<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com></div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature" style="color: inherit; background-color: inherit;">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
--</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jay<br>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM@amd.com><br>
<b>Sent:</b> Tuesday, April 23, 2024 9:34 PM<br>
<b>To:</b> Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com><br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM@amd.com>; Liu, Wenjing <Wenjing.Liu@amd.com>; Chung, ChiaHsuan (Tom) <ChiaHsuan.Chung@amd.com>; Lee, Alvin <Alvin.Lee2@amd.com>; Li, Roman
 <Roman.Li@amd.com>; Wu, Hersen <hersenxs.wu@amd.com>; Hung, Alex <Alex.Hung@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Dan Carpenter <dan.carpenter@linaro.org><br>
<b>Subject:</b> [PATCH v2] drm/amd/display: Remove redundant NULL check in dcn10_set_input_transfer_func</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">This commit removes an unnecessary NULL check in the<br>
`dcn10_set_input_transfer_func` function in the `dcn10_hwseq.c` file.<br>
The variable `tf` is assigned the address of<br>
`plane_state->in_transfer_func` unconditionally, so it can never be<br>
`NULL`. Therefore, the check `if (tf == NULL)` is unnecessary and has<br>
been removed.<br>
<br>
Fixes the below smatch warning:<br>
drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dcn10/dcn10_hwseq.c:1839 dcn10_set_input_transfer_func() warn: address of 'plane_state->in_transfer_func' is non-NULL<br>
<br>
Fixes: 285a7054bf81 ("drm/amd/display: Remove plane and stream pointers from dc scratch")<br>
Cc: Wenjing Liu <wenjing.liu@amd.com><br>
Cc: Tom Chung <chiahsuan.chung@amd.com><br>
Cc: Alvin Lee <alvin.lee2@amd.com><br>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com><br>
Cc: Roman Li <roman.li@amd.com><br>
Cc: Hersen Wu <hersenxs.wu@amd.com><br>
Cc: Alex Hung <alex.hung@amd.com><br>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com><br>
Cc: Harry Wentland <harry.wentland@amd.com><br>
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org><br>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com><br>
---<br>
v2:<br>
  - s/dcn20/dcn10 in commit title<br>
<br>
 drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 4 +---<br>
 1 file changed, 1 insertion(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c<br>
index 32a07ab74c51..f258914a4838 100644<br>
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c<br>
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c<br>
@@ -1837,9 +1837,7 @@ bool dcn10_set_input_transfer_func(struct dc *dc, struct pipe_ctx *pipe_ctx,<br>
                         && dce_use_lut(plane_state->format))<br>
                 dpp_base->funcs->dpp_program_input_lut(dpp_base, &plane_state->gamma_correction);<br>
 <br>
-       if (tf == NULL)<br>
-               dpp_base->funcs->dpp_set_degamma(dpp_base, IPP_DEGAMMA_MODE_BYPASS);<br>
-       else if (tf->type == TF_TYPE_PREDEFINED) {<br>
+       if (tf->type == TF_TYPE_PREDEFINED) {<br>
                 switch (tf->tf) {<br>
                 case TRANSFER_FUNCTION_SRGB:<br>
                         dpp_base->funcs->dpp_set_degamma(dpp_base, IPP_DEGAMMA_MODE_HW_sRGB);<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>