mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-27 12:14:10 +08:00
amd/vpelib: Enhance output format capabilities
- Generalize the p2b programming to support chroma viewport if any - Turn vpe_get_element_size_in_bytes to a global helper function Reviewed-by: Jesse Agate <Jesse.Agate@amd.com> Acked-by: Chih-Wei Chien <Chih-Wei.Chien@amd.com> Signed-off-by: Jiali <jiali.zhao@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31693>
This commit is contained in:
parent
10acd37e93
commit
8fa10461c9
@ -90,7 +90,8 @@ void vpe10_cdc_program_global_sync(
|
|||||||
struct cdc_be *cdc_be, uint32_t vupdate_offset, uint32_t vupdate_width, uint32_t vready_offset);
|
struct cdc_be *cdc_be, uint32_t vupdate_offset, uint32_t vupdate_width, uint32_t vready_offset);
|
||||||
|
|
||||||
void vpe10_cdc_program_p2b_config(struct cdc_be *cdc_be, enum vpe_surface_pixel_format format,
|
void vpe10_cdc_program_p2b_config(struct cdc_be *cdc_be, enum vpe_surface_pixel_format format,
|
||||||
enum vpe_swizzle_mode_values swizzle, const struct vpe_rect *viewport);
|
enum vpe_swizzle_mode_values swizzle, const struct vpe_rect *viewport,
|
||||||
|
const struct vpe_rect *viewport_c);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,8 @@ void vpe10_cdc_program_global_sync(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void vpe10_cdc_program_p2b_config(struct cdc_be *cdc_be, enum vpe_surface_pixel_format format,
|
void vpe10_cdc_program_p2b_config(struct cdc_be *cdc_be, enum vpe_surface_pixel_format format,
|
||||||
enum vpe_swizzle_mode_values swizzle, const struct vpe_rect *viewport)
|
enum vpe_swizzle_mode_values swizzle, const struct vpe_rect *viewport,
|
||||||
|
const struct vpe_rect *viewport_c)
|
||||||
{
|
{
|
||||||
uint32_t bar_sel0 = (uint32_t)MUX_SEL_CB_B;
|
uint32_t bar_sel0 = (uint32_t)MUX_SEL_CB_B;
|
||||||
uint32_t bar_sel1 = (uint32_t)MUX_SEL_Y_G;
|
uint32_t bar_sel1 = (uint32_t)MUX_SEL_Y_G;
|
||||||
|
@ -869,7 +869,7 @@ int32_t vpe10_program_backend(
|
|||||||
vpe_priv->be_cb_ctx.share = true;
|
vpe_priv->be_cb_ctx.share = true;
|
||||||
|
|
||||||
cdc_be->funcs->program_p2b_config(
|
cdc_be->funcs->program_p2b_config(
|
||||||
cdc_be, surface_info->format, surface_info->swizzle, &output_ctx->target_rect);
|
cdc_be, surface_info->format, surface_info->swizzle, &output_ctx->target_rect, NULL);
|
||||||
cdc_be->funcs->program_global_sync(cdc_be, VPE10_CDC_VUPDATE_OFFSET_DEFAULT,
|
cdc_be->funcs->program_global_sync(cdc_be, VPE10_CDC_VUPDATE_OFFSET_DEFAULT,
|
||||||
VPE10_CDC_VUPDATE_WIDTH_DEFAULT, VPE10_CDC_VREADY_OFFSET_DEFAULT);
|
VPE10_CDC_VUPDATE_WIDTH_DEFAULT, VPE10_CDC_VREADY_OFFSET_DEFAULT);
|
||||||
|
|
||||||
|
@ -150,6 +150,7 @@ static enum predefined_gamut_type color_space_to_predefined_gamut_types(
|
|||||||
case COLOR_SPACE_2020_RGB_FULLRANGE:
|
case COLOR_SPACE_2020_RGB_FULLRANGE:
|
||||||
case COLOR_SPACE_2020_RGB_LIMITEDRANGE:
|
case COLOR_SPACE_2020_RGB_LIMITEDRANGE:
|
||||||
case COLOR_SPACE_2020_YCBCR:
|
case COLOR_SPACE_2020_YCBCR:
|
||||||
|
case COLOR_SPACE_2020_YCBCR_LIMITED:
|
||||||
return gamut_type_bt2020;
|
return gamut_type_bt2020;
|
||||||
default:
|
default:
|
||||||
VPE_ASSERT(0);
|
VPE_ASSERT(0);
|
||||||
|
@ -190,7 +190,7 @@ bool vpe_is_yuv(enum vpe_surface_pixel_format format)
|
|||||||
vpe_is_yuv444(format));
|
vpe_is_yuv444(format));
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t vpe_get_element_size_in_bytes(enum vpe_surface_pixel_format format, int plane_idx)
|
uint8_t vpe_get_element_size_in_bytes(enum vpe_surface_pixel_format format, int plane_idx)
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
// nv12/21
|
// nv12/21
|
||||||
|
@ -49,7 +49,8 @@ struct cdc_fe_funcs {
|
|||||||
uint32_t vupdate_width, uint32_t vready_offset);
|
uint32_t vupdate_width, uint32_t vready_offset);
|
||||||
|
|
||||||
void (*program_p2b_config)(struct cdc_fe *cdc_fe, enum vpe_surface_pixel_format format,
|
void (*program_p2b_config)(struct cdc_fe *cdc_fe, enum vpe_surface_pixel_format format,
|
||||||
enum vpe_swizzle_mode_values swizzle, const struct vpe_rect *viewport);
|
enum vpe_swizzle_mode_values swizzle, const struct vpe_rect *viewport,
|
||||||
|
const struct vpe_rect *viewport_c);
|
||||||
|
|
||||||
/** segment specific */
|
/** segment specific */
|
||||||
void (*program_viewport)(
|
void (*program_viewport)(
|
||||||
@ -63,7 +64,8 @@ struct cdc_be_funcs {
|
|||||||
uint32_t vupdate_width, uint32_t vready_offset);
|
uint32_t vupdate_width, uint32_t vready_offset);
|
||||||
|
|
||||||
void (*program_p2b_config)(struct cdc_be *cdc_be, enum vpe_surface_pixel_format format,
|
void (*program_p2b_config)(struct cdc_be *cdc_be, enum vpe_surface_pixel_format format,
|
||||||
enum vpe_swizzle_mode_values swizzle, const struct vpe_rect *viewport);
|
enum vpe_swizzle_mode_values swizzle, const struct vpe_rect *viewport,
|
||||||
|
const struct vpe_rect *viewport_c);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cdc_fe {
|
struct cdc_fe {
|
||||||
|
@ -88,6 +88,8 @@ enum vpe_status vpe_check_input_support(struct vpe *vpe, const struct vpe_stream
|
|||||||
enum vpe_status vpe_check_tone_map_support(
|
enum vpe_status vpe_check_tone_map_support(
|
||||||
struct vpe *vpe, const struct vpe_stream *stream, const struct vpe_build_param *param);
|
struct vpe *vpe, const struct vpe_stream *stream, const struct vpe_build_param *param);
|
||||||
|
|
||||||
|
uint8_t vpe_get_element_size_in_bytes(enum vpe_surface_pixel_format format, int plane_idx);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user