[22/35] drm/panel: drop the orientation workaround from get_modes()
Commit Message
Setting the orientation from get_modes() was a stopgap for the display
drivers not calling drm_connector_set_orientation_from_panel(). It is
also too late: by then the connector is registered and the property can
no longer be attached properly.
drm_bridge_connector and the panel bridge set the orientation on their
own, and the drivers using a panel directly do it when creating the
connector now. The exceptions are sun6i_mipi_dsi, sti_dvo and the Tegra
DSI, which get the panel only after the DRM device has been registered.
None of the in-tree boards using them has a rotated panel.
Assisted-by: LLM
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/gpu/drm/panel/panel-boe-th101mb31ig002-28a.c | 6 ------
drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ------
drivers/gpu/drm/panel/panel-edp.c | 6 ------
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 6 ------
drivers/gpu/drm/panel/panel-lvds.c | 6 ------
drivers/gpu/drm/panel/panel-simple.c | 6 ------
drivers/gpu/drm/panel/panel-sitronix-st7701.c | 6 ------
drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 6 ------
8 files changed, 48 deletions(-)
Comments
On Mon, Oct 26, 2026, Dmitry Baryshkov wrote:
> The exceptions are sun6i_mipi_dsi, sti_dvo and the Tegra DSI, which get
> the panel only after the DRM device has been registered.
> None of the in-tree boards using them has a rotated panel.
Two are on their way for sun6i_mipi_dsi, both A33 handhelds with the
panel mounted for landscape use, rotation = <270>: the Miyoo PocketGo S30
(ILI9488, panel series at [1]) and the Miyoo A30 (ST7701, not posted yet).
I sent a fix for this gap on 1 November [2]: sun6i_dsi_bind() reads the
rotation from the panel node, a child of the DSI node, and sets the
orientation on the connector before the DRM device is registered. It
does not rely on the panel driver, so it keeps working once the
get_modes() workaround is gone, and it skips port/ports nodes, so it
does not mind whether the board also links the panel through the graph.
Tested on the S30; it still applies to drm-misc-next as of 12 November.
Could your repost of 15+ take it, or point at it for sun6i_mipi_dsi? It
reads the DT itself rather than panel->orientation from your 23/35,
because the panel is not there yet at bind time. I am happy to rebase it
on top of your series if you prefer.
[1] https://lore.kernel.org/all/20261109160706.2272332-1-romain.tisserand@gmail.com/
[2] https://lore.kernel.org/all/20261101203406.1360656-1-romain.tisserand@gmail.com/
Romain
On Mon, Oct 26, 2026 at 12:11 PM Dmitry Baryshkov
<dmitry.baryshkov@oss.qualcomm.com> wrote:
> Setting the orientation from get_modes() was a stopgap for the display
> drivers not calling drm_connector_set_orientation_from_panel(). It is
> also too late: by then the connector is registered and the property can
> no longer be attached properly.
>
> drm_bridge_connector and the panel bridge set the orientation on their
> own, and the drivers using a panel directly do it when creating the
> connector now. The exceptions are sun6i_mipi_dsi, sti_dvo and the Tegra
> DSI, which get the panel only after the DRM device has been registered.
> None of the in-tree boards using them has a rotated panel.
>
> Assisted-by: LLM
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Makes sense.
Acked-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
@@ -318,12 +318,6 @@ static int boe_th101mb31ig002_get_modes(struct drm_panel *panel,
const struct drm_display_mode *desc_mode = ctx->desc->modes;
connector->display_info.bpc = 8;
- /*
- * TODO: Remove once all drm drivers call
- * drm_connector_set_orientation_from_panel()
- */
- drm_connector_set_panel_orientation(connector, ctx->orientation);
-
return drm_connector_helper_get_modes_fixed(connector, desc_mode);
}
@@ -1666,12 +1666,6 @@ static int boe_panel_get_modes(struct drm_panel *panel,
connector->display_info.width_mm = boe->desc->size.width_mm;
connector->display_info.height_mm = boe->desc->size.height_mm;
connector->display_info.bpc = boe->desc->bpc;
- /*
- * TODO: Remove once all drm drivers call
- * drm_connector_set_orientation_from_panel()
- */
- drm_connector_set_panel_orientation(connector, boe->orientation);
-
return 1;
}
@@ -637,12 +637,6 @@ static int panel_edp_get_modes(struct drm_panel *panel,
else if (!num)
dev_warn(p->base.dev, "No display modes\n");
- /*
- * TODO: Remove once all drm drivers call
- * drm_connector_set_orientation_from_panel()
- */
- drm_connector_set_panel_orientation(connector, p->orientation);
-
return num;
}
@@ -2520,12 +2520,6 @@ static int ili9881c_get_modes(struct drm_panel *panel,
else
connector->display_info.subpixel_order = SubPixelHorizontalRGB;
- /*
- * TODO: Remove once all drm drivers call
- * drm_connector_set_orientation_from_panel()
- */
- drm_connector_set_panel_orientation(connector, ctx->orientation);
-
return 1;
}
@@ -98,12 +98,6 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
&lvds->bus_format, 1);
connector->display_info.bus_flags = lvds->bus_flags;
- /*
- * TODO: Remove once all drm drivers call
- * drm_connector_set_orientation_from_panel()
- */
- drm_connector_set_panel_orientation(connector, lvds->orientation);
-
return 1;
}
@@ -396,12 +396,6 @@ static int panel_simple_get_modes(struct drm_panel *panel,
/* add hard-coded panel modes */
num += panel_simple_get_non_edid_modes(p, connector);
- /*
- * TODO: Remove once all drm drivers call
- * drm_connector_set_orientation_from_panel()
- */
- drm_connector_set_panel_orientation(connector, p->orientation);
-
return num;
}
@@ -635,12 +635,6 @@ static int st7701_get_modes(struct drm_panel *panel,
connector->display_info.width_mm = desc_mode->width_mm;
connector->display_info.height_mm = desc_mode->height_mm;
- /*
- * TODO: Remove once all drm drivers call
- * drm_connector_set_orientation_from_panel()
- */
- drm_connector_set_panel_orientation(connector, st7701->orientation);
-
return 1;
}
@@ -361,12 +361,6 @@ static int st7789v_get_modes(struct drm_panel *panel,
drm_display_info_set_bus_formats(&connector->display_info,
&ctx->info->bus_format, 1);
- /*
- * TODO: Remove once all drm drivers call
- * drm_connector_set_orientation_from_panel()
- */
- drm_connector_set_panel_orientation(connector, ctx->orientation);
-
return 1;
}