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); }; /**