mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-04 10:39:06 +02:00
modesetting: Use load_cursor_argb_check for sw cursor fallback
The modesetting driver still has an everlasting bug of invisible
cursor on cirrus and other KMS drivers where no hardware cursor is
supported. This patch is a part of an attempt to address it.
This patch particularly converts the current load_cursor_argb callback
of modesetting driver to load_cursor_argb_check so that it can return
whether the driver handles the hw cursor or falls back to the sw
cursor.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
[hdegoede@redhat.com: Add extra comment suggested by Kenneth]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 14c21ea1c9)
This commit is contained in:
parent
15f8aaa786
commit
61094504a7
1 changed files with 18 additions and 6 deletions
|
|
@ -484,7 +484,7 @@ drmmode_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
|
|||
drmModeMoveCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
static Bool
|
||||
drmmode_set_cursor(xf86CrtcPtr crtc)
|
||||
{
|
||||
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
||||
|
|
@ -503,7 +503,7 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
|
|||
handle, ms->cursor_width, ms->cursor_height,
|
||||
cursor->bits->xhot, cursor->bits->yhot);
|
||||
if (!ret)
|
||||
return;
|
||||
return TRUE;
|
||||
|
||||
use_set_cursor2 = FALSE;
|
||||
}
|
||||
|
|
@ -518,11 +518,22 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
|
|||
cursor_info->MaxWidth = cursor_info->MaxHeight = 0;
|
||||
drmmode_crtc->drmmode->sw_cursor = TRUE;
|
||||
/* fallback to swcursor */
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
|
||||
static void drmmode_hide_cursor(xf86CrtcPtr crtc);
|
||||
|
||||
/*
|
||||
* The load_cursor_argb_check driver hook.
|
||||
*
|
||||
* Sets the hardware cursor by calling the drmModeSetCursor2 ioctl.
|
||||
* On failure, returns FALSE indicating that the X server should fall
|
||||
* back to software cursors.
|
||||
*/
|
||||
static Bool
|
||||
drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image)
|
||||
{
|
||||
modesettingPtr ms = modesettingPTR(crtc->scrn);
|
||||
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
||||
|
|
@ -536,7 +547,8 @@ drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
|
|||
ptr[i] = image[i]; // cpu_to_le32(image[i]);
|
||||
|
||||
if (drmmode_crtc->cursor_up)
|
||||
drmmode_set_cursor(crtc);
|
||||
return drmmode_set_cursor(crtc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -805,7 +817,7 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
|
|||
.set_cursor_position = drmmode_set_cursor_position,
|
||||
.show_cursor = drmmode_show_cursor,
|
||||
.hide_cursor = drmmode_hide_cursor,
|
||||
.load_cursor_argb = drmmode_load_cursor_argb,
|
||||
.load_cursor_argb_check = drmmode_load_cursor_argb_check,
|
||||
|
||||
.gamma_set = drmmode_crtc_gamma_set,
|
||||
.destroy = NULL, /* XXX */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue