Module: Mesa
Branch: master
Commit: df451091ac96c09d726379384fa14dea5db2d5b5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=df451091ac96c09d726379384fa14dea5db2d5b5

Author: James Jones <[email protected]>
Date:   Thu Jan 30 21:18:41 2020 -0800

nouveau: no modifier != the invalid modifier

Other drivers fail resource allocation when a list of modifiers for the
resource is provided but none are supported. This includes cases when the
never-supported DRM_FORMAT_MOD_INVALID modifier is explicitly passed.  To
enable matching that functionality in nouveau, use an empty modifier list
rather than creating a one-entry list containing only
DRM_FORMAT_MOD_INVALID when the non-modifier resource creation function is
used.

This change stops short of failing allocations when no modifier is
specified, because the current code ignores all modifiers except the linear
modifier when creating resources, so there is not yet a framework in place
to determine which modifiers are valid for a given resource creation
request, and hence no way to reject only those which are invalid.

Signed-off-by: James Jones <[email protected]>
Tested-by: Karol Herbst <[email protected]>
Tested-by: Simon Ser <[email protected]>
Reviewed-by: Karol Herbst <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3724>

---

 src/gallium/drivers/nouveau/nvc0/nvc0_resource.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
index bd22c9c8f09..b22bc41f82e 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
@@ -9,13 +9,11 @@ static struct pipe_resource *
 nvc0_resource_create(struct pipe_screen *screen,
                      const struct pipe_resource *templ)
 {
-   const uint64_t modifier = DRM_FORMAT_MOD_INVALID;
-
    switch (templ->target) {
    case PIPE_BUFFER:
       return nouveau_buffer_create(screen, templ);
    default:
-      return nvc0_miptree_create(screen, templ, &modifier, 1);
+      return nvc0_miptree_create(screen, templ, NULL, 0);
    }
 }
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to