From a4f7a5f0dd287895461cd007b23094459b6b88cb Mon Sep 17 00:00:00 2001 From: Hiroyuki Ishii Date: Wed, 28 Dec 2022 15:17:24 +0900 Subject: [PATCH 17/17] drm-lease: Fix incorrect drawing with portrait orientation Signed-off-by: Hiroyuki Ishii --- psplash-drm.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/psplash-drm.c b/psplash-drm.c index a5aff90..c20df13 100644 --- a/psplash-drm.c +++ b/psplash-drm.c @@ -736,6 +736,23 @@ PSplashDRM* psplash_drm_new(int angle, int dev_id) drm->canvas.angle = angle; drm->canvas.rgbmode = RGB888; + /* + * There seems some difference about handling portrait angle between + * pure drm vs drm-lease. We'd use a method as same with psplash-fb + * for drm-lease devices. + */ + if (drm_lease_name) { + switch (angle) { + case 270: + case 90: + drm->canvas.width = modeset_list->height; + drm->canvas.height = modeset_list->width; + break; + default: + break; + } + } + return drm; error: psplash_drm_destroy(drm); -- 2.25.1