From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v9 36/42] drm/tidss: dispc: Add hardware state readout helpers
Date: Fri, 20 Nov 2026 13:17:47 +0000 [thread overview]
Message-ID: <sashiko-outbox-225217@kernel.org> (raw)
In-Reply-To: <20261120-drm-state-readout-v9-36-a67c2b45b8ec@kernel.org>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/tidss: dispc readout helpers ordered after callers
breaking bisect
- [Medium] drm/tidss: bus_flags readout mismatch in
dispc_vp_get_bus_flags()
--
commit 0fa7c75e1ac8f9d7d7984b674f13c7d7a5955dd7
Author: Maxime Ripard <mripard@kernel.org>
drm/tidss: dispc: Add hardware state readout helpers
This commit adds DISPC register readout helpers for video ports, overlay
managers, and planes, and adjusts video port initialization and plane
setup to handle pipelines left running by firmware.
> diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
> index e186c63ba5fb9..8e61216d4532f 100644
> --- a/drivers/gpu/drm/tidss/tidss_dispc.c
> +++ b/drivers/gpu/drm/tidss/tidss_dispc.c
[ ... ]
> @@ -1401,6 +1407,228 @@ int dispc_vp_set_clk_rate(struct dispc_device *dispc, u32 hw_videoport,
[ ... ]
> +u32 dispc_vp_get_bus_flags(struct dispc_device *dispc, u32 hw_videoport)
> +{
> + u32 flags = 0;
> + u32 val;
> +
> + val = dispc_vp_read(dispc, hw_videoport, DISPC_VP_POL_FREQ);
> + if (FIELD_GET(DISPC_VP_POL_FREQ_IPC_MASK, val))
> + flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE;
> + else
> + flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE;
> +
> + if (FIELD_GET(DISPC_VP_POL_FREQ_IEO_MASK, val))
> + flags |= DRM_BUS_FLAG_DE_LOW;
> + else
> + flags |= DRM_BUS_FLAG_DE_HIGH;
> +
> + if (FIELD_GET(DISPC_VP_POL_FREQ_RF_MASK, val))
> + flags |= DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE;
> + else
> + flags |= DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE;
> +
> + return flags;
> +}
[Severity: Medium]
Can dispc_vp_get_bus_flags() cause state comparison mismatches in
tidss_crtc_compare_state() and drm_atomic_helper_bridge_compare_state()
when a downstream bridge or panel leaves any of the three polarity flags
unspecified?
tidss_bridge_atomic_check() copies next_bridge_state->input_bus_cfg.flags
(or connector->display_info.bus_flags) directly into
tcrtc_state->bus_flags and propagates it to the tidss encoder bridge
state without filling in default polarities, while dispc_vp_prepare()
programs default polarities in DISPC_VP_POL_FREQ for any unset flags.
Because dispc_vp_get_bus_flags() unconditionally sets all three polarity
flags, the read-out bus_flags on the CRTC and tidss encoder bridge will
not match the committed state whenever a panel or bridge omits one of
those flags (for example, panels that only specify DRM_BUS_FLAG_DE_HIGH,
or tidss_oldi when DE polarity is left unset).
[ ... ]
> diff --git a/drivers/gpu/drm/tidss/tidss_dispc.h b/drivers/gpu/drm/tidss/tidss_dispc.h
> index dcd4d3b18ef48..4abcb9e679acf 100644
> --- a/drivers/gpu/drm/tidss/tidss_dispc.h
> +++ b/drivers/gpu/drm/tidss/tidss_dispc.h
> @@ -111,10 +111,13 @@ void dispc_ovr_set_plane(struct dispc_device *dispc, u32 hw_plane,
> u32 hw_videoport, u32 x, u32 y, u32 layer);
> void dispc_ovr_enable_layer(struct dispc_device *dispc,
> u32 hw_videoport, u32 layer, bool enable);
> +int dispc_ovr_get_plane(struct dispc_device *dispc, u32 hw_plane,
> + u32 *hw_videoport, int *x, int *y, u32 *layer);
>
> void dispc_vp_prepare(struct dispc_device *dispc, u32 hw_videoport,
> const struct drm_crtc_state *state);
> void dispc_vp_enable(struct dispc_device *dispc, u32 hw_videoport);
> +bool dispc_vp_is_enabled(struct dispc_device *dispc, u32 hw_videoport);
> void dispc_vp_disable(struct dispc_device *dispc, u32 hw_videoport);
> void dispc_vp_unprepare(struct dispc_device *dispc, u32 hw_videoport);
> bool dispc_vp_go_busy(struct dispc_device *dispc, u32 hw_videoport);
> @@ -128,9 +131,17 @@ int dispc_vp_enable_clk(struct dispc_device *dispc, u32 hw_videoport);
> void dispc_vp_disable_clk(struct dispc_device *dispc, u32 hw_videoport);
> int dispc_vp_set_clk_rate(struct dispc_device *dispc, u32 hw_videoport,
> unsigned long rate);
> +void dispc_vp_set_dpi_output(struct dispc_device *dispc, u32 hw_videoport,
> + bool dpi_output);
> void dispc_vp_setup(struct dispc_device *dispc, u32 hw_videoport,
> const struct drm_crtc_state *state, bool newmodeset,
> bool dpi_output);
> +int dispc_vp_readout_mode(struct dispc_device *dispc,
> + u32 hw_videoport,
> + struct drm_display_mode *mode);
> +int dispc_vp_get_bus_format(struct dispc_device *dispc, u32 hw_videoport,
> + u32 *bus_fmt);
> +u32 dispc_vp_get_bus_flags(struct dispc_device *dispc, u32 hw_videoport);
>
> int dispc_runtime_suspend(struct dispc_device *dispc);
> int dispc_runtime_resume(struct dispc_device *dispc);
> @@ -141,7 +152,18 @@ int dispc_plane_check(struct dispc_device *dispc, u32 hw_plane,
> void dispc_plane_setup(struct dispc_device *dispc, u32 hw_plane,
> struct drm_plane_state *state,
> u32 hw_videoport);
> +void dispc_plane_get_picture_size(struct dispc_device *dispc, u32 hw_plane,
> + unsigned int *width, unsigned int *height);
> +void dispc_plane_get_size(struct dispc_device *dispc, u32 hw_plane,
> + unsigned int *width, unsigned int *height);
> +const struct drm_format_info *
> +dispc_plane_get_current_format(struct dispc_device *dispc, u32 hw_plane);
> +u8 dispc_plane_get_global_alpha(struct dispc_device *dispc, u32 hw_plane);
> +u32 dispc_plane_get_pixel_inc(struct dispc_device *dispc, u32 hw_plane);
> +u32 dispc_plane_get_row_inc(struct dispc_device *dispc, u32 hw_plane);
> +u16 dispc_plane_get_blend_mode(struct dispc_device *dispc, u32 hw_plane);
> void dispc_plane_enable(struct dispc_device *dispc, u32 hw_plane, bool enable);
> +bool dispc_plane_is_enabled(struct dispc_device *dispc, u32 hw_plane);
[Severity: Medium]
Should this patch be ordered before commit "drm/tidss: crtc: Implement
hardware state readout"?
The earlier commits "drm/tidss: crtc: Implement hardware state readout"
and "drm/tidss: plane: Implement hardware state readout" call these
helpers in tidss_crtc.c and tidss_plane.c before they are declared and
defined here, which breaks the build with CONFIG_DRM_TIDSS enabled at
four intermediate commits in the series during git bisect. (Commit
"drm/tidss: kms: Hook up hardware state readout" also appears to be
ordered before commit "drm/tidss: plane: Implement hardware state
readout".)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-drm-state-readout-v9-0-a67c2b45b8ec@kernel.org?part=36
next prev parent reply other threads:[~2026-11-20 13:18 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 12:54 [PATCH v9 00/42] drm: Implement state readout support Maxime Ripard
2026-11-20 12:54 ` [PATCH v9 01/42] drm/atomic: Add drm_atomic_get_connector_for_encoder_locked() Maxime Ripard
2026-11-20 12:54 ` [PATCH v9 02/42] drm/bridge-helper: Don't unlock the connection mutex after a backoff Maxime Ripard
2026-11-20 12:54 ` [PATCH v9 03/42] drm/tests: hdmi-state-helper: Handle EDEADLK in the 420-only test Maxime Ripard
2026-11-20 12:54 ` [PATCH v9 04/42] drm/tests: hdmi-state-helper: Handle EDEADLK in the color format test Maxime Ripard
2026-11-20 12:54 ` [PATCH v9 05/42] drm/colorop: Export drm_atomic_helper_colorop_create_state() Maxime Ripard
2026-11-20 12:54 ` [PATCH v9 06/42] drm/atomic: Fix private obj error handling Maxime Ripard
2026-11-20 12:54 ` [PATCH v9 07/42] drm/atomic: Add drm_private_obj name Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 08/42] drm/bridge: Switch print_state to use bridge name Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 09/42] drm/bridge: Add drm_private_obj_is_bridge() Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 10/42] drm/fb-dma-helper: Handle framebuffers without a GEM object Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 11/42] drm/gem-atomic-helper: " Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 12/42] drm/atomic: Export drm_atomic_*_print_state Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 13/42] drm/atomic_sro: Create drm_atomic_sro_state container Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 14/42] drm/atomic_sro: Create kernel parameter to force or disable readout Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 15/42] drm/atomic_sro: Add atomic state readout infrastructure Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 16/42] drm/atomic_sro: Create documentation Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 17/42] drm/bridge: Handle bridges with hardware state readout Maxime Ripard
2026-11-20 13:18 ` sashiko-bot
2026-11-20 12:55 ` [PATCH v9 18/42] drm/mode-config: Read out hardware state in drm_mode_config_create_initial_state Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 19/42] drm/atomic_sro: Provide helpers to implement hardware state readout Maxime Ripard
2026-11-20 13:17 ` sashiko-bot
2026-11-20 12:55 ` [PATCH v9 20/42] drm/mode-config: Introduce hw_reset hook Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 21/42] drm/modeset-helper: Add drm_mode_config_helper_hw_reset() Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 22/42] drm/atomic_helper: Compare actual and readout states once the commit is done Maxime Ripard
2026-11-20 13:17 ` sashiko-bot
2026-11-20 12:55 ` [PATCH v9 23/42] drm/atomic-state-helper: Provide comparison macros Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 24/42] drm/atomic-state-helper: Provide atomic_compare_state helpers Maxime Ripard
2026-11-20 13:14 ` sashiko-bot
2026-11-20 12:55 ` [PATCH v9 25/42] drm/atomic-helper: Document State Read-Out as a state initialization approach Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 26/42] drm/tests: kunit: Add a drm_printer helper Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 27/42] drm/tests: Add tests for the atomic state readout Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 28/42] drm/encoder: Create atomic_sro_get_current_crtc hook Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 29/42] drm/bridge: display-connector: Implement readout support Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 30/42] drm/bridge_connector: Implement hw readout for connector Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 31/42] drm/tidss: Implement hw_reset Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 32/42] drm/tidss: crtc: Implement hardware state readout Maxime Ripard
2026-11-20 13:14 ` sashiko-bot
2026-11-20 12:55 ` [PATCH v9 33/42] drm/tidss: encoder: " Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 34/42] drm/tidss: kms: Hook up " Maxime Ripard
2026-11-20 13:25 ` sashiko-bot
2026-11-20 12:55 ` [PATCH v9 35/42] drm/tidss: plane: Implement " Maxime Ripard
2026-11-20 13:28 ` sashiko-bot
2026-11-20 12:55 ` [PATCH v9 36/42] drm/tidss: dispc: Add hardware state readout helpers Maxime Ripard
2026-11-20 13:17 ` sashiko-bot [this message]
2026-11-20 12:55 ` [PATCH v9 37/42] drm/tidss: encoder: Implement atomic_sro_get_current_crtc Maxime Ripard
2026-11-20 12:55 ` [PATCH v9 38/42] drm/bridge: sii902x: Implement hw state readout Maxime Ripard
2026-11-20 13:26 ` sashiko-bot
2026-11-20 12:55 ` [PATCH v9 39/42] drm/panel: Implement state readout support Maxime Ripard
2026-11-20 12:55 ` [PATCH DO NOT MERGE v9 40/42] fixup! drm/tidss: dispc: Add hardware state readout helpers Maxime Ripard
2026-11-20 12:55 ` [PATCH DO NOT MERGE v9 41/42] drm/tidss: oldi: Implement hardware state readout Maxime Ripard
2026-11-20 13:34 ` sashiko-bot
2026-11-20 12:55 ` [PATCH HACK v9 42/42] drm/panel: Prepare and enable panels read out as active Maxime Ripard
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-225217@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mripard@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 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.