From f6f8a19092027ab0248e216997a5529565ce2e12 Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Tue, 12 May 2020 21:56:53 -0400 Subject: [PATCH] freedreno/a6xx: split up gmem/tile alignment requirements RB_BLIT has a granularity of 16x4, but tile sizes must be 32x16 aligned. Signed-off-by: Jonathan Marek Part-of: --- src/gallium/drivers/freedreno/freedreno_gmem.c | 6 +++--- src/gallium/drivers/freedreno/freedreno_screen.c | 14 ++++++++------ src/gallium/drivers/freedreno/freedreno_screen.h | 3 ++- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c index bbffda66e47..b3ef0978f9e 100644 --- a/src/gallium/drivers/freedreno/freedreno_gmem.c +++ b/src/gallium/drivers/freedreno/freedreno_gmem.c @@ -184,8 +184,8 @@ layout_gmem(struct gmem_key *key, uint32_t nbins_x, uint32_t nbins_y, return false; uint32_t bin_w, bin_h; - bin_w = div_align(key->width, nbins_x, screen->gmem_alignw); - bin_h = div_align(key->height, nbins_y, screen->gmem_alignh); + bin_w = div_align(key->width, nbins_x, screen->tile_alignw); + bin_h = div_align(key->height, nbins_y, screen->tile_alignh); gmem->bin_w = bin_w; gmem->bin_h = bin_h; @@ -244,7 +244,7 @@ gmem_stateobj_init(struct fd_screen *screen, struct gmem_key *key) /* first, find a bin width that satisfies the maximum width * restrictions: */ - while (div_align(key->width, nbins_x, screen->gmem_alignw) > max_width) { + while (div_align(key->width, nbins_x, screen->tile_alignw) > max_width) { nbins_x++; } diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index d19f6483e5f..d2ad24fb7c0 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -944,16 +944,18 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro) } if (screen->gpu_id >= 600) { - screen->gmem_alignw = 32; - screen->gmem_alignh = 32; + screen->gmem_alignw = 16; + screen->gmem_alignh = 4; + screen->tile_alignw = 32; + screen->tile_alignh = 32; screen->num_vsc_pipes = 32; } else if (screen->gpu_id >= 500) { - screen->gmem_alignw = 64; - screen->gmem_alignh = 32; + screen->gmem_alignw = screen->tile_alignw = 64; + screen->gmem_alignh = screen->tile_alignh = 32; screen->num_vsc_pipes = 16; } else { - screen->gmem_alignw = 32; - screen->gmem_alignh = 32; + screen->gmem_alignw = screen->tile_alignw = 32; + screen->gmem_alignh = screen->tile_alignh = 32; screen->num_vsc_pipes = 8; } diff --git a/src/gallium/drivers/freedreno/freedreno_screen.h b/src/gallium/drivers/freedreno/freedreno_screen.h index d6bd17daffc..13e48dd5d3d 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.h +++ b/src/gallium/drivers/freedreno/freedreno_screen.h @@ -70,7 +70,8 @@ struct fd_screen { uint32_t max_freq; uint32_t ram_size; uint32_t max_rts; /* max # of render targets */ - uint32_t gmem_alignw, gmem_alignh; + uint32_t gmem_alignw, gmem_alignh; /* gmem load/store granularity */ + uint32_t tile_alignw, tile_alignh; /* alignment for tile sizes */ uint32_t num_vsc_pipes; uint32_t priority_mask; bool has_timestamp; -- 2.30.2