Skip to content

Commit a82197e

Browse files
srishanmalexdeucher
authored andcommitted
drm/amdgpu/display: Initialize gamma correction mode variable in dcn30_get_gamcor_current()
The dcn30_get_gamcor_current() function is responsible for determining the current gamma correction mode used by the display controller. However, the 'mode' variable, which stores the gamma correction mode, was not initialized before its first usage, leading to an uninitialized symbol error. Thus initializes the 'mode' variable with a default value of LUT_BYPASS before the conditional statements in the function, improves code clarity and stability, ensuring correct behavior of the dcn30_get_gamcor_current() function in determining the gamma correction mode. Fixes the below: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_dpp_cm.c:77 dpp30_get_gamcor_current() error: uninitialized symbol 'mode'. Fixes: 03f54d7 ("drm/amd/display: Add DCN3 DPP") Cc: Bhawanpreet Lakha <[email protected]> Cc: Rodrigo Siqueira <[email protected]> Cc: Aurabindo Pillai <[email protected]> Cc: Tom Chung <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> Suggested-by: Roman Li <[email protected]> Reviewed-by: Aurabindo Pillai <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 2f54242 commit a82197e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp_cm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,13 @@ static void dpp3_enable_cm_block(
5656

5757
static enum dc_lut_mode dpp30_get_gamcor_current(struct dpp *dpp_base)
5858
{
59-
enum dc_lut_mode mode;
59+
enum dc_lut_mode mode = LUT_BYPASS;
6060
uint32_t state_mode;
6161
uint32_t lut_mode;
6262
struct dcn3_dpp *dpp = TO_DCN30_DPP(dpp_base);
6363

6464
REG_GET(CM_GAMCOR_CONTROL, CM_GAMCOR_MODE_CURRENT, &state_mode);
6565

66-
if (state_mode == 0)
67-
mode = LUT_BYPASS;
68-
6966
if (state_mode == 2) {//Programmable RAM LUT
7067
REG_GET(CM_GAMCOR_CONTROL, CM_GAMCOR_SELECT_CURRENT, &lut_mode);
7168
if (lut_mode == 0)

0 commit comments

Comments
 (0)