[PATCH] drm/amd/display: Fix null pointer when setting backlight

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes: c894d9f208f9 (drm/amd/display: Fixed dim around 1sec when resume
from S3)

Signed-off-by: Harry Wentland <harry.wentland at amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 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 e6d5dcb35e96..eeb04471b2f5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1960,10 +1960,12 @@ bool dc_link_set_backlight_level(const struct dc_link *link, uint32_t level,
 		(abm->funcs->set_backlight_level == NULL))
 		return false;
 
-	if (stream->bl_pwm_level == 0)
-		frame_ramp = 0;
+	if (stream) {
+		if (stream->bl_pwm_level == 0)
+			frame_ramp = 0;
 
-	((struct dc_stream_state *)stream)->bl_pwm_level = level;
+		((struct dc_stream_state *)stream)->bl_pwm_level = level;
+	}
 
 	use_smooth_brightness = dmcu->funcs->is_dmcu_initialized(dmcu);
 
-- 
2.14.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux