All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [PATCH v2 09/30] drm: omapdrm: dss: Pass DSS pointer to remaining dss functions
Date: Tue, 13 Feb 2018 14:00:27 +0200	[thread overview]
Message-ID: <20180213120048.21603-10-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20180213120048.21603-1-laurent.pinchart@ideasonboard.com>

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>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c |  2 +-
 drivers/gpu/drm/omapdrm/dss/dss.c   |  9 +++++----
 drivers/gpu/drm/omapdrm/dss/dss.h   |  7 ++++---
 drivers/gpu/drm/omapdrm/dss/venc.c  | 11 +++++++----
 4 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 8d0de1b790b7..867887151565 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2733,7 +2733,7 @@ static int dispc_ovl_enable(enum omap_plane_id plane, bool enable)
 
 static enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel)
 {
-	return dss_get_supported_outputs(channel);
+	return dss_get_supported_outputs(dispc.dss, channel);
 }
 
 static void dispc_lcd_enable_signal_polarity(bool act_high)
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 0d292da6757d..7820b04c43e2 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -666,9 +666,10 @@ unsigned long dss_get_max_fck_rate(struct dss_device *dss)
 	return dss->feat->fck_freq_max;
 }
 
-enum omap_dss_output_id dss_get_supported_outputs(enum omap_channel channel)
+enum omap_dss_output_id dss_get_supported_outputs(struct dss_device *dss,
+						  enum omap_channel channel)
 {
-	return dss.feat->outputs[channel];
+	return dss->feat->outputs[channel];
 }
 
 static int dss_setup_default_clock(void)
@@ -697,7 +698,7 @@ static int dss_setup_default_clock(void)
 	return 0;
 }
 
-void dss_set_venc_output(enum omap_dss_venc_type type)
+void dss_set_venc_output(struct dss_device *dss, enum omap_dss_venc_type type)
 {
 	int l = 0;
 
@@ -712,7 +713,7 @@ void dss_set_venc_output(enum omap_dss_venc_type type)
 	REG_FLD_MOD(DSS_CONTROL, l, 6, 6);
 }
 
-void dss_set_dac_pwrdn_bgz(bool enable)
+void dss_set_dac_pwrdn_bgz(struct dss_device *dss, bool enable)
 {
 	REG_FLD_MOD(DSS_CONTROL, enable, 5, 5);	/* DAC Power-Down Control */
 }
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h
index 1d0edf2d145e..89d708e8e970 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -299,7 +299,8 @@ void dss_runtime_put(struct dss_device *dss);
 
 unsigned long dss_get_dispc_clk_rate(struct dss_device *dss);
 unsigned long dss_get_max_fck_rate(struct dss_device *dss);
-enum omap_dss_output_id dss_get_supported_outputs(enum omap_channel channel);
+enum omap_dss_output_id dss_get_supported_outputs(struct dss_device *dss,
+						  enum omap_channel channel);
 int dss_dpi_select_source(struct dss_device *dss, int port,
 			  enum omap_channel channel);
 void dss_select_hdmi_venc_clk_source(struct dss_device *dss,
@@ -329,8 +330,8 @@ enum dss_clk_source dss_get_dsi_clk_source(struct dss_device *dss,
 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);
+void dss_set_venc_output(struct dss_device *dss, enum omap_dss_venc_type type);
+void dss_set_dac_pwrdn_bgz(struct dss_device *dss, bool enable);
 
 int dss_set_fck_rate(struct dss_device *dss, unsigned long rate);
 
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index 6de9d734ddb9..08bae18be188 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -325,6 +325,7 @@ static struct {
 	struct mutex venc_lock;
 	u32 wss_data;
 	struct regulator *vdda_dac_reg;
+	struct dss_device *dss;
 
 	struct clk	*tv_dac_clk;
 
@@ -468,8 +469,8 @@ static int venc_power_on(struct omap_dss_device *dssdev)
 	venc_reset();
 	venc_write_config(venc_timings_to_config(&venc.vm));
 
-	dss_set_venc_output(venc.type);
-	dss_set_dac_pwrdn_bgz(1);
+	dss_set_venc_output(venc.dss, venc.type);
+	dss_set_dac_pwrdn_bgz(venc.dss, 1);
 
 	l = 0;
 
@@ -499,7 +500,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)
 	regulator_disable(venc.vdda_dac_reg);
 err1:
 	venc_write_reg(VENC_OUTPUT_CONTROL, 0);
-	dss_set_dac_pwrdn_bgz(0);
+	dss_set_dac_pwrdn_bgz(venc.dss, 0);
 
 	venc_runtime_put();
 err0:
@@ -511,7 +512,7 @@ static void venc_power_off(struct omap_dss_device *dssdev)
 	enum omap_channel channel = dssdev->dispc_channel;
 
 	venc_write_reg(VENC_OUTPUT_CONTROL, 0);
-	dss_set_dac_pwrdn_bgz(0);
+	dss_set_dac_pwrdn_bgz(venc.dss, 0);
 
 	dss_mgr_disable(channel);
 
@@ -871,11 +872,13 @@ static const struct soc_device_attribute venc_soc_devices[] = {
 static int venc_bind(struct device *dev, struct device *master, void *data)
 {
 	struct platform_device *pdev = to_platform_device(dev);
+	struct dss_device *dss = dss_get_device(master);
 	u8 rev_id;
 	struct resource *venc_mem;
 	int r;
 
 	venc.pdev = pdev;
+	venc.dss = dss;
 
 	/* The OMAP34xx, OMAP35xx and AM35xx VENC require the TV DAC clock. */
 	if (soc_device_match(venc_soc_devices))
-- 
Regards,

Laurent Pinchart

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

  parent reply	other threads:[~2018-02-13 12:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 12:00 [PATCH v2 00/30] omapdrm: Allocate objects dynamically Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 01/30] drm: omapdrm: Split init and cleanup from probe and remove functions Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 02/30] drm: omapdrm: dss: Expose DSS data in a dss_device structure Laurent Pinchart
2018-02-13 20:05   ` Sebastian Reichel
2018-02-13 12:00 ` [PATCH v2 03/30] drm: omapdrm: dss: Pass DSS private structure to runtime PM functions Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 04/30] drm: omapdrm: dss: Pass PLL pointer to dss_ctrl_pll_enable() Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 05/30] drm: omapdrm: dss: Pass DSS pointer to dss_sdi_*() functions Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 06/30] drm: omapdrm: dss: Pass DSS pointer to dss_ops operations Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 07/30] drm: omapdrm: dss: Pass DSS pointer to dss_get_*_clk_source() Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 08/30] drm: omapdrm: dss: Pass DSS pointer to dss clock functions Laurent Pinchart
2018-02-13 12:00 ` Laurent Pinchart [this message]
2018-02-13 12:00 ` [PATCH v2 10/30] drm: omapdrm: dss: Allocate the DSS private data structure dynamically Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 11/30] drm: omapdrm: dss: Support passing private data to debugfs show handlers Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 12/30] drm: omapdrm: dss: Store the registered plls array in struct dss_device Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 13/30] drm: omapdrm: dss: Store the debugfs root directory " Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 14/30] drm: omapdrm: dss: Don't unnecessarily cast to dev to pdev and back Laurent Pinchart
2018-02-13 20:23   ` Sebastian Reichel
2018-02-13 12:00 ` [PATCH v2 15/30] drm: omapdrm: dsi: Pass the dsi_data pointer to internal functions Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 16/30] drm: omapdrm: dsi: Combine two commonly used inline functions Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 17/30] drm: omapdrm: dsi: Use dev pointer directly in dsi_bind() function Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 18/30] drm: omapdrm: dsi: Store the struct device pointer in struct dsi_data Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 19/30] drm: omapdrm: dsi: Don't pass channel to dispc init/uninit functions Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 20/30] drm: omapdrm: dss: Pass omap_dss_device pointer to dss_mgr_*() functions Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 21/30] drm: omapdrm: dss: Pass omap_drm_private pointer to dss_mgr_ops Laurent Pinchart
2018-02-13 20:58   ` Sebastian Reichel
2018-02-13 12:00 ` [PATCH v2 22/30] drm: omapdrm: dss: Store DSS device pointer in the omapdrm private data Laurent Pinchart
2018-02-13 21:25   ` Sebastian Reichel
2018-02-14  8:31   ` Tomi Valkeinen
2018-02-14 15:34     ` Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 23/30] drm: omapdrm: dss: Store dispc ops in dss_device structure Laurent Pinchart
2018-02-13 21:32   ` Sebastian Reichel
2018-02-13 12:00 ` [PATCH v2 24/30] drm: omapdrm: dispc: Pass DISPC pointer to dispc_ops operations Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 25/30] drm: omapdrm: dispc: Pass DISPC pointer to remaining dispc API functions Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 26/30] drm: omapdrm: dispc: Allocate the dispc private data structure dynamically Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 27/30] drm: omapdrm: hdmi4: Allocate the omap_hdmi " Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 28/30] drm: omapdrm: hdmi5: " Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 29/30] drm: omapdrm: sdi: Allocate the sdi private " Laurent Pinchart
2018-02-13 12:00 ` [PATCH v2 30/30] drm: omapdrm: venc: Allocate the venc " Laurent Pinchart
2018-02-14 13:24 ` [PATCH v2 00/30] omapdrm: Allocate objects dynamically Tomi Valkeinen
2018-02-14 15:39   ` Laurent Pinchart
2018-02-14 15:52     ` Tomi Valkeinen
2018-02-28  8:35 ` 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=20180213120048.21603-10-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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.