dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Svyatoslav Ryhel" <clamor95@gmail.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v9 11/13] drm/tegra: rgb: Parameterize configuration based on bus flags and DT property
Date: Mon, 30 Nov 2026 11:59:28 +0000	[thread overview]
Message-ID: <sashiko-outbox-241000@kernel.org> (raw)
In-Reply-To: <20261130114155.72920-12-clamor95@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/tegra: rgb: inverted default pclk polarity in
  tegra_rgb_encoder_enable()
--

commit 4442e43504544159a06f87b67bae36bb5b0f8fcf
Author: Svyatoslav Ryhel <clamor95@gmail.com>

drm/tegra: rgb: Parameterize configuration based on bus flags and DT property

This commit configures Tegra RGB pixel clock and display enable signal
polarities from the bridge input bus flags and adds support for the
"nvidia,contiguous-rgb-pins" device tree property.

> diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c
> index d48d498068ac8..c311f4e2c44bb 100644
> --- a/drivers/gpu/drm/tegra/rgb.c
> +++ b/drivers/gpu/drm/tegra/rgb.c
[ ... ]
> @@ -106,6 +109,7 @@ static void tegra_rgb_encoder_enable(struct drm_encoder *encoder,
>  	struct tegra_output *output = encoder_to_output(encoder);
>  	struct tegra_rgb *rgb = to_rgb(output);
>  	struct drm_connector_state *conn_state;
> +	struct drm_bridge_state *bridge_state;
>  	struct drm_crtc_state *crtc_state;
>  	struct drm_connector *connector;
>  	struct drm_display_mode *mode;
> @@ -117,12 +121,20 @@ static void tegra_rgb_encoder_enable(struct drm_encoder *encoder,
>  	crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc);
>  	mode = &crtc_state->adjusted_mode;
>  
> +	/* Get but flags from the bridge state. */
> +	bridge_state = drm_atomic_get_new_bridge_state(state, output->bridge);
> +	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;
> +
>  	tegra_dc_write_regs(rgb->dc, rgb_enable, ARRAY_SIZE(rgb_enable));
>  
>  	value = DE_SELECT_ACTIVE | DE_CONTROL_NORMAL;
>  	tegra_dc_writel(rgb->dc, value, DC_DISP_DATA_ENABLE_OPTIONS);
>  
> -	/* configure H- and V-sync signal polarities */
> +	/* configure H- and V-sync and pixel clock signal polarities */
>  	value = tegra_dc_readl(rgb->dc, DC_COM_PIN_OUTPUT_POLARITY(1));
>  
>  	if (mode->flags & DRM_MODE_FLAG_NHSYNC)
> @@ -135,11 +147,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 |= PIN_POS(PIN_LSC0);
> +	else
> +		value &= ~PIN_POS(PIN_LSC0);

[Severity: High]
As reported by Mikko Perttunen on v8 [1], does this invert the default
pixel clock polarity when bridge_state is present but neither
DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE nor
DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE is set in
bridge_state->input_bus_cfg.flags?

rgb_enable[] initializes DC_COM_PIN_OUTPUT_POLARITY(1) with
PIN_POS(PIN_LSC0) (0x01000000) set.  Because panel_bridge and bridge
drivers such as lvds-codec allocate atomic bridge state, bridge_state is
non-NULL, while existing Tegra panels (such as auo_b101aw03 in
panel-simple.c) only set DRM_BUS_FLAG_DE_HIGH and omit pixel clock
sampling flags.  Taking the else branch clears PIN_POS(PIN_LSC0) and
flips the pixel clock sampling edge on existing Tegra20 and Tegra30
boards.

Testing for DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE to clear
PIN_POS(PIN_LSC0) and setting PIN_POS(PIN_LSC0) otherwise would preserve
positive-edge sampling as the default when no pixel clock sampling flag is
specified.

[1] https://lore.kernel.org/r/TYDAsh0fQ52x0yM4_wAp5A@nvidia.com

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

  reply	other threads:[~2026-11-30 11:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 11:41 [PATCH v9 00/13] drm/tegra: Add support for Tegra20/Tegra30 8-bit CPU interface Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 01/13] drm: Add MIPI DBI bus support for MIPI DBI Type A and B Svyatoslav Ryhel
2026-11-30 11:55   ` sashiko-bot
2026-11-30 11:41 ` [PATCH v9 02/13] drm/panel: panel-hitachi-tx10d07vm0baa: Convert to use MIPI DBI bus Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 03/13] drm/panel: panel-hitachi-tx10d07vm0baa: Convert to mipi_dbi_write_seq_multi() Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 04/13] drm/panel: panel-lg-lh400wv3: Convert to use MIPI DBI bus Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 05/13] drm/panel: panel-lg-lh400wv3: Convert to mipi_dbi_write_seq_multi() Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 06/13] drm/tegra: dc: Add elements required by Tegra MIPI DBI Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 07/13] dt-bindings: display: tegra: Document Tegra20 DSI port Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 08/13] drm/tegra: output: Make panel parsing configurable Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 09/13] drm/tegra: Convert to use atomic versions of drm_encoder_helper_funcs Svyatoslav Ryhel
2026-11-30 11:53   ` sashiko-bot
2026-11-30 11:41 ` [PATCH v9 10/13] dt-bindings: display: tegra: Document nvidia, contiguous-rgb-pins property Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 11/13] drm/tegra: rgb: Parameterize configuration based on bus flags and DT property Svyatoslav Ryhel
2026-11-30 11:59   ` sashiko-bot [this message]
2026-11-30 11:41 ` [PATCH v9 12/13] dt-bindings: display: tegra: Document 8-bit CPU parallel interface Svyatoslav Ryhel
2026-11-30 13:59   ` Rob Herring (Arm)
2026-11-30 11:41 ` [PATCH v9 13/13] drm/tegra: Add support for 8-bit CPU interface Svyatoslav Ryhel
2026-11-30 12:11   ` sashiko-bot

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=sashiko-outbox-241000@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