Skip to contentSkip to conversation

drm/amd/display: Fix null pointer when setting backlight

PATCH In review Harry Wentland 2 participants 2 messages Mar 14, 2018 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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

from S3)

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +5 -3
index e6d5dcb35e96..eeb04471b2f5 100644
@@ -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);
 
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20180314135537.20052-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

Acked-by
#2 lore raw
Quoted 4 lines · Harry Wentland
Fixes c894d9f208f9 (drm/amd/display: Fixed dim around 1sec when resume

from S3)

Quoted 27 lines
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +5 -4
index e6d5dcb35e96..eeb04471b2f5 100644
@@ -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

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx