Commit 290129c2 authored by Qingqing Zhuo's avatar Qingqing Zhuo Committed by Alex Deucher

drm/amd/display: Add CM_BYPASS via debug option

[Why]
bypass CM block and MPC ogam for debug or triage use.

[How]
create a new flag cm_bypass_mode, which will set both CM_CONTROL
and MPCC_OGAM_MODE to bypass when set to 1.
Signed-off-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Reviewed-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a2080098
...@@ -379,6 +379,9 @@ struct dc_debug_options { ...@@ -379,6 +379,9 @@ struct dc_debug_options {
*/ */
unsigned int force_min_dcfclk_mhz; unsigned int force_min_dcfclk_mhz;
bool disable_timing_sync; bool disable_timing_sync;
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
bool cm_in_bypass;
#endif
}; };
struct dc_debug_data { struct dc_debug_data {
......
...@@ -52,7 +52,12 @@ static void dpp2_enable_cm_block( ...@@ -52,7 +52,12 @@ static void dpp2_enable_cm_block(
{ {
struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base); struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
REG_UPDATE(CM_CONTROL, CM_BYPASS, 0); unsigned int cm_bypass_mode = 0;
//Temp, put CM in bypass mode
if (dpp_base->ctx->dc->debug.cm_in_bypass)
cm_bypass_mode = 1;
REG_UPDATE(CM_CONTROL, CM_BYPASS, cm_bypass_mode);
} }
......
...@@ -368,6 +368,11 @@ void apply_DEDCN20_305_wa( ...@@ -368,6 +368,11 @@ void apply_DEDCN20_305_wa(
{ {
struct dcn20_mpc *mpc20 = TO_DCN20_MPC(mpc); struct dcn20_mpc *mpc20 = TO_DCN20_MPC(mpc);
if (mpc->ctx->dc->debug.cm_in_bypass) {
REG_SET(MPCC_OGAM_MODE[mpcc_id], 0, MPCC_OGAM_MODE, 0);
return;
}
if (mpc->ctx->dc->work_arounds.dedcn20_305_wa == false) { if (mpc->ctx->dc->work_arounds.dedcn20_305_wa == false) {
/*hw fixed in new review*/ /*hw fixed in new review*/
return; return;
...@@ -390,10 +395,16 @@ void mpc2_set_output_gamma( ...@@ -390,10 +395,16 @@ void mpc2_set_output_gamma(
enum dc_lut_mode next_mode; enum dc_lut_mode next_mode;
struct dcn20_mpc *mpc20 = TO_DCN20_MPC(mpc); struct dcn20_mpc *mpc20 = TO_DCN20_MPC(mpc);
if (mpc->ctx->dc->debug.cm_in_bypass) {
REG_SET(MPCC_OGAM_MODE[mpcc_id], 0, MPCC_OGAM_MODE, 0);
return;
}
if (params == NULL) { if (params == NULL) {
REG_SET(MPCC_OGAM_MODE[mpcc_id], 0, MPCC_OGAM_MODE, 0); REG_SET(MPCC_OGAM_MODE[mpcc_id], 0, MPCC_OGAM_MODE, 0);
return; return;
} }
current_mode = mpc20_get_ogam_current(mpc, mpcc_id); current_mode = mpc20_get_ogam_current(mpc, mpcc_id);
if (current_mode == LUT_BYPASS || current_mode == LUT_RAM_A) if (current_mode == LUT_BYPASS || current_mode == LUT_RAM_A)
next_mode = LUT_RAM_B; next_mode = LUT_RAM_B;
......
...@@ -42,6 +42,7 @@ struct dpp { ...@@ -42,6 +42,7 @@ struct dpp {
#if defined(CONFIG_DRM_AMD_DC_DCN2_0) #if defined(CONFIG_DRM_AMD_DC_DCN2_0)
struct pwl_params shaper_params; struct pwl_params shaper_params;
bool cm_bypass_mode;
#endif #endif
}; };
......
...@@ -128,6 +128,7 @@ struct mpc { ...@@ -128,6 +128,7 @@ struct mpc {
struct mpcc mpcc_array[MAX_MPCC]; struct mpcc mpcc_array[MAX_MPCC];
#if defined(CONFIG_DRM_AMD_DC_DCN2_0) #if defined(CONFIG_DRM_AMD_DC_DCN2_0)
struct pwl_params blender_params; struct pwl_params blender_params;
bool cm_bypass_mode;
#endif #endif
}; };
......
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