freedreno/a6x: Rename z/s formats
authorKristian H. Kristensen <hoegsberg@google.com>
Thu, 31 Oct 2019 21:43:58 +0000 (14:43 -0700)
committerKristian H. Kristensen <hoegsberg@google.com>
Fri, 8 Nov 2019 00:36:36 +0000 (16:36 -0800)
What we call eRB6_Z24_UNORM_S8_UINT now is actually
RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8 and RB6_X8Z24_UNORM is actually
RB6_Z24_UNORM_S8_UINT.

Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/freedreno/registers/a6xx.xml
src/freedreno/vulkan/tu_blit.c
src/freedreno/vulkan/tu_formats.c
src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
src/gallium/drivers/freedreno/a6xx/fd6_format.c
src/gallium/drivers/freedreno/a6xx/fd6_format.h
src/gallium/drivers/freedreno/a6xx/fd6_resource.c

index 3f78cd58cf736a7b90d40a97dc0ab4735d259e4b..7f464f1a480f2c36757ce7a439ceabd084cbcee6 100644 (file)
@@ -53,8 +53,8 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
        <value value="0x82" name="RB6_R32G32B32A32_FLOAT"/>
        <value value="0x83" name="RB6_R32G32B32A32_UINT"/>
        <value value="0x84" name="RB6_R32G32B32A32_SINT"/>
-       <value value="0x91" name="RB6_Z24_UNORM_S8_UINT"/>
-       <value value="0xa0" name="RB6_X8Z24_UNORM"/>
+       <value value="0x91" name="RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8"/>
+       <value value="0xa0" name="RB6_Z24_UNORM_S8_UINT"/>
 </enum>
 
 <!-- these might be same as a5xx -->
index 33e0fd45a5574cbdb1d89643c6338b9584d2bc6f..15de704a339a07592fd59b0c6f30745d2e71753a 100644 (file)
@@ -65,8 +65,8 @@ blit_image_info(const struct tu_blit_surf *img, bool src, bool stencil_read)
    enum a3xx_color_swap swap = img->tiled ? WZYX : fmt->swap;
    if (rb == RB6_R10G10B10A2_UNORM && src)
       rb = RB6_R10G10B10A2_FLOAT16;
-   if (rb == RB6_X8Z24_UNORM)
-      rb = RB6_Z24_UNORM_S8_UINT;
+   if (rb == RB6_Z24_UNORM_S8_UINT)
+      rb = RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8;
 
    if (stencil_read)
       swap = XYZW;
@@ -85,8 +85,8 @@ emit_blit_step(struct tu_cmd_buffer *cmdbuf, const struct tu_blit *blt)
    tu_cs_reserve_space(cmdbuf->device, cs, 52);
 
    enum a6xx_color_fmt fmt = tu6_get_native_format(blt->dst.fmt)->rb;
-   if (fmt == RB6_X8Z24_UNORM)
-      fmt = RB6_Z24_UNORM_S8_UINT;
+   if (fmt == RB6_Z24_UNORM_S8_UINT)
+      fmt = RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8;
 
    enum a6xx_2d_ifmt ifmt = tu6_rb_fmt_to_ifmt(fmt);
 
@@ -97,7 +97,7 @@ emit_blit_step(struct tu_cmd_buffer *cmdbuf, const struct tu_blit *blt)
 
    uint32_t blit_cntl = A6XX_RB_2D_BLIT_CNTL_ROTATE(blt->rotation) |
                         A6XX_RB_2D_BLIT_CNTL_COLOR_FORMAT(fmt) | /* not required? */
-                        COND(fmt == RB6_Z24_UNORM_S8_UINT, A6XX_RB_2D_BLIT_CNTL_D24S8) |
+                        COND(fmt == RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8, A6XX_RB_2D_BLIT_CNTL_D24S8) |
                         A6XX_RB_2D_BLIT_CNTL_MASK(0xf) |
                         A6XX_RB_2D_BLIT_CNTL_IFMT(ifmt);
 
index 1bd0df666735a39b4540902c3b2f973999fc4db9..6cedf24b61fe7b29bcc23e48c693c3ffe01cb396 100644 (file)
@@ -249,11 +249,11 @@ TU_FORMAT_TABLE(tu6_format_table0) = {
 
    /* depth/stencil */
    TU6_xTC(D16_UNORM,                  16_UNORM,          R16_UNORM,          WZYX), /* 124 */
-   TU6_xTC(X8_D24_UNORM_PACK32,        X8Z24_UNORM,       X8Z24_UNORM,        WZYX), /* 125 */
+   TU6_xTC(X8_D24_UNORM_PACK32,        Z24_UNORM_S8_UINT, Z24_UNORM_S8_UINT, WZYX), /* 125 */
    TU6_xTC(D32_SFLOAT,                 32_FLOAT,          R32_FLOAT,          WZYX), /* 126 */
    TU6_xTC(S8_UINT,                    8_UINT,            R8_UINT,            WZYX), /* 127 */
    TU6_xxx(D16_UNORM_S8_UINT,          X8Z16_UNORM,       X8Z16_UNORM,        WZYX), /* 128 */
-   TU6_xTC(D24_UNORM_S8_UINT,          X8Z24_UNORM,       X8Z24_UNORM,        WZYX), /* 129 */
+   TU6_xTC(D24_UNORM_S8_UINT,          Z24_UNORM_S8_UINT, Z24_UNORM_S8_UINT, WZYX), /* 129 */
    TU6_xxx(D32_SFLOAT_S8_UINT,         x,                 x,                  WZYX), /* 130 */
 
    /* compressed */
@@ -341,8 +341,8 @@ tu6_rb_fmt_to_ifmt(enum a6xx_color_fmt fmt)
    case RB6_R4G4B4A4_UNORM:
    case RB6_R5G5B5A1_UNORM:
    case RB6_R5G6B5_UNORM:
-   case RB6_X8Z24_UNORM:
    case RB6_Z24_UNORM_S8_UINT:
+   case RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8:
       return R2D_UNORM8;
 
    case RB6_R32_UINT:
index 79541e5cb544304816aab01fbe729f215f1f91d0..39c5ee6f3393d4c8e39d657067e0f6bbd38000ca 100644 (file)
@@ -432,7 +432,7 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring,
                        color->ui[2] = (depth_unorm24 >> 16) & 0xff;
                        color->ui[3] = stencil;
 
-                       dfmt = RB6_Z24_UNORM_S8_UINT;
+                       dfmt = RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8;
                        break;
                }
                case PIPE_FORMAT_B5G6R5_UNORM:
index a3d857fb88c3f5532c585e3686d8e864103c63e2..0e9078bd71a666b522a0868f814a0ce8e068e563 100644 (file)
@@ -215,15 +215,15 @@ static struct fd6_format formats[PIPE_FORMAT_COUNT] = {
        VT(R11G11B10_FLOAT, 11_11_10_FLOAT, R11G11B10_FLOAT, WZYX),
        _T(R9G9B9E5_FLOAT,  9_9_9_E5_FLOAT, NONE,            WZYX),
 
-       _T(Z24X8_UNORM,       X8Z24_UNORM,  X8Z24_UNORM,   WZYX),
-       _T(X24S8_UINT,        8_8_8_8_UINT, X8Z24_UNORM,   WZYX),
-       _T(Z24_UNORM_S8_UINT, X8Z24_UNORM,  X8Z24_UNORM,   WZYX),
-       _T(Z32_FLOAT,         32_FLOAT,     R32_FLOAT,     WZYX),
-       _T(Z32_FLOAT_S8X24_UINT, 32_FLOAT,  R32_FLOAT,     WZYX),
-       _T(X32_S8X24_UINT,    8_UINT,      R8_UINT,        WZYX),
+       _T(Z24X8_UNORM,          X8Z24_UNORM,       Z24_UNORM_S8_UINT, WZYX),
+       _T(X24S8_UINT,           8_8_8_8_UINT,      Z24_UNORM_S8_UINT, WZYX),
+       _T(Z24_UNORM_S8_UINT,    X8Z24_UNORM,       Z24_UNORM_S8_UINT, WZYX),
+       _T(Z32_FLOAT,            32_FLOAT,          R32_FLOAT,         WZYX),
+       _T(Z32_FLOAT_S8X24_UINT, 32_FLOAT,          R32_FLOAT,         WZYX),
+       _T(X32_S8X24_UINT,       8_UINT,            R8_UINT,           WZYX),
 
        /* special format for blits: */
-       _T(Z24_UNORM_S8_UINT_AS_R8G8B8A8, Z24_UNORM_S8_UINT,  Z24_UNORM_S8_UINT,   WZYX),
+       _T(Z24_UNORM_S8_UINT_AS_R8G8B8A8, Z24_UNORM_S8_UINT,  Z24_UNORM_S8_UINT_AS_R8G8B8A8,   WZYX),
 
        /* 48-bit */
        V_(R16G16B16_UNORM,   16_16_16_UNORM, NONE, WZYX),
index 3c1e0a0e5d4cbaa84acbf0a355d64968c7860a1b..8da5f08be5062ee58b8d4cbba28f7b4d2a98c4ab 100644 (file)
@@ -110,8 +110,8 @@ fd6_ifmt(enum a6xx_color_fmt fmt)
        case RB6_R5G5B5A1_UNORM:
        case RB6_R5G6B5_UNORM:
        case RB6_R10G10B10A2_UINT:
-       case RB6_X8Z24_UNORM:
        case RB6_Z24_UNORM_S8_UINT:
+       case RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8:
                return R2D_RAW;
        default:
                unreachable("bad format");
index 8f8f7f20d1f9ca6353840b0205fcf5aa4526c51b..e9f561e08b5211e3bc57d32e3882645ea74a580a 100644 (file)
@@ -206,8 +206,8 @@ ok_ubwc_format(enum pipe_format pfmt)
        case RB6_R8G8_SINT:
        case RB6_R8G8_UINT:
        case RB6_R8G8_UNORM:
-       case RB6_X8Z24_UNORM:
        case RB6_Z24_UNORM_S8_UINT:
+       case RB6_Z24_UNORM_S8_UINT_AS_R8G8B8A8:
                return true;
        default:
                return false;