From 596d9ff8cfbed371faa8cd69ec9a94d7691bbdc9 Mon Sep 17 00:00:00 2001 From: "Hsieh, Mike" Date: Wed, 4 Dec 2024 13:34:17 +0800 Subject: [PATCH] amd/vpelib: Refactor 3D LUT parameters Reviewed-by: Jesse Agate Reviewed-by: Krunoslav Kovac Acked-by: Chih-Wei Chien Signed-off-by: Mike Hsieh Part-of: --- src/amd/vpelib/inc/vpe_types.h | 4 +--- src/amd/vpelib/src/core/common.c | 4 ++++ src/amd/vpelib/src/core/inc/cdc.h | 2 ++ src/amd/vpelib/src/core/inc/config_writer.h | 1 + src/amd/vpelib/src/core/inc/hw_shared.h | 1 + src/amd/vpelib/src/core/vpelib.c | 1 - 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/amd/vpelib/inc/vpe_types.h b/src/amd/vpelib/inc/vpe_types.h index 9d3f72f3509..4892ba1d00c 100644 --- a/src/amd/vpelib/inc/vpe_types.h +++ b/src/amd/vpelib/inc/vpe_types.h @@ -483,7 +483,6 @@ struct vpe_debug_options { uint32_t mpc_crc_ctrl : 1; uint32_t skip_optimal_tap_check : 1; uint32_t disable_lut_caching : 1; /*< disable config caching for all luts */ - uint32_t bg_bit_depth; struct vpe_mem_low_power_enable_options enable_mem_low_power; @@ -750,10 +749,9 @@ struct vpe_tonemap_params { enum vpe_color_primaries lut_out_gamut; /**< Output color primary */ uint16_t input_pq_norm_factor; /**< Perceptual Quantizer normalization factor. */ - uint16_t lut_dim; /**< Size of one dimension of the 3D-LUT */ + uint16_t lut_dim; /**< Size of one dimension of the 3D-LUT */ union { uint16_t *lut_data; /**< Accessible to CPU */ - void *dma_lut_data; /**< Accessible to GPU. Only for fast load */ }; bool is_dma_lut; bool enable_3dlut; /**< Enable/Disable 3D-LUT */ diff --git a/src/amd/vpelib/src/core/common.c b/src/amd/vpelib/src/core/common.c index f31b009a4e1..bf962bf8a6f 100644 --- a/src/amd/vpelib/src/core/common.c +++ b/src/amd/vpelib/src/core/common.c @@ -621,6 +621,10 @@ enum vpe_status vpe_check_tone_map_support( } } + if (is_3D_lut_enabled && stream->tm_params.lut_dim != LUT_DIM_9 && + stream->tm_params.lut_dim != LUT_DIM_17) { /* only support 9/17 cube */ + status = VPE_STATUS_BAD_TONE_MAP_PARAMS; + } return status; } diff --git a/src/amd/vpelib/src/core/inc/cdc.h b/src/amd/vpelib/src/core/inc/cdc.h index 190ebc2e40f..097daf2b033 100644 --- a/src/amd/vpelib/src/core/inc/cdc.h +++ b/src/amd/vpelib/src/core/inc/cdc.h @@ -25,6 +25,8 @@ #pragma once #include "vpe_types.h" +#include "hw_shared.h" +#include "color.h" #ifdef __cplusplus extern "C" { diff --git a/src/amd/vpelib/src/core/inc/config_writer.h b/src/amd/vpelib/src/core/inc/config_writer.h index cecb2e568ac..20a10f3ca57 100644 --- a/src/amd/vpelib/src/core/inc/config_writer.h +++ b/src/amd/vpelib/src/core/inc/config_writer.h @@ -25,6 +25,7 @@ #pragma once #include "vpe_types.h" +#include "hw_shared.h" #if defined(LITTLEENDIAN_CPU) #elif defined(BIGENDIAN_CPU) diff --git a/src/amd/vpelib/src/core/inc/hw_shared.h b/src/amd/vpelib/src/core/inc/hw_shared.h index 293f8c437f1..1bd371202e5 100644 --- a/src/amd/vpelib/src/core/inc/hw_shared.h +++ b/src/amd/vpelib/src/core/inc/hw_shared.h @@ -159,6 +159,7 @@ enum lut_dimension { LUT_DIM_9 = 9, LUT_DIM_17 = 17, }; + struct vpe_rgb { uint32_t red; uint32_t green; diff --git a/src/amd/vpelib/src/core/vpelib.c b/src/amd/vpelib/src/core/vpelib.c index 79d6f35ff20..ef1a2f83a44 100644 --- a/src/amd/vpelib/src/core/vpelib.c +++ b/src/amd/vpelib/src/core/vpelib.c @@ -242,7 +242,6 @@ struct vpe *vpe_create(const struct vpe_init_data *params) vpe_priv->scale_yuv_matrix = true; vpe_priv->collaborate_sync_index = 0; - return &vpe_priv->pub; }