All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitriy Chumachenko" <Dmitry.Chumachenko@cyberprotect.ru>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: guard NULL secondary pipe in dcn_validate_bandwidth()
Date: Mon, 14 Sep 2026 15:26:28 +0000	[thread overview]
Message-ID: <20260914152629.3D5991F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914151446.94380-1-Dmitry.Chumachenko@cyberprotect.ru>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Skipping a required pipe split when no free pipes are available silently accepts an invalid display configuration and allows bandwidth validation to succeed.
--

commit 933da7b5e47097aeef7c30116ceee6ba3c949c0a
Author: Dmitriy Chumachenko <Dmitry.Chumachenko@cyberprotect.ru>

drm/amd/display: guard NULL secondary pipe in dcn_validate_bandwidth()

This commit adds NULL checks around the return value of
resource_find_free_secondary_pipe_legacy() in dcn_validate_bandwidth() to
prevent NULL pointer dereferences during pipe splits.

> diff --git a/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c b/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c
> --- a/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/calcs/dcn_calcs.c

[ ... ]

> @@ -1263,10 +1263,12 @@ bool dcn_validate_bandwidth(
>  						/* pipe not split previously needs split */
>  						hsplit_pipe = resource_find_free_secondary_pipe_legacy(&context->res_ctx, pool, pipe);
>  						ASSERT(hsplit_pipe);
> -						split_stream_across_pipes(&context->res_ctx, pool, pipe, hsplit_pipe);
> +						if (hsplit_pipe)
> +							split_stream_across_pipes(&context->res_ctx, pool, pipe, hsplit_pipe);
>  					}
>  
> -					dcn_bw_calc_rq_dlg_ttu(dc, v, hsplit_pipe, input_idx);
> +					if (hsplit_pipe)
> +						dcn_bw_calc_rq_dlg_ttu(dc, v, hsplit_pipe, input_idx);

[Severity: High]
Does skipping this pipe split allow bandwidth validation to incorrectly
succeed?

When resource_find_free_secondary_pipe_legacy() returns NULL because all
secondary pipes are in use, this change silently skips the required pipe
split. Since dcn_validate_bandwidth() evaluates the bw_limit_pass condition
independently at the end of the function, it can still return true even
though a required hardware resource was missing.

Could this allow the display framework to proceed with an invalid
configuration, potentially leading to hardware misprogramming or display
underflow? Should dcn_validate_bandwidth() return false or propagate an
error when hsplit_pipe is NULL rather than continuing silently?

>  				} else if (hsplit_pipe && hsplit_pipe->plane_state == pipe->plane_state) {
>  					/* merge previously split pipe */
>  					pipe->bottom_pipe = hsplit_pipe->bottom_pipe;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914151446.94380-1-Dmitry.Chumachenko@cyberprotect.ru?part=1

      reply	other threads:[~2026-09-14 15:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 15:14 [PATCH] drm/amd/display: guard NULL secondary pipe in dcn_validate_bandwidth() Dmitriy Chumachenko
2026-09-14 15:26 ` sashiko-bot [this message]

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=20260914152629.3D5991F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Dmitry.Chumachenko@cyberprotect.ru \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.