[PATCH 20/35] drm/sun4i: set the panel orientation on the connector

From: Dmitry Baryshkov

Date: Mon Oct 26 2026 - 07:24:11 EST


The panel is used directly, without the panel bridge, so nothing sets
its orientation on the connector apart from the workaround in the
get_modes() of some panel drivers, which runs too late.

Assisted-by: LLM
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
---
drivers/gpu/drm/sun4i/sun4i_lvds.c | 2 ++
drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 ++
2 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/sun4i/sun4i_lvds.c b/drivers/gpu/drm/sun4i/sun4i_lvds.c
index 6b98d20a8890..448e8a70b1aa 100644
--- a/drivers/gpu/drm/sun4i/sun4i_lvds.c
+++ b/drivers/gpu/drm/sun4i/sun4i_lvds.c
@@ -153,6 +153,8 @@ int sun4i_lvds_init(struct drm_device *drm, struct sun4i_tcon *tcon)
goto err_cleanup_connector;
}

+ drm_connector_set_orientation_from_panel(&lvds->connector,
+ lvds->panel);
drm_connector_attach_encoder(&lvds->connector,
&lvds->encoder);
}
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index 3da9a9283c6e..5414afcb10b5 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -245,6 +245,8 @@ int sun4i_rgb_init(struct drm_device *drm, struct sun4i_tcon *tcon)
goto err_cleanup_connector;
}

+ drm_connector_set_orientation_from_panel(&rgb->connector,
+ rgb->panel);
drm_connector_attach_encoder(&rgb->connector,
&rgb->encoder);
}

--
2.47.3