From patchwork Wed Sep 18 19:04:39 2024 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: 13807098 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 0190FCDD54F for ; Wed, 18 Sep 2024 19:04:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9674210E1CD; Wed, 18 Sep 2024 19:04:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="LsnOD2lJ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0385D10E1CD for ; Wed, 18 Sep 2024 19:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726686285; x=1758222285; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wKeqX1x/T3HQA74D3TVyBxXWbU+8CHUbDiErUDeTf4c=; b=LsnOD2lJQm8G0uXfFLhTS9oSANNf0EU0hP1cKmZMBMle1lpD2PKbpm7j wCcvNiyoDLk3no8AGAamulbw8MdVBU+JkIRD/MvE/GpClCt18fDQAWsFe ++XqC3tc4KCzGvJ/MN0Rg1XnZ285Gzm8Nt7NDK3R0u5m81Kw90SERFkVx JnYq0SmxmzR258mV58LyM1mQGn8CswnLWkEq5DLjNvUYP7kRnuO3Y4SOr 38M8nt5tk/Ch01SUTemjU45QI5lSwBg+u2lNMvrDlwGJhuL6uio1IxY8Q vz6A6Zf7mYpRuRKdp+wxDtM2hB1uwUny1fnqEm/7EgeMibyqw/DgWOGfF Q==; X-CSE-ConnectionGUID: UOE2C7tMSz27YKvjgWW5RA== X-CSE-MsgGUID: RgcQEhJGTiqTMywfMSdRvQ== X-IronPort-AV: E=McAfee;i="6700,10204,11199"; a="48147712" X-IronPort-AV: E=Sophos;i="6.10,239,1719903600"; d="scan'208";a="48147712" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2024 12:04:45 -0700 X-CSE-ConnectionGUID: pdEG5L7ITrWLJzD6xqEqXQ== X-CSE-MsgGUID: /yCHs+wpT4iwVRCNII1ZTg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,239,1719903600"; d="scan'208";a="69786646" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 18 Sep 2024 12:04:42 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 18 Sep 2024 22:04:41 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Cc: =?utf-8?q?Jouni_H=C3=B6gander?= Subject: [PATCH 1/3] drm/i915/dp: Fix colorimetry detection Date: Wed, 18 Sep 2024 22:04:39 +0300 Message-ID: <20240918190441.29071-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.44.2 MIME-Version: 1.0 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ä intel_dp_init_connector() is no place for detecting stuff via DPCD (except perhaps for eDP). Move the colorimetry stuff into a more appropriate place. Cc: Jouni Högander Fixes: 00076671a648 ("drm/i915/display: Move colorimetry_support from intel_psr to intel_dp") Signed-off-by: Ville Syrjälä Reviewed-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_dp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 19f78432cc8f..f44951d8a0f8 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4082,6 +4082,9 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector drm_dp_is_branch(intel_dp->dpcd)); intel_init_dpcd_quirks(intel_dp, &intel_dp->desc.ident); + intel_dp->colorimetry_support = + intel_dp_get_colorimetry_status(intel_dp); + /* * Read the eDP display control registers. * @@ -4195,6 +4198,9 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) intel_init_dpcd_quirks(intel_dp, &intel_dp->desc.ident); + intel_dp->colorimetry_support = + intel_dp_get_colorimetry_status(intel_dp); + intel_dp_update_sink_caps(intel_dp); } @@ -6946,9 +6952,6 @@ intel_dp_init_connector(struct intel_digital_port *dig_port, "HDCP init failed, skipping.\n"); } - intel_dp->colorimetry_support = - intel_dp_get_colorimetry_status(intel_dp); - intel_dp->frl.is_trained = false; intel_dp->frl.trained_rate_gbps = 0; From patchwork Wed Sep 18 19:04:40 2024 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: 13807099 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 19D9DCDD54F for ; Wed, 18 Sep 2024 19:04:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B487F10E28F; Wed, 18 Sep 2024 19:04:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="SEFjq2G5"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E15110E28F for ; Wed, 18 Sep 2024 19:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726686287; x=1758222287; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=z6TyuE052BdKCldMBfCIFLiyhjCjuHHz/NAsRZaoM4U=; b=SEFjq2G5oz8eylZ6OrgtA2NsTQZF8T52auh0Q9by0MaAoQ6ROj3YiOcm RoeY4SRbikFj7A/Yr+A+ouRA9gvxjZ/xuu4oJOIDgZuAIWgCvZIT/ctDQ G7NMVlBRdcXi+hFFoqRlMuJH7snWRCBJGKRzuY8ECDwZ40VTlVHzDzodO 51vQG3Dv4/etckHjGL+giDDdkvXtpkMFcThwW+fkgpUNzq6VJzhr4wV3o 3GbhTDDKYUmPO+my8NnvT9WdBuTjwWIDfrUh4E3pli0d0ujpkAJFLjJUQ F2ND1EU8D92kzvDJkX27nzhCt/OygmnxxFvahwVdF0chy3p82P+wghMlY A==; X-CSE-ConnectionGUID: 34Wy7/rlQ9KEQ3UHzSVHtQ== X-CSE-MsgGUID: aEje3QtlSti4xoFZLG+71g== X-IronPort-AV: E=McAfee;i="6700,10204,11199"; a="48147715" X-IronPort-AV: E=Sophos;i="6.10,239,1719903600"; d="scan'208";a="48147715" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2024 12:04:47 -0700 X-CSE-ConnectionGUID: pRWphbksQRG1ksdlYQaiiw== X-CSE-MsgGUID: bxcqxnn9RNe1rEnJ+2XalA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,239,1719903600"; d="scan'208";a="69786647" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 18 Sep 2024 12:04:45 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 18 Sep 2024 22:04:44 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/3] drm/i915/dp: Make intel_dp_get_colorimetry_status() static Date: Wed, 18 Sep 2024 22:04:40 +0300 Message-ID: <20240918190441.29071-2-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240918190441.29071-1-ville.syrjala@linux.intel.com> References: <20240918190441.29071-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 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ä intel_dp_get_colorimetry_status() is not used outside of intel_dp.c. Make it static. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/i915/display/intel_dp.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index f44951d8a0f8..6a1b0e93a1fc 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -3915,7 +3915,7 @@ void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp, str_enable_disable(tmp)); } -bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp) +static bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp) { u8 dprx = 0; diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h index a0a31fb64716..d1436face8b2 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.h +++ b/drivers/gpu/drm/i915/display/intel_dp.h @@ -117,7 +117,6 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock, bool intel_dp_source_supports_tps3(struct drm_i915_private *i915); bool intel_dp_source_supports_tps4(struct drm_i915_private *i915); -bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp); int intel_dp_link_required(int pixel_clock, int bpp); int intel_dp_effective_data_rate(int pixel_clock, int bpp_x16, int bw_overhead); From patchwork Wed Sep 18 19:04:41 2024 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: 13807100 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 327D1CDD552 for ; Wed, 18 Sep 2024 19:04:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB53010E627; Wed, 18 Sep 2024 19:04:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="BLrW+EnY"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1F18810E626 for ; Wed, 18 Sep 2024 19:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726686290; x=1758222290; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=RtQgLkxVcXSJf9PtjKUB1g6Ks5CIi5i0MkQGYM/KttY=; b=BLrW+EnYkNIXthI+lJEZVMivWYhMT3svaGkGWwsHpOMoGk0VrXJN5yPh 3nYJYKTdDTi418PkFBozSKPF3ACVCyKvh426fYSxEZvdv9stfinE4aJbQ pkzyb1ej6BixeuIgMxHtyDQAxQFOJ3dlkJCzRpaclsCm8X/gMrdy5tFkk sRtG1QNy7qhkXt/3CDyMY3JxGdfBcrBgx/B/vutMIqyAqZQn1KaDnPL2E biQBKP/br1VI2gM97woSh16htaCqgJMRBb1BtPpMQ++MjhJYRQ8ePUbEX 3imAzOywJQFRPS5IPANybjOYyNidHXjbYg0H57ACKIotB+LA3u6jJvaw6 Q==; X-CSE-ConnectionGUID: 3G7FGF2USNykcdNopXskhA== X-CSE-MsgGUID: Z0Hc+nfMR7yCblC6UjDH8Q== X-IronPort-AV: E=McAfee;i="6700,10204,11199"; a="48147717" X-IronPort-AV: E=Sophos;i="6.10,239,1719903600"; d="scan'208";a="48147717" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2024 12:04:50 -0700 X-CSE-ConnectionGUID: PwmIATHASdG3czP0xgQJGQ== X-CSE-MsgGUID: 1ISGeq64Th+pbpkmAR7Waw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,239,1719903600"; d="scan'208";a="69786648" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 18 Sep 2024 12:04:48 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 18 Sep 2024 22:04:47 +0300 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 3/3] drm/i915/dp: Extract intel_edp_set_sink_rates() Date: Wed, 18 Sep 2024 22:04:41 +0300 Message-ID: <20240918190441.29071-3-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240918190441.29071-1-ville.syrjala@linux.intel.com> References: <20240918190441.29071-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 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ä Declutter intel_edp_init_dpcd() a bit by extracting the sink rates probing into its own function. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/intel_dp.c | 76 +++++++++++++------------ 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 6a1b0e93a1fc..ae3f242fa925 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4066,6 +4066,45 @@ static void intel_edp_mso_init(struct intel_dp *intel_dp) intel_dp->mso_pixel_overlap = mso ? info->mso_pixel_overlap : 0; } +static void +intel_edp_set_sink_rates(struct intel_dp *intel_dp) +{ + intel_dp->num_sink_rates = 0; + + if (intel_dp->edp_dpcd[0] >= DP_EDP_14) { + __le16 sink_rates[DP_MAX_SUPPORTED_RATES]; + int i; + + drm_dp_dpcd_read(&intel_dp->aux, DP_SUPPORTED_LINK_RATES, + sink_rates, sizeof(sink_rates)); + + for (i = 0; i < ARRAY_SIZE(sink_rates); i++) { + int val = le16_to_cpu(sink_rates[i]); + + if (val == 0) + break; + + /* Value read multiplied by 200kHz gives the per-lane + * link rate in kHz. The source rates are, however, + * stored in terms of LS_Clk kHz. The full conversion + * back to symbols is + * (val * 200kHz)*(8/10 ch. encoding)*(1/8 bit to Byte) + */ + intel_dp->sink_rates[i] = (val * 200) / 10; + } + intel_dp->num_sink_rates = i; + } + + /* + * Use DP_LINK_RATE_SET if DP_SUPPORTED_LINK_RATES are available, + * default to DP_MAX_LINK_RATE and DP_LINK_BW_SET otherwise. + */ + if (intel_dp->num_sink_rates) + intel_dp->use_rate_select = true; + else + intel_dp_set_sink_rates(intel_dp); +} + static bool intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector) { @@ -4110,42 +4149,7 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp, struct intel_connector *connector */ intel_psr_init_dpcd(intel_dp); - /* Clear the default sink rates */ - intel_dp->num_sink_rates = 0; - - /* Read the eDP 1.4+ supported link rates. */ - if (intel_dp->edp_dpcd[0] >= DP_EDP_14) { - __le16 sink_rates[DP_MAX_SUPPORTED_RATES]; - int i; - - drm_dp_dpcd_read(&intel_dp->aux, DP_SUPPORTED_LINK_RATES, - sink_rates, sizeof(sink_rates)); - - for (i = 0; i < ARRAY_SIZE(sink_rates); i++) { - int val = le16_to_cpu(sink_rates[i]); - - if (val == 0) - break; - - /* Value read multiplied by 200kHz gives the per-lane - * link rate in kHz. The source rates are, however, - * stored in terms of LS_Clk kHz. The full conversion - * back to symbols is - * (val * 200kHz)*(8/10 ch. encoding)*(1/8 bit to Byte) - */ - intel_dp->sink_rates[i] = (val * 200) / 10; - } - intel_dp->num_sink_rates = i; - } - - /* - * Use DP_LINK_RATE_SET if DP_SUPPORTED_LINK_RATES are available, - * default to DP_MAX_LINK_RATE and DP_LINK_BW_SET otherwise. - */ - if (intel_dp->num_sink_rates) - intel_dp->use_rate_select = true; - else - intel_dp_set_sink_rates(intel_dp); + intel_edp_set_sink_rates(intel_dp); intel_dp_set_max_sink_lane_count(intel_dp); /* Read the eDP DSC DPCD registers */