<div dir="ltr"><div>I'm OK with this.</div><div><br></div><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div><br></div><div>Marek<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 13, 2019 at 1:39 PM Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Rob Clark <<a href="mailto:robdclark@chromium.org" target="_blank">robdclark@chromium.org</a>><br>
<br>
This maps to a special format that recent generations of adreno have,<br>
for blitting z24s8. Conceptually it is similar to doing Z and/or S<br>
blits by pretending it is r8g8b8a8 (with appropriate writemask). But<br>
it differs when bandwidth compression is used, as z24 is a different<br>
type from r8g8b8.<br>
<br>
Signed-off-by: Rob Clark <<a href="mailto:robdclark@chromium.org" target="_blank">robdclark@chromium.org</a>><br>
---<br>
This is part of:<br>
<br>
<a href="https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1088" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1088</a><br>
<br>
but sending to list to give better visibility.<br>
<br>
src/gallium/auxiliary/util/u_format.csv | 7 +++++++<br>
src/gallium/drivers/svga/svga_format.c | 1 +<br>
src/gallium/include/pipe/p_format.h | 2 ++<br>
3 files changed, 10 insertions(+)<br>
<br>
diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv<br>
index 51a08bd6530..039b5fa9141 100644<br>
--- a/src/gallium/auxiliary/util/u_format.csv<br>
+++ b/src/gallium/auxiliary/util/u_format.csv<br>
@@ -144,6 +144,13 @@ PIPE_FORMAT_X8Z24_UNORM , plain, 1, 1, x8 , un24, , , y___,<br>
PIPE_FORMAT_Z32_FLOAT_S8X24_UINT , plain, 1, 1, f32 , up8 , x24, , xy__, zs, f32 , x24 , up8, , xz__<br>
PIPE_FORMAT_X32_S8X24_UINT , plain, 1, 1, x32 , up8 , x24, , _y__, zs, x32 , x24 , up8, , _z__<br>
<br>
+# Depth-stencil formats equivalent to blitting PIPE_FORMAT_Z24_UNORM_S8_UINT<br>
+# as PIPE_FORMAT_R8G8B8A8_*, in that it is an equivalent size to the z/s<br>
+# format. This is mainly for hw that has some sort of bandwidth compressed<br>
+# format where the compression for z24s8 is not equivalent to r8g8b8a8,<br>
+# and therefore some special handling is required for blits.<br>
+PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8 , plain, 1, 1, un8 , un8 , un8 , un8 , xyzw, rgb<br>
+<br>
# YUV formats<br>
# <a href="http://www.fourcc.org/yuv.php#UYVY" rel="noreferrer" target="_blank">http://www.fourcc.org/yuv.php#UYVY</a><br>
PIPE_FORMAT_UYVY , subsampled, 2, 1, x32 , , , , xyz1, yuv<br>
diff --git a/src/gallium/drivers/svga/svga_format.c b/src/gallium/drivers/svga/svga_format.c<br>
index 830ff0a1e6b..84134018c17 100644<br>
--- a/src/gallium/drivers/svga/svga_format.c<br>
+++ b/src/gallium/drivers/svga/svga_format.c<br>
@@ -378,6 +378,7 @@ static const struct vgpu10_format_entry format_conversion_table[] =<br>
{ PIPE_FORMAT_ATC_RGB, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
{ PIPE_FORMAT_ATC_RGBA_EXPLICIT, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
{ PIPE_FORMAT_ATC_RGBA_INTERPOLATED, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
+ { PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, SVGA3D_FORMAT_INVALID, 0 },<br>
};<br>
<br>
<br>
diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h<br>
index a4401658f5f..42908e9a720 100644<br>
--- a/src/gallium/include/pipe/p_format.h<br>
+++ b/src/gallium/include/pipe/p_format.h<br>
@@ -407,6 +407,8 @@ enum pipe_format {<br>
PIPE_FORMAT_ATC_RGBA_EXPLICIT = 318,<br>
PIPE_FORMAT_ATC_RGBA_INTERPOLATED = 319,<br>
<br>
+ PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8 = 320,<br>
+<br>
PIPE_FORMAT_COUNT<br>
};<br>
<br>
-- <br>
2.20.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div>