Files
openwrt-master/target/linux/bcm27xx/patches-6.6/950-1051-drm-panel-Add-and-initialise-an-orientation-field-to.patch
domenico c06fb25d1f
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Initial commit
2025-06-24 14:35:53 +02:00

43 lines
1.5 KiB
Diff

From b882872e4391bf38d8cb7fb2544d6941f297b57d Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 1 Feb 2022 12:20:20 +0000
Subject: [PATCH 1051/1085] 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 <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/drm_connector.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -2697,10 +2697,15 @@ int drm_connector_set_orientation_from_p
{
enum drm_panel_orientation orientation;
- if (panel && panel->funcs && panel->funcs->get_orientation)
+ if (panel && panel->funcs && panel->funcs->get_orientation) {
orientation = panel->funcs->get_orientation(panel);
- else
+ } else {
orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
+ if (panel) {
+ of_drm_get_panel_orientation(panel->dev->of_node,
+ &orientation);
+ }
+ }
return drm_connector_set_panel_orientation(connector, orientation);
}