From patchwork Wed Mar 18 06:35:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 11444619 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA8C41392 for ; Wed, 18 Mar 2020 06:33:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 930A120768 for ; Wed, 18 Mar 2020 06:33:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 930A120768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D2E26E86B; Wed, 18 Mar 2020 06:33:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8FD13898CE; Wed, 18 Mar 2020 06:33:48 +0000 (UTC) IronPort-SDR: /x+BofHbPQ9iKQhIzy+QqIzZXRyxis7OzcrfAN5BrL9FGTavu0O9g5GeLUqUYcfYSKhDmJoieO AqN4HHYBI6nQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 23:33:47 -0700 IronPort-SDR: K7+gMKtNA8TaW+AnPejz2F+zk2rlHLF7TssTAc6SFaE5DPArKsGihfoke2y6HdGMDPgSbe02T/ B7hNlJpwVAsg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,566,1574150400"; d="scan'208";a="417839757" Received: from labuser-z97x-ud5h.jf.intel.com ([10.165.21.211]) by orsmga005.jf.intel.com with ESMTP; 17 Mar 2020 23:33:47 -0700 From: Manasi Navare To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Tue, 17 Mar 2020 23:35:15 -0700 Message-Id: <20200318063517.3844-1-manasi.d.navare@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/3] drm/dp: DRM DP helper for reading Ignore MSA from DPCD 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: , Cc: Harry Wentland , Nicholas Kazlauskas Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" DP sink device sets the Ignore MSA bit in its DP_DOWNSTREAM_PORT_COUNT register to indicate its ability to ignore the MSA video timing paramaters and its ability to support seamless video timing change over a range of timing exposed by DisplayID and EDID. This is required for the sink to indicate that it is Adaptive sync capable. Cc: Jani Nikula Cc: Ville Syrjälä Cc: Harry Wentland Cc: Nicholas Kazlauskas Signed-off-by: Manasi Navare --- include/drm/drm_dp_helper.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index c6119e4c169a..ccd6e2e988b9 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1315,6 +1315,14 @@ drm_dp_alternate_scrambler_reset_cap(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) DP_ALTERNATE_SCRAMBLER_RESET_CAP; } +/* Ignore MSA timing for Adaptive Sync support on DP 1.4 */ +static inline bool +drm_dp_sink_is_capable_without_timing_msa(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) +{ + return dpcd[DP_DOWN_STREAM_PORT_COUNT] & + DP_MSA_TIMING_PAR_IGNORED; +} + /* * DisplayPort AUX channel */ From patchwork Wed Mar 18 06:35:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 11444621 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E716014B4 for ; Wed, 18 Mar 2020 06:33:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CF09320768 for ; Wed, 18 Mar 2020 06:33:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF09320768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3188B6E86C; Wed, 18 Mar 2020 06:33:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 566DC6E866; Wed, 18 Mar 2020 06:33:48 +0000 (UTC) IronPort-SDR: WMOCpY4nDSj2Nze8F22irhlT+mQD13U7wbOqqW320yu7qxUBXith9jzKXmhqUO90g+DdcJup4f fW1okT7ywH5A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 23:33:47 -0700 IronPort-SDR: 2BfrBXnn7Yrzn3yRyOlTlQQ/xKY4q3AodVhKURyBBzbcfAC9E9PUllYpTxNz5mGnm0kaWldyM5 Vf+RFKMCZLww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,566,1574150400"; d="scan'208";a="417839759" Received: from labuser-z97x-ud5h.jf.intel.com ([10.165.21.211]) by orsmga005.jf.intel.com with ESMTP; 17 Mar 2020 23:33:47 -0700 From: Manasi Navare To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Tue, 17 Mar 2020 23:35:16 -0700 Message-Id: <20200318063517.3844-2-manasi.d.navare@intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200318063517.3844-1-manasi.d.navare@intel.com> References: <20200318063517.3844-1-manasi.d.navare@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/3] drm: Create a drm_connector_helper_funcs hook for Adaptive Sync support 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: , Cc: Harry Wentland , Nicholas Kazlauskas Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This patch adds a hook in drm_connector_helper_funcs to get the support of the driver for adaptive sync functionality. This can be called in the connector probe helper function after the connector detect() and get_modes() hooks to also query the adaptive sync support of the driver. Cc: Jani Nikula Cc: Ville Syrjälä Cc: Harry Wentland Cc: Nicholas Kazlauskas Signed-off-by: Manasi Navare Reviewed-by: Harry Wentland --- drivers/gpu/drm/drm_probe_helper.c | 4 ++++ include/drm/drm_modeset_helper_vtables.h | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 576b4b7dcd89..4403817bfb02 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -482,6 +482,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, count = (*connector_funcs->get_modes)(connector); + /* Get the Adaptive Sync Support if helper exists */ + if (*connector_funcs->get_adaptive_sync_support) + (**connector_funcs->get_adaptive_sync_support)(connector); + /* * Fallback for when DDC probe failed in drm_get_edid() and thus skipped * override/firmware EDID. diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index 7c20b1c8b6a7..0b203fdd25df 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -1079,6 +1079,22 @@ struct drm_connector_helper_funcs { struct drm_writeback_job *job); void (*cleanup_writeback_job)(struct drm_writeback_connector *connector, struct drm_writeback_job *job); + + /** + * @get_adaptive_sync_support: + * + * This hook is used by the probe helper to get the driver's support + * for adaptive sync or variable refresh rate. + * This is called from drm_helper_probe_single_connector_modes() + * This is called after the @get_modes hook so that the connector modes + * are already obtained and EDID is parsed to obtain the monitor + * range descriptor information. + * + * This hook is optional and defined only for the drivers and on + * connectors that advertise adaptive sync support. + * + */ + void (*get_adaptive_sync_support)(struct drm_connector *connector); }; /** From patchwork Wed Mar 18 06:35:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 11444623 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E56D514B4 for ; Wed, 18 Mar 2020 06:33:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CA80020773 for ; Wed, 18 Mar 2020 06:33:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA80020773 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A37C16E86E; Wed, 18 Mar 2020 06:33:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 19E73898CE; Wed, 18 Mar 2020 06:33:48 +0000 (UTC) IronPort-SDR: SqEtN9/E8/jwY5V6hDAm8C38ojeIGQs13sBDFfaQwpDVhR19b72Lq2wokCM9mHJk+1at59o0HH 2qJ4aMPYKTkw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 23:33:47 -0700 IronPort-SDR: KTi2+Je3Z5QzX1f/QuXhoYMQ8zsv8fJDoFimqj/t6cxH+/YXXIymzMGiS/xzT1UNXCiGCbik1u RwJI7wF0Dviw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,566,1574150400"; d="scan'208";a="417839761" Received: from labuser-z97x-ud5h.jf.intel.com ([10.165.21.211]) by orsmga005.jf.intel.com with ESMTP; 17 Mar 2020 23:33:47 -0700 From: Manasi Navare To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Tue, 17 Mar 2020 23:35:17 -0700 Message-Id: <20200318063517.3844-3-manasi.d.navare@intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200318063517.3844-1-manasi.d.navare@intel.com> References: <20200318063517.3844-1-manasi.d.navare@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/3] drm/i915/dp: intel_dp connector hook for VRR support 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: , Cc: Harry Wentland , Nicholas Kazlauskas Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This defines the get_vrr_support hook for intel DP connector VRR support is set to true based on the DPCD ignore MSA and EDID monitor range Cc: Jani Nikula Cc: Ville Syrjälä Cc: Harry Wentland Cc: Nicholas Kazlauskas Cc: Aditya Swarup Signed-off-by: Manasi Navare --- .../drm/i915/display/intel_display_types.h | 3 +++ drivers/gpu/drm/i915/display/intel_dp.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 5e00e611f077..cd37ee6db1ff 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1353,6 +1353,9 @@ struct intel_dp { /* Display stream compression testing */ bool force_dsc_en; + + /* DP Variable refresh rate/ Adaptive sync support */ + bool vrr_capable; }; enum lspcon_vendor { diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 0a417cd2af2b..ccf5d868b5c1 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5860,6 +5860,24 @@ static int intel_dp_get_modes(struct drm_connector *connector) return 0; } +static void intel_dp_get_vrr_support(struct drm_connector *connector) +{ + struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector)); + const struct drm_display_info *info = &connector->display_info; + struct drm_i915_private *dev_priv = to_i915(connector->dev); + + /* + * DP Sink is capable of Variable refresh video timings if + * Ignore MSA bit is set in DPCD. + * EDID monitor range also should be atleast 10 for reasonable + * Adaptive sync/ VRR end user experience. + */ + if (INTEL_GEN(dev_priv) >= 12 && + drm_dp_sink_is_capable_without_timing_msa(intel_dp->dpcd) && + info->monitor_range.max_vfreq - info->monitor_range.min_vfreq > 10) + intel_dp->vrr_capable = true; +} + static int intel_dp_connector_register(struct drm_connector *connector) { @@ -6756,6 +6774,7 @@ static const struct drm_connector_helper_funcs intel_dp_connector_helper_funcs = .get_modes = intel_dp_get_modes, .mode_valid = intel_dp_mode_valid, .atomic_check = intel_dp_connector_atomic_check, + .get_adaptive_sync_support = intel_dp_get_vrr_support, }; static const struct drm_encoder_funcs intel_dp_enc_funcs = {