mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
gbm: fix get_back_bo() failure with gbm_surface and implicit modifiers
Before361f362258("dri: Unify createImage and createImageWithModifiers"), gbm_surface_create_with_modifiers() would fail with ENOSYS on drivers missing explicit modifiers support. After that commit, it succeeds and fails later when it tries to allocate a new back buffer. Restore the previous behavior. Signed-off-by: Simon Ser <contact@emersion.fr> Fixes:105fcb9cfd("dri: revert INVALID modifier special-casing") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12283 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32726> (cherry picked from commit5a19323d0e)
This commit is contained in:
parent
e074dcbbbb
commit
b0a094edfa
2 changed files with 7 additions and 1 deletions
|
|
@ -34,7 +34,7 @@
|
|||
"description": "gbm: fix get_back_bo() failure with gbm_surface and implicit modifiers",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "105fcb9cfdb4fc28de99f9647ed3d370393058f0",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1078,11 +1078,17 @@ gbm_dri_surface_create(struct gbm_device *gbm,
|
|||
uint32_t format, uint32_t flags,
|
||||
const uint64_t *modifiers, const unsigned count)
|
||||
{
|
||||
struct gbm_dri_device *dri = gbm_dri_device(gbm);
|
||||
struct gbm_dri_surface *surf;
|
||||
|
||||
if (count)
|
||||
assert(modifiers);
|
||||
|
||||
if (count > 0 && !dri->screen->base.screen->resource_create_with_modifiers) {
|
||||
errno = ENOSYS;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* It's acceptable to create an image with INVALID modifier in the list,
|
||||
* but it cannot be on the only modifier (since it will certainly fail
|
||||
* later). While we could easily catch this after modifier creation, doing
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue