From: Jonathan Marek Date: Wed, 13 May 2020 02:01:40 +0000 (-0400) Subject: freedreno: add adreno 650 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a6beb6a24aa084adfd6c57edd0a64f0a044611a;p=mesa.git freedreno: add adreno 650 Signed-off-by: Jonathan Marek Part-of: --- diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_context.c b/src/gallium/drivers/freedreno/a6xx/fd6_context.c index c9884e2bb6a..6ccc45ab658 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_context.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_context.c @@ -134,6 +134,13 @@ PC_UNKNOWN_9805: fd6_ctx->magic.RB_CCU_CNTL_bypass = A6XX_RB_CCU_CNTL_OFFSET(0x20000); fd6_ctx->magic.PC_UNKNOWN_9805 = 0x1; fd6_ctx->magic.SP_UNKNOWN_A0F8 = 0x1; + case 650: + fd6_ctx->magic.RB_UNKNOWN_8E04_blit = 0x04100000; + fd6_ctx->magic.RB_CCU_CNTL_gmem = A6XX_RB_CCU_CNTL_OFFSET(0x114000) | + A6XX_RB_CCU_CNTL_GMEM; + fd6_ctx->magic.RB_CCU_CNTL_bypass = A6XX_RB_CCU_CNTL_OFFSET(0x30000); + fd6_ctx->magic.PC_UNKNOWN_9805 = 0x2; + fd6_ctx->magic.SP_UNKNOWN_A0F8 = 0x2; break; default: unreachable("missing magic config"); diff --git a/src/gallium/drivers/freedreno/freedreno_gmem.c b/src/gallium/drivers/freedreno/freedreno_gmem.c index b3ef0978f9e..a289662f0de 100644 --- a/src/gallium/drivers/freedreno/freedreno_gmem.c +++ b/src/gallium/drivers/freedreno/freedreno_gmem.c @@ -169,7 +169,7 @@ static uint32_t bin_width(struct fd_screen *screen) static unsigned div_align(unsigned num, unsigned denom, unsigned al) { - return align(DIV_ROUND_UP(num, denom), al); + return util_align_npot(DIV_ROUND_UP(num, denom), al); } static bool @@ -198,18 +198,18 @@ layout_gmem(struct gmem_key *key, uint32_t nbins_x, uint32_t nbins_y, for (i = 0; i < MAX_RENDER_TARGETS; i++) { if (key->cbuf_cpp[i]) { - gmem->cbuf_base[i] = align(total, gmem_align); + gmem->cbuf_base[i] = util_align_npot(total, gmem_align); total = gmem->cbuf_base[i] + key->cbuf_cpp[i] * bin_w * bin_h; } } if (key->zsbuf_cpp[0]) { - gmem->zsbuf_base[0] = align(total, gmem_align); + gmem->zsbuf_base[0] = util_align_npot(total, gmem_align); total = gmem->zsbuf_base[0] + key->zsbuf_cpp[0] * bin_w * bin_h; } if (key->zsbuf_cpp[1]) { - gmem->zsbuf_base[1] = align(total, gmem_align); + gmem->zsbuf_base[1] = util_align_npot(total, gmem_align); total = gmem->zsbuf_base[1] + key->zsbuf_cpp[1] * bin_w * bin_h; } @@ -484,7 +484,7 @@ gmem_key_init(struct fd_batch *batch, bool assume_zs, bool no_scis_opt) */ key->gmem_page_align = 8; } else if (is_a6xx(screen)) { - key->gmem_page_align = 1; + key->gmem_page_align = is_a650(screen) ? 3 : 1; } else { // TODO re-check this across gens.. maybe it should only // be a single page in some cases: diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index d2ad24fb7c0..e1c5b81cb32 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -936,6 +936,7 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro) case 618: case 630: case 640: + case 650: fd6_screen_init(pscreen); break; default: @@ -946,7 +947,7 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro) if (screen->gpu_id >= 600) { screen->gmem_alignw = 16; screen->gmem_alignh = 4; - screen->tile_alignw = 32; + screen->tile_alignw = is_a650(screen) ? 96 : 32; screen->tile_alignh = 32; screen->num_vsc_pipes = 32; } else if (screen->gpu_id >= 500) { diff --git a/src/gallium/drivers/freedreno/freedreno_screen.h b/src/gallium/drivers/freedreno/freedreno_screen.h index 13e48dd5d3d..0337866fd9b 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.h +++ b/src/gallium/drivers/freedreno/freedreno_screen.h @@ -200,6 +200,12 @@ is_a6xx(struct fd_screen *screen) return (screen->gpu_id >= 600) && (screen->gpu_id < 700); } +static inline boolean +is_a650(struct fd_screen *screen) +{ + return screen->gpu_id == 650; +} + /* is it using the ir3 compiler (shader isa introduced with a3xx)? */ static inline boolean is_ir3(struct fd_screen *screen)