mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 00:10:10 +01:00
radeonsi/vcn: Support 10bit RGB for EFC input
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30101>
This commit is contained in:
parent
eb05111bf7
commit
8fa9e78e39
3 changed files with 32 additions and 9 deletions
|
|
@ -203,7 +203,9 @@
|
|||
#define RENCODE_COLOR_PACKING_FORMAT_NV12 0
|
||||
#define RENCODE_COLOR_PACKING_FORMAT_P010 1
|
||||
#define RENCODE_COLOR_PACKING_FORMAT_A8R8G8B8 4
|
||||
#define RENCODE_COLOR_PACKING_FORMAT_A2R10G10B10 5
|
||||
#define RENCODE_COLOR_PACKING_FORMAT_A8B8G8R8 7
|
||||
#define RENCODE_COLOR_PACKING_FORMAT_A2B10G10R10 8
|
||||
|
||||
#define RENCODE_COLOR_SPACE_YUV 0
|
||||
#define RENCODE_COLOR_SPACE_RGB 1
|
||||
|
|
|
|||
|
|
@ -416,6 +416,20 @@ static void radeon_vcn_enc_get_input_format_param(struct radeon_encoder *enc,
|
|||
enc->enc_pic.enc_input_format.input_color_packing_format = RENCODE_COLOR_PACKING_FORMAT_A8B8G8R8;
|
||||
enc->enc_pic.enc_input_format.input_color_space = RENCODE_COLOR_SPACE_RGB;
|
||||
break;
|
||||
case PIPE_FORMAT_B10G10R10A2_UNORM:
|
||||
case PIPE_FORMAT_B10G10R10X2_UNORM:
|
||||
enc->enc_pic.enc_input_format.input_color_bit_depth = RENCODE_COLOR_BIT_DEPTH_10_BIT;
|
||||
enc->enc_pic.enc_input_format.input_chroma_subsampling = RENCODE_CHROMA_SUBSAMPLING_4_4_4;
|
||||
enc->enc_pic.enc_input_format.input_color_packing_format = RENCODE_COLOR_PACKING_FORMAT_A2R10G10B10;
|
||||
enc->enc_pic.enc_input_format.input_color_space = RENCODE_COLOR_SPACE_RGB;
|
||||
break;
|
||||
case PIPE_FORMAT_R10G10B10A2_UNORM:
|
||||
case PIPE_FORMAT_R10G10B10X2_UNORM:
|
||||
enc->enc_pic.enc_input_format.input_color_bit_depth = RENCODE_COLOR_BIT_DEPTH_10_BIT;
|
||||
enc->enc_pic.enc_input_format.input_chroma_subsampling = RENCODE_CHROMA_SUBSAMPLING_4_4_4;
|
||||
enc->enc_pic.enc_input_format.input_color_packing_format = RENCODE_COLOR_PACKING_FORMAT_A2B10G10R10;
|
||||
enc->enc_pic.enc_input_format.input_color_space = RENCODE_COLOR_SPACE_RGB;
|
||||
break;
|
||||
case PIPE_FORMAT_NV12: /* FALL THROUGH */
|
||||
default:
|
||||
enc->enc_pic.enc_input_format.input_color_bit_depth = RENCODE_COLOR_BIT_DEPTH_8_BIT;
|
||||
|
|
|
|||
|
|
@ -1135,19 +1135,26 @@ static bool si_vid_is_target_buffer_supported(struct pipe_screen *screen,
|
|||
case PIPE_VIDEO_ENTRYPOINT_ENCODE:
|
||||
/* EFC */
|
||||
if (is_format_conversion) {
|
||||
const bool input_8bit =
|
||||
target->buffer_format == PIPE_FORMAT_B8G8R8A8_UNORM ||
|
||||
target->buffer_format == PIPE_FORMAT_B8G8R8X8_UNORM ||
|
||||
target->buffer_format == PIPE_FORMAT_R8G8B8A8_UNORM ||
|
||||
target->buffer_format == PIPE_FORMAT_R8G8B8X8_UNORM;
|
||||
const bool input_10bit =
|
||||
target->buffer_format == PIPE_FORMAT_B10G10R10A2_UNORM ||
|
||||
target->buffer_format == PIPE_FORMAT_B10G10R10X2_UNORM ||
|
||||
target->buffer_format == PIPE_FORMAT_R10G10B10A2_UNORM ||
|
||||
target->buffer_format == PIPE_FORMAT_R10G10B10X2_UNORM;
|
||||
|
||||
if (sscreen->info.family <= CHIP_RENOIR ||
|
||||
sscreen->debug_flags & DBG(NO_EFC))
|
||||
return false;
|
||||
|
||||
/* Input formats */
|
||||
if (target->buffer_format != PIPE_FORMAT_B8G8R8A8_UNORM &&
|
||||
target->buffer_format != PIPE_FORMAT_R8G8B8A8_UNORM &&
|
||||
target->buffer_format != PIPE_FORMAT_B8G8R8X8_UNORM &&
|
||||
target->buffer_format != PIPE_FORMAT_R8G8B8X8_UNORM)
|
||||
return false;
|
||||
|
||||
/* Output formats */
|
||||
if (format != PIPE_FORMAT_NV12)
|
||||
if (input_8bit)
|
||||
return format == PIPE_FORMAT_NV12;
|
||||
else if (input_10bit)
|
||||
return format == PIPE_FORMAT_NV12 || format == PIPE_FORMAT_P010;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue