drm/amdgpu/display: Initialize gamma correction mode variable in dcn30_get_gamcor_cur...
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Sun, 11 Feb 2024 03:34:19 +0000 (09:04 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Feb 2024 19:18:43 +0000 (14:18 -0500)
commita82197e3a5f45450cbaf92095d8a51249dc44c79
tree438060ec185685991b145fc1593005eae7205d56
parent2f542421a47e8246e9b7d2c6508fe3a6e6c63078
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: 03f54d7d3448 ("drm/amd/display: Add DCN3 DPP")
Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Suggested-by: Roman Li <roman.li@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp_cm.c