summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Jones <jajones@nvidia.com>2020-01-30 21:18:41 -0800
committerMarge Bot <eric+marge@anholt.net>2021-02-17 03:52:53 +0000
commitdf451091ac96c09d726379384fa14dea5db2d5b5 (patch)
tree394d170381b89d0bca4778d408710fe78e87d3b7
parentcf999b3cc3dd4e38b5a6938eb85417abfc10227d (diff)
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 <jajones@nvidia.com> Tested-by: Karol Herbst <kherbst@redhat.com> Tested-by: Simon Ser <contact@emersion.fr> Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3724>
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_resource.c4
1 files changed, 1 insertions, 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);
}
}