From: Frank Li <Frank.li@nxp.com>
To: Liu Ying <victor.liu@nxp.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Dmitry Baryshkov <lumag@kernel.org>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 08/14] drm/imx: dc: Use TCON operation mode
Date: Fri, 19 Sep 2025 11:24:00 -0400 [thread overview]
Message-ID: <aM11kCDCGaAFO7cv@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20250704-imx8-dc-prefetch-v1-8-784c03fd645f@nxp.com>
On Fri, Jul 04, 2025 at 05:03:55PM +0800, Liu Ying wrote:
> In TCON operation mode, sync signals from FrameGen are ignored, but
> a much more customized output timing can be generated by the TCON
> module. By using TCON operaton mode, generate KACHUNK signal along
> with HSYNC/VSYNC/data enable signals. The KACHUNK signal is used as
> a synchronization signal inside the prefetch engine(DPRC + PRG(s),
> attached to FetchUnit(s)). Carefully switch TCON bypass mode to TCON
> operation mode when CRTC is being enabled so that the prefetch engine
> may evade the first dumb frame generated by the display controller.
>
> Since TCON BYPASS bit is controlled by KMS driver when doing atomic
> commits, drop the bit setting when initializing TCON. This also
> avoids accidentally initializing TCON BYPASS bit to 1 when driver
> module removing and re-installing where an upcoming patch would
> disable a CRTC at boot in TCON operation mode if needed.
>
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> ---
> drivers/gpu/drm/imx/dc/dc-crtc.c | 28 ++++++++++
> drivers/gpu/drm/imx/dc/dc-de.h | 2 +
> drivers/gpu/drm/imx/dc/dc-kms.h | 2 +
> drivers/gpu/drm/imx/dc/dc-tc.c | 114 +++++++++++++++++++++++++++++++++++++--
> 4 files changed, 142 insertions(+), 4 deletions(-)
>
...
> @@ -249,6 +260,7 @@ dc_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state)
> enable_irq(dc_crtc->irq_ed_safe_shdload);
>
> dc_fg_cfg_videomode(dc_crtc->fg, adj);
> + dc_tc_cfg_videomode(dc_crtc->tc, adj);
>
> dc_cf_framedimensions(dc_crtc->cf_cont,
> adj->crtc_hdisplay, adj->crtc_vdisplay);
> @@ -273,7 +285,22 @@ dc_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state)
> dc_ed_pec_sync_trigger(dc_crtc->ed_cont);
> dc_ed_pec_sync_trigger(dc_crtc->ed_safe);
> dc_fg_shdtokgen(dc_crtc->fg);
> +
> + /* Don't relinquish CPU until TCON is set to operation mode. */
> + local_irq_save(flags);
> + preempt_disable();
> +
> dc_fg_enable(dc_crtc->fg);
> + /*
> + * Turn TCON into operation mode as soon as the first dumb
> + * frame is generated by DC(we don't relinquish CPU to ensure
> + * this). This makes DPR/PRG be able to evade the frame.
> + */
> + DC_CRTC_WAIT_FOR_FRAMEGEN_FRAME_INDEX_MOVING(dc_crtc->fg);
> + dc_tc_set_operation_mode(dc_crtc->tc);
> +
> + local_irq_restore(flags);
> + preempt_enable();
Does it need reverised order?
>
> DC_CRTC_WAIT_FOR_COMPLETION_TIMEOUT(ed_safe_shdload_done);
> DC_CRTC_WAIT_FOR_COMPLETION_TIMEOUT(ed_cont_shdload_done);
> @@ -561,6 +588,7 @@ int dc_crtc_init(struct dc_drm_device *dc_drm, int crtc_index)
> dc_crtc->ed_cont = pe->ed_cont[crtc_index];
> dc_crtc->ed_safe = pe->ed_safe[crtc_index];
> dc_crtc->fg = de->fg;
> + dc_crtc->tc = de->tc;
>
> dc_crtc->irq_dec_framecomplete = de->irq_framecomplete;
> dc_crtc->irq_dec_seqcomplete = de->irq_seqcomplete;
> diff --git a/drivers/gpu/drm/imx/dc/dc-de.h b/drivers/gpu/drm/imx/dc/dc-de.h
> index 211f3fcc1a9ad642617d3b22e35ea923f75e645b..c39f2ef5eea98c3eb6ae9b5392f9bf9f7e33e7c5 100644
> --- a/drivers/gpu/drm/imx/dc/dc-de.h
> +++ b/drivers/gpu/drm/imx/dc/dc-de.h
> @@ -54,6 +54,8 @@ enum drm_mode_status dc_fg_check_clock(struct dc_fg *fg, int clk_khz);
> void dc_fg_init(struct dc_fg *fg);
>
...
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-09-19 15:24 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 9:03 [PATCH 00/14] drm/imx: dc: Use prefetch engine Liu Ying
2025-07-04 9:03 ` [PATCH 01/14] dt-bindings: display: imx: Add i.MX8qxp/qm PRG binding Liu Ying
2025-07-04 9:03 ` [PATCH 02/14] dt-bindings: display: imx: Add i.MX8qxp/qm DPR channel binding Liu Ying
2025-07-04 9:03 ` [PATCH 03/14] MAINTAINERS: Add i.MX8qxp prefetch engine DT binding files Liu Ying
2025-09-19 14:53 ` Frank Li
2025-07-04 9:03 ` [PATCH 04/14] drm/imx: dc-fu: Fix dimensions Liu Ying
2025-07-04 11:29 ` Alexander Stein
2025-09-19 14:54 ` Frank Li
2025-07-04 9:03 ` [PATCH 05/14] drm/imx: dc-crtc: Disable at boot Liu Ying
2025-09-19 15:04 ` Frank Li
2025-09-22 3:42 ` Liu Ying
2025-07-04 9:03 ` [PATCH 06/14] drm/imx: dc: Add PRG support Liu Ying
2025-09-19 15:09 ` Frank Li
2025-07-04 9:03 ` [PATCH 07/14] drm/imx: dc: Add DPR channel support Liu Ying
2025-09-19 15:15 ` Frank Li
2025-09-22 3:44 ` Liu Ying
2025-07-04 9:03 ` [PATCH 08/14] drm/imx: dc: Use TCON operation mode Liu Ying
2025-09-19 15:24 ` Frank Li [this message]
2025-09-22 3:48 ` Liu Ying
2025-09-22 15:00 ` Frank Li
2025-07-04 9:03 ` [PATCH 09/14] drm/imx: dc-ed: Support getting source selection Liu Ying
2025-09-19 15:25 ` Frank Li
2025-07-04 9:03 ` [PATCH 10/14] drm/imx: dc-lb: Support getting secondary input selection Liu Ying
2025-09-19 15:26 ` [PATCH 10/14] drm/imx: dc-lb: Support getting secondary input selectio Frank Li
2025-07-04 9:03 ` [PATCH 11/14] drm/imx: dc-ed: Drop initial source selection Liu Ying
2025-09-19 15:27 ` Frank Li
2025-07-04 9:03 ` [PATCH 12/14] drm/imx: dc-lb: Drop initial primary and secondary input selections Liu Ying
2025-09-19 15:30 ` Frank Li
2025-07-04 9:04 ` [PATCH 13/14] drm/imx: dc-fu: Get DPR channel Liu Ying
2025-09-19 15:31 ` Frank Li
2025-07-04 9:04 ` [PATCH 14/14] drm/imx: dc: Use prefetch engine Liu Ying
2025-09-19 15:41 ` Frank Li
2025-09-22 3:55 ` Liu Ying
2025-08-12 8:29 ` [PATCH 00/14] " Liu Ying
2025-09-19 9:20 ` Liu Ying
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=aM11kCDCGaAFO7cv@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=airlied@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=victor.liu@nxp.com \
/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