Skip to content

Commit f7c92e7

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 <[email protected]>
1 parent 6829d47 commit f7c92e7

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

0 commit comments

Comments
 (0)