summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSathishkumar S <sathishkumar.sundararaju@amd.com>2022-12-02 19:46:48 +0530
committerEric Engestrom <eric@engestrom.ch>2022-12-14 20:56:54 +0000
commitcdbba253c2ce97bd16701840d9c3893a8c992eeb (patch)
tree6055073993ab631ec9a5307577e785a3f10a4bea
parenta60641d1328786032523a7c1f007cb166ed4b9a5 (diff)
downloadmesa-cdbba253c2ce97bd16701840d9c3893a8c992eeb.tar.gz
frontends/va: fix crash during grayscale rendering
crash is observed as format is assumed to be yuv and buffer plane order is undefined for monochrome. luma only format is not to be considered yuv format. It has to be rendered with rgb=rrr. Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com> Reviewed-by: Thong Thai <thong.thai@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20165> (cherry picked from commit 6a3179c5a97f9a45006af2781d0af4b437784515)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/frontends/va/surface.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 452e70908ff..c2cf26fad20 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -553,7 +553,7 @@
"description": "frontends/va: fix crash during grayscale rendering",
"nominated": false,
"nomination_type": null,
- "resolution": 4,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c
index 94a219485fe..922d816eac7 100644
--- a/src/gallium/frontends/va/surface.c
+++ b/src/gallium/frontends/va/surface.c
@@ -370,7 +370,8 @@ vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface_id, void* draw, short s
vl_compositor_clear_layers(&drv->cstate);
if (format == PIPE_FORMAT_B8G8R8A8_UNORM || format == PIPE_FORMAT_B8G8R8X8_UNORM ||
- format == PIPE_FORMAT_R8G8B8A8_UNORM || format == PIPE_FORMAT_R8G8B8X8_UNORM) {
+ format == PIPE_FORMAT_R8G8B8A8_UNORM || format == PIPE_FORMAT_R8G8B8X8_UNORM ||
+ format == PIPE_FORMAT_L8_UNORM || format == PIPE_FORMAT_Y8_400_UNORM) {
struct pipe_sampler_view **views;
views = surf->buffer->get_sampler_view_planes(surf->buffer);