[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231101143231.GX12764@pendragon.ideasonboard.com>
Date: Wed, 1 Nov 2023 16:32:31 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
Cc: Aradhya Bhatia <a-bhatia1@...com>,
Devarsh Thakkar <devarsht@...com>,
Jyri Sarha <jyri.sarha@....fi>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 08/10] drm/tidss: Add dispc_is_idle()
Hi Tomi,
Thank you for the patch.
On Wed, Nov 01, 2023 at 11:17:45AM +0200, Tomi Valkeinen wrote:
> Add a helper function, dispc_is_idle(), which returns whether the DSS is
> idle (i.e. is any video port enabled).
>
> For now we add a call to it in the suspend and resume callbacks, and
> print a warning if in either place the DSS is not idle.
Could you please explain here why these checks are needed/useful ? Why
would the dispc not be idle ?
> In the future
> this can be used to detect if the bootloader had enabled the DSS, and
> the driver can act on that.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> ---
> drivers/gpu/drm/tidss/tidss_dispc.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
> index 13db062892e3..a527c28c8833 100644
> --- a/drivers/gpu/drm/tidss/tidss_dispc.c
> +++ b/drivers/gpu/drm/tidss/tidss_dispc.c
> @@ -2603,10 +2603,18 @@ void dispc_vp_setup(struct dispc_device *dispc, u32 hw_videoport,
> dispc_vp_set_color_mgmt(dispc, hw_videoport, state, newmodeset);
> }
>
> +static bool dispc_is_idle(struct dispc_device *dispc)
> +{
> + return REG_GET(dispc, DSS_SYSSTATUS, 9, 9);
> +}
> +
> int dispc_runtime_suspend(struct dispc_device *dispc)
> {
> dev_dbg(dispc->dev, "suspend\n");
>
> + if (!dispc_is_idle(dispc))
> + dev_warn(dispc->dev, "Bad HW state: DSS not idle when suspending");
> +
> dispc->is_enabled = false;
>
> clk_disable_unprepare(dispc->fclk);
> @@ -2620,6 +2628,9 @@ int dispc_runtime_resume(struct dispc_device *dispc)
>
> clk_prepare_enable(dispc->fclk);
>
> + if (!dispc_is_idle(dispc))
> + dev_warn(dispc->dev, "Bad HW state: DSS not idle when resuming");
> +
> if (REG_GET(dispc, DSS_SYSSTATUS, 0, 0) == 0)
> dev_warn(dispc->dev, "DSS FUNC RESET not done!\n");
>
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists