diff options
author | Eric Yang <[email protected]> | 2017-10-03 18:15:51 -0400 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2017-10-21 16:48:05 -0400 |
commit | 8459f633b65a81979b9b233ed0a91a9fdc98b7bd (patch) | |
tree | 4812e53e0530ee26803beb024f75c83563fb4166 | |
parent | c196cbe065da1c9b5f7683af9cdd0889760151c1 (diff) |
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: Eric Yang <[email protected]>
Reviewed-by: Tony Cheng <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 4cdb855ef855..fe66c6a21bc3 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -363,7 +363,7 @@ void set_dpms( struct dc_stream_state *stream, bool dpms_off) { - struct pipe_ctx *pipe_ctx; + struct pipe_ctx *pipe_ctx = NULL; int i; for (i = 0; i < MAX_PIPES; i++) { @@ -373,6 +373,11 @@ void set_dpms( } } + if (!pipe_ctx) { + ASSERT(0); + return; + } + if (stream->dpms_off != dpms_off) { stream->dpms_off = dpms_off; if (dpms_off) |