The tidss driver doesn't really implement anything with encoders, it
just relies on simple encoders, bridges and drm_bridge_connector.

In order to figure out the CRTC -> connector association from the
hardware state, we do need encoder support though, through the
get_current_crtc callback.

Since the tidss encoders are always connected to a single CRTC, we don't
really need to read the hardware state though, we can simply return the
one we know we are always connected to.

Reviewed-by: Maarten Lankhorst <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
---
 drivers/gpu/drm/tidss/tidss_encoder.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/tidss/tidss_encoder.c 
b/drivers/gpu/drm/tidss/tidss_encoder.c
index 5034e601ac86..1ca054a3cd87 100644
--- a/drivers/gpu/drm/tidss/tidss_encoder.c
+++ b/drivers/gpu/drm/tidss/tidss_encoder.c
@@ -124,5 +124,20 @@ static const struct drm_bridge_funcs tidss_bridge_funcs = {
 };
 
+static struct drm_crtc *tidss_encoder_get_current_crtc(struct drm_encoder 
*encoder)
+{
+       struct drm_crtc *crtc;
+
+       WARN_ON(hweight32(encoder->possible_crtcs) > 1);
+
+       drm_for_each_crtc(crtc, encoder->dev) {
+               if (encoder->possible_crtcs == (1 << drm_crtc_index(crtc)))
+                       return crtc;
+       }
+
+       return NULL;
+}
+
 static const struct drm_encoder_funcs tidss_encoder_funcs = {
+       .atomic_sro_get_current_crtc = tidss_encoder_get_current_crtc,
        .destroy = drm_encoder_cleanup,
 };

-- 
2.55.0

Reply via email to