mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
st/dri: Don't expose sRGB formats to clients
Though the SARGB8888 format is used internally through its FourCC value, it is not a real format as defined by drm_fourcc.h; it cannot be used with KMS or other interfaces expecting drm_fourcc.h format codes. Ensure we don't advertise it through the dmabuf format/modifier query interfaces, preventing us from tripping over an assert. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Michel Dänzer <michel.daenzer@amd.com> Fixes:8c1b9882b2("egl/dri2: Guard against invalid fourcc formats") Acked-by: Jason Ekstrand <jason.ekstrand@intel.com> (cherry picked from commit01c0aa9f05)
This commit is contained in:
parent
1ec6ba931b
commit
104c598bfb
1 changed files with 6 additions and 0 deletions
|
|
@ -1482,6 +1482,12 @@ dri2_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats,
|
|||
|
||||
for (i = 0, j = 0; (i < ARRAY_SIZE(fourcc_formats)) &&
|
||||
(j < max || max == 0); i++) {
|
||||
/* The sRGB format is not a real FourCC as defined by drm_fourcc.h, so we
|
||||
* must not leak it out to clients.
|
||||
*/
|
||||
if (fourcc_formats[i] == __DRI_IMAGE_FOURCC_SARGB8888)
|
||||
continue;
|
||||
|
||||
if (pscreen->is_format_supported(pscreen,
|
||||
fourcc_to_pipe_format(
|
||||
fourcc_formats[i]),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue