dri: Fix hardware cursor for cards without modifier support
After the breaking commit, gbm_bo_create_with_modifiers({LINEAR}) returns
a BO with gbm_bo_get_modifier() = INVALID. This restores the functionality
and fixes most notably, hardware cursors for cards without modifiers.
Fixes #12039.
Fixes: 361f362258
("dri: Unify createImage and createImageWithModifiers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31725>
This commit is contained in:
@@ -1077,22 +1077,15 @@ dri_create_image(struct dri_screen *screen,
|
|||||||
|
|
||||||
if (!pscreen->resource_create_with_modifiers && count > 0) {
|
if (!pscreen->resource_create_with_modifiers && count > 0) {
|
||||||
bool invalid_ok = false;
|
bool invalid_ok = false;
|
||||||
bool linear_ok = false;
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < _count; i++) {
|
for (unsigned i = 0; i < _count; i++) {
|
||||||
if (modifiers[i] == DRM_FORMAT_MOD_LINEAR)
|
if (modifiers[i] == DRM_FORMAT_MOD_INVALID)
|
||||||
linear_ok = true;
|
|
||||||
else if (modifiers[i] == DRM_FORMAT_MOD_INVALID)
|
|
||||||
invalid_ok = true;
|
invalid_ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invalid_ok) {
|
if (invalid_ok) {
|
||||||
count = 0;
|
count = 0;
|
||||||
modifiers = NULL;
|
modifiers = NULL;
|
||||||
} else if (linear_ok) {
|
|
||||||
count = 0;
|
|
||||||
modifiers = NULL;
|
|
||||||
use |= __DRI_IMAGE_USE_LINEAR;
|
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user