From 4a288b1dd511ac28c631fc9587be1b7eef62a0f1 Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Fri, 23 Jun 2023 09:31:09 +0900 Subject: [PATCH] anv/video: fix to set U/V offset correctly. Fixes: 98c58a16ef1a ("anv: add initial video decode support for h264.") Closes: mesa/mesa#9227 Signed-off-by: Hyunjun Ko Part-of: (cherry picked from commit 23d4e21d835975110e96cd7dface422ef043374f) --- .pick_status.json | 2 +- src/intel/vulkan/genX_video.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f42c3283756..da6c906c796 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1111,7 +1111,7 @@ "description": "anv/video: fix to set U/V offset correctly.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "98c58a16ef1ab2208693505a88e597202cc3c2a1" }, diff --git a/src/intel/vulkan/genX_video.c b/src/intel/vulkan/genX_video.c index 253fcfeffb3..0192d8703c2 100644 --- a/src/intel/vulkan/genX_video.c +++ b/src/intel/vulkan/genX_video.c @@ -110,8 +110,8 @@ anv_h264_decode_video(struct anv_cmd_buffer *cmd_buffer, ss.TiledSurface = img->planes[0].primary_surface.isl.tiling != ISL_TILING_LINEAR; ss.TileWalk = TW_YMAJOR; - ss.YOffsetforUCb = align(img->vk.extent.height, 32); - ss.YOffsetforVCr = align(img->vk.extent.height, 32); + ss.YOffsetforUCb = ss.YOffsetforVCr = + img->planes[1].primary_surface.memory_range.offset / img->planes[0].primary_surface.isl.row_pitch_B; } anv_batch_emit(&cmd_buffer->batch, GENX(MFX_PIPE_BUF_ADDR_STATE), buf) {