v3d: remove old tile blit code
This code was a direct copy from VC4, and it was disabled, as it did not work. Now that we have an implementation, let's remove it. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7816>
This commit is contained in:

committed by
Marge Bot

parent
1c76f6e755
commit
7ad7decc27
@@ -27,143 +27,6 @@
|
||||
#include "v3d_context.h"
|
||||
#include "v3d_tiling.h"
|
||||
|
||||
#if 0
|
||||
static struct pipe_surface *
|
||||
v3d_get_blit_surface(struct pipe_context *pctx,
|
||||
struct pipe_resource *prsc, unsigned level)
|
||||
{
|
||||
struct pipe_surface tmpl;
|
||||
|
||||
memset(&tmpl, 0, sizeof(tmpl));
|
||||
tmpl.format = prsc->format;
|
||||
tmpl.u.tex.level = level;
|
||||
tmpl.u.tex.first_layer = 0;
|
||||
tmpl.u.tex.last_layer = 0;
|
||||
|
||||
return pctx->create_surface(pctx, prsc, &tmpl);
|
||||
}
|
||||
|
||||
static bool
|
||||
is_tile_unaligned(unsigned size, unsigned tile_size)
|
||||
{
|
||||
return size & (tile_size - 1);
|
||||
}
|
||||
|
||||
static bool
|
||||
v3d_tile_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
|
||||
{
|
||||
struct v3d_context *v3d = v3d_context(pctx);
|
||||
bool msaa = (info->src.resource->nr_samples > 1 ||
|
||||
info->dst.resource->nr_samples > 1);
|
||||
int tile_width = msaa ? 32 : 64;
|
||||
int tile_height = msaa ? 32 : 64;
|
||||
|
||||
if (util_format_is_depth_or_stencil(info->dst.resource->format))
|
||||
return false;
|
||||
|
||||
if (info->scissor_enable)
|
||||
return false;
|
||||
|
||||
if ((info->mask & PIPE_MASK_RGBA) == 0)
|
||||
return false;
|
||||
|
||||
if (info->dst.box.x != info->src.box.x ||
|
||||
info->dst.box.y != info->src.box.y ||
|
||||
info->dst.box.width != info->src.box.width ||
|
||||
info->dst.box.height != info->src.box.height) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int dst_surface_width = u_minify(info->dst.resource->width0,
|
||||
info->dst.level);
|
||||
int dst_surface_height = u_minify(info->dst.resource->height0,
|
||||
info->dst.level);
|
||||
if (is_tile_unaligned(info->dst.box.x, tile_width) ||
|
||||
is_tile_unaligned(info->dst.box.y, tile_height) ||
|
||||
(is_tile_unaligned(info->dst.box.width, tile_width) &&
|
||||
info->dst.box.x + info->dst.box.width != dst_surface_width) ||
|
||||
(is_tile_unaligned(info->dst.box.height, tile_height) &&
|
||||
info->dst.box.y + info->dst.box.height != dst_surface_height)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* VC5_PACKET_LOAD_TILE_BUFFER_GENERAL uses the
|
||||
* VC5_PACKET_TILE_RENDERING_MODE_CONFIG's width (determined by our
|
||||
* destination surface) to determine the stride. This may be wrong
|
||||
* when reading from texture miplevels > 0, which are stored in
|
||||
* POT-sized areas. For MSAA, the tile addresses are computed
|
||||
* explicitly by the RCL, but still use the destination width to
|
||||
* determine the stride (which could be fixed by explicitly supplying
|
||||
* it in the ABI).
|
||||
*/
|
||||
struct v3d_resource *rsc = v3d_resource(info->src.resource);
|
||||
|
||||
uint32_t stride;
|
||||
|
||||
if (info->src.resource->nr_samples > 1)
|
||||
stride = align(dst_surface_width, 32) * 4 * rsc->cpp;
|
||||
/* XXX else if (rsc->slices[info->src.level].tiling == VC5_TILING_FORMAT_T)
|
||||
stride = align(dst_surface_width * rsc->cpp, 128); */
|
||||
else
|
||||
stride = align(dst_surface_width * rsc->cpp, 16);
|
||||
|
||||
if (stride != rsc->slices[info->src.level].stride)
|
||||
return false;
|
||||
|
||||
if (info->dst.resource->format != info->src.resource->format)
|
||||
return false;
|
||||
|
||||
if (false) {
|
||||
fprintf(stderr, "RCL blit from %d,%d to %d,%d (%d,%d)\n",
|
||||
info->src.box.x,
|
||||
info->src.box.y,
|
||||
info->dst.box.x,
|
||||
info->dst.box.y,
|
||||
info->dst.box.width,
|
||||
info->dst.box.height);
|
||||
}
|
||||
|
||||
struct pipe_surface *dst_surf =
|
||||
v3d_get_blit_surface(pctx, info->dst.resource, info->dst.level);
|
||||
struct pipe_surface *src_surf =
|
||||
v3d_get_blit_surface(pctx, info->src.resource, info->src.level);
|
||||
|
||||
v3d_flush_jobs_reading_resource(v3d, info->src.resource, false);
|
||||
|
||||
struct v3d_job *job = v3d_get_job(v3d, dst_surf, NULL);
|
||||
pipe_surface_reference(&job->color_read, src_surf);
|
||||
|
||||
/* If we're resolving from MSAA to single sample, we still need to run
|
||||
* the engine in MSAA mode for the load.
|
||||
*/
|
||||
if (!job->msaa && info->src.resource->nr_samples > 1) {
|
||||
job->msaa = true;
|
||||
job->tile_width = 32;
|
||||
job->tile_height = 32;
|
||||
}
|
||||
|
||||
job->draw_min_x = info->dst.box.x;
|
||||
job->draw_min_y = info->dst.box.y;
|
||||
job->draw_max_x = info->dst.box.x + info->dst.box.width;
|
||||
job->draw_max_y = info->dst.box.y + info->dst.box.height;
|
||||
job->draw_width = dst_surf->width;
|
||||
job->draw_height = dst_surf->height;
|
||||
|
||||
job->tile_width = tile_width;
|
||||
job->tile_height = tile_height;
|
||||
job->msaa = msaa;
|
||||
job->needs_flush = true;
|
||||
job->resolve |= PIPE_CLEAR_COLOR;
|
||||
|
||||
v3d_job_submit(v3d, job);
|
||||
|
||||
pipe_surface_reference(&dst_surf, NULL);
|
||||
pipe_surface_reference(&src_surf, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
v3d_blitter_save(struct v3d_context *v3d)
|
||||
{
|
||||
|
Reference in New Issue
Block a user