Commit 93984bbc authored by Shirish S's avatar Shirish S Committed by Alex Deucher

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: default avatarShirish S <shirish.s@amd.com>
Reviewed-by: default avatarRoman Li <Roman.Li@amd.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8ffca5dc
...@@ -1774,6 +1774,10 @@ static enum dc_status validate_fbc(struct dc *dc, ...@@ -1774,6 +1774,10 @@ static enum dc_status validate_fbc(struct dc *dc,
if (pipe_ctx->stream->sink->link->psr_enabled) if (pipe_ctx->stream->sink->link->psr_enabled)
return DC_ERROR_UNEXPECTED; return DC_ERROR_UNEXPECTED;
/* Nothing to compress */
if (!pipe_ctx->plane_state)
return DC_ERROR_UNEXPECTED;
/* Only for non-linear tiling */ /* Only for non-linear tiling */
if (pipe_ctx->plane_state->tiling_info.gfx8.array_mode == DC_ARRAY_LINEAR_GENERAL) if (pipe_ctx->plane_state->tiling_info.gfx8.array_mode == DC_ARRAY_LINEAR_GENERAL)
return DC_ERROR_UNEXPECTED; return DC_ERROR_UNEXPECTED;
......
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