From patchwork Mon Sep 12 11:18:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973564 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 3272AECAAD5 for ; Mon, 12 Sep 2022 11:18:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FDA110E39B; Mon, 12 Sep 2022 11:18:30 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id D78E910E397 for ; Mon, 12 Sep 2022 11:18:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981500; x=1694517500; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=XOmLcosqbgS8x27heBVkD90Pvugtc0lS+iNUJCtA1qA=; b=SgN4gPGNHCNi+5c0D9T7FnRCTwTtqGFyqK4a1NTnD/jM7B5Bi/B6fLNV W/wLBw2b7WGkSEOIqQvG5S0CT2RtWChT0356jQtUOVKXSmkK3nYCqzFNd ZSMXLKT8GUJlhaba5+/49gXW9q2pBcJfpZNykS3ZHZaBYcTqsTkOSEytI 09gg2qLTU8LYJZGkvPWNxm2hVSbYuOQSKIbUDVd1CxDIeA00ANosXlw6O NFHDSKAYUeT28kBxENJx8/GJ5o0B86yY+4VmzfgsRNhoRt7Z1+zvuKI9U 6iFFKH35F+5VI4n5LPNbvbGPBgiKA+g6ptDTRU8qw538MbIS7mUnFOQqV A==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="278232093" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="278232093" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="611727272" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga007.jf.intel.com with SMTP; 12 Sep 2022 04:18:17 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:17 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:00 +0300 Message-Id: <20220912111814.17466-2-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 01/15] drm/i915: Drop pointless middle man variable 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" From: Ville Syrjälä No need for the 'procmon' variable here. Just return the correct thing from the switch statement directly. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/intel_combo_phy.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_combo_phy.c b/drivers/gpu/drm/i915/display/intel_combo_phy.c index 64890f39c3cc..71d7aece1dc6 100644 --- a/drivers/gpu/drm/i915/display/intel_combo_phy.c +++ b/drivers/gpu/drm/i915/display/intel_combo_phy.c @@ -53,7 +53,6 @@ static const struct icl_procmon { static const struct icl_procmon * icl_get_procmon_ref_values(struct drm_i915_private *dev_priv, enum phy phy) { - const struct icl_procmon *procmon; u32 val; val = intel_de_read(dev_priv, ICL_PORT_COMP_DW3(phy)); @@ -62,23 +61,16 @@ icl_get_procmon_ref_values(struct drm_i915_private *dev_priv, enum phy phy) MISSING_CASE(val); fallthrough; case VOLTAGE_INFO_0_85V | PROCESS_INFO_DOT_0: - procmon = &icl_procmon_values[PROCMON_0_85V_DOT_0]; - break; + return &icl_procmon_values[PROCMON_0_85V_DOT_0]; case VOLTAGE_INFO_0_95V | PROCESS_INFO_DOT_0: - procmon = &icl_procmon_values[PROCMON_0_95V_DOT_0]; - break; + return &icl_procmon_values[PROCMON_0_95V_DOT_0]; case VOLTAGE_INFO_0_95V | PROCESS_INFO_DOT_1: - procmon = &icl_procmon_values[PROCMON_0_95V_DOT_1]; - break; + return &icl_procmon_values[PROCMON_0_95V_DOT_1]; case VOLTAGE_INFO_1_05V | PROCESS_INFO_DOT_0: - procmon = &icl_procmon_values[PROCMON_1_05V_DOT_0]; - break; + return &icl_procmon_values[PROCMON_1_05V_DOT_0]; case VOLTAGE_INFO_1_05V | PROCESS_INFO_DOT_1: - procmon = &icl_procmon_values[PROCMON_1_05V_DOT_1]; - break; + return &icl_procmon_values[PROCMON_1_05V_DOT_1]; } - - return procmon; } static void icl_set_procmon_ref_values(struct drm_i915_private *dev_priv, From patchwork Mon Sep 12 11:18:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973563 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 73EF6ECAAD5 for ; Mon, 12 Sep 2022 11:18:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C671B10E3A7; Mon, 12 Sep 2022 11:18:26 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id D01F910E39B for ; Mon, 12 Sep 2022 11:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981503; x=1694517503; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=pPqU9X7KrynXolwsVpK5cbnGQW+NDQfvS3Xfcc4sOJA=; b=bIsXUNEh4Z2hycPigEW+QLEYN80JX6QFLGTahIlbs2soQUMrcrUC84zp dXZ3BYCduLaM/HcKMNJwp9BjE/EZtbdeCQQ62d155HvkR8KNnNm5JOYmW OSZr3SmAJavp/vyYpY7od6bh6qIcAAZzHPXgaOwsbWh1SepTF3mR6oSmt Y+KkPq/isfM33hpEBPpVUGFL4o2fhxOJIZ7CVOUdH4KT4s9RqDp/S6EQQ XhWSlrkjhJ3Gq63pvwuPU8NZuZiRpOMXl3UT4vAAYa7sKhXIugFzHs3kt b8NJKjVj2Ei/OjbHrboxxQckDnD5nMlnC5MrkOyBW+atvr1Futi1WL4U5 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="280858368" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="280858368" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="678044002" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by fmsmga008.fm.intel.com with SMTP; 12 Sep 2022 04:18:21 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:20 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:01 +0300 Message-Id: <20220912111814.17466-3-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 02/15] drm/i915: Clean up transcoder_to_stream_enc_status() 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" From: Ville Syrjälä Drop the pointless middle man variable and just return the correct thing directly. And while at it change the return type to u32 since this is a register value we're returning. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index 88689124c013..35360dd543ac 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -19,28 +19,20 @@ #include "intel_hdcp.h" #include "intel_hdcp_regs.h" -static unsigned int transcoder_to_stream_enc_status(enum transcoder cpu_transcoder) +static u32 transcoder_to_stream_enc_status(enum transcoder cpu_transcoder) { - u32 stream_enc_mask; - switch (cpu_transcoder) { case TRANSCODER_A: - stream_enc_mask = HDCP_STATUS_STREAM_A_ENC; - break; + return HDCP_STATUS_STREAM_A_ENC; case TRANSCODER_B: - stream_enc_mask = HDCP_STATUS_STREAM_B_ENC; - break; + return HDCP_STATUS_STREAM_B_ENC; case TRANSCODER_C: - stream_enc_mask = HDCP_STATUS_STREAM_C_ENC; - break; + return HDCP_STATUS_STREAM_C_ENC; case TRANSCODER_D: - stream_enc_mask = HDCP_STATUS_STREAM_D_ENC; - break; + return HDCP_STATUS_STREAM_D_ENC; default: - stream_enc_mask = 0; + return 0; } - - return stream_enc_mask; } static void intel_dp_hdcp_wait_for_cp_irq(struct intel_hdcp *hdcp, int timeout) From patchwork Mon Sep 12 11:18:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973567 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 06A8AECAAD5 for ; Mon, 12 Sep 2022 11:18:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3244710E3BE; Mon, 12 Sep 2022 11:18:51 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id DE47F10E3A8 for ; Mon, 12 Sep 2022 11:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981506; x=1694517506; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Vr0L/xNTMQcN8ujNFjrBgsCu5SOCc6Xm2JyBRdo09JY=; b=iQoTbnGcv+jquom1EweFX9pNlIccDz9aqL80pDgcGLgdiKPvhX50UZSS 52NnOgZmR0/xkW7BfOxO3fL6YdVMKMgkfvuyXzlfN7HEn6NZa1OtIidPK CUtqOMQVGlEGfV21bsIfMjbf4wMK6nI+VJwcsc5mh4REzRWrE2FKMPpb8 Jq/xTyknLDCuChXmxQzoaAlbu65BmiPQvld2o9lJZBZXjK1KLbnTGAoll PrwSmepWhVV8mbbKvVhsI9MqQLwBvCNLoi4QKpUjUlq0nqAkp36qk58+f pShdhAQVrq9FRNGN1LO9h312GJU7YRh4oO8C/DJhrQ3xoBtFCiuAzH5Vq Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="284860882" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="284860882" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="646415997" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga008.jf.intel.com with SMTP; 12 Sep 2022 04:18:23 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:23 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:02 +0300 Message-Id: <20220912111814.17466-4-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 03/15] drm/i915: Drop pointless 'budget' variable 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" From: Ville Syrjälä Just return the thing directly from the switch statement. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c index e5fb66a5dd02..60b3277a857b 100644 --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c @@ -708,8 +708,6 @@ struct hsw_wrpll_rnp { static unsigned hsw_wrpll_get_budget_for_freq(int clock) { - unsigned budget; - switch (clock) { case 25175000: case 25200000: @@ -742,21 +740,18 @@ static unsigned hsw_wrpll_get_budget_for_freq(int clock) case 222750000: case 296703000: case 297000000: - budget = 0; - break; + return 0; case 233500000: case 245250000: case 247750000: case 253250000: case 298000000: - budget = 1500; - break; + return 1500; case 169128000: case 169500000: case 179500000: case 202000000: - budget = 2000; - break; + return 2000; case 256250000: case 262500000: case 270000000: @@ -766,18 +761,13 @@ static unsigned hsw_wrpll_get_budget_for_freq(int clock) case 281250000: case 286000000: case 291750000: - budget = 4000; - break; + return 4000; case 267250000: case 268500000: - budget = 5000; - break; + return 5000; default: - budget = 1000; - break; + return 1000; } - - return budget; } static void hsw_wrpll_update_rnp(u64 freq2k, unsigned int budget, From patchwork Mon Sep 12 11:18:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973565 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 52115ECAAD5 for ; Mon, 12 Sep 2022 11:18:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A742F10E3A8; Mon, 12 Sep 2022 11:18:39 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE2A110E39B for ; Mon, 12 Sep 2022 11:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981509; x=1694517509; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=VgrHLqkg9tPpVlt22nIY4nKlabJeC99jWw4Wi4AH+xU=; b=Bk3jmNTJzPMUVq8jbR5caG67VFkQRdhHseYpALs1mHqHGIDmNGb2xdD9 pZhxaR0lFbhHJHIJ/PCkZt0otgbPYGfY+lIoq233Ilj6lcydS4AiFUkXR dz60dWM3VGKssfsN4YU4HRsPV6MG3BUtSWp3/AyY+//PjH5u/CKmJmQHl tBMaVoQ4VzelLnv9uDw2X+ogmxPl31Fle/fX/mt14OGP2Sqd274lTMMq2 k/7SF5TvMlu0c2yukjjWmOZJg14CQPpSVjbX/SAils1YBC00SLvYO5bwx rjPS1hL+1ensXJOOTKVsAkYVo/JiWORjjfRFdgSqJeSE6mlAz0eo95l5A A==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="324072010" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="324072010" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="593452363" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga006.jf.intel.com with SMTP; 12 Sep 2022 04:18:26 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:26 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:03 +0300 Message-Id: <20220912111814.17466-5-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 04/15] drm/i915: Use BIT() when dealing with output types 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" From: Ville Syrjälä Most places that deal with output types already use BIT() but a few places still use manual shifts. Convert the stragglers over to BIT(). Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/g4x_hdmi.c | 4 ++-- drivers/gpu/drm/i915/display/intel_crt.c | 2 +- drivers/gpu/drm/i915/display/intel_display.c | 4 ++-- drivers/gpu/drm/i915/display/intel_display_types.h | 9 +++++---- drivers/gpu/drm/i915/display/intel_dvo.c | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.c b/drivers/gpu/drm/i915/display/g4x_hdmi.c index 5fbd2ae95869..5606c667e422 100644 --- a/drivers/gpu/drm/i915/display/g4x_hdmi.c +++ b/drivers/gpu/drm/i915/display/g4x_hdmi.c @@ -585,7 +585,7 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv, } else { intel_encoder->pipe_mask = ~0; } - intel_encoder->cloneable = 1 << INTEL_OUTPUT_ANALOG; + intel_encoder->cloneable = BIT(INTEL_OUTPUT_ANALOG); intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port); /* * BSpec is unclear about HDMI+HDMI cloning on g4x, but it seems @@ -593,7 +593,7 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv, * only one port anyway, nothing is lost by allowing it. */ if (IS_G4X(dev_priv)) - intel_encoder->cloneable |= 1 << INTEL_OUTPUT_HDMI; + intel_encoder->cloneable |= BIT(INTEL_OUTPUT_HDMI); dig_port->hdmi.hdmi_reg = hdmi_reg; dig_port->dp.output_reg = INVALID_MMIO_REG; diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c index 4a8ff2f97608..eba58345619a 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.c +++ b/drivers/gpu/drm/i915/display/intel_crt.c @@ -1044,7 +1044,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv) intel_connector_attach_encoder(intel_connector, &crt->base); crt->base.type = INTEL_OUTPUT_ANALOG; - crt->base.cloneable = (1 << INTEL_OUTPUT_DVO) | (1 << INTEL_OUTPUT_HDMI); + crt->base.cloneable = BIT(INTEL_OUTPUT_DVO) | BIT(INTEL_OUTPUT_HDMI); if (IS_I830(dev_priv)) crt->base.pipe_mask = BIT(PIPE_A); else diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 2d0018ae34b1..53b7ee6e8a0a 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -4565,8 +4565,8 @@ static bool encoders_cloneable(const struct intel_encoder *a, const struct intel_encoder *b) { /* masks could be asymmetric, so check both ways */ - return a == b || (a->cloneable & (1 << b->type) && - b->cloneable & (1 << a->type)); + return a == b || (a->cloneable & BIT(b->type) && + b->cloneable & BIT(a->type)); } static bool check_single_encoder_cloning(struct intel_atomic_state *state, diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 3b7945aad22a..11f083cf1124 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -2040,15 +2040,16 @@ static inline bool intel_crtc_has_type(const struct intel_crtc_state *crtc_state, enum intel_output_type type) { - return crtc_state->output_types & (1 << type); + return crtc_state->output_types & BIT(type); } + static inline bool intel_crtc_has_dp_encoder(const struct intel_crtc_state *crtc_state) { return crtc_state->output_types & - ((1 << INTEL_OUTPUT_DP) | - (1 << INTEL_OUTPUT_DP_MST) | - (1 << INTEL_OUTPUT_EDP)); + (BIT(INTEL_OUTPUT_DP) | + BIT(INTEL_OUTPUT_DP_MST) | + BIT(INTEL_OUTPUT_EDP)); } static inline bool diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c index 5572e43026e4..167c9b7318f8 100644 --- a/drivers/gpu/drm/i915/display/intel_dvo.c +++ b/drivers/gpu/drm/i915/display/intel_dvo.c @@ -491,8 +491,8 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) intel_encoder->pipe_mask = ~0; if (dvo->type != INTEL_DVO_CHIP_LVDS) - intel_encoder->cloneable = (1 << INTEL_OUTPUT_ANALOG) | - (1 << INTEL_OUTPUT_DVO); + intel_encoder->cloneable = BIT(INTEL_OUTPUT_ANALOG) | + BIT(INTEL_OUTPUT_DVO); switch (dvo->type) { case INTEL_DVO_CHIP_TMDS: From patchwork Mon Sep 12 11:18:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973566 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 0A3D9ECAAA1 for ; Mon, 12 Sep 2022 11:18:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DD7E310E3B7; Mon, 12 Sep 2022 11:18:39 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id F3C9410E3A8 for ; Mon, 12 Sep 2022 11:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981511; x=1694517511; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=3MH8gegRdOgwkHoIcEqkqMqrqZmjQeDDIy5Qicgi8so=; b=gU0nEFvZBv+SvfwSx7heNPmMdxCNKa5sdcRI5fYowUVMm5nZTK2j0oyX 1vu+Y66fAFBqshdsjg8nETunsnhJytVGYXb8tQ/R/lv+4n+bAQDXcNUt/ P5Gyx3KIvLnPTJ9977LUEVOgs6lh6hBnermVQ6rl2IvobltULpb590Dp+ KlHPEQ4LSFkyRt+sfHoPvv6ECIWHRPNelFxSUMZTcU0zQJyi4w1ll4SdK uB4HjJZD5WsgC2ui5KX7NUzcvxFgo2NL0jdzSYdMHgCmtWNDgd75ZYWUB LZXualZu6YCWXxNdTbgjhg7MQ8vVdEMFfMVcwGmI3QH4VgEERd1WJJ9CE g==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="324072019" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="324072019" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="649213560" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga001.jf.intel.com with SMTP; 12 Sep 2022 04:18:29 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:29 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:04 +0300 Message-Id: <20220912111814.17466-6-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 05/15] drm/i915: Pass intel_encoder to to_lvds_encoder() 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" From: Ville Syrjälä Most of our encoder type cast stuff already operates on intel_encoder rather than drm_encoder. Switch to_lvds_encoder() over as well. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/intel_lvds.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 9aa38e8141b5..6fef829e855b 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -78,9 +78,9 @@ struct intel_lvds_encoder { struct intel_connector *attached_connector; }; -static struct intel_lvds_encoder *to_lvds_encoder(struct drm_encoder *encoder) +static struct intel_lvds_encoder *to_lvds_encoder(struct intel_encoder *encoder) { - return container_of(encoder, struct intel_lvds_encoder, base.base); + return container_of(encoder, struct intel_lvds_encoder, base); } bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv, @@ -103,7 +103,7 @@ static bool intel_lvds_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe) { struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); - struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); + struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); intel_wakeref_t wakeref; bool ret; @@ -123,7 +123,7 @@ static void intel_lvds_get_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config) { struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); - struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); + struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); u32 tmp, flags = 0; pipe_config->output_types |= BIT(INTEL_OUTPUT_LVDS); @@ -229,7 +229,7 @@ static void intel_pre_enable_lvds(struct intel_atomic_state *state, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { - struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); + struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; @@ -312,7 +312,7 @@ static void intel_enable_lvds(struct intel_atomic_state *state, const struct drm_connector_state *conn_state) { struct drm_device *dev = encoder->base.dev; - struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); + struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); struct drm_i915_private *dev_priv = to_i915(dev); intel_de_write(dev_priv, lvds_encoder->reg, @@ -334,7 +334,7 @@ static void intel_disable_lvds(struct intel_atomic_state *state, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { - struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(&encoder->base); + struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); intel_de_write(dev_priv, PP_CONTROL(0), @@ -413,7 +413,7 @@ static int intel_lvds_compute_config(struct intel_encoder *intel_encoder, { struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); struct intel_lvds_encoder *lvds_encoder = - to_lvds_encoder(&intel_encoder->base); + to_lvds_encoder(intel_encoder); struct intel_connector *intel_connector = lvds_encoder->attached_connector; struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; @@ -775,7 +775,7 @@ bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv) { struct intel_encoder *encoder = intel_get_lvds_encoder(dev_priv); - return encoder && to_lvds_encoder(&encoder->base)->is_dual_link; + return encoder && to_lvds_encoder(encoder)->is_dual_link; } static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder) From patchwork Mon Sep 12 11:18:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973568 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 723C6ECAAD5 for ; Mon, 12 Sep 2022 11:18:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03CB310E3C7; Mon, 12 Sep 2022 11:18:54 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id F29D410E3A8 for ; Mon, 12 Sep 2022 11:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981514; x=1694517514; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=55Oyi62kyFs7lmNJi2N2j6kjJLxDXancExEfFTdXHyE=; b=Fujx1rmsBToya5mQjpnng1YwJEMEAUmUy1TjMzziZB9My1Lf7FE0EiAV vSGlbgoKe1ToneoMr8jaBslaGaZgTKAZBHLhRFSCNbbs1LayAEunDCYrU Rebc64DIJk9WS+T+XqkJSIjgszGRbwd21bXtabKCOcCvCuA9cHSGzmhpE bTSWuweNb1wWD0itmLlqGRh5IpApVAhhX5w9GIw6QEO4BxoHffFlpPzhL l+e8no8xCzcaDiOIUn0muFHriMTqLGk/h7rV4qhM98Y/rxx/kbsGdVZps i3RdbiUg/vvlb3UZkrVECpo0pGXw6KroRPdMhKq5KDAOnU0cX+C7dhG9N Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="278232122" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="278232122" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="758357739" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by fmsmga001.fm.intel.com with SMTP; 12 Sep 2022 04:18:32 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:31 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:05 +0300 Message-Id: <20220912111814.17466-7-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 06/15] drm/i915: Extract intel_edp_backlight_setup() 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" From: Ville Syrjälä Pull the eDP backlight setup ino its own function. No reason to pollute intel_edp_init_connector() with all the mundane details. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/intel_dp.c | 51 +++++++++++++++---------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index a5eca5396fed..de5a4d2df78e 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5217,6 +5217,35 @@ intel_edp_add_properties(struct intel_dp *intel_dp) fixed_mode->vdisplay); } +static void intel_edp_backlight_setup(struct intel_dp *intel_dp, + struct intel_connector *connector) +{ + struct drm_i915_private *i915 = dp_to_i915(intel_dp); + enum pipe pipe = INVALID_PIPE; + + if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) { + /* + * Figure out the current pipe for the initial backlight setup. + * If the current pipe isn't valid, try the PPS pipe, and if that + * fails just assume pipe A. + */ + pipe = vlv_active_pipe(intel_dp); + + if (pipe != PIPE_A && pipe != PIPE_B) + pipe = intel_dp->pps.pps_pipe; + + if (pipe != PIPE_A && pipe != PIPE_B) + pipe = PIPE_A; + + drm_dbg_kms(&i915->drm, + "[CONNECTOR:%d:%s] using pipe %c for initial backlight setup\n", + connector->base.base.id, connector->base.name, + pipe_name(pipe)); + } + + intel_backlight_setup(connector, pipe); +} + static bool intel_edp_init_connector(struct intel_dp *intel_dp, struct intel_connector *intel_connector) { @@ -5226,7 +5255,6 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, struct drm_display_mode *fixed_mode; struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; bool has_dpcd; - enum pipe pipe = INVALID_PIPE; struct edid *edid; if (!intel_dp_is_edp(intel_dp)) @@ -5301,28 +5329,9 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, mutex_unlock(&dev->mode_config.mutex); - if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { - /* - * Figure out the current pipe for the initial backlight setup. - * If the current pipe isn't valid, try the PPS pipe, and if that - * fails just assume pipe A. - */ - pipe = vlv_active_pipe(intel_dp); - - if (pipe != PIPE_A && pipe != PIPE_B) - pipe = intel_dp->pps.pps_pipe; - - if (pipe != PIPE_A && pipe != PIPE_B) - pipe = PIPE_A; - - drm_dbg_kms(&dev_priv->drm, - "using pipe %c for initial backlight setup\n", - pipe_name(pipe)); - } - intel_panel_init(intel_connector); - intel_backlight_setup(intel_connector, pipe); + intel_edp_backlight_setup(intel_dp, intel_connector); intel_edp_add_properties(intel_dp); From patchwork Mon Sep 12 11:18:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973573 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 365BFECAAA1 for ; Mon, 12 Sep 2022 11:19:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 36A5A10E3A7; Mon, 12 Sep 2022 11:19:19 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id B1A2610E3BE for ; Mon, 12 Sep 2022 11:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981529; x=1694517529; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=uCQtEIulLGSHAq5vBvDwsJglzj6lv48j6d+QuuVkqrg=; b=UrstTDSO/oeGR0srInoDZuI3S8M1l+h3TEoY2/6aL+BWxu5pqF5mFJYZ JPpeWOeFHR+86duo/3hB/lLu9C7xRihmxGTDBRzdmiknf7qOsl0XpBe5e 78pWXKZOCiQ5is1lwd6jEstvHbg7TnlwWj4nenmETdmEuUEaNjpiVEGRz 1WLVpIVvkDDaPRzCWfeMNV0RzfbxHCvzc33xvK6uisAT5q4AczZc+9E93 IAoz9GOLU+CRSVIyqKkY9+9BB9Dfcu85YxcOzh6FHcc7VcpVPcI7Qdt8d yWuBvNQwQDPYfLrZUuQsKzDqvQj/cdCWLuQmUQBuMxGz1nKA9qj4xliP/ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="296575666" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="296575666" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="705115852" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by FMSMGA003.fm.intel.com with SMTP; 12 Sep 2022 04:18:35 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:34 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:06 +0300 Message-Id: <20220912111814.17466-8-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 07/15] drm/i915: Extract intel_tv_add_properties() 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" From: Ville Syrjälä Pull all the TV connector property setup into its own neat function. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_tv.c | 80 +++++++++++++------------ 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index 9379f3463344..306d08482855 100644 --- a/drivers/gpu/drm/i915/display/intel_tv.c +++ b/drivers/gpu/drm/i915/display/intel_tv.c @@ -1869,6 +1869,48 @@ static const struct drm_encoder_funcs intel_tv_enc_funcs = { .destroy = intel_encoder_destroy, }; +static void intel_tv_add_properties(struct drm_connector *connector) +{ + struct drm_i915_private *i915 = to_i915(connector->dev); + struct drm_connector_state *conn_state = connector->state; + const char *tv_format_names[ARRAY_SIZE(tv_modes)]; + int i; + + /* BIOS margin values */ + conn_state->tv.margins.left = 54; + conn_state->tv.margins.top = 36; + conn_state->tv.margins.right = 46; + conn_state->tv.margins.bottom = 37; + + conn_state->tv.mode = 0; + + /* Create TV properties then attach current values */ + for (i = 0; i < ARRAY_SIZE(tv_modes); i++) { + /* 1080p50/1080p60 not supported on gen3 */ + if (DISPLAY_VER(i915) == 3 && tv_modes[i].oversample == 1) + break; + + tv_format_names[i] = tv_modes[i].name; + } + drm_mode_create_tv_properties(&i915->drm, i, tv_format_names); + + drm_object_attach_property(&connector->base, + i915->drm.mode_config.tv_mode_property, + conn_state->tv.mode); + drm_object_attach_property(&connector->base, + i915->drm.mode_config.tv_left_margin_property, + conn_state->tv.margins.left); + drm_object_attach_property(&connector->base, + i915->drm.mode_config.tv_top_margin_property, + conn_state->tv.margins.top); + drm_object_attach_property(&connector->base, + i915->drm.mode_config.tv_right_margin_property, + conn_state->tv.margins.right); + drm_object_attach_property(&connector->base, + i915->drm.mode_config.tv_bottom_margin_property, + conn_state->tv.margins.bottom); +} + void intel_tv_init(struct drm_i915_private *dev_priv) { @@ -1878,9 +1920,6 @@ intel_tv_init(struct drm_i915_private *dev_priv) struct intel_encoder *intel_encoder; struct intel_connector *intel_connector; u32 tv_dac_on, tv_dac_off, save_tv_dac; - const char *tv_format_names[ARRAY_SIZE(tv_modes)]; - int i, initial_mode = 0; - struct drm_connector_state *state; if ((intel_de_read(dev_priv, TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED) return; @@ -1926,7 +1965,6 @@ intel_tv_init(struct drm_i915_private *dev_priv) intel_encoder = &intel_tv->base; connector = &intel_connector->base; - state = connector->state; /* * The documentation, for the older chipsets at least, recommend @@ -1963,41 +2001,9 @@ intel_tv_init(struct drm_i915_private *dev_priv) intel_encoder->cloneable = 0; intel_tv->type = DRM_MODE_CONNECTOR_Unknown; - /* BIOS margin values */ - state->tv.margins.left = 54; - state->tv.margins.top = 36; - state->tv.margins.right = 46; - state->tv.margins.bottom = 37; - - state->tv.mode = initial_mode; - drm_connector_helper_add(connector, &intel_tv_connector_helper_funcs); connector->interlace_allowed = false; connector->doublescan_allowed = false; - /* Create TV properties then attach current values */ - for (i = 0; i < ARRAY_SIZE(tv_modes); i++) { - /* 1080p50/1080p60 not supported on gen3 */ - if (DISPLAY_VER(dev_priv) == 3 && - tv_modes[i].oversample == 1) - break; - - tv_format_names[i] = tv_modes[i].name; - } - drm_mode_create_tv_properties(dev, i, tv_format_names); - - drm_object_attach_property(&connector->base, dev->mode_config.tv_mode_property, - state->tv.mode); - drm_object_attach_property(&connector->base, - dev->mode_config.tv_left_margin_property, - state->tv.margins.left); - drm_object_attach_property(&connector->base, - dev->mode_config.tv_top_margin_property, - state->tv.margins.top); - drm_object_attach_property(&connector->base, - dev->mode_config.tv_right_margin_property, - state->tv.margins.right); - drm_object_attach_property(&connector->base, - dev->mode_config.tv_bottom_margin_property, - state->tv.margins.bottom); + intel_tv_add_properties(connector); } From patchwork Mon Sep 12 11:18:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973570 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 EC4ADECAAA1 for ; Mon, 12 Sep 2022 11:18:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 68B8A10E3CB; Mon, 12 Sep 2022 11:18:54 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0078910E3BE for ; Mon, 12 Sep 2022 11:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981520; x=1694517520; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=71KgHHpG5ElIrEC2vaIaDdc5tn/9/q4xquduiPJmFN8=; b=AmVG9A7muD8Iws/qWEuT5XqdT5yELnrEgI9Q/lwwjkWN5In5qC6FvxNM KsM0svYSvPEDwtjRqDyF+8eosjwjpoFQhS9EpTRa2n6qd3+5D5OKnTa+D 2jVpHdov2VPid4L138L5cUrarFQPkq/esXH8+twHPMfG5mTwLxPDIiHVJ r4NKEw04RxMHz7/63d6/2gBwGdhCUXnoM3J5UR+SbIRxNtl/j2NxW8FDG hYjKNQGg8ozAyAvubhHevbolDXp5w/SNLQUFcoh5KTDSt7L445hYT2QcI E2iQ5YZA9CcNxJNQyXyOYUSYZVZoOPwJvsjhGIruh8srkH9thelucdrUv Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="299180237" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="299180237" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="616013707" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga002.jf.intel.com with SMTP; 12 Sep 2022 04:18:38 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:37 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:07 +0300 Message-Id: <20220912111814.17466-9-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 08/15] drm/i915: Extract intel_dp_mst_add_properties() 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" From: Ville Syrjälä Move the DP MST connector property setup into its own function so it's not spread all over intel_dp_add_mst_connector(). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 46 ++++++++++++++------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 5adfd226d6c4..ac67738e4eda 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -790,7 +790,35 @@ static bool intel_dp_mst_get_hw_state(struct intel_connector *connector) return false; } -static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *pathprop) +static int intel_dp_mst_add_properties(struct intel_dp *intel_dp, + struct drm_connector *connector, + const char *pathprop) +{ + struct drm_i915_private *i915 = to_i915(connector->dev); + + drm_object_attach_property(&connector->base, + i915->drm.mode_config.path_property, 0); + drm_object_attach_property(&connector->base, + i915->drm.mode_config.tile_property, 0); + + intel_attach_force_audio_property(connector); + intel_attach_broadcast_rgb_property(connector); + + /* + * Reuse the prop from the SST connector because we're + * not allowed to create new props after device registration. + */ + connector->max_bpc_property = + intel_dp->attached_connector->base.max_bpc_property; + if (connector->max_bpc_property) + drm_connector_attach_max_bpc_property(connector, 6, 12); + + return drm_connector_set_path_property(connector, pathprop); +} + +static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, + struct drm_dp_mst_port *port, + const char *pathprop) { struct intel_dp *intel_dp = container_of(mgr, struct intel_dp, mst_mgr); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); @@ -830,28 +858,14 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo goto err; } - drm_object_attach_property(&connector->base, dev->mode_config.path_property, 0); - drm_object_attach_property(&connector->base, dev->mode_config.tile_property, 0); - - ret = drm_connector_set_path_property(connector, pathprop); + ret = intel_dp_mst_add_properties(intel_dp, connector, pathprop); if (ret) goto err; - intel_attach_force_audio_property(connector); - intel_attach_broadcast_rgb_property(connector); - ret = intel_dp_hdcp_init(dig_port, intel_connector); if (ret) drm_dbg_kms(&dev_priv->drm, "[%s:%d] HDCP MST init failed, skipping.\n", connector->name, connector->base.id); - /* - * Reuse the prop from the SST connector because we're - * not allowed to create new props after device registration. - */ - connector->max_bpc_property = - intel_dp->attached_connector->base.max_bpc_property; - if (connector->max_bpc_property) - drm_connector_attach_max_bpc_property(connector, 6, 12); return connector; From patchwork Mon Sep 12 11:18:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973569 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 940A1ECAAA1 for ; Mon, 12 Sep 2022 11:18:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8805010E3CD; Mon, 12 Sep 2022 11:18:54 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id A64D010E3BE for ; Mon, 12 Sep 2022 11:18:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981523; x=1694517523; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=on6W24aqoXO1s3ZvRB7qJQFJDH0jYdAFO4/cRJgTWJo=; b=S8W6w46Bn5q8Z4mWIOWR5+4//bOn79mG8GlPnYzEm7o70IQ7R5+k82F3 2bMBhLEPwdKea6JAFL44gXTn+4xE/Lt9MVDYRkS+4sS8Jarr4dUsQklB+ M7pdz122c89LAfvIki44XiS1Q/u6f0xMT7zFyngqH0OXx3vKrIUWqUstA gazU+X9+kZiHDhN9FwQ+qZWra4ooDBEnOIyMOQTkpnX452LNYYdlXfF15 6jXEjXTPCSlmKd1/oizrgPUhYecC5QIShtxrWnOZt2vsNaDZkG+rmn5D+ YyfPKdHxU1oK2bDioHRwCdlmD+/TdRA0w1xH8mwlcudBbv4Kn+v1TCGJZ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="297841609" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="297841609" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="719722858" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by fmsmga002.fm.intel.com with SMTP; 12 Sep 2022 04:18:41 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:40 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:08 +0300 Message-Id: <20220912111814.17466-10-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 09/15] drm/i915: Extract intel_lvds_add_properties() 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" From: Ville Syrjälä Move the LVDS connector property setup to a dedicated function to depollute intel_lvds_init() a bit. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_lvds.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 6fef829e855b..7cadb548ad6c 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -814,6 +814,19 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder) return (val & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP; } +static void intel_lvds_add_properties(struct drm_connector *connector) +{ + u32 allowed_scalers; + + allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | + BIT(DRM_MODE_SCALE_FULLSCREEN) | + BIT(DRM_MODE_SCALE_CENTER); + + drm_connector_attach_scaling_mode_property(connector, allowed_scalers); + + connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT; +} + /** * intel_lvds_init - setup LVDS connectors on this device * @dev_priv: i915 device @@ -833,7 +846,6 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) i915_reg_t lvds_reg; u32 lvds; u8 pin; - u32 allowed_scalers; /* Skip init on machines we know falsely report LVDS */ if (dmi_check_system(intel_no_lvds)) { @@ -925,12 +937,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) lvds_encoder->reg = lvds_reg; - /* create the scaling mode property */ - allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT); - allowed_scalers |= BIT(DRM_MODE_SCALE_FULLSCREEN); - allowed_scalers |= BIT(DRM_MODE_SCALE_CENTER); - drm_connector_attach_scaling_mode_property(connector, allowed_scalers); - connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT; + intel_lvds_add_properties(connector); intel_lvds_pps_get_hw_state(dev_priv, &lvds_encoder->init_pps); lvds_encoder->init_lvds_val = lvds; From patchwork Mon Sep 12 11:18:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973572 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 41C5BECAAA1 for ; Mon, 12 Sep 2022 11:19:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B855A10E3CF; Mon, 12 Sep 2022 11:18:54 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7034010E3BE for ; Mon, 12 Sep 2022 11:18: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=1662981526; x=1694517526; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=OGnNpRfTKYawipsk3m2WIdR0tcsBnMzOMpGgoR26II8=; b=mfwZb1DAJwrIeq7WaFi9tI+u01YLQwxLi61XD7H5Q8Lt4t80g88dzdWr T+XDhfDzeh+bNqaG4SvlJhsfxC+utEkDCbyc5HXtrwe5y6/OvGtuOsLaY H9X8eB0kS0i+vSuhNBCupfT9Wzyd3e0LP1d+pv9zAJFnuT90VpHhlD/Vy Vl3CBCR6IXmBzyGfRanYTJnAlhVGOCzu5SI1JyP9VsH/7dsb6FSrG3cQx 9V62GtP7I2UPn/u3wrRcabaCpGyDAekG52Hy6e9NUehInqtJThF7a2dfl iMpW2lH3GuyVbzmGY9Qe6gFVjIfJWU6xj6PKl1ybTTXb09esfOKdNaUpt Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="324072063" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="324072063" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="618518529" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by fmsmga007.fm.intel.com with SMTP; 12 Sep 2022 04:18:44 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:43 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:09 +0300 Message-Id: <20220912111814.17466-11-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 10/15] drm/i915: Move eDP scaling_mode prop setup to the proper place 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" From: Ville Syrjälä We have an eDP specific intel_edp_add_properties() so move the eDP scaling_mode property setup there from intel_dp_add_properties(). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dp.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index de5a4d2df78e..049228a09364 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5183,19 +5183,6 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect if (has_gamut_metadata_dip(dev_priv, port)) drm_connector_attach_hdr_output_metadata_property(connector); - if (intel_dp_is_edp(intel_dp)) { - u32 allowed_scalers; - - allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | BIT(DRM_MODE_SCALE_FULLSCREEN); - if (!HAS_GMCH(dev_priv)) - allowed_scalers |= BIT(DRM_MODE_SCALE_CENTER); - - drm_connector_attach_scaling_mode_property(connector, allowed_scalers); - - connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT; - - } - if (HAS_VRR(dev_priv)) drm_connector_attach_vrr_capable_property(connector); } @@ -5207,6 +5194,16 @@ intel_edp_add_properties(struct intel_dp *intel_dp) struct drm_i915_private *i915 = to_i915(connector->base.dev); const struct drm_display_mode *fixed_mode = intel_panel_preferred_fixed_mode(connector); + u32 allowed_scalers; + + allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | + BIT(DRM_MODE_SCALE_FULLSCREEN); + if (!HAS_GMCH(i915)) + allowed_scalers |= BIT(DRM_MODE_SCALE_CENTER); + + drm_connector_attach_scaling_mode_property(&connector->base, allowed_scalers); + + connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT; if (!fixed_mode) return; From patchwork Mon Sep 12 11:18:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973571 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 13ECAECAAD5 for ; Mon, 12 Sep 2022 11:19:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 17D5810E3CA; Mon, 12 Sep 2022 11:18:55 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id B747A10E3C7 for ; Mon, 12 Sep 2022 11:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981529; x=1694517529; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=83sbV5vr7U3La5jBBgcs8Kssf2UxBCbES8WYb4m3+QI=; b=mlfn/w/mCZ56qPK8GltlYHQkT30r/OJysBoch1IKn/UgQBkq8DLkczjH Kv8UX1F9JVTtSADy3EJM86LT8hvtJx3q9/a0yCIZwfkKrR8UxKSc7XdCE MrlVpmpKptMXbuYLqkcPSeUPTKQq3Ap5+BY1mX4nhDrx8zhyAVdduq6hJ PDZPkB57EMaYYl0qMuyZ093iaMppfowVXwU50+1LebI97RACl/MPSIzqy QwEnZ6Q+l4GxPzCpvBcGFJKNjBUqOtrSafXs7STCFkvRRontGiGqCowS6 LSl63xB+XFYmnVx36sbw/bDbhXJRawAAlA8mUb7URCXZaSbJojzInXN+7 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="295424652" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="295424652" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="611727345" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga007.jf.intel.com with SMTP; 12 Sep 2022 04:18:46 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:46 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:10 +0300 Message-Id: <20220912111814.17466-12-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 11/15] drm/i915: Extract intel_attach_scaling_mode_property() 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" From: Ville Syrjälä Consolidate the scaling_mode property setup into a single place. The one slight complicateion here is that GMCH platforms can't do the CENTER mode except on the LVDS port. But we can deal with that by just checking the connector type. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/icl_dsi.c | 10 +--------- drivers/gpu/drm/i915/display/intel_connector.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/display/intel_connector.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c | 10 +--------- drivers/gpu/drm/i915/display/intel_lvds.c | 10 +--------- drivers/gpu/drm/i915/display/vlv_dsi.c | 11 +---------- 6 files changed, 23 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index ed4d93942dbd..59546cbcaeda 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -1974,16 +1974,8 @@ static void icl_dsi_add_properties(struct intel_connector *connector) { const struct drm_display_mode *fixed_mode = intel_panel_preferred_fixed_mode(connector); - u32 allowed_scalers; - allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | - BIT(DRM_MODE_SCALE_FULLSCREEN) | - BIT(DRM_MODE_SCALE_CENTER); - - drm_connector_attach_scaling_mode_property(&connector->base, - allowed_scalers); - - connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT; + intel_attach_scaling_mode_property(&connector->base); drm_connector_set_panel_orientation_with_quirk(&connector->base, intel_dsi_get_panel_orientation(connector), diff --git a/drivers/gpu/drm/i915/display/intel_connector.c b/drivers/gpu/drm/i915/display/intel_connector.c index 6d5cbeb8df4d..6205ddd3ded0 100644 --- a/drivers/gpu/drm/i915/display/intel_connector.c +++ b/drivers/gpu/drm/i915/display/intel_connector.c @@ -293,3 +293,21 @@ intel_attach_dp_colorspace_property(struct drm_connector *connector) if (!drm_mode_create_dp_colorspace_property(connector)) drm_connector_attach_colorspace_property(connector); } + +void +intel_attach_scaling_mode_property(struct drm_connector *connector) +{ + struct drm_i915_private *i915 = to_i915(connector->dev); + u32 scaling_modes; + + scaling_modes = BIT(DRM_MODE_SCALE_ASPECT) | + BIT(DRM_MODE_SCALE_FULLSCREEN); + + /* On GMCH platforms borders are only possible on the LVDS port */ + if (!HAS_GMCH(i915) || connector->connector_type == DRM_MODE_CONNECTOR_LVDS) + scaling_modes |= BIT(DRM_MODE_SCALE_CENTER); + + drm_connector_attach_scaling_mode_property(connector, scaling_modes); + + connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT; +} diff --git a/drivers/gpu/drm/i915/display/intel_connector.h b/drivers/gpu/drm/i915/display/intel_connector.h index 661a37a3c6d8..7d7b588d2286 100644 --- a/drivers/gpu/drm/i915/display/intel_connector.h +++ b/drivers/gpu/drm/i915/display/intel_connector.h @@ -32,5 +32,6 @@ void intel_attach_broadcast_rgb_property(struct drm_connector *connector); void intel_attach_aspect_ratio_property(struct drm_connector *connector); void intel_attach_hdmi_colorspace_property(struct drm_connector *connector); void intel_attach_dp_colorspace_property(struct drm_connector *connector); +void intel_attach_scaling_mode_property(struct drm_connector *connector); #endif /* __INTEL_CONNECTOR_H__ */ diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 049228a09364..ce74f6695cab 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5194,16 +5194,8 @@ intel_edp_add_properties(struct intel_dp *intel_dp) struct drm_i915_private *i915 = to_i915(connector->base.dev); const struct drm_display_mode *fixed_mode = intel_panel_preferred_fixed_mode(connector); - u32 allowed_scalers; - allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | - BIT(DRM_MODE_SCALE_FULLSCREEN); - if (!HAS_GMCH(i915)) - allowed_scalers |= BIT(DRM_MODE_SCALE_CENTER); - - drm_connector_attach_scaling_mode_property(&connector->base, allowed_scalers); - - connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT; + intel_attach_scaling_mode_property(&connector->base); if (!fixed_mode) return; diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 7cadb548ad6c..951170af7bb3 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -816,15 +816,7 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder) static void intel_lvds_add_properties(struct drm_connector *connector) { - u32 allowed_scalers; - - allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | - BIT(DRM_MODE_SCALE_FULLSCREEN) | - BIT(DRM_MODE_SCALE_CENTER); - - drm_connector_attach_scaling_mode_property(connector, allowed_scalers); - - connector->state->scaling_mode = DRM_MODE_SCALE_ASPECT; + intel_attach_scaling_mode_property(connector); } /** diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index b3f5ca280ef2..421ad02f8e9b 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -1659,19 +1659,10 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = { static void vlv_dsi_add_properties(struct intel_connector *connector) { - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); const struct drm_display_mode *fixed_mode = intel_panel_preferred_fixed_mode(connector); - u32 allowed_scalers; - allowed_scalers = BIT(DRM_MODE_SCALE_ASPECT) | BIT(DRM_MODE_SCALE_FULLSCREEN); - if (!HAS_GMCH(dev_priv)) - allowed_scalers |= BIT(DRM_MODE_SCALE_CENTER); - - drm_connector_attach_scaling_mode_property(&connector->base, - allowed_scalers); - - connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT; + intel_attach_scaling_mode_property(&connector->base); drm_connector_set_panel_orientation_with_quirk(&connector->base, intel_dsi_get_panel_orientation(connector), From patchwork Mon Sep 12 11:18:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973575 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 19AEEC6FA83 for ; Mon, 12 Sep 2022 11:19:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE6FE10E3D1; Mon, 12 Sep 2022 11:19:24 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id C351810E3C7 for ; Mon, 12 Sep 2022 11:18:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981532; x=1694517532; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=/XdP/cXujAqp9sYYfbJmeJN5xZaEgT1od/h2cr4KUL0=; b=StO55cFGtdrS/NVDF4CdRFoTen0Y7QYdSz7AYWazgTwTspUCsMmRttti U9r06vLhF86DJLV5LGqtthcVz6n7jhKvM5rlBcxeOk5dCfC0+CdjvN/Vo y7cAF7fYApFampZKifN0OVdWrYCysb3kbZmIPBydiSriCj2JQ+M3NfDvB XAAFcm6PnCuug62sKj+L0mZmAONEGrfTMe5jgpnhKLQ/mNscesFU1T47S xEFq1XKdMZwUDM9lpVOKim2LflzEatgSRojZp2/gp4NgyAEBYdAgPdYgA PxQP8GrxExl+e9DpKaPjtsfc6B90Sk1C6EySzGpYTYnVL7jomwiV5AzLl w==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="361792173" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="361792173" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="678044343" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by fmsmga008.fm.intel.com with SMTP; 12 Sep 2022 04:18:49 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:49 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:11 +0300 Message-Id: <20220912111814.17466-13-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 12/15] drm/i915: Clean up connector->*_allowed setup 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" From: Ville Syrjälä All the connectors are zero initialized so no need to clear the *_allowed flags we don't support. Only leave the ones we want to set. And while at it switch to booleans instead of ints. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/icl_dsi.c | 2 -- drivers/gpu/drm/i915/display/intel_crt.c | 7 ++----- drivers/gpu/drm/i915/display/intel_dp.c | 1 - drivers/gpu/drm/i915/display/intel_dvo.c | 2 -- drivers/gpu/drm/i915/display/intel_hdmi.c | 5 ++--- drivers/gpu/drm/i915/display/intel_lvds.c | 2 -- drivers/gpu/drm/i915/display/intel_sdvo.c | 3 +-- drivers/gpu/drm/i915/display/intel_tv.c | 2 -- drivers/gpu/drm/i915/display/vlv_dsi.c | 2 -- 9 files changed, 5 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 59546cbcaeda..47f13750f6fa 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -2038,8 +2038,6 @@ void icl_dsi_init(struct drm_i915_private *dev_priv) DRM_MODE_CONNECTOR_DSI); drm_connector_helper_add(connector, &gen11_dsi_connector_helper_funcs); connector->display_info.subpixel_order = SubPixelHorizontalRGB; - connector->interlace_allowed = false; - connector->doublescan_allowed = false; intel_connector->get_hw_state = intel_connector_get_hw_state; /* attach connector to encoder */ diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c index eba58345619a..94d0a5e1dd03 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.c +++ b/drivers/gpu/drm/i915/display/intel_crt.c @@ -1050,11 +1050,8 @@ void intel_crt_init(struct drm_i915_private *dev_priv) else crt->base.pipe_mask = ~0; - if (DISPLAY_VER(dev_priv) == 2) - connector->interlace_allowed = 0; - else - connector->interlace_allowed = 1; - connector->doublescan_allowed = 0; + if (DISPLAY_VER(dev_priv) != 2) + connector->interlace_allowed = true; crt->adpa_reg = adpa_reg; diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index ce74f6695cab..7b4ffb74c94c 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5422,7 +5422,6 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, if (!HAS_GMCH(dev_priv)) connector->interlace_allowed = true; - connector->doublescan_allowed = 0; intel_connector->polled = DRM_CONNECTOR_POLL_HPD; diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c index 167c9b7318f8..595087288922 100644 --- a/drivers/gpu/drm/i915/display/intel_dvo.c +++ b/drivers/gpu/drm/i915/display/intel_dvo.c @@ -515,8 +515,6 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) drm_connector_helper_add(connector, &intel_dvo_connector_helper_funcs); connector->display_info.subpixel_order = SubPixelHorizontalRGB; - connector->interlace_allowed = false; - connector->doublescan_allowed = false; intel_connector_attach_encoder(intel_connector, intel_encoder); if (dvo->type == INTEL_DVO_CHIP_LVDS) { diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 7816b2a33fee..93519fb23d9d 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2956,9 +2956,8 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port, ddc); drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs); - connector->interlace_allowed = 1; - connector->doublescan_allowed = 0; - connector->stereo_allowed = 1; + connector->interlace_allowed = true; + connector->stereo_allowed = true; if (DISPLAY_VER(dev_priv) >= 10) connector->ycbcr_420_allowed = true; diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 951170af7bb3..270368b43729 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -924,8 +924,6 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs); connector->display_info.subpixel_order = SubPixelHorizontalRGB; - connector->interlace_allowed = false; - connector->doublescan_allowed = false; lvds_encoder->reg = lvds_reg; diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index f5b744bef18f..2a99ec7ff737 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -2689,9 +2689,8 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector, drm_connector_helper_add(drm_connector, &intel_sdvo_connector_helper_funcs); - connector->base.base.interlace_allowed = 1; - connector->base.base.doublescan_allowed = 0; connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB; + connector->base.base.interlace_allowed = true; connector->base.get_hw_state = intel_sdvo_connector_get_hw_state; intel_connector_attach_encoder(&connector->base, &encoder->base); diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index 306d08482855..b1c74eca4fe7 100644 --- a/drivers/gpu/drm/i915/display/intel_tv.c +++ b/drivers/gpu/drm/i915/display/intel_tv.c @@ -2002,8 +2002,6 @@ intel_tv_init(struct drm_i915_private *dev_priv) intel_tv->type = DRM_MODE_CONNECTOR_Unknown; drm_connector_helper_add(connector, &intel_tv_connector_helper_funcs); - connector->interlace_allowed = false; - connector->doublescan_allowed = false; intel_tv_add_properties(connector); } diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index 421ad02f8e9b..dee0147a316c 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -1971,8 +1971,6 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) drm_connector_helper_add(connector, &intel_dsi_connector_helper_funcs); connector->display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/ - connector->interlace_allowed = false; - connector->doublescan_allowed = false; intel_connector_attach_encoder(intel_connector, intel_encoder); From patchwork Mon Sep 12 11:18:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973576 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 9EC03ECAAA1 for ; Mon, 12 Sep 2022 11:19:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 113A110E3D6; Mon, 12 Sep 2022 11:19:41 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5BC8C10E3D1 for ; Mon, 12 Sep 2022 11:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981542; x=1694517542; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=e43mcejOSRMsCcAh7WmYhhegJgBsUKjjYl9MwEzKhhw=; b=VQWhGE1XHMXhRFTFci84IYbC9FpmDV6UIjMB6XJnIX9YmYMi8v0o8hz6 m64l4BbcngS8iKS+cVRU1p6JWqbgf1AWyeGfrOnGbi//BgDKArGkrblOn lan0pArhZynPE3Ef8GcQb+xV5jJF3DmRMVFNbS3YhUhDBVCVDLp2CCy8W QpdBUnEIY8OAyMZKH4RFU8kKCnHJvrb8Ggnm/W2huXucowZtECtGp/k7B /7L5qiU81zaVKuehWMf2qVUXkGVL6UeDazyLbb1t1mPUcMXLZxo2UjAxd By69OuLgQOqsICLUFOtDqg3HxsilzJz1m3nXx0JjyJ9lKWkC2jXJ5UOEX A==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="299180274" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="299180274" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="646416128" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga008.jf.intel.com with SMTP; 12 Sep 2022 04:18:52 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:51 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:12 +0300 Message-Id: <20220912111814.17466-14-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 13/15] drm/i915: Don't init eDP if we can't find a fixed mode 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" From: Ville Syrjälä In the unlikely case of not finding a fixed mode don't register the eDP connector. I think there are some places where we'd oops if we didn't have a fixed mode for eDP so presumable this doesn't typically happen. But better safe than sorry. Also pimp the debugs with the encoder id+name. I think dumping the encoder rather than the connector provides more information here (eg. to match again the port information in the VBT). We can also drop the extra check from intel_edp_add_properties(). Signed-off-by: Ville Syrjälä Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_dp.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 7b4ffb74c94c..8fe48634eb9d 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5197,9 +5197,6 @@ intel_edp_add_properties(struct intel_dp *intel_dp) intel_attach_scaling_mode_property(&connector->base); - if (!fixed_mode) - return; - drm_connector_set_panel_orientation_with_quirk(&connector->base, i915->display.vbt.orientation, fixed_mode->hdisplay, @@ -5272,7 +5269,8 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, if (!has_dpcd) { /* if this fails, presume the device is a ghost */ drm_info(&dev_priv->drm, - "failed to retrieve link info, disabling eDP\n"); + "[ENCODER:%d:%s] failed to retrieve link info, disabling eDP\n", + encoder->base.base.id, encoder->base.name); goto out_vdd_off; } @@ -5318,6 +5316,13 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, mutex_unlock(&dev->mode_config.mutex); + if (!intel_panel_preferred_fixed_mode(intel_connector)) { + drm_info(&dev_priv->drm, + "[ENCODER:%d:%s] failed to find fixed mode for the panel, disabling eDP\n", + encoder->base.base.id, encoder->base.name); + goto out_vdd_off; + } + intel_panel_init(intel_connector); intel_edp_backlight_setup(intel_dp, intel_connector); From patchwork Mon Sep 12 11:18:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973574 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 8C85CECAAD5 for ; Mon, 12 Sep 2022 11:19:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10BC310E39B; Mon, 12 Sep 2022 11:19:19 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8922B10E3B8 for ; Mon, 12 Sep 2022 11:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981538; x=1694517538; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Qw9JYMQFmW9oENhltlTaenSNT8GcbjbqiuL+9jrW8oA=; b=jQ9IiupWD5aTPX/HAhC0ivLtNVZTiwxDhy7lxIpt2vOEE+L++vNOBK9p uiIxvsP/cHiXMZEqgpGFl8QcmmiDX28yAtWi6oFxlNn4sgrfYJPtyk7Fk 8irheLs1T8Bx0XzVD1CsNusccdEVHp+uoUseAj/gBvN3G2kwqYCcB/EXm JbEVHDSClfUdPzj4L60dF7nBQJi+W5ONtetC6HSOM0NpwDS4L7c/4JcJC 9QXNAq9SQZPLzxjrBHQumueLLOj5o2rd3v/1xWxVxGSlWGXhzqubyH057 QFfnD0hfb6H4rlQf2FBQFLQlna28okGWRqMgqWVNOPsFPP+SCGZW3++OT A==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="278232179" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="278232179" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:18:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="593452435" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga006.jf.intel.com with SMTP; 12 Sep 2022 04:18:55 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:54 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:13 +0300 Message-Id: <20220912111814.17466-15-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 14/15] drm/i915: Finish s/intel_encoder/encoder/ rename 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" From: Ville Syrjälä Not a lot of places left that still use the 'intel_encoder' variable name rather than just 'encoder'. Clean up the stragglers. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/g4x_dp.c | 99 ++++++++++--------- drivers/gpu/drm/i915/display/g4x_hdmi.c | 66 ++++++------- drivers/gpu/drm/i915/display/icl_dsi.c | 7 +- drivers/gpu/drm/i915/display/intel_audio.c | 10 +- drivers/gpu/drm/i915/display/intel_crt.c | 24 +++-- drivers/gpu/drm/i915/display/intel_crt.h | 2 +- drivers/gpu/drm/i915/display/intel_ddi.c | 23 ++--- drivers/gpu/drm/i915/display/intel_ddi.h | 4 +- drivers/gpu/drm/i915/display/intel_display.c | 26 +++-- drivers/gpu/drm/i915/display/intel_display.h | 2 +- .../drm/i915/display/intel_display_debugfs.c | 19 ++-- .../drm/i915/display/intel_display_types.h | 6 +- drivers/gpu/drm/i915/display/intel_dp.c | 32 +++--- drivers/gpu/drm/i915/display/intel_dp.h | 7 +- drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 4 +- drivers/gpu/drm/i915/display/intel_dp_mst.c | 52 +++++----- drivers/gpu/drm/i915/display/intel_dvo.c | 40 ++++---- drivers/gpu/drm/i915/display/intel_hdmi.c | 16 +-- drivers/gpu/drm/i915/display/intel_hdmi.h | 1 - drivers/gpu/drm/i915/display/intel_lvds.c | 56 +++++------ drivers/gpu/drm/i915/display/intel_opregion.c | 18 ++-- drivers/gpu/drm/i915/display/intel_opregion.h | 4 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 70 ++++++------- drivers/gpu/drm/i915/display/intel_tv.c | 30 +++--- drivers/gpu/drm/i915/display/vlv_dsi.c | 80 ++++++++------- 25 files changed, 340 insertions(+), 358 deletions(-) diff --git a/drivers/gpu/drm/i915/display/g4x_dp.c b/drivers/gpu/drm/i915/display/g4x_dp.c index e3e3d27ffb53..6afd4a2142f2 100644 --- a/drivers/gpu/drm/i915/display/g4x_dp.c +++ b/drivers/gpu/drm/i915/display/g4x_dp.c @@ -1228,12 +1228,14 @@ static bool ilk_digital_port_connected(struct intel_encoder *encoder) return intel_de_read(dev_priv, DEISR) & bit; } -static void intel_dp_encoder_destroy(struct drm_encoder *encoder) +static void intel_dp_encoder_destroy(struct drm_encoder *_encoder) { + struct intel_encoder *encoder = to_intel_encoder(_encoder); + intel_dp_encoder_flush_work(encoder); - drm_encoder_cleanup(encoder); - kfree(enc_to_dig_port(to_intel_encoder(encoder))); + drm_encoder_cleanup(&encoder->base); + kfree(enc_to_dig_port(encoder)); } enum pipe vlv_active_pipe(struct intel_dp *intel_dp) @@ -1249,10 +1251,11 @@ enum pipe vlv_active_pipe(struct intel_dp *intel_dp) return INVALID_PIPE; } -static void intel_dp_encoder_reset(struct drm_encoder *encoder) +static void intel_dp_encoder_reset(struct drm_encoder *_encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->dev); - struct intel_dp *intel_dp = enc_to_intel_dp(to_intel_encoder(encoder)); + struct intel_encoder *encoder = to_intel_encoder(_encoder); + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); intel_dp->DP = intel_de_read(dev_priv, intel_dp->output_reg); @@ -1277,8 +1280,7 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv, i915_reg_t output_reg, enum port port) { struct intel_digital_port *dig_port; - struct intel_encoder *intel_encoder; - struct drm_encoder *encoder; + struct intel_encoder *encoder; struct intel_connector *intel_connector; dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL); @@ -1289,43 +1291,42 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv, if (!intel_connector) goto err_connector_alloc; - intel_encoder = &dig_port->base; - encoder = &intel_encoder->base; + encoder = &dig_port->base; mutex_init(&dig_port->hdcp_mutex); - if (drm_encoder_init(&dev_priv->drm, &intel_encoder->base, + if (drm_encoder_init(&dev_priv->drm, &encoder->base, &intel_dp_enc_funcs, DRM_MODE_ENCODER_TMDS, "DP %c", port_name(port))) goto err_encoder_init; - intel_encoder->hotplug = intel_dp_hotplug; - intel_encoder->compute_config = intel_dp_compute_config; - intel_encoder->get_hw_state = intel_dp_get_hw_state; - intel_encoder->get_config = intel_dp_get_config; - intel_encoder->sync_state = intel_dp_sync_state; - intel_encoder->initial_fastset_check = intel_dp_initial_fastset_check; - intel_encoder->update_pipe = intel_backlight_update; - intel_encoder->suspend = intel_dp_encoder_suspend; - intel_encoder->shutdown = intel_dp_encoder_shutdown; + encoder->hotplug = intel_dp_hotplug; + encoder->compute_config = intel_dp_compute_config; + encoder->get_hw_state = intel_dp_get_hw_state; + encoder->get_config = intel_dp_get_config; + encoder->sync_state = intel_dp_sync_state; + encoder->initial_fastset_check = intel_dp_initial_fastset_check; + encoder->update_pipe = intel_backlight_update; + encoder->suspend = intel_dp_encoder_suspend; + encoder->shutdown = intel_dp_encoder_shutdown; if (IS_CHERRYVIEW(dev_priv)) { - intel_encoder->pre_pll_enable = chv_dp_pre_pll_enable; - intel_encoder->pre_enable = chv_pre_enable_dp; - intel_encoder->enable = vlv_enable_dp; - intel_encoder->disable = vlv_disable_dp; - intel_encoder->post_disable = chv_post_disable_dp; - intel_encoder->post_pll_disable = chv_dp_post_pll_disable; + encoder->pre_pll_enable = chv_dp_pre_pll_enable; + encoder->pre_enable = chv_pre_enable_dp; + encoder->enable = vlv_enable_dp; + encoder->disable = vlv_disable_dp; + encoder->post_disable = chv_post_disable_dp; + encoder->post_pll_disable = chv_dp_post_pll_disable; } else if (IS_VALLEYVIEW(dev_priv)) { - intel_encoder->pre_pll_enable = vlv_dp_pre_pll_enable; - intel_encoder->pre_enable = vlv_pre_enable_dp; - intel_encoder->enable = vlv_enable_dp; - intel_encoder->disable = vlv_disable_dp; - intel_encoder->post_disable = vlv_post_disable_dp; + encoder->pre_pll_enable = vlv_dp_pre_pll_enable; + encoder->pre_enable = vlv_pre_enable_dp; + encoder->enable = vlv_enable_dp; + encoder->disable = vlv_disable_dp; + encoder->post_disable = vlv_post_disable_dp; } else { - intel_encoder->pre_enable = g4x_pre_enable_dp; - intel_encoder->enable = g4x_enable_dp; - intel_encoder->disable = g4x_disable_dp; - intel_encoder->post_disable = g4x_post_disable_dp; + encoder->pre_enable = g4x_pre_enable_dp; + encoder->enable = g4x_enable_dp; + encoder->disable = g4x_disable_dp; + encoder->post_disable = g4x_post_disable_dp; } if ((IS_IVYBRIDGE(dev_priv) && port == PORT_A) || @@ -1335,15 +1336,15 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv, dig_port->dp.set_link_train = g4x_set_link_train; if (IS_CHERRYVIEW(dev_priv)) - intel_encoder->set_signal_levels = chv_set_signal_levels; + encoder->set_signal_levels = chv_set_signal_levels; else if (IS_VALLEYVIEW(dev_priv)) - intel_encoder->set_signal_levels = vlv_set_signal_levels; + encoder->set_signal_levels = vlv_set_signal_levels; else if (IS_IVYBRIDGE(dev_priv) && port == PORT_A) - intel_encoder->set_signal_levels = ivb_cpu_edp_set_signal_levels; + encoder->set_signal_levels = ivb_cpu_edp_set_signal_levels; else if (IS_SANDYBRIDGE(dev_priv) && port == PORT_A) - intel_encoder->set_signal_levels = snb_cpu_edp_set_signal_levels; + encoder->set_signal_levels = snb_cpu_edp_set_signal_levels; else - intel_encoder->set_signal_levels = g4x_set_signal_levels; + encoder->set_signal_levels = g4x_set_signal_levels; if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv) || (HAS_PCH_SPLIT(dev_priv) && port != PORT_A)) { @@ -1357,19 +1358,19 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv, dig_port->dp.output_reg = output_reg; dig_port->max_lanes = 4; - intel_encoder->type = INTEL_OUTPUT_DP; - intel_encoder->power_domain = intel_display_power_ddi_lanes_domain(dev_priv, port); + encoder->type = INTEL_OUTPUT_DP; + encoder->power_domain = intel_display_power_ddi_lanes_domain(dev_priv, port); if (IS_CHERRYVIEW(dev_priv)) { if (port == PORT_D) - intel_encoder->pipe_mask = BIT(PIPE_C); + encoder->pipe_mask = BIT(PIPE_C); else - intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B); + encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B); } else { - intel_encoder->pipe_mask = ~0; + encoder->pipe_mask = ~0; } - intel_encoder->cloneable = 0; - intel_encoder->port = port; - intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port); + encoder->cloneable = 0; + encoder->port = port; + encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port); dig_port->hpd_pulse = intel_dp_hpd_pulse; @@ -1395,7 +1396,7 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv, return true; err_init_connector: - drm_encoder_cleanup(encoder); + drm_encoder_cleanup(&encoder->base); err_encoder_init: kfree(intel_connector); err_connector_alloc: diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.c b/drivers/gpu/drm/i915/display/g4x_hdmi.c index 5606c667e422..1e292c4a177f 100644 --- a/drivers/gpu/drm/i915/display/g4x_hdmi.c +++ b/drivers/gpu/drm/i915/display/g4x_hdmi.c @@ -521,7 +521,7 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg, enum port port) { struct intel_digital_port *dig_port; - struct intel_encoder *intel_encoder; + struct intel_encoder *encoder; struct intel_connector *intel_connector; dig_port = kzalloc(sizeof(*dig_port), GFP_KERNEL); @@ -534,66 +534,66 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv, return; } - intel_encoder = &dig_port->base; + encoder = &dig_port->base; mutex_init(&dig_port->hdcp_mutex); - drm_encoder_init(&dev_priv->drm, &intel_encoder->base, + drm_encoder_init(&dev_priv->drm, &encoder->base, &intel_hdmi_enc_funcs, DRM_MODE_ENCODER_TMDS, "HDMI %c", port_name(port)); - intel_encoder->hotplug = intel_hdmi_hotplug; - intel_encoder->compute_config = intel_hdmi_compute_config; + encoder->hotplug = intel_hdmi_hotplug; + encoder->compute_config = intel_hdmi_compute_config; if (HAS_PCH_SPLIT(dev_priv)) { - intel_encoder->disable = pch_disable_hdmi; - intel_encoder->post_disable = pch_post_disable_hdmi; + encoder->disable = pch_disable_hdmi; + encoder->post_disable = pch_post_disable_hdmi; } else { - intel_encoder->disable = g4x_disable_hdmi; + encoder->disable = g4x_disable_hdmi; } - intel_encoder->get_hw_state = intel_hdmi_get_hw_state; - intel_encoder->get_config = intel_hdmi_get_config; + encoder->get_hw_state = intel_hdmi_get_hw_state; + encoder->get_config = intel_hdmi_get_config; if (IS_CHERRYVIEW(dev_priv)) { - intel_encoder->pre_pll_enable = chv_hdmi_pre_pll_enable; - intel_encoder->pre_enable = chv_hdmi_pre_enable; - intel_encoder->enable = vlv_enable_hdmi; - intel_encoder->post_disable = chv_hdmi_post_disable; - intel_encoder->post_pll_disable = chv_hdmi_post_pll_disable; + encoder->pre_pll_enable = chv_hdmi_pre_pll_enable; + encoder->pre_enable = chv_hdmi_pre_enable; + encoder->enable = vlv_enable_hdmi; + encoder->post_disable = chv_hdmi_post_disable; + encoder->post_pll_disable = chv_hdmi_post_pll_disable; } else if (IS_VALLEYVIEW(dev_priv)) { - intel_encoder->pre_pll_enable = vlv_hdmi_pre_pll_enable; - intel_encoder->pre_enable = vlv_hdmi_pre_enable; - intel_encoder->enable = vlv_enable_hdmi; - intel_encoder->post_disable = vlv_hdmi_post_disable; + encoder->pre_pll_enable = vlv_hdmi_pre_pll_enable; + encoder->pre_enable = vlv_hdmi_pre_enable; + encoder->enable = vlv_enable_hdmi; + encoder->post_disable = vlv_hdmi_post_disable; } else { - intel_encoder->pre_enable = intel_hdmi_pre_enable; + encoder->pre_enable = intel_hdmi_pre_enable; if (HAS_PCH_CPT(dev_priv)) - intel_encoder->enable = cpt_enable_hdmi; + encoder->enable = cpt_enable_hdmi; else if (HAS_PCH_IBX(dev_priv)) - intel_encoder->enable = ibx_enable_hdmi; + encoder->enable = ibx_enable_hdmi; else - intel_encoder->enable = g4x_enable_hdmi; + encoder->enable = g4x_enable_hdmi; } - intel_encoder->shutdown = intel_hdmi_encoder_shutdown; + encoder->shutdown = intel_hdmi_encoder_shutdown; - intel_encoder->type = INTEL_OUTPUT_HDMI; - intel_encoder->power_domain = intel_display_power_ddi_lanes_domain(dev_priv, port); - intel_encoder->port = port; + encoder->type = INTEL_OUTPUT_HDMI; + encoder->power_domain = intel_display_power_ddi_lanes_domain(dev_priv, port); + encoder->port = port; if (IS_CHERRYVIEW(dev_priv)) { if (port == PORT_D) - intel_encoder->pipe_mask = BIT(PIPE_C); + encoder->pipe_mask = BIT(PIPE_C); else - intel_encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B); + encoder->pipe_mask = BIT(PIPE_A) | BIT(PIPE_B); } else { - intel_encoder->pipe_mask = ~0; + encoder->pipe_mask = ~0; } - intel_encoder->cloneable = BIT(INTEL_OUTPUT_ANALOG); - intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port); + encoder->cloneable = BIT(INTEL_OUTPUT_ANALOG); + encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port); /* * BSpec is unclear about HDMI+HDMI cloning on g4x, but it seems * to work on real hardware. And since g4x can send infoframes to * only one port anyway, nothing is lost by allowing it. */ if (IS_G4X(dev_priv)) - intel_encoder->cloneable |= BIT(INTEL_OUTPUT_HDMI); + encoder->cloneable |= BIT(INTEL_OUTPUT_HDMI); dig_port->hdmi.hdmi_reg = hdmi_reg; dig_port->dp.output_reg = INVALID_MMIO_REG; diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 47f13750f6fa..2213d88daf38 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -1774,13 +1774,8 @@ static bool gen11_dsi_initial_fastset_check(struct intel_encoder *encoder, return true; } -static void gen11_dsi_encoder_destroy(struct drm_encoder *encoder) -{ - intel_encoder_destroy(encoder); -} - static const struct drm_encoder_funcs gen11_dsi_encoder_funcs = { - .destroy = gen11_dsi_encoder_destroy, + .destroy = intel_encoder_destroy, }; static const struct drm_connector_funcs gen11_dsi_connector_funcs = { diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index aacbc6da84ef..41d26b717baa 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -1216,14 +1216,14 @@ static int i915_audio_component_get_eld(struct device *kdev, int port, unsigned char *buf, int max_bytes) { struct drm_i915_private *dev_priv = kdev_to_i915(kdev); - struct intel_encoder *intel_encoder; + struct intel_encoder *encoder; const u8 *eld; int ret = -EINVAL; mutex_lock(&dev_priv->display.audio.mutex); - intel_encoder = get_saved_enc(dev_priv, port, pipe); - if (!intel_encoder) { + encoder = get_saved_enc(dev_priv, port, pipe); + if (!encoder) { drm_dbg_kms(&dev_priv->drm, "Not valid for port %c\n", port_name(port)); mutex_unlock(&dev_priv->display.audio.mutex); @@ -1231,9 +1231,9 @@ static int i915_audio_component_get_eld(struct device *kdev, int port, } ret = 0; - *enabled = intel_encoder->audio_connector != NULL; + *enabled = encoder->audio_connector != NULL; if (*enabled) { - eld = intel_encoder->audio_connector->eld; + eld = encoder->audio_connector->eld; ret = drm_eld_size(eld); memcpy(buf, eld, min(max_bytes, ret)); } diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c index 94d0a5e1dd03..9400af950691 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.c +++ b/drivers/gpu/drm/i915/display/intel_crt.c @@ -828,7 +828,7 @@ intel_crt_detect(struct drm_connector *connector, { struct drm_i915_private *dev_priv = to_i915(connector->dev); struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector)); - struct intel_encoder *intel_encoder = &crt->base; + struct intel_encoder *encoder = &crt->base; intel_wakeref_t wakeref; int status, ret; struct intel_load_detect_pipe tmp; @@ -841,8 +841,7 @@ intel_crt_detect(struct drm_connector *connector, return connector_status_disconnected; if (dev_priv->params.load_detect_test) { - wakeref = intel_display_power_get(dev_priv, - intel_encoder->power_domain); + wakeref = intel_display_power_get(dev_priv, encoder->power_domain); goto load_detect; } @@ -850,8 +849,7 @@ intel_crt_detect(struct drm_connector *connector, if (dmi_check_system(intel_spurious_crt_detect)) return connector_status_disconnected; - wakeref = intel_display_power_get(dev_priv, - intel_encoder->power_domain); + wakeref = intel_display_power_get(dev_priv, encoder->power_domain); if (I915_HAS_HOTPLUG(dev_priv)) { /* We can not rely on the HPD pin always being correctly wired @@ -908,7 +906,7 @@ intel_crt_detect(struct drm_connector *connector, } out: - intel_display_power_put(dev_priv, intel_encoder->power_domain, wakeref); + intel_display_power_put(dev_priv, encoder->power_domain, wakeref); /* * Make sure the refs for power wells enabled during detect are @@ -924,13 +922,12 @@ static int intel_crt_get_modes(struct drm_connector *connector) struct drm_device *dev = connector->dev; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector)); - struct intel_encoder *intel_encoder = &crt->base; + struct intel_encoder *encoder = &crt->base; intel_wakeref_t wakeref; struct i2c_adapter *i2c; int ret; - wakeref = intel_display_power_get(dev_priv, - intel_encoder->power_domain); + wakeref = intel_display_power_get(dev_priv, encoder->power_domain); i2c = intel_gmbus_get_adapter(dev_priv, dev_priv->display.vbt.crt_ddc_pin); ret = intel_crt_ddc_get_modes(connector, i2c); @@ -942,15 +939,16 @@ static int intel_crt_get_modes(struct drm_connector *connector) ret = intel_crt_ddc_get_modes(connector, i2c); out: - intel_display_power_put(dev_priv, intel_encoder->power_domain, wakeref); + intel_display_power_put(dev_priv, encoder->power_domain, wakeref); return ret; } -void intel_crt_reset(struct drm_encoder *encoder) +void intel_crt_reset(struct drm_encoder *_encoder) { - struct drm_i915_private *dev_priv = to_i915(encoder->dev); - struct intel_crt *crt = intel_encoder_to_crt(to_intel_encoder(encoder)); + struct intel_encoder *encoder = to_intel_encoder(_encoder); + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct intel_crt *crt = intel_encoder_to_crt(encoder); if (DISPLAY_VER(dev_priv) >= 5) { u32 adpa; diff --git a/drivers/gpu/drm/i915/display/intel_crt.h b/drivers/gpu/drm/i915/display/intel_crt.h index c6071efd93ce..ae0364bad274 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.h +++ b/drivers/gpu/drm/i915/display/intel_crt.h @@ -15,6 +15,6 @@ struct drm_i915_private; bool intel_crt_port_enabled(struct drm_i915_private *dev_priv, i915_reg_t adpa_reg, enum pipe *pipe); void intel_crt_init(struct drm_i915_private *dev_priv); -void intel_crt_reset(struct drm_encoder *encoder); +void intel_crt_reset(struct drm_encoder *_encoder); #endif /* __INTEL_CRT_H__ */ diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 643832d55c28..65c92ad634f8 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -619,18 +619,17 @@ void intel_ddi_disable_transcoder_func(const struct intel_crtc_state *crtc_state } } -int intel_ddi_toggle_hdcp_bits(struct intel_encoder *intel_encoder, +int intel_ddi_toggle_hdcp_bits(struct intel_encoder *encoder, enum transcoder cpu_transcoder, bool enable, u32 hdcp_mask) { - struct drm_device *dev = intel_encoder->base.dev; + struct drm_device *dev = encoder->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); intel_wakeref_t wakeref; int ret = 0; u32 tmp; - wakeref = intel_display_power_get_if_enabled(dev_priv, - intel_encoder->power_domain); + wakeref = intel_display_power_get_if_enabled(dev_priv, encoder->power_domain); if (drm_WARN_ON(dev, !wakeref)) return -ENXIO; @@ -640,7 +639,7 @@ int intel_ddi_toggle_hdcp_bits(struct intel_encoder *intel_encoder, else tmp &= ~hdcp_mask; intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder), tmp); - intel_display_power_put(dev_priv, intel_encoder->power_domain, wakeref); + intel_display_power_put(dev_priv, encoder->power_domain, wakeref); return ret; } @@ -3771,10 +3770,11 @@ static int intel_ddi_compute_config_late(struct intel_encoder *encoder, return 0; } -static void intel_ddi_encoder_destroy(struct drm_encoder *encoder) +static void intel_ddi_encoder_destroy(struct drm_encoder *_encoder) { - struct drm_i915_private *i915 = to_i915(encoder->dev); - struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder)); + struct intel_encoder *encoder = to_intel_encoder(_encoder); + struct drm_i915_private *i915 = to_i915(encoder->base.dev); + struct intel_digital_port *dig_port = enc_to_dig_port(encoder); enum phy phy = intel_port_to_phy(i915, dig_port->base.port); intel_dp_encoder_flush_work(encoder); @@ -3782,14 +3782,15 @@ static void intel_ddi_encoder_destroy(struct drm_encoder *encoder) intel_tc_port_flush_work(dig_port); intel_display_power_flush_work(i915); - drm_encoder_cleanup(encoder); + drm_encoder_cleanup(&encoder->base); kfree(dig_port->hdcp_port_data.streams); kfree(dig_port); } -static void intel_ddi_encoder_reset(struct drm_encoder *encoder) +static void intel_ddi_encoder_reset(struct drm_encoder *_encoder) { - struct intel_dp *intel_dp = enc_to_intel_dp(to_intel_encoder(encoder)); + struct intel_encoder *encoder = to_intel_encoder(_encoder); + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); intel_dp->reset_link_params = true; diff --git a/drivers/gpu/drm/i915/display/intel_ddi.h b/drivers/gpu/drm/i915/display/intel_ddi.h index d39076facdce..ebdf13fbeb41 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.h +++ b/drivers/gpu/drm/i915/display/intel_ddi.h @@ -27,7 +27,7 @@ i915_reg_t dp_tp_ctl_reg(struct intel_encoder *encoder, i915_reg_t dp_tp_status_reg(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state); void intel_ddi_fdi_post_disable(struct intel_atomic_state *state, - struct intel_encoder *intel_encoder, + struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state); void intel_ddi_enable_clock(struct intel_encoder *encoder, @@ -62,7 +62,7 @@ void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state, bool state); void intel_ddi_compute_min_voltage_level(struct drm_i915_private *dev_priv, struct intel_crtc_state *crtc_state); -int intel_ddi_toggle_hdcp_bits(struct intel_encoder *intel_encoder, +int intel_ddi_toggle_hdcp_bits(struct intel_encoder *encoder, enum transcoder cpu_transcoder, bool enable, u32 hdcp_mask); void intel_ddi_sanitize_encoder_pll_mapping(struct intel_encoder *encoder); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 53b7ee6e8a0a..a9b1b6b1b40b 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -2172,7 +2172,7 @@ static void get_crtc_power_domains(struct intel_crtc_state *crtc_state, struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; - struct drm_encoder *encoder; + struct intel_encoder *encoder; enum pipe pipe = crtc->pipe; bitmap_zero(mask->bits, POWER_DOMAIN_NUM); @@ -2186,12 +2186,9 @@ static void get_crtc_power_domains(struct intel_crtc_state *crtc_state, crtc_state->pch_pfit.force_thru) set_bit(POWER_DOMAIN_PIPE_PANEL_FITTER(pipe), mask->bits); - drm_for_each_encoder_mask(encoder, &dev_priv->drm, - crtc_state->uapi.encoder_mask) { - struct intel_encoder *intel_encoder = to_intel_encoder(encoder); - - set_bit(intel_encoder->power_domain, mask->bits); - } + for_each_intel_encoder_mask(&dev_priv->drm, encoder, + crtc_state->uapi.encoder_mask) + set_bit(encoder->power_domain, mask->bits); if (HAS_DDI(dev_priv) && crtc_state->has_audio) set_bit(POWER_DOMAIN_AUDIO_MMIO, mask->bits); @@ -2433,12 +2430,12 @@ int intel_display_suspend(struct drm_device *dev) return ret; } -void intel_encoder_destroy(struct drm_encoder *encoder) +void intel_encoder_destroy(struct drm_encoder *_encoder) { - struct intel_encoder *intel_encoder = to_intel_encoder(encoder); + struct intel_encoder *encoder = to_intel_encoder(_encoder); - drm_encoder_cleanup(encoder); - kfree(intel_encoder); + drm_encoder_cleanup(&encoder->base); + kfree(encoder); } static bool intel_crtc_supports_double_wide(const struct intel_crtc *crtc) @@ -4348,16 +4345,15 @@ void intel_release_load_detect_pipe(struct drm_connector *connector, struct intel_load_detect_pipe *old, struct drm_modeset_acquire_ctx *ctx) { - struct intel_encoder *intel_encoder = + struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector)); - struct drm_i915_private *i915 = to_i915(intel_encoder->base.dev); - struct drm_encoder *encoder = &intel_encoder->base; + struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct drm_atomic_state *state = old->restore_state; int ret; drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n", connector->base.id, connector->name, - encoder->base.id, encoder->name); + encoder->base.base.id, encoder->base.name); if (!state) return; diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h index 884e8e67b17c..92a05f1f9232 100644 --- a/drivers/gpu/drm/i915/display/intel_display.h +++ b/drivers/gpu/drm/i915/display/intel_display.h @@ -588,7 +588,7 @@ unsigned int intel_rotation_info_size(const struct intel_rotation_info *rot_info unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info); bool intel_has_pending_fb_unpin(struct drm_i915_private *dev_priv); int intel_display_suspend(struct drm_device *dev); -void intel_encoder_destroy(struct drm_encoder *encoder); +void intel_encoder_destroy(struct drm_encoder *_encoder); struct drm_display_mode * intel_encoder_current_mode(struct intel_encoder *encoder); void intel_encoder_get_config(struct intel_encoder *encoder, diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index fe40e2a226d6..a1700c42c455 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -517,8 +517,8 @@ static void intel_hdcp_info(struct seq_file *m, static void intel_dp_info(struct seq_file *m, struct intel_connector *intel_connector) { - struct intel_encoder *intel_encoder = intel_attached_encoder(intel_connector); - struct intel_dp *intel_dp = enc_to_intel_dp(intel_encoder); + struct intel_encoder *encoder = intel_attached_encoder(intel_connector); + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); const struct drm_property_blob *edid = intel_connector->base.edid_blob_ptr; seq_printf(m, "\tDPCD rev: %x\n", intel_dp->dpcd[DP_DPCD_REV]); @@ -540,8 +540,8 @@ static void intel_dp_mst_info(struct seq_file *m, static void intel_hdmi_info(struct seq_file *m, struct intel_connector *intel_connector) { - struct intel_encoder *intel_encoder = intel_attached_encoder(intel_connector); - struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(intel_encoder); + struct intel_encoder *encoder = intel_attached_encoder(intel_connector); + struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); seq_printf(m, "\taudio support: %s\n", str_yes_no(intel_hdmi->has_audio)); @@ -1160,7 +1160,7 @@ static int i915_dp_mst_info(struct seq_file *m, void *unused) { struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_device *dev = &dev_priv->drm; - struct intel_encoder *intel_encoder; + struct intel_encoder *encoder; struct intel_digital_port *dig_port; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; @@ -1170,17 +1170,16 @@ static int i915_dp_mst_info(struct seq_file *m, void *unused) if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) continue; - intel_encoder = intel_attached_encoder(to_intel_connector(connector)); - if (!intel_encoder || intel_encoder->type == INTEL_OUTPUT_DP_MST) + encoder = intel_attached_encoder(to_intel_connector(connector)); + if (!encoder || encoder->type == INTEL_OUTPUT_DP_MST) continue; - dig_port = enc_to_dig_port(intel_encoder); + dig_port = enc_to_dig_port(encoder); if (!intel_dp_mst_source_support(&dig_port->dp)) continue; seq_printf(m, "MST Source Port [ENCODER:%d:%s]\n", - dig_port->base.base.base.id, - dig_port->base.base.name); + encoder->base.base.id, encoder->base.name); drm_dp_mst_dump_topology(m, &dig_port->dp.mst_mgr); } drm_connector_list_iter_end(&conn_iter); diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 11f083cf1124..b730c515d431 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1882,12 +1882,10 @@ enc_to_mst(struct intel_encoder *encoder) static inline struct intel_digital_port * enc_to_dig_port(struct intel_encoder *encoder) { - struct intel_encoder *intel_encoder = encoder; - - if (intel_encoder_is_dig_port(intel_encoder)) + if (intel_encoder_is_dig_port(encoder)) return container_of(&encoder->base, struct intel_digital_port, base.base); - else if (intel_encoder_is_mst(intel_encoder)) + else if (intel_encoder_is_mst(encoder)) return enc_to_mst(encoder)->primary; else return NULL; diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 8fe48634eb9d..fa9931656383 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4773,8 +4773,8 @@ intel_dp_force(struct drm_connector *connector) { struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector)); struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); - struct intel_encoder *intel_encoder = &dig_port->base; - struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); + struct intel_encoder *encoder = &dig_port->base; + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); enum intel_display_power_domain aux_domain = intel_aux_power_domain(dig_port); intel_wakeref_t wakeref; @@ -4873,9 +4873,9 @@ intel_dp_connector_unregister(struct drm_connector *connector) intel_connector_unregister(connector); } -void intel_dp_encoder_flush_work(struct drm_encoder *encoder) +void intel_dp_encoder_flush_work(struct intel_encoder *encoder) { - struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder)); + struct intel_digital_port *dig_port = enc_to_dig_port(encoder); struct intel_dp *intel_dp = &dig_port->dp; intel_dp_mst_encoder_cleanup(dig_port); @@ -4885,16 +4885,16 @@ void intel_dp_encoder_flush_work(struct drm_encoder *encoder) intel_dp_aux_fini(intel_dp); } -void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder) +void intel_dp_encoder_suspend(struct intel_encoder *encoder) { - struct intel_dp *intel_dp = enc_to_intel_dp(intel_encoder); + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); intel_pps_vdd_off_sync(intel_dp); } -void intel_dp_encoder_shutdown(struct intel_encoder *intel_encoder) +void intel_dp_encoder_shutdown(struct intel_encoder *encoder) { - struct intel_dp *intel_dp = enc_to_intel_dp(intel_encoder); + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); intel_pps_wait_power_cycle(intel_dp); } @@ -5368,10 +5368,10 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, { struct drm_connector *connector = &intel_connector->base; struct intel_dp *intel_dp = &dig_port->dp; - struct intel_encoder *intel_encoder = &dig_port->base; - struct drm_device *dev = intel_encoder->base.dev; + struct intel_encoder *encoder = &dig_port->base; + struct drm_device *dev = encoder->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); - enum port port = intel_encoder->port; + enum port port = encoder->port; enum phy phy = intel_port_to_phy(dev_priv, port); int type; @@ -5381,8 +5381,8 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, if (drm_WARN(dev, dig_port->max_lanes < 1, "Not enough lanes (%d) for DP on [ENCODER:%d:%s]\n", - dig_port->max_lanes, intel_encoder->base.base.id, - intel_encoder->base.name)) + dig_port->max_lanes, encoder->base.base.id, + encoder->base.name)) return false; intel_dp->reset_link_params = true; @@ -5400,7 +5400,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, */ drm_WARN_ON(dev, intel_phy_is_tc(dev_priv, phy)); type = DRM_MODE_CONNECTOR_eDP; - intel_encoder->type = INTEL_OUTPUT_EDP; + encoder->type = INTEL_OUTPUT_EDP; /* eDP only on port B and/or C on vlv/chv */ if (drm_WARN_ON(dev, (IS_VALLEYVIEW(dev_priv) || @@ -5420,7 +5420,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, drm_dbg_kms(&dev_priv->drm, "Adding %s connector on [ENCODER:%d:%s]\n", type == DRM_MODE_CONNECTOR_eDP ? "eDP" : "DP", - intel_encoder->base.base.id, intel_encoder->base.name); + encoder->base.base.id, encoder->base.name); drm_connector_init(dev, connector, &intel_dp_connector_funcs, type); drm_connector_helper_add(connector, &intel_dp_connector_helper_funcs); @@ -5432,7 +5432,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, intel_dp_aux_init(intel_dp); - intel_connector_attach_encoder(intel_connector, intel_encoder); + intel_connector_attach_encoder(intel_connector, encoder); if (HAS_DDI(dev_priv)) intel_connector->get_hw_state = intel_ddi_connector_get_hw_state; diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h index a54902c713a3..b5fee51eb92b 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.h +++ b/drivers/gpu/drm/i915/display/intel_dp.h @@ -12,7 +12,6 @@ enum intel_output_format; enum pipe; enum port; struct drm_connector_state; -struct drm_encoder; struct drm_i915_private; struct drm_modeset_acquire_ctx; struct drm_dp_vsc_sdp; @@ -50,9 +49,9 @@ void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp, void intel_dp_sink_set_decompression_state(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state, bool enable); -void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder); -void intel_dp_encoder_shutdown(struct intel_encoder *intel_encoder); -void intel_dp_encoder_flush_work(struct drm_encoder *encoder); +void intel_dp_encoder_suspend(struct intel_encoder *encoder); +void intel_dp_encoder_shutdown(struct intel_encoder *encoder); +void intel_dp_encoder_flush_work(struct intel_encoder *encoder); int intel_dp_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state); diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index 35360dd543ac..4c73f3a8b6a4 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -797,8 +797,8 @@ int intel_dp_hdcp_init(struct intel_digital_port *dig_port, { struct drm_device *dev = intel_connector->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); - struct intel_encoder *intel_encoder = &dig_port->base; - enum port port = intel_encoder->port; + struct intel_encoder *encoder = &dig_port->base; + enum port port = encoder->port; struct intel_dp *intel_dp = &dig_port->dp; if (!is_hdcp_supported(dev_priv, port)) diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index ac67738e4eda..d98657a61527 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -767,11 +767,12 @@ static const struct drm_connector_helper_funcs intel_dp_mst_connector_helper_fun .detect_ctx = intel_dp_mst_detect, }; -static void intel_dp_mst_encoder_destroy(struct drm_encoder *encoder) +static void intel_dp_mst_encoder_destroy(struct drm_encoder *_encoder) { - struct intel_dp_mst_encoder *intel_mst = enc_to_mst(to_intel_encoder(encoder)); + struct intel_encoder *encoder = to_intel_encoder(_encoder); + struct intel_dp_mst_encoder *intel_mst = enc_to_mst(encoder); - drm_encoder_cleanup(encoder); + drm_encoder_cleanup(&encoder->base); kfree(intel_mst); } @@ -850,10 +851,11 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo drm_connector_helper_add(connector, &intel_dp_mst_connector_helper_funcs); for_each_pipe(dev_priv, pipe) { - struct drm_encoder *enc = - &intel_dp->mst_encoders[pipe]->base.base; + struct intel_encoder *encoder = + &intel_dp->mst_encoders[pipe]->base; - ret = drm_connector_attach_encoder(&intel_connector->base, enc); + ret = drm_connector_attach_encoder(&intel_connector->base, + &encoder->base); if (ret) goto err; } @@ -891,7 +893,7 @@ static struct intel_dp_mst_encoder * intel_dp_create_fake_mst_encoder(struct intel_digital_port *dig_port, enum pipe pipe) { struct intel_dp_mst_encoder *intel_mst; - struct intel_encoder *intel_encoder; + struct intel_encoder *encoder; struct drm_device *dev = dig_port->base.base.dev; intel_mst = kzalloc(sizeof(*intel_mst), GFP_KERNEL); @@ -900,16 +902,16 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *dig_port, enum pipe return NULL; intel_mst->pipe = pipe; - intel_encoder = &intel_mst->base; + encoder = &intel_mst->base; intel_mst->primary = dig_port; - drm_encoder_init(dev, &intel_encoder->base, &intel_dp_mst_enc_funcs, + drm_encoder_init(dev, &encoder->base, &intel_dp_mst_enc_funcs, DRM_MODE_ENCODER_DPMST, "DP-MST %c", pipe_name(pipe)); - intel_encoder->type = INTEL_OUTPUT_DP_MST; - intel_encoder->power_domain = dig_port->base.power_domain; - intel_encoder->port = dig_port->base.port; - intel_encoder->cloneable = 0; + encoder->type = INTEL_OUTPUT_DP_MST; + encoder->power_domain = dig_port->base.power_domain; + encoder->port = dig_port->base.port; + encoder->cloneable = 0; /* * This is wrong, but broken userspace uses the intersection * of possible_crtcs of all the encoders of a given connector @@ -918,19 +920,19 @@ intel_dp_create_fake_mst_encoder(struct intel_digital_port *dig_port, enum pipe * To keep such userspace functioning we must misconfigure * this to make sure the intersection is not empty :( */ - intel_encoder->pipe_mask = ~0; + encoder->pipe_mask = ~0; - intel_encoder->compute_config = intel_dp_mst_compute_config; - intel_encoder->compute_config_late = intel_dp_mst_compute_config_late; - intel_encoder->disable = intel_mst_disable_dp; - intel_encoder->post_disable = intel_mst_post_disable_dp; - intel_encoder->update_pipe = intel_ddi_update_pipe; - intel_encoder->pre_pll_enable = intel_mst_pre_pll_enable_dp; - intel_encoder->pre_enable = intel_mst_pre_enable_dp; - intel_encoder->enable = intel_mst_enable_dp; - intel_encoder->get_hw_state = intel_dp_mst_enc_get_hw_state; - intel_encoder->get_config = intel_dp_mst_enc_get_config; - intel_encoder->initial_fastset_check = intel_dp_mst_initial_fastset_check; + encoder->compute_config = intel_dp_mst_compute_config; + encoder->compute_config_late = intel_dp_mst_compute_config_late; + encoder->disable = intel_mst_disable_dp; + encoder->post_disable = intel_mst_post_disable_dp; + encoder->update_pipe = intel_ddi_update_pipe; + encoder->pre_pll_enable = intel_mst_pre_pll_enable_dp; + encoder->pre_enable = intel_mst_pre_enable_dp; + encoder->enable = intel_mst_enable_dp; + encoder->get_hw_state = intel_dp_mst_enc_get_hw_state; + encoder->get_config = intel_dp_mst_enc_get_config; + encoder->initial_fastset_check = intel_dp_mst_initial_fastset_check; return intel_mst; diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c index 595087288922..d3532e51843c 100644 --- a/drivers/gpu/drm/i915/display/intel_dvo.c +++ b/drivers/gpu/drm/i915/display/intel_dvo.c @@ -364,14 +364,15 @@ static const struct drm_connector_helper_funcs intel_dvo_connector_helper_funcs .get_modes = intel_dvo_get_modes, }; -static void intel_dvo_enc_destroy(struct drm_encoder *encoder) +static void intel_dvo_enc_destroy(struct drm_encoder *_encoder) { - struct intel_dvo *intel_dvo = enc_to_dvo(to_intel_encoder(encoder)); + struct intel_encoder *encoder = to_intel_encoder(_encoder); + struct intel_dvo *intel_dvo = enc_to_dvo(encoder); if (intel_dvo->dev.dev_ops->destroy) intel_dvo->dev.dev_ops->destroy(&intel_dvo->dev); - intel_encoder_destroy(encoder); + intel_encoder_destroy(&encoder->base); } static const struct drm_encoder_funcs intel_dvo_enc_funcs = { @@ -390,7 +391,7 @@ static enum port intel_dvo_port(i915_reg_t dvo_reg) void intel_dvo_init(struct drm_i915_private *dev_priv) { - struct intel_encoder *intel_encoder; + struct intel_encoder *encoder; struct intel_dvo *intel_dvo; struct intel_connector *intel_connector; int i; @@ -408,14 +409,14 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) intel_dvo->attached_connector = intel_connector; - intel_encoder = &intel_dvo->base; + encoder = &intel_dvo->base; - intel_encoder->disable = intel_disable_dvo; - intel_encoder->enable = intel_enable_dvo; - intel_encoder->get_hw_state = intel_dvo_get_hw_state; - intel_encoder->get_config = intel_dvo_get_config; - intel_encoder->compute_config = intel_dvo_compute_config; - intel_encoder->pre_enable = intel_dvo_pre_enable; + encoder->disable = intel_disable_dvo; + encoder->enable = intel_enable_dvo; + encoder->get_hw_state = intel_dvo_get_hw_state; + encoder->get_config = intel_dvo_get_config; + encoder->compute_config = intel_dvo_compute_config; + encoder->pre_enable = intel_dvo_pre_enable; intel_connector->get_hw_state = intel_dvo_connector_get_hw_state; /* Now, try to find a controller */ @@ -481,17 +482,17 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) continue; port = intel_dvo_port(dvo->dvo_reg); - drm_encoder_init(&dev_priv->drm, &intel_encoder->base, + drm_encoder_init(&dev_priv->drm, &encoder->base, &intel_dvo_enc_funcs, encoder_type, "DVO %c", port_name(port)); - intel_encoder->type = INTEL_OUTPUT_DVO; - intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER; - intel_encoder->port = port; - intel_encoder->pipe_mask = ~0; + encoder->type = INTEL_OUTPUT_DVO; + encoder->power_domain = POWER_DOMAIN_PORT_OTHER; + encoder->port = port; + encoder->pipe_mask = ~0; if (dvo->type != INTEL_DVO_CHIP_LVDS) - intel_encoder->cloneable = BIT(INTEL_OUTPUT_ANALOG) | + encoder->cloneable = BIT(INTEL_OUTPUT_ANALOG) | BIT(INTEL_OUTPUT_DVO); switch (dvo->type) { @@ -516,7 +517,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) &intel_dvo_connector_helper_funcs); connector->display_info.subpixel_order = SubPixelHorizontalRGB; - intel_connector_attach_encoder(intel_connector, intel_encoder); + intel_connector_attach_encoder(intel_connector, encoder); if (dvo->type == INTEL_DVO_CHIP_LVDS) { /* * For our LVDS chipsets, we should hopefully be able @@ -526,8 +527,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) * headers, likely), so for now, just get the current * mode being output through DVO. */ - intel_panel_add_encoder_fixed_mode(intel_connector, - intel_encoder); + intel_panel_add_encoder_fixed_mode(intel_connector, encoder); intel_panel_init(intel_connector); diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 93519fb23d9d..4d57d6193142 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2927,27 +2927,27 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port, { struct drm_connector *connector = &intel_connector->base; struct intel_hdmi *intel_hdmi = &dig_port->hdmi; - struct intel_encoder *intel_encoder = &dig_port->base; - struct drm_device *dev = intel_encoder->base.dev; + struct intel_encoder *encoder = &dig_port->base; + struct drm_device *dev = encoder->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); struct i2c_adapter *ddc; - enum port port = intel_encoder->port; + enum port port = encoder->port; struct cec_connector_info conn_info; drm_dbg_kms(&dev_priv->drm, "Adding HDMI connector on [ENCODER:%d:%s]\n", - intel_encoder->base.base.id, intel_encoder->base.name); + encoder->base.base.id, encoder->base.name); if (DISPLAY_VER(dev_priv) < 12 && drm_WARN_ON(dev, port == PORT_A)) return; if (drm_WARN(dev, dig_port->max_lanes < 4, "Not enough lanes (%d) for HDMI on [ENCODER:%d:%s]\n", - dig_port->max_lanes, intel_encoder->base.base.id, - intel_encoder->base.name)) + dig_port->max_lanes, encoder->base.base.id, + encoder->base.name)) return; - intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(intel_encoder); + intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(encoder); ddc = intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus); drm_connector_init_with_ddc(dev, connector, @@ -2971,7 +2971,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port, intel_hdmi_add_properties(intel_hdmi, connector); - intel_connector_attach_encoder(intel_connector, intel_encoder); + intel_connector_attach_encoder(intel_connector, encoder); intel_hdmi->attached_connector = intel_connector; if (is_hdcp_supported(dev_priv, port)) { diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h b/drivers/gpu/drm/i915/display/intel_hdmi.h index 93f65a917c36..8532f0cc3dd2 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.h +++ b/drivers/gpu/drm/i915/display/intel_hdmi.h @@ -10,7 +10,6 @@ #include struct drm_connector; -struct drm_encoder; struct drm_i915_private; struct intel_connector; struct intel_digital_port; diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 270368b43729..251282ef2d90 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -407,15 +407,13 @@ intel_lvds_mode_valid(struct drm_connector *connector, return MODE_OK; } -static int intel_lvds_compute_config(struct intel_encoder *intel_encoder, +static int intel_lvds_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); - struct intel_lvds_encoder *lvds_encoder = - to_lvds_encoder(intel_encoder); - struct intel_connector *intel_connector = - lvds_encoder->attached_connector; + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder); + struct intel_connector *intel_connector = lvds_encoder->attached_connector; struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); unsigned int lvds_bpp; @@ -830,10 +828,9 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) { struct drm_device *dev = &dev_priv->drm; struct intel_lvds_encoder *lvds_encoder; - struct intel_encoder *intel_encoder; + struct intel_encoder *encoder; struct intel_connector *intel_connector; struct drm_connector *connector; - struct drm_encoder *encoder; struct edid *edid; i915_reg_t lvds_reg; u32 lvds; @@ -887,40 +884,39 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) lvds_encoder->attached_connector = intel_connector; - intel_encoder = &lvds_encoder->base; - encoder = &intel_encoder->base; + encoder = &lvds_encoder->base; connector = &intel_connector->base; drm_connector_init(dev, &intel_connector->base, &intel_lvds_connector_funcs, DRM_MODE_CONNECTOR_LVDS); - drm_encoder_init(dev, &intel_encoder->base, &intel_lvds_enc_funcs, + drm_encoder_init(dev, &encoder->base, &intel_lvds_enc_funcs, DRM_MODE_ENCODER_LVDS, "LVDS"); - intel_encoder->enable = intel_enable_lvds; - intel_encoder->pre_enable = intel_pre_enable_lvds; - intel_encoder->compute_config = intel_lvds_compute_config; + encoder->enable = intel_enable_lvds; + encoder->pre_enable = intel_pre_enable_lvds; + encoder->compute_config = intel_lvds_compute_config; if (HAS_PCH_SPLIT(dev_priv)) { - intel_encoder->disable = pch_disable_lvds; - intel_encoder->post_disable = pch_post_disable_lvds; + encoder->disable = pch_disable_lvds; + encoder->post_disable = pch_post_disable_lvds; } else { - intel_encoder->disable = gmch_disable_lvds; + encoder->disable = gmch_disable_lvds; } - intel_encoder->get_hw_state = intel_lvds_get_hw_state; - intel_encoder->get_config = intel_lvds_get_config; - intel_encoder->update_pipe = intel_backlight_update; - intel_encoder->shutdown = intel_lvds_shutdown; + encoder->get_hw_state = intel_lvds_get_hw_state; + encoder->get_config = intel_lvds_get_config; + encoder->update_pipe = intel_backlight_update; + encoder->shutdown = intel_lvds_shutdown; intel_connector->get_hw_state = intel_connector_get_hw_state; - intel_connector_attach_encoder(intel_connector, intel_encoder); + intel_connector_attach_encoder(intel_connector, encoder); - intel_encoder->type = INTEL_OUTPUT_LVDS; - intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER; - intel_encoder->port = PORT_NONE; - intel_encoder->cloneable = 0; + encoder->type = INTEL_OUTPUT_LVDS; + encoder->power_domain = POWER_DOMAIN_PORT_OTHER; + encoder->port = PORT_NONE; + encoder->cloneable = 0; if (DISPLAY_VER(dev_priv) < 4) - intel_encoder->pipe_mask = BIT(PIPE_B); + encoder->pipe_mask = BIT(PIPE_B); else - intel_encoder->pipe_mask = ~0; + encoder->pipe_mask = ~0; drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs); connector->display_info.subpixel_order = SubPixelHorizontalRGB; @@ -982,7 +978,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) * whatever is currently programmed is the correct mode. */ if (!intel_panel_preferred_fixed_mode(intel_connector)) - intel_panel_add_encoder_fixed_mode(intel_connector, intel_encoder); + intel_panel_add_encoder_fixed_mode(intel_connector, encoder); mutex_unlock(&dev->mode_config.mutex); @@ -1005,7 +1001,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) failed: drm_dbg_kms(&dev_priv->drm, "No LVDS modes found, disabling.\n"); drm_connector_cleanup(connector); - drm_encoder_cleanup(encoder); + drm_encoder_cleanup(&encoder->base); kfree(lvds_encoder); intel_connector_free(intel_connector); return; diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c index caa07ef34f21..3ae575dcd40d 100644 --- a/drivers/gpu/drm/i915/display/intel_opregion.c +++ b/drivers/gpu/drm/i915/display/intel_opregion.c @@ -356,10 +356,10 @@ static int swsci(struct drm_i915_private *dev_priv, #define DISPLAY_TYPE_EXTERNAL_FLAT_PANEL 2 #define DISPLAY_TYPE_INTERNAL_FLAT_PANEL 3 -int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, +int intel_opregion_notify_encoder(struct intel_encoder *encoder, bool enable) { - struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); u32 parm = 0; u32 type = 0; u32 port; @@ -374,10 +374,10 @@ int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, if (ret) return ret; - if (intel_encoder->type == INTEL_OUTPUT_DSI) + if (encoder->type == INTEL_OUTPUT_DSI) port = 0; else - port = intel_encoder->port; + port = encoder->port; if (port == PORT_E) { port = 0; @@ -396,15 +396,15 @@ int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, if (port > 4) { drm_dbg_kms(&dev_priv->drm, "[ENCODER:%d:%s] port %c (index %u) out of bounds for display power state notification\n", - intel_encoder->base.base.id, intel_encoder->base.name, - port_name(intel_encoder->port), port); + encoder->base.base.id, encoder->base.name, + port_name(encoder->port), port); return -EINVAL; } if (!enable) parm |= 4 << 8; - switch (intel_encoder->type) { + switch (encoder->type) { case INTEL_OUTPUT_ANALOG: type = DISPLAY_TYPE_CRT; break; @@ -420,8 +420,8 @@ int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, break; default: drm_WARN_ONCE(&dev_priv->drm, 1, - "unsupported intel_encoder type %d\n", - intel_encoder->type); + "unsupported encoder type %d\n", + encoder->type); return -EINVAL; } diff --git a/drivers/gpu/drm/i915/display/intel_opregion.h b/drivers/gpu/drm/i915/display/intel_opregion.h index 2f261f985400..6cebe60349ae 100644 --- a/drivers/gpu/drm/i915/display/intel_opregion.h +++ b/drivers/gpu/drm/i915/display/intel_opregion.h @@ -69,7 +69,7 @@ void intel_opregion_suspend(struct drm_i915_private *dev_priv, pci_power_t state); void intel_opregion_asle_intr(struct drm_i915_private *dev_priv); -int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, +int intel_opregion_notify_encoder(struct intel_encoder *encoder, bool enable); int intel_opregion_notify_adapter(struct drm_i915_private *dev_priv, pci_power_t state); @@ -107,7 +107,7 @@ static inline void intel_opregion_asle_intr(struct drm_i915_private *dev_priv) } static inline int -intel_opregion_notify_encoder(struct intel_encoder *intel_encoder, bool enable) +intel_opregion_notify_encoder(struct intel_encoder *encoder, bool enable) { return 0; } diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 2a99ec7ff737..01c69da81f3d 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -1454,11 +1454,11 @@ static void intel_sdvo_update_props(struct intel_sdvo *intel_sdvo, } static void intel_sdvo_pre_enable(struct intel_atomic_state *state, - struct intel_encoder *intel_encoder, + struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; const struct intel_sdvo_connector_state *sdvo_state = @@ -1466,7 +1466,7 @@ static void intel_sdvo_pre_enable(struct intel_atomic_state *state, struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(conn_state->connector); const struct drm_display_mode *mode = &crtc_state->hw.mode; - struct intel_sdvo *intel_sdvo = to_sdvo(intel_encoder); + struct intel_sdvo *intel_sdvo = to_sdvo(encoder); u32 sdvox; struct intel_sdvo_in_out_map in_out; struct intel_sdvo_dtd input_dtd, output_dtd; @@ -2513,12 +2513,13 @@ static const struct drm_connector_helper_funcs intel_sdvo_connector_helper_funcs .atomic_check = intel_sdvo_atomic_check, }; -static void intel_sdvo_enc_destroy(struct drm_encoder *encoder) +static void intel_sdvo_enc_destroy(struct drm_encoder *_encoder) { - struct intel_sdvo *intel_sdvo = to_sdvo(to_intel_encoder(encoder)); + struct intel_encoder *encoder = to_intel_encoder(_encoder); + struct intel_sdvo *intel_sdvo = to_sdvo(encoder); i2c_del_adapter(&intel_sdvo->ddc); - intel_encoder_destroy(encoder); + intel_encoder_destroy(&encoder->base); } static const struct drm_encoder_funcs intel_sdvo_enc_funcs = { @@ -2734,9 +2735,8 @@ static struct intel_sdvo_connector *intel_sdvo_connector_alloc(void) static bool intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) { - struct drm_encoder *encoder = &intel_sdvo->base.base; + struct intel_encoder *encoder = &intel_sdvo->base; struct drm_connector *connector; - struct intel_encoder *intel_encoder = to_intel_encoder(encoder); struct intel_connector *intel_connector; struct intel_sdvo_connector *intel_sdvo_connector; @@ -2764,12 +2764,12 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) * Ensure that they get re-enabled when an interrupt happens. */ intel_connector->polled = DRM_CONNECTOR_POLL_HPD; - intel_encoder->hotplug = intel_sdvo_hotplug; - intel_sdvo_enable_hotplug(intel_encoder); + encoder->hotplug = intel_sdvo_hotplug; + intel_sdvo_enable_hotplug(encoder); } else { intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; } - encoder->encoder_type = DRM_MODE_ENCODER_TMDS; + encoder->base.encoder_type = DRM_MODE_ENCODER_TMDS; connector->connector_type = DRM_MODE_CONNECTOR_DVID; if (intel_sdvo_is_hdmi_connector(intel_sdvo, device)) { @@ -2791,7 +2791,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) static bool intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) { - struct drm_encoder *encoder = &intel_sdvo->base.base; + struct intel_encoder *encoder = &intel_sdvo->base; struct drm_connector *connector; struct intel_connector *intel_connector; struct intel_sdvo_connector *intel_sdvo_connector; @@ -2804,7 +2804,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) intel_connector = &intel_sdvo_connector->base; connector = &intel_connector->base; - encoder->encoder_type = DRM_MODE_ENCODER_TVDAC; + encoder->base.encoder_type = DRM_MODE_ENCODER_TVDAC; connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; intel_sdvo->controlled_output |= type; @@ -2831,7 +2831,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) static bool intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) { - struct drm_encoder *encoder = &intel_sdvo->base.base; + struct intel_encoder *encoder = &intel_sdvo->base; struct drm_connector *connector; struct intel_connector *intel_connector; struct intel_sdvo_connector *intel_sdvo_connector; @@ -2845,7 +2845,7 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) intel_connector = &intel_sdvo_connector->base; connector = &intel_connector->base; intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT; - encoder->encoder_type = DRM_MODE_ENCODER_DAC; + encoder->base.encoder_type = DRM_MODE_ENCODER_DAC; connector->connector_type = DRM_MODE_CONNECTOR_VGA; if (device == 0) { @@ -2867,8 +2867,8 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) static bool intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) { - struct drm_encoder *encoder = &intel_sdvo->base.base; - struct drm_i915_private *i915 = to_i915(encoder->dev); + struct intel_encoder *encoder = &intel_sdvo->base; + struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct drm_connector *connector; struct intel_connector *intel_connector; struct intel_sdvo_connector *intel_sdvo_connector; @@ -2881,7 +2881,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) intel_connector = &intel_sdvo_connector->base; connector = &intel_connector->base; - encoder->encoder_type = DRM_MODE_ENCODER_LVDS; + encoder->base.encoder_type = DRM_MODE_ENCODER_LVDS; connector->connector_type = DRM_MODE_CONNECTOR_LVDS; if (device == 0) { @@ -3294,7 +3294,7 @@ static void assert_sdvo_port_valid(const struct drm_i915_private *dev_priv, bool intel_sdvo_init(struct drm_i915_private *dev_priv, i915_reg_t sdvo_reg, enum port port) { - struct intel_encoder *intel_encoder; + struct intel_encoder *encoder; struct intel_sdvo *intel_sdvo; int i; @@ -3313,11 +3313,11 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv, goto err_i2c_bus; /* encoder type will be decided later */ - intel_encoder = &intel_sdvo->base; - intel_encoder->type = INTEL_OUTPUT_SDVO; - intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER; - intel_encoder->port = port; - drm_encoder_init(&dev_priv->drm, &intel_encoder->base, + encoder = &intel_sdvo->base; + encoder->type = INTEL_OUTPUT_SDVO; + encoder->power_domain = POWER_DOMAIN_PORT_OTHER; + encoder->port = port; + drm_encoder_init(&dev_priv->drm, &encoder->base, &intel_sdvo_enc_funcs, 0, "SDVO %c", port_name(port)); @@ -3333,17 +3333,17 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv, } } - intel_encoder->compute_config = intel_sdvo_compute_config; + encoder->compute_config = intel_sdvo_compute_config; if (HAS_PCH_SPLIT(dev_priv)) { - intel_encoder->disable = pch_disable_sdvo; - intel_encoder->post_disable = pch_post_disable_sdvo; + encoder->disable = pch_disable_sdvo; + encoder->post_disable = pch_post_disable_sdvo; } else { - intel_encoder->disable = intel_disable_sdvo; + encoder->disable = intel_disable_sdvo; } - intel_encoder->pre_enable = intel_sdvo_pre_enable; - intel_encoder->enable = intel_enable_sdvo; - intel_encoder->get_hw_state = intel_sdvo_get_hw_state; - intel_encoder->get_config = intel_sdvo_get_config; + encoder->pre_enable = intel_sdvo_pre_enable; + encoder->enable = intel_enable_sdvo; + encoder->get_hw_state = intel_sdvo_get_hw_state; + encoder->get_config = intel_sdvo_get_config; /* In default case sdvo lvds is false */ if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) @@ -3367,9 +3367,9 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv, */ if (intel_sdvo->hotplug_active) { if (intel_sdvo->port == PORT_B) - intel_encoder->hpd_pin = HPD_SDVO_B; + encoder->hpd_pin = HPD_SDVO_B; else - intel_encoder->hpd_pin = HPD_SDVO_C; + encoder->hpd_pin = HPD_SDVO_C; } /* @@ -3415,7 +3415,7 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv, intel_sdvo_output_cleanup(intel_sdvo); err: - drm_encoder_cleanup(&intel_encoder->base); + drm_encoder_cleanup(&encoder->base); i2c_del_adapter(&intel_sdvo->ddc); err_i2c_bus: intel_sdvo_unselect_i2c_bus(intel_sdvo); diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index b1c74eca4fe7..8235f91f58c5 100644 --- a/drivers/gpu/drm/i915/display/intel_tv.c +++ b/drivers/gpu/drm/i915/display/intel_tv.c @@ -1917,7 +1917,7 @@ intel_tv_init(struct drm_i915_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct drm_connector *connector; struct intel_tv *intel_tv; - struct intel_encoder *intel_encoder; + struct intel_encoder *encoder; struct intel_connector *intel_connector; u32 tv_dac_on, tv_dac_off, save_tv_dac; @@ -1963,7 +1963,7 @@ intel_tv_init(struct drm_i915_private *dev_priv) return; } - intel_encoder = &intel_tv->base; + encoder = &intel_tv->base; connector = &intel_connector->base; /* @@ -1981,24 +1981,24 @@ intel_tv_init(struct drm_i915_private *dev_priv) drm_connector_init(dev, connector, &intel_tv_connector_funcs, DRM_MODE_CONNECTOR_SVIDEO); - drm_encoder_init(dev, &intel_encoder->base, &intel_tv_enc_funcs, + drm_encoder_init(dev, &encoder->base, &intel_tv_enc_funcs, DRM_MODE_ENCODER_TVDAC, "TV"); - intel_encoder->compute_config = intel_tv_compute_config; - intel_encoder->get_config = intel_tv_get_config; - intel_encoder->pre_enable = intel_tv_pre_enable; - intel_encoder->enable = intel_enable_tv; - intel_encoder->disable = intel_disable_tv; - intel_encoder->get_hw_state = intel_tv_get_hw_state; + encoder->compute_config = intel_tv_compute_config; + encoder->get_config = intel_tv_get_config; + encoder->pre_enable = intel_tv_pre_enable; + encoder->enable = intel_enable_tv; + encoder->disable = intel_disable_tv; + encoder->get_hw_state = intel_tv_get_hw_state; intel_connector->get_hw_state = intel_connector_get_hw_state; - intel_connector_attach_encoder(intel_connector, intel_encoder); + intel_connector_attach_encoder(intel_connector, encoder); - intel_encoder->type = INTEL_OUTPUT_TVOUT; - intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER; - intel_encoder->port = PORT_NONE; - intel_encoder->pipe_mask = ~0; - intel_encoder->cloneable = 0; + encoder->type = INTEL_OUTPUT_TVOUT; + encoder->power_domain = POWER_DOMAIN_PORT_OTHER; + encoder->port = PORT_NONE; + encoder->pipe_mask = ~0; + encoder->cloneable = 0; intel_tv->type = DRM_MODE_CONNECTOR_Unknown; drm_connector_helper_add(connector, &intel_tv_connector_helper_funcs); diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index dee0147a316c..58b5b3cfc540 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -83,8 +83,8 @@ enum mipi_dsi_pixel_format pixel_format_from_register_bits(u32 fmt) void vlv_dsi_wait_for_fifo_empty(struct intel_dsi *intel_dsi, enum port port) { - struct drm_encoder *encoder = &intel_dsi->base.base; - struct drm_device *dev = encoder->dev; + struct intel_encoder *encoder = &intel_dsi->base; + struct drm_device *dev = encoder->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); u32 mask; @@ -224,8 +224,8 @@ static const struct mipi_dsi_host_ops intel_dsi_host_ops = { static int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs, enum port port) { - struct drm_encoder *encoder = &intel_dsi->base.base; - struct drm_device *dev = encoder->dev; + struct intel_encoder *encoder = &intel_dsi->base; + struct drm_device *dev = encoder->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); u32 mask; @@ -730,7 +730,7 @@ static void intel_dsi_wait_panel_power_cycle(struct intel_dsi *intel_dsi) msleep(intel_dsi->panel_pwr_cycle_delay - panel_power_off_duration); } -static void intel_dsi_prepare(struct intel_encoder *intel_encoder, +static void intel_dsi_prepare(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config); static void intel_dsi_unprepare(struct intel_encoder *encoder); @@ -1299,12 +1299,12 @@ static u16 txclkesc(u32 divider, unsigned int us) } } -static void set_dsi_timings(struct drm_encoder *encoder, +static void set_dsi_timings(struct intel_encoder *encoder, const struct drm_display_mode *adjusted_mode) { - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); - struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(encoder)); + struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); enum port port; unsigned int bpp = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format); unsigned int lane_count = intel_dsi->lane_count; @@ -1388,14 +1388,13 @@ static u32 pixel_format_to_reg(enum mipi_dsi_pixel_format fmt) } } -static void intel_dsi_prepare(struct intel_encoder *intel_encoder, +static void intel_dsi_prepare(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config) { - struct drm_encoder *encoder = &intel_encoder->base; - struct drm_device *dev = encoder->dev; + struct drm_device *dev = encoder->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); - struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(encoder)); + struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; enum port port; unsigned int bpp = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format); @@ -1627,12 +1626,13 @@ static void intel_dsi_unprepare(struct intel_encoder *encoder) } } -static void intel_dsi_encoder_destroy(struct drm_encoder *encoder) +static void intel_dsi_encoder_destroy(struct drm_encoder *_encoder) { - struct intel_dsi *intel_dsi = enc_to_intel_dsi(to_intel_encoder(encoder)); + struct intel_encoder *encoder = to_intel_encoder(_encoder); + struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); intel_dsi_vbt_gpio_cleanup(intel_dsi); - intel_encoder_destroy(encoder); + intel_encoder_destroy(&encoder->base); } static const struct drm_encoder_funcs intel_dsi_funcs = { @@ -1847,8 +1847,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) { struct drm_device *dev = &dev_priv->drm; struct intel_dsi *intel_dsi; - struct intel_encoder *intel_encoder; - struct drm_encoder *encoder; + struct intel_encoder *encoder; struct intel_connector *intel_connector; struct drm_connector *connector; struct drm_display_mode *current_mode; @@ -1876,43 +1875,42 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) return; } - intel_encoder = &intel_dsi->base; - encoder = &intel_encoder->base; + encoder = &intel_dsi->base; intel_dsi->attached_connector = intel_connector; connector = &intel_connector->base; - drm_encoder_init(dev, encoder, &intel_dsi_funcs, DRM_MODE_ENCODER_DSI, - "DSI %c", port_name(port)); + drm_encoder_init(dev, &encoder->base, &intel_dsi_funcs, + DRM_MODE_ENCODER_DSI, "DSI %c", port_name(port)); - intel_encoder->compute_config = intel_dsi_compute_config; - intel_encoder->pre_enable = intel_dsi_pre_enable; + encoder->compute_config = intel_dsi_compute_config; + encoder->pre_enable = intel_dsi_pre_enable; if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) - intel_encoder->enable = bxt_dsi_enable; - intel_encoder->disable = intel_dsi_disable; - intel_encoder->post_disable = intel_dsi_post_disable; - intel_encoder->get_hw_state = intel_dsi_get_hw_state; - intel_encoder->get_config = intel_dsi_get_config; - intel_encoder->update_pipe = intel_backlight_update; - intel_encoder->shutdown = intel_dsi_shutdown; + encoder->enable = bxt_dsi_enable; + encoder->disable = intel_dsi_disable; + encoder->post_disable = intel_dsi_post_disable; + encoder->get_hw_state = intel_dsi_get_hw_state; + encoder->get_config = intel_dsi_get_config; + encoder->update_pipe = intel_backlight_update; + encoder->shutdown = intel_dsi_shutdown; intel_connector->get_hw_state = intel_connector_get_hw_state; - intel_encoder->port = port; - intel_encoder->type = INTEL_OUTPUT_DSI; - intel_encoder->power_domain = POWER_DOMAIN_PORT_DSI; - intel_encoder->cloneable = 0; + encoder->port = port; + encoder->type = INTEL_OUTPUT_DSI; + encoder->power_domain = POWER_DOMAIN_PORT_DSI; + encoder->cloneable = 0; /* * On BYT/CHV, pipe A maps to MIPI DSI port A, pipe B maps to MIPI DSI * port C. BXT isn't limited like this. */ if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) - intel_encoder->pipe_mask = ~0; + encoder->pipe_mask = ~0; else if (port == PORT_A) - intel_encoder->pipe_mask = BIT(PIPE_A); + encoder->pipe_mask = BIT(PIPE_A); else - intel_encoder->pipe_mask = BIT(PIPE_B); + encoder->pipe_mask = BIT(PIPE_B); intel_dsi->panel_power_off_time = ktime_get_boottime(); @@ -1947,7 +1945,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) } /* Use clock read-back from current hw-state for fastboot */ - current_mode = intel_encoder_current_mode(intel_encoder); + current_mode = intel_encoder_current_mode(encoder); if (current_mode) { drm_dbg_kms(&dev_priv->drm, "Calculated pclk %d GOP %d\n", intel_dsi->pclk, current_mode->clock); @@ -1963,7 +1961,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) vlv_dphy_param_init(intel_dsi); intel_dsi_vbt_gpio_init(intel_dsi, - intel_dsi_get_hw_state(intel_encoder, &pipe)); + intel_dsi_get_hw_state(encoder, &pipe)); drm_connector_init(dev, connector, &intel_dsi_connector_funcs, DRM_MODE_CONNECTOR_DSI); @@ -1972,7 +1970,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) connector->display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/ - intel_connector_attach_encoder(intel_connector, intel_encoder); + intel_connector_attach_encoder(intel_connector, encoder); mutex_lock(&dev->mode_config.mutex); intel_panel_add_vbt_lfp_fixed_mode(intel_connector); @@ -1994,7 +1992,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) err_cleanup_connector: drm_connector_cleanup(&intel_connector->base); err: - drm_encoder_cleanup(&intel_encoder->base); + drm_encoder_cleanup(&encoder->base); kfree(intel_dsi); kfree(intel_connector); } From patchwork Mon Sep 12 11:18:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 12973577 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 DB578C6FA83 for ; Mon, 12 Sep 2022 11:19:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF58E10E3D5; Mon, 12 Sep 2022 11:19:40 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5477B10E3B8 for ; Mon, 12 Sep 2022 11:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662981550; x=1694517550; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=JyEgn+vxlDhvmkE8iLvZtJEcH1XBGrPhtUSf/M80JNE=; b=BDmiTuD7TD5WHpO4lOtH0A2yfXqEH3RyOsWTHyC4HP9MyNwh6weKKioB nIwVVAAYNpSR3kRSsXd7Ghqw67GhV6NhpERRjDh46eMmHKrYjhVnT6ATv ZZK9BzdPx5/cTVoYJlSmkkoYPVUm/GE5qHeRcB9Tdx+jZNq+AFi1nXXqE xZn12zjtQKR4t8ptP7cLxqWhVzI3ZDPgFihIobSzCJO4daGy2hz7cocoj 4ARynMnaaOwMSiwufn6Qr/0BDl4ALwQ+3DpAxmdKLj/l+IA/sjOUrd8E0 MVD2EJ+NXdN1/220BEilbCtvo0iGVyRaEIn8mMz/zHqY3tVYbmiOw0t6l w==; X-IronPort-AV: E=McAfee;i="6500,9779,10467"; a="298640812" X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="298640812" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 04:19:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,310,1654585200"; d="scan'208";a="649213715" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.191]) by orsmga001.jf.intel.com with SMTP; 12 Sep 2022 04:18:58 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Sep 2022 14:18:57 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Date: Mon, 12 Sep 2022 14:18:14 +0300 Message-Id: <20220912111814.17466-16-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220912111814.17466-1-ville.syrjala@linux.intel.com> References: <20220912111814.17466-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 15/15] drm/i915: s/intel_connector/connector/ in init code 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" From: Ville Syrjälä As we did with intel_encoder vs. encoder varaible names let's do a quick s/intel_connector/connector/ pass over the encoder/connector init functions. Cleans them up a little bit more at least. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/icl_dsi.c | 48 +++++------ drivers/gpu/drm/i915/display/intel_crt.c | 29 +++---- drivers/gpu/drm/i915/display/intel_dp.c | 71 ++++++++-------- drivers/gpu/drm/i915/display/intel_dp_mst.c | 36 ++++---- drivers/gpu/drm/i915/display/intel_dvo.c | 29 ++++--- drivers/gpu/drm/i915/display/intel_hdmi.c | 31 ++++--- drivers/gpu/drm/i915/display/intel_lvds.c | 61 +++++++------- drivers/gpu/drm/i915/display/intel_sdvo.c | 91 ++++++++++----------- drivers/gpu/drm/i915/display/intel_tv.c | 21 +++-- drivers/gpu/drm/i915/display/vlv_dsi.c | 49 ++++++----- 10 files changed, 226 insertions(+), 240 deletions(-) diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 2213d88daf38..33e945c1b5e8 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -1983,8 +1983,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct intel_dsi *intel_dsi; struct intel_encoder *encoder; - struct intel_connector *intel_connector; - struct drm_connector *connector; + struct intel_connector *connector; enum port port; if (!intel_bios_is_dsi_present(dev_priv, &port)) @@ -1994,15 +1993,14 @@ void icl_dsi_init(struct drm_i915_private *dev_priv) if (!intel_dsi) return; - intel_connector = intel_connector_alloc(); - if (!intel_connector) { + connector = intel_connector_alloc(); + if (!connector) { kfree(intel_dsi); return; } encoder = &intel_dsi->base; - intel_dsi->attached_connector = intel_connector; - connector = &intel_connector->base; + intel_dsi->attached_connector = connector; /* register DSI encoder with DRM subsystem */ drm_encoder_init(dev, &encoder->base, &gen11_dsi_encoder_funcs, @@ -2029,40 +2027,42 @@ void icl_dsi_init(struct drm_i915_private *dev_priv) encoder->is_clock_enabled = gen11_dsi_is_clock_enabled; /* register DSI connector with DRM subsystem */ - drm_connector_init(dev, connector, &gen11_dsi_connector_funcs, + drm_connector_init(dev, &connector->base, + &gen11_dsi_connector_funcs, DRM_MODE_CONNECTOR_DSI); - drm_connector_helper_add(connector, &gen11_dsi_connector_helper_funcs); - connector->display_info.subpixel_order = SubPixelHorizontalRGB; - intel_connector->get_hw_state = intel_connector_get_hw_state; + drm_connector_helper_add(&connector->base, + &gen11_dsi_connector_helper_funcs); + connector->base.display_info.subpixel_order = SubPixelHorizontalRGB; + connector->get_hw_state = intel_connector_get_hw_state; /* attach connector to encoder */ - intel_connector_attach_encoder(intel_connector, encoder); + intel_connector_attach_encoder(connector, encoder); - intel_bios_init_panel(dev_priv, &intel_connector->panel, NULL, NULL); + intel_bios_init_panel(dev_priv, &connector->panel, NULL, NULL); mutex_lock(&dev->mode_config.mutex); - intel_panel_add_vbt_lfp_fixed_mode(intel_connector); + intel_panel_add_vbt_lfp_fixed_mode(connector); mutex_unlock(&dev->mode_config.mutex); - if (!intel_panel_preferred_fixed_mode(intel_connector)) { + if (!intel_panel_preferred_fixed_mode(connector)) { drm_err(&dev_priv->drm, "DSI fixed mode info missing\n"); goto err; } - intel_panel_init(intel_connector); + intel_panel_init(connector); - intel_backlight_setup(intel_connector, INVALID_PIPE); + intel_backlight_setup(connector, INVALID_PIPE); - if (intel_connector->panel.vbt.dsi.config->dual_link) + if (connector->panel.vbt.dsi.config->dual_link) intel_dsi->ports = BIT(PORT_A) | BIT(PORT_B); else intel_dsi->ports = BIT(port); - if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports)) - intel_connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports; + if (drm_WARN_ON(&dev_priv->drm, connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports)) + connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports; - if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports)) - intel_connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports; + if (drm_WARN_ON(&dev_priv->drm, connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports)) + connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports; for_each_dsi_port(port, intel_dsi->ports) { struct intel_dsi_host *host; @@ -2081,12 +2081,12 @@ void icl_dsi_init(struct drm_i915_private *dev_priv) icl_dphy_param_init(intel_dsi); - icl_dsi_add_properties(intel_connector); + icl_dsi_add_properties(connector); return; err: - drm_connector_cleanup(connector); + drm_connector_cleanup(&connector->base); drm_encoder_cleanup(&encoder->base); kfree(intel_dsi); - kfree(intel_connector); + kfree(connector); } diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c index 9400af950691..383d4ade1b22 100644 --- a/drivers/gpu/drm/i915/display/intel_crt.c +++ b/drivers/gpu/drm/i915/display/intel_crt.c @@ -991,9 +991,8 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = { void intel_crt_init(struct drm_i915_private *dev_priv) { - struct drm_connector *connector; + struct intel_connector *connector; struct intel_crt *crt; - struct intel_connector *intel_connector; i915_reg_t adpa_reg; u32 adpa; @@ -1025,21 +1024,22 @@ void intel_crt_init(struct drm_i915_private *dev_priv) if (!crt) return; - intel_connector = intel_connector_alloc(); - if (!intel_connector) { + connector = intel_connector_alloc(); + if (!connector) { kfree(crt); return; } - connector = &intel_connector->base; - crt->connector = intel_connector; - drm_connector_init(&dev_priv->drm, &intel_connector->base, - &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA); + crt->connector = connector; + + drm_connector_init(&dev_priv->drm, &connector->base, + &intel_crt_connector_funcs, + DRM_MODE_CONNECTOR_VGA); drm_encoder_init(&dev_priv->drm, &crt->base.base, &intel_crt_enc_funcs, DRM_MODE_ENCODER_DAC, "CRT"); - intel_connector_attach_encoder(intel_connector, &crt->base); + intel_connector_attach_encoder(connector, &crt->base); crt->base.type = INTEL_OUTPUT_ANALOG; crt->base.cloneable = BIT(INTEL_OUTPUT_DVO) | BIT(INTEL_OUTPUT_HDMI); @@ -1049,7 +1049,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv) crt->base.pipe_mask = ~0; if (DISPLAY_VER(dev_priv) != 2) - connector->interlace_allowed = true; + connector->base.interlace_allowed = true; crt->adpa_reg = adpa_reg; @@ -1059,9 +1059,9 @@ void intel_crt_init(struct drm_i915_private *dev_priv) !dmi_check_system(intel_spurious_crt_detect)) { crt->base.hpd_pin = HPD_CRT; crt->base.hotplug = intel_encoder_hotplug; - intel_connector->polled = DRM_CONNECTOR_POLL_HPD; + connector->polled = DRM_CONNECTOR_POLL_HPD; } else { - intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT; + connector->polled = DRM_CONNECTOR_POLL_CONNECT; } if (HAS_DDI(dev_priv)) { @@ -1093,9 +1093,10 @@ void intel_crt_init(struct drm_i915_private *dev_priv) crt->base.get_hw_state = intel_crt_get_hw_state; crt->base.enable = intel_enable_crt; } - intel_connector->get_hw_state = intel_connector_get_hw_state; + connector->get_hw_state = intel_connector_get_hw_state; - drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); + drm_connector_helper_add(&connector->base, + &intel_crt_connector_helper_funcs); /* * TODO: find a proper way to discover whether we need to set the the diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index fa9931656383..814d4065910e 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5233,11 +5233,10 @@ static void intel_edp_backlight_setup(struct intel_dp *intel_dp, } static bool intel_edp_init_connector(struct intel_dp *intel_dp, - struct intel_connector *intel_connector) + struct intel_connector *connector) { struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); struct drm_device *dev = &dev_priv->drm; - struct drm_connector *connector = &intel_connector->base; struct drm_display_mode *fixed_mode; struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base; bool has_dpcd; @@ -5275,18 +5274,18 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, } mutex_lock(&dev->mode_config.mutex); - edid = drm_get_edid(connector, &intel_dp->aux.ddc); + edid = drm_get_edid(&connector->base, &intel_dp->aux.ddc); if (!edid) { /* Fallback to EDID from ACPI OpRegion, if any */ - edid = intel_opregion_get_edid(intel_connector); + edid = intel_opregion_get_edid(connector); if (edid) drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s] Using OpRegion EDID\n", - connector->base.id, connector->name); + connector->base.base.id, connector->base.name); } if (edid) { - if (drm_add_edid_modes(connector, edid)) { - drm_connector_update_edid_property(connector, edid); + if (drm_add_edid_modes(&connector->base, edid)) { + drm_connector_update_edid_property(&connector->base, edid); } else { kfree(edid); edid = ERR_PTR(-EINVAL); @@ -5294,38 +5293,38 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, } else { edid = ERR_PTR(-ENOENT); } - intel_connector->edid = edid; + connector->edid = edid; - intel_bios_init_panel(dev_priv, &intel_connector->panel, + intel_bios_init_panel(dev_priv, &connector->panel, encoder->devdata, IS_ERR(edid) ? NULL : edid); - intel_panel_add_edid_fixed_modes(intel_connector, - intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE, - intel_vrr_is_capable(intel_connector)); + intel_panel_add_edid_fixed_modes(connector, + connector->panel.vbt.drrs_type != DRRS_TYPE_NONE, + intel_vrr_is_capable(connector)); /* MSO requires information from the EDID */ intel_edp_mso_init(intel_dp); /* multiply the mode clock and horizontal timings for MSO */ - list_for_each_entry(fixed_mode, &intel_connector->panel.fixed_modes, head) - intel_edp_mso_mode_fixup(intel_connector, fixed_mode); + list_for_each_entry(fixed_mode, &connector->panel.fixed_modes, head) + intel_edp_mso_mode_fixup(connector, fixed_mode); /* fallback to VBT if available for eDP */ - if (!intel_panel_preferred_fixed_mode(intel_connector)) - intel_panel_add_vbt_lfp_fixed_mode(intel_connector); + if (!intel_panel_preferred_fixed_mode(connector)) + intel_panel_add_vbt_lfp_fixed_mode(connector); mutex_unlock(&dev->mode_config.mutex); - if (!intel_panel_preferred_fixed_mode(intel_connector)) { + if (!intel_panel_preferred_fixed_mode(connector)) { drm_info(&dev_priv->drm, "[ENCODER:%d:%s] failed to find fixed mode for the panel, disabling eDP\n", encoder->base.base.id, encoder->base.name); goto out_vdd_off; } - intel_panel_init(intel_connector); + intel_panel_init(connector); - intel_edp_backlight_setup(intel_dp, intel_connector); + intel_edp_backlight_setup(intel_dp, connector); intel_edp_add_properties(intel_dp); @@ -5364,9 +5363,8 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work) bool intel_dp_init_connector(struct intel_digital_port *dig_port, - struct intel_connector *intel_connector) + struct intel_connector *connector) { - struct drm_connector *connector = &intel_connector->base; struct intel_dp *intel_dp = &dig_port->dp; struct intel_encoder *encoder = &dig_port->base; struct drm_device *dev = encoder->base.dev; @@ -5376,7 +5374,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, int type; /* Initialize the work for modeset in case of link train failure */ - INIT_WORK(&intel_connector->modeset_retry_work, + INIT_WORK(&connector->modeset_retry_work, intel_dp_modeset_retry_work_fn); if (drm_WARN(dev, dig_port->max_lanes < 1, @@ -5391,7 +5389,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, /* Preserve the current hw state. */ intel_dp->DP = intel_de_read(dev_priv, intel_dp->output_reg); - intel_dp->attached_connector = intel_connector; + intel_dp->attached_connector = connector; if (intel_dp_is_port_edp(dev_priv, port)) { /* @@ -5422,24 +5420,26 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, type == DRM_MODE_CONNECTOR_eDP ? "eDP" : "DP", encoder->base.base.id, encoder->base.name); - drm_connector_init(dev, connector, &intel_dp_connector_funcs, type); - drm_connector_helper_add(connector, &intel_dp_connector_helper_funcs); + drm_connector_init(dev, &connector->base, + &intel_dp_connector_funcs, type); + drm_connector_helper_add(&connector->base, + &intel_dp_connector_helper_funcs); if (!HAS_GMCH(dev_priv)) - connector->interlace_allowed = true; + connector->base.interlace_allowed = true; - intel_connector->polled = DRM_CONNECTOR_POLL_HPD; + connector->polled = DRM_CONNECTOR_POLL_HPD; intel_dp_aux_init(intel_dp); - intel_connector_attach_encoder(intel_connector, encoder); + intel_connector_attach_encoder(connector, encoder); if (HAS_DDI(dev_priv)) - intel_connector->get_hw_state = intel_ddi_connector_get_hw_state; + connector->get_hw_state = intel_ddi_connector_get_hw_state; else - intel_connector->get_hw_state = intel_connector_get_hw_state; + connector->get_hw_state = intel_connector_get_hw_state; - if (!intel_edp_init_connector(intel_dp, intel_connector)) { + if (!intel_edp_init_connector(intel_dp, connector)) { intel_dp_aux_fini(intel_dp); goto fail; } @@ -5449,13 +5449,12 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, intel_dp_reset_max_link_params(intel_dp); /* init MST on ports that can support it */ - intel_dp_mst_encoder_init(dig_port, - intel_connector->base.base.id); + intel_dp_mst_encoder_init(dig_port, connector->base.base.id); - intel_dp_add_properties(intel_dp, connector); + intel_dp_add_properties(intel_dp, &connector->base); if (is_hdcp_supported(dev_priv, port) && !intel_dp_is_edp(intel_dp)) { - int ret = intel_dp_hdcp_init(dig_port, intel_connector); + int ret = intel_dp_hdcp_init(dig_port, connector); if (ret) drm_dbg_kms(&dev_priv->drm, "HDCP init failed, skipping.\n"); @@ -5479,7 +5478,7 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, return true; fail: - drm_connector_cleanup(connector); + drm_connector_cleanup(&connector->base); return false; } diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index d98657a61527..5f95b2cb9efe 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -825,54 +825,54 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp); struct drm_device *dev = dig_port->base.base.dev; struct drm_i915_private *dev_priv = to_i915(dev); - struct intel_connector *intel_connector; - struct drm_connector *connector; + struct intel_connector *connector; enum pipe pipe; int ret; - intel_connector = intel_connector_alloc(); - if (!intel_connector) + connector = intel_connector_alloc(); + if (!connector) return NULL; - intel_connector->get_hw_state = intel_dp_mst_get_hw_state; - intel_connector->mst_port = intel_dp; - intel_connector->port = port; + connector->get_hw_state = intel_dp_mst_get_hw_state; + connector->mst_port = intel_dp; + connector->port = port; drm_dp_mst_get_port_malloc(port); - connector = &intel_connector->base; - ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs, + ret = drm_connector_init(dev, &connector->base, + &intel_dp_mst_connector_funcs, DRM_MODE_CONNECTOR_DisplayPort); if (ret) { drm_dp_mst_put_port_malloc(port); - intel_connector_free(intel_connector); + intel_connector_free(connector); return NULL; } - drm_connector_helper_add(connector, &intel_dp_mst_connector_helper_funcs); + drm_connector_helper_add(&connector->base, + &intel_dp_mst_connector_helper_funcs); for_each_pipe(dev_priv, pipe) { struct intel_encoder *encoder = &intel_dp->mst_encoders[pipe]->base; - ret = drm_connector_attach_encoder(&intel_connector->base, + ret = drm_connector_attach_encoder(&connector->base, &encoder->base); if (ret) goto err; } - ret = intel_dp_mst_add_properties(intel_dp, connector, pathprop); + ret = intel_dp_mst_add_properties(intel_dp, &connector->base, pathprop); if (ret) goto err; - ret = intel_dp_hdcp_init(dig_port, intel_connector); + ret = intel_dp_hdcp_init(dig_port, connector); if (ret) - drm_dbg_kms(&dev_priv->drm, "[%s:%d] HDCP MST init failed, skipping.\n", - connector->name, connector->base.id); + drm_dbg_kms(&dev_priv->drm, "CONNECTOR[%d:%s] HDCP MST init failed, skipping.\n", + connector->base.base.id, connector->base.name); - return connector; + return &connector->base; err: - drm_connector_cleanup(connector); + drm_connector_cleanup(&connector->base); return NULL; } diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c index d3532e51843c..6aa8a45629db 100644 --- a/drivers/gpu/drm/i915/display/intel_dvo.c +++ b/drivers/gpu/drm/i915/display/intel_dvo.c @@ -393,7 +393,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) { struct intel_encoder *encoder; struct intel_dvo *intel_dvo; - struct intel_connector *intel_connector; + struct intel_connector *connector; int i; int encoder_type = DRM_MODE_ENCODER_NONE; @@ -401,13 +401,13 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) if (!intel_dvo) return; - intel_connector = intel_connector_alloc(); - if (!intel_connector) { + connector = intel_connector_alloc(); + if (!connector) { kfree(intel_dvo); return; } - intel_dvo->attached_connector = intel_connector; + intel_dvo->attached_connector = connector; encoder = &intel_dvo->base; @@ -417,11 +417,10 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) encoder->get_config = intel_dvo_get_config; encoder->compute_config = intel_dvo_compute_config; encoder->pre_enable = intel_dvo_pre_enable; - intel_connector->get_hw_state = intel_dvo_connector_get_hw_state; + connector->get_hw_state = intel_dvo_connector_get_hw_state; /* Now, try to find a controller */ for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) { - struct drm_connector *connector = &intel_connector->base; const struct intel_dvo_device *dvo = &intel_dvo_devices[i]; struct i2c_adapter *i2c; int gpio; @@ -497,27 +496,27 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) switch (dvo->type) { case INTEL_DVO_CHIP_TMDS: - intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT | + connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; - drm_connector_init(&dev_priv->drm, connector, + drm_connector_init(&dev_priv->drm, &connector->base, &intel_dvo_connector_funcs, DRM_MODE_CONNECTOR_DVII); encoder_type = DRM_MODE_ENCODER_TMDS; break; case INTEL_DVO_CHIP_LVDS_NO_FIXED: case INTEL_DVO_CHIP_LVDS: - drm_connector_init(&dev_priv->drm, connector, + drm_connector_init(&dev_priv->drm, &connector->base, &intel_dvo_connector_funcs, DRM_MODE_CONNECTOR_LVDS); encoder_type = DRM_MODE_ENCODER_LVDS; break; } - drm_connector_helper_add(connector, + drm_connector_helper_add(&connector->base, &intel_dvo_connector_helper_funcs); - connector->display_info.subpixel_order = SubPixelHorizontalRGB; + connector->base.display_info.subpixel_order = SubPixelHorizontalRGB; - intel_connector_attach_encoder(intel_connector, encoder); + intel_connector_attach_encoder(connector, encoder); if (dvo->type == INTEL_DVO_CHIP_LVDS) { /* * For our LVDS chipsets, we should hopefully be able @@ -527,9 +526,9 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) * headers, likely), so for now, just get the current * mode being output through DVO. */ - intel_panel_add_encoder_fixed_mode(intel_connector, encoder); + intel_panel_add_encoder_fixed_mode(connector, encoder); - intel_panel_init(intel_connector); + intel_panel_init(connector); intel_dvo->panel_wants_dither = true; } @@ -538,5 +537,5 @@ void intel_dvo_init(struct drm_i915_private *dev_priv) } kfree(intel_dvo); - kfree(intel_connector); + kfree(connector); } diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 4d57d6193142..8d1043503a1a 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2923,9 +2923,8 @@ void intel_infoframe_init(struct intel_digital_port *dig_port) } void intel_hdmi_init_connector(struct intel_digital_port *dig_port, - struct intel_connector *intel_connector) + struct intel_connector *connector) { - struct drm_connector *connector = &intel_connector->base; struct intel_hdmi *intel_hdmi = &dig_port->hdmi; struct intel_encoder *encoder = &dig_port->base; struct drm_device *dev = encoder->base.dev; @@ -2950,32 +2949,32 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port, intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(encoder); ddc = intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus); - drm_connector_init_with_ddc(dev, connector, + drm_connector_init_with_ddc(dev, &connector->base, &intel_hdmi_connector_funcs, DRM_MODE_CONNECTOR_HDMIA, ddc); - drm_connector_helper_add(connector, &intel_hdmi_connector_helper_funcs); - - connector->interlace_allowed = true; - connector->stereo_allowed = true; + drm_connector_helper_add(&connector->base, + &intel_hdmi_connector_helper_funcs); + connector->base.interlace_allowed = true; + connector->base.stereo_allowed = true; if (DISPLAY_VER(dev_priv) >= 10) - connector->ycbcr_420_allowed = true; + connector->base.ycbcr_420_allowed = true; - intel_connector->polled = DRM_CONNECTOR_POLL_HPD; + connector->polled = DRM_CONNECTOR_POLL_HPD; if (HAS_DDI(dev_priv)) - intel_connector->get_hw_state = intel_ddi_connector_get_hw_state; + connector->get_hw_state = intel_ddi_connector_get_hw_state; else - intel_connector->get_hw_state = intel_connector_get_hw_state; + connector->get_hw_state = intel_connector_get_hw_state; - intel_hdmi_add_properties(intel_hdmi, connector); + intel_hdmi_add_properties(intel_hdmi, &connector->base); - intel_connector_attach_encoder(intel_connector, encoder); - intel_hdmi->attached_connector = intel_connector; + intel_connector_attach_encoder(connector, encoder); + intel_hdmi->attached_connector = connector; if (is_hdcp_supported(dev_priv, port)) { - int ret = intel_hdcp_init(intel_connector, dig_port, + int ret = intel_hdcp_init(connector, dig_port, &intel_hdmi_hdcp_shim); if (ret) drm_dbg_kms(&dev_priv->drm, @@ -2992,7 +2991,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *dig_port, (temp & ~0xf) | 0xd); } - cec_fill_conn_info_from_drm(&conn_info, connector); + cec_fill_conn_info_from_drm(&conn_info, &connector->base); intel_hdmi->cec_notifier = cec_notifier_conn_register(dev->dev, port_identifier(port), diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 251282ef2d90..5a0292b44e2c 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -829,8 +829,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct intel_lvds_encoder *lvds_encoder; struct intel_encoder *encoder; - struct intel_connector *intel_connector; - struct drm_connector *connector; + struct intel_connector *connector; struct edid *edid; i915_reg_t lvds_reg; u32 lvds; @@ -876,17 +875,17 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) if (!lvds_encoder) return; - intel_connector = intel_connector_alloc(); - if (!intel_connector) { + connector = intel_connector_alloc(); + if (!connector) { kfree(lvds_encoder); return; } - lvds_encoder->attached_connector = intel_connector; + lvds_encoder->attached_connector = connector; encoder = &lvds_encoder->base; - connector = &intel_connector->base; - drm_connector_init(dev, &intel_connector->base, &intel_lvds_connector_funcs, + drm_connector_init(dev, &connector->base, + &intel_lvds_connector_funcs, DRM_MODE_CONNECTOR_LVDS); drm_encoder_init(dev, &encoder->base, &intel_lvds_enc_funcs, @@ -905,9 +904,9 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) encoder->get_config = intel_lvds_get_config; encoder->update_pipe = intel_backlight_update; encoder->shutdown = intel_lvds_shutdown; - intel_connector->get_hw_state = intel_connector_get_hw_state; + connector->get_hw_state = intel_connector_get_hw_state; - intel_connector_attach_encoder(intel_connector, encoder); + intel_connector_attach_encoder(connector, encoder); encoder->type = INTEL_OUTPUT_LVDS; encoder->power_domain = POWER_DOMAIN_PORT_OTHER; @@ -918,12 +917,13 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) else encoder->pipe_mask = ~0; - drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs); - connector->display_info.subpixel_order = SubPixelHorizontalRGB; + drm_connector_helper_add(&connector->base, + &intel_lvds_connector_helper_funcs); + connector->base.display_info.subpixel_order = SubPixelHorizontalRGB; lvds_encoder->reg = lvds_reg; - intel_lvds_add_properties(connector); + intel_lvds_add_properties(&connector->base); intel_lvds_pps_get_hw_state(dev_priv, &lvds_encoder->init_pps); lvds_encoder->init_lvds_val = lvds; @@ -942,15 +942,14 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) */ mutex_lock(&dev->mode_config.mutex); if (vga_switcheroo_handler_flags() & VGA_SWITCHEROO_CAN_SWITCH_DDC) - edid = drm_get_edid_switcheroo(connector, - intel_gmbus_get_adapter(dev_priv, pin)); + edid = drm_get_edid_switcheroo(&connector->base, + intel_gmbus_get_adapter(dev_priv, pin)); else - edid = drm_get_edid(connector, + edid = drm_get_edid(&connector->base, intel_gmbus_get_adapter(dev_priv, pin)); if (edid) { - if (drm_add_edid_modes(connector, edid)) { - drm_connector_update_edid_property(connector, - edid); + if (drm_add_edid_modes(&connector->base, edid)) { + drm_connector_update_edid_property(&connector->base, edid); } else { kfree(edid); edid = ERR_PTR(-EINVAL); @@ -958,37 +957,37 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) } else { edid = ERR_PTR(-ENOENT); } - intel_connector->edid = edid; + connector->edid = edid; - intel_bios_init_panel(dev_priv, &intel_connector->panel, NULL, + intel_bios_init_panel(dev_priv, &connector->panel, NULL, IS_ERR(edid) ? NULL : edid); /* Try EDID first */ - intel_panel_add_edid_fixed_modes(intel_connector, - intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE, + intel_panel_add_edid_fixed_modes(connector, + connector->panel.vbt.drrs_type != DRRS_TYPE_NONE, false); /* Failed to get EDID, what about VBT? */ - if (!intel_panel_preferred_fixed_mode(intel_connector)) - intel_panel_add_vbt_lfp_fixed_mode(intel_connector); + if (!intel_panel_preferred_fixed_mode(connector)) + intel_panel_add_vbt_lfp_fixed_mode(connector); /* * If we didn't get a fixed mode from EDID or VBT, try checking * if the panel is already turned on. If so, assume that * whatever is currently programmed is the correct mode. */ - if (!intel_panel_preferred_fixed_mode(intel_connector)) - intel_panel_add_encoder_fixed_mode(intel_connector, encoder); + if (!intel_panel_preferred_fixed_mode(connector)) + intel_panel_add_encoder_fixed_mode(connector, encoder); mutex_unlock(&dev->mode_config.mutex); /* If we still don't have a mode after all that, give up. */ - if (!intel_panel_preferred_fixed_mode(intel_connector)) + if (!intel_panel_preferred_fixed_mode(connector)) goto failed; - intel_panel_init(intel_connector); + intel_panel_init(connector); - intel_backlight_setup(intel_connector, INVALID_PIPE); + intel_backlight_setup(connector, INVALID_PIPE); lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder); drm_dbg_kms(&dev_priv->drm, "detected %s-link lvds configuration\n", @@ -1000,9 +999,9 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) failed: drm_dbg_kms(&dev_priv->drm, "No LVDS modes found, disabling.\n"); - drm_connector_cleanup(connector); + drm_connector_cleanup(&connector->base); drm_encoder_cleanup(&encoder->base); kfree(lvds_encoder); - intel_connector_free(intel_connector); + intel_connector_free(connector); return; } diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 01c69da81f3d..e4ae5395bc00 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -2673,28 +2673,26 @@ intel_sdvo_get_slave_addr(struct drm_i915_private *dev_priv, } static int -intel_sdvo_connector_init(struct intel_sdvo_connector *connector, - struct intel_sdvo *encoder) +intel_sdvo_connector_init(struct intel_connector *connector, + struct intel_encoder *encoder) { - struct drm_connector *drm_connector; int ret; - drm_connector = &connector->base.base; - ret = drm_connector_init(encoder->base.base.dev, - drm_connector, - &intel_sdvo_connector_funcs, - connector->base.base.connector_type); + ret = drm_connector_init(encoder->base.dev, + &connector->base, + &intel_sdvo_connector_funcs, + connector->base.connector_type); if (ret < 0) return ret; - drm_connector_helper_add(drm_connector, + drm_connector_helper_add(&connector->base, &intel_sdvo_connector_helper_funcs); - connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB; - connector->base.base.interlace_allowed = true; - connector->base.get_hw_state = intel_sdvo_connector_get_hw_state; + connector->base.display_info.subpixel_order = SubPixelHorizontalRGB; + connector->base.interlace_allowed = true; + connector->get_hw_state = intel_sdvo_connector_get_hw_state; - intel_connector_attach_encoder(&connector->base, &encoder->base); + intel_connector_attach_encoder(connector, encoder); return 0; } @@ -2736,9 +2734,8 @@ static bool intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) { struct intel_encoder *encoder = &intel_sdvo->base; - struct drm_connector *connector; - struct intel_connector *intel_connector; struct intel_sdvo_connector *intel_sdvo_connector; + struct intel_connector *connector; DRM_DEBUG_KMS("initialising DVI device %d\n", device); @@ -2754,8 +2751,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS1; } - intel_connector = &intel_sdvo_connector->base; - connector = &intel_connector->base; + connector = &intel_sdvo_connector->base; if (intel_sdvo_get_hotplug_support(intel_sdvo) & intel_sdvo_connector->output_flag) { intel_sdvo->hotplug_active |= intel_sdvo_connector->output_flag; @@ -2763,21 +2759,22 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) * Some SDVO devices have one-shot hotplug interrupts. * Ensure that they get re-enabled when an interrupt happens. */ - intel_connector->polled = DRM_CONNECTOR_POLL_HPD; + connector->polled = DRM_CONNECTOR_POLL_HPD; encoder->hotplug = intel_sdvo_hotplug; intel_sdvo_enable_hotplug(encoder); } else { - intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; + connector->polled = DRM_CONNECTOR_POLL_CONNECT | + DRM_CONNECTOR_POLL_DISCONNECT; } encoder->base.encoder_type = DRM_MODE_ENCODER_TMDS; - connector->connector_type = DRM_MODE_CONNECTOR_DVID; + connector->base.connector_type = DRM_MODE_CONNECTOR_DVID; if (intel_sdvo_is_hdmi_connector(intel_sdvo, device)) { - connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; + connector->base.connector_type = DRM_MODE_CONNECTOR_HDMIA; intel_sdvo_connector->is_hdmi = true; } - if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { + if (intel_sdvo_connector_init(connector, encoder) < 0) { kfree(intel_sdvo_connector); return false; } @@ -2792,9 +2789,8 @@ static bool intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) { struct intel_encoder *encoder = &intel_sdvo->base; - struct drm_connector *connector; - struct intel_connector *intel_connector; struct intel_sdvo_connector *intel_sdvo_connector; + struct intel_connector *connector; DRM_DEBUG_KMS("initialising TV type %d\n", type); @@ -2802,15 +2798,14 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) if (!intel_sdvo_connector) return false; - intel_connector = &intel_sdvo_connector->base; - connector = &intel_connector->base; + connector = &intel_sdvo_connector->base; encoder->base.encoder_type = DRM_MODE_ENCODER_TVDAC; - connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; + connector->base.connector_type = DRM_MODE_CONNECTOR_SVIDEO; intel_sdvo->controlled_output |= type; intel_sdvo_connector->output_flag = type; - if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { + if (intel_sdvo_connector_init(connector, encoder) < 0) { kfree(intel_sdvo_connector); return false; } @@ -2824,7 +2819,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) return true; err: - intel_connector_destroy(connector); + intel_connector_destroy(&connector->base); return false; } @@ -2832,9 +2827,8 @@ static bool intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) { struct intel_encoder *encoder = &intel_sdvo->base; - struct drm_connector *connector; - struct intel_connector *intel_connector; struct intel_sdvo_connector *intel_sdvo_connector; + struct intel_connector *connector; DRM_DEBUG_KMS("initialising analog device %d\n", device); @@ -2842,11 +2836,10 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) if (!intel_sdvo_connector) return false; - intel_connector = &intel_sdvo_connector->base; - connector = &intel_connector->base; - intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT; + connector = &intel_sdvo_connector->base; + connector->polled = DRM_CONNECTOR_POLL_CONNECT; encoder->base.encoder_type = DRM_MODE_ENCODER_DAC; - connector->connector_type = DRM_MODE_CONNECTOR_VGA; + connector->base.connector_type = DRM_MODE_CONNECTOR_VGA; if (device == 0) { intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; @@ -2856,7 +2849,7 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1; } - if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { + if (intel_sdvo_connector_init(connector, encoder) < 0) { kfree(intel_sdvo_connector); return false; } @@ -2869,9 +2862,8 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) { struct intel_encoder *encoder = &intel_sdvo->base; struct drm_i915_private *i915 = to_i915(encoder->base.dev); - struct drm_connector *connector; - struct intel_connector *intel_connector; struct intel_sdvo_connector *intel_sdvo_connector; + struct intel_connector *connector; DRM_DEBUG_KMS("initialising LVDS device %d\n", device); @@ -2879,10 +2871,9 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) if (!intel_sdvo_connector) return false; - intel_connector = &intel_sdvo_connector->base; - connector = &intel_connector->base; + connector = &intel_sdvo_connector->base; encoder->base.encoder_type = DRM_MODE_ENCODER_LVDS; - connector->connector_type = DRM_MODE_CONNECTOR_LVDS; + connector->base.connector_type = DRM_MODE_CONNECTOR_LVDS; if (device == 0) { intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; @@ -2892,7 +2883,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1; } - if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { + if (intel_sdvo_connector_init(connector, encoder) < 0) { kfree(intel_sdvo_connector); return false; } @@ -2900,28 +2891,28 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) goto err; - intel_bios_init_panel(i915, &intel_connector->panel, NULL, NULL); + intel_bios_init_panel(i915, &connector->panel, NULL, NULL); /* * Fetch modes from VBT. For SDVO prefer the VBT mode since some * SDVO->LVDS transcoders can't cope with the EDID mode. */ - intel_panel_add_vbt_sdvo_fixed_mode(intel_connector); + intel_panel_add_vbt_sdvo_fixed_mode(connector); - if (!intel_panel_preferred_fixed_mode(intel_connector)) { - intel_ddc_get_modes(connector, &intel_sdvo->ddc); - intel_panel_add_edid_fixed_modes(intel_connector, false, false); + if (!intel_panel_preferred_fixed_mode(connector)) { + intel_ddc_get_modes(&connector->base, &intel_sdvo->ddc); + intel_panel_add_edid_fixed_modes(connector, false, false); } - intel_panel_init(intel_connector); + intel_panel_init(connector); - if (!intel_panel_preferred_fixed_mode(intel_connector)) + if (!intel_panel_preferred_fixed_mode(connector)) goto err; return true; err: - intel_connector_destroy(connector); + intel_connector_destroy(&connector->base); return false; } diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index 8235f91f58c5..c28323db7d63 100644 --- a/drivers/gpu/drm/i915/display/intel_tv.c +++ b/drivers/gpu/drm/i915/display/intel_tv.c @@ -1915,10 +1915,9 @@ void intel_tv_init(struct drm_i915_private *dev_priv) { struct drm_device *dev = &dev_priv->drm; - struct drm_connector *connector; struct intel_tv *intel_tv; struct intel_encoder *encoder; - struct intel_connector *intel_connector; + struct intel_connector *connector; u32 tv_dac_on, tv_dac_off, save_tv_dac; if ((intel_de_read(dev_priv, TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED) @@ -1957,14 +1956,13 @@ intel_tv_init(struct drm_i915_private *dev_priv) return; } - intel_connector = intel_connector_alloc(); - if (!intel_connector) { + connector = intel_connector_alloc(); + if (!connector) { kfree(intel_tv); return; } encoder = &intel_tv->base; - connector = &intel_connector->base; /* * The documentation, for the older chipsets at least, recommend @@ -1976,9 +1974,9 @@ intel_tv_init(struct drm_i915_private *dev_priv) * * More recent chipsets favour HDMI rather than integrated S-Video. */ - intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT; + connector->polled = DRM_CONNECTOR_POLL_CONNECT; - drm_connector_init(dev, connector, &intel_tv_connector_funcs, + drm_connector_init(dev, &connector->base, &intel_tv_connector_funcs, DRM_MODE_CONNECTOR_SVIDEO); drm_encoder_init(dev, &encoder->base, &intel_tv_enc_funcs, @@ -1990,9 +1988,9 @@ intel_tv_init(struct drm_i915_private *dev_priv) encoder->enable = intel_enable_tv; encoder->disable = intel_disable_tv; encoder->get_hw_state = intel_tv_get_hw_state; - intel_connector->get_hw_state = intel_connector_get_hw_state; + connector->get_hw_state = intel_connector_get_hw_state; - intel_connector_attach_encoder(intel_connector, encoder); + intel_connector_attach_encoder(connector, encoder); encoder->type = INTEL_OUTPUT_TVOUT; encoder->power_domain = POWER_DOMAIN_PORT_OTHER; @@ -2001,7 +1999,8 @@ intel_tv_init(struct drm_i915_private *dev_priv) encoder->cloneable = 0; intel_tv->type = DRM_MODE_CONNECTOR_Unknown; - drm_connector_helper_add(connector, &intel_tv_connector_helper_funcs); + drm_connector_helper_add(&connector->base, + &intel_tv_connector_helper_funcs); - intel_tv_add_properties(connector); + intel_tv_add_properties(&connector->base); } diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index 58b5b3cfc540..974f8674f862 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -1848,8 +1848,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct intel_dsi *intel_dsi; struct intel_encoder *encoder; - struct intel_connector *intel_connector; - struct drm_connector *connector; + struct intel_connector *connector; struct drm_display_mode *current_mode; enum port port; enum pipe pipe; @@ -1869,16 +1868,14 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) if (!intel_dsi) return; - intel_connector = intel_connector_alloc(); - if (!intel_connector) { + connector = intel_connector_alloc(); + if (!connector) { kfree(intel_dsi); return; } encoder = &intel_dsi->base; - intel_dsi->attached_connector = intel_connector; - - connector = &intel_connector->base; + intel_dsi->attached_connector = connector; drm_encoder_init(dev, &encoder->base, &intel_dsi_funcs, DRM_MODE_ENCODER_DSI, "DSI %c", port_name(port)); @@ -1894,7 +1891,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) encoder->update_pipe = intel_backlight_update; encoder->shutdown = intel_dsi_shutdown; - intel_connector->get_hw_state = intel_connector_get_hw_state; + connector->get_hw_state = intel_connector_get_hw_state; encoder->port = port; encoder->type = INTEL_OUTPUT_DSI; @@ -1914,18 +1911,18 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) intel_dsi->panel_power_off_time = ktime_get_boottime(); - intel_bios_init_panel(dev_priv, &intel_connector->panel, NULL, NULL); + intel_bios_init_panel(dev_priv, &connector->panel, NULL, NULL); - if (intel_connector->panel.vbt.dsi.config->dual_link) + if (connector->panel.vbt.dsi.config->dual_link) intel_dsi->ports = BIT(PORT_A) | BIT(PORT_C); else intel_dsi->ports = BIT(port); - if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports)) - intel_connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports; + if (drm_WARN_ON(&dev_priv->drm, connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports)) + connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports; - if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports)) - intel_connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports; + if (drm_WARN_ON(&dev_priv->drm, connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports)) + connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports; /* Create a DSI host (and a device) for each port. */ for_each_dsi_port(port, intel_dsi->ports) { @@ -1963,36 +1960,38 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) intel_dsi_vbt_gpio_init(intel_dsi, intel_dsi_get_hw_state(encoder, &pipe)); - drm_connector_init(dev, connector, &intel_dsi_connector_funcs, + drm_connector_init(dev, &connector->base, + &intel_dsi_connector_funcs, DRM_MODE_CONNECTOR_DSI); - drm_connector_helper_add(connector, &intel_dsi_connector_helper_funcs); + drm_connector_helper_add(&connector->base, + &intel_dsi_connector_helper_funcs); - connector->display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/ + connector->base.display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/ - intel_connector_attach_encoder(intel_connector, encoder); + intel_connector_attach_encoder(connector, encoder); mutex_lock(&dev->mode_config.mutex); - intel_panel_add_vbt_lfp_fixed_mode(intel_connector); + intel_panel_add_vbt_lfp_fixed_mode(connector); mutex_unlock(&dev->mode_config.mutex); - if (!intel_panel_preferred_fixed_mode(intel_connector)) { + if (!intel_panel_preferred_fixed_mode(connector)) { drm_dbg_kms(&dev_priv->drm, "no fixed mode\n"); goto err_cleanup_connector; } - intel_panel_init(intel_connector); + intel_panel_init(connector); - intel_backlight_setup(intel_connector, INVALID_PIPE); + intel_backlight_setup(connector, INVALID_PIPE); - vlv_dsi_add_properties(intel_connector); + vlv_dsi_add_properties(connector); return; err_cleanup_connector: - drm_connector_cleanup(&intel_connector->base); + drm_connector_cleanup(&connector->base); err: drm_encoder_cleanup(&encoder->base); kfree(intel_dsi); - kfree(intel_connector); + kfree(connector); }