All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 26/48] drm: omapdrm: dss: Pass DSS pointer to dss_get_*_clk_source()
Date: Mon, 16 Oct 2017 11:08:17 +0200	[thread overview]
Message-ID: <20171016090817.i7lqzv5mcsavc7t5@earth> (raw)
In-Reply-To: <20171013145944.26557-27-laurent.pinchart@ideasonboard.com>


[-- Attachment #1.1: Type: text/plain, Size: 6811 bytes --]

Hi,

On Fri, Oct 13, 2017 at 05:59:22PM +0300, Laurent Pinchart wrote:
> This removes the need to access the global DSS private data in those
> functions (both for the current accesses and the future ones that will
> be introduced when allocating the DSS device dynamically).
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

-- Sebastian

>  drivers/gpu/drm/omapdrm/dss/dispc.c | 11 +++++++----
>  drivers/gpu/drm/omapdrm/dss/dsi.c   |  8 +++++---
>  drivers/gpu/drm/omapdrm/dss/dss.c   | 18 ++++++++++--------
>  drivers/gpu/drm/omapdrm/dss/dss.h   |  8 +++++---
>  4 files changed, 27 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
> index 1afd2802e807..723828f97196 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -167,6 +167,7 @@ struct dispc_features {
>  static struct {
>  	struct platform_device *pdev;
>  	void __iomem    *base;
> +	struct dss_device *dss;
>  
>  	struct dss_debugfs_entry *debugfs;
>  
> @@ -3116,7 +3117,7 @@ static unsigned long dispc_fclk_rate(void)
>  	unsigned long r;
>  	enum dss_clk_source src;
>  
> -	src = dss_get_dispc_clk_source();
> +	src = dss_get_dispc_clk_source(dispc.dss);
>  
>  	if (src == DSS_CLK_SRC_FCK) {
>  		r = dss_get_dispc_clk_rate();
> @@ -3143,7 +3144,7 @@ static unsigned long dispc_mgr_lclk_rate(enum omap_channel channel)
>  	if (!dss_mgr_is_lcd(channel))
>  		return dispc_fclk_rate();
>  
> -	src = dss_get_lcd_clk_source(channel);
> +	src = dss_get_lcd_clk_source(dispc.dss, channel);
>  
>  	if (src == DSS_CLK_SRC_FCK) {
>  		r = dss_get_dispc_clk_rate();
> @@ -3223,7 +3224,7 @@ static void dispc_dump_clocks_channel(struct seq_file *s, enum omap_channel chan
>  
>  	seq_printf(s, "- %s -\n", mgr_desc[channel].name);
>  
> -	lcd_clk_src = dss_get_lcd_clk_source(channel);
> +	lcd_clk_src = dss_get_lcd_clk_source(dispc.dss, channel);
>  
>  	seq_printf(s, "%s clk source = %s\n", mgr_desc[channel].name,
>  		dss_get_clk_source_name(lcd_clk_src));
> @@ -3240,7 +3241,7 @@ void dispc_dump_clocks(struct seq_file *s)
>  {
>  	int lcd;
>  	u32 l;
> -	enum dss_clk_source dispc_clk_src = dss_get_dispc_clk_source();
> +	enum dss_clk_source dispc_clk_src = dss_get_dispc_clk_source(dispc.dss);
>  
>  	if (dispc_runtime_get())
>  		return;
> @@ -4542,12 +4543,14 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
>  {
>  	struct platform_device *pdev = to_platform_device(dev);
>  	const struct soc_device_attribute *soc;
> +	struct dss_device *dss = dss_get_device(master);
>  	u32 rev;
>  	int r = 0;
>  	struct resource *dispc_mem;
>  	struct device_node *np = pdev->dev.of_node;
>  
>  	dispc.pdev = pdev;
> +	dispc.dss = dss;
>  
>  	spin_lock_init(&dispc.control_lock);
>  
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 6d60882dfd10..7fb048023fd0 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -1292,8 +1292,10 @@ static unsigned long dsi_fclk_rate(struct platform_device *dsidev)
>  {
>  	unsigned long r;
>  	struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
> +	enum dss_clk_source source;
>  
> -	if (dss_get_dsi_clk_source(dsi->module_id) == DSS_CLK_SRC_FCK) {
> +	source = dss_get_dsi_clk_source(dsi->dss, dsi->module_id);
> +	if (source == DSS_CLK_SRC_FCK) {
>  		/* DSI FCLK source is DSS_CLK_FCK */
>  		r = clk_get_rate(dsi->dss_clk);
>  	} else {
> @@ -1512,8 +1514,8 @@ static void dsi_dump_dsidev_clocks(struct platform_device *dsidev,
>  	int dsi_module = dsi->module_id;
>  	struct dss_pll *pll = &dsi->pll;
>  
> -	dispc_clk_src = dss_get_dispc_clk_source();
> -	dsi_clk_src = dss_get_dsi_clk_source(dsi_module);
> +	dispc_clk_src = dss_get_dispc_clk_source(dsi->dss);
> +	dsi_clk_src = dss_get_dsi_clk_source(dsi->dss, dsi_module);
>  
>  	if (dsi_runtime_get(dsidev))
>  		return;
> diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
> index bd8f7abf0450..ba7a2bf1ec09 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dss.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dss.c
> @@ -610,25 +610,27 @@ void dss_select_lcd_clk_source(struct dss_device *dss,
>  	dss->lcd_clk_source[idx] = clk_src;
>  }
>  
> -enum dss_clk_source dss_get_dispc_clk_source(void)
> +enum dss_clk_source dss_get_dispc_clk_source(struct dss_device *dss)
>  {
> -	return dss.dispc_clk_source;
> +	return dss->dispc_clk_source;
>  }
>  
> -enum dss_clk_source dss_get_dsi_clk_source(int dsi_module)
> +enum dss_clk_source dss_get_dsi_clk_source(struct dss_device *dss,
> +					   int dsi_module)
>  {
> -	return dss.dsi_clk_source[dsi_module];
> +	return dss->dsi_clk_source[dsi_module];
>  }
>  
> -enum dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel)
> +enum dss_clk_source dss_get_lcd_clk_source(struct dss_device *dss,
> +					   enum omap_channel channel)
>  {
> -	if (dss.feat->has_lcd_clk_src) {
> +	if (dss->feat->has_lcd_clk_src) {
>  		int idx = dss_get_channel_index(channel);
> -		return dss.lcd_clk_source[idx];
> +		return dss->lcd_clk_source[idx];
>  	} else {
>  		/* LCD_CLK source is the same as DISPC_FCLK source for
>  		 * OMAP2 and OMAP3 */
> -		return dss.dispc_clk_source;
> +		return dss->dispc_clk_source;
>  	}
>  }
>  
> diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h
> index 05fba6b3400b..fdb51063c703 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/dss.h
> @@ -311,9 +311,11 @@ void dss_select_dsi_clk_source(struct dss_device *dss, int dsi_module,
>  void dss_select_lcd_clk_source(struct dss_device *dss,
>  			       enum omap_channel channel,
>  			       enum dss_clk_source clk_src);
> -enum dss_clk_source dss_get_dispc_clk_source(void);
> -enum dss_clk_source dss_get_dsi_clk_source(int dsi_module);
> -enum dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel);
> +enum dss_clk_source dss_get_dispc_clk_source(struct dss_device *dss);
> +enum dss_clk_source dss_get_dsi_clk_source(struct dss_device *dss,
> +					   int dsi_module);
> +enum dss_clk_source dss_get_lcd_clk_source(struct dss_device *dss,
> +					   enum omap_channel channel);
>  
>  void dss_set_venc_output(enum omap_dss_venc_type type);
>  void dss_set_dac_pwrdn_bgz(bool enable);
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

  reply	other threads:[~2017-10-16  9:08 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 14:58 [PATCH 00/48] omapdrm: Merge omapdrm and omapdss Laurent Pinchart
2017-10-13 14:58 ` [PATCH 01/48] drm: omapdrm: dpi: Don't treat GPIO probe deferral as an error Laurent Pinchart
2017-10-14 12:11   ` Sebastian Reichel
2017-10-13 14:58 ` [PATCH 02/48] drm: omapdrm: Pass drm_device to omap_gem_resume() Laurent Pinchart
2017-10-14 12:15   ` Sebastian Reichel
2017-10-13 14:58 ` [PATCH 03/48] drm: omapdrm: Remove unused omap_dss_find_device() function Laurent Pinchart
2017-10-14 12:16   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 04/48] drm: omapdrm: Merge the omapdss and omapdss-base modules Laurent Pinchart
2017-10-14 12:22   ` Sebastian Reichel
2017-10-16  9:04     ` Laurent Pinchart
2017-10-18  9:19   ` Tomi Valkeinen
2017-10-18 12:28     ` Laurent Pinchart
2017-10-13 14:59 ` [PATCH 05/48] drm: omapdrm: dss: Set the DMA coherent mask Laurent Pinchart
2017-10-14 12:24   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 06/48] drm: omapdrm: dss: Make dss_dump_clocks() function static Laurent Pinchart
2017-10-14 12:24   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 07/48] drm: omapdrm: dpi: Remove dpi_data port_initialized field Laurent Pinchart
2017-10-14 12:28   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 08/48] drm: omapdrm: venc: Return error code on OF parsing failure Laurent Pinchart
2017-10-14 12:29   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 09/48] drm: omapdrm: Deconstruct the omap_drv.h header Laurent Pinchart
2017-10-17 22:25   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 10/48] drm: omapdrm: Use kernel integer types Laurent Pinchart
2017-10-14 12:34   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 11/48] drm: omapdrm: Use unsigned int type Laurent Pinchart
2017-10-14 12:37   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 12/48] drm: omapdrm: Split init and cleanup from probe and remove functions Laurent Pinchart
2017-10-14 12:41   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 13/48] drm: omapdrm: connector-analog-tv: Remove tvc_of_match forward declaration Laurent Pinchart
2017-10-14 12:42   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 14/48] drm: omapdrm: displays: Remove OF node check in connector drivers Laurent Pinchart
2017-10-14 12:43   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 15/48] drm: omapdrm: displays: Remove OF node check in encoder drivers Laurent Pinchart
2017-10-14 12:44   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 16/48] drm: omapdrm: displays: Remove OF node check in panel drivers Laurent Pinchart
2017-10-14 12:45   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 17/48] drm: omapdrm: displays: Get connector source at connect time Laurent Pinchart
2017-10-14 12:51   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 18/48] drm: omapdrm: displays: Get panel " Laurent Pinchart
2017-10-14 12:55   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 19/48] drm: omapdrm: displays: Get encoder " Laurent Pinchart
2017-10-14 12:58   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 20/48] drm: omapdrm: Merge the omapdrm and omapdss drivers Laurent Pinchart
2017-10-14 13:12   ` Sebastian Reichel
2017-10-16  9:09     ` Laurent Pinchart
2017-10-13 14:59 ` [PATCH 21/48] drm: omapdrm: dss: Support passing private data to debugfs show handlers Laurent Pinchart
2017-10-15 21:10   ` Sebastian Reichel
2017-10-16  9:11     ` Laurent Pinchart
2017-10-13 14:59 ` [PATCH 22/48] drm: omapdrm: dss: Pass DSS private structure to runtime PM functions Laurent Pinchart
2017-10-16  8:39   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 23/48] drm: omapdrm: dss: Pass PLL pointer to dss_ctrl_pll_enable() Laurent Pinchart
2017-10-16  8:42   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 24/48] drm: omapdrm: sdi: Pass DSS pointer to dss_sdi_*() functions Laurent Pinchart
2017-10-16  8:47   ` Sebastian Reichel
2017-10-16  9:03     ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 25/48] drm: omapdrm: dss: Pass DSS pointer to dss_ops operations Laurent Pinchart
2017-10-16  9:05   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 26/48] drm: omapdrm: dss: Pass DSS pointer to dss_get_*_clk_source() Laurent Pinchart
2017-10-16  9:08   ` Sebastian Reichel [this message]
2017-10-13 14:59 ` [PATCH 27/48] drm: omapdrm: dss: Pass DSS pointer to dss clock functions Laurent Pinchart
2017-10-16  9:12   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 28/48] drm: omapdrm: dss: Pass DSS pointer to remaining dss functions Laurent Pinchart
2017-10-16  9:15   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 29/48] drm: omapdrm: dss: Remove dss_get_hdmi_venc_clk_source() function Laurent Pinchart
2017-10-16  9:16   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 30/48] drm: omapdrm: dss: Allocate the DSS private data structure dynamically Laurent Pinchart
2017-10-16  9:39   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 31/48] drm: omapdrm: hdmi4: Allocate the omap_hdmi " Laurent Pinchart
2017-10-16 10:19   ` Sebastian Reichel
2017-10-16 10:27   ` Sebastian Reichel
2017-10-16 11:17     ` Laurent Pinchart
2017-10-13 14:59 ` [PATCH 32/48] drm: omapdrm: hdmi5: " Laurent Pinchart
2017-10-17 18:52   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 33/48] drm: omapdrm: venc: Allocate the venc private " Laurent Pinchart
2017-10-17 18:52   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 34/48] drm: omapdrm: sdi: Allocate the sdi " Laurent Pinchart
2017-10-17 19:09   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 35/48] drm: omapdrm: dsi: Make wait_for_bit_change() return a status Laurent Pinchart
2017-10-17 19:12   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 36/48] drm: omapdrm: dsi: Pass the dsi_data pointer to internal functions Laurent Pinchart
2017-10-17 20:02   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 37/48] drm: omapdrm: dsi: Combine two commonly used inline functions Laurent Pinchart
2017-10-17 20:06   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 38/48] drm: omapdrm: dsi: Use dev pointer directly in dsi_bind() function Laurent Pinchart
2017-10-17 20:08   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 39/48] drm: omapdrm: dsi: Store the struct device pointer in struct dsi_data Laurent Pinchart
2017-10-17 20:11   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 40/48] drm: omapdrm: dsi: Don't pass channel to dispc init/uninit functions Laurent Pinchart
2017-10-17 20:13   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 41/48] drm: omapdrm: dss: Pass omap_dss_device pointer to dss_mgr_*() functions Laurent Pinchart
2017-10-17 20:31   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 42/48] drm: omapdrm: dss: Remove unused functions prototypes Laurent Pinchart
2017-10-17 20:37   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 43/48] drm: omapdrm: dss: Pass omap_drm_private pointer to dss_mgr_ops Laurent Pinchart
2017-10-17 21:23   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 44/48] drm: omapdrm: dispc: Pass DISPC pointer to dispc_ops operations Laurent Pinchart
2017-10-17 21:23   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 45/48] drm: omapdrm: dispc: Pass DISPC pointer to remaining dispc API functions Laurent Pinchart
2017-10-17 21:24   ` Sebastian Reichel
2017-10-17 21:44     ` Laurent Pinchart
2017-10-13 14:59 ` [PATCH 46/48] drm: omapdrm: dispc: Allocate the dispc private data structure dynamically Laurent Pinchart
2017-10-17 22:09   ` Sebastian Reichel
2017-10-13 14:59 ` [PATCH 47/48] drm: omapdrm: dss: Store the debugfs root directory in struct dss_device Laurent Pinchart
2017-10-17 22:16   ` Sebastian Reichel
2017-10-17 22:34     ` Laurent Pinchart
2017-10-13 14:59 ` [PATCH 48/48] drm: omapdrm: dss: Store the registered plls array " Laurent Pinchart
2017-10-17 22:21   ` Sebastian Reichel
2017-10-17 22:29 ` [PATCH 00/48] omapdrm: Merge omapdrm and omapdss Sebastian Reichel
2017-10-17 22:36   ` Laurent Pinchart
2017-10-18  9:46 ` Tomi Valkeinen
2017-10-18  9:56   ` Tomi Valkeinen
2018-01-19  3:48     ` Laurent Pinchart
2017-10-18 12:56 ` Tomi Valkeinen
2017-12-01 12:55 ` Tomi Valkeinen

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=20171016090817.i7lqzv5mcsavc7t5@earth \
    --to=sre@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=tomi.valkeinen@ti.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 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.