From: Leo Liu Date: Fri, 7 Feb 2020 00:20:09 +0000 (-0500) Subject: radeon/jpeg: fix the jpeg dt_pitch with YUYV format X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e272b110bb511b3735672a61c58c5b6b944bc37b;p=mesa.git radeon/jpeg: fix the jpeg dt_pitch with YUYV format The dt_pitch should be same as NV12 format from decoder views, and it finally got corrected with gfx9 surface's fixes from MR https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3738 Signed-off-by: Leo Liu Acked-by: Pierre-Eric Pelloux-Prayer Tested-by: Marge Bot Part-of: --- diff --git a/src/gallium/drivers/radeon/radeon_vcn_dec_jpeg.c b/src/gallium/drivers/radeon/radeon_vcn_dec_jpeg.c index b53af093785..1214c9438d1 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_dec_jpeg.c +++ b/src/gallium/drivers/radeon/radeon_vcn_dec_jpeg.c @@ -48,12 +48,9 @@ static struct pb_buffer *radeon_jpeg_get_decode_param(struct radeon_decoder *dec dec->jpg.bsd_size = align(dec->bs_size, 128); dec->jpg.dt_luma_top_offset = luma->surface.u.gfx9.surf_offset; - if (target->buffer_format == PIPE_FORMAT_NV12) { + if (target->buffer_format == PIPE_FORMAT_NV12) dec->jpg.dt_chroma_top_offset = chroma->surface.u.gfx9.surf_offset; - dec->jpg.dt_pitch = luma->surface.u.gfx9.surf_pitch * luma->surface.blk_w; - } - else if (target->buffer_format == PIPE_FORMAT_YUYV) - dec->jpg.dt_pitch = luma->surface.u.gfx9.surf_pitch; + dec->jpg.dt_pitch = luma->surface.u.gfx9.surf_pitch * luma->surface.blk_w; dec->jpg.dt_uv_pitch = dec->jpg.dt_pitch / 2; return luma->buffer.buf;