From: Stefan Agner <stefan@agner.ch>
To: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Marek Vasut <marex@denx.de>, Shawn Guo <shawnguo@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Robert Chiras <robert.chiras@nxp.com>,
Fabio Estevam <fabio.estevam@nxp.com>,
Anson Huang <Anson.Huang@nxp.com>,
dri-devel@lists.freedesktop.org,
Dong Aisheng <aisheng.dong@nxp.com>,
linux-imx@nxp.com, kernel@pengutronix.de,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/5] drm/mxsfb: Move axi clk enable/disable to crtc enable/disable
Date: Wed, 08 Aug 2018 20:57:55 +0200 [thread overview]
Message-ID: <19cefc44fb2888fa0de4c54f1e8c9bd9@agner.ch> (raw)
In-Reply-To: <f0d719af219a7f922bcc0746e9f840c471c56c5d.1533743954.git.leonard.crestez@nxp.com>
On 08.08.2018 18:08, Leonard Crestez wrote:
> The main axi clk is disabled at the end of mxsfb_crtc_mode_set_nofb and
> immediately reenabled in mxsfb_enable_controller.
>
> Avoid this by moving the handling of axi clk one level up to
> mxsfb_crtc_enable. Do the same for mxsfb_crtc_disable for simmetry
>
> This shouldn't have any functional effect.
>
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Thanks, looks good!
Reviewed-by: Stefan Agner <stefan@agner.ch>
> ---
> drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> index 0abe77675b76..e4fcbb65b969 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> @@ -127,11 +127,10 @@ static void mxsfb_enable_controller(struct
> mxsfb_drm_private *mxsfb)
> u32 reg;
>
> if (mxsfb->clk_disp_axi)
> clk_prepare_enable(mxsfb->clk_disp_axi);
> clk_prepare_enable(mxsfb->clk);
> - mxsfb_enable_axi_clk(mxsfb);
>
> /* If it was disabled, re-enable the mode again */
> writel(CTRL_DOTCLK_MODE, mxsfb->base + LCDC_CTRL + REG_SET);
>
> /* Enable the SYNC signals first, then the DMA engine */
> @@ -157,12 +156,10 @@ static void mxsfb_disable_controller(struct
> mxsfb_drm_private *mxsfb)
>
> reg = readl(mxsfb->base + LCDC_VDCTRL4);
> reg &= ~VDCTRL4_SYNC_SIGNALS_ON;
> writel(reg, mxsfb->base + LCDC_VDCTRL4);
>
> - mxsfb_disable_axi_clk(mxsfb);
> -
> clk_disable_unprepare(mxsfb->clk);
> if (mxsfb->clk_disp_axi)
> clk_disable_unprepare(mxsfb->clk_disp_axi);
> }
>
> @@ -206,11 +203,10 @@ static void mxsfb_crtc_mode_set_nofb(struct
> mxsfb_drm_private *mxsfb)
> /*
> * It seems, you can't re-program the controller if it is still
> * running. This may lead to shifted pictures (FIFO issue?), so
> * first stop the controller and drain its FIFOs.
> */
> - mxsfb_enable_axi_clk(mxsfb);
>
> /* Mandatory eLCDIF reset as per the Reference Manual */
> err = mxsfb_reset_block(mxsfb->base);
> if (err)
> return;
> @@ -267,23 +263,23 @@ static void mxsfb_crtc_mode_set_nofb(struct
> mxsfb_drm_private *mxsfb)
> SET_VERT_WAIT_CNT(m->crtc_vtotal - m->crtc_vsync_start),
> mxsfb->base + LCDC_VDCTRL3);
>
> writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay),
> mxsfb->base + LCDC_VDCTRL4);
> -
> - mxsfb_disable_axi_clk(mxsfb);
> }
>
> void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb)
> {
> + mxsfb_enable_axi_clk(mxsfb);
> mxsfb_crtc_mode_set_nofb(mxsfb);
> mxsfb_enable_controller(mxsfb);
> }
>
> void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb)
> {
> mxsfb_disable_controller(mxsfb);
> + mxsfb_disable_axi_clk(mxsfb);
> }
>
> void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb,
> struct drm_plane_state *state)
> {
next prev parent reply other threads:[~2018-08-08 18:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-08 16:08 [PATCH v4 0/5] drm/mxsfb: Fix runtime PM for unpowering lcdif block Leonard Crestez
2018-08-08 16:08 ` [PATCH v4 1/5] drm/mxsfb: Move axi clk enable/disable to crtc enable/disable Leonard Crestez
2018-08-08 18:57 ` Stefan Agner [this message]
2018-08-13 13:19 ` Leonard Crestez
2018-08-08 16:08 ` [PATCH v4 2/5] drm/mxsfb: Fix initial corrupt frame when activating display Leonard Crestez
2018-08-08 18:58 ` Stefan Agner
2018-08-08 16:09 ` [PATCH v4 3/5] drm/mxsfb: Add pm_runtime calls to pipe_enable/disable Leonard Crestez
2018-08-08 16:09 ` [PATCH v4 4/5] drm/mxsfb: Add PM_SLEEP support Leonard Crestez
2018-08-08 16:09 ` [PATCH v4 5/5] drm/mxsfb: Switch to drm_atomic_helper_commit_tail_rpm Leonard Crestez
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=19cefc44fb2888fa0de4c54f1e8c9bd9@agner.ch \
--to=stefan@agner.ch \
--cc=Anson.Huang@nxp.com \
--cc=aisheng.dong@nxp.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=fabio.estevam@nxp.com \
--cc=kernel@pengutronix.de \
--cc=leonard.crestez@nxp.com \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--cc=p.zabel@pengutronix.de \
--cc=robert.chiras@nxp.com \
--cc=shawnguo@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).