From c44d7b3f286a1bb277b0cc80db111cc2012c2b1e Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 9 Jan 2024 14:57:23 +0000 Subject: [PATCH] backend/drm: Ensure plane rotation is always reset The rotation property of a plane persists between commits. If any application has set the property before wlroots takes over, then that rotation will still apply to wlroots' output. If the rotate applied to a primary plane but not the cursor plane (as would happen if the kernel command line contains "video=HDMI-A-1:1920x1080,rotate=180"), then system operation becomes "interesting". If the property exists, always set it to DRM_MODE_ROTATE_0 to ensure that the system generates the expected output. Signed-off-by: Dave Stevenson --- backend/drm/atomic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c index 530ee2545..97934618b 100644 --- a/backend/drm/atomic.c +++ b/backend/drm/atomic.c @@ -256,6 +256,8 @@ static void set_plane_props(struct atomic *atom, struct wlr_drm_backend *drm, atomic_add(atom, id, props->crtc_id, crtc_id); atomic_add(atom, id, props->crtc_x, (uint64_t)x); atomic_add(atom, id, props->crtc_y, (uint64_t)y); + if (plane->props.rotation) + atomic_add(atom, id, props->rotation, DRM_MODE_ROTATE_0); } static bool atomic_crtc_commit(struct wlr_drm_connector *conn,