radeon/uvd: fix the assertion check for YUYV format
authorLeo Liu <leo.liu@amd.com>
Tue, 5 Sep 2017 17:30:57 +0000 (13:30 -0400)
committerLeo Liu <leo.liu@amd.com>
Wed, 6 Sep 2017 19:53:18 +0000 (15:53 -0400)
Fixes:7319ff87("radeon/uvd: add YUYV format support for target buffer")

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

index 00d6267018236834fc87e09b6398d5d1a83ec527..fabc73e38348c383024582ffd94f55d30286a199 100644 (file)
@@ -1588,9 +1588,11 @@ void ruvd_set_dt_surfaces(struct ruvd_msg *msg, struct radeon_surf *luma,
                        msg->body.decode.dt_chroma_bottom_offset = msg->body.decode.dt_chroma_top_offset;
                }
 
-               assert(luma->u.legacy.bankw == chroma->u.legacy.bankw);
-               assert(luma->u.legacy.bankh == chroma->u.legacy.bankh);
-               assert(luma->u.legacy.mtilea == chroma->u.legacy.mtilea);
+               if (chroma) {
+                       assert(luma->u.legacy.bankw == chroma->u.legacy.bankw);
+                       assert(luma->u.legacy.bankh == chroma->u.legacy.bankh);
+                       assert(luma->u.legacy.mtilea == chroma->u.legacy.mtilea);
+               }
 
                msg->body.decode.dt_surf_tile_config |= RUVD_BANK_WIDTH(bank_wh(luma->u.legacy.bankw));
                msg->body.decode.dt_surf_tile_config |= RUVD_BANK_HEIGHT(bank_wh(luma->u.legacy.bankh));