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 <jani.nik...@linux.intel.com>
Cc: Ville Syrjälä <ville.syrj...@linux.intel.com>
Cc: Harry Wentland <harry.wentl...@amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlaus...@amd.com>
Signed-off-by: Manasi Navare <manasi.d.nav...@intel.com>
---
 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);
 };
 
 /**
-- 
2.19.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to