Skip to content

Commit 1d2cea9

Browse files
chadmedjannau
authored andcommitted
drm: apple: warn about broken sw cursor fallback
Some userspace may not handle invalid plane checks gracefully when falling back to a software cursor. This will manifest as the screen freezing, recoverable by moving the cursor away from a screen edge. Throw a warning once to let the user know why this has happened. Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
1 parent 4fdc611 commit 1d2cea9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/gpu/drm/apple/apple_drv.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ static int apple_plane_atomic_check(struct drm_plane *plane,
101101
*/
102102
if ((new_plane_state->crtc_x + 32) > crtc_state->mode.hdisplay ||
103103
(new_plane_state->crtc_y + 32) > crtc_state->mode.vdisplay) {
104+
dev_err_once(state->dev->dev,
105+
"Plane operation would have crashed DCP! Rejected!\n\
106+
DCP requires 32x32 of every plane to be within screen space.\n\
107+
Your compositor asked for a screen space area of [%d, %d].\n\
108+
This is not supported, and your compositor should have\n\
109+
switched to software compositing when this operation failed.\n\
110+
You should not have noticed this at all. If your screen\n\
111+
froze/hitched, or your compositor crashed, please report\n\
112+
this to the your compositor's developers. We will not\n\
113+
throw this error again until you next reboot.\n",
114+
crtc_state->mode.hdisplay - new_plane_state->crtc_x,
115+
crtc_state->mode.vdisplay - new_plane_state->crtc_y);
104116
return -EINVAL;
105117
}
106118

0 commit comments

Comments
 (0)