radeon/uvd: get the target buffer pitch correct for different format
authorLeo Liu <leo.liu@amd.com>
Fri, 18 Aug 2017 16:03:19 +0000 (12:03 -0400)
committerLeo Liu <leo.liu@amd.com>
Mon, 21 Aug 2017 14:09:09 +0000 (10:09 -0400)
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 d5352d9de6fa37e664f0dd9e9b61de91ef8dfb4e..dd8c0e0eb0d3054ae49d2b893282d12a894ececa 100644 (file)
@@ -1397,7 +1397,7 @@ void ruvd_set_dt_surfaces(struct ruvd_msg *msg, struct radeon_surf *luma,
        switch (type) {
        default:
        case RUVD_SURFACE_TYPE_LEGACY:
-               msg->body.decode.dt_pitch = luma->u.legacy.level[0].nblk_x;
+               msg->body.decode.dt_pitch = luma->u.legacy.level[0].nblk_x * luma->blk_w;
                switch (luma->u.legacy.level[0].mode) {
                case RADEON_SURF_MODE_LINEAR_ALIGNED:
                        msg->body.decode.dt_tiling_mode = RUVD_TILE_LINEAR;
@@ -1435,7 +1435,7 @@ void ruvd_set_dt_surfaces(struct ruvd_msg *msg, struct radeon_surf *luma,
                msg->body.decode.dt_surf_tile_config |= RUVD_MACRO_TILE_ASPECT_RATIO(macro_tile_aspect(luma->u.legacy.mtilea));
                break;
        case RUVD_SURFACE_TYPE_GFX9:
-               msg->body.decode.dt_pitch = luma->u.gfx9.surf_pitch * luma->bpe;
+               msg->body.decode.dt_pitch = luma->u.gfx9.surf_pitch * luma->blk_w;
                /* SWIZZLE LINEAR MODE */
                msg->body.decode.dt_tiling_mode = RUVD_TILE_LINEAR;
                msg->body.decode.dt_array_mode = RUVD_ARRAY_MODE_LINEAR;