diff --git a/src/broadcom/ci/broadcom-rpi4-fails.txt b/src/broadcom/ci/broadcom-rpi4-fails.txt index 51ef5be10aa..f257490eceb 100644 --- a/src/broadcom/ci/broadcom-rpi4-fails.txt +++ b/src/broadcom/ci/broadcom-rpi4-fails.txt @@ -198,7 +198,6 @@ spec@ext_framebuffer_object@getteximage-formats init-by-clear-and-render,Fail spec@ext_framebuffer_object@getteximage-formats init-by-rendering,Fail spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers,Fail spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers@autogen-R16-DRM_FORMAT_MOD_LINEAR-clear_reimport,Fail -spec@ext_image_dma_buf_import@ext_image_dma_buf_import-tex-modifier,Crash spec@ext_packed_depth_stencil@texwrap formats bordercolor,Fail spec@ext_packed_depth_stencil@texwrap formats bordercolor-swizzled,Fail spec@ext_packed_depth_stencil@texwrap formats bordercolor-swizzled@GL_DEPTH24_STENCIL8- swizzled- border color only,Fail diff --git a/src/broadcom/ci/broadcom-rpi5-fails.txt b/src/broadcom/ci/broadcom-rpi5-fails.txt index 0d1b7f70fda..c79e2028dc2 100644 --- a/src/broadcom/ci/broadcom-rpi5-fails.txt +++ b/src/broadcom/ci/broadcom-rpi5-fails.txt @@ -184,7 +184,6 @@ spec@ext_framebuffer_object@getteximage-formats init-by-clear-and-render,Fail spec@ext_framebuffer_object@getteximage-formats init-by-rendering,Fail spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers,Fail spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers@autogen-R16-DRM_FORMAT_MOD_LINEAR-clear_reimport,Fail -spec@ext_image_dma_buf_import@ext_image_dma_buf_import-tex-modifier,Crash spec@ext_packed_depth_stencil@texwrap formats bordercolor,Fail spec@ext_packed_depth_stencil@texwrap formats bordercolor-swizzled,Fail spec@ext_packed_depth_stencil@texwrap formats bordercolor-swizzled@GL_DEPTH24_STENCIL8- swizzled- border color only,Fail diff --git a/src/gallium/drivers/v3d/v3d_resource.c b/src/gallium/drivers/v3d/v3d_resource.c index cbffde0ea4b..33ad83ba3a1 100644 --- a/src/gallium/drivers/v3d/v3d_resource.c +++ b/src/gallium/drivers/v3d/v3d_resource.c @@ -1164,11 +1164,61 @@ v3d_surface_destroy(struct pipe_context *pctx, struct pipe_surface *psurf) } static void -v3d_flush_resource(struct pipe_context *pctx, struct pipe_resource *resource) +v3d_flush_resource(struct pipe_context *pctx, struct pipe_resource *prsc) { /* All calls to flush_resource are followed by a flush of the context, - * so there's nothing to do. + * so there's nothing to do. Still, if the resource is going to be + * shared and it is tiled, only UIF format is valid, so we need to + * convert it. */ + struct v3d_resource *rsc = v3d_resource(prsc); + if (rsc->tiled && + rsc->slices[0].tiling != V3D_TILING_UIF_XOR && + rsc->slices[0].tiling != V3D_TILING_UIF_NO_XOR) { + /* Shared resources must be not mipmapped */ + assert(prsc->last_level == 0); + /* Shared resources must not be multisampled */ + assert(prsc->nr_samples <= 1); + + struct pipe_resource ptmpl = *prsc; + ptmpl.bind |= PIPE_BIND_SHARED; + struct v3d_resource *new_rsc = + v3d_resource(pctx->screen->resource_create(pctx->screen, &ptmpl)); + assert(new_rsc); + + struct pipe_blit_info blit = { 0 }; + u_box_3d(0, 0, 0, + prsc->width0, prsc->height0, prsc->depth0, + &blit.dst.box); + blit.src.box = blit.dst.box; + blit.dst.resource = &new_rsc->base; + blit.dst.format = new_rsc->base.format; + blit.dst.level = 0; + blit.src.resource = prsc; + blit.src.format = prsc->format; + blit.src.level = 0 ; + blit.mask = util_format_get_mask(blit.src.format); + blit.filter = PIPE_TEX_FILTER_NEAREST; + + v3d_blit(pctx, &blit); + + rsc->base.bind = new_rsc->base.bind; + /* Swap the BOs */ + struct v3d_bo *old_bo = rsc->bo; + rsc->bo = new_rsc->bo; + rsc->serial_id++; + new_rsc->bo = old_bo; + + /* Copy the affected fields */ + rsc->slices[0] = new_rsc->slices[0]; + rsc->cube_map_stride = new_rsc->cube_map_stride; + rsc->sand_col128_stride = new_rsc->sand_col128_stride; + rsc->size = new_rsc->size; + rsc->tiled = new_rsc->tiled; + + struct pipe_resource *new_prsc = (struct pipe_resource *)&new_rsc; + pipe_resource_reference(&new_prsc, NULL); + } } static enum pipe_format