etnaviv: rs: Change param etna_get_rs_alignment_mask(..)

This prepares etna_get_rs_alignment_mask(..) for the next commit.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33226>
This commit is contained in:
Christian Gmeiner 2025-03-15 14:25:01 +01:00 committed by Marge Bot
parent 98b9cc6d5a
commit 2c3e0b5ac2
3 changed files with 7 additions and 8 deletions

View file

@ -610,11 +610,10 @@ etna_compute_tileoffset(const struct pipe_box *box, enum pipe_format format,
}
static inline void
etna_get_rs_alignment_mask(const struct etna_context *ctx,
etna_get_rs_alignment_mask(const struct etna_screen *screen,
const enum etna_surface_layout layout,
unsigned int *width_mask, unsigned int *height_mask)
{
struct etna_screen *screen = ctx->screen;
unsigned int h_align, w_align;
if (layout & ETNA_LAYOUT_BIT_SUPER) {
@ -713,7 +712,7 @@ etna_try_rs_blit(struct pipe_context *pctx,
unsigned w_mask, h_mask;
etna_get_rs_alignment_mask(ctx, src->layout, &w_mask, &h_mask);
etna_get_rs_alignment_mask(ctx->screen, src->layout, &w_mask, &h_mask);
if ((blit_info->src.box.x & w_mask) || (blit_info->src.box.y & h_mask)) {
DBG("src x/y not properly aligned: %d %d",
blit_info->src.box.x,
@ -721,7 +720,7 @@ etna_try_rs_blit(struct pipe_context *pctx,
return false;
}
etna_get_rs_alignment_mask(ctx, dst->layout, &w_mask, &h_mask);
etna_get_rs_alignment_mask(ctx->screen, dst->layout, &w_mask, &h_mask);
if ((blit_info->dst.box.x & w_mask) || (blit_info->dst.box.y & h_mask)) {
DBG("dst x/y not properly aligned: %d %d",
blit_info->src.box.x,
@ -906,13 +905,13 @@ manual:
}
void
etna_align_box_for_rs(const struct etna_context *ctx,
etna_align_box_for_rs(const struct etna_screen *screen,
const struct etna_resource *rsc,
struct pipe_box *box)
{
unsigned w_align, h_align;
etna_get_rs_alignment_mask(ctx, rsc->layout, &w_align, &h_align);
etna_get_rs_alignment_mask(screen, rsc->layout, &w_align, &h_align);
box->width += box->x & w_align;
box->x = box->x & ~w_align;

View file

@ -88,7 +88,7 @@ etna_compile_rs_state(struct etna_context *ctx, struct compiled_rs_state *cs,
const struct rs_state *rs);
void
etna_align_box_for_rs(const struct etna_context *ctx,
etna_align_box_for_rs(const struct etna_screen *screen,
const struct etna_resource *rsc,
struct pipe_box *box);

View file

@ -298,7 +298,7 @@ etna_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc,
/* Need to align the transfer region to satisfy RS restrictions, as we
* really want to hit the RS blit path here.
*/
etna_align_box_for_rs(ctx, rsc, &ptrans->box);
etna_align_box_for_rs(ctx->screen, rsc, &ptrans->box);
}
if ((usage & PIPE_MAP_READ) || !(usage & ETNA_PIPE_MAP_DISCARD_LEVEL))