Skip to contentSkip to conversation

imx-drm: imx-drm-core: Export imx_drm_encoder_get_mux_id

PATCH In review Fabio Estevam 3 participants 6 messages Jun 28, 2013 – Jul 1, 2013

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v2 1/4 imx-drm: imx-drm-core: Export imx_drm_encoder_get_mux_id

From: Fabio Estevam <[email protected]>

When building imx_v6_v7_defconfig with imx-drm drivers selected as modules, we get the following build error:

ERROR: "imx_drm_encoder_get_mux_id" [drivers/staging/imx-drm/imx-ldb.ko] undefined!

Export the required function to avoid this problem.

---
Changes since v1:
- None

 drivers/staging/imx-drm/imx-drm-core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/imx-drm/imx-drm-core.c +1 -0
index 9854a1d..6bc205b 100644
@@ -678,6 +678,7 @@ found:
 
 	return i;
 }
+EXPORT_SYMBOL_GPL(imx_drm_encoder_get_mux_id);
 
 /*
  * imx_drm_remove_encoder - remove an encoder
Signature · 1 line
1.8.1.2
author reviewer
#1 lore raw

PATCH v2 2/4 imx-drm: ipu-dp: Check the return value of devm_kzalloc()

From: Fabio Estevam <[email protected]>

devm_kzalloc() may fail, so let's check its return value.

---
Changes since v1:
- None

 drivers/staging/imx-drm/ipu-v3/ipu-dp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/imx-drm/ipu-v3/ipu-dp.c +2 -0
index 113b046..0449515 100644
@@ -309,6 +309,8 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base)
 	int i;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
 	priv->dev = dev;
 	priv->ipu = ipu;
 
Signature · 1 line
1.8.1.2
author reviewer
#2 lore raw

PATCH v2 3/4 imx-drm: ipu-dp: Remove unneeded braces

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

No need to have braces for a single line 'if' block

---
Changes since v1:
- None

 drivers/staging/imx-drm/ipu-v3/ipu-dp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/imx-drm/ipu-v3/ipu-dp.c +1 -2
index 0449515..6e0e9f1 100644
@@ -317,9 +317,8 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base)
 	ipu->dp_priv = priv;
 
 	priv->base = devm_ioremap(dev, base, PAGE_SIZE);
-	if (!priv->base) {
+	if (!priv->base)
 		return -ENOMEM;
-	}
 
 	mutex_init(&priv->mutex);
 
Signature · 1 line
1.8.1.2
author reviewer
#3 lore raw

PATCH v2 4/4 imx-drm: ipu-dp: Introduce IPUV3_NUM_FLOWS

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

IPUv3 has a total of 3 flows (one synchronous flow and 2 asynchronous flows).

Let's add a definition for such number in order to let the code easier to understand.

---
Changes since v1:
- Merged patches 4 and 5 from previous series
- Fix the comparison logic in 'if ((flow >> 1) >= IPUV3_NUM_FLOWS)'

---
 drivers/staging/imx-drm/ipu-v3/ipu-dp.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/staging/imx-drm/ipu-v3/ipu-dp.c +5 -3
index 6e0e9f1..231afd6 100644
@@ -46,6 +46,8 @@
 #define DP_COM_CONF_CSC_DEF_BG		(2 << 8)
 #define DP_COM_CONF_CSC_DEF_BOTH	(1 << 8)
 
+#define IPUV3_NUM_FLOWS		3
+
 struct ipu_dp_priv;
 
 struct ipu_dp {
@@ -67,7 +69,7 @@ struct ipu_dp_priv {
 	struct ipu_soc *ipu;
 	struct device *dev;
 	void __iomem *base;
-	struct ipu_flow flow[3];
+	struct ipu_flow flow[IPUV3_NUM_FLOWS];
 	struct mutex mutex;
 	int use_count;
 };
@@ -280,7 +282,7 @@ struct ipu_dp *ipu_dp_get(struct ipu_soc *ipu, unsigned int flow)
 	struct ipu_dp_priv *priv = ipu->dp_priv;
 	struct ipu_dp *dp;
 
-	if (flow > 5)
+	if ((flow >> 1) >= IPUV3_NUM_FLOWS)
 		return ERR_PTR(-EINVAL);
 
 	if (flow & 1)
@@ -322,7 +324,7 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base)
 
 	mutex_init(&priv->mutex);
 
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < IPUV3_NUM_FLOWS; i++) {
 		priv->flow[i].foreground.foreground = 1;
 		priv->flow[i].base = priv->base + ipu_dp_flow_base[i];
 		priv->flow[i].priv = priv;
Signature · 1 line
1.8.1.2
Acked-by on v2 1/4
#4 lore raw
In reply to Fabio Estevam

Am Freitag, den 28.06.2013, 13:55 -0300 schrieb Fabio Estevam:

Quoted 22 lines

From: Fabio Estevam <[email protected]>

When building imx_v6_v7_defconfig with imx-drm drivers selected as modules, we get the following build error:

ERROR: "imx_drm_encoder_get_mux_id" [drivers/staging/imx-drm/imx-ldb.ko] undefined!

Export the required function to avoid this problem.

---
Changes since v1:
- None

 drivers/staging/imx-drm/imx-drm-core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/imx-drm/imx-drm-core.c +0 -0
index 9854a1d..6bc205b 100644

drivers/staging/imx-drm/imx-drm-core.c found: · line 684

Quoted 7 lines
drivers/staging/imx-drm/imx-drm-core.c +1 -0
@@ -678,6 +678,7 @@ found:
 
 	return i;
 }
+EXPORT_SYMBOL_GPL(imx_drm_encoder_get_mux_id);
 
 /*
  * imx_drm_remove_encoder - remove an encoder

All four

regards
Philipp

maintainer
#5 lore raw
In reply to Fabio Estevam
Quoted 10 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

When building imx_v6_v7_defconfig with imx-drm drivers selected as modules, we get the following build error:

ERROR: "imx_drm_encoder_get_mux_id" [drivers/staging/imx-drm/imx-ldb.ko] undefined!

Export the required function to avoid this problem.

All: Acked-by: Sascha Hauer <[email protected]>

Sascha

Quoted 23 lines

---
Changes since v1:
- None

 drivers/staging/imx-drm/imx-drm-core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/imx-drm/imx-drm-core.c +1 -0
index 9854a1d..6bc205b 100644
@@ -678,6 +678,7 @@ found:
 
 	return i;
 }
+EXPORT_SYMBOL_GPL(imx_drm_encoder_get_mux_id);
 
 /*
  * imx_drm_remove_encoder - remove an encoder
Signature · 1 line
1.8.1.2
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |