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 <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson 2024-01-09 14:57:23 +00:00
parent ce89f49b7a
commit c44d7b3f28

View file

@ -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_id, crtc_id);
atomic_add(atom, id, props->crtc_x, (uint64_t)x); atomic_add(atom, id, props->crtc_x, (uint64_t)x);
atomic_add(atom, id, props->crtc_y, (uint64_t)y); 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, static bool atomic_crtc_commit(struct wlr_drm_connector *conn,