diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2018-11-06 12:06:20 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2018-11-15 16:10:03 +0100 |
commit | 426f9a49655f01863cf4d898f525e5f95984e0c4 (patch) | |
tree | b45d3ec5840052cd1c141d03b3de934237557362 /src | |
parent | a9da219e13bd0cdec65554382b5cd15abc3e3778 (diff) |
Relax detection of non-premultiplied alpha cursor data
The stricter detection broke the cursor in some games. Apparently those
use cursor data with premultiplied alpha, but with some pixels having
r/g/b values larger than the alpha value (which corresponds to original
r/g/b values > 1.0), triggering the workaround.
Relax the detection to match what's in the X server since 1.18.4, but
keep the workaround for older versions.
Bugzilla: https://bugs.freedesktop.org/108650
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drmmode_display.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 34b3d87..871a645 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1509,8 +1509,8 @@ drmmode_cursor_pixel(xf86CrtcPtr crtc, uint32_t *argb, Bool premultiplied, int i; if (premultiplied) { -#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 20, 99, 0, 0) - if (*argb > (alpha | alpha << 8 | alpha << 16 | alpha << 24)) +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 18, 4, 0, 0) + if (alpha == 0 && (*argb & 0xffffff) != 0) /* Doesn't look like premultiplied alpha */ return FALSE; #endif |