Commit 146a9f63 authored by Krunoslav Kovac's avatar Krunoslav Kovac Committed by Alex Deucher

drm/amd/display: Pass full 3x4 remap matrix for color transform

Signed-off-by: default avatarKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 03736f4c
...@@ -413,12 +413,14 @@ struct dc_cursor_mi_param { ...@@ -413,12 +413,14 @@ struct dc_cursor_mi_param {
enum { enum {
GAMMA_RGB_256_ENTRIES = 256, GAMMA_RGB_256_ENTRIES = 256,
GAMMA_RGB_FLOAT_1024_ENTRIES = 1024, GAMMA_RGB_FLOAT_1024_ENTRIES = 1024,
GAMMA_MAX_ENTRIES = 1024 GAMMA_CS_TFM_1D_ENTRIES = 4096,
GAMMA_MAX_ENTRIES = 4096
}; };
enum dc_gamma_type { enum dc_gamma_type {
GAMMA_RGB_256 = 1, GAMMA_RGB_256 = 1,
GAMMA_RGB_FLOAT_1024 = 2 GAMMA_RGB_FLOAT_1024 = 2,
GAMMA_CS_TFM_1D = 3,
}; };
struct dc_gamma { struct dc_gamma {
......
...@@ -879,6 +879,7 @@ static void dce_transform_set_gamut_remap( ...@@ -879,6 +879,7 @@ static void dce_transform_set_gamut_remap(
const struct xfm_grph_csc_adjustment *adjust) const struct xfm_grph_csc_adjustment *adjust)
{ {
struct dce_transform *xfm_dce = TO_DCE_TRANSFORM(xfm); struct dce_transform *xfm_dce = TO_DCE_TRANSFORM(xfm);
int i = 0;
if (adjust->gamut_adjust_type != GRAPHICS_GAMUT_ADJUST_TYPE_SW) if (adjust->gamut_adjust_type != GRAPHICS_GAMUT_ADJUST_TYPE_SW)
/* Bypass if type is bypass or hw */ /* Bypass if type is bypass or hw */
...@@ -887,20 +888,8 @@ static void dce_transform_set_gamut_remap( ...@@ -887,20 +888,8 @@ static void dce_transform_set_gamut_remap(
struct fixed31_32 arr_matrix[GAMUT_MATRIX_SIZE]; struct fixed31_32 arr_matrix[GAMUT_MATRIX_SIZE];
uint16_t arr_reg_val[GAMUT_MATRIX_SIZE]; uint16_t arr_reg_val[GAMUT_MATRIX_SIZE];
arr_matrix[0] = adjust->temperature_matrix[0]; for (i = 0; i < GAMUT_MATRIX_SIZE; i++)
arr_matrix[1] = adjust->temperature_matrix[1]; arr_matrix[i] = adjust->temperature_matrix[i];
arr_matrix[2] = adjust->temperature_matrix[2];
arr_matrix[3] = dal_fixed31_32_zero;
arr_matrix[4] = adjust->temperature_matrix[3];
arr_matrix[5] = adjust->temperature_matrix[4];
arr_matrix[6] = adjust->temperature_matrix[5];
arr_matrix[7] = dal_fixed31_32_zero;
arr_matrix[8] = adjust->temperature_matrix[6];
arr_matrix[9] = adjust->temperature_matrix[7];
arr_matrix[10] = adjust->temperature_matrix[8];
arr_matrix[11] = dal_fixed31_32_zero;
convert_float_matrix( convert_float_matrix(
arr_reg_val, arr_matrix, GAMUT_MATRIX_SIZE); arr_reg_val, arr_matrix, GAMUT_MATRIX_SIZE);
......
...@@ -2121,6 +2121,7 @@ static void program_surface_visibility(const struct dc *dc, ...@@ -2121,6 +2121,7 @@ static void program_surface_visibility(const struct dc *dc,
static void program_gamut_remap(struct pipe_ctx *pipe_ctx) static void program_gamut_remap(struct pipe_ctx *pipe_ctx)
{ {
int i = 0;
struct xfm_grph_csc_adjustment adjust; struct xfm_grph_csc_adjustment adjust;
memset(&adjust, 0, sizeof(adjust)); memset(&adjust, 0, sizeof(adjust));
adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS; adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
...@@ -2128,33 +2129,10 @@ static void program_gamut_remap(struct pipe_ctx *pipe_ctx) ...@@ -2128,33 +2129,10 @@ static void program_gamut_remap(struct pipe_ctx *pipe_ctx)
if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) { if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) {
adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW; adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
adjust.temperature_matrix[0] =
pipe_ctx->stream-> for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++)
gamut_remap_matrix.matrix[0]; adjust.temperature_matrix[i] =
adjust.temperature_matrix[1] = pipe_ctx->stream->gamut_remap_matrix.matrix[i];
pipe_ctx->stream->
gamut_remap_matrix.matrix[1];
adjust.temperature_matrix[2] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[2];
adjust.temperature_matrix[3] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[4];
adjust.temperature_matrix[4] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[5];
adjust.temperature_matrix[5] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[6];
adjust.temperature_matrix[6] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[8];
adjust.temperature_matrix[7] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[9];
adjust.temperature_matrix[8] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[10];
} }
pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust); pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust);
...@@ -2195,33 +2173,10 @@ static void set_plane_config( ...@@ -2195,33 +2173,10 @@ static void set_plane_config(
if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) { if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) {
adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW; adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
adjust.temperature_matrix[0] =
pipe_ctx->stream-> for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++)
gamut_remap_matrix.matrix[0]; adjust.temperature_matrix[i] =
adjust.temperature_matrix[1] = pipe_ctx->stream->gamut_remap_matrix.matrix[i];
pipe_ctx->stream->
gamut_remap_matrix.matrix[1];
adjust.temperature_matrix[2] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[2];
adjust.temperature_matrix[3] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[4];
adjust.temperature_matrix[4] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[5];
adjust.temperature_matrix[5] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[6];
adjust.temperature_matrix[6] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[8];
adjust.temperature_matrix[7] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[9];
adjust.temperature_matrix[8] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[10];
} }
pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust); pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust);
...@@ -2689,33 +2644,10 @@ static void dce110_program_front_end_for_pipe( ...@@ -2689,33 +2644,10 @@ static void dce110_program_front_end_for_pipe(
if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) { if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) {
adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW; adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
adjust.temperature_matrix[0] =
pipe_ctx->stream-> for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++)
gamut_remap_matrix.matrix[0]; adjust.temperature_matrix[i] =
adjust.temperature_matrix[1] = pipe_ctx->stream->gamut_remap_matrix.matrix[i];
pipe_ctx->stream->
gamut_remap_matrix.matrix[1];
adjust.temperature_matrix[2] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[2];
adjust.temperature_matrix[3] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[4];
adjust.temperature_matrix[4] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[5];
adjust.temperature_matrix[5] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[6];
adjust.temperature_matrix[6] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[8];
adjust.temperature_matrix[7] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[9];
adjust.temperature_matrix[8] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[10];
} }
pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust); pipe_ctx->plane_res.xfm->funcs->transform_set_gamut_remap(pipe_ctx->plane_res.xfm, &adjust);
......
...@@ -193,6 +193,7 @@ void dpp1_cm_set_gamut_remap( ...@@ -193,6 +193,7 @@ void dpp1_cm_set_gamut_remap(
const struct dpp_grph_csc_adjustment *adjust) const struct dpp_grph_csc_adjustment *adjust)
{ {
struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
int i = 0;
if (adjust->gamut_adjust_type != GRAPHICS_GAMUT_ADJUST_TYPE_SW) if (adjust->gamut_adjust_type != GRAPHICS_GAMUT_ADJUST_TYPE_SW)
/* Bypass if type is bypass or hw */ /* Bypass if type is bypass or hw */
...@@ -201,20 +202,8 @@ void dpp1_cm_set_gamut_remap( ...@@ -201,20 +202,8 @@ void dpp1_cm_set_gamut_remap(
struct fixed31_32 arr_matrix[12]; struct fixed31_32 arr_matrix[12];
uint16_t arr_reg_val[12]; uint16_t arr_reg_val[12];
arr_matrix[0] = adjust->temperature_matrix[0]; for (i = 0; i < 12; i++)
arr_matrix[1] = adjust->temperature_matrix[1]; arr_matrix[i] = adjust->temperature_matrix[i];
arr_matrix[2] = adjust->temperature_matrix[2];
arr_matrix[3] = dal_fixed31_32_zero;
arr_matrix[4] = adjust->temperature_matrix[3];
arr_matrix[5] = adjust->temperature_matrix[4];
arr_matrix[6] = adjust->temperature_matrix[5];
arr_matrix[7] = dal_fixed31_32_zero;
arr_matrix[8] = adjust->temperature_matrix[6];
arr_matrix[9] = adjust->temperature_matrix[7];
arr_matrix[10] = adjust->temperature_matrix[8];
arr_matrix[11] = dal_fixed31_32_zero;
convert_float_matrix( convert_float_matrix(
arr_reg_val, arr_matrix, 12); arr_reg_val, arr_matrix, 12);
......
...@@ -1380,6 +1380,7 @@ static void dcn10_enable_plane( ...@@ -1380,6 +1380,7 @@ static void dcn10_enable_plane(
static void program_gamut_remap(struct pipe_ctx *pipe_ctx) static void program_gamut_remap(struct pipe_ctx *pipe_ctx)
{ {
int i = 0;
struct dpp_grph_csc_adjustment adjust; struct dpp_grph_csc_adjustment adjust;
memset(&adjust, 0, sizeof(adjust)); memset(&adjust, 0, sizeof(adjust));
adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS; adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
...@@ -1387,33 +1388,9 @@ static void program_gamut_remap(struct pipe_ctx *pipe_ctx) ...@@ -1387,33 +1388,9 @@ static void program_gamut_remap(struct pipe_ctx *pipe_ctx)
if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) { if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) {
adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW; adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
adjust.temperature_matrix[0] = for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++)
pipe_ctx->stream-> adjust.temperature_matrix[i] =
gamut_remap_matrix.matrix[0]; pipe_ctx->stream->gamut_remap_matrix.matrix[i];
adjust.temperature_matrix[1] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[1];
adjust.temperature_matrix[2] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[2];
adjust.temperature_matrix[3] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[4];
adjust.temperature_matrix[4] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[5];
adjust.temperature_matrix[5] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[6];
adjust.temperature_matrix[6] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[8];
adjust.temperature_matrix[7] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[9];
adjust.temperature_matrix[8] =
pipe_ctx->stream->
gamut_remap_matrix.matrix[10];
} }
pipe_ctx->plane_res.dpp->funcs->dpp_set_gamut_remap(pipe_ctx->plane_res.dpp, &adjust); pipe_ctx->plane_res.dpp->funcs->dpp_set_gamut_remap(pipe_ctx->plane_res.dpp, &adjust);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "dc_hw_types.h" #include "dc_hw_types.h"
#include "fixed31_32.h" #include "fixed31_32.h"
#define CSC_TEMPERATURE_MATRIX_SIZE 9 #define CSC_TEMPERATURE_MATRIX_SIZE 12
struct bit_depth_reduction_params; struct bit_depth_reduction_params;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment