Skip to content

Commit 4d35836

Browse files
6by9popcornmix
authored andcommitted
drm/panel: Add and initialise an orientation field to drm_panel from OF
"rotation" is listed as a standard property of panels in panel-common.yaml, therefore it would be logical to process that from within the core code should a panel driver not implement the get_orientation hook. Call of_drm_get_panel_orientation from drm_connector_set_orientation_from_panel to get that information. This removes the need for any boiler-plate in panel drivers for calling drm_connector_set_orientation_from_panel or drm_connector_set_panel_orientation. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 2fb0e57 commit 4d35836

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/gpu/drm/drm_connector.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,10 +3073,15 @@ int drm_connector_set_orientation_from_panel(
30733073
{
30743074
enum drm_panel_orientation orientation;
30753075

3076-
if (panel && panel->funcs && panel->funcs->get_orientation)
3076+
if (panel && panel->funcs && panel->funcs->get_orientation) {
30773077
orientation = panel->funcs->get_orientation(panel);
3078-
else
3078+
} else {
30793079
orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
3080+
if (panel) {
3081+
of_drm_get_panel_orientation(panel->dev->of_node,
3082+
&orientation);
3083+
}
3084+
}
30803085

30813086
return drm_connector_set_panel_orientation(connector, orientation);
30823087
}

0 commit comments

Comments
 (0)