mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
i965/screen: Return false for unsupported formats in query_modifiers
Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
parent
eeae485149
commit
a266934935
1 changed files with 14 additions and 2 deletions
|
|
@ -1262,6 +1262,16 @@ intel_create_image_from_dma_bufs(__DRIscreen *dri_screen,
|
||||||
loaderPrivate);
|
loaderPrivate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
intel_image_format_is_supported(const struct intel_image_format *fmt)
|
||||||
|
{
|
||||||
|
if (fmt->fourcc == __DRI_IMAGE_FOURCC_SARGB8888 ||
|
||||||
|
fmt->fourcc == __DRI_IMAGE_FOURCC_SABGR8888)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static GLboolean
|
static GLboolean
|
||||||
intel_query_dma_buf_formats(__DRIscreen *screen, int max,
|
intel_query_dma_buf_formats(__DRIscreen *screen, int max,
|
||||||
int *formats, int *count)
|
int *formats, int *count)
|
||||||
|
|
@ -1269,8 +1279,7 @@ intel_query_dma_buf_formats(__DRIscreen *screen, int max,
|
||||||
int num_formats = 0, i;
|
int num_formats = 0, i;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(intel_image_formats); i++) {
|
for (i = 0; i < ARRAY_SIZE(intel_image_formats); i++) {
|
||||||
if (intel_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SARGB8888 ||
|
if (!intel_image_format_is_supported(&intel_image_formats[i]))
|
||||||
intel_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SABGR8888)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
num_formats++;
|
num_formats++;
|
||||||
|
|
@ -1300,6 +1309,9 @@ intel_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!intel_image_format_is_supported(f))
|
||||||
|
return false;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(supported_modifiers); i++) {
|
for (i = 0; i < ARRAY_SIZE(supported_modifiers); i++) {
|
||||||
uint64_t modifier = supported_modifiers[i].modifier;
|
uint64_t modifier = supported_modifiers[i].modifier;
|
||||||
if (!modifier_is_supported(&screen->devinfo, f, 0, modifier))
|
if (!modifier_is_supported(&screen->devinfo, f, 0, modifier))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue