freedreno: add adreno 650
authorJonathan Marek <jonathan@marek.ca>
Wed, 13 May 2020 02:01:40 +0000 (22:01 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 20 May 2020 18:24:28 +0000 (18:24 +0000)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4611>

src/gallium/drivers/freedreno/a6xx/fd6_context.c
src/gallium/drivers/freedreno/freedreno_gmem.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_screen.h

index c9884e2bb6ab459b0c7ab2b73dc3a1e5b2aa4305..6ccc45ab658e050b1a6e1c98864a185933bbe181 100644 (file)
@@ -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");
index b3ef0978f9ed8c1e1af116ce23c79b631744e0bd..a289662f0de35c8ae4578912df01cc89d59e8a37 100644 (file)
@@ -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:
index d2ad24fb7c05266978fcd8a280be84c9530e5d1c..e1c5b81cb32811de8d3730545deba39880190a45 100644 (file)
@@ -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) {
index 13e48dd5d3dbcf1df5348902fdeb40c84289033c..0337866fd9b81d05b738bb454ef689073188d6a0 100644 (file)
@@ -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)