diff options
author | Shirish S <shirish.s@amd.com> | 2017-11-20 06:07:08 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-11-28 23:55:33 +0100 |
commit | 93984bbc70b3f321b8f6a3ec303e31b084e54230 (patch) | |
tree | ec98f14608bed8c9923ef901a0572f1749377b33 /drivers | |
parent | drm/amd/display: Do DC mode-change check when adding CRTCs (diff) | |
download | linux-93984bbc70b3f321b8f6a3ec303e31b084e54230.tar.xz linux-93984bbc70b3f321b8f6a3ec303e31b084e54230.zip |
drm/amd/display: check plane state before validating fbc
While validation fbc, array_mode of the pipe is accessed
without checking plane_state exists for it.
Causing to null pointer dereferencing followed by
reboot when a crtc associated with external display(not
connected) is page flipped.
This patch adds a check for plane_state before using
it to validate fbc.
Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c index be14a2665072..c3de7f305cd3 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c @@ -1774,6 +1774,10 @@ static enum dc_status validate_fbc(struct dc *dc, if (pipe_ctx->stream->sink->link->psr_enabled) return DC_ERROR_UNEXPECTED; + /* Nothing to compress */ + if (!pipe_ctx->plane_state) + return DC_ERROR_UNEXPECTED; + /* Only for non-linear tiling */ if (pipe_ctx->plane_state->tiling_info.gfx8.array_mode == DC_ARRAY_LINEAR_GENERAL) return DC_ERROR_UNEXPECTED; |