All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] drm/omap: misc changes
@ 2017-04-27 10:27 Tomi Valkeinen
  2017-04-27 10:27 ` [PATCH 1/6] drm/omap: add new connector types Tomi Valkeinen
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Tomi Valkeinen @ 2017-04-27 10:27 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Tomi Valkeinen, Jyri Sarha

Hi,

Here are a few cleanups, 64bit fixes and connector type improvement for
omapdrm.

 Tomi

Tomi Valkeinen (6):
  drm/omap: add new connector types
  drm/omap: remove unused ovl_enabled()
  drm/omap: remove ovl_set_channel_out
  drm/omap: remove read_irqenable()
  drm/omap: 64bit compile fixes
  drm/omap: define compat_ioctl

 drivers/gpu/drm/omapdrm/dss/dispc.c      | 28 +++++++++-------------------
 drivers/gpu/drm/omapdrm/dss/omapdss.h    |  5 ++---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c |  2 +-
 drivers/gpu/drm/omapdrm/omap_drv.c       |  8 ++++++++
 drivers/gpu/drm/omapdrm/omap_fb.c        |  2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c       |  2 +-
 drivers/gpu/drm/omapdrm/omap_irq.c       |  1 -
 drivers/gpu/drm/omapdrm/omap_plane.c     |  6 ++----
 8 files changed, 24 insertions(+), 30 deletions(-)

-- 
2.7.4

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/6] drm/omap: add new connector types
  2017-04-27 10:27 [PATCH 0/6] drm/omap: misc changes Tomi Valkeinen
@ 2017-04-27 10:27 ` Tomi Valkeinen
  2017-05-08 14:21   ` Laurent Pinchart
  2017-05-09  7:16   ` [PATCH 1/6 v2] " Tomi Valkeinen
  2017-04-27 10:27 ` [PATCH 2/6] drm/omap: remove unused ovl_enabled() Tomi Valkeinen
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 22+ messages in thread
From: Tomi Valkeinen @ 2017-04-27 10:27 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Tomi Valkeinen, Jyri Sarha

We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
because there has not been a proper connector type for them.

We now have connector type for DPI so let's take it into use. At the
same time, add better connector types for the remaining outputs too.

This patch sets the following outputs to use the following connector
types:

DPI -> DPI
DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)
SDI -> LVDS (SDI is a type of LVDS)
VENC -> SVIDEO (it could also be composite, but we don't have that
        information here, so svideo should be quite good match)

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index e1f47f0b3ccf..58c639e1e8e9 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -214,6 +214,13 @@ static int get_connector_type(struct omap_dss_device *dssdev)
 		return DRM_MODE_CONNECTOR_DVID;
 	case OMAP_DISPLAY_TYPE_DSI:
 		return DRM_MODE_CONNECTOR_DSI;
+	case OMAP_DISPLAY_TYPE_DPI:
+	case OMAP_DISPLAY_TYPE_DBI:
+		return DRM_MODE_CONNECTOR_DPI;
+	case OMAP_DISPLAY_TYPE_VENC:
+		return DRM_MODE_CONNECTOR_SVIDEO;
+	case OMAP_DISPLAY_TYPE_SDI:
+		return DRM_MODE_CONNECTOR_LVDS;
 	default:
 		return DRM_MODE_CONNECTOR_Unknown;
 	}
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/6] drm/omap: remove unused ovl_enabled()
  2017-04-27 10:27 [PATCH 0/6] drm/omap: misc changes Tomi Valkeinen
  2017-04-27 10:27 ` [PATCH 1/6] drm/omap: add new connector types Tomi Valkeinen
@ 2017-04-27 10:27 ` Tomi Valkeinen
  2017-05-08 14:23   ` Laurent Pinchart
  2017-04-27 10:27 ` [PATCH 3/6] drm/omap: remove ovl_set_channel_out Tomi Valkeinen
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Tomi Valkeinen @ 2017-04-27 10:27 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Tomi Valkeinen, Jyri Sarha

ovl_enabled() is not used anywhere, so remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c   | 6 ------
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 -
 2 files changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 5ac0145fbae6..9fba92973d0e 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2935,11 +2935,6 @@ static int dispc_ovl_enable(enum omap_plane_id plane, bool enable)
 	return 0;
 }
 
-static bool dispc_ovl_enabled(enum omap_plane_id plane)
-{
-	return REG_GET(DISPC_OVL_ATTRIBUTES(plane), 0, 0);
-}
-
 static enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel)
 {
 	return dss_feat_get_supported_outputs(channel);
@@ -4377,7 +4372,6 @@ static const struct dispc_ops dispc_ops = {
 	.mgr_set_gamma = dispc_mgr_set_gamma,
 
 	.ovl_enable = dispc_ovl_enable,
-	.ovl_enabled = dispc_ovl_enabled,
 	.ovl_set_channel_out = dispc_ovl_set_channel_out,
 	.ovl_setup = dispc_ovl_setup,
 	.ovl_get_color_modes = dispc_ovl_get_color_modes,
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index b19dae1fd6c5..d9ad33df0455 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -913,7 +913,6 @@ struct dispc_ops {
 		unsigned int length);
 
 	int (*ovl_enable)(enum omap_plane_id plane, bool enable);
-	bool (*ovl_enabled)(enum omap_plane_id plane);
 	void (*ovl_set_channel_out)(enum omap_plane_id plane,
 			enum omap_channel channel);
 	int (*ovl_setup)(enum omap_plane_id plane,
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/6] drm/omap: remove ovl_set_channel_out
  2017-04-27 10:27 [PATCH 0/6] drm/omap: misc changes Tomi Valkeinen
  2017-04-27 10:27 ` [PATCH 1/6] drm/omap: add new connector types Tomi Valkeinen
  2017-04-27 10:27 ` [PATCH 2/6] drm/omap: remove unused ovl_enabled() Tomi Valkeinen
@ 2017-04-27 10:27 ` Tomi Valkeinen
  2017-05-08 14:26   ` Laurent Pinchart
  2017-04-27 10:27 ` [PATCH 4/6] drm/omap: remove read_irqenable() Tomi Valkeinen
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Tomi Valkeinen @ 2017-04-27 10:27 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Tomi Valkeinen, Jyri Sarha

At the moment we have ovl_set_channel_out() to configure the output
channel of an overlay. It makes sense to have this configuration as part
of the reset of overlay configuration, and in DSS6+ we need the output
channel when doing the other overlay configuration.

This patch adds 'channel' parameter to ovl_setup(), so that all overlay
configuration is done via the same function, and removes the
ovl_set_channel_out().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c   | 13 ++++++-------
 drivers/gpu/drm/omapdrm/dss/omapdss.h |  3 ++-
 drivers/gpu/drm/omapdrm/omap_plane.c  |  6 ++----
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 9fba92973d0e..97f4a1163fbe 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2834,21 +2834,21 @@ static int dispc_ovl_setup_common(enum omap_plane_id plane,
 
 static int dispc_ovl_setup(enum omap_plane_id plane,
 		const struct omap_overlay_info *oi,
-		const struct videomode *vm, bool mem_to_mem)
+		const struct videomode *vm, bool mem_to_mem,
+		enum omap_channel channel)
 {
 	int r;
 	enum omap_overlay_caps caps = dss_feat_get_overlay_caps(plane);
-	enum omap_channel channel;
 	const bool replication = true;
 
-	channel = dispc_ovl_get_channel_out(plane);
-
 	DSSDBG("dispc_ovl_setup %d, pa %pad, pa_uv %pad, sw %d, %d,%d, %dx%d ->"
 		" %dx%d, cmode %x, rot %d, mir %d, chan %d repl %d\n",
 		plane, &oi->paddr, &oi->p_uv_addr, oi->screen_width, oi->pos_x,
 		oi->pos_y, oi->width, oi->height, oi->out_width, oi->out_height,
 		oi->color_mode, oi->rotation, oi->mirror, channel, replication);
 
+	dispc_ovl_set_channel_out(plane, channel);
+
 	r = dispc_ovl_setup_common(plane, caps, oi->paddr, oi->p_uv_addr,
 		oi->screen_width, oi->pos_x, oi->pos_y, oi->width, oi->height,
 		oi->out_width, oi->out_height, oi->color_mode, oi->rotation,
@@ -4304,8 +4304,8 @@ static void dispc_errata_i734_wa(void)
 	REG_FLD_MOD(DISPC_CONFIG, 0x1f, 8, 4);
 
 	/* Setup and enable GFX plane */
-	dispc_ovl_set_channel_out(OMAP_DSS_GFX, OMAP_DSS_CHANNEL_LCD);
-	dispc_ovl_setup(OMAP_DSS_GFX, &ovli, &i734.vm, false);
+	dispc_ovl_setup(OMAP_DSS_GFX, &ovli, &i734.vm, false,
+		OMAP_DSS_CHANNEL_LCD);
 	dispc_ovl_enable(OMAP_DSS_GFX, true);
 
 	/* Set up and enable display manager for LCD1 */
@@ -4372,7 +4372,6 @@ static const struct dispc_ops dispc_ops = {
 	.mgr_set_gamma = dispc_mgr_set_gamma,
 
 	.ovl_enable = dispc_ovl_enable,
-	.ovl_set_channel_out = dispc_ovl_set_channel_out,
 	.ovl_setup = dispc_ovl_setup,
 	.ovl_get_color_modes = dispc_ovl_get_color_modes,
 };
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index d9ad33df0455..a2b9b7f29472 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -917,7 +917,8 @@ struct dispc_ops {
 			enum omap_channel channel);
 	int (*ovl_setup)(enum omap_plane_id plane,
 			 const struct omap_overlay_info *oi,
-			const struct videomode *vm, bool mem_to_mem);
+			const struct videomode *vm, bool mem_to_mem,
+			enum omap_channel channel);
 
 	enum omap_color_mode (*ovl_get_color_modes)(enum omap_plane_id plane);
 };
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 9168154d749e..81d9822f6f4a 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -118,12 +118,10 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
 	DBG("%d,%d %pad %pad", info.pos_x, info.pos_y,
 			&info.paddr, &info.p_uv_addr);
 
-	priv->dispc_ops->ovl_set_channel_out(omap_plane->id,
-				  omap_crtc_channel(state->crtc));
-
 	/* and finally, update omapdss: */
 	ret = priv->dispc_ops->ovl_setup(omap_plane->id, &info,
-			      omap_crtc_timings(state->crtc), false);
+			      omap_crtc_timings(state->crtc), false,
+			      omap_crtc_channel(state->crtc));
 	if (ret) {
 		dev_err(plane->dev->dev, "Failed to setup plane %s\n",
 			omap_plane->name);
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/6] drm/omap: remove read_irqenable()
  2017-04-27 10:27 [PATCH 0/6] drm/omap: misc changes Tomi Valkeinen
                   ` (2 preceding siblings ...)
  2017-04-27 10:27 ` [PATCH 3/6] drm/omap: remove ovl_set_channel_out Tomi Valkeinen
@ 2017-04-27 10:27 ` Tomi Valkeinen
  2017-05-08 14:28   ` Laurent Pinchart
  2017-04-27 10:27 ` [PATCH 5/6] drm/omap: 64bit compile fixes Tomi Valkeinen
  2017-04-27 10:27 ` [PATCH 6/6] drm/omap: define compat_ioctl Tomi Valkeinen
  5 siblings, 1 reply; 22+ messages in thread
From: Tomi Valkeinen @ 2017-04-27 10:27 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Tomi Valkeinen, Jyri Sarha

We only use read_irqenable() to flush posted write. Instead of having a
separate function for this, do the flush implicitly in write_irqenable().
Thus we can remove read_irqenable().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c   | 9 +++------
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 -
 drivers/gpu/drm/omapdrm/omap_irq.c    | 1 -
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 97f4a1163fbe..352fad583571 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -3782,11 +3782,6 @@ static void dispc_clear_irqstatus(u32 mask)
 	dispc_write_reg(DISPC_IRQSTATUS, mask);
 }
 
-static u32 dispc_read_irqenable(void)
-{
-	return dispc_read_reg(DISPC_IRQENABLE);
-}
-
 static void dispc_write_irqenable(u32 mask)
 {
 	u32 old_mask = dispc_read_reg(DISPC_IRQENABLE);
@@ -3795,6 +3790,9 @@ static void dispc_write_irqenable(u32 mask)
 	dispc_clear_irqstatus((mask ^ old_mask) & mask);
 
 	dispc_write_reg(DISPC_IRQENABLE, mask);
+
+	/* flush posted write */
+	dispc_read_reg(DISPC_IRQENABLE);
 }
 
 void dispc_enable_sidle(void)
@@ -4345,7 +4343,6 @@ static void dispc_errata_i734_wa(void)
 static const struct dispc_ops dispc_ops = {
 	.read_irqstatus = dispc_read_irqstatus,
 	.clear_irqstatus = dispc_clear_irqstatus,
-	.read_irqenable = dispc_read_irqenable,
 	.write_irqenable = dispc_write_irqenable,
 
 	.request_irq = dispc_request_irq,
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index a2b9b7f29472..44bf53351e00 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -881,7 +881,6 @@ void dss_mgr_unregister_framedone_handler(enum omap_channel channel,
 struct dispc_ops {
 	u32 (*read_irqstatus)(void);
 	void (*clear_irqstatus)(u32 mask);
-	u32 (*read_irqenable)(void);
 	void (*write_irqenable)(u32 mask);
 
 	int (*request_irq)(irq_handler_t handler, void *dev_id);
diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c
index 115104cdcc59..7afe4b90befd 100644
--- a/drivers/gpu/drm/omapdrm/omap_irq.c
+++ b/drivers/gpu/drm/omapdrm/omap_irq.c
@@ -41,7 +41,6 @@ static void omap_irq_update(struct drm_device *dev)
 	DBG("irqmask=%08x", irqmask);
 
 	priv->dispc_ops->write_irqenable(irqmask);
-	priv->dispc_ops->read_irqenable();        /* flush posted write */
 }
 
 static void omap_irq_wait_handler(struct omap_irq_wait *wait)
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/6] drm/omap: 64bit compile fixes
  2017-04-27 10:27 [PATCH 0/6] drm/omap: misc changes Tomi Valkeinen
                   ` (3 preceding siblings ...)
  2017-04-27 10:27 ` [PATCH 4/6] drm/omap: remove read_irqenable() Tomi Valkeinen
@ 2017-04-27 10:27 ` Tomi Valkeinen
  2017-05-08 14:29   ` Laurent Pinchart
  2017-04-27 10:27 ` [PATCH 6/6] drm/omap: define compat_ioctl Tomi Valkeinen
  5 siblings, 1 reply; 22+ messages in thread
From: Tomi Valkeinen @ 2017-04-27 10:27 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Tomi Valkeinen, Jyri Sarha

Fix a few type issues that cause compile warnings on 64 bit ARM
compiler. The change should not affect 32bit platforms.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 2 +-
 drivers/gpu/drm/omapdrm/omap_fb.c        | 2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index 3cab06661a08..1dd3dafc59af 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -388,7 +388,7 @@ struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, uint16_t w,
 	u32 min_align = 128;
 	int ret;
 	unsigned long flags;
-	size_t slot_bytes;
+	u32 slot_bytes;
 
 	BUG_ON(!validfmt(fmt));
 
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 29dc677dd4d3..2dca19a0c2ff 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -449,7 +449,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
 
 		if (size > omap_gem_mmap_size(bos[i]) - mode_cmd->offsets[i]) {
 			dev_dbg(dev->dev,
-				"provided buffer object is too small! %d < %d\n",
+				"provided buffer object is too small! %zu < %d\n",
 				bos[i]->size - mode_cmd->offsets[i], size);
 			ret = -EINVAL;
 			goto fail;
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 68a75b829b71..f076c63e5b08 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -1046,7 +1046,7 @@ void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m)
 					area->p1.x, area->p1.y);
 		}
 	} else {
-		seq_printf(m, " %d", obj->size);
+		seq_printf(m, " %zu", obj->size);
 	}
 
 	seq_printf(m, "\n");
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 6/6] drm/omap: define compat_ioctl
  2017-04-27 10:27 [PATCH 0/6] drm/omap: misc changes Tomi Valkeinen
                   ` (4 preceding siblings ...)
  2017-04-27 10:27 ` [PATCH 5/6] drm/omap: 64bit compile fixes Tomi Valkeinen
@ 2017-04-27 10:27 ` Tomi Valkeinen
  2017-05-08 14:32   ` Laurent Pinchart
  5 siblings, 1 reply; 22+ messages in thread
From: Tomi Valkeinen @ 2017-04-27 10:27 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Tomi Valkeinen, Jyri Sarha

Define compat_ioctl in omapdriver_fops to make it possible to use 32bit
apps on 64bit platform.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 58c639e1e8e9..3cfff88c7d79 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -615,6 +615,7 @@ static const struct file_operations omapdriver_fops = {
 	.owner = THIS_MODULE,
 	.open = drm_open,
 	.unlocked_ioctl = drm_ioctl,
+	.compat_ioctl = drm_compat_ioctl,
 	.release = drm_release,
 	.mmap = omap_gem_mmap,
 	.poll = drm_poll,
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] drm/omap: add new connector types
  2017-04-27 10:27 ` [PATCH 1/6] drm/omap: add new connector types Tomi Valkeinen
@ 2017-05-08 14:21   ` Laurent Pinchart
  2017-05-08 14:35     ` Tomi Valkeinen
  2017-05-09  7:16   ` [PATCH 1/6 v2] " Tomi Valkeinen
  1 sibling, 1 reply; 22+ messages in thread
From: Laurent Pinchart @ 2017-05-08 14:21 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Jyri Sarha, dri-devel

Hi Tomi,

Thank you for the patch.

On Thursday 27 Apr 2017 13:27:49 Tomi Valkeinen wrote:
> We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
> because there has not been a proper connector type for them.
> 
> We now have connector type for DPI so let's take it into use. At the
> same time, add better connector types for the remaining outputs too.
> 
> This patch sets the following outputs to use the following connector
> types:
> 
> DPI -> DPI
> DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)

This looks OK to me.

> SDI -> LVDS (SDI is a type of LVDS)

If we're talking about this 
https://en.wikipedia.org/wiki/Serial_digital_interface SDI, it's not a type of 
LVDS at all. DRM_MODE_CONNECTOR_LVDS is interpreted as meaning that an LVDS 
display panel is attached to the device, and is likely not removable. I don't 
think it's a good match for SDI. We might need a new connector type.

> VENC -> SVIDEO (it could also be composite, but we don't have that
>         information here, so svideo should be quite good match)

Do we have the information anywhere ?

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
> b/drivers/gpu/drm/omapdrm/omap_drv.c index e1f47f0b3ccf..58c639e1e8e9
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -214,6 +214,13 @@ static int get_connector_type(struct omap_dss_device
> *dssdev) return DRM_MODE_CONNECTOR_DVID;
>  	case OMAP_DISPLAY_TYPE_DSI:
>  		return DRM_MODE_CONNECTOR_DSI;
> +	case OMAP_DISPLAY_TYPE_DPI:
> +	case OMAP_DISPLAY_TYPE_DBI:
> +		return DRM_MODE_CONNECTOR_DPI;
> +	case OMAP_DISPLAY_TYPE_VENC:
> +		return DRM_MODE_CONNECTOR_SVIDEO;
> +	case OMAP_DISPLAY_TYPE_SDI:
> +		return DRM_MODE_CONNECTOR_LVDS;
>  	default:
>  		return DRM_MODE_CONNECTOR_Unknown;
>  	}

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 2/6] drm/omap: remove unused ovl_enabled()
  2017-04-27 10:27 ` [PATCH 2/6] drm/omap: remove unused ovl_enabled() Tomi Valkeinen
@ 2017-05-08 14:23   ` Laurent Pinchart
  0 siblings, 0 replies; 22+ messages in thread
From: Laurent Pinchart @ 2017-05-08 14:23 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Jyri Sarha, dri-devel

Hi Tomi,

Thank you for the patch.

On Thursday 27 Apr 2017 13:27:50 Tomi Valkeinen wrote:
> ovl_enabled() is not used anywhere, so remove it.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

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

> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c   | 6 ------
>  drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 -
>  2 files changed, 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c
> b/drivers/gpu/drm/omapdrm/dss/dispc.c index 5ac0145fbae6..9fba92973d0e
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -2935,11 +2935,6 @@ static int dispc_ovl_enable(enum omap_plane_id plane,
> bool enable) return 0;
>  }
> 
> -static bool dispc_ovl_enabled(enum omap_plane_id plane)
> -{
> -	return REG_GET(DISPC_OVL_ATTRIBUTES(plane), 0, 0);
> -}
> -
>  static enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum
> omap_channel channel) {
>  	return dss_feat_get_supported_outputs(channel);
> @@ -4377,7 +4372,6 @@ static const struct dispc_ops dispc_ops = {
>  	.mgr_set_gamma = dispc_mgr_set_gamma,
> 
>  	.ovl_enable = dispc_ovl_enable,
> -	.ovl_enabled = dispc_ovl_enabled,
>  	.ovl_set_channel_out = dispc_ovl_set_channel_out,
>  	.ovl_setup = dispc_ovl_setup,
>  	.ovl_get_color_modes = dispc_ovl_get_color_modes,
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> b/drivers/gpu/drm/omapdrm/dss/omapdss.h index b19dae1fd6c5..d9ad33df0455
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> @@ -913,7 +913,6 @@ struct dispc_ops {
>  		unsigned int length);
> 
>  	int (*ovl_enable)(enum omap_plane_id plane, bool enable);
> -	bool (*ovl_enabled)(enum omap_plane_id plane);
>  	void (*ovl_set_channel_out)(enum omap_plane_id plane,
>  			enum omap_channel channel);
>  	int (*ovl_setup)(enum omap_plane_id plane,

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 3/6] drm/omap: remove ovl_set_channel_out
  2017-04-27 10:27 ` [PATCH 3/6] drm/omap: remove ovl_set_channel_out Tomi Valkeinen
@ 2017-05-08 14:26   ` Laurent Pinchart
  2017-05-09  7:12     ` Tomi Valkeinen
  0 siblings, 1 reply; 22+ messages in thread
From: Laurent Pinchart @ 2017-05-08 14:26 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Jyri Sarha, dri-devel

Hi Tomi,

Thank you for the patch.

On Thursday 27 Apr 2017 13:27:51 Tomi Valkeinen wrote:
> At the moment we have ovl_set_channel_out() to configure the output
> channel of an overlay. It makes sense to have this configuration as part
> of the reset of overlay configuration, and in DSS6+ we need the output

Do you mean s/reset/rest/ ?

> channel when doing the other overlay configuration.
> 
> This patch adds 'channel' parameter to ovl_setup(), so that all overlay

s/adds/adds a/

> configuration is done via the same function, and removes the
> ovl_set_channel_out().
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c   | 13 ++++++-------
>  drivers/gpu/drm/omapdrm/dss/omapdss.h |  3 ++-
>  drivers/gpu/drm/omapdrm/omap_plane.c  |  6 ++----
>  3 files changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c
> b/drivers/gpu/drm/omapdrm/dss/dispc.c index 9fba92973d0e..97f4a1163fbe
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -2834,21 +2834,21 @@ static int dispc_ovl_setup_common(enum omap_plane_id
> plane,
> 
>  static int dispc_ovl_setup(enum omap_plane_id plane,
>  		const struct omap_overlay_info *oi,
> -		const struct videomode *vm, bool mem_to_mem)
> +		const struct videomode *vm, bool mem_to_mem,
> +		enum omap_channel channel)
>  {
>  	int r;
>  	enum omap_overlay_caps caps = dss_feat_get_overlay_caps(plane);
> -	enum omap_channel channel;
>  	const bool replication = true;
> 
> -	channel = dispc_ovl_get_channel_out(plane);
> -
>  	DSSDBG("dispc_ovl_setup %d, pa %pad, pa_uv %pad, sw %d, %d,%d, %dx%d -
>"
>  		" %dx%d, cmode %x, rot %d, mir %d, chan %d repl %d\n",
>  		plane, &oi->paddr, &oi->p_uv_addr, oi->screen_width, oi-
>pos_x,
>  		oi->pos_y, oi->width, oi->height, oi->out_width, oi-
>out_height,
>  		oi->color_mode, oi->rotation, oi->mirror, channel, 
replication);
> 
> +	dispc_ovl_set_channel_out(plane, channel);
> +
>  	r = dispc_ovl_setup_common(plane, caps, oi->paddr, oi->p_uv_addr,
>  		oi->screen_width, oi->pos_x, oi->pos_y, oi->width, oi->height,
>  		oi->out_width, oi->out_height, oi->color_mode, oi->rotation,
> @@ -4304,8 +4304,8 @@ static void dispc_errata_i734_wa(void)
>  	REG_FLD_MOD(DISPC_CONFIG, 0x1f, 8, 4);
> 
>  	/* Setup and enable GFX plane */
> -	dispc_ovl_set_channel_out(OMAP_DSS_GFX, OMAP_DSS_CHANNEL_LCD);
> -	dispc_ovl_setup(OMAP_DSS_GFX, &ovli, &i734.vm, false);
> +	dispc_ovl_setup(OMAP_DSS_GFX, &ovli, &i734.vm, false,
> +		OMAP_DSS_CHANNEL_LCD);
>  	dispc_ovl_enable(OMAP_DSS_GFX, true);
> 
>  	/* Set up and enable display manager for LCD1 */
> @@ -4372,7 +4372,6 @@ static const struct dispc_ops dispc_ops = {
>  	.mgr_set_gamma = dispc_mgr_set_gamma,
> 
>  	.ovl_enable = dispc_ovl_enable,
> -	.ovl_set_channel_out = dispc_ovl_set_channel_out,
>  	.ovl_setup = dispc_ovl_setup,
>  	.ovl_get_color_modes = dispc_ovl_get_color_modes,
>  };
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> b/drivers/gpu/drm/omapdrm/dss/omapdss.h index d9ad33df0455..a2b9b7f29472
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> @@ -917,7 +917,8 @@ struct dispc_ops {
>  			enum omap_channel channel);

Shouldn't you also remove the .ovl_set_channel_out() operation from this 
structure ?

Apart from that,

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

>  	int (*ovl_setup)(enum omap_plane_id plane,
>  			 const struct omap_overlay_info *oi,
> -			const struct videomode *vm, bool mem_to_mem);
> +			const struct videomode *vm, bool mem_to_mem,
> +			enum omap_channel channel);
> 
>  	enum omap_color_mode (*ovl_get_color_modes)(enum omap_plane_id plane);
>  };
> diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c
> b/drivers/gpu/drm/omapdrm/omap_plane.c index 9168154d749e..81d9822f6f4a
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_plane.c
> +++ b/drivers/gpu/drm/omapdrm/omap_plane.c
> @@ -118,12 +118,10 @@ static void omap_plane_atomic_update(struct drm_plane
> *plane, DBG("%d,%d %pad %pad", info.pos_x, info.pos_y,
>  			&info.paddr, &info.p_uv_addr);
> 
> -	priv->dispc_ops->ovl_set_channel_out(omap_plane->id,
> -				  omap_crtc_channel(state->crtc));
> -
>  	/* and finally, update omapdss: */
>  	ret = priv->dispc_ops->ovl_setup(omap_plane->id, &info,
> -			      omap_crtc_timings(state->crtc), false);
> +			      omap_crtc_timings(state->crtc), false,
> +			      omap_crtc_channel(state->crtc));
>  	if (ret) {
>  		dev_err(plane->dev->dev, "Failed to setup plane %s\n",
>  			omap_plane->name);

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 4/6] drm/omap: remove read_irqenable()
  2017-04-27 10:27 ` [PATCH 4/6] drm/omap: remove read_irqenable() Tomi Valkeinen
@ 2017-05-08 14:28   ` Laurent Pinchart
  0 siblings, 0 replies; 22+ messages in thread
From: Laurent Pinchart @ 2017-05-08 14:28 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Jyri Sarha, dri-devel

Hi Tomi,

Thank you for the patch.

On Thursday 27 Apr 2017 13:27:52 Tomi Valkeinen wrote:
> We only use read_irqenable() to flush posted write. Instead of having a
> separate function for this, do the flush implicitly in write_irqenable().
> Thus we can remove read_irqenable().
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

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

> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c   | 9 +++------
>  drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 -
>  drivers/gpu/drm/omapdrm/omap_irq.c    | 1 -
>  3 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c
> b/drivers/gpu/drm/omapdrm/dss/dispc.c index 97f4a1163fbe..352fad583571
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -3782,11 +3782,6 @@ static void dispc_clear_irqstatus(u32 mask)
>  	dispc_write_reg(DISPC_IRQSTATUS, mask);
>  }
> 
> -static u32 dispc_read_irqenable(void)
> -{
> -	return dispc_read_reg(DISPC_IRQENABLE);
> -}
> -
>  static void dispc_write_irqenable(u32 mask)
>  {
>  	u32 old_mask = dispc_read_reg(DISPC_IRQENABLE);
> @@ -3795,6 +3790,9 @@ static void dispc_write_irqenable(u32 mask)
>  	dispc_clear_irqstatus((mask ^ old_mask) & mask);
> 
>  	dispc_write_reg(DISPC_IRQENABLE, mask);
> +
> +	/* flush posted write */
> +	dispc_read_reg(DISPC_IRQENABLE);
>  }
> 
>  void dispc_enable_sidle(void)
> @@ -4345,7 +4343,6 @@ static void dispc_errata_i734_wa(void)
>  static const struct dispc_ops dispc_ops = {
>  	.read_irqstatus = dispc_read_irqstatus,
>  	.clear_irqstatus = dispc_clear_irqstatus,
> -	.read_irqenable = dispc_read_irqenable,
>  	.write_irqenable = dispc_write_irqenable,
> 
>  	.request_irq = dispc_request_irq,
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> b/drivers/gpu/drm/omapdrm/dss/omapdss.h index a2b9b7f29472..44bf53351e00
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> @@ -881,7 +881,6 @@ void dss_mgr_unregister_framedone_handler(enum
> omap_channel channel, struct dispc_ops {
>  	u32 (*read_irqstatus)(void);
>  	void (*clear_irqstatus)(u32 mask);
> -	u32 (*read_irqenable)(void);
>  	void (*write_irqenable)(u32 mask);
> 
>  	int (*request_irq)(irq_handler_t handler, void *dev_id);
> diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c
> b/drivers/gpu/drm/omapdrm/omap_irq.c index 115104cdcc59..7afe4b90befd
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_irq.c
> +++ b/drivers/gpu/drm/omapdrm/omap_irq.c
> @@ -41,7 +41,6 @@ static void omap_irq_update(struct drm_device *dev)
>  	DBG("irqmask=%08x", irqmask);
> 
>  	priv->dispc_ops->write_irqenable(irqmask);
> -	priv->dispc_ops->read_irqenable();        /* flush posted write */
>  }
> 
>  static void omap_irq_wait_handler(struct omap_irq_wait *wait)

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 5/6] drm/omap: 64bit compile fixes
  2017-04-27 10:27 ` [PATCH 5/6] drm/omap: 64bit compile fixes Tomi Valkeinen
@ 2017-05-08 14:29   ` Laurent Pinchart
  0 siblings, 0 replies; 22+ messages in thread
From: Laurent Pinchart @ 2017-05-08 14:29 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Jyri Sarha, dri-devel

Hi Tomi,

Thank you for the patch.

On Thursday 27 Apr 2017 13:27:53 Tomi Valkeinen wrote:
> Fix a few type issues that cause compile warnings on 64 bit ARM
> compiler. The change should not affect 32bit platforms.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

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

> ---
>  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 2 +-
>  drivers/gpu/drm/omapdrm/omap_fb.c        | 2 +-
>  drivers/gpu/drm/omapdrm/omap_gem.c       | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index 3cab06661a08..1dd3dafc59af
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> @@ -388,7 +388,7 @@ struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt,
> uint16_t w, u32 min_align = 128;
>  	int ret;
>  	unsigned long flags;
> -	size_t slot_bytes;
> +	u32 slot_bytes;
> 
>  	BUG_ON(!validfmt(fmt));
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c
> b/drivers/gpu/drm/omapdrm/omap_fb.c index 29dc677dd4d3..2dca19a0c2ff 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fb.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fb.c
> @@ -449,7 +449,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct
> drm_device *dev,
> 
>  		if (size > omap_gem_mmap_size(bos[i]) - mode_cmd->offsets[i]) 
{
>  			dev_dbg(dev->dev,
> -				"provided buffer object is too small! %d < 
%d\n",
> +				"provided buffer object is too small! %zu < 
%d\n",
>  				bos[i]->size - mode_cmd->offsets[i], size);
>  			ret = -EINVAL;
>  			goto fail;
> diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c
> b/drivers/gpu/drm/omapdrm/omap_gem.c index 68a75b829b71..f076c63e5b08
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_gem.c
> +++ b/drivers/gpu/drm/omapdrm/omap_gem.c
> @@ -1046,7 +1046,7 @@ void omap_gem_describe(struct drm_gem_object *obj,
> struct seq_file *m) area->p1.x, area->p1.y);
>  		}
>  	} else {
> -		seq_printf(m, " %d", obj->size);
> +		seq_printf(m, " %zu", obj->size);
>  	}
> 
>  	seq_printf(m, "\n");

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 6/6] drm/omap: define compat_ioctl
  2017-04-27 10:27 ` [PATCH 6/6] drm/omap: define compat_ioctl Tomi Valkeinen
@ 2017-05-08 14:32   ` Laurent Pinchart
  0 siblings, 0 replies; 22+ messages in thread
From: Laurent Pinchart @ 2017-05-08 14:32 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Jyri Sarha, dri-devel

Hi Tomi,

Thank you for the patch.

On Thursday 27 Apr 2017 13:27:54 Tomi Valkeinen wrote:
> Define compat_ioctl in omapdriver_fops to make it possible to use 32bit
> apps on 64bit platform.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

None of the omapdrm custom ioctls seem to need compat handling, so

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

> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
> b/drivers/gpu/drm/omapdrm/omap_drv.c index 58c639e1e8e9..3cfff88c7d79
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -615,6 +615,7 @@ static const struct file_operations omapdriver_fops = {
>  	.owner = THIS_MODULE,
>  	.open = drm_open,
>  	.unlocked_ioctl = drm_ioctl,
> +	.compat_ioctl = drm_compat_ioctl,
>  	.release = drm_release,
>  	.mmap = omap_gem_mmap,
>  	.poll = drm_poll,

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] drm/omap: add new connector types
  2017-05-08 14:21   ` Laurent Pinchart
@ 2017-05-08 14:35     ` Tomi Valkeinen
  2017-05-08 16:21       ` Laurent Pinchart
  0 siblings, 1 reply; 22+ messages in thread
From: Tomi Valkeinen @ 2017-05-08 14:35 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Jyri Sarha, dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 1453 bytes --]

On 08/05/17 17:21, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Thursday 27 Apr 2017 13:27:49 Tomi Valkeinen wrote:
>> We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
>> because there has not been a proper connector type for them.
>>
>> We now have connector type for DPI so let's take it into use. At the
>> same time, add better connector types for the remaining outputs too.
>>
>> This patch sets the following outputs to use the following connector
>> types:
>>
>> DPI -> DPI
>> DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)
> 
> This looks OK to me.
> 
>> SDI -> LVDS (SDI is a type of LVDS)
> 
> If we're talking about this 
> https://en.wikipedia.org/wiki/Serial_digital_interface SDI, it's not a type of 
> LVDS at all. DRM_MODE_CONNECTOR_LVDS is interpreted as meaning that an LVDS 
> display panel is attached to the device, and is likely not removable. I don't 
> think it's a good match for SDI. We might need a new connector type.

No, it's not that. It's Serial display interface. I think it's
FPDLink/FlatLink.

>> VENC -> SVIDEO (it could also be composite, but we don't have that
>>         information here, so svideo should be quite good match)
> 
> Do we have the information anywhere ?

Yes, in the dts. At some point we should use that data, but I didn't
want to start digging the encoder/connector properties here.

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] drm/omap: add new connector types
  2017-05-08 14:35     ` Tomi Valkeinen
@ 2017-05-08 16:21       ` Laurent Pinchart
  2017-05-09  6:57         ` Tomi Valkeinen
  0 siblings, 1 reply; 22+ messages in thread
From: Laurent Pinchart @ 2017-05-08 16:21 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Jyri Sarha, dri-devel

Hi Tomi,

On Monday 08 May 2017 17:35:50 Tomi Valkeinen wrote:
> On 08/05/17 17:21, Laurent Pinchart wrote:
> > On Thursday 27 Apr 2017 13:27:49 Tomi Valkeinen wrote:
> >> We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
> >> because there has not been a proper connector type for them.
> >> 
> >> We now have connector type for DPI so let's take it into use. At the
> >> same time, add better connector types for the remaining outputs too.
> >> 
> >> This patch sets the following outputs to use the following connector
> >> types:
> >> 
> >> DPI -> DPI
> >> DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)
> > 
> > This looks OK to me.
> > 
> >> SDI -> LVDS (SDI is a type of LVDS)
> > 
> > If we're talking about this
> > https://en.wikipedia.org/wiki/Serial_digital_interface SDI, it's not a
> > type of LVDS at all. DRM_MODE_CONNECTOR_LVDS is interpreted as meaning
> > that an LVDS display panel is attached to the device, and is likely not
> > removable. I don't think it's a good match for SDI. We might need a new
> > connector type.
>
> No, it's not that. It's Serial display interface. I think it's
> FPDLink/FlatLink.

Ah that makes more sense. Could you maybe mention that in the commit message ?

> >> VENC -> SVIDEO (it could also be composite, but we don't have that
> >>         information here, so svideo should be quite good match)
> > 
> > Do we have the information anywhere ?
> 
> Yes, in the dts. At some point we should use that data, but I didn't
> want to start digging the encoder/connector properties here.

So we don't need to program the hardware differently for S-Video and Composite 
? OK, in that case, with a few words about SDI in the commit message,

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

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6] drm/omap: add new connector types
  2017-05-08 16:21       ` Laurent Pinchart
@ 2017-05-09  6:57         ` Tomi Valkeinen
  0 siblings, 0 replies; 22+ messages in thread
From: Tomi Valkeinen @ 2017-05-09  6:57 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Jyri Sarha, dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 2401 bytes --]

On 08/05/17 19:21, Laurent Pinchart wrote:
> Hi Tomi,
> 
> On Monday 08 May 2017 17:35:50 Tomi Valkeinen wrote:
>> On 08/05/17 17:21, Laurent Pinchart wrote:
>>> On Thursday 27 Apr 2017 13:27:49 Tomi Valkeinen wrote:
>>>> We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
>>>> because there has not been a proper connector type for them.
>>>>
>>>> We now have connector type for DPI so let's take it into use. At the
>>>> same time, add better connector types for the remaining outputs too.
>>>>
>>>> This patch sets the following outputs to use the following connector
>>>> types:
>>>>
>>>> DPI -> DPI
>>>> DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)
>>>
>>> This looks OK to me.
>>>
>>>> SDI -> LVDS (SDI is a type of LVDS)
>>>
>>> If we're talking about this
>>> https://en.wikipedia.org/wiki/Serial_digital_interface SDI, it's not a
>>> type of LVDS at all. DRM_MODE_CONNECTOR_LVDS is interpreted as meaning
>>> that an LVDS display panel is attached to the device, and is likely not
>>> removable. I don't think it's a good match for SDI. We might need a new
>>> connector type.
>>
>> No, it's not that. It's Serial display interface. I think it's
>> FPDLink/FlatLink.
> 
> Ah that makes more sense. Could you maybe mention that in the commit message ?

Sure.

>>>> VENC -> SVIDEO (it could also be composite, but we don't have that
>>>>         information here, so svideo should be quite good match)
>>>
>>> Do we have the information anywhere ?
>>
>> Yes, in the dts. At some point we should use that data, but I didn't
>> want to start digging the encoder/connector properties here.
> 
> So we don't need to program the hardware differently for S-Video and Composite 
> ? OK, in that case, with a few words about SDI in the commit message,

We do program the HW differently. connector-analog-tv's DT property has
the connector type in the compatible string. Looks like it tries to pass
this forward to DSS's VENC, but if I read it right, it's broken... No,
wait... that's for non-DT. Yeah, I'm confused on what the code tries to
do here =)

But my point was that svideo/composite is not visible at the moment from
omapdrm. That said, I think a simple check of the compatible property
between "omapdss,svideo-connector" and
"omapdss,composite-video-connector" should do it. Let's see...

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 3/6] drm/omap: remove ovl_set_channel_out
  2017-05-08 14:26   ` Laurent Pinchart
@ 2017-05-09  7:12     ` Tomi Valkeinen
  0 siblings, 0 replies; 22+ messages in thread
From: Tomi Valkeinen @ 2017-05-09  7:12 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Jyri Sarha, dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 3640 bytes --]

On 08/05/17 17:26, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Thursday 27 Apr 2017 13:27:51 Tomi Valkeinen wrote:
>> At the moment we have ovl_set_channel_out() to configure the output
>> channel of an overlay. It makes sense to have this configuration as part
>> of the reset of overlay configuration, and in DSS6+ we need the output
> 
> Do you mean s/reset/rest/ ?
> 
>> channel when doing the other overlay configuration.
>>
>> This patch adds 'channel' parameter to ovl_setup(), so that all overlay
> 
> s/adds/adds a/

Thanks, fixed.

>> configuration is done via the same function, and removes the
>> ovl_set_channel_out().
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> ---
>>  drivers/gpu/drm/omapdrm/dss/dispc.c   | 13 ++++++-------
>>  drivers/gpu/drm/omapdrm/dss/omapdss.h |  3 ++-
>>  drivers/gpu/drm/omapdrm/omap_plane.c  |  6 ++----
>>  3 files changed, 10 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c
>> b/drivers/gpu/drm/omapdrm/dss/dispc.c index 9fba92973d0e..97f4a1163fbe
>> 100644
>> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
>> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
>> @@ -2834,21 +2834,21 @@ static int dispc_ovl_setup_common(enum omap_plane_id
>> plane,
>>
>>  static int dispc_ovl_setup(enum omap_plane_id plane,
>>  		const struct omap_overlay_info *oi,
>> -		const struct videomode *vm, bool mem_to_mem)
>> +		const struct videomode *vm, bool mem_to_mem,
>> +		enum omap_channel channel)
>>  {
>>  	int r;
>>  	enum omap_overlay_caps caps = dss_feat_get_overlay_caps(plane);
>> -	enum omap_channel channel;
>>  	const bool replication = true;
>>
>> -	channel = dispc_ovl_get_channel_out(plane);
>> -
>>  	DSSDBG("dispc_ovl_setup %d, pa %pad, pa_uv %pad, sw %d, %d,%d, %dx%d -
>> "
>>  		" %dx%d, cmode %x, rot %d, mir %d, chan %d repl %d\n",
>>  		plane, &oi->paddr, &oi->p_uv_addr, oi->screen_width, oi-
>> pos_x,
>>  		oi->pos_y, oi->width, oi->height, oi->out_width, oi-
>> out_height,
>>  		oi->color_mode, oi->rotation, oi->mirror, channel, 
> replication);
>>
>> +	dispc_ovl_set_channel_out(plane, channel);
>> +
>>  	r = dispc_ovl_setup_common(plane, caps, oi->paddr, oi->p_uv_addr,
>>  		oi->screen_width, oi->pos_x, oi->pos_y, oi->width, oi->height,
>>  		oi->out_width, oi->out_height, oi->color_mode, oi->rotation,
>> @@ -4304,8 +4304,8 @@ static void dispc_errata_i734_wa(void)
>>  	REG_FLD_MOD(DISPC_CONFIG, 0x1f, 8, 4);
>>
>>  	/* Setup and enable GFX plane */
>> -	dispc_ovl_set_channel_out(OMAP_DSS_GFX, OMAP_DSS_CHANNEL_LCD);
>> -	dispc_ovl_setup(OMAP_DSS_GFX, &ovli, &i734.vm, false);
>> +	dispc_ovl_setup(OMAP_DSS_GFX, &ovli, &i734.vm, false,
>> +		OMAP_DSS_CHANNEL_LCD);
>>  	dispc_ovl_enable(OMAP_DSS_GFX, true);
>>
>>  	/* Set up and enable display manager for LCD1 */
>> @@ -4372,7 +4372,6 @@ static const struct dispc_ops dispc_ops = {
>>  	.mgr_set_gamma = dispc_mgr_set_gamma,
>>
>>  	.ovl_enable = dispc_ovl_enable,
>> -	.ovl_set_channel_out = dispc_ovl_set_channel_out,
>>  	.ovl_setup = dispc_ovl_setup,
>>  	.ovl_get_color_modes = dispc_ovl_get_color_modes,
>>  };
>> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h
>> b/drivers/gpu/drm/omapdrm/dss/omapdss.h index d9ad33df0455..a2b9b7f29472
>> 100644
>> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
>> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
>> @@ -917,7 +917,8 @@ struct dispc_ops {
>>  			enum omap_channel channel);
> 
> Shouldn't you also remove the .ovl_set_channel_out() operation from this 
> structure ?

Ah missed that, thanks.


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/6 v2] drm/omap: add new connector types
  2017-04-27 10:27 ` [PATCH 1/6] drm/omap: add new connector types Tomi Valkeinen
  2017-05-08 14:21   ` Laurent Pinchart
@ 2017-05-09  7:16   ` Tomi Valkeinen
  2017-05-09  7:36     ` Jyri Sarha
  2017-05-09 22:35     ` Laurent Pinchart
  1 sibling, 2 replies; 22+ messages in thread
From: Tomi Valkeinen @ 2017-05-09  7:16 UTC (permalink / raw)
  To: dri-devel, Laurent Pinchart; +Cc: Tomi Valkeinen, Jyri Sarha

We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
because there has not been a proper connector type for them.

We now have connector type for DPI so let's take it into use. At the
same time, add better connector types for the remaining outputs too.

This patch sets the following outputs to use the following connector
types:

DPI -> DPI
DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)
SDI -> LVDS (SDI, TI Flatlink 3G, is a type of LVDS)
VENC -> SVIDEO (it could also be composite, but we don't have that
        information here, so svideo should be quite good match)

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index e1f47f0b3ccf..16c537837742 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -214,6 +214,19 @@ static int get_connector_type(struct omap_dss_device *dssdev)
 		return DRM_MODE_CONNECTOR_DVID;
 	case OMAP_DISPLAY_TYPE_DSI:
 		return DRM_MODE_CONNECTOR_DSI;
+	case OMAP_DISPLAY_TYPE_DPI:
+	case OMAP_DISPLAY_TYPE_DBI:
+		return DRM_MODE_CONNECTOR_DPI;
+	case OMAP_DISPLAY_TYPE_VENC:
+		if (of_device_is_compatible(dssdev->dev->of_node,
+		    "omapdss,svideo-connector"))
+			return DRM_MODE_CONNECTOR_SVIDEO;
+		if (of_device_is_compatible(dssdev->dev->of_node,
+		    "omapdss,composite-video-connector"))
+			return DRM_MODE_CONNECTOR_Composite;
+		return DRM_MODE_CONNECTOR_Unknown;
+	case OMAP_DISPLAY_TYPE_SDI:
+		return DRM_MODE_CONNECTOR_LVDS;
 	default:
 		return DRM_MODE_CONNECTOR_Unknown;
 	}
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6 v2] drm/omap: add new connector types
  2017-05-09  7:16   ` [PATCH 1/6 v2] " Tomi Valkeinen
@ 2017-05-09  7:36     ` Jyri Sarha
  2017-05-09  7:41       ` Tomi Valkeinen
  2017-05-09 22:35     ` Laurent Pinchart
  1 sibling, 1 reply; 22+ messages in thread
From: Jyri Sarha @ 2017-05-09  7:36 UTC (permalink / raw)
  To: Tomi Valkeinen, dri-devel, Laurent Pinchart

On 05/09/17 10:16, Tomi Valkeinen wrote:
> We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
> because there has not been a proper connector type for them.
> 
> We now have connector type for DPI so let's take it into use. At the
> same time, add better connector types for the remaining outputs too.
> 
> This patch sets the following outputs to use the following connector
> types:
> 
> DPI -> DPI
> DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)
> SDI -> LVDS (SDI, TI Flatlink 3G, is a type of LVDS)
> VENC -> SVIDEO (it could also be composite, but we don't have that
>         information here, so svideo should be quite good match)

I don't think the above comment is valid anymore.

> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index e1f47f0b3ccf..16c537837742 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -214,6 +214,19 @@ static int get_connector_type(struct omap_dss_device *dssdev)
>  		return DRM_MODE_CONNECTOR_DVID;
>  	case OMAP_DISPLAY_TYPE_DSI:
>  		return DRM_MODE_CONNECTOR_DSI;
> +	case OMAP_DISPLAY_TYPE_DPI:
> +	case OMAP_DISPLAY_TYPE_DBI:
> +		return DRM_MODE_CONNECTOR_DPI;
> +	case OMAP_DISPLAY_TYPE_VENC:
> +		if (of_device_is_compatible(dssdev->dev->of_node,
> +		    "omapdss,svideo-connector"))
> +			return DRM_MODE_CONNECTOR_SVIDEO;
> +		if (of_device_is_compatible(dssdev->dev->of_node,
> +		    "omapdss,composite-video-connector"))
> +			return DRM_MODE_CONNECTOR_Composite;
> +		return DRM_MODE_CONNECTOR_Unknown;
> +	case OMAP_DISPLAY_TYPE_SDI:
> +		return DRM_MODE_CONNECTOR_LVDS;
>  	default:
>  		return DRM_MODE_CONNECTOR_Unknown;
>  	}
> 

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6 v2] drm/omap: add new connector types
  2017-05-09  7:36     ` Jyri Sarha
@ 2017-05-09  7:41       ` Tomi Valkeinen
  0 siblings, 0 replies; 22+ messages in thread
From: Tomi Valkeinen @ 2017-05-09  7:41 UTC (permalink / raw)
  To: Jyri Sarha, dri-devel, Laurent Pinchart


[-- Attachment #1.1.1: Type: text/plain, Size: 859 bytes --]



On 09/05/17 10:36, Jyri Sarha wrote:
> On 05/09/17 10:16, Tomi Valkeinen wrote:
>> We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
>> because there has not been a proper connector type for them.
>>
>> We now have connector type for DPI so let's take it into use. At the
>> same time, add better connector types for the remaining outputs too.
>>
>> This patch sets the following outputs to use the following connector
>> types:
>>
>> DPI -> DPI
>> DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)
>> SDI -> LVDS (SDI, TI Flatlink 3G, is a type of LVDS)
>> VENC -> SVIDEO (it could also be composite, but we don't have that
>>         information here, so svideo should be quite good match)
> 
> I don't think the above comment is valid anymore.

Ah, right =). I'll drop that from the desc.

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6 v2] drm/omap: add new connector types
  2017-05-09  7:16   ` [PATCH 1/6 v2] " Tomi Valkeinen
  2017-05-09  7:36     ` Jyri Sarha
@ 2017-05-09 22:35     ` Laurent Pinchart
  2017-05-10  6:59       ` Tomi Valkeinen
  1 sibling, 1 reply; 22+ messages in thread
From: Laurent Pinchart @ 2017-05-09 22:35 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: Jyri Sarha, dri-devel

Hi Tomi,

Thank you for the patch.

On Tuesday 09 May 2017 10:16:27 Tomi Valkeinen wrote:
> We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
> because there has not been a proper connector type for them.
> 
> We now have connector type for DPI so let's take it into use. At the
> same time, add better connector types for the remaining outputs too.
> 
> This patch sets the following outputs to use the following connector
> types:
> 
> DPI -> DPI
> DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)
> SDI -> LVDS (SDI, TI Flatlink 3G, is a type of LVDS)
> VENC -> SVIDEO (it could also be composite, but we don't have that
>         information here, so svideo should be quite good match)
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
> b/drivers/gpu/drm/omapdrm/omap_drv.c index e1f47f0b3ccf..16c537837742
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -214,6 +214,19 @@ static int get_connector_type(struct omap_dss_device
> *dssdev) return DRM_MODE_CONNECTOR_DVID;
>  	case OMAP_DISPLAY_TYPE_DSI:
>  		return DRM_MODE_CONNECTOR_DSI;
> +	case OMAP_DISPLAY_TYPE_DPI:
> +	case OMAP_DISPLAY_TYPE_DBI:
> +		return DRM_MODE_CONNECTOR_DPI;
> +	case OMAP_DISPLAY_TYPE_VENC:
> +		if (of_device_is_compatible(dssdev->dev->of_node,
> +		    "omapdss,svideo-connector"))
> +			return DRM_MODE_CONNECTOR_SVIDEO;
> +		if (of_device_is_compatible(dssdev->dev->of_node,
> +		    "omapdss,composite-video-connector"))
> +			return DRM_MODE_CONNECTOR_Composite;

Checking the compat string here feels like a bit of a hack to me. Wouldn't it 
be simpler and cleaner to add the connector type to the omap_dss_device 
structure ? That's more work though, so as a first step I think I could 
tolerate this hack if you really feel lazy ;-) Although, maybe we should just 
return SVIDEO unconditionally for VENC for now and fix that later.

> +		return DRM_MODE_CONNECTOR_Unknown;
> +	case OMAP_DISPLAY_TYPE_SDI:
> +		return DRM_MODE_CONNECTOR_LVDS;
>  	default:
>  		return DRM_MODE_CONNECTOR_Unknown;
>  	}

-- 
Regards,

Laurent Pinchart

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/6 v2] drm/omap: add new connector types
  2017-05-09 22:35     ` Laurent Pinchart
@ 2017-05-10  6:59       ` Tomi Valkeinen
  0 siblings, 0 replies; 22+ messages in thread
From: Tomi Valkeinen @ 2017-05-10  6:59 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Jyri Sarha, dri-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 2534 bytes --]

On 10/05/17 01:35, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Tuesday 09 May 2017 10:16:27 Tomi Valkeinen wrote:
>> We have been using DRM_MODE_CONNECTOR_Unknown for many of our outputs
>> because there has not been a proper connector type for them.
>>
>> We now have connector type for DPI so let's take it into use. At the
>> same time, add better connector types for the remaining outputs too.
>>
>> This patch sets the following outputs to use the following connector
>> types:
>>
>> DPI -> DPI
>> DBI -> DPI (MIPI DBI is very similar to DPI at the bus level)
>> SDI -> LVDS (SDI, TI Flatlink 3G, is a type of LVDS)
>> VENC -> SVIDEO (it could also be composite, but we don't have that
>>         information here, so svideo should be quite good match)
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> ---
>>  drivers/gpu/drm/omapdrm/omap_drv.c | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
>> b/drivers/gpu/drm/omapdrm/omap_drv.c index e1f47f0b3ccf..16c537837742
>> 100644
>> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
>> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
>> @@ -214,6 +214,19 @@ static int get_connector_type(struct omap_dss_device
>> *dssdev) return DRM_MODE_CONNECTOR_DVID;
>>  	case OMAP_DISPLAY_TYPE_DSI:
>>  		return DRM_MODE_CONNECTOR_DSI;
>> +	case OMAP_DISPLAY_TYPE_DPI:
>> +	case OMAP_DISPLAY_TYPE_DBI:
>> +		return DRM_MODE_CONNECTOR_DPI;
>> +	case OMAP_DISPLAY_TYPE_VENC:
>> +		if (of_device_is_compatible(dssdev->dev->of_node,
>> +		    "omapdss,svideo-connector"))
>> +			return DRM_MODE_CONNECTOR_SVIDEO;
>> +		if (of_device_is_compatible(dssdev->dev->of_node,
>> +		    "omapdss,composite-video-connector"))
>> +			return DRM_MODE_CONNECTOR_Composite;
> 
> Checking the compat string here feels like a bit of a hack to me. Wouldn't it 
> be simpler and cleaner to add the connector type to the omap_dss_device 
> structure ? That's more work though, so as a first step I think I could 
> tolerate this hack if you really feel lazy ;-) Although, maybe we should just 
> return SVIDEO unconditionally for VENC for now and fix that later.

Yes, it looks a bit ugly to me too. I've been reluctant to add more
things to omap_dss_device and to the panel/encoder drivers, as I think
each thing there will make it more difficult to convert driver the model
to more DRM'ish model.

So, I think I'll just use the SVIDEO as I had originally.

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-05-10  7:00 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 10:27 [PATCH 0/6] drm/omap: misc changes Tomi Valkeinen
2017-04-27 10:27 ` [PATCH 1/6] drm/omap: add new connector types Tomi Valkeinen
2017-05-08 14:21   ` Laurent Pinchart
2017-05-08 14:35     ` Tomi Valkeinen
2017-05-08 16:21       ` Laurent Pinchart
2017-05-09  6:57         ` Tomi Valkeinen
2017-05-09  7:16   ` [PATCH 1/6 v2] " Tomi Valkeinen
2017-05-09  7:36     ` Jyri Sarha
2017-05-09  7:41       ` Tomi Valkeinen
2017-05-09 22:35     ` Laurent Pinchart
2017-05-10  6:59       ` Tomi Valkeinen
2017-04-27 10:27 ` [PATCH 2/6] drm/omap: remove unused ovl_enabled() Tomi Valkeinen
2017-05-08 14:23   ` Laurent Pinchart
2017-04-27 10:27 ` [PATCH 3/6] drm/omap: remove ovl_set_channel_out Tomi Valkeinen
2017-05-08 14:26   ` Laurent Pinchart
2017-05-09  7:12     ` Tomi Valkeinen
2017-04-27 10:27 ` [PATCH 4/6] drm/omap: remove read_irqenable() Tomi Valkeinen
2017-05-08 14:28   ` Laurent Pinchart
2017-04-27 10:27 ` [PATCH 5/6] drm/omap: 64bit compile fixes Tomi Valkeinen
2017-05-08 14:29   ` Laurent Pinchart
2017-04-27 10:27 ` [PATCH 6/6] drm/omap: define compat_ioctl Tomi Valkeinen
2017-05-08 14:32   ` Laurent Pinchart

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.