Commit 8459f633 authored by Eric Yang's avatar Eric Yang Committed by Alex Deucher

drm/amd/display: Handle case when stream not found in set_dpms

When validate with context fail to add stream to the context, we have
a case where set_dpms won't be able to find the stream that need to
be disabled.
Signed-off-by: default avatarEric Yang <Eric.Yang2@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c196cbe0
...@@ -363,7 +363,7 @@ void set_dpms( ...@@ -363,7 +363,7 @@ void set_dpms(
struct dc_stream_state *stream, struct dc_stream_state *stream,
bool dpms_off) bool dpms_off)
{ {
struct pipe_ctx *pipe_ctx; struct pipe_ctx *pipe_ctx = NULL;
int i; int i;
for (i = 0; i < MAX_PIPES; i++) { for (i = 0; i < MAX_PIPES; i++) {
...@@ -373,6 +373,11 @@ void set_dpms( ...@@ -373,6 +373,11 @@ void set_dpms(
} }
} }
if (!pipe_ctx) {
ASSERT(0);
return;
}
if (stream->dpms_off != dpms_off) { if (stream->dpms_off != dpms_off) {
stream->dpms_off = dpms_off; stream->dpms_off = dpms_off;
if (dpms_off) if (dpms_off)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment