radeon/jpeg: fix the jpeg dt_pitch with YUYV format
authorLeo Liu <leo.liu@amd.com>
Fri, 7 Feb 2020 00:20:09 +0000 (19:20 -0500)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 27 Feb 2020 09:01:35 +0000 (10:01 +0100)
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 <leo.liu@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3738>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3738>

src/gallium/drivers/radeon/radeon_vcn_dec_jpeg.c

index b53af09378532179bce6ee3371c5dcf703e8a577..1214c9438d170b17e4460b20e448751d96399766 100644 (file)
@@ -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;