freedreno: handle PIPE_TRANSFER_MAP_DIRECTLY
authorRob Clark <robdclark@chromium.org>
Sat, 23 May 2020 17:56:56 +0000 (10:56 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 26 May 2020 19:14:22 +0000 (19:14 +0000)
Just something I noticed in the process of debugging the issue fixed in
the previous commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5188>

src/gallium/drivers/freedreno/freedreno_resource.c

index 93738e20f74c3c7cabbc7e9562c5ca56c67016d7..f7111a499e7b682a38e2c3427f42974197098728 100644 (file)
@@ -569,6 +569,11 @@ fd_resource_transfer_map(struct pipe_context *pctx,
        DBG("prsc=%p, level=%u, usage=%x, box=%dx%d+%d,%d", prsc, level, usage,
                box->width, box->height, box->x, box->y);
 
        DBG("prsc=%p, level=%u, usage=%x, box=%dx%d+%d,%d", prsc, level, usage,
                box->width, box->height, box->x, box->y);
 
+       if ((usage & PIPE_TRANSFER_MAP_DIRECTLY) && rsc->layout.tile_mode) {
+               DBG("CANNOT MAP DIRECTLY!\n");
+               return NULL;
+       }
+
        ptrans = slab_alloc(&ctx->transfer_pool);
        if (!ptrans)
                return NULL;
        ptrans = slab_alloc(&ctx->transfer_pool);
        if (!ptrans)
                return NULL;