amd/vpelib: Apply external CSC
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

[WHY]
3x4 matrix passed in as part of 3DLUT compound.
Due to HW limitations of coeffs, hdr_mult may need to be used.

Acked-by: Chuanyu Tseng <Chuanyu.Tseng@amd.com>
Signed-off-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40210>
This commit is contained in:
Kovac, Krunoslav 2026-02-06 14:11:01 -05:00 committed by Chuanyu Tseng
parent 852b85ed48
commit ed6a576533
3 changed files with 9 additions and 8 deletions

View file

@ -34,6 +34,7 @@
#include "3dlut_builder.h"
#include "shaper_builder.h"
#include "geometric_scaling.h"
#include "conversion.h"
static void color_check_input_cm_update(struct vpe_priv *vpe_priv, struct stream_ctx *stream_ctx,
const struct vpe_color_space *vcs, const struct vpe_color_adjust *adjustments,
@ -702,15 +703,15 @@ enum vpe_status vpe_color_update_color_space_and_tf(
return status;
}
enum vpe_status vpe_color_tm_update_hdr_mult(uint16_t shaper_in_exp_max, uint32_t peak_white,
struct fixed31_32 *hdr_multiplier, bool enable3dlut, bool is_fp16)
enum vpe_status vpe_color_tm_update_hdr_mult(
uint32_t peak_white, struct fixed31_32 *hdr_multiplier, bool enable3dlut, bool is_g10)
{
if (enable3dlut) {
struct fixed31_32 shaper_in_gain;
struct fixed31_32 pq_norm_gain;
shaper_in_gain = vpe_fixpt_from_int((long long)1 << shaper_in_exp_max);
if (is_fp16) {
shaper_in_gain = vpe_fixpt_from_int((long long)1 << SHAPER_EXP_MAX_IN);
if (is_g10) {
*hdr_multiplier = vpe_fixpt_div_int(shaper_in_gain, CCCS_NORM);
} else {
// HDRMULT = 2^shaper_in_exp_max*(1/PQ(x))
@ -859,7 +860,7 @@ enum vpe_status vpe_color_update_movable_cm(
// Update the HDR multiplier based on the shaper normalization factor and other
// parameters.
vpe_color_tm_update_hdr_mult(SHAPER_EXP_MAX_IN, shaper_norm_factor,
vpe_color_tm_update_hdr_mult(shaper_norm_factor,
&stream_ctx->lut3d_func->hdr_multiplier, enable_3dlut,
stream_ctx->stream.surface_info.cs.tf == VPE_TF_G10);

View file

@ -275,8 +275,8 @@ void vpe_convert_full_range_color_enum(enum color_space *cs);
enum vpe_status vpe_color_update_whitepoint(
const struct vpe_priv *vpe_priv, const struct vpe_build_param *param);
enum vpe_status vpe_color_tm_update_hdr_mult(uint16_t shaper_in_exp_max, uint32_t peak_white,
struct fixed31_32 *hdr_multiplier, bool enable_3dlut, bool is_fp16);
enum vpe_status vpe_color_tm_update_hdr_mult(
uint32_t peak_white, struct fixed31_32 *hdr_multiplier, bool enable_3dlut, bool is_fp16);
enum vpe_status vpe_color_build_shaper_cs(const struct vpe_tonemap_params *tm_params,
struct vpe_surface_info *surface_info, struct vpe_color_space *tm_out_cs);

View file

@ -553,7 +553,7 @@ enum vpe_status vpe_check_support(
}
if (status == VPE_STATUS_OK) {
if (status == VPE_STATUS_OK) {
// output checking - check per asic support
status = vpe_check_output_support(vpe, param);
if (status != VPE_STATUS_OK) {