1 From b882872e4391bf38d8cb7fb2544d6941f297b57d Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 1 Feb 2022 12:20:20 +0000
4 Subject: [PATCH 1051/1085] drm/panel: Add and initialise an orientation field
7 "rotation" is listed as a standard property of panels in panel-common.yaml,
8 therefore it would be logical to process that from within the core
9 code should a panel driver not implement the get_orientation hook.
11 Call of_drm_get_panel_orientation from
12 drm_connector_set_orientation_from_panel to get that information.
14 This removes the need for any boiler-plate in panel drivers for calling
15 drm_connector_set_orientation_from_panel or
16 drm_connector_set_panel_orientation.
18 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
20 drivers/gpu/drm/drm_connector.c | 9 +++++++--
21 1 file changed, 7 insertions(+), 2 deletions(-)
23 --- a/drivers/gpu/drm/drm_connector.c
24 +++ b/drivers/gpu/drm/drm_connector.c
25 @@ -2697,10 +2697,15 @@ int drm_connector_set_orientation_from_p
27 enum drm_panel_orientation orientation;
29 - if (panel && panel->funcs && panel->funcs->get_orientation)
30 + if (panel && panel->funcs && panel->funcs->get_orientation) {
31 orientation = panel->funcs->get_orientation(panel);
34 orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
36 + of_drm_get_panel_orientation(panel->dev->of_node,
41 return drm_connector_set_panel_orientation(connector, orientation);