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:

committed by
Marge Bot

parent
8364f2e571
commit
9ec286b037
@@ -932,7 +932,7 @@ gbm_dri_bo_create(struct gbm_device *gbm,
|
|||||||
|
|
||||||
/* If the driver supports fixed-rate compression, filter the acceptable
|
/* If the driver supports fixed-rate compression, filter the acceptable
|
||||||
* modifiers by the compression rate. */
|
* modifiers by the compression rate. */
|
||||||
if (modifiers && dri->image->queryCompressionModifiers) {
|
if (modifiers && dri->has_compression_modifiers) {
|
||||||
enum __DRIFixedRateCompression comp = __DRI_FIXED_RATE_COMPRESSION_NONE;
|
enum __DRIFixedRateCompression comp = __DRI_FIXED_RATE_COMPRESSION_NONE;
|
||||||
|
|
||||||
switch (usage & GBM_BO_FIXED_COMPRESSION_MASK) {
|
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)
|
if (pscreen->get_param(pscreen, PIPE_CAP_DMABUF) & DRM_PRIME_CAP_IMPORT)
|
||||||
dri->has_dmabuf_import = true;
|
dri->has_dmabuf_import = true;
|
||||||
#endif
|
#endif
|
||||||
|
dri->has_compression_modifiers = pscreen->query_compression_rates &&
|
||||||
|
pscreen->query_compression_modifiers;
|
||||||
|
|
||||||
return &dri->base;
|
return &dri->base;
|
||||||
|
|
||||||
|
@@ -53,6 +53,7 @@ struct gbm_dri_device {
|
|||||||
bool software; /* A software driver was loaded */
|
bool software; /* A software driver was loaded */
|
||||||
bool swrast; /* this is swrast */
|
bool swrast; /* this is swrast */
|
||||||
bool has_dmabuf_import;
|
bool has_dmabuf_import;
|
||||||
|
bool has_compression_modifiers;
|
||||||
|
|
||||||
__DRIscreen *screen;
|
__DRIscreen *screen;
|
||||||
__DRIcontext *context;
|
__DRIcontext *context;
|
||||||
|
Reference in New Issue
Block a user