devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/8] omapdrm: DSI command mode panel support
@ 2018-02-08 18:30 Sebastian Reichel
       [not found] ` <20180208183035.8461-1-sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-08 18:30 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Tony Lindgren
  Cc: Laurent Pinchart, Hans de Goede, Rob Herring, Mark Rutland,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-ZGY8ohtN/8qB+jHODAdFcQ, Sebastian Reichel

Hi,

These are the remaining patches from my previous patchset to get
Droid 4 (omap4) display working. The patches have been rebased to
current master branch from Torvalds (581e400ff935). Since N950
(omap3) is broken even with the workaround I moved it to the end,
so that it can be skipped.

Working on Droid 4:
 * Framebuffer Console, updated at 1Hz due to blinking cursor
 * kmstest (static image)
 * Display blanking
 * Xorg with omap and modesetting driver
 * No updates send when nothing needs to be sent
 * Orientation DRM property is attached to the DSI panel

Known issues:
 * N950 (omap3) is broken. I have updated the omap3 fifo workaround,
   but it's not enough to fix omap3.
 * N950 (and N9) has first and last few lines covered by plastic, so
   we should expose a smaller screen

Changes since PATCHv1:
 * Drop patches, that were queued by Tomi
 * Rebase to current master
 * Rework the omap3 workaround patch to only affect omap3
 * Add orientation DRM property support

-- Sebastian


Sebastian Reichel (8):
  drm/omap: add framedone interrupt support
  drm/omap: add manual update detection helper
  drm/omap: add support for manually updated displays
  dt-bindings: panel: common: document orientation property
  drm/omap: add support for orientation hints from display drivers
  drm/omap: panel-dsi-cm: add orientation support
  ARM: dts: omap4-droid4: Add LCD panel orientation property
  drm/omap: plane: update fifo size on ovl setup

 .../bindings/display/panel/panel-common.txt        |  12 ++
 arch/arm/boot/dts/omap4-droid4-xt894.dts           |   3 +
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c    |  13 ++
 drivers/gpu/drm/omapdrm/dss/dispc.c                |  36 ++++-
 drivers/gpu/drm/omapdrm/dss/omapdss.h              |   2 +
 drivers/gpu/drm/omapdrm/omap_connector.c           |  18 ++-
 drivers/gpu/drm/omapdrm/omap_connector.h           |   1 +
 drivers/gpu/drm/omapdrm/omap_crtc.c                | 158 +++++++++++++++++++--
 drivers/gpu/drm/omapdrm/omap_crtc.h                |   2 +
 drivers/gpu/drm/omapdrm/omap_fb.c                  |  20 +++
 drivers/gpu/drm/omapdrm/omap_irq.c                 |  24 ++++
 drivers/gpu/drm/omapdrm/omap_irq.h                 |   1 +
 include/dt-bindings/display/common.h               |  14 ++
 13 files changed, 294 insertions(+), 10 deletions(-)
 create mode 100644 include/dt-bindings/display/common.h

-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2 1/8] drm/omap: add framedone interrupt support
       [not found] ` <20180208183035.8461-1-sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
@ 2018-02-08 18:30   ` Sebastian Reichel
  2018-03-20 14:28     ` Tony Lindgren
  2018-02-08 18:30   ` [PATCHv2 2/8] drm/omap: add manual update detection helper Sebastian Reichel
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-08 18:30 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Tony Lindgren
  Cc: Laurent Pinchart, Hans de Goede, Rob Herring, Mark Rutland,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-ZGY8ohtN/8qB+jHODAdFcQ, Sebastian Reichel

This prepares framedone interrupt handling for
manual display update support.

Signed-off-by: Sebastian Reichel <sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 48 +++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/omapdrm/omap_crtc.h |  1 +
 drivers/gpu/drm/omapdrm/omap_irq.c  | 24 +++++++++++++++++++
 drivers/gpu/drm/omapdrm/omap_irq.h  |  1 +
 4 files changed, 74 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 1b8154e58d18..2278e3433008 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -51,6 +51,9 @@ struct omap_crtc {
 	bool pending;
 	wait_queue_head_t pending_wait;
 	struct drm_pending_vblank_event *event;
+
+	void (*framedone_handler)(void *);
+	void *framedone_handler_data;
 };
 
 /* -----------------------------------------------------------------------------
@@ -247,6 +250,17 @@ static int omap_crtc_dss_register_framedone(
 		enum omap_channel channel,
 		void (*handler)(void *), void *data)
 {
+	struct omap_crtc *omap_crtc = omap_crtcs[channel];
+	struct drm_device *dev = omap_crtc->base.dev;
+
+	if (omap_crtc->framedone_handler)
+		return -EBUSY;
+
+	dev_dbg(dev->dev, "register framedone %s", omap_crtc->name);
+
+	omap_crtc->framedone_handler = handler;
+	omap_crtc->framedone_handler_data = data;
+
 	return 0;
 }
 
@@ -254,6 +268,16 @@ static void omap_crtc_dss_unregister_framedone(
 		enum omap_channel channel,
 		void (*handler)(void *), void *data)
 {
+	struct omap_crtc *omap_crtc = omap_crtcs[channel];
+	struct drm_device *dev = omap_crtc->base.dev;
+
+	dev_dbg(dev->dev, "unregister framedone %s", omap_crtc->name);
+
+	WARN_ON(omap_crtc->framedone_handler != handler);
+	WARN_ON(omap_crtc->framedone_handler_data != data);
+
+	omap_crtc->framedone_handler = NULL;
+	omap_crtc->framedone_handler_data = NULL;
 }
 
 static const struct dss_mgr_ops mgr_ops = {
@@ -321,6 +345,30 @@ void omap_crtc_vblank_irq(struct drm_crtc *crtc)
 	DBG("%s: apply done", omap_crtc->name);
 }
 
+void omap_crtc_framedone_irq(struct drm_crtc *crtc, uint32_t irqstatus)
+{
+	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+
+	if (!omap_crtc->framedone_handler) {
+		dev_warn(omap_crtc->base.dev->dev, "no framedone handler?");
+		return;
+	}
+
+	omap_crtc->framedone_handler(omap_crtc->framedone_handler_data);
+
+	spin_lock(&crtc->dev->event_lock);
+	/* Send the vblank event if one has been requested. */
+	if (omap_crtc->event) {
+		drm_crtc_send_vblank_event(crtc, omap_crtc->event);
+		omap_crtc->event = NULL;
+	}
+	omap_crtc->pending = false;
+	spin_unlock(&crtc->dev->event_lock);
+
+	/* Wake up omap_atomic_complete. */
+	wake_up(&omap_crtc->pending_wait);
+}
+
 static void omap_crtc_write_crtc_properties(struct drm_crtc *crtc)
 {
 	struct omap_drm_private *priv = crtc->dev->dev_private;
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.h b/drivers/gpu/drm/omapdrm/omap_crtc.h
index ad7b007c6174..bd316bc0b6f4 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.h
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.h
@@ -39,5 +39,6 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
 int omap_crtc_wait_pending(struct drm_crtc *crtc);
 void omap_crtc_error_irq(struct drm_crtc *crtc, uint32_t irqstatus);
 void omap_crtc_vblank_irq(struct drm_crtc *crtc);
+void omap_crtc_framedone_irq(struct drm_crtc *crtc, uint32_t irqstatus);
 
 #endif /* __OMAPDRM_CRTC_H__ */
diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c
index 53ba424823b2..354df3583229 100644
--- a/drivers/gpu/drm/omapdrm/omap_irq.c
+++ b/drivers/gpu/drm/omapdrm/omap_irq.c
@@ -85,6 +85,27 @@ int omap_irq_wait(struct drm_device *dev, struct omap_irq_wait *wait,
 	return ret == 0 ? -1 : 0;
 }
 
+int omap_irq_enable_framedone(struct drm_crtc *crtc, bool enable)
+{
+	struct drm_device *dev = crtc->dev;
+	struct omap_drm_private *priv = dev->dev_private;
+	unsigned long flags;
+	enum omap_channel channel = omap_crtc_channel(crtc);
+	int framedone_irq = priv->dispc_ops->mgr_get_framedone_irq(channel);
+
+	DBG("dev=%p, crtc=%u, enable=%d", dev, channel, enable);
+
+	spin_lock_irqsave(&priv->wait_lock, flags);
+	if (enable)
+		priv->irq_mask |= framedone_irq;
+	else
+		priv->irq_mask &= ~framedone_irq;
+	omap_irq_update(dev);
+	spin_unlock_irqrestore(&priv->wait_lock, flags);
+
+	return 0;
+}
+
 /**
  * enable_vblank - enable vblank interrupt events
  * @dev: DRM device
@@ -215,6 +236,9 @@ static irqreturn_t omap_irq_handler(int irq, void *arg)
 
 		if (irqstatus & priv->dispc_ops->mgr_get_sync_lost_irq(channel))
 			omap_crtc_error_irq(crtc, irqstatus);
+
+		if (irqstatus & priv->dispc_ops->mgr_get_framedone_irq(channel))
+			omap_crtc_framedone_irq(crtc, irqstatus);
 	}
 
 	omap_irq_ocp_error_handler(dev, irqstatus);
diff --git a/drivers/gpu/drm/omapdrm/omap_irq.h b/drivers/gpu/drm/omapdrm/omap_irq.h
index 606c09932bc0..69f4ff80a0e4 100644
--- a/drivers/gpu/drm/omapdrm/omap_irq.h
+++ b/drivers/gpu/drm/omapdrm/omap_irq.h
@@ -27,6 +27,7 @@ struct drm_device;
 struct omap_irq_wait;
 
 int omap_irq_enable_vblank(struct drm_crtc *crtc);
+int omap_irq_enable_framedone(struct drm_crtc *crtc, bool enable);
 void omap_irq_disable_vblank(struct drm_crtc *crtc);
 void omap_drm_irq_uninstall(struct drm_device *dev);
 int omap_drm_irq_install(struct drm_device *dev);
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2 2/8] drm/omap: add manual update detection helper
       [not found] ` <20180208183035.8461-1-sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
  2018-02-08 18:30   ` [PATCHv2 1/8] drm/omap: add framedone interrupt support Sebastian Reichel
@ 2018-02-08 18:30   ` Sebastian Reichel
  2018-03-20 14:28     ` Tony Lindgren
  2018-02-08 18:30   ` [PATCHv2 3/8] drm/omap: add support for manually updated displays Sebastian Reichel
  2018-02-08 18:30   ` [PATCHv2 8/8] drm/omap: plane: update fifo size on ovl setup Sebastian Reichel
  3 siblings, 1 reply; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-08 18:30 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Tony Lindgren
  Cc: Laurent Pinchart, Hans de Goede, Rob Herring, Mark Rutland,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-ZGY8ohtN/8qB+jHODAdFcQ, Sebastian Reichel

In preparation for manually updated display support, such as DSI
command mode panels, this adds a simple helper to see if a connector
is manually updated.

Signed-off-by: Sebastian Reichel <sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
---
 drivers/gpu/drm/omapdrm/omap_connector.c | 8 ++++++++
 drivers/gpu/drm/omapdrm/omap_connector.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
index a0d7b1d905e8..a33b51484b2d 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.c
+++ b/drivers/gpu/drm/omapdrm/omap_connector.c
@@ -57,6 +57,14 @@ bool omap_connector_get_hdmi_mode(struct drm_connector *connector)
 	return omap_connector->hdmi_mode;
 }
 
+bool omap_connector_get_manually_updated(struct drm_connector *connector)
+{
+	struct omap_connector *omap_connector = to_omap_connector(connector);
+
+	return !!(omap_connector->dssdev->caps &
+		  OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE);
+}
+
 static enum drm_connector_status omap_connector_detect(
 		struct drm_connector *connector, bool force)
 {
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.h b/drivers/gpu/drm/omapdrm/omap_connector.h
index 98bbc779b302..652136d167f5 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.h
+++ b/drivers/gpu/drm/omapdrm/omap_connector.h
@@ -33,5 +33,6 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
 struct drm_encoder *omap_connector_attached_encoder(
 		struct drm_connector *connector);
 bool omap_connector_get_hdmi_mode(struct drm_connector *connector);
+bool omap_connector_get_manually_updated(struct drm_connector *connector);
 
 #endif /* __OMAPDRM_CONNECTOR_H__ */
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2 3/8] drm/omap: add support for manually updated displays
       [not found] ` <20180208183035.8461-1-sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
  2018-02-08 18:30   ` [PATCHv2 1/8] drm/omap: add framedone interrupt support Sebastian Reichel
  2018-02-08 18:30   ` [PATCHv2 2/8] drm/omap: add manual update detection helper Sebastian Reichel
@ 2018-02-08 18:30   ` Sebastian Reichel
  2018-03-20 14:29     ` Tony Lindgren
  2018-02-08 18:30   ` [PATCHv2 8/8] drm/omap: plane: update fifo size on ovl setup Sebastian Reichel
  3 siblings, 1 reply; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-08 18:30 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Tony Lindgren
  Cc: Laurent Pinchart, Hans de Goede, Rob Herring, Mark Rutland,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-ZGY8ohtN/8qB+jHODAdFcQ, Sebastian Reichel

This adds the required infrastructure for manually
updated displays, such as DSI command mode panels.

While those panels often support partial updates
we currently always do a full refresh. Display
will be refreshed when something calls the dirty
callback, such as libdrm's drmModeDirtyFB().

This is currently being implemented for the kernel
console and for Xorg. Weston currently does not
implement this and is known not to work on manually
updated displays.

Signed-off-by: Sebastian Reichel <sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 110 +++++++++++++++++++++++++++++++++---
 drivers/gpu/drm/omapdrm/omap_crtc.h |   1 +
 drivers/gpu/drm/omapdrm/omap_fb.c   |  20 +++++++
 3 files changed, 123 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 2278e3433008..c2defb514b9f 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -51,6 +51,7 @@ struct omap_crtc {
 	bool pending;
 	wait_queue_head_t pending_wait;
 	struct drm_pending_vblank_event *event;
+	struct delayed_work update_work;
 
 	void (*framedone_handler)(void *);
 	void *framedone_handler_data;
@@ -142,6 +143,28 @@ static void omap_crtc_dss_disconnect(enum omap_channel channel,
 
 static void omap_crtc_dss_start_update(enum omap_channel channel)
 {
+	struct omap_crtc *omap_crtc = omap_crtcs[channel];
+	struct omap_drm_private *priv = omap_crtc->base.dev->dev_private;
+
+	priv->dispc_ops->mgr_enable(channel, true);
+}
+
+static bool omap_crtc_is_manually_updated(struct drm_crtc *crtc)
+{
+	struct drm_connector *connector;
+	struct drm_connector_list_iter conn_iter;
+	bool result = false;
+
+	drm_connector_list_iter_begin(crtc->dev, &conn_iter);
+	drm_for_each_connector_iter(connector, &conn_iter) {
+		if (connector->state->crtc != crtc)
+			continue;
+		result = omap_connector_get_manually_updated(connector);
+		break;
+	}
+	drm_connector_list_iter_end(&conn_iter);
+
+	return result;
 }
 
 /* Called only from the encoder enable/disable and suspend/resume handlers. */
@@ -153,12 +176,17 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable)
 	enum omap_channel channel = omap_crtc->channel;
 	struct omap_irq_wait *wait;
 	u32 framedone_irq, vsync_irq;
+	bool is_manual = omap_crtc_is_manually_updated(crtc);
+	enum omap_display_type type = omap_crtc_output[channel]->output_type;
 	int ret;
 
 	if (WARN_ON(omap_crtc->enabled == enable))
 		return;
 
-	if (omap_crtc_output[channel]->output_type == OMAP_DISPLAY_TYPE_HDMI) {
+	if (is_manual)
+		omap_irq_enable_framedone(crtc, enable);
+
+	if (is_manual || type == OMAP_DISPLAY_TYPE_HDMI) {
 		priv->dispc_ops->mgr_enable(channel, enable);
 		omap_crtc->enabled = enable;
 		return;
@@ -209,7 +237,6 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable)
 	}
 }
 
-
 static int omap_crtc_dss_enable(enum omap_channel channel)
 {
 	struct omap_crtc *omap_crtc = omap_crtcs[channel];
@@ -369,6 +396,53 @@ void omap_crtc_framedone_irq(struct drm_crtc *crtc, uint32_t irqstatus)
 	wake_up(&omap_crtc->pending_wait);
 }
 
+void omap_crtc_flush(struct drm_crtc *crtc)
+{
+	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+
+	if (!omap_crtc_is_manually_updated(crtc))
+		return;
+
+	if (!delayed_work_pending(&omap_crtc->update_work))
+		schedule_delayed_work(&omap_crtc->update_work, 0);
+}
+
+static void omap_crtc_manual_display_update(struct work_struct *data)
+{
+	struct omap_crtc *omap_crtc =
+			container_of(data, struct omap_crtc, update_work.work);
+	struct omap_dss_device *dssdev = omap_crtc_output[omap_crtc->channel];
+	struct drm_device *dev = omap_crtc->base.dev;
+	struct omap_dss_driver *dssdrv;
+	int ret, width, height;
+
+	if (!dssdev || !dssdev->dst) {
+		dev_err_once(dev->dev, "missing dssdev!");
+		return;
+	}
+
+	dssdev = dssdev->dst;
+	dssdrv = dssdev->driver;
+
+	if (!dssdrv || !dssdrv->update) {
+		dev_err_once(dev->dev, "incorrect dssdrv!");
+		return;
+	}
+
+	if (dssdrv->sync)
+		dssdrv->sync(dssdev);
+
+	width = dssdev->panel.vm.hactive;
+	height = dssdev->panel.vm.vactive;
+	ret = dssdrv->update(dssdev, 0, 0, width, height);
+	if (ret < 0) {
+		spin_lock_irq(&dev->event_lock);
+		omap_crtc->pending = false;
+		spin_unlock_irq(&dev->event_lock);
+		wake_up(&omap_crtc->pending_wait);
+	}
+}
+
 static void omap_crtc_write_crtc_properties(struct drm_crtc *crtc)
 {
 	struct omap_drm_private *priv = crtc->dev->dev_private;
@@ -421,6 +495,10 @@ static void omap_crtc_atomic_enable(struct drm_crtc *crtc,
 
 	DBG("%s", omap_crtc->name);
 
+	/* manual updated display will not trigger vsync irq */
+	if (omap_crtc_is_manually_updated(crtc))
+		return;
+
 	spin_lock_irq(&crtc->dev->event_lock);
 	drm_crtc_vblank_on(crtc);
 	ret = drm_crtc_vblank_get(crtc);
@@ -434,6 +512,7 @@ static void omap_crtc_atomic_disable(struct drm_crtc *crtc,
 				     struct drm_crtc_state *old_state)
 {
 	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+	struct drm_device *dev = crtc->dev;
 
 	DBG("%s", omap_crtc->name);
 
@@ -444,6 +523,11 @@ static void omap_crtc_atomic_disable(struct drm_crtc *crtc,
 	}
 	spin_unlock_irq(&crtc->dev->event_lock);
 
+	cancel_delayed_work(&omap_crtc->update_work);
+
+	if (!omap_crtc_wait_pending(crtc))
+		dev_warn(dev->dev, "manual display update did not finish!");
+
 	drm_crtc_vblank_off(crtc);
 }
 
@@ -593,13 +677,20 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
 
 	DBG("%s: GO", omap_crtc->name);
 
-	ret = drm_crtc_vblank_get(crtc);
-	WARN_ON(ret != 0);
+	if (!omap_crtc_is_manually_updated(crtc)) {
+		ret = drm_crtc_vblank_get(crtc);
+		WARN_ON(ret != 0);
 
-	spin_lock_irq(&crtc->dev->event_lock);
-	priv->dispc_ops->mgr_go(omap_crtc->channel);
-	omap_crtc_arm_event(crtc);
-	spin_unlock_irq(&crtc->dev->event_lock);
+		spin_lock_irq(&crtc->dev->event_lock);
+		priv->dispc_ops->mgr_go(omap_crtc->channel);
+		omap_crtc_arm_event(crtc);
+		spin_unlock_irq(&crtc->dev->event_lock);
+	} else {
+		spin_lock_irq(&crtc->dev->event_lock);
+		omap_crtc_flush(crtc);
+		omap_crtc_arm_event(crtc);
+		spin_unlock_irq(&crtc->dev->event_lock);
+	}
 }
 
 static int omap_crtc_atomic_set_property(struct drm_crtc *crtc,
@@ -761,6 +852,9 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
 	omap_crtc->channel = channel;
 	omap_crtc->name = channel_names[channel];
 
+	INIT_DELAYED_WORK(&omap_crtc->update_work,
+			  omap_crtc_manual_display_update);
+
 	ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
 					&omap_crtc_funcs, NULL);
 	if (ret < 0) {
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.h b/drivers/gpu/drm/omapdrm/omap_crtc.h
index bd316bc0b6f4..b61c94b34f04 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.h
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.h
@@ -40,5 +40,6 @@ int omap_crtc_wait_pending(struct drm_crtc *crtc);
 void omap_crtc_error_irq(struct drm_crtc *crtc, uint32_t irqstatus);
 void omap_crtc_vblank_irq(struct drm_crtc *crtc);
 void omap_crtc_framedone_irq(struct drm_crtc *crtc, uint32_t irqstatus);
+void omap_crtc_flush(struct drm_crtc *crtc);
 
 #endif /* __OMAPDRM_CRTC_H__ */
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index b2539a90e1a4..57b1767bef09 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -95,8 +95,28 @@ static void omap_framebuffer_destroy(struct drm_framebuffer *fb)
 	kfree(omap_fb);
 }
 
+static int omap_framebuffer_dirty(struct drm_framebuffer *fb,
+				  struct drm_file *file_priv,
+				  unsigned flags, unsigned color,
+				  struct drm_clip_rect *clips,
+				  unsigned num_clips)
+{
+	struct drm_connector *connector = NULL;
+
+	drm_modeset_lock_all(fb->dev);
+
+	while ((connector = omap_framebuffer_get_next_connector(fb, connector)))
+		if (connector->encoder && connector->encoder->crtc)
+			omap_crtc_flush(connector->encoder->crtc);
+
+	drm_modeset_unlock_all(fb->dev);
+
+	return 0;
+}
+
 static const struct drm_framebuffer_funcs omap_framebuffer_funcs = {
 	.create_handle = omap_framebuffer_create_handle,
+	.dirty = omap_framebuffer_dirty,
 	.destroy = omap_framebuffer_destroy,
 };
 
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2 4/8] dt-bindings: panel: common: document orientation property
  2018-02-08 18:30 [PATCHv2 0/8] omapdrm: DSI command mode panel support Sebastian Reichel
       [not found] ` <20180208183035.8461-1-sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
@ 2018-02-08 18:30 ` Sebastian Reichel
  2018-02-18 23:24   ` Rob Herring
  2018-02-08 18:30 ` [PATCHv2 5/8] drm/omap: add support for orientation hints from display drivers Sebastian Reichel
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-08 18:30 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Tony Lindgren
  Cc: Laurent Pinchart, Hans de Goede, Rob Herring, Mark Rutland,
	dri-devel, devicetree, linux-omap, linux-kernel, kernel,
	Sebastian Reichel

Introduce new "orientation" property for describing in which
orientation a panel has been mounted to the device. This can
be used by the operating system to automatically rotate the
display correctly.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
 .../devicetree/bindings/display/panel/panel-common.txt     | 12 ++++++++++++
 include/dt-bindings/display/common.h                       | 14 ++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 include/dt-bindings/display/common.h

diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.txt b/Documentation/devicetree/bindings/display/panel/panel-common.txt
index 557fa765adcb..c646b8908458 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-common.txt
+++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt
@@ -18,6 +18,18 @@ Descriptive Properties
   physical area where images are displayed. These properties are expressed in
   millimeters and rounded to the closest unit.
 
+- orientation: The orientation property specifies the panel orientation
+  in relation to the device's casing. The following values are possible:
+
+   * 0 = The top side of the panel matches the top side of the device's
+         casing.
+   * 1 = The top side of the panel matches the bottom side of the device's
+         casing. In other words the panel is mounted upside-down.
+   * 2 = The left side of the panel matches the top side of the device's
+         casing.
+   * 3 = The right side of the panel matches the top side of the device's
+         casing.
+
 - label: The label property specifies a symbolic name for the panel as a
   string suitable for use by humans. It typically contains a name inscribed on
   the system (e.g. as an affixed label) or specified in the system's
diff --git a/include/dt-bindings/display/common.h b/include/dt-bindings/display/common.h
new file mode 100644
index 000000000000..a864775445a0
--- /dev/null
+++ b/include/dt-bindings/display/common.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This header provides common constants for displays
+ */
+
+#ifndef _DT_BINDINGS_DISPLAY_COMMON_H
+#define _DT_BINDINGS_DISPLAY_COMMON_H
+
+#define PANEL_ORIENTATION_NORMAL 0
+#define PANEL_ORIENTATION_BOTTOM_UP 1
+#define PANEL_ORIENTATION_LEFT_UP 2
+#define PANEL_ORIENTATION_RIGHT_UP 3
+
+#endif
-- 
2.15.1

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

* [PATCHv2 5/8] drm/omap: add support for orientation hints from display drivers
  2018-02-08 18:30 [PATCHv2 0/8] omapdrm: DSI command mode panel support Sebastian Reichel
       [not found] ` <20180208183035.8461-1-sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
  2018-02-08 18:30 ` [PATCHv2 4/8] dt-bindings: panel: common: document orientation property Sebastian Reichel
@ 2018-02-08 18:30 ` Sebastian Reichel
  2018-02-08 18:30 ` [PATCHv2 6/8] drm/omap: panel-dsi-cm: add orientation support Sebastian Reichel
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-08 18:30 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Tony Lindgren
  Cc: Laurent Pinchart, Hans de Goede, Rob Herring, Mark Rutland,
	dri-devel, devicetree, linux-omap, linux-kernel, kernel,
	Sebastian Reichel

This adds support for setting DRM panel orientation property
based on information from the display driver.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
 drivers/gpu/drm/omapdrm/dss/omapdss.h    |  2 ++
 drivers/gpu/drm/omapdrm/omap_connector.c | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index f8f83e826a56..72ebd82409d3 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -565,6 +565,8 @@ struct omap_dss_driver {
 			    struct videomode *vm);
 	void (*get_size)(struct omap_dss_device *dssdev,
 			 unsigned int *width, unsigned int *height);
+	void (*get_orientation)(struct omap_dss_device *dssdev,
+				int *orientation);
 
 	int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
 	u32 (*get_wss)(struct omap_dss_device *dssdev);
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
index a33b51484b2d..2f296d29b74b 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.c
+++ b/drivers/gpu/drm/omapdrm/omap_connector.c
@@ -249,6 +249,7 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
 	struct drm_connector *connector = NULL;
 	struct omap_connector *omap_connector;
 	bool hpd_supported = false;
+	int ret;
 
 	DBG("%s", dssdev->name);
 
@@ -267,7 +268,7 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
 	drm_connector_helper_add(connector, &omap_connector_helper_funcs);
 
 	if (dssdev->driver->register_hpd_cb) {
-		int ret = dssdev->driver->register_hpd_cb(dssdev,
+		ret = dssdev->driver->register_hpd_cb(dssdev,
 							  omap_connector_hpd_cb,
 							  omap_connector);
 		if (!ret)
@@ -288,6 +289,13 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
 	connector->interlace_allowed = 1;
 	connector->doublescan_allowed = 0;
 
+	if (dssdev->driver->get_orientation)
+		dssdev->driver->get_orientation(dssdev, &connector->display_info.panel_orientation);
+
+	ret = drm_connector_init_panel_orientation_property(connector, 0, 0);
+	if (ret)
+		DBG("%s: Failed to init orientation property (%d)", dssdev->name, ret);
+
 	return connector;
 
 fail:
-- 
2.15.1

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

* [PATCHv2 6/8] drm/omap: panel-dsi-cm: add orientation support
  2018-02-08 18:30 [PATCHv2 0/8] omapdrm: DSI command mode panel support Sebastian Reichel
                   ` (2 preceding siblings ...)
  2018-02-08 18:30 ` [PATCHv2 5/8] drm/omap: add support for orientation hints from display drivers Sebastian Reichel
@ 2018-02-08 18:30 ` Sebastian Reichel
  2018-02-08 18:30 ` [PATCHv2 7/8] ARM: dts: omap4-droid4: Add LCD panel orientation property Sebastian Reichel
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-08 18:30 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Tony Lindgren
  Cc: Laurent Pinchart, Hans de Goede, Rob Herring, Mark Rutland,
	dri-devel, devicetree, linux-omap, linux-kernel, kernel,
	Sebastian Reichel

Add support to inform the DRM subsystem about the orientation
the display has been mounted to the casing.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 15399a1a666b..7a63d6775a27 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -68,6 +68,7 @@ struct panel_drv_data {
 
 	int width_mm;
 	int height_mm;
+	int orientation;
 
 	struct omap_dsi_pin_config pin_config;
 
@@ -1198,6 +1199,14 @@ static void dsicm_get_size(struct omap_dss_device *dssdev,
 	*height = ddata->height_mm;
 }
 
+static void dsicm_get_orientation(struct omap_dss_device *dssdev,
+				  int *orientation)
+{
+	struct panel_drv_data *ddata = to_panel_data(dssdev);
+
+	*orientation = ddata->orientation;
+}
+
 static struct omap_dss_driver dsicm_ops = {
 	.connect	= dsicm_connect,
 	.disconnect	= dsicm_disconnect,
@@ -1211,6 +1220,7 @@ static struct omap_dss_driver dsicm_ops = {
 	.get_timings	= dsicm_get_timings,
 	.check_timings	= dsicm_check_timings,
 	.get_size	= dsicm_get_size,
+	.get_orientation = dsicm_get_orientation,
 
 	.enable_te	= dsicm_enable_te,
 	.get_te		= dsicm_get_te,
@@ -1259,6 +1269,9 @@ static int dsicm_probe_of(struct platform_device *pdev)
 	ddata->height_mm = 0;
 	of_property_read_u32(node, "height-mm", &ddata->height_mm);
 
+	ddata->orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
+	of_property_read_u32(node, "orientation", &ddata->orientation);
+
 	in = omapdss_of_find_source_for_first_ep(node);
 	if (IS_ERR(in)) {
 		dev_err(&pdev->dev, "failed to find video source\n");
-- 
2.15.1

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

* [PATCHv2 7/8] ARM: dts: omap4-droid4: Add LCD panel orientation property
  2018-02-08 18:30 [PATCHv2 0/8] omapdrm: DSI command mode panel support Sebastian Reichel
                   ` (3 preceding siblings ...)
  2018-02-08 18:30 ` [PATCHv2 6/8] drm/omap: panel-dsi-cm: add orientation support Sebastian Reichel
@ 2018-02-08 18:30 ` Sebastian Reichel
  2018-02-08 23:13 ` [PATCHv2 0/8] omapdrm: DSI command mode panel support Tony Lindgren
  2018-03-20 14:31 ` Tony Lindgren
  6 siblings, 0 replies; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-08 18:30 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Tony Lindgren
  Cc: Laurent Pinchart, Hans de Goede, Rob Herring, Mark Rutland,
	dri-devel, devicetree, linux-omap, linux-kernel, kernel,
	Sebastian Reichel

This adds a LCD panel orientation hint to the Droid 4. If the
display is rotated this way the keyboard can be used properly.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/omap4-droid4-xt894.dts b/arch/arm/boot/dts/omap4-droid4-xt894.dts
index b21084da490b..e11a24397163 100644
--- a/arch/arm/boot/dts/omap4-droid4-xt894.dts
+++ b/arch/arm/boot/dts/omap4-droid4-xt894.dts
@@ -6,6 +6,7 @@
 /dts-v1/;
 
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/display/common.h>
 #include "omap443x.dtsi"
 #include "motorola-cpcap-mapphone.dtsi"
 
@@ -181,6 +182,8 @@
 		height-mm = <89>;
 		backlight = <&lcd_backlight>;
 
+		orientation = <PANEL_ORIENTATION_RIGHT_UP>;
+
 		panel-timing {
 			clock-frequency = <0>;		/* Calculated by dsi */
 
-- 
2.15.1

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

* [PATCHv2 8/8] drm/omap: plane: update fifo size on ovl setup
       [not found] ` <20180208183035.8461-1-sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
                     ` (2 preceding siblings ...)
  2018-02-08 18:30   ` [PATCHv2 3/8] drm/omap: add support for manually updated displays Sebastian Reichel
@ 2018-02-08 18:30   ` Sebastian Reichel
  3 siblings, 0 replies; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-08 18:30 UTC (permalink / raw)
  To: Sebastian Reichel, Tomi Valkeinen, Tony Lindgren
  Cc: Laurent Pinchart, Hans de Goede, Rob Herring, Mark Rutland,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	kernel-ZGY8ohtN/8qB+jHODAdFcQ, Sebastian Reichel

This is a workaround for a hardware bug occuring on OMAP3
with manually updated panels. Details about the HW bug are
unknown to me, but without this fix the panel refresh does
not work at all on Nokia N950. This is not the case for the
OMAP4 based Droid 4, which works perfectly fine with default
settings.

Signed-off-by: Sebastian Reichel <sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 4e8f68efd169..0904c3201914 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -157,6 +157,8 @@ struct dispc_features {
 	bool has_gamma_table:1;
 
 	bool has_gamma_i734_bug:1;
+
+	bool has_fifo_stallmode_bug:1;
 };
 
 #define DISPC_MAX_NR_FIFOS 5
@@ -1489,6 +1491,18 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane_id plane,
 	}
 }
 
+static void dispc_ovl_set_manual_fifo_threshold(enum omap_plane_id plane)
+{
+	u32 fifo_low, fifo_high;
+	bool use_fifo_merge = false;
+	bool use_manual_update = true;
+
+	dispc_ovl_compute_fifo_thresholds(plane, &fifo_low, &fifo_high,
+					  use_fifo_merge, use_manual_update);
+
+	dispc_ovl_set_fifo_threshold(plane, fifo_low, fifo_high);
+}
+
 static void dispc_ovl_set_mflag(enum omap_plane_id plane, bool enable)
 {
 	int bit;
@@ -2651,8 +2665,21 @@ static int dispc_ovl_setup(enum omap_plane_id plane,
 		oi->out_width, oi->out_height, oi->fourcc, oi->rotation,
 		oi->zorder, oi->pre_mult_alpha, oi->global_alpha,
 		oi->rotation_type, replication, vm, mem_to_mem);
+	if (r)
+		return r;
 
-	return r;
+	/*
+	 * OMAP3 chips have non-working FIFO thresholds for manually updated
+	 * displays. The issue is not fully understood, but this workaround
+	 * fixes the issue. OMAP4 is known to work with default thresholds.
+	 */
+	if (mgr_fld_read(channel, DISPC_MGR_FLD_STALLMODE) &&
+	    dispc.feat->has_fifo_stallmode_bug) {
+		DSSDBG("Enable OMAP3 FIFO stallmode bug workaround!\n");
+		dispc_ovl_set_manual_fifo_threshold(plane);
+	}
+
+	return 0;
 }
 
 int dispc_wb_setup(const struct omap_dss_writeback_info *wi,
@@ -4067,6 +4094,7 @@ static const struct dispc_features omap24xx_dispc_feats = {
 	.no_framedone_tv	=	true,
 	.set_max_preload	=	false,
 	.last_pixel_inc_missing	=	true,
+	.has_fifo_stallmode_bug	=	true,
 };
 
 static const struct dispc_features omap34xx_rev1_0_dispc_feats = {
@@ -4101,6 +4129,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats = {
 	.no_framedone_tv	=	true,
 	.set_max_preload	=	false,
 	.last_pixel_inc_missing	=	true,
+	.has_fifo_stallmode_bug	=	true,
 };
 
 static const struct dispc_features omap34xx_rev3_0_dispc_feats = {
@@ -4135,6 +4164,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats = {
 	.no_framedone_tv	=	true,
 	.set_max_preload	=	false,
 	.last_pixel_inc_missing	=	true,
+	.has_fifo_stallmode_bug	=	true,
 };
 
 static const struct dispc_features omap36xx_dispc_feats = {
@@ -4169,6 +4199,7 @@ static const struct dispc_features omap36xx_dispc_feats = {
 	.no_framedone_tv	=	true,
 	.set_max_preload	=	false,
 	.last_pixel_inc_missing	=	true,
+	.has_fifo_stallmode_bug	=	true,
 };
 
 static const struct dispc_features am43xx_dispc_feats = {
@@ -4203,6 +4234,7 @@ static const struct dispc_features am43xx_dispc_feats = {
 	.no_framedone_tv	=	true,
 	.set_max_preload	=	false,
 	.last_pixel_inc_missing	=	true,
+	.has_fifo_stallmode_bug	=	false,
 };
 
 static const struct dispc_features omap44xx_dispc_feats = {
@@ -4242,6 +4274,7 @@ static const struct dispc_features omap44xx_dispc_feats = {
 	.reverse_ilace_field_order =	true,
 	.has_gamma_table	=	true,
 	.has_gamma_i734_bug	=	true,
+	.has_fifo_stallmode_bug	=	false,
 };
 
 static const struct dispc_features omap54xx_dispc_feats = {
@@ -4282,6 +4315,7 @@ static const struct dispc_features omap54xx_dispc_feats = {
 	.reverse_ilace_field_order =	true,
 	.has_gamma_table	=	true,
 	.has_gamma_i734_bug	=	true,
+	.has_fifo_stallmode_bug	=	false,
 };
 
 static irqreturn_t dispc_irq_handler(int irq, void *arg)
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv2 0/8] omapdrm: DSI command mode panel support
  2018-02-08 18:30 [PATCHv2 0/8] omapdrm: DSI command mode panel support Sebastian Reichel
                   ` (4 preceding siblings ...)
  2018-02-08 18:30 ` [PATCHv2 7/8] ARM: dts: omap4-droid4: Add LCD panel orientation property Sebastian Reichel
@ 2018-02-08 23:13 ` Tony Lindgren
  2018-03-20 14:31 ` Tony Lindgren
  6 siblings, 0 replies; 17+ messages in thread
From: Tony Lindgren @ 2018-02-08 23:13 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Sebastian Reichel, Tomi Valkeinen, Laurent Pinchart,
	Hans de Goede, Rob Herring, Mark Rutland, dri-devel, devicetree,
	linux-omap, linux-kernel, kernel

* Sebastian Reichel <sebastian.reichel@collabora.co.uk> [180208 10:31]:
> Hi,
> 
> These are the remaining patches from my previous patchset to get
> Droid 4 (omap4) display working. The patches have been rebased to
> current master branch from Torvalds (581e400ff935). Since N950
> (omap3) is broken even with the workaround I moved it to the end,
> so that it can be skipped.
> 
> Working on Droid 4:
>  * Framebuffer Console, updated at 1Hz due to blinking cursor
>  * kmstest (static image)
>  * Display blanking
>  * Xorg with omap and modesetting driver
>  * No updates send when nothing needs to be sent
>  * Orientation DRM property is attached to the DSI panel

Great, still works for me :) Seems like the dts change is
safe to merge along with the driver changes once no more
comments. For patches 1 - 7, please feel free to add:

Tested-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCHv2 4/8] dt-bindings: panel: common: document orientation property
  2018-02-08 18:30 ` [PATCHv2 4/8] dt-bindings: panel: common: document orientation property Sebastian Reichel
@ 2018-02-18 23:24   ` Rob Herring
  2018-02-19 11:06     ` Sebastian Reichel
  0 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2018-02-18 23:24 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Mark Rutland, devicetree, kernel, Tony Lindgren,
	Sebastian Reichel, dri-devel, linux-kernel, Hans de Goede,
	Tomi Valkeinen, Laurent Pinchart, linux-omap

On Thu, Feb 08, 2018 at 07:30:31PM +0100, Sebastian Reichel wrote:
> Introduce new "orientation" property for describing in which
> orientation a panel has been mounted to the device. This can
> be used by the operating system to automatically rotate the
> display correctly.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
> ---
>  .../devicetree/bindings/display/panel/panel-common.txt     | 12 ++++++++++++
>  include/dt-bindings/display/common.h                       | 14 ++++++++++++++
>  2 files changed, 26 insertions(+)
>  create mode 100644 include/dt-bindings/display/common.h
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.txt b/Documentation/devicetree/bindings/display/panel/panel-common.txt
> index 557fa765adcb..c646b8908458 100644
> --- a/Documentation/devicetree/bindings/display/panel/panel-common.txt
> +++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt
> @@ -18,6 +18,18 @@ Descriptive Properties
>    physical area where images are displayed. These properties are expressed in
>    millimeters and rounded to the closest unit.
>  
> +- orientation: The orientation property specifies the panel orientation
> +  in relation to the device's casing. The following values are possible:
> +
> +   * 0 = The top side of the panel matches the top side of the device's
> +         casing.
> +   * 1 = The top side of the panel matches the bottom side of the device's
> +         casing. In other words the panel is mounted upside-down.
> +   * 2 = The left side of the panel matches the top side of the device's
> +         casing.
> +   * 3 = The right side of the panel matches the top side of the device's
> +         casing.


The rotation property in panel.txt already handles this, right?

> +
>  - label: The label property specifies a symbolic name for the panel as a
>    string suitable for use by humans. It typically contains a name inscribed on
>    the system (e.g. as an affixed label) or specified in the system's
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCHv2 4/8] dt-bindings: panel: common: document orientation property
  2018-02-18 23:24   ` Rob Herring
@ 2018-02-19 11:06     ` Sebastian Reichel
  2018-02-20 19:09       ` Rob Herring
  0 siblings, 1 reply; 17+ messages in thread
From: Sebastian Reichel @ 2018-02-19 11:06 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mark Rutland, devicetree, kernel, Tony Lindgren, linux-kernel,
	dri-devel, Hans de Goede, Tomi Valkeinen, Laurent Pinchart,
	linux-omap


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

Hi,

On Sun, Feb 18, 2018 at 05:24:24PM -0600, Rob Herring wrote:
> On Thu, Feb 08, 2018 at 07:30:31PM +0100, Sebastian Reichel wrote:
> > Introduce new "orientation" property for describing in which
> > orientation a panel has been mounted to the device. This can
> > be used by the operating system to automatically rotate the
> > display correctly.
> > 
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
> > ---
> >  .../devicetree/bindings/display/panel/panel-common.txt     | 12 ++++++++++++
> >  include/dt-bindings/display/common.h                       | 14 ++++++++++++++
> >  2 files changed, 26 insertions(+)
> >  create mode 100644 include/dt-bindings/display/common.h
> > 
> > diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.txt b/Documentation/devicetree/bindings/display/panel/panel-common.txt
> > index 557fa765adcb..c646b8908458 100644
> > --- a/Documentation/devicetree/bindings/display/panel/panel-common.txt
> > +++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt
> > @@ -18,6 +18,18 @@ Descriptive Properties
> >    physical area where images are displayed. These properties are expressed in
> >    millimeters and rounded to the closest unit.
> >  
> > +- orientation: The orientation property specifies the panel orientation
> > +  in relation to the device's casing. The following values are possible:
> > +
> > +   * 0 = The top side of the panel matches the top side of the device's
> > +         casing.
> > +   * 1 = The top side of the panel matches the bottom side of the device's
> > +         casing. In other words the panel is mounted upside-down.
> > +   * 2 = The left side of the panel matches the top side of the device's
> > +         casing.
> > +   * 3 = The right side of the panel matches the top side of the device's
> > +         casing.
> 
> The rotation property in panel.txt already handles this, right?

Yes, looks like it can be used. I guess panel.txt and
panel-common.txt should be merged, though?

> >  - label: The label property specifies a symbolic name for the panel as a
> >    string suitable for use by humans. It typically contains a name inscribed on
> >    the system (e.g. as an affixed label) or specified in the system's

-- Sebastian

[-- 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

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

* Re: [PATCHv2 4/8] dt-bindings: panel: common: document orientation property
  2018-02-19 11:06     ` Sebastian Reichel
@ 2018-02-20 19:09       ` Rob Herring
  0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2018-02-20 19:09 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Mark Rutland, devicetree, kernel, Tony Lindgren, linux-kernel,
	dri-devel, Hans de Goede, Tomi Valkeinen, Laurent Pinchart,
	linux-omap

On Mon, Feb 19, 2018 at 5:06 AM, Sebastian Reichel
<sebastian.reichel@collabora.co.uk> wrote:
> Hi,
>
> On Sun, Feb 18, 2018 at 05:24:24PM -0600, Rob Herring wrote:
>> On Thu, Feb 08, 2018 at 07:30:31PM +0100, Sebastian Reichel wrote:
>> > Introduce new "orientation" property for describing in which
>> > orientation a panel has been mounted to the device. This can
>> > be used by the operating system to automatically rotate the
>> > display correctly.
>> >
>> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
>> > ---
>> >  .../devicetree/bindings/display/panel/panel-common.txt     | 12 ++++++++++++
>> >  include/dt-bindings/display/common.h                       | 14 ++++++++++++++
>> >  2 files changed, 26 insertions(+)
>> >  create mode 100644 include/dt-bindings/display/common.h
>> >
>> > diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.txt b/Documentation/devicetree/bindings/display/panel/panel-common.txt
>> > index 557fa765adcb..c646b8908458 100644
>> > --- a/Documentation/devicetree/bindings/display/panel/panel-common.txt
>> > +++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt
>> > @@ -18,6 +18,18 @@ Descriptive Properties
>> >    physical area where images are displayed. These properties are expressed in
>> >    millimeters and rounded to the closest unit.
>> >
>> > +- orientation: The orientation property specifies the panel orientation
>> > +  in relation to the device's casing. The following values are possible:
>> > +
>> > +   * 0 = The top side of the panel matches the top side of the device's
>> > +         casing.
>> > +   * 1 = The top side of the panel matches the bottom side of the device's
>> > +         casing. In other words the panel is mounted upside-down.
>> > +   * 2 = The left side of the panel matches the top side of the device's
>> > +         casing.
>> > +   * 3 = The right side of the panel matches the top side of the device's
>> > +         casing.
>>
>> The rotation property in panel.txt already handles this, right?
>
> Yes, looks like it can be used. I guess panel.txt and
> panel-common.txt should be merged, though?

Yes, please. Actually, I'd like to merge simple-panel.txt too because
that is really kernel driver, not a type of panel. But there's a lot
of references to it to fix.

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

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

* Re: [PATCHv2 1/8] drm/omap: add framedone interrupt support
  2018-02-08 18:30   ` [PATCHv2 1/8] drm/omap: add framedone interrupt support Sebastian Reichel
@ 2018-03-20 14:28     ` Tony Lindgren
  0 siblings, 0 replies; 17+ messages in thread
From: Tony Lindgren @ 2018-03-20 14:28 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Sebastian Reichel, Tomi Valkeinen, Laurent Pinchart,
	Hans de Goede, Rob Herring, Mark Rutland, dri-devel, devicetree,
	linux-omap, linux-kernel, kernel

* Sebastian Reichel <sebastian.reichel@collabora.co.uk> [180208 18:31]:
> This prepares framedone interrupt handling for
> manual display update support.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

Tested-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCHv2 2/8] drm/omap: add manual update detection helper
  2018-02-08 18:30   ` [PATCHv2 2/8] drm/omap: add manual update detection helper Sebastian Reichel
@ 2018-03-20 14:28     ` Tony Lindgren
  0 siblings, 0 replies; 17+ messages in thread
From: Tony Lindgren @ 2018-03-20 14:28 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Sebastian Reichel, Tomi Valkeinen, Laurent Pinchart,
	Hans de Goede, Rob Herring, Mark Rutland, dri-devel, devicetree,
	linux-omap, linux-kernel, kernel

* Sebastian Reichel <sebastian.reichel@collabora.co.uk> [180208 18:31]:
> In preparation for manually updated display support, such as DSI
> command mode panels, this adds a simple helper to see if a connector
> is manually updated.

Tested-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCHv2 3/8] drm/omap: add support for manually updated displays
  2018-02-08 18:30   ` [PATCHv2 3/8] drm/omap: add support for manually updated displays Sebastian Reichel
@ 2018-03-20 14:29     ` Tony Lindgren
  0 siblings, 0 replies; 17+ messages in thread
From: Tony Lindgren @ 2018-03-20 14:29 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Sebastian Reichel, Tomi Valkeinen, Laurent Pinchart,
	Hans de Goede, Rob Herring, Mark Rutland, dri-devel, devicetree,
	linux-omap, linux-kernel, kernel

* Sebastian Reichel <sebastian.reichel@collabora.co.uk> [180208 18:31]:
> This adds the required infrastructure for manually
> updated displays, such as DSI command mode panels.
> 
> While those panels often support partial updates
> we currently always do a full refresh. Display
> will be refreshed when something calls the dirty
> callback, such as libdrm's drmModeDirtyFB().
> 
> This is currently being implemented for the kernel
> console and for Xorg. Weston currently does not
> implement this and is known not to work on manually
> updated displays.

Tested-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCHv2 0/8] omapdrm: DSI command mode panel support
  2018-02-08 18:30 [PATCHv2 0/8] omapdrm: DSI command mode panel support Sebastian Reichel
                   ` (5 preceding siblings ...)
  2018-02-08 23:13 ` [PATCHv2 0/8] omapdrm: DSI command mode panel support Tony Lindgren
@ 2018-03-20 14:31 ` Tony Lindgren
  6 siblings, 0 replies; 17+ messages in thread
From: Tony Lindgren @ 2018-03-20 14:31 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Sebastian Reichel, Tomi Valkeinen, Laurent Pinchart,
	Hans de Goede, Rob Herring, Mark Rutland, dri-devel, devicetree,
	linux-omap, linux-kernel, kernel

Tomi,

* Sebastian Reichel <sebastian.reichel@collabora.co.uk> [180208 10:31]:
> Hi,
> 
> These are the remaining patches from my previous patchset to get
> Droid 4 (omap4) display working. The patches have been rebased to
> current master branch from Torvalds (581e400ff935). Since N950
> (omap3) is broken even with the workaround I moved it to the end,
> so that it can be skipped.

Seems like the first three patches of these could be applied
for v4.17 separate from the rotation and omap3 related issues?

Regards,

Tony

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

end of thread, other threads:[~2018-03-20 14:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08 18:30 [PATCHv2 0/8] omapdrm: DSI command mode panel support Sebastian Reichel
     [not found] ` <20180208183035.8461-1-sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
2018-02-08 18:30   ` [PATCHv2 1/8] drm/omap: add framedone interrupt support Sebastian Reichel
2018-03-20 14:28     ` Tony Lindgren
2018-02-08 18:30   ` [PATCHv2 2/8] drm/omap: add manual update detection helper Sebastian Reichel
2018-03-20 14:28     ` Tony Lindgren
2018-02-08 18:30   ` [PATCHv2 3/8] drm/omap: add support for manually updated displays Sebastian Reichel
2018-03-20 14:29     ` Tony Lindgren
2018-02-08 18:30   ` [PATCHv2 8/8] drm/omap: plane: update fifo size on ovl setup Sebastian Reichel
2018-02-08 18:30 ` [PATCHv2 4/8] dt-bindings: panel: common: document orientation property Sebastian Reichel
2018-02-18 23:24   ` Rob Herring
2018-02-19 11:06     ` Sebastian Reichel
2018-02-20 19:09       ` Rob Herring
2018-02-08 18:30 ` [PATCHv2 5/8] drm/omap: add support for orientation hints from display drivers Sebastian Reichel
2018-02-08 18:30 ` [PATCHv2 6/8] drm/omap: panel-dsi-cm: add orientation support Sebastian Reichel
2018-02-08 18:30 ` [PATCHv2 7/8] ARM: dts: omap4-droid4: Add LCD panel orientation property Sebastian Reichel
2018-02-08 23:13 ` [PATCHv2 0/8] omapdrm: DSI command mode panel support Tony Lindgren
2018-03-20 14:31 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).