nouveau: treat DRM_FORMAT_INVALID as implicit modifier
Failing to allocate resources when DRM_FORMAT_INVALID is passed as a modifier breaks tegra. Change this behaviour so that this modifier is instead interpreted as a don't care, allowing for the driver to choose an appropriate modifier internally. v2: change nouveau instead of tegra (Thierry Rieding) Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6693 Fixes:129d83cac2
("nouveau: Use format modifiers in buffer allocation") Signed-off-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt> Reviewed-by: Thierry Reding <treding@nvidia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18649> (cherry picked from commit941c70a28a
)
This commit is contained in:
@@ -922,7 +922,7 @@
|
||||
"description": "nouveau: treat DRM_FORMAT_INVALID as implicit modifier",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "129d83cac2accc4a66eae50c19ac245b864dc98c"
|
||||
},
|
||||
|
@@ -423,9 +423,12 @@ nvc0_miptree_select_best_modifier(struct pipe_screen *pscreen,
|
||||
|
||||
for (i = 0u; i < count; i++) {
|
||||
for (p = 0; p < ARRAY_SIZE(prio_supported_mods); p++) {
|
||||
if (prio_supported_mods[p] == modifiers[i]) {
|
||||
if (top_mod_slot > p) top_mod_slot = p;
|
||||
break;
|
||||
if (prio_supported_mods[p] != DRM_FORMAT_MOD_INVALID) {
|
||||
if (modifiers[i] == DRM_FORMAT_MOD_INVALID ||
|
||||
prio_supported_mods[p] == modifiers[i]) {
|
||||
if (top_mod_slot > p) top_mod_slot = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user