radeonsi: initialise imported surface to 0.
authorDave Airlie <airlied@redhat.com>
Mon, 14 Aug 2017 06:01:54 +0000 (07:01 +0100)
committerDave Airlie <airlied@redhat.com>
Tue, 15 Aug 2017 00:35:58 +0000 (01:35 +0100)
For memobj imports we weren't setting the surface to 0, which
meant sometimes we'd end up with tile_swizzle garbage, which
would corrupt rendering.

This seems to fix the image corruption on the imported memory
objects in vrdashboard for me.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/radeon/r600_texture.c

index 176896f86c13164a03e1d5deae65082f2ea4e4f6..deedfaff3666feb8feb5c2f72c8c7046032e1aa0 100644 (file)
@@ -2913,7 +2913,7 @@ r600_texture_from_memobj(struct pipe_screen *screen,
        struct r600_common_screen *rscreen = (struct r600_common_screen*)screen;
        struct r600_memory_object *memobj = (struct r600_memory_object *)_memobj;
        struct r600_texture *rtex;
-       struct radeon_surf surface;
+       struct radeon_surf surface = {};
        struct radeon_bo_metadata metadata = {};
        enum radeon_surf_mode array_mode;
        bool is_scanout;