xserver: Branch 'master'
Adam Jackson
ajax at kemper.freedesktop.org
Fri Sep 2 17:05:09 UTC 2016
hw/xfree86/drivers/modesetting/drmmode_display.c | 10 ++++------
hw/xfree86/drivers/modesetting/drmmode_display.h | 2 ++
2 files changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 6c984ac9a737304ab5e26de90c76a79d970b6e33
Author: Hans De Goede <hdegoede at redhat.com>
Date: Wed Aug 31 16:11:11 2016 +0200
modesetting: Do not use function local static variables
The modesetting driver may be driving 2 screens (slave and master
gpu), which may have different behavior wrt hardware cursor support.
So stop using static variables and instead store the hw-cursor support
related data in a per screen struct. While at it actually make it per
crtc data as in theory different crtc's could have different hw-cursor
support.
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 1dad66a..dd8cc71 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -756,10 +756,9 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
drmmode_ptr drmmode = drmmode_crtc->drmmode;
uint32_t handle = drmmode_crtc->cursor_bo->handle;
modesettingPtr ms = modesettingPTR(crtc->scrn);
- static Bool use_set_cursor2 = TRUE;
int ret;
- if (use_set_cursor2) {
+ if (!drmmode_crtc->set_cursor2_failed) {
CursorPtr cursor = xf86CurrentCursor(crtc->scrn->pScreen);
ret =
@@ -769,7 +768,7 @@ drmmode_set_cursor(xf86CrtcPtr crtc)
if (!ret)
return TRUE;
- use_set_cursor2 = FALSE;
+ drmmode_crtc->set_cursor2_failed = TRUE;
}
ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle,
@@ -803,7 +802,6 @@ drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image)
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
int i;
uint32_t *ptr;
- static Bool first_time = TRUE;
/* cursor should be mapped already */
ptr = (uint32_t *) (drmmode_crtc->cursor_bo->ptr);
@@ -811,11 +809,11 @@ 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 || first_time) {
+ 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);
- first_time = FALSE;
+ drmmode_crtc->first_cursor_load_done = TRUE;
return ret;
}
return TRUE;
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h
index 5499c16..6d05ec4 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.h
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.h
@@ -89,6 +89,8 @@ typedef struct {
int dpms_mode;
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;
More information about the xorg-commit
mailing list