modesetting: Immediately handle failure to set HW cursor, v5
Based on v4 by Alexandre Courbot <acourbot@nvidia.com> There is currently no reliable way to report failure to set a HW cursor. Still such failures can happen if e.g. the MODE_CURSOR DRM ioctl fails (which currently happens at least with modesetting on Tegra for format incompatibility reasons). As failures are currently handled by setting the HW cursor size to (0,0), the fallback to SW cursor will not happen until the next time the cursor changes and xf86CursorSetCursor() is called again. In the meantime, the cursor will be invisible to the user. This patch addresses that by adding _xf86CrtcFuncs::set_cursor_check and _xf86CursorInfoRec::ShowCursorCheck hook variants that return booleans. This allows to propagate errors up to xf86CursorSetCursor(), which can then fall back to using the SW cursor immediately. v5: - Removed parts of patch already committed as part of14c21ea1
. - Adjusted code slightly to match surrounding code. - Effectively revertedaf916477
which is made unnecessary by this patch. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Michael Thayer <michael.thayer@oracle.com>
This commit is contained in:
parent
c02f6a687c
commit
ecd0a62323
|
@ -813,13 +813,8 @@ drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image)
|
|||
for (i = 0; i < ms->cursor_width * ms->cursor_height; i++)
|
||||
ptr[i] = image[i]; // cpu_to_le32(image[i]);
|
||||
|
||||
if (drmmode_crtc->cursor_up || !drmmode_crtc->first_cursor_load_done) {
|
||||
Bool ret = drmmode_set_cursor(crtc);
|
||||
if (!drmmode_crtc->cursor_up)
|
||||
drmmode_hide_cursor(crtc);
|
||||
drmmode_crtc->first_cursor_load_done = TRUE;
|
||||
return ret;
|
||||
}
|
||||
if (drmmode_crtc->cursor_up)
|
||||
return drmmode_set_cursor(crtc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -835,12 +830,12 @@ drmmode_hide_cursor(xf86CrtcPtr crtc)
|
|||
ms->cursor_width, ms->cursor_height);
|
||||
}
|
||||
|
||||
static void
|
||||
static Bool
|
||||
drmmode_show_cursor(xf86CrtcPtr crtc)
|
||||
{
|
||||
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
||||
drmmode_crtc->cursor_up = TRUE;
|
||||
drmmode_set_cursor(crtc);
|
||||
return drmmode_set_cursor(crtc);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1108,7 +1103,7 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
|
|||
.set_mode_major = drmmode_set_mode_major,
|
||||
.set_cursor_colors = drmmode_set_cursor_colors,
|
||||
.set_cursor_position = drmmode_set_cursor_position,
|
||||
.show_cursor = drmmode_show_cursor,
|
||||
.show_cursor_check = drmmode_show_cursor,
|
||||
.hide_cursor = drmmode_hide_cursor,
|
||||
.load_cursor_argb_check = drmmode_load_cursor_argb_check,
|
||||
|
||||
|
|
|
@ -93,7 +93,6 @@ typedef struct {
|
|||
struct dumb_bo *cursor_bo;
|
||||
Bool cursor_up;
|
||||
Bool set_cursor2_failed;
|
||||
Bool first_cursor_load_done;
|
||||
uint16_t lut_r[256], lut_g[256], lut_b[256];
|
||||
|
||||
drmmode_bo rotate_bo;
|
||||
|
|
Loading…
Reference in New Issue