Re: [PATCH 1/2] drm/amdgpu/display: check if fbc is available in set_static_screen_control

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

 



On 2018-11-05 2:27 p.m., Alex Deucher wrote:
> The value is dependent on whether fbc is available.
> 
> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> 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 4789270c29d9..6c9299e33f34 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
> @@ -1738,6 +1738,7 @@ static void get_position(struct pipe_ctx **pipe_ctx,
>  static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
>  		int num_pipes, const struct dc_static_screen_events *events)
>  {
> +	struct dc *dc = pipe_ctx[0]->stream->ctx->dc;

pipe_ctx[0] could be undefined if num_pipes == 0. I don't think this should happen but I can see a bunch of ways dc_stream_set_static_screen_events might call this with num_pipes=0. Maybe best to guard against it.

Harry

>  	unsigned int i;
>  	unsigned int value = 0;
>  
> @@ -1750,7 +1751,8 @@ static void set_static_screen_control(struct pipe_ctx **pipe_ctx,
>  	if (events->force_trigger)
>  		value |= 0x1;
>  
> -	value |= 0x84;
> +	if (dc->fbc_compressor)
> +		value |= 0x84;
>  
>  	for (i = 0; i < num_pipes; i++)
>  		pipe_ctx[i]->stream_res.tg->funcs->
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
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