[PATCH] drm/amd/display: check plane state before validating fbc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2017-11-22 02:13 AM, S, Shirish wrote:
> From: Shirish S <shirish.s at amd.com>
> 
> 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 at amd.com>
> Reviewed-by: Roman Li <Roman.Li at amd.com>

Reviewed-by: Harry Wentland <harry.wentland at amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> 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 ee3b944..a6cd63a 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
> @@ -1724,6 +1724,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;
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> 


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux