From: "Kazlauskas, Nicholas" <Nicholas.Kazlauskas-5C7GfCeVMHo@public.gmane.org>
To: "Ernst Sjöstrand"
<ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 4/6] drm/amd/amdgpu: Check stream in amdgpu_dm_commit_planes
Date: Tue, 25 Jun 2019 18:45:05 +0000 [thread overview]
Message-ID: <e57dacfc-66fd-81e1-ec6d-7056fe70736d@amd.com> (raw)
In-Reply-To: <20190624151544.13934-4-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 6/24/19 11:15 AM, Ernst Sjöstrand wrote:
> Reported by smatch:
> amdgpu_dm.c:5637 amdgpu_dm_commit_planes() error: we previously assumed 'acrtc_state->stream' could be null
> This seems to be checked for null pretty consistently elsewhere.
>
> Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
This is already reviewed and merged, but this NULL check is actually
unnecessary. This function doesn't run in the new_crtc_state->stream is
NULL.
Technically the behavior does change inside
dc_commit_updates_for_stream. We don't actually deference the stream
anywhere as far as I can tell, but we do an prepare/optimize bandwidth
and a state swap. The missing state swap would matter here, but once
again, we don't actually run this function at all.
All these checks should probably just be dropped.
Nicholas Kazlauskas
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 58d7bbc5ada7..360b31a5c028 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5669,7 +5669,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
> }
>
> /* Update the planes if changed or disable if we don't have any. */
> - if (planes_count || acrtc_state->active_planes == 0) {
> + if ((planes_count || acrtc_state->active_planes == 0) &&
> + acrtc_state->stream) {
> if (new_pcrtc_state->mode_changed) {
> bundle->stream_update.src = acrtc_state->stream->src;
> bundle->stream_update.dst = acrtc_state->stream->dst;
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2019-06-25 18:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 15:15 [PATCH 1/6] drm/amd/amdgpu: Indent AMD_IS_APU properly Ernst Sjöstrand
[not found] ` <20190624151544.13934-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-24 15:15 ` [PATCH 2/6] drm/amd/amdgpu: Fix amdgpu_set_pp_od_clk_voltage error check Ernst Sjöstrand
2019-06-24 15:15 ` [PATCH 3/6] drm/amd/amdgpu: amdgpu_hwmon_show_temp: initialize temp Ernst Sjöstrand
2019-06-24 15:15 ` [PATCH 4/6] drm/amd/amdgpu: Check stream in amdgpu_dm_commit_planes Ernst Sjöstrand
[not found] ` <20190624151544.13934-4-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-25 18:45 ` Kazlauskas, Nicholas [this message]
2019-06-24 15:15 ` [PATCH 5/6] drm/amd/amdgpu: Fix style issues in dcn20_resource.c Ernst Sjöstrand
2019-06-24 15:15 ` [PATCH 6/6] drm/amd/amdgpu: sdma_v4_0_start: initialize r Ernst Sjöstrand
[not found] ` <20190624151544.13934-6-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-24 17:44 ` Alex Deucher
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=e57dacfc-66fd-81e1-ec6d-7056fe70736d@amd.com \
--to=nicholas.kazlauskas-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=ernstp-Re5JQEeQqe8AvxtiuMwx3w@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