pan/crc: Introduce pan_fb_is_fully_covered()

Add function to retrieve whether the area of a pan_fb_info data
structure is fully covered by the draw extent.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This commit is contained in:
Loïc Molinari 2026-02-10 10:27:34 +01:00
parent b965adc60f
commit 7fe62246dd
3 changed files with 12 additions and 9 deletions

View file

@ -1197,9 +1197,7 @@ pan_preload_emit_pre_frame_dcd(struct pan_fb_preload_cache *cache,
* write even clean tiles to make sure CRC data is updated. */
if (crc_rt >= 0) {
bool *valid = fb->rts[crc_rt].crc_valid;
bool full = !fb->draw_extent.minx && !fb->draw_extent.miny &&
fb->draw_extent.maxx == (fb->width - 1) &&
fb->draw_extent.maxy == (fb->height - 1);
bool full = pan_fb_is_fully_covered(fb);
if (full && !(*valid))
always_write = true;

View file

@ -140,9 +140,7 @@ GENX(pan_select_crc_rt)(const struct pan_fb_info *fb, unsigned tile_size)
continue;
bool valid = *(fb->rts[i].crc_valid);
bool full = !fb->draw_extent.minx && !fb->draw_extent.miny &&
fb->draw_extent.maxx == (fb->width - 1) &&
fb->draw_extent.maxy == (fb->height - 1);
bool full = pan_fb_is_fully_covered(fb);
if (!full && !valid)
continue;
@ -1256,9 +1254,7 @@ GENX(pan_emit_fbd)(const struct pan_fb_info *fb, unsigned layer_idx,
if (crc_rt >= 0) {
bool *valid = fb->rts[crc_rt].crc_valid;
bool full = !fb->draw_extent.minx && !fb->draw_extent.miny &&
fb->draw_extent.maxx == (fb->width - 1) &&
fb->draw_extent.maxy == (fb->height - 1);
bool full = pan_fb_is_fully_covered(fb);
/* If the CRC was valid it stays valid, if it wasn't, we must ensure
* the render operation covers the full frame, and clean tiles are

View file

@ -162,6 +162,15 @@ struct pan_clean_tile {
uint8_t write_zs : 1;
};
static inline bool
pan_fb_is_fully_covered(const struct pan_fb_info *fb)
{
return !fb->draw_extent.minx &&
!fb->draw_extent.miny &&
fb->draw_extent.maxx == (fb->width - 1) &&
fb->draw_extent.maxy == (fb->height - 1);
}
static inline bool
pan_clean_tile_write_rt_enabled(struct pan_clean_tile clean_tile,
unsigned index)