panfrost: Reduce pan_image_state indirection

In actuality, this just shadows the crc_valid for pan_cs... the
data_valid checks are contained in the caller and just add noise.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
This commit is contained in:
Alyssa Rosenzweig
2021-06-08 20:27:52 -04:00
committed by Marge Bot
parent d181218238
commit f652c61283
4 changed files with 11 additions and 17 deletions
+2 -4
View File
@@ -657,14 +657,14 @@ panfrost_batch_to_fb_info(const struct panfrost_batch *batch,
rts[i].image = &prsrc->image;
rts[i].nr_samples = surf->nr_samples ? : MAX2(surf->texture->nr_samples, 1);
memcpy(rts[i].swizzle, id_swz, sizeof(rts[i].swizzle));
fb->rts[i].state = &prsrc->state;
fb->rts[i].crc_valid = &prsrc->state.crc_valid;
fb->rts[i].view = &rts[i];
/* Preload if the RT is read or updated */
if (!(batch->clear & mask) &&
((batch->read & mask) ||
((batch->draws & mask) &&
fb->rts[i].state->slices[fb->rts[i].view->first_level].data_valid)))
prsrc->state.slices[fb->rts[i].view->first_level].data_valid)))
fb->rts[i].preload = true;
}
@@ -686,7 +686,6 @@ panfrost_batch_to_fb_info(const struct panfrost_batch *batch,
zs->nr_samples = surf->nr_samples ? : MAX2(surf->texture->nr_samples, 1);
memcpy(zs->swizzle, id_swz, sizeof(zs->swizzle));
fb->zs.view.zs = zs;
fb->zs.state.zs = &prsrc->state;
z_view = zs;
z_state = &prsrc->state;
if (util_format_is_depth_and_stencil(zs->format)) {
@@ -704,7 +703,6 @@ panfrost_batch_to_fb_info(const struct panfrost_batch *batch,
s->nr_samples = surf->nr_samples ? : MAX2(surf->texture->nr_samples, 1);
memcpy(s->swizzle, id_swz, sizeof(s->swizzle));
fb->zs.view.s = s;
fb->zs.state.s = &prsrc->separate_stencil->state;
s_view = s;
s_state = &prsrc->separate_stencil->state;
}
+2 -2
View File
@@ -1248,12 +1248,12 @@ pan_preload_emit_bifrost_pre_frame_dcd(struct pan_pool *desc_pool,
/* If CRC data is currently invalid and this batch will make it valid,
* write even clean tiles to make sure CRC data is updated. */
if (crc_rt >= 0) {
bool valid = fb->rts[crc_rt].state->crc_valid;
bool *valid = fb->rts[crc_rt].crc_valid;
bool full = !fb->extent.minx && !fb->extent.miny &&
fb->extent.maxx == (fb->width - 1) &&
fb->extent.maxy == (fb->height - 1);
if (full && !valid)
if (full && !(*valid))
always_write = true;
}
+6 -6
View File
@@ -331,7 +331,7 @@ pan_select_crc_rt(const struct panfrost_device *dev, const struct pan_fb_info *f
fb->rts[i].view->image->layout.crc_mode == PAN_IMAGE_CRC_NONE)
continue;
bool valid = fb->rts[i].state->crc_valid;
bool valid = *(fb->rts[i].crc_valid);
bool full = !fb->extent.minx && !fb->extent.miny &&
fb->extent.maxx == (fb->width - 1) &&
fb->extent.maxy == (fb->height - 1);
@@ -720,19 +720,19 @@ pan_emit_mfbd(const struct panfrost_device *dev,
cfg.has_zs_crc_extension = has_zs_crc_ext;
if (crc_rt >= 0) {
bool valid = fb->rts[crc_rt].state->crc_valid;
bool *valid = fb->rts[crc_rt].crc_valid;
bool full = !fb->extent.minx && !fb->extent.miny &&
fb->extent.maxx == (fb->width - 1) &&
fb->extent.maxy == (fb->height - 1);
cfg.crc_read_enable = valid;
cfg.crc_read_enable = *valid;
/* If the data is currently invalid, still write CRC
* data if we are doing a full write, so that it is
* valid for next time. */
cfg.crc_write_enable = valid || full;
cfg.crc_write_enable = *valid || full;
fb->rts[crc_rt].state->crc_valid = full;
*valid = full;
}
}
@@ -760,7 +760,7 @@ pan_emit_mfbd(const struct panfrost_device *dev,
tile_size * fb->rts[i].view->image->layout.nr_samples;
if (i != crc_rt)
fb->rts[i].state->crc_valid = false;
*(fb->rts[i].crc_valid) = false;
}
tags |= MALI_POSITIVE(MAX2(fb->rt_count, 1)) << 2;
+1 -5
View File
@@ -36,7 +36,7 @@ struct pan_compute_dim {
struct pan_fb_color_attachment {
const struct pan_image_view *view;
struct pan_image_state *state;
bool *crc_valid;
bool clear;
bool preload;
bool discard;
@@ -48,10 +48,6 @@ struct pan_fb_zs_attachment {
const struct pan_image_view *zs, *s;
} view;
struct {
struct pan_image_state *zs, *s;
} state;
struct {
bool z, s;
} clear;