diff options
author | Robin Murphy <[email protected]> | 2019-09-21 18:07:28 +0100 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2019-10-01 14:45:15 +0100 |
commit | 563f8974d81c3716538036781df3ecbf7e7686c0 (patch) | |
tree | f945ce890275feb8a26ec14ee8fe3ad35285b85d /src/egl | |
parent | 4943c89d6d3f522b3100be9187ff045f84f032b1 (diff) |
egl/gbm: Fix config validation
In converting to shift/size-based validation, we lost a condition from
the ARGB/XRGB equivalence check, which left it working one way round
but not the other, and broke applications like glmark2-es2-drm on some
platforms. Restore the equivalent check that *both* configs actually
have an alpha channel before considering a mismatch.
Fixes: 7b4ed2b513ef ("egl: Convert configs to use shifts and sizes instead of masks")
Signed-off-by: Robin Murphy <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/platform_drm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 7b13129ee3a..d0ab172d659 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -122,11 +122,13 @@ dri2_drm_config_is_compatible(struct dri2_egl_display *dri2_dpy, if (shifts[0] != visual->rgba_shifts.red || shifts[1] != visual->rgba_shifts.green || shifts[2] != visual->rgba_shifts.blue || - (shifts[3] > -1 && shifts[3] != visual->rgba_shifts.alpha) || + (shifts[3] > -1 && visual->rgba_shifts.alpha > -1 && + shifts[3] != visual->rgba_shifts.alpha) || sizes[0] != visual->rgba_sizes.red || sizes[1] != visual->rgba_sizes.green || sizes[2] != visual->rgba_sizes.blue || - (sizes[3] > 0 && sizes[3] != visual->rgba_sizes.alpha) || + (sizes[3] > 0 && visual->rgba_sizes.alpha > 0 && + sizes[3] != visual->rgba_sizes.alpha) || is_float != visual->is_float) { return false; } |