sdm: Add support for flip panel mount in drm DAL
- Define 180 rotation in drm interface
- Read panel rotation from connector info and
populate panel orientation for sdm
Change-Id: Iaf8417f4eb8d3b8dc6f95f783bcb447cad230c64
CRs-fixed: 2051379
diff --git a/libdrmutils/drm_interface.h b/libdrmutils/drm_interface.h
index 46ab782..71767e7 100644
--- a/libdrmutils/drm_interface.h
+++ b/libdrmutils/drm_interface.h
@@ -218,6 +218,7 @@
enum struct DRMRotation {
FLIP_H = 0x1,
FLIP_V = 0x2,
+ ROT_180 = FLIP_H | FLIP_V,
ROT_90 = 0x4,
};
@@ -358,6 +359,7 @@
int wmin;
int hmin;
bool roi_merge;
+ DRMRotation panel_orientation;
};
/* Identifier token for a display */
diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp
index 6bc4434..1be973c 100644
--- a/sdm/libs/core/drm/hw_device_drm.cpp
+++ b/sdm/libs/core/drm/hw_device_drm.cpp
@@ -445,6 +445,15 @@
hw_panel_info_.is_primary_panel = connector_info_.is_primary;
hw_panel_info_.is_pluggable = 0;
+ // no supprt for 90 rotation only flips or 180 supported
+ hw_panel_info_.panel_orientation.rotation = 0;
+ hw_panel_info_.panel_orientation.flip_horizontal =
+ (connector_info_.panel_orientation == DRMRotation::FLIP_H) ||
+ (connector_info_.panel_orientation == DRMRotation::ROT_180);
+ hw_panel_info_.panel_orientation.flip_vertical =
+ (connector_info_.panel_orientation == DRMRotation::FLIP_V) ||
+ (connector_info_.panel_orientation == DRMRotation::ROT_180);
+
GetHWDisplayPortAndMode();
GetHWPanelMaxBrightness();