radeon/uvd: add YUYV format support for target buffer
authorLeo Liu <leo.liu@amd.com>
Fri, 18 Aug 2017 16:12:05 +0000 (12:12 -0400)
committerLeo Liu <leo.liu@amd.com>
Mon, 21 Aug 2017 14:09:09 +0000 (10:09 -0400)
Make chroma plane optional for YUYV support

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeon/radeon_uvd.c
src/gallium/drivers/radeonsi/si_uvd.c

index 9ebc31c170cef56f4efbe60385a313726de85c4b..648a493b59cdcbd551fc5335b0e1c4f34930c171 100644 (file)
@@ -1566,10 +1566,12 @@ void ruvd_set_dt_surfaces(struct ruvd_msg *msg, struct radeon_surf *luma,
                }
 
                msg->body.decode.dt_luma_top_offset = texture_offset(luma, 0, type);
-               msg->body.decode.dt_chroma_top_offset = texture_offset(chroma, 0, type);
+               if (chroma)
+                       msg->body.decode.dt_chroma_top_offset = texture_offset(chroma, 0, type);
                if (msg->body.decode.dt_field_mode) {
                        msg->body.decode.dt_luma_bottom_offset = texture_offset(luma, 1, type);
-                       msg->body.decode.dt_chroma_bottom_offset = texture_offset(chroma, 1, type);
+                       if (chroma)
+                               msg->body.decode.dt_chroma_bottom_offset = texture_offset(chroma, 1, type);
                } else {
                        msg->body.decode.dt_luma_bottom_offset = msg->body.decode.dt_luma_top_offset;
                        msg->body.decode.dt_chroma_bottom_offset = msg->body.decode.dt_chroma_top_offset;
index d17a6656a46be2effcdd4afce334da4d48d0e533..2441ad248c69a7e00e6415a01e8db2a550383fce 100644 (file)
@@ -131,7 +131,7 @@ static struct pb_buffer* si_uvd_set_dtb(struct ruvd_msg *msg, struct vl_video_bu
 
        msg->body.decode.dt_field_mode = buf->base.interlaced;
 
-       ruvd_set_dt_surfaces(msg, &luma->surface, &chroma->surface, type);
+       ruvd_set_dt_surfaces(msg, &luma->surface, (chroma) ? &chroma->surface : NULL, type);
 
        return luma->resource.buf;
 }