drm/amd/display: add getter routine to retrieve mpcc mux
authorJosip Pavic <Josip.Pavic@amd.com>
Fri, 11 Dec 2020 05:09:11 +0000 (00:09 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 23 Dec 2020 20:02:55 +0000 (15:02 -0500)
[Why & How]
Add function to identify which MPCC is providing input to a specified OPP

Signed-off-by: Josip Pavic <Josip.Pavic@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h

index 3fcd408..a46cb20 100644 (file)
@@ -467,6 +467,17 @@ void mpc1_cursor_lock(struct mpc *mpc, int opp_id, bool lock)
        REG_SET(CUR[opp_id], 0, CUR_VUPDATE_LOCK_SET, lock ? 1 : 0);
 }
 
+unsigned int mpc1_get_mpc_out_mux(struct mpc *mpc, int opp_id)
+{
+       struct dcn10_mpc *mpc10 = TO_DCN10_MPC(mpc);
+       uint32_t val;
+
+       if (opp_id < MAX_OPP && REG(MUX[opp_id]))
+               REG_GET(MUX[opp_id], MPC_OUT_MUX, &val);
+
+       return val;
+}
+
 static const struct mpc_funcs dcn10_mpc_funcs = {
        .read_mpcc_state = mpc1_read_mpcc_state,
        .insert_plane = mpc1_insert_plane,
@@ -483,6 +494,7 @@ static const struct mpc_funcs dcn10_mpc_funcs = {
        .set_denorm_clamp = NULL,
        .set_output_csc = NULL,
        .set_output_gamma = NULL,
+       .get_mpc_out_mux = mpc1_get_mpc_out_mux,
 };
 
 void dcn10_mpc_construct(struct dcn10_mpc *mpc10,
index 66a4719..dbfffc6 100644 (file)
@@ -200,4 +200,5 @@ void mpc1_read_mpcc_state(
 
 void mpc1_cursor_lock(struct mpc *mpc, int opp_id, bool lock);
 
+unsigned int mpc1_get_mpc_out_mux(struct mpc *mpc, int opp_id);
 #endif
index 99cc095..6a99fdd 100644 (file)
@@ -556,6 +556,7 @@ const struct mpc_funcs dcn20_mpc_funcs = {
        .set_ocsc_default = mpc2_set_ocsc_default,
        .set_output_gamma = mpc2_set_output_gamma,
        .power_on_mpc_mem_pwr = mpc20_power_on_ogam_lut,
+       .get_mpc_out_mux = mpc1_get_mpc_out_mux,
 };
 
 void dcn20_mpc_construct(struct dcn20_mpc *mpc20,
index d7d053f..3e6f760 100644 (file)
@@ -1428,6 +1428,7 @@ const struct mpc_funcs dcn30_mpc_funcs = {
        .program_3dlut = mpc3_program_3dlut,
        .release_rmu = mpcc3_release_rmu,
        .power_on_mpc_mem_pwr = mpc20_power_on_ogam_lut,
+       .get_mpc_out_mux = mpc1_get_mpc_out_mux,
 
 };
 
index 879f502..75c77ad 100644 (file)
@@ -359,6 +359,10 @@ struct mpc_funcs {
 
        int (*release_rmu)(struct mpc *mpc, int mpcc_id);
 
+       unsigned int (*get_mpc_out_mux)(
+                       struct mpc *mpc,
+                       int opp_id);
+
 };
 
 #endif