Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Svyatoslav Ryhel" <clamor95@gmail.com>
Cc: robh@kernel.org, dri-devel@lists.freedesktop.org,
	devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 2/7] drm/tegra: rgb: Parameterize configuration based on bus flags
Date: Sun, 04 Oct 2026 16:41:41 +0000	[thread overview]
Message-ID: <20261004164142.3CA6D1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261004163114.181800-3-clamor95@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/tegra: lockdep splat in tegra_rgb_encoder_enable() due to dropped locks
- [High] drm/tegra: fallback bus flags invert default pixel clock polarity
--

commit 9e423aa598f153ae0ba6a206e3338f678a83bd15
Author: Svyatoslav Ryhel <clamor95@gmail.com>

drm/tegra: rgb: Parameterize configuration based on bus flags

This commit parameterizes the display configuration based on bus flags passed
from the bridge or panel. The list of supported flags now includes pixel
clock polarity, display enable polarity, and data alignment.

> diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c
> index b6d09a8d8e5ea..86bff5f7f7964 100644
> --- a/drivers/gpu/drm/tegra/rgb.c
> +++ b/drivers/gpu/drm/tegra/rgb.c

[ ... ]

> @@ -104,14 +105,24 @@ static void tegra_rgb_encoder_enable(struct drm_encoder *encoder)
>  	struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
>  	struct tegra_output *output = encoder_to_output(encoder);
>  	struct tegra_rgb *rgb = to_rgb(output);
> -	u32 value;
> +	struct drm_bridge_state *bridge_state;
> +	u32 bus_flags, value;
> +
> +	/* Get but flags from the bridge state. */
> +	bridge_state = drm_bridge_get_current_state(output->bridge);

[Severity: High]
Does calling drm_bridge_get_current_state() here trigger a lockdep warning?

The helper function explicitly requires the modeset lock to be held and
asserts it via drm_modeset_lock_assert_held(). If a userspace application
issues a non-blocking atomic commit, the commit_tail worker executes this
tegra_rgb_encoder_enable() hook asynchronously after the modeset locks have
been dropped, which will trigger a WARN.

> +	if (bridge_state)
> +		bus_flags = bridge_state->input_bus_cfg.flags;
> +	else
> +		bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE |
> +			    DRM_BUS_FLAG_DE_HIGH |
> +			    DRM_BUS_FLAG_DATA_MSB_TO_LSB;

[ ... ]

> @@ -124,11 +135,31 @@ static void tegra_rgb_encoder_enable(struct drm_encoder *encoder)
>  	else
>  		value &= ~LVS_OUTPUT_POLARITY_LOW;
>  
> +	if (bus_flags & DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE)
> +		value &= ~LSC0_OUTPUT_POLARITY_LOW;
> +	else
> +		value |= LSC0_OUTPUT_POLARITY_LOW;

[Severity: High]
Does this fallback configuration silently invert the default pixel clock
polarity for older panels?

The legacy hardware initialization array rgb_enable historically set
LSC0_OUTPUT_POLARITY_LOW to 1 by default. By hardcoding
DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE in the fallback bus_flags for
missing bridge states, the code now clears LSC0_OUTPUT_POLARITY_LOW.
Will this corrupt the display output or cause blank screens on legacy
configurations without explicitly configured bus flags?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261004163114.181800-1-clamor95@gmail.com?part=2

  reply	other threads:[~2026-10-04 16:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-04 16:31 [PATCH v2 0/7] drm/tegra: Add support for Tegra20/Tegra30 8-bit CPU interface Svyatoslav Ryhel
2026-10-04 16:31 ` [PATCH v2 1/7] drm/tegra: dc: Expand available registers layouts Svyatoslav Ryhel
2026-10-04 16:31 ` [PATCH v2 2/7] drm/tegra: rgb: Parameterize configuration based on bus flags Svyatoslav Ryhel
2026-10-04 16:41   ` sashiko-bot [this message]
2026-10-04 16:31 ` [PATCH v2 3/7] dt-bindings: display: tegra: Document 8-bit CPU parallel interface Svyatoslav Ryhel
2026-10-04 16:41   ` sashiko-bot
2026-10-05 13:30   ` Rob Herring (Arm)
2026-10-04 16:31 ` [PATCH v2 4/7] drm/tegra: Add support for 8-bit CPU interface Svyatoslav Ryhel
2026-10-04 16:44   ` sashiko-bot
2026-10-05 14:29   ` kernel test robot
2026-10-06  3:42   ` kernel test robot
2026-10-04 16:31 ` [PATCH v2 5/7] dt-bindings: display: panel: Document Hitachi TX10D07VM0BAA and LG LH400WV3 panels Svyatoslav Ryhel
2026-10-04 16:31 ` [PATCH v2 6/7] drm/panel: Add Hitachi TX10D07VM0BAA MIPI DBI Type B panel driver Svyatoslav Ryhel
2026-10-04 16:31 ` [PATCH v2 7/7] drm/panel: Add LG LH400WV3-SD04 " Svyatoslav Ryhel

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=20261004164142.3CA6D1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robh@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox