Skip to content

Android: port `reflect-y` plane rotation support int mtk-android11-5.4

FROMLIST: drm/mediatek: Support reflect-y plane rotation

Expose the rotation property and handle REFLECT_Y rotations.

Cc: Fritz Koenig frkoenig@chromium.org Cc: Daniele Castagna dcastagna@chromium.org Cc: Miguel Casas mcasas@chromium.org Cc: Mark Yacoub markyacoub@google.com Signed-off-by: Sean Paul seanpaul@chromium.org (am from https://patchwork.kernel.org/patch/11223121/) (also found at https://lore.kernel.org/r/20191101132647.189033-1-sean@poorly.run) Signed-off-by: Mattijs Korpershoek mkorpershoek@baylibre.com

Note that for a cleaner support we should port the following series instead:

But the above series does not cleanly apply on mtk-android11-5.4 and we only need REFLECT_Y for our use. Since mtk-android-11-5.4 is a maintenance branch, this should be sufficient.

Tested on a i350 based board with the following hack in drm_hwcomposer:

--- a/drm/DrmPlane.cpp
+++ b/drm/DrmPlane.cpp
@@ -270,6 +270,8 @@ static uint64_t ToDrmRotation(DrmHwcTransform transform) {
   else
     rotation |= DRM_MODE_ROTATE_0;
 
+  rotation |= DRM_MODE_REFLECT_Y;
+
   return rotation;
 }

Also tested with modetest:

modetest -M mediatek -s 32@41:1200x1920-60 -d -w 33:rotation:33 

Merge request reports