From: Nicholas Kazlauskas <nicholas.kazlaus...@amd.com>

[Why]
On ASIC without ABM support (most dGPU) we run into a null pointer
dereference when attempting to set the backlight level.

[How]
This function requires ABM, so fix up the condition to only allow
DMCU to be optional.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlaus...@amd.com>
Reviewed-by: Wyatt Wood <wyatt.w...@amd.com>
Acked-by: Rodrigo Siqueira <rodrigo.sique...@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 1c5c11d6347e..a926c1c3f57d 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -2462,8 +2462,7 @@ bool dc_link_set_backlight_level(const struct dc_link 
*link,
        int i;
        DC_LOGGER_INIT(link->ctx->logger);
 
-       if ((dmcu == NULL && abm == NULL) ||
-               (abm->funcs->set_backlight_level_pwm == NULL))
+       if (abm == NULL || (abm->funcs->set_backlight_level_pwm == NULL))
                return false;
 
        if (dmcu)
-- 
2.26.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to