gbm: check for compression modifiers on device create

remove the last DRI_IMAGE check

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30472>
This commit is contained in:
Mike Blumenkrantz
2024-07-29 13:31:08 -04:00
committed by Marge Bot
parent 8364f2e571
commit 9ec286b037
2 changed files with 4 additions and 1 deletions

View File

@@ -932,7 +932,7 @@ gbm_dri_bo_create(struct gbm_device *gbm,
/* If the driver supports fixed-rate compression, filter the acceptable
* modifiers by the compression rate. */
if (modifiers && dri->image->queryCompressionModifiers) {
if (modifiers && dri->has_compression_modifiers) {
enum __DRIFixedRateCompression comp = __DRI_FIXED_RATE_COMPRESSION_NONE;
switch (usage & GBM_BO_FIXED_COMPRESSION_MASK) {
@@ -1244,6 +1244,8 @@ dri_device_create(int fd, uint32_t gbm_backend_version)
if (pscreen->get_param(pscreen, PIPE_CAP_DMABUF) & DRM_PRIME_CAP_IMPORT)
dri->has_dmabuf_import = true;
#endif
dri->has_compression_modifiers = pscreen->query_compression_rates &&
pscreen->query_compression_modifiers;
return &dri->base;

View File

@@ -53,6 +53,7 @@ struct gbm_dri_device {
bool software; /* A software driver was loaded */
bool swrast; /* this is swrast */
bool has_dmabuf_import;
bool has_compression_modifiers;
__DRIscreen *screen;
__DRIcontext *context;