From e791098f2ef0dd3bcf0e67c6da3c96e6fe3ca670 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 9 Jan 2025 22:45:34 -0700 Subject: [PATCH] svga: add svga_resource_create_with_modifiers() function The dri_create_image() function returns early if the gallium driver does not implement this function. Surface creation has been broken for some time up to this fix. Signed-off-by: Brian Paul Reviewed-by: Neha Bhende Reviewed-by: Neha Bhende (cherry picked from commit b13e2a495e9e3da56add7d852ca01b2cd7eef52d) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/svga/svga_resource.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 5298c6c408a..3664ceafff6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2134,7 +2134,7 @@ "description": "svga: add svga_resource_create_with_modifiers() function", "nominated": false, "nomination_type": 0, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/svga/svga_resource.c b/src/gallium/drivers/svga/svga_resource.c index 80a4311854e..1775b65fab1 100644 --- a/src/gallium/drivers/svga/svga_resource.c +++ b/src/gallium/drivers/svga/svga_resource.c @@ -52,6 +52,22 @@ svga_resource_from_handle(struct pipe_screen * screen, } +static struct pipe_resource * +svga_resource_create_with_modifiers(struct pipe_screen *screen, + const struct pipe_resource *templat, + const uint64_t *modifiers, int count) +{ + /* Not sure, but it seems there's no format modifiers + * to deal with here. + */ + if (count > 0 && modifiers != NULL && modifiers[0] != 0) { + debug_printf("vmware: unexpected format modifier 0x%lx\n", + modifiers[0]); + } + return svga_resource_create(screen, templat); +} + + /** * Check if a resource (texture, buffer) of the given size * and format can be created. @@ -121,6 +137,7 @@ void svga_init_screen_resource_functions(struct svga_screen *is) { is->screen.resource_create = svga_resource_create; + is->screen.resource_create_with_modifiers = svga_resource_create_with_modifiers; is->screen.resource_from_handle = svga_resource_from_handle; is->screen.resource_get_handle = svga_resource_get_handle; is->screen.resource_destroy = svga_resource_destroy;