Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1353227 > unrolled thread

[PATCH 00/23] Nokia N950 display support

Started bySebastian Reichel <sre@kernel.org>
First post2016-03-08 18:00 +0100
Last post2016-03-09 18:10 +0100
Articles 20 on this page of 21 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/23] Nokia N950 display support Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 21/23] drm: omapdrm: panel-dsi-cm: block disable until update completed Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 14/23] drm: omapdrm: crtc: save framedone callback from dss Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 10/23] drm: omapdrm: crtc: detect manually updated displays Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 19/23] drm: omapdrm: panel-dsi-cm: improve DT support Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 01/23] ARM: dts: n9/n950: regulator configuration Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 07/23] drm: omapdrm: crtc: switch pending variable to atomic bitset Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 15/23] drm: omapdrm: crtc: add support for manual updated displays Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 11/23] include: video: omapdss: provide fifo threshold methods Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 08/23] drm: omapdrm: crtc: add enabled bit to state Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 16/23] drm: omapdrm: update manual displays on dirty ioctl Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    [PATCH 18/23] drm: omapdrm: panel-dsi-cm: use threaded irq handler Sebastian Reichel <sre@kernel.org> - 2016-03-08 18:00 +0100
    Re: [PATCH 00/23] Nokia N950 display support Aaro Koskinen <aaro.koskinen@iki.fi> - 2016-03-08 19:40 +0100
      Re: [PATCH 00/23] Nokia N950 display support Sebastian Reichel <sre@kernel.org> - 2016-03-08 21:50 +0100
        Re: [PATCH 00/23] Nokia N950 display support Tomi Valkeinen <tomi.valkeinen@ti.com> - 2016-03-09 08:20 +0100
          Re: [PATCH 00/23] Nokia N950 display support Sebastian Reichel <sre@kernel.org> - 2016-03-09 15:40 +0100
        Re: [PATCH 00/23] Nokia N950 display support Aaro Koskinen <aaro.koskinen@iki.fi> - 2016-03-09 22:10 +0100
    Re: [PATCH 00/23] Nokia N950 display support Tomi Valkeinen <tomi.valkeinen@ti.com> - 2016-03-09 17:30 +0100
      Re: [PATCH 00/23] Nokia N950 display support Emil Velikov <emil.l.velikov@gmail.com> - 2016-03-09 18:00 +0100
    Re: [PATCH 00/23] Nokia N950 display support Emil Velikov <emil.l.velikov@gmail.com> - 2016-03-09 17:30 +0100
      Re: [PATCH 00/23] Nokia N950 display support Sebastian Reichel <sre@kernel.org> - 2016-03-09 18:10 +0100

Page 1 of 2  [1] 2  Next page →


#1353227 — [PATCH 00/23] Nokia N950 display support

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 00/23] Nokia N950 display support
Message-ID<rat9g-3s9-15@gated-at.bofh.it>
Hi,

This series adds support for the Nokia N950 display.
Since the panel is using DSI command mode, it involves
adding support for manually updated displays to
omapdrm.

The following patches, that are based on 4.5-rc7
were tested with fbcon and Xorg (from Debian sid)
on the N950.

-- Sebastian

Sebastian Reichel (22):
  ARM: dts: n9/n950: regulator configuration
  ARM: dts: n950: add display support
  drm: omapdrm: add DSI mapping
  Revert "drm: omapdrm: Remove manual update display support"
  drm: omapdrm: wait for pending operations before updating plane
  drm: omapdrm: crtc: switch pending variable to atomic bitset
  drm: omapdrm: crtc: add enabled bit to state
  drm: omapdrm: dss: method to get stallmode from lcd config
  drm: omapdrm: crtc: detect manually updated displays
  include: video: omapdss: provide fifo threshold methods
  drm: omapdrm: plane: update fifo size on atomic update
  drm: omapdrm: crtc: update plane fifos on lcd config change
  drm: omapdrm: crtc: save framedone callback from dss
  drm: omapdrm: crtc: add support for manual updated displays
  drm: omapdrm: update manual displays on dirty ioctl
  drm: omapdrm: panel-dsi-cm: add regulator support
  drm: omapdrm: panel-dsi-cm: use threaded irq handler
  drm: omapdrm: panel-dsi-cm: improve DT support
  drm: omapdrm: panel-dsi-cm: add offset support
  drm: omapdrm: panel-dsi-cm: block disable until update completed
  drm: omapdrm: panel-dsi-cm: ratelimit debug output in update path
  drm: omapdrm: panel-dsi-cm: provide timings methods for omapdrm

Tomi Valkeinen (1):
  drm: omapdrm: dss: reset dsi module during initialization

 arch/arm/boot/dts/omap3-n950-n9.dtsi            |  72 +++++++++
 arch/arm/boot/dts/omap3-n950.dts                |  71 +++++++++
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 163 ++++++++++++++++++---
 drivers/gpu/drm/omapdrm/dss/dsi.c               |  24 +++
 drivers/gpu/drm/omapdrm/dss/output.c            |   6 +
 drivers/gpu/drm/omapdrm/omap_crtc.c             | 185 +++++++++++++++++++++---
 drivers/gpu/drm/omapdrm/omap_drv.c              |   6 +
 drivers/gpu/drm/omapdrm/omap_drv.h              |   6 +
 drivers/gpu/drm/omapdrm/omap_fb.c               |  38 +++++
 drivers/gpu/drm/omapdrm/omap_fbdev.c            |  57 +++++++-
 drivers/gpu/drm/omapdrm/omap_plane.c            |  23 +++
 include/video/omapdss.h                         |   7 +
 12 files changed, 616 insertions(+), 42 deletions(-)

-- 
2.7.0

[toc] | [next] | [standalone]


#1353228 — [PATCH 21/23] drm: omapdrm: panel-dsi-cm: block disable until update completed

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 21/23] drm: omapdrm: panel-dsi-cm: block disable until update completed
Message-ID<rat9h-3s9-47@gated-at.bofh.it>
In reply to#1353227
DSI hardware IPs seem to be a bit unhappy about
incomplete image transfers, so try to wait for
an update to finish before disabling the panel.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index c60bc3013ff4..ca7fba59c760 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -78,6 +78,9 @@ struct panel_drv_data {
 	atomic_t do_update;
 	int channel;
 
+	wait_queue_head_t update_wait;
+	atomic_t updating;
+
 	struct delayed_work te_timeout_work;
 
 	bool intro_printed;
@@ -845,6 +848,13 @@ static void dsicm_disable(struct omap_dss_device *dssdev)
 
 	dev_dbg(&ddata->pdev->dev, "disable\n");
 
+	r = wait_event_timeout(ddata->update_wait,
+				!atomic_read(&ddata->updating),
+				msecs_to_jiffies(250));
+	if (!r) {
+		dev_warn(&ddata->pdev->dev, "update did not finish, force disable!");
+	}
+
 	mutex_lock(&ddata->lock);
 
 	dsicm_cancel_ulps_work(ddata);
@@ -871,6 +881,9 @@ static void dsicm_framedone_cb(int err, void *data)
 
 	dev_dbg(&ddata->pdev->dev, "framedone, err %d\n", err);
 	in->ops.dsi->bus_unlock(ddata->in);
+
+	atomic_set(&ddata->updating, 0);
+	wake_up(&ddata->update_wait);
 }
 
 static irqreturn_t dsicm_te_isr(int irq, void *data)
@@ -885,6 +898,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data)
 	if (old) {
 		cancel_delayed_work(&ddata->te_timeout_work);
 
+		atomic_set(&ddata->updating, 1);
 		r = in->ops.dsi->update(in, ddata->channel, dsicm_framedone_cb,
 				ddata);
 		if (r)
@@ -943,6 +957,7 @@ static int dsicm_update(struct omap_dss_device *dssdev,
 				msecs_to_jiffies(250));
 		atomic_set(&ddata->do_update, 1);
 	} else {
+		atomic_set(&ddata->updating, 1);
 		r = in->ops.dsi->update(in, ddata->channel, dsicm_framedone_cb,
 				ddata);
 		if (r)
@@ -1317,6 +1332,9 @@ static int dsicm_probe(struct platform_device *pdev)
 	mutex_init(&ddata->lock);
 
 	atomic_set(&ddata->do_update, 0);
+	atomic_set(&ddata->updating, 0);
+
+	init_waitqueue_head(&ddata->update_wait);
 
 	if (gpio_is_valid(ddata->reset_gpio)) {
 		r = devm_gpio_request_one(dev, ddata->reset_gpio,
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353229 — [PATCH 14/23] drm: omapdrm: crtc: save framedone callback from dss

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 14/23] drm: omapdrm: crtc: save framedone callback from dss
Message-ID<rat9h-3s9-49@gated-at.bofh.it>
In reply to#1353227
Save the framedone callback supplied by dss for later
usage.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 094e89a2fa94..3ce7143e5a5f 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -57,6 +57,9 @@ struct omap_crtc {
 
 	unsigned long state;
 	wait_queue_head_t pending_wait;
+
+	void (*framedone_handler)(void *);
+	void *framedone_handler_data;
 };
 
 /* -----------------------------------------------------------------------------
@@ -263,6 +266,17 @@ static int omap_crtc_dss_register_framedone(
 		struct omap_overlay_manager *mgr,
 		void (*handler)(void *), void *data)
 {
+	struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
+	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;
 }
 
@@ -270,6 +284,16 @@ static void omap_crtc_dss_unregister_framedone(
 		struct omap_overlay_manager *mgr,
 		void (*handler)(void *), void *data)
 {
+	struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
+	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 = {
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353231 — [PATCH 10/23] drm: omapdrm: crtc: detect manually updated displays

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 10/23] drm: omapdrm: crtc: detect manually updated displays
Message-ID<rat9h-3s9-55@gated-at.bofh.it>
In reply to#1353227
Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 31 ++++++++++++++++++++++++++++++-
 drivers/gpu/drm/omapdrm/omap_drv.h  |  1 +
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 78ef9773cca1..8967013c1fb5 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -48,6 +48,7 @@ struct omap_crtc {
 	struct omap_overlay_manager *mgr;
 
 	struct omap_video_timings timings;
+	bool manually_updated;
 
 	struct omap_drm_irq vblank_irq;
 	struct omap_drm_irq error_irq;
@@ -90,6 +91,12 @@ int omap_crtc_wait_pending(struct drm_crtc *crtc)
 				  msecs_to_jiffies(50));
 }
 
+bool omap_crtc_is_manual_updated(struct drm_crtc *crtc)
+{
+	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+	return omap_crtc->manually_updated;
+}
+
 /* -----------------------------------------------------------------------------
  * DSS Manager Functions
  */
@@ -154,6 +161,11 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable)
 		omap_crtc->ignore_digit_sync_lost = true;
 	}
 
+	if (omap_crtc->manually_updated) {
+		dev_dbg(dev->dev, "stallmode detected, not waiting for irq");
+		return;
+	}
+
 	framedone_irq = dispc_mgr_get_framedone_irq(channel);
 	vsync_irq = dispc_mgr_get_vsync_irq(channel);
 
@@ -233,7 +245,13 @@ static void omap_crtc_dss_set_lcd_config(struct omap_overlay_manager *mgr,
 		const struct dss_lcd_mgr_config *config)
 {
 	struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
-	DBG("%s", omap_crtc->name);
+	struct drm_device *dev = omap_crtc->base.dev;
+	struct drm_plane *plane;
+
+	dev_dbg(dev->dev, "set lcd config for %s", omap_crtc->name);
+
+	omap_crtc->manually_updated = dss_lcd_mgr_config_get_stallmode(config);
+
 	dispc_mgr_set_lcd_config(omap_crtc->channel, config);
 }
 
@@ -358,10 +376,18 @@ static bool omap_crtc_mode_fixup(struct drm_crtc *crtc,
 static void omap_crtc_enable(struct drm_crtc *crtc)
 {
 	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+	struct omap_dss_device *display = omap_crtc->mgr->output->dst;
 	struct drm_device *dev = crtc->dev;
 
 	DBG("%s", omap_crtc->name);
 
+	/* manual updated display will not trigger vsync irq */
+	/* omap_crtc->manually_updated is not yet set */
+	if (display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
+		dev_dbg(dev->dev, "manual update display detected!");
+		return;
+	}
+
 	if (test_and_set_bit(crtc_pending, &omap_crtc->state))
 		dev_warn(dev->dev, "crtc enable while pending bit set!");
 
@@ -407,6 +433,9 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
 
 	WARN_ON(omap_crtc->vblank_irq.registered);
 
+	if (omap_crtc->manually_updated)
+		return;
+
 	if (dispc_mgr_is_enabled(omap_crtc->channel)) {
 
 		DBG("%s: GO", omap_crtc->name);
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 5dfa93a3b505..71e2c2284b86 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -155,6 +155,7 @@ void omap_crtc_pre_uninit(void);
 struct drm_crtc *omap_crtc_init(struct drm_device *dev,
 		struct drm_plane *plane, enum omap_channel channel, int id);
 int omap_crtc_wait_pending(struct drm_crtc *crtc);
+bool omap_crtc_is_manual_updated(struct drm_crtc *crtc);
 
 struct drm_plane *omap_plane_init(struct drm_device *dev,
 		int id, enum drm_plane_type type);
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353232 — [PATCH 19/23] drm: omapdrm: panel-dsi-cm: improve DT support

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 19/23] drm: omapdrm: panel-dsi-cm: improve DT support
Message-ID<rat9h-3s9-59@gated-at.bofh.it>
In reply to#1353227
Introduce new DT properties, so that it's possible
to use different panels with the driver.

 * resolution-x (default: 864)
 * resolution-y (default: 480)
 * has-dsi-backlight (default: no backlight)

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 8316b6c2d8aa..4c1e76da68cd 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -1240,7 +1240,12 @@ static int dsicm_probe_of(struct platform_device *pdev)
 
 	ddata->in = in;
 
-	/* TODO: ulps, backlight */
+	ddata->use_dsi_backlight = of_property_read_bool(node, "has-dsi-backlight");
+
+	of_property_read_u32(node, "resolution-x", (u32*) &ddata->timings.x_res);
+	of_property_read_u32(node, "resolution-y", (u32*) &ddata->timings.y_res);
+
+	ddata->timings.pixelclock = ddata->timings.x_res * ddata->timings.y_res * 60;
 
 	return 0;
 }
@@ -1263,6 +1268,12 @@ static int dsicm_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, ddata);
 	ddata->pdev = pdev;
 
+	/* setup defaults */
+	ddata->ulps_timeout = 500;
+	ddata->timings.x_res = 864;
+	ddata->timings.y_res = 480;
+	ddata->timings.pixelclock = 864 * 480 * 60;
+
 	if (dev_get_platdata(dev)) {
 		r = dsicm_probe_pdata(pdev);
 		if (r)
@@ -1275,10 +1286,6 @@ static int dsicm_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	ddata->timings.x_res = 864;
-	ddata->timings.y_res = 480;
-	ddata->timings.pixelclock = 864 * 480 * 60;
-
 	dssdev = &ddata->dssdev;
 	dssdev->dev = dev;
 	dssdev->driver = &dsicm_ops;
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353234 — [PATCH 01/23] ARM: dts: n9/n950: regulator configuration

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 01/23] ARM: dts: n9/n950: regulator configuration
Message-ID<rat9i-3s9-69@gated-at.bofh.it>
In reply to#1353227
Add regulator configuration as found in the
board files of Nokia's kernel.

Signed-off-By: Sebastian Reichel <sre@kernel.org>
---
 arch/arm/boot/dts/omap3-n950-n9.dtsi | 72 ++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n950-n9.dtsi b/arch/arm/boot/dts/omap3-n950-n9.dtsi
index a2c2b8d8dd2c..3c7f1d2deb2f 100644
--- a/arch/arm/boot/dts/omap3-n950-n9.dtsi
+++ b/arch/arm/boot/dts/omap3-n950-n9.dtsi
@@ -72,6 +72,30 @@
 	ti,pulldowns	= <0x008106>; /* BIT(1) | BIT(2) | BIT(8) | BIT(15) */
 };
 
+&vdac {
+	regulator-name = "vdac";
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
+&vpll1 {
+	regulator-name = "vpll1";
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
+&vpll2 {
+	regulator-name = "vpll2";
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
+&vaux1 {
+	regulator-name = "vaux1";
+	regulator-min-microvolt = <2800000>;
+	regulator-max-microvolt = <2800000>;
+};
+
 /* CSI-2 receiver */
 &vaux2 {
 	regulator-name = "vaux2";
@@ -86,6 +110,54 @@
 	regulator-max-microvolt = <2800000>;
 };
 
+&vaux4 {
+	regulator-name = "vaux4";
+	regulator-min-microvolt = <2800000>;
+	regulator-max-microvolt = <2800000>;
+};
+
+&vmmc1 {
+	regulator-name = "vmmc1";
+	regulator-min-microvolt = <1850000>;
+	regulator-max-microvolt = <3150000>;
+};
+
+&vmmc2 {
+	regulator-name = "vmmc2";
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+};
+
+&vintana1 {
+	regulator-name = "vintana1";
+	regulator-min-microvolt = <1500000>;
+	regulator-max-microvolt = <1500000>;
+};
+
+&vintana2 {
+	regulator-name = "vintana2";
+	regulator-min-microvolt = <2750000>;
+	regulator-max-microvolt = <2750000>;
+};
+
+&vintdig {
+	regulator-name = "vintdig";
+	regulator-min-microvolt = <1500000>;
+	regulator-max-microvolt = <1500000>;
+};
+
+&vsim {
+	regulator-name = "vsim";
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
+&vio {
+	regulator-name = "vio";
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
 &i2c2 {
 	clock-frequency = <400000>;
 };
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353235 — [PATCH 07/23] drm: omapdrm: crtc: switch pending variable to atomic bitset

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 07/23] drm: omapdrm: crtc: switch pending variable to atomic bitset
Message-ID<rat9i-3s9-67@gated-at.bofh.it>
In reply to#1353227
Having the pending variable available as atomic bit helps
with the later addition of manually updated display support.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 2ed0754ed19e..5ef27664bcfa 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -28,6 +28,11 @@
 
 #define to_omap_crtc(x) container_of(x, struct omap_crtc, base)
 
+enum omap_crtc_state {
+	crtc_enabled	= 0,
+	crtc_pending	= 1
+};
+
 struct omap_crtc {
 	struct drm_crtc base;
 
@@ -49,7 +54,7 @@ struct omap_crtc {
 
 	bool ignore_digit_sync_lost;
 
-	bool pending;
+	unsigned long state;
 	wait_queue_head_t pending_wait;
 };
 
@@ -81,7 +86,7 @@ int omap_crtc_wait_pending(struct drm_crtc *crtc)
 	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
 
 	return wait_event_timeout(omap_crtc->pending_wait,
-				  !omap_crtc->pending,
+				  !test_bit(crtc_pending, &omap_crtc->state),
 				  msecs_to_jiffies(50));
 }
 
@@ -311,10 +316,8 @@ static void omap_crtc_vblank_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
 
 	__omap_irq_unregister(dev, &omap_crtc->vblank_irq);
 
-	rmb();
-	WARN_ON(!omap_crtc->pending);
-	omap_crtc->pending = false;
-	wmb();
+	if (!test_and_clear_bit(crtc_pending, &omap_crtc->state))
+		dev_warn(dev->dev, "pending bit was not set in vblank irq");
 
 	/* wake up userspace */
 	omap_crtc_complete_page_flip(&omap_crtc->base);
@@ -351,13 +354,12 @@ static bool omap_crtc_mode_fixup(struct drm_crtc *crtc,
 static void omap_crtc_enable(struct drm_crtc *crtc)
 {
 	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+	struct drm_device *dev = crtc->dev;
 
 	DBG("%s", omap_crtc->name);
 
-	rmb();
-	WARN_ON(omap_crtc->pending);
-	omap_crtc->pending = true;
-	wmb();
+	if (test_and_set_bit(crtc_pending, &omap_crtc->state))
+		dev_warn(dev->dev, "crtc enable while pending bit set!");
 
 	omap_irq_register(crtc->dev, &omap_crtc->vblank_irq);
 
@@ -397,6 +399,7 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
                                   struct drm_crtc_state *old_crtc_state)
 {
 	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+	struct drm_device *dev = crtc->dev;
 
 	WARN_ON(omap_crtc->vblank_irq.registered);
 
@@ -404,10 +407,8 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
 
 		DBG("%s: GO", omap_crtc->name);
 
-		rmb();
-		WARN_ON(omap_crtc->pending);
-		omap_crtc->pending = true;
-		wmb();
+		if (test_and_set_bit(crtc_pending, &omap_crtc->state))
+			dev_warn(dev->dev, "atomic flush while pending bit set!");
 
 		dispc_mgr_go(omap_crtc->channel);
 		omap_irq_register(crtc->dev, &omap_crtc->vblank_irq);
@@ -509,6 +510,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
 
 	init_waitqueue_head(&omap_crtc->pending_wait);
 
+	omap_crtc->state = 0;
+
 	omap_crtc->channel = channel;
 	omap_crtc->name = channel_names[channel];
 
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353237 — [PATCH 15/23] drm: omapdrm: crtc: add support for manual updated displays

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 15/23] drm: omapdrm: crtc: add support for manual updated displays
Message-ID<rat9j-3s9-73@gated-at.bofh.it>
In reply to#1353227
Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 91 +++++++++++++++++++++++++++++++++++--
 drivers/gpu/drm/omapdrm/omap_drv.h  |  2 +
 2 files changed, 90 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 3ce7143e5a5f..10d2647965c2 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -51,12 +51,14 @@ struct omap_crtc {
 	bool manually_updated;
 
 	struct omap_drm_irq vblank_irq;
+	struct omap_drm_irq framedone_irq;
 	struct omap_drm_irq error_irq;
 
 	bool ignore_digit_sync_lost;
 
 	unsigned long state;
 	wait_queue_head_t pending_wait;
+	struct delayed_work update_work;
 
 	void (*framedone_handler)(void *);
 	void *framedone_handler_data;
@@ -91,7 +93,7 @@ int omap_crtc_wait_pending(struct drm_crtc *crtc)
 
 	return wait_event_timeout(omap_crtc->pending_wait,
 				  !test_bit(crtc_pending, &omap_crtc->state),
-				  msecs_to_jiffies(50));
+				  msecs_to_jiffies(250));
 }
 
 bool omap_crtc_is_manual_updated(struct drm_crtc *crtc)
@@ -141,6 +143,15 @@ static void omap_crtc_dss_disconnect(struct omap_overlay_manager *mgr,
 
 static void omap_crtc_dss_start_update(struct omap_overlay_manager *mgr)
 {
+	struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
+	struct drm_device *dev = omap_crtc->base.dev;
+	enum omap_channel channel = omap_crtc->channel;
+
+	WARN_ON(dispc_mgr_is_enabled(channel));
+
+	omap_irq_register(dev, &omap_crtc->framedone_irq);
+
+	dispc_mgr_enable(channel, true);
 }
 
 /* Called only from the encoder enable/disable and suspend/resume handlers. */
@@ -209,8 +220,11 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable)
 static int omap_crtc_dss_enable(struct omap_overlay_manager *mgr)
 {
 	struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
+	struct drm_device *dev = omap_crtc->base.dev;
 	struct omap_overlay_manager_info info;
 
+	dev_dbg(dev->dev, "crtc dss enable %s", omap_crtc->name);
+
 	memset(&info, 0, sizeof(info));
 	info.default_color = 0x00000000;
 	info.trans_key = 0x00000000;
@@ -230,6 +244,9 @@ static int omap_crtc_dss_enable(struct omap_overlay_manager *mgr)
 static void omap_crtc_dss_disable(struct omap_overlay_manager *mgr)
 {
 	struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
+	struct drm_device *dev = omap_crtc->base.dev;
+
+	dev_dbg(dev->dev, "crtc dss disable %s", omap_crtc->name);
 
 	clear_bit(crtc_enabled, &omap_crtc->state);
 
@@ -376,6 +393,63 @@ static void omap_crtc_vblank_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
 	wake_up(&omap_crtc->pending_wait);
 }
 
+static void omap_crtc_framedone_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
+{
+	struct omap_crtc *omap_crtc =
+			container_of(irq, struct omap_crtc, framedone_irq);
+	struct drm_device *dev = omap_crtc->base.dev;
+
+	if (omap_crtc->framedone_handler)
+		omap_crtc->framedone_handler(omap_crtc->framedone_handler_data);
+
+	__omap_irq_unregister(dev, &omap_crtc->framedone_irq);
+
+	clear_bit(crtc_pending, &omap_crtc->state);
+	wake_up(&omap_crtc->pending_wait);
+}
+
+void omap_crtc_flush(struct drm_crtc *crtc,
+		int x, int y, int w, int h)
+{
+	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+
+	if (!omap_crtc->manually_updated)
+		return;
+
+	if (!test_bit(crtc_enabled, &omap_crtc->state))
+		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->mgr->output->dst;
+	struct omap_dss_driver *dssdrv = dssdev->driver;
+	int ret;
+
+	if (!dssdrv || !dssdrv->update)
+		return;
+
+	if (!test_bit(crtc_enabled, &omap_crtc->state))
+		return;
+
+	if (test_and_set_bit(crtc_pending, &omap_crtc->state))
+		return;
+
+	if (dssdrv->sync)
+		dssdrv->sync(dssdev);
+
+	ret = dssdrv->update(dssdev, 0, 0, omap_crtc->timings.x_res, omap_crtc->timings.y_res);
+	if (ret < 0) {
+		clear_bit(crtc_pending, &omap_crtc->state);
+		wake_up(&omap_crtc->pending_wait);
+	}
+}
+
 /* -----------------------------------------------------------------------------
  * CRTC Functions
  */
@@ -407,7 +481,7 @@ static void omap_crtc_enable(struct drm_crtc *crtc)
 	struct omap_dss_device *display = omap_crtc->mgr->output->dst;
 	struct drm_device *dev = crtc->dev;
 
-	DBG("%s", omap_crtc->name);
+	dev_dbg(dev->dev, "enable crtc %s", omap_crtc->name);
 
 	/* manual updated display will not trigger vsync irq */
 	/* omap_crtc->manually_updated is not yet set */
@@ -427,8 +501,14 @@ static void omap_crtc_enable(struct drm_crtc *crtc)
 static void omap_crtc_disable(struct drm_crtc *crtc)
 {
 	struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
+	struct drm_device *dev = crtc->dev;
 
-	DBG("%s", omap_crtc->name);
+	dev_dbg(dev->dev, "disable crtc %s", omap_crtc->name);
+
+	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);
 }
@@ -571,6 +651,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
 
 	init_waitqueue_head(&omap_crtc->pending_wait);
 
+	INIT_DELAYED_WORK(&omap_crtc->update_work, omap_crtc_manual_display_update);
+
 	omap_crtc->state = 0;
 
 	omap_crtc->channel = channel;
@@ -579,6 +661,9 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
 	omap_crtc->vblank_irq.irqmask = pipe2vbl(crtc);
 	omap_crtc->vblank_irq.irq = omap_crtc_vblank_irq;
 
+	omap_crtc->framedone_irq.irqmask = dispc_mgr_get_framedone_irq(omap_crtc->channel);
+	omap_crtc->framedone_irq.irq = omap_crtc_framedone_irq;
+
 	omap_crtc->error_irq.irqmask =
 			dispc_mgr_get_sync_lost_irq(channel);
 	omap_crtc->error_irq.irq = omap_crtc_error_irq;
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 3ab4919aff4b..e08f4ef1bf3c 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -174,6 +174,8 @@ struct drm_encoder *omap_connector_attached_encoder(
 bool omap_connector_get_hdmi_mode(struct drm_connector *connector);
 void omap_connector_flush(struct drm_connector *connector,
 		int x, int y, int w, int h);
+void omap_crtc_flush(struct drm_crtc *crtc,
+		int x, int y, int w, int h);
 
 void copy_timings_omap_to_drm(struct drm_display_mode *mode,
 		struct omap_video_timings *timings);
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353238 — [PATCH 11/23] include: video: omapdss: provide fifo threshold methods

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 11/23] include: video: omapdss: provide fifo threshold methods
Message-ID<rat9j-3s9-77@gated-at.bofh.it>
In reply to#1353227
The FIFO thresholds must be configured by omapdrm for
manually updated DSI panels due to a hardware bug.

Signed-off-By: Sebastian Reichel <sre@kernel.org>
---
 include/video/omapdss.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 9bde65b79220..f6cdd809ae5c 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -935,6 +935,12 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
 		bool replication, const struct omap_video_timings *mgr_timings,
 		bool mem_to_mem);
 
+void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
+		u32 *fifo_low, u32 *fifo_high, bool use_fifomerge,
+		bool manual_update);
+void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high);
+
+
 int omapdss_compat_init(void);
 void omapdss_compat_uninit(void);
 
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353239 — [PATCH 08/23] drm: omapdrm: crtc: add enabled bit to state

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 08/23] drm: omapdrm: crtc: add enabled bit to state
Message-ID<rat9j-3s9-79@gated-at.bofh.it>
In reply to#1353227
Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/omap_crtc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 5ef27664bcfa..78ef9773cca1 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -207,6 +207,8 @@ static int omap_crtc_dss_enable(struct omap_overlay_manager *mgr)
 			&omap_crtc->timings);
 	omap_crtc_set_enabled(&omap_crtc->base, true);
 
+	set_bit(crtc_enabled, &omap_crtc->state);
+
 	return 0;
 }
 
@@ -214,6 +216,8 @@ static void omap_crtc_dss_disable(struct omap_overlay_manager *mgr)
 {
 	struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
 
+	clear_bit(crtc_enabled, &omap_crtc->state);
+
 	omap_crtc_set_enabled(&omap_crtc->base, false);
 }
 
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353240 — [PATCH 16/23] drm: omapdrm: update manual displays on dirty ioctl

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 16/23] drm: omapdrm: update manual displays on dirty ioctl
Message-ID<rat9j-3s9-81@gated-at.bofh.it>
In reply to#1353227
Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/omap_connector.c | 12 ------------
 drivers/gpu/drm/omapdrm/omap_drv.h       |  2 --
 drivers/gpu/drm/omapdrm/omap_fb.c        |  2 +-
 3 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
index 8db36aa4bd00..83f2a9177c14 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.c
+++ b/drivers/gpu/drm/omapdrm/omap_connector.c
@@ -275,18 +275,6 @@ static const struct drm_connector_helper_funcs omap_connector_helper_funcs = {
 	.best_encoder = omap_connector_attached_encoder,
 };
 
-/* flush an area of the framebuffer (in case of manual update display that
- * is not automatically flushed)
- */
-void omap_connector_flush(struct drm_connector *connector,
-		int x, int y, int w, int h)
-{
-	struct omap_connector *omap_connector = to_omap_connector(connector);
-
-	/* TODO: enable when supported in dss */
-	VERB("%s: %d,%d, %dx%d", omap_connector->dssdev->name, x, y, w, h);
-}
-
 /* initialize connector */
 struct drm_connector *omap_connector_init(struct drm_device *dev,
 		int connector_type, struct omap_dss_device *dssdev,
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index e08f4ef1bf3c..e536a8dbb51b 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -172,8 +172,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);
-void omap_connector_flush(struct drm_connector *connector,
-		int x, int y, int w, int h);
 void omap_crtc_flush(struct drm_crtc *crtc,
 		int x, int y, int w, int h);
 
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index b51d2243f356..ee61a34bab26 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -378,7 +378,7 @@ void omap_framebuffer_flush(struct drm_framebuffer *fb,
 			int cw = w + (x - crtc->x) - cx;
 			int ch = h + (y - crtc->y) - cy;
 
-			omap_connector_flush(connector, cx, cy, cw, ch);
+			omap_crtc_flush(crtc, cx, cy, cw, ch);
 		}
 	}
 }
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353242 — [PATCH 18/23] drm: omapdrm: panel-dsi-cm: use threaded irq handler

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 18:00 +0100
Subject[PATCH 18/23] drm: omapdrm: panel-dsi-cm: use threaded irq handler
Message-ID<rat9j-3s9-83@gated-at.bofh.it>
In reply to#1353227
Use threaded irq handler for the tearing effect gpio,
since it updates the display content, which requires
too much time for a fastpath irq.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 768e92d1ec8b..8316b6c2d8aa 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -1317,9 +1317,9 @@ static int dsicm_probe(struct platform_device *pdev)
 			return r;
 		}
 
-		r = devm_request_irq(dev, gpio_to_irq(ddata->ext_te_gpio),
-				dsicm_te_isr,
-				IRQF_TRIGGER_RISING,
+		r = devm_request_threaded_irq(dev, gpio_to_irq(ddata->ext_te_gpio),
+				NULL, dsicm_te_isr,
+				IRQF_TRIGGER_RISING | IRQF_ONESHOT,
 				"taal vsync", ddata);
 
 		if (r) {
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1353304

FromAaro Koskinen <aaro.koskinen@iki.fi>
Date2016-03-08 19:40 +0100
Message-ID<rauI2-4Kx-7@gated-at.bofh.it>
In reply to#1353227
Hi,

On Tue, Mar 08, 2016 at 05:39:32PM +0100, Sebastian Reichel wrote:
> This series adds support for the Nokia N950 display.
> Since the panel is using DSI command mode, it involves
> adding support for manually updated displays to
> omapdrm.

Works OK, but the picture seems to be upside down? Also shouldn't the
default orientation be landscape?

A.

[toc] | [prev] | [next] | [standalone]


#1353393

FromSebastian Reichel <sre@kernel.org>
Date2016-03-08 21:50 +0100
Message-ID<rawJQ-659-25@gated-at.bofh.it>
In reply to#1353304

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Tue, Mar 08, 2016 at 08:39:08PM +0200, Aaro Koskinen wrote:
> On Tue, Mar 08, 2016 at 05:39:32PM +0100, Sebastian Reichel wrote:
> > This series adds support for the Nokia N950 display.
> > Since the panel is using DSI command mode, it involves
> > adding support for manually updated displays to
> > omapdrm.
> 
> Works OK, but the picture seems to be upside down?

vertical, upside down is the native panel orientation.

> Also shouldn't the default orientation be landscape?

The N950 vendor kernel contains some code adding DSI
rotation support with half-frame update mechnism to
avoid tearing. It's quite complex and as far as I
understand it also error-prone. Tomi knows more about
that.

I have a simpler patch without the half-frame update
stuff, which works fine for me. I didn't notice any
tearing, but I haven't done any really fast image
updating. Also omapdrm has rotation support using
the DSS hardware, which also seems to work ok. I'm
still checking out what method is most suitable for
mainline.

But yeah, we probably want to change the default
rotation. Especially since touchscreen should have
the same default rotation as the screen. (TS is
horizontal, correct orientation for keyboard usage)

I will have a look at the (default-)rotation when
basic panel support has been ACKed.

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#1353877

FromTomi Valkeinen <tomi.valkeinen@ti.com>
Date2016-03-09 08:20 +0100
Message-ID<raGzw-4yV-7@gated-at.bofh.it>
In reply to#1353393

[Multipart message — attachments visible in raw view] — view raw

On 08/03/16 22:45, Sebastian Reichel wrote:
> Hi,
> 
> On Tue, Mar 08, 2016 at 08:39:08PM +0200, Aaro Koskinen wrote:
>> On Tue, Mar 08, 2016 at 05:39:32PM +0100, Sebastian Reichel wrote:
>>> This series adds support for the Nokia N950 display.
>>> Since the panel is using DSI command mode, it involves
>>> adding support for manually updated displays to
>>> omapdrm.
>>
>> Works OK, but the picture seems to be upside down?
> 
> vertical, upside down is the native panel orientation.
> 
>> Also shouldn't the default orientation be landscape?
> 
> The N950 vendor kernel contains some code adding DSI
> rotation support with half-frame update mechnism to
> avoid tearing. It's quite complex and as far as I
> understand it also error-prone. Tomi knows more about
> that.

It needs support in both the panel driver and the dispc driver, and is
quite intrusive. Or, at least it was with omapfb, I can't say if it
could somehow be implemented more cleanly with omapdrm. It's definitely
not something I will be working on.

> I have a simpler patch without the half-frame update
> stuff, which works fine for me. I didn't notice any
> tearing, but I haven't done any really fast image

You will see diagonal tearing with that rotation. But maybe that's not
an issue. I think it's the best option available if landscape mode is
required.

> updating. Also omapdrm has rotation support using
> the DSS hardware, which also seems to work ok. I'm
> still checking out what method is most suitable for
> mainline.

Hmm there's only so called DMA rotation, which shouldn't work. It's only
meant for really small displays, when the framebuffer is in SRAM. So I'm
a bit baffled as to what rotation you are using and why is it working =).

There is also VRFB rotation on omap3, but that's not supported by omapdrm.

> But yeah, we probably want to change the default
> rotation. Especially since touchscreen should have
> the same default rotation as the screen. (TS is
> horizontal, correct orientation for keyboard usage)

I don't know much about touchscreens, but I'm guessing that it's easier
to rotate the coordinates from touch than achieve good panel rotation on
N950.

 Tomi

[toc] | [prev] | [next] | [standalone]


#1354178

FromSebastian Reichel <sre@kernel.org>
Date2016-03-09 15:40 +0100
Message-ID<raNrl-Hp-23@gated-at.bofh.it>
In reply to#1353877

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Wed, Mar 09, 2016 at 09:10:28AM +0200, Tomi Valkeinen wrote:
> Hmm there's only so called DMA rotation, which shouldn't work. It's only
> meant for really small displays, when the framebuffer is in SRAM. So I'm
> a bit baffled as to what rotation you are using and why is it working =).
>
> There is also VRFB rotation on omap3, but that's not supported by omapdrm.

yeah, I was also wondering why it's working. I just did "xrandr -o
left" and my display was rotated unexpectedly :) I have not yet
checked what happens in that case.

> > But yeah, we probably want to change the default
> > rotation. Especially since touchscreen should have
> > the same default rotation as the screen. (TS is
> > horizontal, correct orientation for keyboard usage)
> 
> I don't know much about touchscreens, but I'm guessing that it's easier
> to rotate the coordinates from touch than achieve good panel rotation on
> N950.

Yes, rotating the TS coordinates is simpler than panel rotation,
since much less information must be rotated. I just mentioned
TS, since the _default_ orientation should be the same for both.
In the end both must be rotated at the same time (and thus both
must support rotation).

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#1354455

FromAaro Koskinen <aaro.koskinen@iki.fi>
Date2016-03-09 22:10 +0100
Message-ID<raTwL-578-17@gated-at.bofh.it>
In reply to#1353393
Hi,

On Tue, Mar 08, 2016 at 09:45:11PM +0100, Sebastian Reichel wrote:
> On Tue, Mar 08, 2016 at 08:39:08PM +0200, Aaro Koskinen wrote:
> > On Tue, Mar 08, 2016 at 05:39:32PM +0100, Sebastian Reichel wrote:
> > > This series adds support for the Nokia N950 display.
> > > Since the panel is using DSI command mode, it involves
> > > adding support for manually updated displays to
> > > omapdrm.
> > 
> > Works OK, but the picture seems to be upside down?
> 
> vertical, upside down is the native panel orientation.
> 
> > Also shouldn't the default orientation be landscape?
> 
> The N950 vendor kernel contains some code adding DSI
> rotation support with half-frame update mechnism to
> avoid tearing. It's quite complex and as far as I
> understand it also error-prone. Tomi knows more about
> that.

Ok, my comment was actually about fbcon (which doesn't need driver support
for rotation). But I guess there is no way to tell it what the default
should be, instead user needs to pass the correct rotation manually...

Anyway, for this series:

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>

A.

[toc] | [prev] | [next] | [standalone]


#1354247

FromTomi Valkeinen <tomi.valkeinen@ti.com>
Date2016-03-09 17:30 +0100
Message-ID<raP9L-1Xm-1@gated-at.bofh.it>
In reply to#1353227

[Multipart message — attachments visible in raw view] — view raw

On 09/03/16 18:19, Emil Velikov wrote:
> Hi Sebastian,
> 
> On 8 March 2016 at 16:39, Sebastian Reichel <sre@kernel.org> wrote:
> 
>>  arch/arm/boot/dts/omap3-n950-n9.dtsi            |  72 +++++++++
>>  arch/arm/boot/dts/omap3-n950.dts                |  71 +++++++++
> Just a friendly reminder that updating these and one will have to keep
> the driver backwards compatible forever.
> 
> Tomi, has been in the process of removing all the unneeded cruft,
> although omapdrm it is still using the custom panel, dsi and other
> code as opposed to the ones provided by DRM. As he gets to reusing
> those he might have some fun keeping things compatible.
> 
> It's up-to Tomi to decide, just thought I point it out.

I haven't looked at this series yet, but all the omap display DT
bindings have been designed to be correct, and while omapdrm will
receive lots of changes, I don't see any need to touch anything in the
DT side.

Of course, if we will be using some existing common driver which
implements bindings in some other way, it'll cause some complexities...

 Tomi

[toc] | [prev] | [next] | [standalone]


#1354275

FromEmil Velikov <emil.l.velikov@gmail.com>
Date2016-03-09 18:00 +0100
Message-ID<raPCP-2eF-23@gated-at.bofh.it>
In reply to#1354247
On 9 March 2016 at 16:24, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> On 09/03/16 18:19, Emil Velikov wrote:
>> Hi Sebastian,
>>
>> On 8 March 2016 at 16:39, Sebastian Reichel <sre@kernel.org> wrote:
>>
>>>  arch/arm/boot/dts/omap3-n950-n9.dtsi            |  72 +++++++++
>>>  arch/arm/boot/dts/omap3-n950.dts                |  71 +++++++++
>> Just a friendly reminder that updating these and one will have to keep
>> the driver backwards compatible forever.
>>
>> Tomi, has been in the process of removing all the unneeded cruft,
>> although omapdrm it is still using the custom panel, dsi and other
>> code as opposed to the ones provided by DRM. As he gets to reusing
>> those he might have some fun keeping things compatible.
>>
>> It's up-to Tomi to decide, just thought I point it out.
>
> I haven't looked at this series yet, but all the omap display DT
> bindings have been designed to be correct, and while omapdrm will
> receive lots of changes, I don't see any need to touch anything in the
> DT side.
>
> Of course, if we will be using some existing common driver which
> implements bindings in some other way, it'll cause some complexities...
>
I'm leaning that you want to use the existing the DRM_PANEL driver
(gpu/drm/drm_panel.c). It has enough infrastructure to support 25+
'simple' panels (gpu/drm/panel/panel-simple.c) plus 5+ more complex
ones (gpu/drm/panel/).

From a quick look the binding, they do differ although do take a look
for yourself:
Documentation/devicetree/bindings/display/panel/{display-timing,panel-dpi,panel-dsi-cm,simple-panel}.txt

Regards,
Emil

[toc] | [prev] | [next] | [standalone]


#1354248

FromEmil Velikov <emil.l.velikov@gmail.com>
Date2016-03-09 17:30 +0100
Message-ID<raP9L-1Xm-3@gated-at.bofh.it>
In reply to#1353227
Hi Sebastian,

On 8 March 2016 at 16:39, Sebastian Reichel <sre@kernel.org> wrote:

>  arch/arm/boot/dts/omap3-n950-n9.dtsi            |  72 +++++++++
>  arch/arm/boot/dts/omap3-n950.dts                |  71 +++++++++
Just a friendly reminder that updating these and one will have to keep
the driver backwards compatible forever.

Tomi, has been in the process of removing all the unneeded cruft,
although omapdrm it is still using the custom panel, dsi and other
code as opposed to the ones provided by DRM. As he gets to reusing
those he might have some fun keeping things compatible.

It's up-to Tomi to decide, just thought I point it out.

Regards,
Emil

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web