drm/vmwgfx: stop setting multiple domain flags
authorChristian König <christian.koenig@amd.com>
Tue, 8 Sep 2020 14:55:55 +0000 (16:55 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 11 Sep 2020 11:31:23 +0000 (13:31 +0200)
Setting more than one placement flag is illegal.
Fix this by using the current flags.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/389824/?series=81551&rev=1
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c

index 3229451..03f5660 100644 (file)
@@ -354,10 +354,11 @@ void vmw_bo_pin_reserved(struct vmw_buffer_object *vbo, bool pin)
 
        pl.fpfn = 0;
        pl.lpfn = 0;
-       pl.flags = TTM_PL_FLAG_VRAM | VMW_PL_FLAG_GMR | VMW_PL_FLAG_MOB
-               | TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED;
+       pl.flags = bo->mem.placement;
        if (pin)
                pl.flags |= TTM_PL_FLAG_NO_EVICT;
+       else
+               pl.flags &= ~TTM_PL_FLAG_NO_EVICT;
 
        memset(&placement, 0, sizeof(placement));
        placement.num_placement = 1;