Ilia Mirkin
2014-Sep-19 04:19 UTC
[Nouveau] [PATCH 0/2] nv50, nvc0: fix weirdo zs formats and their blits
There were reports of issues with gallium-nine. It's unclear whether mesa/st uses these, the patches did not produce any piglit changes. However they seem right... Ilia Mirkin (2): nv50,nvc0: add missing depth/stencil formats to tile flag selection nv50,nvc0: fix 3d blit logic for odd depth/stencil formats src/gallium/drivers/nouveau/nv50/nv50_blit.h | 21 ++++++++++++++------- src/gallium/drivers/nouveau/nv50/nv50_miptree.c | 4 ++++ src/gallium/drivers/nouveau/nv50/nv50_surface.c | 4 ++++ src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c | 4 ++++ 4 files changed, 26 insertions(+), 7 deletions(-) -- 1.8.5.5
Ilia Mirkin
2014-Sep-19 04:19 UTC
[Nouveau] [PATCH 1/2] nv50, nvc0: add missing depth/stencil formats to tile flag selection
Reported-by: David Heidelberger <david.heidelberger at ixit.cz> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- src/gallium/drivers/nouveau/nv50/nv50_miptree.c | 4 ++++ src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c index 14e5a0d..1aacaec 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c @@ -78,9 +78,12 @@ nv50_mt_choose_storage_type(struct nv50_miptree *mt, boolean compressed) case PIPE_FORMAT_Z16_UNORM: tile_flags = 0x6c + ms; break; + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_S8X24_UINT: case PIPE_FORMAT_S8_UINT_Z24_UNORM: tile_flags = 0x18 + ms; break; + case PIPE_FORMAT_X24S8_UINT: case PIPE_FORMAT_Z24X8_UNORM: case PIPE_FORMAT_Z24_UNORM_S8_UINT: tile_flags = 0x128 + ms; @@ -88,6 +91,7 @@ nv50_mt_choose_storage_type(struct nv50_miptree *mt, boolean compressed) case PIPE_FORMAT_Z32_FLOAT: tile_flags = 0x40 + ms; break; + case PIPE_FORMAT_X32_S8X24_UINT: case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: tile_flags = 0x60 + ms; break; diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c index 3baa752..1beda7d 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c @@ -53,12 +53,15 @@ nvc0_mt_choose_storage_type(struct nv50_miptree *mt, boolean compressed) else tile_flags = 0x01; break; + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_S8X24_UINT: case PIPE_FORMAT_S8_UINT_Z24_UNORM: if (compressed) tile_flags = 0x51 + ms; else tile_flags = 0x46; break; + case PIPE_FORMAT_X24S8_UINT: case PIPE_FORMAT_Z24X8_UNORM: case PIPE_FORMAT_Z24_UNORM_S8_UINT: if (compressed) @@ -72,6 +75,7 @@ nvc0_mt_choose_storage_type(struct nv50_miptree *mt, boolean compressed) else tile_flags = 0x7b; break; + case PIPE_FORMAT_X32_S8X24_UINT: case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: if (compressed) tile_flags = 0xce + ms; -- 1.8.5.5
Ilia Mirkin
2014-Sep-19 04:19 UTC
[Nouveau] [PATCH 2/2] nv50, nvc0: fix 3d blit logic for odd depth/stencil formats
Reported-by: David Heidelberger <david.heidelberger at ixit.cz> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- src/gallium/drivers/nouveau/nv50/nv50_blit.h | 21 ++++++++++++++------- src/gallium/drivers/nouveau/nv50/nv50_surface.c | 4 ++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_blit.h b/src/gallium/drivers/nouveau/nv50/nv50_blit.h index bdd6a63..756c4c1 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_blit.h +++ b/src/gallium/drivers/nouveau/nv50/nv50_blit.h @@ -111,10 +111,14 @@ nv50_blit_zeta_to_colour_format(enum pipe_format format) case PIPE_FORMAT_Z24_UNORM_S8_UINT: case PIPE_FORMAT_S8_UINT_Z24_UNORM: case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_X24S8_UINT: + case PIPE_FORMAT_S8X24_UINT: return PIPE_FORMAT_R8G8B8A8_UNORM; case PIPE_FORMAT_Z32_FLOAT: return PIPE_FORMAT_R32_FLOAT; case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: + case PIPE_FORMAT_X32_S8X24_UINT: return PIPE_FORMAT_R32G32_FLOAT; default: assert(0); @@ -131,19 +135,21 @@ nv50_blit_derive_color_mask(const struct pipe_blit_info *info) uint16_t color_mask = 0; switch (info->dst.format) { + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X24S8_UINT: case PIPE_FORMAT_Z24_UNORM_S8_UINT: if (mask & PIPE_MASK_S) color_mask |= 0x1000; - /* fall through */ - case PIPE_FORMAT_Z24X8_UNORM: if (mask & PIPE_MASK_Z) color_mask |= 0x0111; break; + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_S8X24_UINT: case PIPE_FORMAT_S8_UINT_Z24_UNORM: - if (mask & PIPE_MASK_Z) - color_mask |= 0x1110; if (mask & PIPE_MASK_S) color_mask |= 0x0001; + if (mask & PIPE_MASK_Z) + color_mask |= 0x1110; break; default: if (mask & (PIPE_MASK_R | PIPE_MASK_Z)) color_mask |= 0x0001; @@ -162,17 +168,18 @@ nv50_blit_eng2d_get_mask(const struct pipe_blit_info *info) uint32_t mask = 0; switch (info->dst.format) { + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X24S8_UINT: case PIPE_FORMAT_Z24_UNORM_S8_UINT: if (info->mask & PIPE_MASK_Z) mask |= 0x00ffffff; if (info->mask & PIPE_MASK_S) mask |= 0xff000000; break; + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_S8X24_UINT: case PIPE_FORMAT_S8_UINT_Z24_UNORM: if (info->mask & PIPE_MASK_Z) mask |= 0xffffff00; if (info->mask & PIPE_MASK_S) mask |= 0x000000ff; break; - case PIPE_FORMAT_X8Z24_UNORM: - if (info->mask & PIPE_MASK_Z) mask = 0x00ffffff; - break; default: mask = 0xffffffff; break; diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c index 8ec4a5f..e1dd6e0 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c @@ -827,6 +827,7 @@ nv50_blit_select_mode(const struct pipe_blit_info *info) switch (info->dst.resource->format) { case PIPE_FORMAT_Z24_UNORM_S8_UINT: case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X24S8_UINT: switch (mask & PIPE_MASK_ZS) { case PIPE_MASK_ZS: return NV50_BLIT_MODE_Z24S8; case PIPE_MASK_Z: return NV50_BLIT_MODE_Z24X8; @@ -834,6 +835,8 @@ nv50_blit_select_mode(const struct pipe_blit_info *info) return NV50_BLIT_MODE_X24S8; } case PIPE_FORMAT_S8_UINT_Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_S8X24_UINT: switch (mask & PIPE_MASK_ZS) { case PIPE_MASK_ZS: return NV50_BLIT_MODE_S8Z24; case PIPE_MASK_Z: return NV50_BLIT_MODE_X8Z24; @@ -842,6 +845,7 @@ nv50_blit_select_mode(const struct pipe_blit_info *info) } case PIPE_FORMAT_Z32_FLOAT: case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: + case PIPE_FORMAT_X32_S8X24_UINT: switch (mask & PIPE_MASK_ZS) { case PIPE_MASK_ZS: return NV50_BLIT_MODE_ZS; case PIPE_MASK_Z: return NV50_BLIT_MODE_PASS; -- 1.8.5.5