From df451091ac96c09d726379384fa14dea5db2d5b5 Mon Sep 17 00:00:00 2001 From: James Jones Date: Thu, 30 Jan 2020 21:18:41 -0800 Subject: [PATCH] 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 Tested-by: Karol Herbst Tested-by: Simon Ser Reviewed-by: Karol Herbst Reviewed-by: Ilia Mirkin Part-of: --- 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 bd22c9c..b22bc41 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); } } -- 2.7.4