From patchwork Tue Oct 4 12:53:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vivekanandan, Balasubramani" X-Patchwork-Id: 12998270 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53877C433F5 for ; Tue, 4 Oct 2022 12:54:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 017A310E5E1; Tue, 4 Oct 2022 12:54:10 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id C0AA810E5E1 for ; Tue, 4 Oct 2022 12:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664888044; x=1696424044; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=pRHK5vO/PwOmhnsvMWUiYBRyxrfj8LiJrAN6K1wdhIU=; b=JfOKTKoqDM1tzFLRvXA4HIbq5oyoTvytP7GDq9G0zaRaYH2YUTAOr+YR CtOUMorkNmw6GMzPXq/qwbY1sePnWu0vz9ebyO/qw3d+iNmnjURUn0OU6 dCAwaTV/icxX69mRUzv3o0yzO3uAJoCXPo7/JtjQ0yzNv4J410nT49DAv 07TH9so+DiF2R4XdYNFYtI9zvIX+2ZAxlTrZdkEx0boDoMbzoL1uFYu8y 13W/7v+vDao0DjutBr1Qw1srXX4PH6D/pmqnhNvd8tZUSv1hrt4Geh4TC Jio27a5mYznXTaWAsiNYpbml5OOrGXsflfppn1c3FjG3q0fckxZPUGZNs A==; X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="301620644" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="301620644" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2022 05:54:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="692478092" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="692478092" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 04 Oct 2022 05:54:04 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:03 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 4 Oct 2022 05:54:03 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yk0H3VXf8aEQAQFP9gN1wGK76GevpNDCnRmFxTDRTJ4qdJsYyJF6aHFKbShjjxbj7viy8aOsjJSoOXN36uzs8P+KnrzCFZyIWsUukbpp0MQa4kSyvzIJtX4r5hV9gbWF71vIryvxSFvm6y24KMBUIjTGxCrdSK8QlaLzkX4H1lwVVNLJiR6R9I9B+S9C06cSE7AHD6fdDLIzN3vvqRmezYrNK3wE2TfNsOhWm0XPfqgAV6bjg10EgDS8dQUi3oITSGog4/9SHFe0Rp9OJwA52LyWx4vxotzQ/5f8WUIpa22FE4wzlCNej7GAOITr5AtpJKdfQetEci1fNtCzrrsMuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KhmdwEkC3ReYFZupqGWRqjCzUKtdikn44PGDSRK/+ng=; b=Q1Z4gAK5tFAizqgm/z2ESVBpMWWeY2nbO7qIp8nVlM3OV3erYokUXr/ePTi8UZM7wvKi2cCfqI/h2GGbuG+1ak3SolbuJtLZBW5zPRlDqVv+CE4hYQBv7MHFBkZp4DrE/xXSLl9mus75B6f+eeN2F91DdE9X97RCnmMy4oz9PPviLLaPvMDrvosXdDDBeH85KzBYqVzZl0BDO8wWUZAHUMwDvqWEychVPVi9MJBm6/mQ0zIfefeBok62Vr/XLc8O98o5sKJttIEvEdqs6fKDA43+XLHNVGS7EHc6NLcMEKGFFF3kxMUJp31wyueEXgbvKHY1qPM80YQdm6rZALiesg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) by MN2PR11MB4645.namprd11.prod.outlook.com (2603:10b6:208:269::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Tue, 4 Oct 2022 12:54:01 +0000 Received: from DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67]) by DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67%3]) with mapi id 15.20.5676.031; Tue, 4 Oct 2022 12:54:01 +0000 From: Balasubramani Vivekanandan To: Date: Tue, 4 Oct 2022 18:23:38 +0530 Message-ID: <20221004125344.228294-2-balasubramani.vivekanandan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> References: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> X-ClientProxiedBy: PN3PR01CA0034.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:97::6) To DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR11MB1897:EE_|MN2PR11MB4645:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e1df0c8-c0b3-4286-4311-08daa6078287 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3TmVuYJ8CoqaB3ibV6N9nIVa2wLCt7PdoPLBetA5qu1JDYlXjXLoNr/KmJDM2EQp++SDL6ueFSGy6Yf0j1N2nLZZWL2wxGPWYeqfKOfEk+yVhMadqQFegQE3rHGiSNXJmT1YDF03fG+6kd5OsMCLTQL4ampCguEdUDPXgGnbt41sJHW9fLyurnJdwzVqxCY+gw2pcvCcjsx8eIuwhm2/Na+FhHVv8q+SUsCjUMOBmBQDN6Kf9NLAlHOuUpe1D2n4m7Xdpa1HLGGvXtkS3OpDOFu3b7mH3tExEzotLmENtf/1OfSzbjWg7y+MhthaMrIVzM0KL+sSIA9UsBegLx4pTYiejLiU7QLMVzVwdCRfvteM6r0QbOcnYiUnL2ZqgWk7HI3O/93ASeyLstx5Fo2O/tS77ZOQJGxnjGjqS2L0BwJ0VEekzttHk+QzCy88W4pXBtBsQ5GAniavRpFEJq7Yctz1DI1CWzrzPYu2pP2J2clQ9mDRKUL1hQBp++oZAuq1DS3bCV6JHqzbnGST6RZroeVA6VgzIGDDM7XltcIn9pim0/pTFMhOXKal0Gd7CfDMZVc318Fv6/pgYQOWGEZTG4o4fIOPvDvbtqYr8xYT43AjdVOFVmfpwgOdPB0oVeRrGUrL0FfUzj4VKh+9QO+LTPvgholE5pvDaIdu0HOyFCKStUBhkmfEk7CiFW4VcpTNfeYoLrED3dY76lajvVyGIA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1897.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(346002)(396003)(136003)(366004)(39860400002)(451199015)(2906002)(38100700002)(30864003)(44832011)(478600001)(82960400001)(36756003)(86362001)(66556008)(83380400001)(6506007)(2616005)(6486002)(6666004)(26005)(6512007)(186003)(8676002)(4326008)(54906003)(5660300002)(41300700001)(1076003)(66476007)(8936002)(66946007)(316002)(6916009); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UBksgLblfnIpElQOrXEeb7ZEHXEI9LZPsf9eJrc4p/WsTvr5XH/YTT2TY7ip/DKirCC+JF9mjeGpIyViQdil8rWfLiwgFKNPyhZQqYzRvxFCen9GwYEJdwLy09LaV1KBKDSvn6dzPvl5CjdrqY50TA3u9fa3BijAvaAqP+LEy4B4YDxX4vs77rVK8XEDMw9lRvCDtsXI1u8JB/HvhOwkI868RLPG6o9AFYWHgFFt6q6EaWj6KFcRvNyirnEYGiPHcyOLrHNMAdT0zrEqcD9FXasG6kljPXYd6/+XvXvbJxLc6uqaeUL0Qyc/0LMnfrt5iM++FqWkABvZUQRaTHay6rcvhgjwLHhyCFB4dL67oD0MwnWFNHQawivhsStDZzxgqqRfTD606IABpAYpibNbjZaToRPtOs/tjGnUevZVNFJgUOecBUTz/VeSR85oChlgJeyfhMHZS99mcmcW4oC5ry3SJeJUOuu2YBW0nvxy6b2h36OU8BUppIWijOIcrZ4y7KdXk9uWYowdGxMSr6QgDHOP6wUSma0yaxYCWaJKRpkvtx8o+S21n66crRZ/1fxshzt427ZAKCwSdaN4PZF8AeX3UMfZmPyL1qiZnEq6Y+kO5m3qPGcP/PgRlnUesm58StlHhUKl3HtRRhS3iWkSFxnZfBlYKAb2kDi/7mzY2Coj2H0hXD03QvuPW7Fu70gtcsXOsa5EQyznRkBxgqz/+B1FBHPbjFZts2toSN2wcHoAB/wI9tuGz9lpdT2YmrGblLCzWgG8blN1t/fRr1RKkYqMFFqfgo6Xoz9LQ2rd1F4Lg8Piro0hUHhiMnd1DO5K+68kqS45vCOzOBeaWoUVrhTkM9uPzZm1J7vskFl1MWBPlWJCd36omgPCCdvwWyLNqViddDgIbJmeQNJeNxMBGkFkdO5HvG6bzKABCkaagXJEN93YXZMUqjgLXsAqJ5DGxhAx/gWxsSikB585ODzruYmi3YRq02/UCGuEAhY9rGsmoiD9eTFj25pR/f6QvO+72R99J1k/6DXOoXG1s3HKDTBnj0HTINHBIfhG7M1wlR2CtIuF0pPr3trq3lw7kGvZvbNDW50FD/ciRzoA1mYIpl29GypA/GoPc7+bhz4tFTA7yhTD15MpvGgflnEb9Q86yAj3OgQRD3AAZQOR0F74ysCDTRT0+PAma1s2HuQ2CodakLnNH9DEpZrbM6UxBVoAaGvIE8LIkvkyAKhtsLipCwKuJztfHHAlP8ChXsyby35PA2MqcuBzyl5fLgF/rcyowvxhe1dli9hTK8VoeANfAWgJCfK3XOJ0C2Pdiya7sdYvbd7BN18QUmqoOmRF0yVxt2qxZLusZbza+VgGH+yKtGm1MpApkwplYr4e4lb6snV+y3VTy98aSvJQnIZvVsNdOxPmQQ3t9akz5ZRdry16FFfsGXoPMhOH8/vUFE5PnOrbb8NI1ssNS0IfQj5wGelfxAU9P1gDk9B8HfUdFj5NhS8XDR822ZvWW28L7pQoiJiPrsLNbluVbre2AsVZUQLudoGuP0+NhaoKZ0hcA8MzJRYv4C2MHHVLU9UbWEq5eqJVaPpnBy9Ysi3JzMuRiXBXqOvV5brlKHNIEgZNlcUNYUPOqOTIu/8uNBITKjTtTOg= X-MS-Exchange-CrossTenant-Network-Message-Id: 8e1df0c8-c0b3-4286-4311-08daa6078287 X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1897.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 12:54:01.4824 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Bio+lbVEUq0K/SR2Q13Fv+edGAYD4PACPvr72N+A+mKR7bThRhoRYJjGCfAu2+T4msMSp29VV7usV8Nqw+rhiWydcQ23VD7fJs+EeUdD5mBeQjA8WcOIlJthm9gjKWwE X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4645 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH v6 1/7] drm/i915/display: Pass struct drm_i915_private to DDI_BUF_CTL macro X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This is a prep patch for a patch series in which register offset of the DDI ports are not calculated using the port enums but using a different datastructure part of the device info. So the device info is passed as a parameter to the macro DDI_BUF_CTL but unused yet. Signed-off-by: Balasubramani Vivekanandan --- drivers/gpu/drm/i915/display/icl_dsi.c | 12 +++--- drivers/gpu/drm/i915/display/intel_ddi.c | 39 +++++++++++--------- drivers/gpu/drm/i915/display/intel_display.c | 6 ++- drivers/gpu/drm/i915/display/intel_fdi.c | 14 +++---- drivers/gpu/drm/i915/display/intel_tc.c | 6 +-- drivers/gpu/drm/i915/gvt/display.c | 30 +++++++-------- drivers/gpu/drm/i915/gvt/handlers.c | 17 +++++---- drivers/gpu/drm/i915/i915_reg.h | 6 ++- drivers/gpu/drm/i915/intel_gvt_mmio_table.c | 10 ++--- 9 files changed, 76 insertions(+), 64 deletions(-) diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 47f13750f6fa..f7c1f6561423 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -548,11 +548,11 @@ static void gen11_dsi_enable_ddi_buffer(struct intel_encoder *encoder) enum port port; for_each_dsi_port(port, intel_dsi->ports) { - tmp = intel_de_read(dev_priv, DDI_BUF_CTL(port)); + tmp = intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)); tmp |= DDI_BUF_CTL_ENABLE; - intel_de_write(dev_priv, DDI_BUF_CTL(port), tmp); + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, port), tmp); - if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) & + if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)) & DDI_BUF_IS_IDLE), 500)) drm_err(&dev_priv->drm, "DDI port:%c buffer idle\n", @@ -1400,11 +1400,11 @@ static void gen11_dsi_disable_port(struct intel_encoder *encoder) gen11_dsi_ungate_clocks(encoder); for_each_dsi_port(port, intel_dsi->ports) { - tmp = intel_de_read(dev_priv, DDI_BUF_CTL(port)); + tmp = intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)); tmp &= ~DDI_BUF_CTL_ENABLE; - intel_de_write(dev_priv, DDI_BUF_CTL(port), tmp); + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, port), tmp); - if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(port)) & + if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)) & DDI_BUF_IS_IDLE), 8)) drm_err(&dev_priv->drm, diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 971356237eca..77a986696c76 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -172,7 +172,7 @@ void intel_wait_ddi_buf_idle(struct drm_i915_private *dev_priv, return; } - if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(port)) & + if (wait_for_us((intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)) & DDI_BUF_IS_IDLE), 8)) drm_err(&dev_priv->drm, "Timeout waiting for DDI BUF %c to get idle\n", port_name(port)); @@ -189,7 +189,7 @@ static void intel_wait_ddi_buf_active(struct drm_i915_private *dev_priv, return; } - ret = _wait_for(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) & + ret = _wait_for(!(intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)) & DDI_BUF_IS_IDLE), IS_DG2(dev_priv) ? 1200 : 500, 10, 10); if (ret) @@ -730,7 +730,7 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder, if (!wakeref) return; - tmp = intel_de_read(dev_priv, DDI_BUF_CTL(port)); + tmp = intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)); if (!(tmp & DDI_BUF_CTL_ENABLE)) goto out; @@ -1397,8 +1397,8 @@ hsw_set_signal_levels(struct intel_encoder *encoder, intel_dp->DP &= ~DDI_BUF_EMP_MASK; intel_dp->DP |= signal_levels; - intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP); - intel_de_posting_read(dev_priv, DDI_BUF_CTL(port)); + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, port), intel_dp->DP); + intel_de_posting_read(dev_priv, DDI_BUF_CTL(dev_priv, port)); } static void _icl_ddi_enable_clock(struct drm_i915_private *i915, i915_reg_t reg, @@ -2577,10 +2577,10 @@ static void intel_disable_ddi_buf(struct intel_encoder *encoder, bool wait = false; u32 val; - val = intel_de_read(dev_priv, DDI_BUF_CTL(port)); + val = intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)); if (val & DDI_BUF_CTL_ENABLE) { val &= ~DDI_BUF_CTL_ENABLE; - intel_de_write(dev_priv, DDI_BUF_CTL(port), val); + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, port), val); wait = true; } @@ -2909,7 +2909,7 @@ static void intel_enable_ddi_hdmi(struct intel_atomic_state *state, drm_WARN_ON(&dev_priv->drm, !intel_tc_port_in_legacy_mode(dig_port)); buf_ctl |= DDI_BUF_CTL_TC_PHY_OWNERSHIP; } - intel_de_write(dev_priv, DDI_BUF_CTL(port), buf_ctl); + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, port), buf_ctl); intel_audio_codec_enable(encoder, crtc_state, conn_state); } @@ -3113,9 +3113,9 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp, dp_tp_ctl = intel_de_read(dev_priv, dp_tp_ctl_reg(encoder, crtc_state)); if (dp_tp_ctl & DP_TP_CTL_ENABLE) { - ddi_buf_ctl = intel_de_read(dev_priv, DDI_BUF_CTL(port)); + ddi_buf_ctl = intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)); if (ddi_buf_ctl & DDI_BUF_CTL_ENABLE) { - intel_de_write(dev_priv, DDI_BUF_CTL(port), + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, port), ddi_buf_ctl & ~DDI_BUF_CTL_ENABLE); wait = true; } @@ -3145,8 +3145,8 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp, adlp_tbt_to_dp_alt_switch_wa(encoder); intel_dp->DP |= DDI_BUF_CTL_ENABLE; - intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP); - intel_de_posting_read(dev_priv, DDI_BUF_CTL(port)); + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, port), intel_dp->DP); + intel_de_posting_read(dev_priv, DDI_BUF_CTL(dev_priv, port)); intel_wait_ddi_buf_active(dev_priv, port); } @@ -3823,13 +3823,15 @@ static struct intel_connector * intel_ddi_init_dp_connector(struct intel_digital_port *dig_port) { struct intel_connector *connector; - enum port port = dig_port->base.port; + struct intel_encoder *encoder = &dig_port->base; + enum port port = encoder->port; + struct drm_i915_private *i915 = to_i915(encoder->base.dev); connector = intel_connector_alloc(); if (!connector) return NULL; - dig_port->dp.output_reg = DDI_BUF_CTL(port); + dig_port->dp.output_reg = DDI_BUF_CTL(i915, port); dig_port->dp.prepare_link_retrain = intel_ddi_prepare_link_retrain; dig_port->dp.set_link_train = intel_ddi_set_link_train; dig_port->dp.set_idle_link_train = intel_ddi_set_idle_link_train; @@ -4061,12 +4063,13 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port *dig_port) { struct intel_connector *connector; enum port port = dig_port->base.port; + struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev); connector = intel_connector_alloc(); if (!connector) return NULL; - dig_port->hdmi.hdmi_reg = DDI_BUF_CTL(port); + dig_port->hdmi.hdmi_reg = DDI_BUF_CTL(dev_priv, port); intel_hdmi_init_connector(dig_port, connector); return connector; @@ -4102,7 +4105,7 @@ intel_ddi_max_lanes(struct intel_digital_port *dig_port) return max_lanes; if (port == PORT_A || port == PORT_E) { - if (intel_de_read(dev_priv, DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) + if (intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, PORT_A)) & DDI_A_4_LANES) max_lanes = port == PORT_A ? 4 : 0; else /* Both A and E share 2 lanes */ @@ -4464,11 +4467,11 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) if (DISPLAY_VER(dev_priv) >= 11) dig_port->saved_port_bits = - intel_de_read(dev_priv, DDI_BUF_CTL(port)) + intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)) & DDI_BUF_PORT_REVERSAL; else dig_port->saved_port_bits = - intel_de_read(dev_priv, DDI_BUF_CTL(port)) + intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, port)) & (DDI_BUF_PORT_REVERSAL | DDI_A_4_LANES); if (intel_bios_is_lane_reversal_needed(dev_priv, port)) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 3ffd8fc0b05c..8681055843f0 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -7884,7 +7884,7 @@ static bool intel_ddi_crt_present(struct drm_i915_private *dev_priv) return false; /* DDI E can't be used if DDI A requires 4 lanes */ - if (intel_de_read(dev_priv, DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) + if (intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, PORT_A)) & DDI_A_4_LANES) return false; if (!dev_priv->display.vbt.int_crt_support) @@ -7970,7 +7970,9 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv) intel_crt_init(dev_priv); /* Haswell uses DDI functions to detect digital outputs. */ - found = intel_de_read(dev_priv, DDI_BUF_CTL(PORT_A)) & DDI_INIT_DISPLAY_DETECTED; + found = intel_de_read(dev_priv, + DDI_BUF_CTL(dev_priv, PORT_A)) & + DDI_INIT_DISPLAY_DETECTED; if (found) intel_ddi_init(dev_priv, PORT_A); diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c index 7f47e5c85c81..d3d92ac26099 100644 --- a/drivers/gpu/drm/i915/display/intel_fdi.c +++ b/drivers/gpu/drm/i915/display/intel_fdi.c @@ -818,9 +818,9 @@ void hsw_fdi_link_train(struct intel_encoder *encoder, * DDI E does not support port reversal, the functionality is * achieved on the PCH side in FDI_RX_CTL, so no need to set the * port reversal bit */ - intel_de_write(dev_priv, DDI_BUF_CTL(PORT_E), + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, PORT_E), DDI_BUF_CTL_ENABLE | ((crtc_state->fdi_lanes - 1) << 1) | DDI_BUF_TRANS_SELECT(i / 2)); - intel_de_posting_read(dev_priv, DDI_BUF_CTL(PORT_E)); + intel_de_posting_read(dev_priv, DDI_BUF_CTL(dev_priv, PORT_E)); udelay(600); @@ -864,10 +864,10 @@ void hsw_fdi_link_train(struct intel_encoder *encoder, intel_de_write(dev_priv, FDI_RX_CTL(PIPE_A), rx_ctl_val); intel_de_posting_read(dev_priv, FDI_RX_CTL(PIPE_A)); - temp = intel_de_read(dev_priv, DDI_BUF_CTL(PORT_E)); + temp = intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, PORT_E)); temp &= ~DDI_BUF_CTL_ENABLE; - intel_de_write(dev_priv, DDI_BUF_CTL(PORT_E), temp); - intel_de_posting_read(dev_priv, DDI_BUF_CTL(PORT_E)); + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, PORT_E), temp); + intel_de_posting_read(dev_priv, DDI_BUF_CTL(dev_priv, PORT_E)); /* Disable DP_TP_CTL and FDI_RX_CTL and retry */ temp = intel_de_read(dev_priv, DP_TP_CTL(PORT_E)); @@ -909,9 +909,9 @@ void hsw_fdi_disable(struct intel_encoder *encoder) val &= ~FDI_RX_ENABLE; intel_de_write(dev_priv, FDI_RX_CTL(PIPE_A), val); - val = intel_de_read(dev_priv, DDI_BUF_CTL(PORT_E)); + val = intel_de_read(dev_priv, DDI_BUF_CTL(dev_priv, PORT_E)); val &= ~DDI_BUF_CTL_ENABLE; - intel_de_write(dev_priv, DDI_BUF_CTL(PORT_E), val); + intel_de_write(dev_priv, DDI_BUF_CTL(dev_priv, PORT_E), val); intel_wait_ddi_buf_idle(dev_priv, PORT_E); diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c index b0aa1edd8302..a308665340d4 100644 --- a/drivers/gpu/drm/i915/display/intel_tc.c +++ b/drivers/gpu/drm/i915/display/intel_tc.c @@ -410,12 +410,12 @@ static bool adl_tc_phy_take_ownership(struct intel_digital_port *dig_port, enum port port = dig_port->base.port; u32 val; - val = intel_uncore_read(uncore, DDI_BUF_CTL(port)); + val = intel_uncore_read(uncore, DDI_BUF_CTL(i915, port)); if (take) val |= DDI_BUF_CTL_TC_PHY_OWNERSHIP; else val &= ~DDI_BUF_CTL_TC_PHY_OWNERSHIP; - intel_uncore_write(uncore, DDI_BUF_CTL(port), val); + intel_uncore_write(uncore, DDI_BUF_CTL(i915, port), val); return true; } @@ -455,7 +455,7 @@ static bool adl_tc_phy_is_owned(struct intel_digital_port *dig_port) enum port port = dig_port->base.port; u32 val; - val = intel_uncore_read(uncore, DDI_BUF_CTL(port)); + val = intel_uncore_read(uncore, DDI_BUF_CTL(i915, port)); return val & DDI_BUF_CTL_TC_PHY_OWNERSHIP; } diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/display.c index c7722c818b4d..5e3cd306c41d 100644 --- a/drivers/gpu/drm/i915/gvt/display.c +++ b/drivers/gpu/drm/i915/gvt/display.c @@ -213,10 +213,10 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) PORT_PLL_REF_SEL | PORT_PLL_LOCK | PORT_PLL_ENABLE); - vgpu_vreg_t(vgpu, DDI_BUF_CTL(port)) &= + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, port)) &= ~(DDI_INIT_DISPLAY_DETECTED | DDI_BUF_CTL_ENABLE); - vgpu_vreg_t(vgpu, DDI_BUF_CTL(port)) |= DDI_BUF_IS_IDLE; + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, port)) |= DDI_BUF_IS_IDLE; } vgpu_vreg_t(vgpu, PCH_PORT_HOTPLUG) &= ~(PORTA_HOTPLUG_ENABLE | PORTA_HOTPLUG_STATUS_MASK); @@ -276,9 +276,9 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) (PORT_PLL_POWER_STATE | PORT_PLL_POWER_ENABLE | PORT_PLL_REF_SEL | PORT_PLL_LOCK | PORT_PLL_ENABLE); - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_A)) |= + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_A)) |= (DDI_BUF_CTL_ENABLE | DDI_INIT_DISPLAY_DETECTED); - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_A)) &= + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_A)) &= ~DDI_BUF_IS_IDLE; vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_EDP)) |= (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | @@ -305,9 +305,9 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) (PORT_PLL_POWER_STATE | PORT_PLL_POWER_ENABLE | PORT_PLL_REF_SEL | PORT_PLL_LOCK | PORT_PLL_ENABLE); - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_B)) |= + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_B)) |= DDI_BUF_CTL_ENABLE; - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_B)) &= + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_B)) &= ~DDI_BUF_IS_IDLE; vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | @@ -335,9 +335,9 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) (PORT_PLL_POWER_STATE | PORT_PLL_POWER_ENABLE | PORT_PLL_REF_SEL | PORT_PLL_LOCK | PORT_PLL_ENABLE); - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_C)) |= + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_C)) |= DDI_BUF_CTL_ENABLE; - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_C)) &= + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_C)) &= ~DDI_BUF_IS_IDLE; vgpu_vreg_t(vgpu, TRANS_DDI_FUNC_CTL(TRANSCODER_A)) |= (TRANS_DDI_BPC_8 | TRANS_DDI_MODE_SELECT_DP_SST | @@ -416,8 +416,8 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) vgpu_vreg_t(vgpu, PORT_CLK_SEL(PORT_B)) |= PORT_CLK_SEL_LCPLL_810; } - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_B)) |= DDI_BUF_CTL_ENABLE; - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_B)) &= ~DDI_BUF_IS_IDLE; + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_B)) |= DDI_BUF_CTL_ENABLE; + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_B)) &= ~DDI_BUF_IS_IDLE; vgpu_vreg_t(vgpu, SDEISR) |= SDE_PORTB_HOTPLUG_CPT; } @@ -442,8 +442,8 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) vgpu_vreg_t(vgpu, PORT_CLK_SEL(PORT_C)) |= PORT_CLK_SEL_LCPLL_810; } - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_C)) |= DDI_BUF_CTL_ENABLE; - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_C)) &= ~DDI_BUF_IS_IDLE; + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_C)) |= DDI_BUF_CTL_ENABLE; + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_C)) &= ~DDI_BUF_IS_IDLE; vgpu_vreg_t(vgpu, SFUSE_STRAP) |= SFUSE_STRAP_DDIC_DETECTED; } @@ -468,8 +468,8 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) vgpu_vreg_t(vgpu, PORT_CLK_SEL(PORT_D)) |= PORT_CLK_SEL_LCPLL_810; } - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_D)) |= DDI_BUF_CTL_ENABLE; - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_D)) &= ~DDI_BUF_IS_IDLE; + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_D)) |= DDI_BUF_CTL_ENABLE; + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_D)) &= ~DDI_BUF_IS_IDLE; vgpu_vreg_t(vgpu, SFUSE_STRAP) |= SFUSE_STRAP_DDID_DETECTED; } @@ -488,7 +488,7 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) else vgpu_vreg_t(vgpu, SDEISR) |= SDE_PORTA_HOTPLUG_SPT; - vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_A)) |= DDI_INIT_DISPLAY_DETECTED; + vgpu_vreg_t(vgpu, DDI_BUF_CTL(dev_priv, PORT_A)) |= DDI_INIT_DISPLAY_DETECTED; } /* Clear host CRT status, so guest couldn't detect this host CRT. */ diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c index daac2050d77d..15393c861721 100644 --- a/drivers/gpu/drm/i915/gvt/handlers.c +++ b/drivers/gpu/drm/i915/gvt/handlers.c @@ -787,13 +787,15 @@ static int force_nonpriv_write(struct intel_vgpu *vgpu, static int ddi_buf_ctl_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, void *p_data, unsigned int bytes) { + struct drm_i915_private *i915 = vgpu->gvt->gt->i915; + write_vreg(vgpu, offset, p_data, bytes); if (vgpu_vreg(vgpu, offset) & DDI_BUF_CTL_ENABLE) { vgpu_vreg(vgpu, offset) &= ~DDI_BUF_IS_IDLE; } else { vgpu_vreg(vgpu, offset) |= DDI_BUF_IS_IDLE; - if (offset == i915_mmio_reg_offset(DDI_BUF_CTL(PORT_E))) + if (offset == i915_mmio_reg_offset(DDI_BUF_CTL(i915, PORT_E))) vgpu_vreg_t(vgpu, DP_TP_STATUS(PORT_E)) &= ~DP_TP_STATUS_AUTOTRAIN_DONE; } @@ -812,7 +814,8 @@ static int fdi_rx_iir_mmio_write(struct intel_vgpu *vgpu, static int fdi_auto_training_started(struct intel_vgpu *vgpu) { - u32 ddi_buf_ctl = vgpu_vreg_t(vgpu, DDI_BUF_CTL(PORT_E)); + struct drm_i915_private *i915 = vgpu->gvt->gt->i915; + u32 ddi_buf_ctl = vgpu_vreg_t(vgpu, DDI_BUF_CTL(i915, PORT_E)); u32 rx_ctl = vgpu_vreg(vgpu, _FDI_RXA_CTL); u32 tx_ctl = vgpu_vreg_t(vgpu, DP_TP_CTL(PORT_E)); @@ -2333,11 +2336,11 @@ static int init_generic_mmio_info(struct intel_gvt *gvt) MMIO_F(_MMIO(_DPA_AUX_CH_CTL), 6 * 4, 0, 0, 0, D_ALL, NULL, dp_aux_ch_ctl_mmio_write); - MMIO_DH(DDI_BUF_CTL(PORT_A), D_ALL, NULL, ddi_buf_ctl_mmio_write); - MMIO_DH(DDI_BUF_CTL(PORT_B), D_ALL, NULL, ddi_buf_ctl_mmio_write); - MMIO_DH(DDI_BUF_CTL(PORT_C), D_ALL, NULL, ddi_buf_ctl_mmio_write); - MMIO_DH(DDI_BUF_CTL(PORT_D), D_ALL, NULL, ddi_buf_ctl_mmio_write); - MMIO_DH(DDI_BUF_CTL(PORT_E), D_ALL, NULL, ddi_buf_ctl_mmio_write); + MMIO_DH(DDI_BUF_CTL(dev_priv, PORT_A), D_ALL, NULL, ddi_buf_ctl_mmio_write); + MMIO_DH(DDI_BUF_CTL(dev_priv, PORT_B), D_ALL, NULL, ddi_buf_ctl_mmio_write); + MMIO_DH(DDI_BUF_CTL(dev_priv, PORT_C), D_ALL, NULL, ddi_buf_ctl_mmio_write); + MMIO_DH(DDI_BUF_CTL(dev_priv, PORT_D), D_ALL, NULL, ddi_buf_ctl_mmio_write); + MMIO_DH(DDI_BUF_CTL(dev_priv, PORT_E), D_ALL, NULL, ddi_buf_ctl_mmio_write); MMIO_DH(DP_TP_CTL(PORT_A), D_ALL, NULL, dp_tp_ctl_mmio_write); MMIO_DH(DP_TP_CTL(PORT_B), D_ALL, NULL, dp_tp_ctl_mmio_write); diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 2126e441199d..a91bbc6e1255 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -6936,7 +6936,11 @@ enum skl_power_gate { /* DDI Buffer Control */ #define _DDI_BUF_CTL_A 0x64000 #define _DDI_BUF_CTL_B 0x64100 -#define DDI_BUF_CTL(port) _MMIO_PORT(port, _DDI_BUF_CTL_A, _DDI_BUF_CTL_B) +#define DDI_BUF_CTL(i915, port) ({ \ + (void)i915; /* Suppress unused variable warning */ \ + _MMIO_PORT(port, _DDI_BUF_CTL_A, _DDI_BUF_CTL_B); \ + }) + #define DDI_BUF_CTL_ENABLE (1 << 31) #define DDI_BUF_TRANS_SELECT(n) ((n) << 24) #define DDI_BUF_EMP_MASK (0xf << 24) diff --git a/drivers/gpu/drm/i915/intel_gvt_mmio_table.c b/drivers/gpu/drm/i915/intel_gvt_mmio_table.c index 8279dc580a3e..b55bdc2cdd84 100644 --- a/drivers/gpu/drm/i915/intel_gvt_mmio_table.c +++ b/drivers/gpu/drm/i915/intel_gvt_mmio_table.c @@ -503,11 +503,11 @@ static int iterate_generic_mmio(struct intel_gvt_mmio_table_iter *iter) MMIO_D(SBI_CTL_STAT); MMIO_D(PIXCLK_GATE); MMIO_F(_MMIO(_DPA_AUX_CH_CTL), 6 * 4); - MMIO_D(DDI_BUF_CTL(PORT_A)); - MMIO_D(DDI_BUF_CTL(PORT_B)); - MMIO_D(DDI_BUF_CTL(PORT_C)); - MMIO_D(DDI_BUF_CTL(PORT_D)); - MMIO_D(DDI_BUF_CTL(PORT_E)); + MMIO_D(DDI_BUF_CTL(dev_priv, PORT_A)); + MMIO_D(DDI_BUF_CTL(dev_priv, PORT_B)); + MMIO_D(DDI_BUF_CTL(dev_priv, PORT_C)); + MMIO_D(DDI_BUF_CTL(dev_priv, PORT_D)); + MMIO_D(DDI_BUF_CTL(dev_priv, PORT_E)); MMIO_D(DP_TP_CTL(PORT_A)); MMIO_D(DP_TP_CTL(PORT_B)); MMIO_D(DP_TP_CTL(PORT_C)); From patchwork Tue Oct 4 12:53:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vivekanandan, Balasubramani" X-Patchwork-Id: 12998271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 647FCC433F5 for ; Tue, 4 Oct 2022 12:54:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 88BA310E5F4; Tue, 4 Oct 2022 12:54:22 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id C394010E62A for ; Tue, 4 Oct 2022 12:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664888059; x=1696424059; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=Yc/GUEpZydBZ7pwAHgwB5emfOno2c17NHzSRPUnxEfs=; b=SQeEPkcqSImZRVUUFNwuirmyEG/V16hKoXnybxQyYhHCxy+Ib3X8W2U9 Eqdw0e+W7FHaxRJEq2XHpHQBL3B5lX0nErZBGdjQ4XU8TQjtLbY7CuD1r gg6mIM5TKzOIBs8MoOVlANAgwCqLnku+d2bM4vIWo6dNtee3Ng73b3sZ0 p65xBXStzg0gHdf0wxPaKC6YME9wHE6l7CyLNDar88Ex6nbrtgUTzCar1 4U1TBqvzek9TnYw8SW/7uiJSzKQZhAcRFg8PaIm7zG02wNOyzVKPlMkvg 2KvmZLw8O0DEzODsIf7XW+Oy/t3kzAYpbh3xhdofRErJbGyTc3qyMgWMR w==; X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="300501744" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="300501744" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2022 05:54:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="619093339" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="619093339" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga007.jf.intel.com with ESMTP; 04 Oct 2022 05:54:18 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:18 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:17 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 4 Oct 2022 05:54:17 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.40) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GNGQ+bgu27LsMZxoOai326ED6AEoDlEBnJpbljP2gCi4k6ud6RHXLYfieo79+4J4qfIoiY56L9IyvEQ+ZxzRsMTdZecxcc9Gk+ppdAlIFAL1jyaub2srl75vyG9Xfk90ud5vGyis1NWYm6UbNeudIHxIjSvFB7Rw+jJqqUYPFvmFKXuZKBA20KmN4dvibv6ydrpoekGoaluSLtLjJqKUo0bj0CBa/6YjJ+2wKfAEWt7kXGVhALo3h0BUdiGLQ5czNRnjXQ0naJNUK2/T81x1gIPu3eYD1nBPFtNx3t80QsDhtz54MqstWzRhmyy7BDagMz8M6wG1TFq8X8IPI6I6zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NV4dgGmsQlfAPf7NNyNMGP4/cZvb0EgFzwpiLBbqccc=; b=ccsr0XuVDhPB5vFQKmlevp4sBwDtfv2K2zqS7njUOTV20/rKLnJKByVzbug2cmY/35vTUCrV11nBiXec8BF433Sw1s7DsO/KTkJCy/ZGq/gsS6PUQX8ivs+yi+ynMYRQU0CxS52nwbRSw/woDpXe8qvI1tn2rfz7AmY0bQkZ5PCZFomZ0qUwoNGIfGi6AXJ5D6C99zYzvS1btGYX1Xrqp2/4QHjrHZNERSw5E5ARkHe5KL84m6dg+CURJhO+srUmQHtuxm612peiKd2tzV7K2eLtyn2hjSo+utOG3x6OVHjk/2vYNs7UIMUMuXsG/Q85UdAJtRI2CggNhJW04G2KZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) by PH7PR11MB6053.namprd11.prod.outlook.com (2603:10b6:510:1d1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Tue, 4 Oct 2022 12:54:10 +0000 Received: from DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67]) by DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67%3]) with mapi id 15.20.5676.031; Tue, 4 Oct 2022 12:54:10 +0000 From: Balasubramani Vivekanandan To: Date: Tue, 4 Oct 2022 18:23:39 +0530 Message-ID: <20221004125344.228294-3-balasubramani.vivekanandan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> References: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> X-ClientProxiedBy: PN3PR01CA0129.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:bf::8) To DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR11MB1897:EE_|PH7PR11MB6053:EE_ X-MS-Office365-Filtering-Correlation-Id: e2029ad2-ca4a-4e25-92db-08daa607880a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rq1/zCtHjw5IRO+kwMWVf49weEpbVzozRj09nnb/5bAqmaW/9fQunlrgE+THrYWTaGqlZ3vaNDXYVOgkar6d3iyz+en6KbsGRKG0ufi93fIHIeeMI+qGd2O4zSXtGk3UHKYD1cZXB0Getv1zqMR6NHDFBHuwOIaMAJtYEioPBmSVqt6irNVp9eOeolze7hLZWWVlMl9j2XBDi2cmIJcKLa69gfjQDbEjnUQME9ZskA8o7L31edtuIm53XmZo3px5NxeXaVKNPGmowV01g8JAkMGjXeN7r8/LUeYrkRt7HarN7nK5VxQK06dXxP8q/wdAfLkom0ohog5H2ZUEfItBXHM7i3Nz5rnwnMbgl40sU89URBYuRJy1RQSvvBzAfcW/j6Uiybc9n0aCUYEiWmAN5dpPwRh1r+gp7wdutCilu7og18oxLwEn3sFHO/3CmEqA2Yf817pS04m+QeKn5yxpiNgdOBUC47xU61SYzFuZwN7wNzxTO1ojlh2SnXPLy8/2WRJeHGhj1WBNEfbWxKoOCC1pKKV/vRs593dnEIg4R1YOnvddE8kMuA25/b+IvQkcJWAJykrJuEk5cEcsFAt8shNuyZfIg3ebJYxY3Xu9rem9p6BqlMfJ//q3tGeG8o11lZmdoDA8OVNFr8tfWlHY+M1triWChGXCahEA8YbyRSbNFKWqj08ScI6dt/aK0nLIXl45ZRDkts+o8wYCW8g/CA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1897.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199015)(186003)(38100700002)(6506007)(44832011)(26005)(2616005)(83380400001)(1076003)(82960400001)(5660300002)(2906002)(41300700001)(8936002)(478600001)(6512007)(4326008)(6666004)(8676002)(6486002)(66556008)(66476007)(66946007)(316002)(36756003)(6916009)(54906003)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7TeB1t6oSAVps/4ZIzZ1tnpaSvE5/39GM6XDQgWpGnKpF/ch/Nm2LOBpT8vOqKhhykZeGvbDO8WIYKTrdr2Nb90wZIuwAZQmvYx6nuOVo5Xrvq+5mYTrvvm6buW/w4cryhhf5p7kLolPCpywXbljn1rI8FHtTygzS0cWtY8pETVNg28Cfh9/bH5Iv4qe2YV8cl6UB2EEtaiOUb5TuXs0STLMlvr5NDz7ne9Zfl0QdN3ypgelS5sOAegqS5JEfhBPUf7Ln90c79gBOm/5sWJ+QCv245yQ6m3VxaPD/bZLgWyBBtMhN92c7CuoQYs4UDwtWFSfPTA/PQyW2UnWDPOn5TvUy3l3auJz9q+q5eOFcarRowEcJcmetFneI5tDxbGfUIEfOiqESSVsHpNFyjkE1RfDuHDo7bPA+jZqd0RuCqYnfDwqhlz/TluRvkbKaV6qeLUV/dBGQNJ1t2S7JDbUtn87z6W4lE/aBHhhNUWirDdaxLkwxlutA1/FKMT+HtOYQm052d2xF9k0jszaAsD+uN4Xl83mCuW5WmRB/AKyv//+lmSCDMpswvGSD0m+0cntChklBTiCFAeYWQXZ8kZo48ieqL8jpepT///M7Er5oSc+/KCqAzYA+JfFNqGX+vymfAkCmX1K3pkQJZDQEfLoqZ7foPXyRxv9u8HgWMVH8tXPgICiS4DXoRzFgsZwDQquNXr6QOGCaigfVlt9ktKuE8LLY4bxkFZZ1vzqbebHMNHx56bfSh9UM/UQZTxdUd0KFLKUZFIjwovGBahahNWryLQoQrQNAuvoWkJaIfDlolnjDbwl6RmMIcfeSratVufuvSLcFMnvnHS6Oq4OqyGKpZ9+ZOfmRoBboiT5YHjFwHpVHw4kGUH9xiKmdHDc5Ici7Q4ngxLlvZJyggdF/y4/tp43BcrpiMtPzMz3lfrM0Rp+xcVO9f3aSjpnQGH0n3qqOCtQYQjVC9IB7jo4ut6J82GOW3IRlBdaOvLPMxmjZAdtORqxDOfK6EqJGGMGMRsCoOF7gsDvEQzGIR8b9JZxrwbSWMaFrN73zhZLSJmvHHFvE9zMT9bWvYxoHC10/mU51OoqlRj9mQWv5wF46jvHQ+MzE+O8GHxtkMFFn5TSb6pnH++jnRgeB48ELBUuI0f46njFKyNjI3otu3rn/JQzAOCtIwpFQUy6Gk99tU90jwSDntsfpzeloHs1uFacs6juJUyK3dhtQXKTbNI8UaBIpNzpz3+clSdvUoHbc23adAi3w+zxkAw/5wqfgcrrQfEs53n+GGJ563QULXiTXw/AaG4H2iW+R3F+UYJAN26oWUQPSefhIl6MNVHWgRIFrCmjIvPSD2VW634MgqHN98bI8eB0DmdDz9gA7LyD6fHOVlxpwgUO9mH/rGW5ZSg7VjZ+XjHu4c4+B5vYNBZrelAREJP9pRtsScdodM7bkCSqrfrwL+WCIAjUD/FmkmVLhg6D/kpQE15PimuiZGmqk81QeDVo1ZvW2wToVqP5yMHYJVLBqKuH48dgIOg4XhKNpzR8ZlPJC2mIlEDFCvOKmrlRdXneohbBXuk0Gp675Skw6jdtfZqRsrVbkZU2Yp1TY4vNeqE/zX3rmPlPopu8oDfWpIDAWanagMSdlTXjeuMFUO8= X-MS-Exchange-CrossTenant-Network-Message-Id: e2029ad2-ca4a-4e25-92db-08daa607880a X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1897.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 12:54:10.4816 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UczC7AQtXyKi8w2cohHhTXicmhIY/DZl4mpOFtHytSDN0/5lblONNb4w3wulXAegcWCiaNBayZFQ47hDYbS1gIcq2GaIJboi5ysGR5TzypFqwLJrMAP4+ZltRXQGeRxI X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6053 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH v6 2/7] drm/i915/display: Pass struct drm_i915_private to DDI_CLK_SEL macro X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" DDI_CLK_SEL is an another macro which returns the register offset based on DDI port enum. So DDI_CLK_SEL has to be prepared for the new method being developed for calculating the register offsets of DDI ports. Macro receives i915 private structure as new parameter for the upcoming changes. Signed-off-by: Balasubramani Vivekanandan --- drivers/gpu/drm/i915/display/intel_ddi.c | 17 +++++++++-------- drivers/gpu/drm/i915/i915_reg.h | 5 ++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 77a986696c76..e7beafafb857 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -305,7 +305,8 @@ static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder, static int icl_calc_tbt_pll_link(struct drm_i915_private *dev_priv, enum port port) { - u32 val = intel_de_read(dev_priv, DDI_CLK_SEL(port)) & DDI_CLK_SEL_MASK; + u32 val = intel_de_read(dev_priv, DDI_CLK_SEL(dev_priv, port)) & + DDI_CLK_SEL_MASK; switch (val) { case DDI_CLK_SEL_NONE: @@ -1656,7 +1657,7 @@ static void jsl_ddi_tc_enable_clock(struct intel_encoder *encoder, * "For DDIC and DDID, program DDI_CLK_SEL to map the MG clock to the port. * MG does not exist, but the programming is required to ungate DDIC and DDID." */ - intel_de_write(i915, DDI_CLK_SEL(port), DDI_CLK_SEL_MG); + intel_de_write(i915, DDI_CLK_SEL(i915, port), DDI_CLK_SEL_MG); icl_ddi_combo_enable_clock(encoder, crtc_state); } @@ -1668,7 +1669,7 @@ static void jsl_ddi_tc_disable_clock(struct intel_encoder *encoder) icl_ddi_combo_disable_clock(encoder); - intel_de_write(i915, DDI_CLK_SEL(port), DDI_CLK_SEL_NONE); + intel_de_write(i915, DDI_CLK_SEL(i915, port), DDI_CLK_SEL_NONE); } static bool jsl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder) @@ -1677,7 +1678,7 @@ static bool jsl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder) enum port port = encoder->port; u32 tmp; - tmp = intel_de_read(i915, DDI_CLK_SEL(port)); + tmp = intel_de_read(i915, DDI_CLK_SEL(i915, port)); if ((tmp & DDI_CLK_SEL_MASK) == DDI_CLK_SEL_NONE) return false; @@ -1696,7 +1697,7 @@ static void icl_ddi_tc_enable_clock(struct intel_encoder *encoder, if (drm_WARN_ON(&i915->drm, !pll)) return; - intel_de_write(i915, DDI_CLK_SEL(port), + intel_de_write(i915, DDI_CLK_SEL(i915, port), icl_pll_to_ddi_clk_sel(encoder, crtc_state)); mutex_lock(&i915->display.dpll.lock); @@ -1720,7 +1721,7 @@ static void icl_ddi_tc_disable_clock(struct intel_encoder *encoder) mutex_unlock(&i915->display.dpll.lock); - intel_de_write(i915, DDI_CLK_SEL(port), DDI_CLK_SEL_NONE); + intel_de_write(i915, DDI_CLK_SEL(i915, port), DDI_CLK_SEL_NONE); } static bool icl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder) @@ -1730,7 +1731,7 @@ static bool icl_ddi_tc_is_clock_enabled(struct intel_encoder *encoder) enum port port = encoder->port; u32 tmp; - tmp = intel_de_read(i915, DDI_CLK_SEL(port)); + tmp = intel_de_read(i915, DDI_CLK_SEL(i915, port)); if ((tmp & DDI_CLK_SEL_MASK) == DDI_CLK_SEL_NONE) return false; @@ -1748,7 +1749,7 @@ static struct intel_shared_dpll *icl_ddi_tc_get_pll(struct intel_encoder *encode enum intel_dpll_id id; u32 tmp; - tmp = intel_de_read(i915, DDI_CLK_SEL(port)); + tmp = intel_de_read(i915, DDI_CLK_SEL(i915, port)); switch (tmp & DDI_CLK_SEL_MASK) { case DDI_CLK_SEL_TBT_162: diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index a91bbc6e1255..acb764755338 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -7075,7 +7075,10 @@ enum skl_power_gate { #define PORT_CLK_SEL_NONE REG_FIELD_PREP(PORT_CLK_SEL_MASK, 7) /* On ICL+ this is the same as PORT_CLK_SEL, but all bits change. */ -#define DDI_CLK_SEL(port) PORT_CLK_SEL(port) +#define DDI_CLK_SEL(i915, port) ({ \ + (void)i915; /* Suppress unused variable warning */ \ + PORT_CLK_SEL(port); \ + }) #define DDI_CLK_SEL_MASK REG_GENMASK(31, 28) #define DDI_CLK_SEL_NONE REG_FIELD_PREP(DDI_CLK_SEL_MASK, 0x0) #define DDI_CLK_SEL_MG REG_FIELD_PREP(DDI_CLK_SEL_MASK, 0x8) From patchwork Tue Oct 4 12:53:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vivekanandan, Balasubramani" X-Patchwork-Id: 12998272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04599C433FE for ; Tue, 4 Oct 2022 12:54:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F04F10E62A; Tue, 4 Oct 2022 12:54:26 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC6AB10E622 for ; Tue, 4 Oct 2022 12:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664888062; x=1696424062; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=XOLKi1vsOYJB4SZ7AM8VI/WTq6cjwbTYRiwjlV5xi/o=; b=a+iJbewNuxciTLOAnurFss6NofwVpdXvgE7GuZQLzSElbR9ndMVRwdzb cnA+E+5vn6GY0tWzsMt8kYdZ7wfDXUuPSwtVmAkHxsf8ayNLbVujpzHgu 5WaIM4xE5kpr/g2gU4qZ9nbEkG4z1iozuPNo91ilvPS23NeMuv7coAh2Z +0cX9h0hi+98JBWufZB4cYkQMxXOytAfaGtaZiZFw0xguNhZOp51WjVUt n76muNRZwsXaPCK/I37rJuRsgGcu4gr6hFk85kS3NoWIxtx4+/HnoMRor r6dONM+MCJyiO3Q7Q5Ikv1H3jK9z5nxDvEOzHA8kBwgmrjQ4/KAppjgyb Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="304444120" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="304444120" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2022 05:54:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="654759847" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="654759847" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga008.jf.intel.com with ESMTP; 04 Oct 2022 05:54:22 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:21 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:21 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 4 Oct 2022 05:54:21 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.48) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d7g2jl2b0ZAg6AWbEfXmJZJFmNB/slEiAMJpL71OmglRMEtLdYjFPaO6ojFYZy6j6K2Cc/8zpFWzaUiE3gCQgQ/172TxGT5VD/pFafpeJxon66FCSl6f8hCDPBUlqj59tHP3YWQsnkB/Az1/2OlDIUOrVXOTgd3z/Zh6Tpzvlo706bSovI7CUod4Ad0Rm/5uzLbLHwdh60BAsTtzCLcSZ7FQlfZg6sZk1F3N2yaH/pIp3DvezrBMg459dbEZGNoDLEF3xuoRIAl7wYwmLxGI5JsZ6Q2E+d+WjoVR/5aQaU0Xe+NspQGMKQ5rdVQyrZ9Iw43uINkdUhSIGX3Lesg3nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9AKEGV3JiZ9jz3RJp6JGA4JUwvxlEI6Jt12uKNBT8i0=; b=OqpfxSUfqIWfGq7e1F2VZW9SnUHAHYwCNQf/bXRKns9+MrPQa2eZB7O+GEoGLjJ9dukfMEVUOu+1vKvWIGzz2PU/m3849f0qoKaKJQFMHAVYd6OUKZmbQtX/8tKTpEJbJ7ohTtMaRQTnh3k2W7iAZ9MfWWMN5z61ZICtNdkFMPs/cj7xwupFbnS64QCLbKyi54BNoqu1l8CboiJh4RlWtrPCxpvt3Y3gQXhDi/igjqnoeUkOXEAfdYZKU08dnUsUZcNpMm90Z5oe4QgzaGPB+HSOumKaRtFt6SGelp2a4t9u87uA6GjhXYbIzV8CDE4z93ME6UNZdyPWnUd6C0u9kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) by PH7PR11MB6053.namprd11.prod.outlook.com (2603:10b6:510:1d1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Tue, 4 Oct 2022 12:54:18 +0000 Received: from DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67]) by DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67%3]) with mapi id 15.20.5676.031; Tue, 4 Oct 2022 12:54:18 +0000 From: Balasubramani Vivekanandan To: Date: Tue, 4 Oct 2022 18:23:40 +0530 Message-ID: <20221004125344.228294-4-balasubramani.vivekanandan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> References: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> X-ClientProxiedBy: PN3PR01CA0041.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:98::10) To DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR11MB1897:EE_|PH7PR11MB6053:EE_ X-MS-Office365-Filtering-Correlation-Id: 88aeaa9a-d763-4278-8b17-08daa6078cf0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b/kslssbx5UYAf4YxdKr5bL7d6k5AqzXLcWO9WNerZLZNpqujzCUDhveoLisSqcGr9NDEmi0j3WtW9PYe6fhJhcu3FC3wAaG+yZcaCngtBSpsWM6MBltenFznBai7Lxk1+X5eDhWO3VuZ7cmWvjXZpeicKiGaF67BX/3dfL3ho4u16T0VttoOFlLsWEDMrLayi7RPjZhH0PFdDb1RzEJBLoV51WtTjoPCQ2w26je9oEkKx/fSHFeWQaJR/JJ/WU6YvLgToDu9tkWzgyRIgWCx/mWDKOVAb5kmElIhziOJ0LsLWYilImNkf8XMsGWRVJvhxj1TlkrMmZALA9Bk9OTCMs4NW8Igxogr+J1zmzLTpDBxmHJoM6ffCbZOwmtaFCYvIE+wiFgORXwdk2Bsh55Iov9gbm8lebw0TAWEujOya2E0p+15JllF75oKxLqot5G4P+8Ti9eb5EJCIR6ilSwjoWiX849u/IaWJ5J5EyyZLOsHkViSAzYnpb0gRA/TX/d5UGR3GklzeZb2uLtb6u7J//IwLfPlEXc0H+wRD0ra6FKwQVePC5iFrGkFi7t+yI6gAO5Z1zy16d44T+dJCHL8ksEnEbe8xKwZQoGnAhdIXc/ycNx2FtLbINCuIT9ZT5ajVQw2Mi9DAhvSis4Iw9Ti/tKs8d3m5Kq/Jhy1a6jexF+OjRNNkpPmVaTPKJjGAC7eFlzVr6PeyzYjzz702ql0A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1897.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199015)(186003)(38100700002)(6506007)(44832011)(26005)(2616005)(83380400001)(1076003)(82960400001)(5660300002)(2906002)(41300700001)(8936002)(478600001)(6512007)(4326008)(6666004)(8676002)(6486002)(66556008)(66476007)(66946007)(316002)(36756003)(6916009)(54906003)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Jn/eX3ReK7PWDysb0CJWy+3lOfUVAs9nOW/OdClkzgarzpR9ajiGvOcx8EHTf7A8WlvD3VzMOlS7qA+gdUTNqgN/y3yELircwqFbokescEJNxdtA1oWrwnfHfJU2zREyPSSWU+WBy8/xS0+sFTVj8QPutIOr15FEhuHCP+Pajjk63EiVf1cOWpqCGaseEua8UJKRAq7TWtvCk0Ed8Q5jjksYOKQleT1sExF8pjqvLQF3nVoLBYpHSd55Q1jzkJ9nkx0ThFDifTi2HqtG0VLuSq5jCk2Hd/wtmaOvRTS2JvLIsRJN9Aue+JXgn5kTOd9loIqwpF+u8hloVeUVKU2dtLMjOhEtswSWwcegWLh4X+qZxS7OBRFOivk5T86EyJiWrmtfIKVXNwUblxj9GpX4f7qSRK69mpxxNqzSGRIU/8ziySCXoC9OZX17sQa4MOwQRdKXr9KCSqUdSG5bBGzuOxzLGTwzZXcFr8FvkUbC4xJB8kNPEzXsNBu6y25w8UErnV04OCJ/5UDjx5aLqlkYXgycMa+VzOTIQwciWA9SyYIhDGVRPOSJnVwDxk4tsyGY4Dllm6KWp4KEc5lxlY82D1ip4L/FHP7Th6Mb+foK1dT0boxghzdQrMFoMuH2J8Hc2f3aVYOpQyfCmj1ipOluAYLaB+MX7LSsM5GX7XEKwqVML/G67WGvrZKDytrqewAqBWuSqCXkDMKXxE/KOiT5oEUQYf9KsvyuWuorbzQ1IjPe5A/8Snoem5BBXDn9pyxA5YMnT1T6MOTlgekVnQFbMetGpnAnR5r4C3G4o9fevbBKCdX5DkUDfjqywx1r0C4C9M8XASXc2w0w2a8mHPKC4WBmrG0M52Gjvf35hMON6MEBoxwd+aLi91qk4cq4VgDN/kzlXUM5IweINBZvIGuk81om8CkzK/0rHeTK/Am5FJY8BodMsKVzgBWDC6mcq7wiNtuYipNdxNyR7Ios9V+dY4u8lnSIMbf5uh/HUeuUzace1a7wLZXt+Mua+xt2S2ZSyr5Cvj1c9+w+aZYqWkXRoaTIFnmkhgQmllBDIVdrqGJvVW6z7C2PoTD7c4l5Sk5UfacQWdKDGNWk/m7NsBS8/A1xj0SqetemYC/Myl0G0GdMTJu0Q1PqPbs4LemvF1v6R9evZxmOrUqDOTOTzWgg5Ai6fDsxdn/Tf0DdRSAfje6I0DfQW62UzBYS5inMEILgxkwzKlhu0HAYY11NiBNsQv1ah9rWiccGE2Qaq518WsMJmIdGOHQUc4A8PV3lvnldsbEaV0gv4YxHauiZb+dZjSuXHHYEUzlhnhm0Hxd9y5sor0ZPhKxNJvqGxaG4imWvtIUSSG8pSDpl8WWNJqRzw/Q9hrPDsfP+5Gt4Vw2MYeaGClsHcH9GC70sfl0nsrLEiOqSjReGIyoOZwPjkCJfDp0VdQw7JRGnFZkI+sbrcup0S/XPPt5NOEZwHs/n50Tqmevi8WhTElyCMiT4nx+JeXxm8XBGCuiZh6k1isinuEzhKZrQwkcp6DxyEciKUDNrrcbBAgQPA9ekzFlTyRoWlxLYFOucm9vpWtjqkEXVgJMPXIk87IAKbjhvBhvXGDLZNaEnwL0YMIgW5lCAdsrSqbqKd8YPm1nswHGPpuYqdoU= X-MS-Exchange-CrossTenant-Network-Message-Id: 88aeaa9a-d763-4278-8b17-08daa6078cf0 X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1897.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 12:54:18.8090 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OBWSwe8VF80LOJcHXzH7ZE8mWI7aRCcY4doQ4sRg5RhV8XomGnwlPvGutLLN68xYskYURpIiqaMRzZS3sGlILzq75gYAeMT0n4Np9EfJnoOddQIQYmGqra+MqbxLF56i X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6053 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH v6 3/7] drm/i915/display: Define the DDI port indices inside device info X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Prior to display version 12, platforms had DDI ports A,B,C,D,E,F represented by enums PORT_A,PORT_B...PORT_F. The DDI register offsets of the ports was in the same order as the ports. So the port enums were directly used as index to calculate the register offset of the ports. Starting in display version 12, TypeC ports were introduced in the platforms. These were defined as new enums PORT_TC1,PORT_TC2... The later generation platforms had DDI register offests of TypeC and non-TypeC ports interleaved and the existing port enums didn't match the order of the DDI register offests. So the enums could no more be used as index to calculate the register offest. This led to the creation of new platform specific enums for the ports like PORT_D_XELPD, PORT_E_XELPD to match the index of the ports in those platforms and additional code to handle the special enums. So we want to make the port enums not tied to DDI register offset and use the index from somewhere else to calculate the register offsets. The index of the DDI ports in the platform is now defined as part of device info. This patch just adds the indices to the device info. Later patches in the series use that index for offset calculation. Signed-off-by: Balasubramani Vivekanandan --- drivers/gpu/drm/i915/i915_pci.c | 46 ++++++++++++++++++++++-- drivers/gpu/drm/i915/intel_device_info.h | 1 + 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 38460a0bd7cb..b37a95755b77 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -132,6 +132,42 @@ [PIPE_D] = TGL_CURSOR_D_OFFSET, \ } +#define GEN75_DDI_INDEX \ + .display.ddi_index = { \ + [PORT_A] = 0, \ + [PORT_B] = 1, \ + [PORT_C] = 2, \ + [PORT_D] = 3, \ + [PORT_E] = 4, \ + [PORT_F] = 5, \ + } + +#define GEN12_DDI_INDEX \ + .display.ddi_index = { \ + [PORT_A] = 0, \ + [PORT_B] = 1, \ + [PORT_C] = 2, \ + [PORT_TC1] = 3, \ + [PORT_TC2] = 4, \ + [PORT_TC3] = 5, \ + [PORT_TC4] = 6, \ + [PORT_TC5] = 7, \ + [PORT_TC6] = 8, \ + } + +#define XE_LPD_DDI_INDEX \ + .display.ddi_index = { \ + [PORT_A] = 0, \ + [PORT_B] = 1, \ + [PORT_C] = 2, \ + [PORT_TC1] = 3, \ + [PORT_TC2] = 4, \ + [PORT_TC3] = 5, \ + [PORT_TC4] = 6, \ + [PORT_D_XELPD] = 7, \ + [PORT_E_XELPD] = 8, \ + } + #define I9XX_COLORS \ .display.color = { .gamma_lut_size = 256 } #define I965_COLORS \ @@ -562,7 +598,8 @@ static const struct intel_device_info vlv_info = { .display.has_dp_mst = 1, \ .has_rc6p = 0 /* RC6p removed-by HSW */, \ HSW_PIPE_OFFSETS, \ - .has_runtime_pm = 1 + .has_runtime_pm = 1, \ + GEN75_DDI_INDEX #define HSW_PLATFORM \ G75_FEATURES, \ @@ -733,7 +770,8 @@ static const struct intel_device_info skl_gt4_info = { IVB_CURSOR_OFFSETS, \ IVB_COLORS, \ GEN9_DEFAULT_PAGE_SIZES, \ - GEN_DEFAULT_REGIONS + GEN_DEFAULT_REGIONS, \ + GEN75_DDI_INDEX static const struct intel_device_info bxt_info = { GEN9_LP_FEATURES, @@ -887,6 +925,7 @@ static const struct intel_device_info jsl_info = { [TRANSCODER_DSI_1] = TRANSCODER_DSI1_OFFSET, \ }, \ TGL_CURSOR_OFFSETS, \ + GEN12_DDI_INDEX, \ .has_global_mocs = 1, \ .has_pxp = 1, \ .display.has_dsb = 0 /* FIXME: LUT load is broken with DSB */ @@ -984,7 +1023,8 @@ static const struct intel_device_info adl_s_info = { [TRANSCODER_DSI_0] = TRANSCODER_DSI0_OFFSET, \ [TRANSCODER_DSI_1] = TRANSCODER_DSI1_OFFSET, \ }, \ - TGL_CURSOR_OFFSETS + TGL_CURSOR_OFFSETS, \ + XE_LPD_DDI_INDEX static const struct intel_device_info adl_p_info = { GEN12_FEATURES, diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h index bc87d3156b14..a93f54990a01 100644 --- a/drivers/gpu/drm/i915/intel_device_info.h +++ b/drivers/gpu/drm/i915/intel_device_info.h @@ -292,6 +292,7 @@ struct intel_device_info { u32 pipe_offsets[I915_MAX_TRANSCODERS]; u32 trans_offsets[I915_MAX_TRANSCODERS]; u32 cursor_offsets[I915_MAX_PIPES]; + u32 ddi_index[I915_MAX_PORTS]; struct { u32 degamma_lut_size; From patchwork Tue Oct 4 12:53:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vivekanandan, Balasubramani" X-Patchwork-Id: 12998273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 378D6C433FE for ; Tue, 4 Oct 2022 12:54:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D83D10E622; Tue, 4 Oct 2022 12:54:34 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F8D610E62F for ; Tue, 4 Oct 2022 12:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664888070; x=1696424070; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=Oo2+pv38yQhIDSiN5SEyT/ElBKthbFDnsuWJhvP+kZ4=; b=C1OGheSj2hSJmd7uIp8+5BgCsSxz00X28Z70Ctpejceb3/54Ogi7pKGz VriQmipA3XsGjfi/362tkP101yqPGbllp5d7+qR6o+F4pjMOFdO+LhAaZ +fFChHVcD47yhBnrW2+fnjaIxX9yCKv5+Gz5m+zRDcNyHvvDmZ1FsLr5v zg6wC/DHGmXOBZjBzjqJT8AOLIvCMM71JC67FDivzUV+KmKRX0reEesDe Osd+GbgHZ0eVN817fbBKKtvJeGlFoa4eGm2LY7tkrvph3qLYqZy+yRHsr htZJmda+6KLBl/UEi1TRICC+5rDaN8ParKba5lw4MwQtUx7TQ5GRm4BV1 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="366996596" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="366996596" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2022 05:54:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="749361669" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="749361669" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga004.jf.intel.com with ESMTP; 04 Oct 2022 05:54:29 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:29 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 4 Oct 2022 05:54:29 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.41) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y5Grn1FrVwTxG36JuY0MxJx1rYk8YOgq/0PNxu23/dBg3iHaT9gbIfwyD3rCtGLMdo2nalzdaFfHDPkY2egLeWn+iLH3EmxLfpnlU8//ATC67U7lBdcNqke5pvDzlmXDwnSRAnb1cJRw/G5qjbGANglvwVf2kYirU8mAx5TrR3UyEjMorIJg3n0YMGVI8GDaYS8TA41YU5MXQci/7KyoPvfm5CiH0XI6Vvgwm3PTxaSJ8d1/v2Ue4lco0cmNvB99cVItso6WWCYENCxhsos4br4gaj9BoWUQ2YohuHXPVIaWj+72OkOXvaGl6vwoN8F0U4gQ8nLbdAN3toqh4ZCvcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FhaYfzQYMpV+2NtFhwq0Ey/kCymRb2+q/DKL+9CfaqE=; b=fvg20qmX9rH2eNVQRGvpA5fI07wxUtRVSmzfScUis5Ut95zSjEBUx6rakzWcosclPAQzrwp1SK4L2ZOXGxhfrCe14Jc8dU5C7cXwHprsOOMGQ+HVOGacHJzatogIaO35jBFc3N4PkZ1OYJfUoZxn/MsogLgQ4J5evGhDAUDhKWjqwL3MoW+Qi+rvrNjkJqpnMhQ9JL1r4Yu6JpBZd9v969jnTND4v14z7QyKybRGplCq46j+p3PkKPvWbTHVTuJB0I/qA6TnN3I+xuDTaihZk2kqbmMk6iVkCMMrp2/Lnc2NzHs6whJ8KPnLuZuR/aQYkjJR3iUqrCMWl1BeU9WhEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) by PH7PR11MB6053.namprd11.prod.outlook.com (2603:10b6:510:1d1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Tue, 4 Oct 2022 12:54:26 +0000 Received: from DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67]) by DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67%3]) with mapi id 15.20.5676.031; Tue, 4 Oct 2022 12:54:26 +0000 From: Balasubramani Vivekanandan To: Date: Tue, 4 Oct 2022 18:23:41 +0530 Message-ID: <20221004125344.228294-5-balasubramani.vivekanandan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> References: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> X-ClientProxiedBy: PN2PR01CA0082.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:23::27) To DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR11MB1897:EE_|PH7PR11MB6053:EE_ X-MS-Office365-Filtering-Correlation-Id: 2256335c-474b-4509-c747-08daa6079155 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nalLjS9fvC2y2w/UeBLdWtzsXLVbExVeBTJtXKBQpRyZw3WMo2MP1HZaooiq4uS5SlDxiHHXrZmv1c6KGlOWP1+MaZo8tE7Sz/9Tv+58upnmNzCtikau8lKVOKwg0Nan8AKQ/FDc0so07ORApZWcBQVNkws1j4aGyaOjNIDKn2fW5btvAqOPeLgyeiH49VCO74QvU/Qo1rZn2O5cxsU49N1skihORaHsfCtjV8JewLXowNR0JiSIqYwIocsam5qLZU0XnwoFG7kwKkxLETUGnWLHQ1lXFwChNOIsJNHLtDK1fZkbgG5OL7ZXUa/SOtN289CrkLrg5p0G4gcuW4wMCdQcJyZasdmBWhJbbVstfKJR+B3FN92ECMOLjaxjkcJV7+M6smfB9/uyJ4IVDNc2q6aNxhtM5uefGPozup3tnnzkNC2lD57FeF+mh+d/ccFi8jic1gfNM6X0gwFTkb5i6+R3njyqXbhhMlEk4FMBs3kolHVc0XX4ewPVB79De6A4hoZ4jwRb1uAdGXebh7b6XiyR9F532XCJWgIrrAAHkk/nv+PW/unsqnWDML8ly5LaCKtfbrgTzyn79qtU7mWsqIvEXeSa4mPaDnN3IA/1+n0WARgF0iGGbMzPtBXzGmPTQrCgjZHC99ydTmhAOjG9PE5WOR5hoyGESV2caOjiBqUB75+4xT88Wxvuof5oq0PXqXPR/zFfrpdFJi0rQnhSUw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1897.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199015)(186003)(38100700002)(6506007)(44832011)(26005)(2616005)(83380400001)(1076003)(82960400001)(5660300002)(2906002)(41300700001)(8936002)(478600001)(6512007)(4326008)(6666004)(8676002)(6486002)(66556008)(66476007)(66946007)(316002)(36756003)(6916009)(54906003)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BDsDD3nmz+YXC8wPH+YMvdOAf5uZ36Nn/DkYxAEsrx/WIM9blowEBiPoCDwDxF6IeE5sNantZaqdfriY2Ui8LcJga3Fm1HTGKCKsxphH0il5itjBl9GkzSBvvXmCsnqAYGGerqwzCh6b16ZZKzZOXNOMO5naPgGIFf1KBWMOMQMDpIhT9bLAUAFnOXRKPksmsKkHv5ZnRL+cYyusc3cuCwVzAsHNC4GBYnDA2ipSXjThO82pq5eCtZKMKJOKHJLH73VnHBQy+YUxp441Hn9QUAewqkmBNEUf+dMvrQXbnJDTNri4nxJltH4vzbXCM+L2wQWRHTttWAcRNhyG3ps3M/BPObJ7UuqV/HGnbpl8kkRlAL+WCUZ+sBDFYOw3AAKQWmYVvwJbYxCoaN73C6vjBzPJgddo3iPHVvpDQLj0hUrE5e3NegM8GuMsytsVA8d1NFH9SbSf6wGLl7K+oExxEbpDHrwvQiIdoj6npVeSIvbO71B9VeP2g/A4kP1YtVUMNS0bPNG1PImte6YeYb0TTWW+KZC+/c+DOWlKADStyX8AFQXyxDVp6wvw2AEfpM7rkEbqQb5YlsUbWcbxzY1lPl9nLgdoVHU59wmNdhiFd7zdDtG4/+FvZBVX5xCbsaOg13fmfFlWJ+PT7bqYezpZIqLh6iysBKOO/qCK3mELp0gKGYZ3hTN39vKnlH90LA/z9EVGfoCPAyfmp2Mwpsj/aMjySPysnxXCQjOzEJG76t1kr+EDs0pyEYYEz8JIC/comatv3Pwf1Njx4GgSixmoRQXAYIDCN6y28YgUL95sbZER+pS+YuFfAjv8bOGJteThxZJIjnTwlUJzUaLOJPyunqRegQ6Z8AS6dOcmKxelfzpdF6unoLcStUjy4FCaHJZvruyc5tMJkki6RQaBgH7uhz13+7a/VX/DM3BZZMN4/SI7HUzm0rbJkYoqBgOpahcG9QtUkWlmTUngSkfSkTAHyy1kAPQIxLs26pw2rqOTX+bWw4yCzEtEyMamS1QgkMDo53/ySATrFldF8ZtyMbzE6h2tq6T7mICQ0a+Qb8ogOR6YsIRf0SgmBObepTKHI3XidYZYY+YL4s4F9jVjnh1A5S5scyTjDG17+lnm/wuPBlhJoZ3YiAAiCXgB9q42zsme6h8aDTgSxnDoey70Et6ur6OyIgZME+oc4QMN0X8kdLXrdL0rz/ZQfiv3w2xs+X6q8AVw5MlHKek3Pf5KYPKIYB9GIJFwYrpUdOCNbVM/jbdtIt4BDAvm49QfPB4RONHnIYFskVAuDB+/rl0+j+YgUFHOsN5bPGMuOSqHu/WQhSzRCrP6yt/rSngselx+Qx6vYT/UArHBQ8Yrs7Yn8Rw+TB+iO8O7S8XXslK0Q0ultygUznbYPfY9/RGeEDSRQWfv/r83SRQh1b9v9ZWpjMRdG26gyzQQik8EqBfrm5IZ8LoTIQcukkgHQYnlKJxj5TK6jF9L5DmFgxRvepe2gTqDm8ZF0PG2k762zTWzQ4hWiU9DYl+Iv8iTkwEdtVrSJ255NMPDDG7zNvf2mdpG38bFnniyjocDvSghS5culnJ2GblZgch5JvUIggbrOEGJVzY/G34GIiCJTfaO79qTdHb1ILI4MIaIXN4MeMiQeK7Z0iQ= X-MS-Exchange-CrossTenant-Network-Message-Id: 2256335c-474b-4509-c747-08daa6079155 X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1897.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 12:54:26.3239 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dqK85Q8NYFMAf56yvj3Af2EaN9vAcZkAc0OFUg1F9/9xFX8iwWnUa1Z7UJk+JSj25+Elogem8lZ4mqjtRGkRBpatVM8lhr8XKRLnynPV/4Eyz0sRDqeAfRlqFYshLyGP X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6053 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH v6 4/7] drm/i915/display: Free port enums from tied to register offset X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" With the index required for DDI register offset calculation available in the device info, the macros which used port enums to calculate the DDI register offsets i.e. DDI_BUF_CTL and DDI_CLK_SEL are updated to make use of the index rather than enum directly. Any new macros access that DDI registers should follow the same procedure. This would free the port enums from tied to the register offset of DDI registers. We can remove all the enum aliases and clean up the enum definitions. The key target of the patch series to remove platform specific definitions of ports like PORT_D_XELPD, PORT_E_XELPD is not yet covered here. The definitions are still retained and will be handled in the follow patch. Removed a WARN_ON as it is no longer valid. The WARN was added in the commit "327f8d8c336d drm/i915: simplify setting of ddi_io_power_domain" The ddi_io_power_domain calculation has changed completely since the commit and doesn't need this WARN_ON anymore. Signed-off-by: Balasubramani Vivekanandan --- drivers/gpu/drm/i915/display/intel_ddi.c | 1 - drivers/gpu/drm/i915/display/intel_display.h | 8 +++----- drivers/gpu/drm/i915/i915_reg.h | 12 ++++-------- include/drm/i915_component.h | 2 +- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index e7beafafb857..74b4271063d1 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -4493,7 +4493,6 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) encoder->update_complete = intel_ddi_update_complete; } - drm_WARN_ON(&dev_priv->drm, port > PORT_I); dig_port->ddi_io_power_domain = intel_display_power_ddi_io_domain(dev_priv, port); if (init_dp) { diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index 2af4a1925063..9112833b39eb 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -212,18 +212,16 @@ enum port { PORT_H, PORT_I, - /* tgl+ */ - PORT_TC1 = PORT_D, + /* Non-TypeC ports must be defined above */ + PORT_TC1, PORT_TC2, PORT_TC3, PORT_TC4, PORT_TC5, PORT_TC6, - /* XE_LPD repositions D/E offsets and bitfields */ - PORT_D_XELPD = PORT_TC5, + PORT_D_XELPD, PORT_E_XELPD, - I915_MAX_PORTS }; diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index acb764755338..15e6b9482ee8 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -170,6 +170,7 @@ #define _MMIO_CURSOR2(pipe, reg) _MMIO(INTEL_INFO(dev_priv)->display.cursor_offsets[(pipe)] - \ INTEL_INFO(dev_priv)->display.cursor_offsets[PIPE_A] + \ DISPLAY_MMIO_BASE(dev_priv) + (reg)) +#define _MMIO_DDI(i915, port, a, b) _MMIO_PORT(INTEL_INFO(i915)->display.ddi_index[port], a, b) #define __MASKED_FIELD(mask, value) ((mask) << 16 | (value)) #define _MASKED_FIELD(mask, value) ({ \ @@ -6936,10 +6937,7 @@ enum skl_power_gate { /* DDI Buffer Control */ #define _DDI_BUF_CTL_A 0x64000 #define _DDI_BUF_CTL_B 0x64100 -#define DDI_BUF_CTL(i915, port) ({ \ - (void)i915; /* Suppress unused variable warning */ \ - _MMIO_PORT(port, _DDI_BUF_CTL_A, _DDI_BUF_CTL_B); \ - }) +#define DDI_BUF_CTL(i915, port) _MMIO_DDI(i915, port, _DDI_BUF_CTL_A, _DDI_BUF_CTL_B) #define DDI_BUF_CTL_ENABLE (1 << 31) #define DDI_BUF_TRANS_SELECT(n) ((n) << 24) @@ -7075,10 +7073,8 @@ enum skl_power_gate { #define PORT_CLK_SEL_NONE REG_FIELD_PREP(PORT_CLK_SEL_MASK, 7) /* On ICL+ this is the same as PORT_CLK_SEL, but all bits change. */ -#define DDI_CLK_SEL(i915, port) ({ \ - (void)i915; /* Suppress unused variable warning */ \ - PORT_CLK_SEL(port); \ - }) +#define DDI_CLK_SEL(i915, port) _MMIO_DDI(i915, port, _PORT_CLK_SEL_A, _PORT_CLK_SEL_B) + #define DDI_CLK_SEL_MASK REG_GENMASK(31, 28) #define DDI_CLK_SEL_NONE REG_FIELD_PREP(DDI_CLK_SEL_MASK, 0x0) #define DDI_CLK_SEL_MG REG_FIELD_PREP(DDI_CLK_SEL_MASK, 0x8) diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h index c1e2a43d2d1e..f95ff82c3b4a 100644 --- a/include/drm/i915_component.h +++ b/include/drm/i915_component.h @@ -35,7 +35,7 @@ enum i915_component_type { /* MAX_PORT is the number of port * It must be sync with I915_MAX_PORTS defined i915_drv.h */ -#define MAX_PORTS 9 +#define MAX_PORTS 17 /** * struct i915_audio_component - Used for direct communication between i915 and hda drivers From patchwork Tue Oct 4 12:53:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vivekanandan, Balasubramani" X-Patchwork-Id: 12998274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 889F3C433F5 for ; Tue, 4 Oct 2022 12:54:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A796610E632; Tue, 4 Oct 2022 12:54:44 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 86EE210E630 for ; Tue, 4 Oct 2022 12:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664888078; x=1696424078; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=blzYfdVdEsh+y7T/s6U6QoD1mJkxgXqQtZX7ZOR8Rjc=; b=nGVS8RcaqtqOujJx5z0rBJhvq88Iwhigwz/+2bXeTiQ67VdpwWxT+PAV 86Td+l52K2h9XUT0t69pwo+Q40gi3swH7AmaCheUwQNRzERZvgc3eTuZU /nj2V5GYwkDlxOe3bavmaAjY3vGksEMweu+niFCXszAWC9UfXlnyHRkRu Blg7SiMYtC4+D4Vl6n13senVtWRL83PhBacM3d8K0X0d5/eqOEs8y5R40 h3XM4UPBcIqo2xCtW2whOKZNpGdts3mj8aUmWyThsi1b61bYysZ7Makvf KTeLVjGlH4ZkAHV31fq1oS8o8auyzTvVSFJnCTTpzhszUCM/JdEpfjRgv w==; X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="301620760" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="301620760" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2022 05:54:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="692478198" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="692478198" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 04 Oct 2022 05:54:38 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:37 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 4 Oct 2022 05:54:37 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.40) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MskbmrfkSOjc1mZNl3qGaL+2XArKba+12+xU3HGKIySVroZk4ImExn5M2LPUoeZHysXUhFXFQO2GQSPGsf1NwNLhijwTjZmpygPQlmQ41g3sdoz72xiCOBJeRmeRstbwANjt+E37HLOLEFeJpZJalF8uEMQx/rCcWTQ5GxLoGazIICwJD8qWyhO/yrcJyctyusAbas2jk3MIe9jEKBgEh215FYgK14szqpuCX2lGyKbbB2yHUX0D2eaiDu9NGdW4zXX5zheAQBpBNdqlCReaX+ePJFXSnYZgKJJV6B5xEuCVioXYgcUfCfUhYQsuh/ILyUHu4RTa7+7+2TkHTHvn9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=P/Bwfd26EuO4dlyvJlYcltCZHgCQ2qmQcuwLi46XgfE=; b=OOgZ4hwhaEscxglm+sYSPYSgj/sGTO0gnvDrMpAGn2yGRna/HNj2BetZIhRrFA8+SOaVg7OywPUHYfrfH0ibpstOjCX2BMP0pf2mIWzsIhxycqWKAe8PMoTMmERxwOrzgnqW6CeM+l0djH4B7ddCegyuJWMDUU1H7Bafh66Q+foPch8lxYM5r8T5W4X5E3+kkjam6mg71liM57Yy+rfbsc0rS02sK0FGO/oBT5A5IW1XHOg7A8BUUcVtuqksMp2NsZF5gGpJK3gBcEXD7rK4dYmQAZp0kiL7wPA7DDY30NwAMqxPIOcrmg+AVdPQU+vgFuYRVn2jHubKc+AqypLqGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) by PH7PR11MB6053.namprd11.prod.outlook.com (2603:10b6:510:1d1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Tue, 4 Oct 2022 12:54:35 +0000 Received: from DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67]) by DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67%3]) with mapi id 15.20.5676.031; Tue, 4 Oct 2022 12:54:35 +0000 From: Balasubramani Vivekanandan To: Date: Tue, 4 Oct 2022 18:23:42 +0530 Message-ID: <20221004125344.228294-6-balasubramani.vivekanandan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> References: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> X-ClientProxiedBy: PN2PR01CA0151.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:26::6) To DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR11MB1897:EE_|PH7PR11MB6053:EE_ X-MS-Office365-Filtering-Correlation-Id: d1b14482-2dbb-46d4-a8d5-08daa6079666 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z8DQARx/GN+bNE17YAngdM7Txwe/WfbcNmquErV6R9Mmd71F5fYUPwMu23Y6+sHzq11VcBtjAXndZCSfFmST4qZ0IPar3DC6CiwKpD0ZpatZt8ScvPaC0M/Btepn5HAZ1MFSsbRkY6f8Ju9UXtbDTlW3Aa2Mjtwac0xWeWqiKlHF1F42en8yMLsIopgVsy8gksiZ5W+alNECIUeHLczBZghvd6nJV1+EQ9dPI4HgcaXWW7AtBUMS/0vz5BJ5wIMMuj/0ax+1tcum+QVIyLxR5E+LAfwcc/ul8aMs00VQghEySxm+VfMiYuuEzlaij7rfA3yVzm0J9YiLBrM1cKcup/OhwUEHdahzf/pYLrRu4upgal4wmgzXFqghyyvtiG0/APtaO8G645OTZ2BqA/sHOoj8jvkR4mJMFCE+snsnQz86hJ0HychcwgwBy+uahr0vuYUPrRQsjjcOYhxxAyyxuj51SXkTQPqwytsy/UOLg4nOk/irpkDiIWOjSGoW6VxAo+Jonp9w7/Olh3y5aAwWOU5PZIuVVACAcfSS/Nm+rVQaJkojfjsuhoTJOu+CY5RWxdXBelGAJk4ncYgnJS3Cat4Km6IGz6SqKQig2VRtVhWnjLiYCzrZTBTwR95GtOSc+RqkwPZZKGUJn1RCOGU0hKWlynPUtqJzbtwq/uljS5qqb3YrUtawM85XNPbSer/MYL3e19fC14gvmRdfFZT2dw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1897.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199015)(186003)(38100700002)(6506007)(44832011)(26005)(2616005)(83380400001)(1076003)(82960400001)(5660300002)(2906002)(41300700001)(8936002)(478600001)(6512007)(4326008)(6666004)(8676002)(6486002)(66556008)(66476007)(66946007)(316002)(36756003)(6916009)(54906003)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e0pmg4Jlzv0vzlavgwJS7QfzNaYdzxjYzAOhJs4ddYmZvmfCSBQXBY7nDPf2fxxcZW31KWZ1dQe4bZuQaBwkfUvX+GiPoMY6LDEBrfBJi9kFAtqq++pwKugETznvIEksMlsUXBmRS4iFNQnJlFnrkn6Mgid62Gn7hbwoIHsgseTq3169Es/tKCpcYeZAfi5meJq72qr886pZlZcbInyPsyil/RISsjZy1003icMzX5hd/vCJh2/87dap0uWWCw1gxwZgQiUngt9GdOfk1xj+2N6YUM6Wn4MCgrVFrkSLfvDWER9B2Q4IeofaPhu18OgmlbInKcFWSoB7BRMoGN2B/lAls05nR9wPEZe3FmBguX2QW9oyz5fb5/Ni+doVMOAunAHkYn/512J+dc/ozac5N/jPJOSsvdFkXkjlp5mGbSgmygyuxl75fCRZtTTe5OdTMGm7NMA76t8AGOJsJIXfrLSE/W/c0N2zdJ122Vm2gZ4OIplSzdHs54aUkLuAWCnc93NsfFSL0ionKw5kvSo1EZf555548LngoXmkrWy7wMSi1reasPZCWH2kIZzfgAHIwPvIg8Kd4jGoSgF1r+OOcqD+7942tJo+ltujsIR4eT70/J+FXG16E24nSetox2NVYkORBfXhJDOY/BA9fu5R4qjTJVTfj7KZ7XvqosCFm4vB/CSGqDFLUEudu93FqjNQY0HQVtcb/9l5XP4C5si8m3fJJuTM7WBxGtDohqF7W35LLaxRYdujlH8N0KP6p/nm1oKhE69ctPyJmTkhIQafF9xyDHOEsEZ1i6cvBjoPUgF81Cr3Rpw0s5GFxMeEPD8tk+fMcA9u4NeEwSpSYibglFptniOYkKo+zbrLBA+fZawZlmvNO4GpJBzBR4Uvhjidvz4Nvr6y7gBH5fIZ28qtbwW+a2aWON4o9svGbEs8wkkl7CGEx71bAmsj3t5fwRwguz1BW8AkoHatpIcN20lwzU+cWQ53ru84O+me0ZyXQ0cVw7la+FSD6wpKWttCYh3e+bYuy64tboZ9qtCOsFs6QpPm3FgFREmBlWNJxLOvdE0Tb+AjV0y+dngpFFiRfrVA5HyDpGuDiY09CPIwnwsJhSzeNmUOf102J1MP/fiX8o/gWMv3AmPcGordWTNS7KLe50CiQSOFjBQ2v46aLEiS5x6dE4lzvDc0VeuqAgYdmdi8v9XXZ2XuSibLG4loKDB51oGcJgOkkaIUA6MHGzui/7AhS5Ll4xjwcVVP6c7s03y4k/sDwd6gu4Wz2h3PV1WV0wg5QpcBx7HiJgm9ZWGN45V9VEXbtS8IJY+ZM3IrdkQ6JmUp/ieoMo58aNn3yBF4W/ZlU5TvxAi0o8HyRxX/SfkHkQMFdgFLslVPojBRyd289E17d0IMwoFPfPU7V4g7blysUB87Dh/OEEce59AQcfwh79BdyHONpkUHR4algAoFhOI3RTlPrkShdp/tmBtWNTsAyq0LbopOl0L4G2F9vviSds5jA7nk9apLyRBe+cZPXLbmK0cg8VQZdpUR9VFZjeaAvnZXY/wkpvTjNM5EytcBccvQ3jVBwUvhmYhNmhA4O/RvEvFNQ1+wgM6h8fHzuL0zlCzDPt/7HgLS3LtVNtViY6aDvMJ4/jzSdstsf1E= X-MS-Exchange-CrossTenant-Network-Message-Id: d1b14482-2dbb-46d4-a8d5-08daa6079666 X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1897.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 12:54:35.1981 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6sWAhoi4kGUUyOVqTMtlrtefCiDu+ZIRfmnbg7Th2Jw7Wu5m9SCHNRFoR4akxDdO4ZoAvZzE5rpKYcv0ByaD4GQSw39E4p6bkE2NH0tHpBI3Erwde+7YVmNzHVje1FE6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6053 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH v6 5/7] drm/i915/display: Remove PORT_D_XELPD/PORT_E_XELPD platform specific defintions X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Port enums are no more used in the DDI register offset caculcation. We can remove the platform specific port redefinitions. Along with it we also get rid of the code required for handling these special definitions. Signed-off-by: Balasubramani Vivekanandan --- drivers/gpu/drm/i915/display/intel_bios.c | 4 +- drivers/gpu/drm/i915/display/intel_ddi.c | 23 +--------- drivers/gpu/drm/i915/display/intel_display.c | 6 +-- drivers/gpu/drm/i915/display/intel_display.h | 2 - .../drm/i915/display/intel_display_power.c | 44 ++----------------- drivers/gpu/drm/i915/i915_pci.c | 4 +- include/drm/i915_component.h | 2 +- 7 files changed, 12 insertions(+), 73 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 4c543e8205ca..ab472fa757d8 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -2436,8 +2436,8 @@ static enum port dvo_port_to_port(struct drm_i915_private *i915, [PORT_A] = { DVO_PORT_HDMIA, DVO_PORT_DPA, -1 }, [PORT_B] = { DVO_PORT_HDMIB, DVO_PORT_DPB, -1 }, [PORT_C] = { DVO_PORT_HDMIC, DVO_PORT_DPC, -1 }, - [PORT_D_XELPD] = { DVO_PORT_HDMID, DVO_PORT_DPD, -1 }, - [PORT_E_XELPD] = { DVO_PORT_HDMIE, DVO_PORT_DPE, -1 }, + [PORT_D] = { DVO_PORT_HDMID, DVO_PORT_DPD, -1 }, + [PORT_E] = { DVO_PORT_HDMIE, DVO_PORT_DPE, -1 }, [PORT_TC1] = { DVO_PORT_HDMIF, DVO_PORT_DPF, -1 }, [PORT_TC2] = { DVO_PORT_HDMIG, DVO_PORT_DPG, -1 }, [PORT_TC3] = { DVO_PORT_HDMIH, DVO_PORT_DPH, -1 }, diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 74b4271063d1..0b6f884650d3 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -4134,17 +4134,6 @@ static bool hti_uses_phy(struct drm_i915_private *i915, enum phy phy) i915->hti_state & HDPORT_DDI_USED(phy); } -static enum hpd_pin xelpd_hpd_pin(struct drm_i915_private *dev_priv, - enum port port) -{ - if (port >= PORT_D_XELPD) - return HPD_PORT_D + port - PORT_D_XELPD; - else if (port >= PORT_TC1) - return HPD_PORT_TC1 + port - PORT_TC1; - else - return HPD_PORT_A + port - PORT_A; -} - static enum hpd_pin dg1_hpd_pin(struct drm_i915_private *dev_priv, enum port port) { @@ -4313,13 +4302,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) encoder = &dig_port->base; encoder->devdata = devdata; - if (DISPLAY_VER(dev_priv) >= 13 && port >= PORT_D_XELPD) { - drm_encoder_init(&dev_priv->drm, &encoder->base, &intel_ddi_funcs, - DRM_MODE_ENCODER_TMDS, - "DDI %c/PHY %c", - port_name(port - PORT_D_XELPD + PORT_D), - phy_name(phy)); - } else if (DISPLAY_VER(dev_priv) >= 12) { + if (DISPLAY_VER(dev_priv) >= 12) { enum tc_port tc_port = intel_port_to_tc(dev_priv, port); drm_encoder_init(&dev_priv->drm, &encoder->base, &intel_ddi_funcs, @@ -4449,9 +4432,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) intel_ddi_buf_trans_init(encoder); - if (DISPLAY_VER(dev_priv) >= 13) - encoder->hpd_pin = xelpd_hpd_pin(dev_priv, port); - else if (IS_DG1(dev_priv)) + if (IS_DG1(dev_priv)) encoder->hpd_pin = dg1_hpd_pin(dev_priv, port); else if (IS_ROCKETLAKE(dev_priv)) encoder->hpd_pin = rkl_hpd_pin(dev_priv, port); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 8681055843f0..febe85a8a9c8 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -2135,9 +2135,7 @@ bool intel_phy_is_snps(struct drm_i915_private *dev_priv, enum phy phy) enum phy intel_port_to_phy(struct drm_i915_private *i915, enum port port) { - if (DISPLAY_VER(i915) >= 13 && port >= PORT_D_XELPD) - return PHY_D + port - PORT_D_XELPD; - else if (DISPLAY_VER(i915) >= 13 && port >= PORT_TC1) + if (DISPLAY_VER(i915) >= 13 && port >= PORT_TC1) return PHY_F + port - PORT_TC1; else if (IS_ALDERLAKE_S(i915) && port >= PORT_TC1) return PHY_B + port - PORT_TC1; @@ -7907,7 +7905,7 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv) intel_ddi_init(dev_priv, PORT_A); intel_ddi_init(dev_priv, PORT_B); intel_ddi_init(dev_priv, PORT_C); - intel_ddi_init(dev_priv, PORT_D_XELPD); + intel_ddi_init(dev_priv, PORT_D); intel_ddi_init(dev_priv, PORT_TC1); } else if (IS_ALDERLAKE_P(dev_priv)) { intel_ddi_init(dev_priv, PORT_A); diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index 9112833b39eb..62604cadf0b8 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -220,8 +220,6 @@ enum port { PORT_TC5, PORT_TC6, - PORT_D_XELPD, - PORT_E_XELPD, I915_MAX_PORTS }; diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c b/drivers/gpu/drm/i915/display/intel_display_power.c index 1e608b9e5055..d900d8051a82 100644 --- a/drivers/gpu/drm/i915/display/intel_display_power.c +++ b/drivers/gpu/drm/i915/display/intel_display_power.c @@ -2338,9 +2338,9 @@ static const struct intel_ddi_port_domains d12_port_domains[] = { { .port_start = PORT_A, - .port_end = PORT_C, + .port_end = PORT_E, .aux_ch_start = AUX_CH_A, - .aux_ch_end = AUX_CH_C, + .aux_ch_end = AUX_CH_E, .ddi_lanes = POWER_DOMAIN_PORT_DDI_LANES_A, .ddi_io = POWER_DOMAIN_PORT_DDI_IO_A, @@ -2359,50 +2359,12 @@ d12_port_domains[] = { }, }; -static const struct intel_ddi_port_domains -d13_port_domains[] = { - { - .port_start = PORT_A, - .port_end = PORT_C, - .aux_ch_start = AUX_CH_A, - .aux_ch_end = AUX_CH_C, - - .ddi_lanes = POWER_DOMAIN_PORT_DDI_LANES_A, - .ddi_io = POWER_DOMAIN_PORT_DDI_IO_A, - .aux_legacy_usbc = POWER_DOMAIN_AUX_A, - .aux_tbt = POWER_DOMAIN_INVALID, - }, { - .port_start = PORT_TC1, - .port_end = PORT_TC4, - .aux_ch_start = AUX_CH_USBC1, - .aux_ch_end = AUX_CH_USBC4, - - .ddi_lanes = POWER_DOMAIN_PORT_DDI_LANES_TC1, - .ddi_io = POWER_DOMAIN_PORT_DDI_IO_TC1, - .aux_legacy_usbc = POWER_DOMAIN_AUX_USBC1, - .aux_tbt = POWER_DOMAIN_AUX_TBT1, - }, { - .port_start = PORT_D_XELPD, - .port_end = PORT_E_XELPD, - .aux_ch_start = AUX_CH_D_XELPD, - .aux_ch_end = AUX_CH_E_XELPD, - - .ddi_lanes = POWER_DOMAIN_PORT_DDI_LANES_D, - .ddi_io = POWER_DOMAIN_PORT_DDI_IO_D, - .aux_legacy_usbc = POWER_DOMAIN_AUX_D, - .aux_tbt = POWER_DOMAIN_INVALID, - }, -}; - static void intel_port_domains_for_platform(struct drm_i915_private *i915, const struct intel_ddi_port_domains **domains, int *domains_size) { - if (DISPLAY_VER(i915) >= 13) { - *domains = d13_port_domains; - *domains_size = ARRAY_SIZE(d13_port_domains); - } else if (DISPLAY_VER(i915) >= 12) { + if (DISPLAY_VER(i915) >= 12) { *domains = d12_port_domains; *domains_size = ARRAY_SIZE(d12_port_domains); } else if (DISPLAY_VER(i915) >= 11) { diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index b37a95755b77..45eafe447546 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -164,8 +164,8 @@ [PORT_TC2] = 4, \ [PORT_TC3] = 5, \ [PORT_TC4] = 6, \ - [PORT_D_XELPD] = 7, \ - [PORT_E_XELPD] = 8, \ + [PORT_D] = 7, \ + [PORT_E] = 8, \ } #define I9XX_COLORS \ diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h index f95ff82c3b4a..4b31bab5533a 100644 --- a/include/drm/i915_component.h +++ b/include/drm/i915_component.h @@ -35,7 +35,7 @@ enum i915_component_type { /* MAX_PORT is the number of port * It must be sync with I915_MAX_PORTS defined i915_drv.h */ -#define MAX_PORTS 17 +#define MAX_PORTS 15 /** * struct i915_audio_component - Used for direct communication between i915 and hda drivers From patchwork Tue Oct 4 12:53:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vivekanandan, Balasubramani" X-Patchwork-Id: 12998275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C333EC433FE for ; Tue, 4 Oct 2022 12:54:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6473710E00A; Tue, 4 Oct 2022 12:54:52 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id E856010E630 for ; Tue, 4 Oct 2022 12:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664888086; x=1696424086; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=axpCy/cvmkX/nPyW7nDkGmLqafnYae9FB/kU22RDNvs=; b=mzbbrw8v+BZOp3W0rcw0O60YLPs93EgXIBRDd9ZHUHMdjvhDmFpTv+Bq TVGMeTpobqPEnZ2hofKezU/663dd0krSLmWqQWarwVOHnqXaVSpKL/bFQ XBN6IshGwdf4Z36z1LuIwBJVEVpz92VIIIGsRr10IQipbwilHSBmIpcIC S6XcMrvI5PECGc0iK6Gvtzfpx+iOseh47qcnYB8BtqdX3hIfwiT2wWutP aQkUa7Is1QSwdfrfOlDjAyEnMEuAb7AFudlcOV8W5v8HWG5vfY7TsqoPo H8Wl1RPH/qkLSsJmdCSTS3RG5b8GOh4Aq5h4+IAh+w9LNVol9bWdF5fVa Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="283268334" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="283268334" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2022 05:54:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="692478231" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="692478231" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 04 Oct 2022 05:54:46 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:45 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:45 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 4 Oct 2022 05:54:45 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.43) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hhRQm+ZsFOrxTbphUbT7/VeZ5H1DgLpLdv7Q4iSVSLCJ/KO/upZDP5uzu852WJxSLqIdLUodXIBlbHTV8OnW7iNw7jfaB0FZE3J6qZY3RhOo0zcJ41k5Ml3DLWcE2yRD+0UU2cPApUOOUr5ALclQAp7kbr+qiLhzv2nLL9s2Nbko0O9+hXfItNSWi2JxUE/ggFWjWC1RWNje8+jkhUCkr7yfBCrAAj42gjHRZvchsjqJj8Y/dhOUKesYx4640L4vlhR5r+p6D9xYzWHZ26l52kYHNStAXOc6by29zVuSwluh9ESX/leF5TuQ9yVN33avGtti+8y+2XpG9AqVGjwSRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VRMBqPWpEV4xajyxjb92OC1osBEUvd+wrmDWaXKHyDw=; b=lx5e1nc2jJtfBa0VssmLeyJuT4KJ1pwra7Jh9NvWtQPn9C1qSroIGuCUfftsjRNzmEeuUy1e1tJz/99XiLcXincFHOX3AnvTEWvFjj580BujRfJuOZ8f54algVF9+K4+IVfzHoeeXmZ4Ho25TaJUUANDlv8n34VL3q2RAdD4DNYbKfk8iVCqYBaxn9duEgYAvhPFFbignOZ7MD7X2nJQgWHeJBGzuFX1Y6zmbDgOWiuM3HmSyyR24rfKmwJ4CwsstXBnItf+MUZ7D0DmMPL41sbkrf1at1jacnSIb50bwOyias71RE7mtD5KsH6f8MM5GxRwxLVQL37KdC6ofKqRjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) by PH7PR11MB6053.namprd11.prod.outlook.com (2603:10b6:510:1d1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Tue, 4 Oct 2022 12:54:43 +0000 Received: from DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67]) by DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67%3]) with mapi id 15.20.5676.031; Tue, 4 Oct 2022 12:54:43 +0000 From: Balasubramani Vivekanandan To: Date: Tue, 4 Oct 2022 18:23:43 +0530 Message-ID: <20221004125344.228294-7-balasubramani.vivekanandan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> References: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> X-ClientProxiedBy: PN3PR01CA0116.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:96::6) To DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR11MB1897:EE_|PH7PR11MB6053:EE_ X-MS-Office365-Filtering-Correlation-Id: 703e825b-467f-4d46-e87a-08daa6079bb7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KHuAdwqCC/6EtqmJ0KR2P52HAvQBoAOtlZwvLpf9q0ssNwUep0vtuiIJxo2+/lCzoiU9B+sd5cxmTv0l74BseH+YTmR3RITrZJSQwBgT6m2/pLQfsFS6LLf5H5ojI4KeT1ZLm1MCCCdOOz1TNsi4j45uAicPLh8oCLW8i9FZSIei8HIb/vA93J9f9r+q6OEd+RvIFA4nDePWGFnOPiWPbx2DpEqTAoI/cez20Hd31pwQBH5zThFxqbDKO0S3DLdnk8HTh6diMPVIDuxJDO03sqbKuzvDxXdeA2gUYO5WjplK1L3BPsmngZtd24uAzFjdnPXNPRwpJPVBc2CDVDwDB+SajpVUp9+5uKxPyQ800BESDV87hBShzMZ9c/CmR7gpJ52tM+IZnCs8DCyMGMcGL5S6ltuj3k/UiD31SrNJUVYX/0xP8gJR0uxOJx6fqlUciYy9UdBybMjFDEsCbiIycwLUTTSwZTWh+dcObTC9Vc0TXep2aO2aLThmdAQTScQ3dqZah8e/BFHoXzwoTyH8+jmCGuQRgS3s6Kdbutd911FUc8NyeHQ3NC+i9nSL5SiyBBm0FXLGAO7WuYAU4PPK9W99+TDGsMAoQ3HKdzuCv5jFNDknSQX+0sdZ/wt1ntbJ8uNDnhDEeD874hZorsnefQNbEaeYQUsRRDcq/YdCzzXnnarHeV+4Edcc0FcncD988ve2+WFJyQyWoZEiETdleg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1897.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199015)(186003)(38100700002)(6506007)(44832011)(26005)(2616005)(1076003)(82960400001)(5660300002)(2906002)(41300700001)(8936002)(478600001)(6512007)(4326008)(8676002)(6486002)(66556008)(66476007)(66946007)(316002)(36756003)(6916009)(54906003)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SVKOJ3L3GbHhaViW8Z/cgameCOP2qpK5QURG1GQLkFcePavm7OMdPw6F5aboXtEUEMPA03yfD8oD4QOTsneWbaLT1khEqmVfIU4pkuiwJE1/sQ1l21ipooraBb/Ntq4/1E3US0VpXCJeYFCFAueS0gglOIzGCdnce3OOlP3OPoc8j51GhmTyfanQgQnTSFdvK/pq5j5uDQt3vfdvAcnzM2RNrkTpNgUDpYsLsbm1DqU5GqP6Id1WPfe3RgVwZUMmz/O/vbGT/i2z80AEu+iDSHnfWJmmnboEL5ndSR08YfUqho+FLIW6+XBwdJoMuztaTbAy0L8V+2RpWkGX3E6/UiuwGKG/OD+yI5NuLf0JbFM0iZgqxSVDx8RYL9HvS7DefLpwTIkjZzYcXsu17lsjX9OIQxdUYtiIdh6gD86TiJeelJD+tEPZH6jl8jfrmM7I5g+FBrsR3vGUxtRpd2vRClWGdOhkyHssi4Q5i0COvc9AYKO5d9xqM2pqOXt4N7cXJxJqu6IzYCzoHMks4JLL0klvhrjpaLCfS3fZhalaX3a/P0qdbewEpCqj61IF+/4MCb1MPfURqZPVNAaDVFsPZA/0plftvEUIvTT8d1XIxVJiUCYq8xJcWoipiPe1uD+nDZRAsX17uSCX9Q76wudnpdAnuFK2CWZpvloCkc3wyL1cJS29CbPVCgGhyIhTdxbonQh5vwu+wfaQ1ZWYHEv+4Nva7YAxN5LmzQrG6EzaAviHlEZBuxgDto4v/GnO2SeNfpn3ViCBc7MI2AZa4OvONAHIGDyKO81WN9uF9u7aM8LB75UgWAy9L0dPc1vCeeO8olTgieSkR+4aRqzfQ7JGuDYKPE2AjRsxGIHpiytPWRx1agp3nnny4rSiM8yQC0SpVjy+LrkTrEemCERfAoOIa24H1FAr9Z8atkPjUXL65ox3bjPixe9kFQHKw5HHxyZKGxPoSlPAlJAVG5Ino+TKnyld8chzULEwithkPiZFie93R7+eOcPoNcecCxEeNLGg8tQMbPLbHRgoKEj6upsMKM2eox+fnFcAZwMJhomy3v7MyYG0Pd9gWN7ghFIZQ6Rii1lJ4W3mCRZvnBdfCPnkzL5cRS7eiA/cKyyutIvA5gLoedUPQZkY1KGnQIzImfxpt+3lz+47kw5DDSm4R1Ee+MbQ5APOetSHLd2+9mVzgqg/1z0LXPrE02RhGOnvCKlqG/gf9KTCGBFjFufDFw+NMeXRlpVcjaVKnMZ0Ztz3GqrXgJQFD+Z2F013FizERd+8OtisCIGiiC42FX3GIKsIjdQhZNMPaFbKROlKnae2qXXKpWE12cdEtIA/6m6nOkWPaaDraouWceCKYOlmLyPmrqDtHn2KBrSC3qEfavYMuPR80qNslnB2yYxGsYurIOJ8aXLhcSdyml5fAA5XjbQj6HkPSuPWTgzb+G7vRHCRuEZbQXOwXybmX8LU4PMR4HdigFhxuDAXe0AhGqMugxZCli9aqXLupcYfxfGLrBOoJ3zdoy5tjuLUvevVFn1BPDAe/+NYSkMWuJFtIC4xtFtRaaGSzjYN/gHN0bFyTM8DpDeKkD4EtNbQc1W2njp7DxpLuV/JFPAJ3szBDA2J8sDTISBra5vMExhqZSkfsRxysLI= X-MS-Exchange-CrossTenant-Network-Message-Id: 703e825b-467f-4d46-e87a-08daa6079bb7 X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1897.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 12:54:43.5099 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i1xbdHjiYx72y2jfutdvkiUs06f2qfxGwt0xsWiKZdzw0l4bwvKzcIZJNz9AGjkE3sSdBVUpiW/X7EfbsXTZ3nxDeZdgSiFrSSkCaKQd1DsK9QpdU0oqycdb2dh50yyt X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6053 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH v6 6/7] drm/i915/display: Fix port_identifier function X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" port_identifier function was broken when TypeC ports were using enum aliases. It would return wrong string for TypeC ports. With unique enums for DDI ports now, fix port_identifier to cover all ports. Signed-off-by: Balasubramani Vivekanandan --- drivers/gpu/drm/i915/display/intel_display.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index 62604cadf0b8..4a5f7df7492b 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -250,6 +250,18 @@ static inline const char *port_identifier(enum port port) return "Port H"; case PORT_I: return "Port I"; + case PORT_TC1: + return "Port TC1"; + case PORT_TC2: + return "Port TC2"; + case PORT_TC3: + return "Port TC3"; + case PORT_TC4: + return "Port TC4"; + case PORT_TC5: + return "Port TC5"; + case PORT_TC6: + return "Port TC6"; default: return ""; } From patchwork Tue Oct 4 12:53:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vivekanandan, Balasubramani" X-Patchwork-Id: 12998276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1BD7FC433F5 for ; Tue, 4 Oct 2022 12:55:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3905E10E5E1; Tue, 4 Oct 2022 12:55:00 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4EAEB10E630 for ; Tue, 4 Oct 2022 12:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664888095; x=1696424095; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=BAU0gC84rvBXkJYWMsECUTKbK8VQt8/4996dACIVH1k=; b=GBVraQ9PC+ECMmv9DbMFl9Cqe8Q986THxf7/D/9jx4TvqUAh+O7USSlH M8fzPBgC1NtGUIN+Tqzuej9j/RZX5RtIOddSdB87OKpCYkJuw6KHmSg1D BEMQVfRcHyQcuTsJ35DBs8kZEm7hbBHb/EJb/2RjO0eCzbpR1bA9UaQhm dyS3Q7SCDs6YstJTvpuDkaa1n73L9NIGSZOl+fepOvA2izCiNJiADsi6Q 59CLum07UuOT+JON/43kd9NCECfLkjI+8yaw8dGB6+hnd0zB9vbwRYIyv csbfQfEOkoH/hFHpD6h2gWOSm3N2bnM1RGvMcMzll1X9kg0Dow6b1Y+XO Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="304444187" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="304444187" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2022 05:54:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="692478261" X-IronPort-AV: E=Sophos;i="5.93,157,1654585200"; d="scan'208";a="692478261" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 04 Oct 2022 05:54:54 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:54 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:53 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 4 Oct 2022 05:54:53 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.49) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 4 Oct 2022 05:54:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S0IdNI3j/jvY6awx0MSS0axY334N6bhCLsgt1EolGEwOUIEcA7rwbmGH+j3KdribCELpE/dqWj/g9kz3DzzKXqjOiL0uQGYK2yQlUcwq57XI6EEGWg3PBlTLQLjfUajrRCX4IE/NZTThHQX7wqiqIyTOKZY+IfMjC16A25acdDraZ17Y1FFVY8CBhy557WTE34U+Xywp9WRxc4UaCj+8CRnsoA2kRI3Yve3odM6rJ23EfMlB6iwFdV98CBvYW+o1uHZBrK40YlH+bmjHmwzYvXDp/rO9wUogXAm4Q00jdVHTXowwUfBKBDj1oRXUBX6a3SqSYQVVhOSARYHGPW8NwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=thsGNY98TalJdJjyzlld9eBpipGT3bNbNJrRl6mwyXQ=; b=C6nxX0/bXdrmZhBiTk9+GBeQ1KaxUSpTAp6PV62DW27Tk7dkr4ngkM/VN9R0UCnK5g/nE/5qFUYTbm0SxbUpp7I/9EQU8jBHbKE9FK1U6Wvt0fn+ec9UBK4P2RSP7iDzq4O2mFoA4YkX+YEFH1KSoa+AR+nCGBP9o35o8eV7w6EwgRPR3G2q5gpioeh0SRvJb0AS6ga7F91v71v9JvtdfvM21gsq3oDnZW+aVDO0QGqWvhaihl1AJLstOc5S24rbcqD/2WjW9nNjqu3xlPpG37FqOwNHNON3nlvcgtuMjBtAMPBiIwIynE2Xvpf9jC5Z1qD9Qts025QVfAB2YtTaVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) by PH7PR11MB6053.namprd11.prod.outlook.com (2603:10b6:510:1d1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Tue, 4 Oct 2022 12:54:51 +0000 Received: from DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67]) by DM5PR11MB1897.namprd11.prod.outlook.com ([fe80::c0e8:f5ad:37d:ee67%3]) with mapi id 15.20.5676.031; Tue, 4 Oct 2022 12:54:51 +0000 From: Balasubramani Vivekanandan To: Date: Tue, 4 Oct 2022 18:23:44 +0530 Message-ID: <20221004125344.228294-8-balasubramani.vivekanandan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> References: <20221004125344.228294-1-balasubramani.vivekanandan@intel.com> X-ClientProxiedBy: PN3PR01CA0062.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:99::11) To DM5PR11MB1897.namprd11.prod.outlook.com (2603:10b6:3:112::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR11MB1897:EE_|PH7PR11MB6053:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d66fc8f-23b6-4e66-f540-08daa607a091 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j9N9zHe37/JrJgEo95lpsV1utWi6siwa/BTpaVfF6GbpF6W4qYF6QVRuUpHbajoAsFf+fDbDHOMDD3atV1YkOrVp3TJbop1lfGXOoKVYZ/LVZynTmtP7rCibkhUkEv2uYK4a5FzA0UZu4G1IQKN/9YwX3ulY2ygU/XBpLF1oqmHvYiLBC93k9O8Y+qZO3uV/YQUUv7JcU/vZ15b4Zaxkf8GTKUCQfDWUhC5Mi3whmrM+I41qD+U8Vn8wKggMxRLHJvFta2DM4Uf+vF0ce9m8C8XvpvbZFqQSWG0a0GIc9e1CDopG2XyuQcSb8B7FOuvQie9CkLDhuaN/cVLsJc6fVFIefdJMYMszvkCyTIIBh5qF6CfUBCx8HxU4b2md5RQd0RRyrIcES54loSH1QJ4+jGEcuTVSpLiF3OQdlBcvZ2wOslrkb9tQUPswJ1FxJww0TPUDKPfd1JcZ9HKD6yX4BreO8wliEj4zCJtt9vMFB2M0COe5Q3UzMlFv1VXYLM9gKM3lJbMvNzqj9auYGEned33Us+7chNgSkHUXssfJRvDe96v91O4gIyok/jzail+54dfzZrlm2CkJ6uXFnNK4m8z6Dw5r4qIa83t4PZ50RyYO8a61SMITzGkZsE3lAlbN0vTHnaIwSL/B9Wkc76d4l8uvrykv7YoidgIp2eGznbMB8nq6Y+jkzaaLuEAIQM6XaJuoCjG5MF0xda2NM6p0og== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1897.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(39860400002)(136003)(376002)(346002)(451199015)(186003)(38100700002)(6506007)(44832011)(26005)(2616005)(83380400001)(1076003)(82960400001)(5660300002)(2906002)(41300700001)(8936002)(478600001)(6512007)(4326008)(6666004)(8676002)(6486002)(66556008)(66476007)(66946007)(316002)(36756003)(6916009)(54906003)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: v4Zon6oXWbDb4RkqJDFu/T0WB0eeo64tG48NaHTkWVuTCvrBwACl4vmrdJx4SjKg+7EthQCnTG1jfQlKv47rtJUGTYrK8SuwIkrRHhahilUHh/TuL3QnStkoFYDrC5aM9JagyZ5/mfxxccczUENkLtIYW/fAv9OAUou9RziKoudCeUvwAB6MzV0GNZA2FYNRP5hocHoQFXN9QHgao1x4K7EePAqxKx5EiHTdGkVLS0RpUIY0lNyBzzDAYjGksaRAWIXK5IlOR4tdJi65vNRUIzQ3JSQzgTjHVpjVSgvgJZD2zpB3EbZeZkOPx7ltVZ+AVSeln27htPsVPajPCVgn5jZCQ5HtznCXyWJBIwECrU1c6nCMiePJgv6cquj0Xg8sXrP8eQFq49fGxOb6JPiehf4O9ThcCri91Pz+YRE1NXCwXsup0cvg0qgchIcOfXs1kS59mSxPCKhXH1VuMwsqnpbSAzDHF9yN7RB5SguUr2eB8moCQuLwFk4Eb3TgKlH24otDPN1PXhdqEfRjp99Gl7TLoOCp8FzvkmYnaOH4c6NUaD84LqPsURzQemH1Wl3mMxANwtdrMt2e+CudgLjqDYSstkQirQ4Szop9hPKE+DxCoclbPH5JHUMP184hymBZgAZ0T32L4voGE2E5Iu/4ncBhViO2suSnW9v5uiS9vJs12fEJ/L1mxHGzVHrNDvFyoegXA1ZzQ6alQG7qZwmBnaYiiTm9pRvQNHfl4xr/B0VwN4cgd72I/rjzbgrX2y/I23roYT9F8x2bfG66QIXJj2i3EoTegS4dmK7WhUhXNPKkO1+JTc+IwS/gbX8Ou85Ir/J/VC79DTbqKJqaBBXZFgu/FuPlCh9uJbax2m0Iu/w/bw3zGqWOHMPPV3pscoabSIpzL9bAWKok5T5YoHQtUzf+ZZC6ye7iGlbuzh4fl/nF7iwUY9tZLBDaC9P//DNb4Qc9fWozM2klnhaBpeY0OqLpoYSSPXmWe88bow0kw2EeJr0gI89hQIFVFPOd7l3ufkxPZX6SUxwYn8XtRtwug99e32h019aXaxRsAMBKKX0MDK46tDAJqtHDfErBjSv9M1A/f/H3oZy1mzYWBkibnNZfqAnRzNFZVSuVf3cTyIK9whM+5RreiIB3IHaHAJIdEZWUgc4gmF1Hye5vLMk76QqDOn2jpGuaifQnEC+3Gkfw/Wl5YgLrR3thTjOUWjTDxjDDTjziP8cfYK+pPkoDojBZPUArU3iSh1X5jrL+0/ONMshqH7iFXVZHJZmtOmKwjyrR0OJWflou0Rtx08GL5ZUkMGKNG9JSH8b3gGH54MjfRYpAQ1WGCgNjVbVV5gycLW9koqQzz9f0lPy2FA+ZKSZoVZ3tJuN545A9i8XIAREqpipl4Rjk8XCxkcmaPpIYI8vnbBqYSxiuwNIlC4y5KUjXix1pjOPiFhq8hNZH92PBizFAMHGHDL9lEq3Y83HON55L0nOPXWW/2EVadv8iOMvYWDzGhXKSVR02MIwCoIU4DWFwGhEa19PXGoJy1WnfhIiSy68c89ff5/sv4gUa24/4rTguCjM9wef/LGdkXSKRN8ijcBuuQMZl875ycfyV0Skut9isQWS+3zmPMlqxYLzqpU+AyaJtUfc6CVw9O/k= X-MS-Exchange-CrossTenant-Network-Message-Id: 0d66fc8f-23b6-4e66-f540-08daa607a091 X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1897.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 12:54:51.6654 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K/UdOYx6EfDYlGooEdwNbvqC3NAxdtNQd9dCcGtB7mx9o1tvOJ+zWZgmx9mKWPCpUgsSJSAyBL1Yb2HyKYSugHc36sLYMyI1NmxtVKK11hHDWJuB3KhVM49nPnreC/B1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6053 X-OriginatorOrg: intel.com Subject: [Intel-gfx] [PATCH v6 7/7] drm/i915/display: cleanup unused DDI port enums X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" DDI port enums PORT_G/H/I were added in the commit - "6c8337dafaa9 drm/i915/tgl: Add additional ports for Tiger Lake" to identify new ports added in the platform. In the subsequent commits those ports were identified by new enums PORT_TC1/TC2/TC3.. to differentiate TypeC ports from non-TypeC. However, the enum definitions PORT_G/H/I and few usages of these enums were left as it is. These enums are unused as of today and can be removed. Signed-off-by: Balasubramani Vivekanandan --- drivers/gpu/drm/i915/display/intel_bios.c | 3 --- drivers/gpu/drm/i915/display/intel_display.h | 9 --------- include/drm/i915_component.h | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index ab472fa757d8..b0dfb37e402a 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -2404,9 +2404,6 @@ static enum port dvo_port_to_port(struct drm_i915_private *i915, [PORT_D] = { DVO_PORT_HDMID, DVO_PORT_DPD, -1 }, [PORT_E] = { DVO_PORT_HDMIE, DVO_PORT_DPE, DVO_PORT_CRT }, [PORT_F] = { DVO_PORT_HDMIF, DVO_PORT_DPF, -1 }, - [PORT_G] = { DVO_PORT_HDMIG, DVO_PORT_DPG, -1 }, - [PORT_H] = { DVO_PORT_HDMIH, DVO_PORT_DPH, -1 }, - [PORT_I] = { DVO_PORT_HDMII, DVO_PORT_DPI, -1 }, }; /* * RKL VBT uses PHY based mapping. Combo PHYs A,B,C,D diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index 4a5f7df7492b..5a55b9f43ce3 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -208,9 +208,6 @@ enum port { PORT_D, PORT_E, PORT_F, - PORT_G, - PORT_H, - PORT_I, /* Non-TypeC ports must be defined above */ PORT_TC1, @@ -244,12 +241,6 @@ static inline const char *port_identifier(enum port port) return "Port E"; case PORT_F: return "Port F"; - case PORT_G: - return "Port G"; - case PORT_H: - return "Port H"; - case PORT_I: - return "Port I"; case PORT_TC1: return "Port TC1"; case PORT_TC2: diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h index 4b31bab5533a..335822d6960a 100644 --- a/include/drm/i915_component.h +++ b/include/drm/i915_component.h @@ -35,7 +35,7 @@ enum i915_component_type { /* MAX_PORT is the number of port * It must be sync with I915_MAX_PORTS defined i915_drv.h */ -#define MAX_PORTS 15 +#define MAX_PORTS 12 /** * struct i915_audio_component - Used for direct communication between i915 and hda drivers