Mesa (main): radeon/vcn/enc: use surface swizzle mode instead of linear

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 4 12:57:37 UTC 2021


Module: Mesa
Branch: main
Commit: 56714238ba62cbd5e80ff20b738fe0b4bcd30400
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=56714238ba62cbd5e80ff20b738fe0b4bcd30400

Author: Leo Liu <leo.liu at amd.com>
Date:   Wed Jun  2 12:52:05 2021 -0400

radeon/vcn/enc: use surface swizzle mode instead of linear

It will be capable to have encoder tiling supported via modifier

Signed-off-by: Leo Liu <leo.liu at amd.com>
Reviewed-by: Thong Thai <thong.thai at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11165>

---

 src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
index 8302e3ffb3b..5f2400b9a9d 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c
@@ -982,10 +982,15 @@ static void radeon_enc_encode_params(struct radeon_encoder *enc)
       enc->enc_pic.enc_params.pic_type = RENCODE_PICTURE_TYPE_I;
    }
 
+   if (enc->luma->meta_offset) {
+      RVID_ERR("DCC surfaces not supported.\n");
+      return;
+   }
+
    enc->enc_pic.enc_params.allowed_max_bitstream_size = enc->bs_size;
    enc->enc_pic.enc_params.input_pic_luma_pitch = enc->luma->u.gfx9.surf_pitch;
    enc->enc_pic.enc_params.input_pic_chroma_pitch = enc->chroma->u.gfx9.surf_pitch;
-   enc->enc_pic.enc_params.input_pic_swizzle_mode = RENCODE_INPUT_SWIZZLE_MODE_LINEAR;
+   enc->enc_pic.enc_params.input_pic_swizzle_mode = enc->luma->u.gfx9.swizzle_mode;
 
    if (enc->enc_pic.picture_type == PIPE_H2645_ENC_PICTURE_TYPE_IDR)
       enc->enc_pic.enc_params.reference_picture_index = 0xFFFFFFFF;
@@ -1027,10 +1032,15 @@ static void radeon_enc_encode_params_hevc(struct radeon_encoder *enc)
       enc->enc_pic.enc_params.pic_type = RENCODE_PICTURE_TYPE_I;
    }
 
+   if (enc->luma->meta_offset) {
+      RVID_ERR("DCC surfaces not supported.\n");
+      return;
+   }
+
    enc->enc_pic.enc_params.allowed_max_bitstream_size = enc->bs_size;
    enc->enc_pic.enc_params.input_pic_luma_pitch = enc->luma->u.gfx9.surf_pitch;
    enc->enc_pic.enc_params.input_pic_chroma_pitch = enc->chroma->u.gfx9.surf_pitch;
-   enc->enc_pic.enc_params.input_pic_swizzle_mode = RENCODE_INPUT_SWIZZLE_MODE_LINEAR;
+   enc->enc_pic.enc_params.input_pic_swizzle_mode = enc->luma->u.gfx9.swizzle_mode;
 
    if (enc->enc_pic.enc_params.pic_type == RENCODE_PICTURE_TYPE_I)
       enc->enc_pic.enc_params.reference_picture_index = 0xFFFFFFFF;



More information about the mesa-commit mailing list