Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Marek Vasut <marex@denx.de>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Vincent Abriou <vincent.abriou@st.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Kukjin Kim <kgene@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	NXP Linux Team <linux-imx@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Jonas Karlman <jonas@kwiboo.se>,
	Alison Wang <alison.wang@nxp.com>,
	Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>,
	Alexios Zavras <alexios.zavras@intel.com>,
	linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>, Sean Paul <sean@poorly.run>,
	Allison Randal <allison@lohutok.net>
Subject: Re: [PATCH v1 11/16] drm/panel: move drm_panel functions to .c file
Date: Mon, 5 Aug 2019 13:45:15 +0300	[thread overview]
Message-ID: <20190805104515.GF29747@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20190804201637.1240-12-sam@ravnborg.org>

Hi Sam,

Thank you for the patch.

On Sun, Aug 04, 2019 at 10:16:32PM +0200, Sam Ravnborg wrote:
> Move inline functions from include/drm/drm_panel.h to drm_panel.c.
> This is in preparation for follow-up patches that will add extra
> logic to the functions.
> As they are no longer static inline, EXPORT them.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Sean Paul <sean@poorly.run>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> ---
>  drivers/gpu/drm/drm_panel.c | 96 +++++++++++++++++++++++++++++++++++
>  include/drm/drm_panel.h     | 99 +++----------------------------------
>  2 files changed, 104 insertions(+), 91 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> index dbd5b873e8f2..9946b8d9bacc 100644
> --- a/drivers/gpu/drm/drm_panel.c
> +++ b/drivers/gpu/drm/drm_panel.c
> @@ -54,6 +54,102 @@ void drm_panel_init(struct drm_panel *panel)
>  }
>  EXPORT_SYMBOL(drm_panel_init);
>  
> +/**
> + * drm_panel_prepare - power on a panel
> + * @panel: DRM panel
> + *
> + * Calling this function will enable power and deassert any reset signals to
> + * the panel. After this has completed it is possible to communicate with any
> + * integrated circuitry via a command bus.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int drm_panel_prepare(struct drm_panel *panel)
> +{
> +	if (panel && panel->funcs && panel->funcs->prepare)
> +		return panel->funcs->prepare(panel);
> +
> +	return panel ? -ENOSYS : -EINVAL;
> +}
> +EXPORT_SYMBOL(drm_panel_prepare);
> +
> +/**
> + * drm_panel_enable - enable a panel
> + * @panel: DRM panel
> + *
> + * Calling this function will cause the panel display drivers to be turned on
> + * and the backlight to be enabled. Content will be visible on screen after
> + * this call completes.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int drm_panel_enable(struct drm_panel *panel)
> +{
> +	if (panel && panel->funcs && panel->funcs->enable)
> +		return panel->funcs->enable(panel);
> +
> +	return panel ? -ENOSYS : -EINVAL;
> +}
> +EXPORT_SYMBOL(drm_panel_enable);
> +
> +/**
> + * drm_panel_disable - disable a panel
> + * @panel: DRM panel
> + *
> + * This will typically turn off the panel's backlight or disable the display
> + * drivers. For smart panels it should still be possible to communicate with
> + * the integrated circuitry via any command bus after this call.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int drm_panel_disable(struct drm_panel *panel)
> +{
> +	if (panel && panel->funcs && panel->funcs->disable)
> +		return panel->funcs->disable(panel);
> +
> +	return panel ? -ENOSYS : -EINVAL;
> +}
> +EXPORT_SYMBOL(drm_panel_disable);
> +
> +/**
> + * drm_panel_unprepare - power off a panel
> + * @panel: DRM panel
> + *
> + * Calling this function will completely power off a panel (assert the panel's
> + * reset, turn off power supplies, ...). After this function has completed, it
> + * is usually no longer possible to communicate with the panel until another
> + * call to drm_panel_prepare().
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int drm_panel_unprepare(struct drm_panel *panel)
> +{
> +	if (panel && panel->funcs && panel->funcs->unprepare)
> +		return panel->funcs->unprepare(panel);
> +
> +	return panel ? -ENOSYS : -EINVAL;
> +}
> +EXPORT_SYMBOL(drm_panel_unprepare);
> +
> +/**
> + * drm_panel_get_modes - probe the available display modes of a panel
> + * @panel: DRM panel
> + *
> + * The modes probed from the panel are automatically added to the connector
> + * that the panel is attached to.
> + *
> + * Return: The number of modes available from the panel on success or a
> + * negative error code on failure.
> + */
> +int drm_panel_get_modes(struct drm_panel *panel)
> +{
> +	if (panel && panel->funcs && panel->funcs->get_modes)
> +		return panel->funcs->get_modes(panel);
> +
> +	return panel ? -ENOSYS : -EINVAL;
> +}
> +EXPORT_SYMBOL(drm_panel_get_modes);
> +
>  /**
>   * drm_panel_add - add a panel to the global registry
>   * @panel: panel to add
> diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
> index 26377836141c..053d611656b9 100644
> --- a/include/drm/drm_panel.h
> +++ b/include/drm/drm_panel.h
> @@ -97,97 +97,6 @@ struct drm_panel {
>  	struct list_head list;
>  };
>  
> -/**
> - * drm_disable_unprepare - power off a panel
> - * @panel: DRM panel
> - *
> - * Calling this function will completely power off a panel (assert the panel's
> - * reset, turn off power supplies, ...). After this function has completed, it
> - * is usually no longer possible to communicate with the panel until another
> - * call to drm_panel_prepare().
> - *
> - * Return: 0 on success or a negative error code on failure.
> - */
> -static inline int drm_panel_unprepare(struct drm_panel *panel)
> -{
> -	if (panel && panel->funcs && panel->funcs->unprepare)
> -		return panel->funcs->unprepare(panel);
> -
> -	return panel ? -ENOSYS : -EINVAL;
> -}
> -
> -/**
> - * drm_panel_disable - disable a panel
> - * @panel: DRM panel
> - *
> - * This will typically turn off the panel's backlight or disable the display
> - * drivers. For smart panels it should still be possible to communicate with
> - * the integrated circuitry via any command bus after this call.
> - *
> - * Return: 0 on success or a negative error code on failure.
> - */
> -static inline int drm_panel_disable(struct drm_panel *panel)
> -{
> -	if (panel && panel->funcs && panel->funcs->disable)
> -		return panel->funcs->disable(panel);
> -
> -	return panel ? -ENOSYS : -EINVAL;
> -}
> -
> -/**
> - * drm_panel_prepare - power on a panel
> - * @panel: DRM panel
> - *
> - * Calling this function will enable power and deassert any reset signals to
> - * the panel. After this has completed it is possible to communicate with any
> - * integrated circuitry via a command bus.
> - *
> - * Return: 0 on success or a negative error code on failure.
> - */
> -static inline int drm_panel_prepare(struct drm_panel *panel)
> -{
> -	if (panel && panel->funcs && panel->funcs->prepare)
> -		return panel->funcs->prepare(panel);
> -
> -	return panel ? -ENOSYS : -EINVAL;
> -}
> -
> -/**
> - * drm_panel_enable - enable a panel
> - * @panel: DRM panel
> - *
> - * Calling this function will cause the panel display drivers to be turned on
> - * and the backlight to be enabled. Content will be visible on screen after
> - * this call completes.
> - *
> - * Return: 0 on success or a negative error code on failure.
> - */
> -static inline int drm_panel_enable(struct drm_panel *panel)
> -{
> -	if (panel && panel->funcs && panel->funcs->enable)
> -		return panel->funcs->enable(panel);
> -
> -	return panel ? -ENOSYS : -EINVAL;
> -}
> -
> -/**
> - * drm_panel_get_modes - probe the available display modes of a panel
> - * @panel: DRM panel
> - *
> - * The modes probed from the panel are automatically added to the connector
> - * that the panel is attached to.
> - *
> - * Return: The number of modes available from the panel on success or a
> - * negative error code on failure.
> - */
> -static inline int drm_panel_get_modes(struct drm_panel *panel)
> -{
> -	if (panel && panel->funcs && panel->funcs->get_modes)
> -		return panel->funcs->get_modes(panel);
> -
> -	return panel ? -ENOSYS : -EINVAL;
> -}
> -
>  void drm_panel_init(struct drm_panel *panel);
>  
>  int drm_panel_add(struct drm_panel *panel);
> @@ -196,6 +105,14 @@ void drm_panel_remove(struct drm_panel *panel);
>  int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector);
>  int drm_panel_detach(struct drm_panel *panel);
>  
> +int drm_panel_prepare(struct drm_panel *panel);
> +int drm_panel_unprepare(struct drm_panel *panel);
> +
> +int drm_panel_enable(struct drm_panel *panel);
> +int drm_panel_disable(struct drm_panel *panel);

Nitpicking, I would keep the order of the declarations aligned with the
definitions. prepare - enable - disable - unprepare and prepare -
unprepare - enable - disable are both fine with me, as long as they're
consistent.

Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +
> +int drm_panel_get_modes(struct drm_panel *panel);
> +
>  #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
>  struct drm_panel *of_drm_find_panel(const struct device_node *np);
>  #else

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-08-05 10:45 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-04 20:16 [PATCH v1 0/16] drm: panel related updates Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 01/16] drm/bridge: tc358767: fix opencoded use of drm_panel_* Sam Ravnborg
2019-08-05  9:35   ` Philipp Zabel
2019-08-05 11:53     ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 02/16] drm/exynos: " Sam Ravnborg
2019-12-01 11:32   ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 03/16] " Sam Ravnborg
2019-12-01 11:32   ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 04/16] drm/imx: " Sam Ravnborg
2019-08-05  9:34   ` Philipp Zabel
2019-08-04 20:16 ` [PATCH v1 05/16] drm/fsl-dcu: " Sam Ravnborg
2019-08-05  9:16   ` Stefan Agner
2019-08-05 11:54     ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 06/16] drm/msm: " Sam Ravnborg
2019-12-01 11:33   ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 07/16] drm/mxsfb: " Sam Ravnborg
2019-08-05  9:20   ` Stefan Agner
2019-08-04 20:16 ` [PATCH v1 08/16] drm/sti: " Sam Ravnborg
2019-08-07 11:55   ` Benjamin Gaignard
2019-08-04 20:16 ` [PATCH v1 09/16] drm/tegra: " Sam Ravnborg
2019-12-01 11:33   ` Sam Ravnborg
2019-08-04 20:16 ` [PATCH v1 10/16] drm/panel: ili9322: move bus_flags to get_modes() Sam Ravnborg
2019-08-06 12:56   ` Linus Walleij
2019-08-04 20:16 ` [PATCH v1 11/16] drm/panel: move drm_panel functions to .c file Sam Ravnborg
2019-08-05 10:45   ` Laurent Pinchart [this message]
2019-08-04 20:16 ` [PATCH v1 12/16] drm/panel: use inline comments in drm_panel.h Sam Ravnborg
2019-08-05 10:54   ` Laurent Pinchart
2019-08-04 20:16 ` [PATCH v1 13/16] drm/panel: drop return code from drm_panel_detach() Sam Ravnborg
2019-08-05 10:56   ` Laurent Pinchart
2019-08-04 20:16 ` [PATCH v1 14/16] drm/panel: call prepare/enable only once Sam Ravnborg
2019-08-05 10:59   ` Laurent Pinchart
2019-08-05 13:15     ` Emil Velikov
2019-08-05 16:51     ` Sam Ravnborg
2019-12-02 15:22       ` Laurent Pinchart
2019-08-05 17:01   ` Sean Paul
2019-12-02 15:15     ` Laurent Pinchart
2019-08-04 20:16 ` [PATCH v1 15/16] drm/panel: add backlight support Sam Ravnborg
2019-08-05 11:04   ` Laurent Pinchart
2019-08-04 20:16 ` [PATCH v1 16/16] drm/panel: simple: use drm_panel infrastructure Sam Ravnborg
2019-08-05 11:12   ` Laurent Pinchart
2019-08-05 13:18 ` [PATCH v1 0/16] drm: panel related updates Emil Velikov

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=20190805104515.GF29747@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=alexios.zavras@intel.com \
    --cc=alison.wang@nxp.com \
    --cc=allison@lohutok.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gwan-gyeong.mun@intel.com \
    --cc=jonas@kwiboo.se \
    --cc=jonathanh@nvidia.com \
    --cc=kernel@pengutronix.de \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=maxime.ripard@bootlin.com \
    --cc=narmstrong@baylibre.com \
    --cc=sam@ravnborg.org \
    --cc=sean@poorly.run \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=vincent.abriou@st.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