AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
To: Andrey Grodzovsky
	<Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org>,
	"S, Shirish" <Shirish.S-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"sw.dl.display.sudo"
	<sw.dl.display.sudo-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH] drm/amd/display: check plane state before validating fbc
Date: Mon, 27 Nov 2017 09:28:46 -0500	[thread overview]
Message-ID: <a33f198c-10fc-4976-67f3-5243029da52c@amd.com> (raw)
In-Reply-To: <6ac8f56c-8782-901a-35f9-d54fac563000-5C7GfCeVMHo@public.gmane.org>



On 2017-11-27 07:38 AM, Andrey Grodzovsky wrote:
> 
> 
> On 11/26/2017 11:57 AM, Harry Wentland wrote:
>> On 2017-11-24 05:07 PM, Andrey Grodzovsky wrote:
>>> The patch is good, but why validate_fbc is being called from dce110_apply_ctx_to_hw (atomic_commit) ? It should be called from atomic_check.
>>>
>> Ideally yes, but I don't think this has any impact on bandwidth and mode validation, i.e. we should never fail to apply an atomic state, no matter whether we do FBC. If we let user-mode decide whether to do FBC or not it would need to be a property and check in atomic_check but I don't think it makes any sense to expose this outside DC.
>>
>> Harry
> 
> I see, as long as enable_fbc return code is ignored as it is today that ok.
> 

Maybe we just shouldn't return an error code here. dce110_apply_ctx_to_hw probably shouldn't return one either then, and apply_single_controller_ctx_to_hw_plane (just a couple lines before enable_fbc) shouldn't fail. I might have to look at those sometime.

Harry

> Thanks,
> Andrey
> 
>>
>>> Thanks,
>>> Andrey
>>>
>>> On 2017-11-22 02:13 AM, S, Shirish wrote:
>>>> From: Shirish S <shirish.s@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@amd.com>
>>>> Reviewed-by: Roman Li <Roman.Li@amd.com>
>>>> ---
>>>>    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@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-11-27 14:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1511334698-5752-1-git-send-email-shirish.s12@gmail.com>
     [not found] ` <1511334698-5752-1-git-send-email-shirish.s12-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-22  7:13   ` [PATCH] drm/amd/display: check plane state before validating fbc S, Shirish
     [not found]     ` <BN6PR12MB182648D32C4125E3124C7C8AF2200-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-11-23  0:49       ` Harry Wentland
2017-11-24 22:07       ` Andrey Grodzovsky
     [not found]         ` <c8ca42f2-1237-d13c-ad30-dd42a5d850f2-5C7GfCeVMHo@public.gmane.org>
2017-11-26 16:57           ` Harry Wentland
     [not found]             ` <6e85fe6c-ff85-cf10-be5b-a6f411f8b83d-5C7GfCeVMHo@public.gmane.org>
2017-11-27 12:38               ` Andrey Grodzovsky
     [not found]                 ` <6ac8f56c-8782-901a-35f9-d54fac563000-5C7GfCeVMHo@public.gmane.org>
2017-11-27 14:28                   ` Harry Wentland [this message]
     [not found]                     ` <a33f198c-10fc-4976-67f3-5243029da52c-5C7GfCeVMHo@public.gmane.org>
2017-11-27 14:37                       ` Andrey Grodzovsky
     [not found]                         ` <80a8e63b-6b84-c880-ba96-58534d3fff44-5C7GfCeVMHo@public.gmane.org>
2017-11-27 14:56                           ` Harry Wentland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a33f198c-10fc-4976-67f3-5243029da52c@amd.com \
    --to=harry.wentland-5c7gfcevmho@public.gmane.org \
    --cc=Andrey.Grodzovsky-5C7GfCeVMHo@public.gmane.org \
    --cc=Shirish.S-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=sw.dl.display.sudo-5C7GfCeVMHo@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox