]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Add HW change required mpc gamut remap
authorCharlene Liu <charlene.liu@amd.com>
Tue, 20 May 2025 16:03:44 +0000 (12:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Jun 2025 16:19:16 +0000 (12:19 -0400)
[WHAT]
Add HW change to required mpc gamut remap

Reviewed-by: Dmytro Laktyushkin <dmytro.laktyushkin@amd.com>
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_hw_types.h
drivers/gpu/drm/amd/display/dc/mpc/dcn401/dcn401_mpc.c
drivers/gpu/drm/amd/display/dc/mpc/dcn401/dcn401_mpc.h

index d562ddeca51260db98fc92ec3a4823d8164a9e53..a0e99db61410bc3630f8671018e002e94ba59d0a 100644 (file)
@@ -1103,7 +1103,8 @@ enum mpcc_gamut_remap_mode_select {
 enum mpcc_gamut_remap_id {
        MPCC_OGAM_GAMUT_REMAP,
        MPCC_MCM_FIRST_GAMUT_REMAP,
-       MPCC_MCM_SECOND_GAMUT_REMAP
+       MPCC_MCM_SECOND_GAMUT_REMAP,
+       MPCC_RMCM_GAMUT_REMAP,
 };
 
 enum cursor_matrix_mode {
index 98cf0cbd59ba0ea05638e6724bbc55d6cdef2685..99c10a7acbf36724e3cefd07a7e5b681b399fd18 100644 (file)
@@ -294,7 +294,7 @@ void mpc401_program_3dlut_size(struct mpc *mpc, bool is_17x17x17, int mpcc_id)
        REG_UPDATE(MPCC_MCM_3DLUT_MODE[mpcc_id], MPCC_MCM_3DLUT_SIZE, is_17x17x17 ? 0 : 1);
 }
 
-static void program_gamut_remap(
+void mpc_program_gamut_remap(
        struct mpc *mpc,
        unsigned int mpcc_id,
        const uint16_t *regval,
@@ -426,7 +426,7 @@ void mpc401_set_gamut_remap(
 
        if (adjust->gamut_adjust_type != GRAPHICS_GAMUT_ADJUST_TYPE_SW) {
                /* Bypass / Disable if type is bypass or hw */
-               program_gamut_remap(mpc, mpcc_id, NULL,
+               mpc_program_gamut_remap(mpc, mpcc_id, NULL,
                        adjust->mpcc_gamut_remap_block_id, MPCC_GAMUT_REMAP_MODE_SELECT_0);
        } else {
                struct fixed31_32 arr_matrix[12];
@@ -460,12 +460,12 @@ void mpc401_set_gamut_remap(
                else
                        mode_select = MPCC_GAMUT_REMAP_MODE_SELECT_2;
 
-               program_gamut_remap(mpc, mpcc_id, arr_reg_val,
+               mpc_program_gamut_remap(mpc, mpcc_id, arr_reg_val,
                        adjust->mpcc_gamut_remap_block_id, mode_select);
        }
 }
 
-static void read_gamut_remap(struct mpc *mpc,
+void mpc_read_gamut_remap(struct mpc *mpc,
        int mpcc_id,
        uint16_t *regval,
        enum mpcc_gamut_remap_id gamut_remap_block_id,
@@ -563,7 +563,7 @@ void mpc401_get_gamut_remap(struct mpc *mpc,
        uint16_t arr_reg_val[12] = {0};
        uint32_t mode_select;
 
-       read_gamut_remap(mpc, mpcc_id, arr_reg_val, adjust->mpcc_gamut_remap_block_id, &mode_select);
+       mpc_read_gamut_remap(mpc, mpcc_id, arr_reg_val, adjust->mpcc_gamut_remap_block_id, &mode_select);
 
        if (mode_select == MPCC_GAMUT_REMAP_MODE_SELECT_0) {
                adjust->gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
index 8e35ebc603a9dd10a3efa8fb2d9a7ba996f9d8bc..eb0c68d0b0c76569e1f0714b6efd218a7bcfa6bf 100644 (file)
@@ -241,6 +241,19 @@ void mpc401_update_3dlut_fast_load_select(
        int mpcc_id,
        int hubp_idx);
 
+void mpc_program_gamut_remap(
+       struct mpc *mpc,
+       unsigned int mpcc_id,
+       const uint16_t *regval,
+       enum mpcc_gamut_remap_id gamut_remap_block_id,
+       enum mpcc_gamut_remap_mode_select mode_select);
+
+void mpc_read_gamut_remap(struct mpc *mpc,
+       int mpcc_id,
+       uint16_t *regval,
+       enum mpcc_gamut_remap_id gamut_remap_block_id,
+       uint32_t *mode_select);
+
 void mpc401_update_3dlut_fast_load_select(
        struct mpc *mpc,
        int mpcc_id,