All of lore.kernel.org
 help / color / mirror / Atom feed
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/7 v3] drm/pl111: Add optional variant display en/disable callbacks
Date: Thu,  7 Sep 2017 14:49:24 +0200	[thread overview]
Message-ID: <20170907124925.13805-6-linus.walleij@linaro.org> (raw)
In-Reply-To: <20170907124925.13805-1-linus.walleij@linaro.org>

The silcon and components around the PL111 may require some
variants to perform special set-up of the display. Add two
callbacks to manage this.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v2->v3:
- Rebase on DRM-TIP
ChangeLog v1->v2:
- Rebase on other display driver changes.
---
 drivers/gpu/drm/pl111/pl111_display.c | 6 ++++++
 drivers/gpu/drm/pl111/pl111_drm.h     | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index b7df9f5df881..68847a074331 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -208,6 +208,9 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
 	 */
 	msleep(20);
 
+	if (priv->variant_display_enable)
+		priv->variant_display_enable(drm, fb->format->format);
+
 	/* Power Up */
 	cntl |= CNTL_LCDPWR;
 	writel(cntl, priv->regs + priv->ctrl);
@@ -237,6 +240,9 @@ void pl111_display_disable(struct drm_simple_display_pipe *pipe)
 	 */
 	msleep(20);
 
+	if (priv->variant_display_disable)
+		priv->variant_display_disable(drm);
+
 	/* Disable */
 	writel(0, priv->regs + priv->ctrl);
 
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index b380a7b4fb58..440f53ebee8c 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -26,6 +26,7 @@
 #include <drm/drm_panel.h>
 #include <drm/drm_bridge.h>
 #include <linux/clk-provider.h>
+#include <linux/interrupt.h>
 
 #define CLCD_IRQ_NEXTBASE_UPDATE BIT(2)
 
@@ -66,6 +67,8 @@ struct pl111_drm_dev_private {
 	 */
 	spinlock_t tim2_lock;
 	const struct pl111_variant_data *variant;
+	void (*variant_display_enable) (struct drm_device *drm, u32 format);
+	void (*variant_display_disable) (struct drm_device *drm);
 };
 
 int pl111_display_init(struct drm_device *dev);
-- 
2.13.5

WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org>
To: Daniel Vetter <daniel.vetter@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Sean Paul <seanpaul@chromium.org>, Eric Anholt <eric@anholt.net>
Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 6/7 v3] drm/pl111: Add optional variant display en/disable callbacks
Date: Thu,  7 Sep 2017 14:49:24 +0200	[thread overview]
Message-ID: <20170907124925.13805-6-linus.walleij@linaro.org> (raw)
In-Reply-To: <20170907124925.13805-1-linus.walleij@linaro.org>

The silcon and components around the PL111 may require some
variants to perform special set-up of the display. Add two
callbacks to manage this.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v2->v3:
- Rebase on DRM-TIP
ChangeLog v1->v2:
- Rebase on other display driver changes.
---
 drivers/gpu/drm/pl111/pl111_display.c | 6 ++++++
 drivers/gpu/drm/pl111/pl111_drm.h     | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index b7df9f5df881..68847a074331 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -208,6 +208,9 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
 	 */
 	msleep(20);
 
+	if (priv->variant_display_enable)
+		priv->variant_display_enable(drm, fb->format->format);
+
 	/* Power Up */
 	cntl |= CNTL_LCDPWR;
 	writel(cntl, priv->regs + priv->ctrl);
@@ -237,6 +240,9 @@ void pl111_display_disable(struct drm_simple_display_pipe *pipe)
 	 */
 	msleep(20);
 
+	if (priv->variant_display_disable)
+		priv->variant_display_disable(drm);
+
 	/* Disable */
 	writel(0, priv->regs + priv->ctrl);
 
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index b380a7b4fb58..440f53ebee8c 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -26,6 +26,7 @@
 #include <drm/drm_panel.h>
 #include <drm/drm_bridge.h>
 #include <linux/clk-provider.h>
+#include <linux/interrupt.h>
 
 #define CLCD_IRQ_NEXTBASE_UPDATE BIT(2)
 
@@ -66,6 +67,8 @@ struct pl111_drm_dev_private {
 	 */
 	spinlock_t tim2_lock;
 	const struct pl111_variant_data *variant;
+	void (*variant_display_enable) (struct drm_device *drm, u32 format);
+	void (*variant_display_disable) (struct drm_device *drm);
 };
 
 int pl111_display_init(struct drm_device *dev);
-- 
2.13.5

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

  parent reply	other threads:[~2017-09-07 12:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 12:49 [PATCH 1/7 v3] drm/pl111: Cleanup local header file Linus Walleij
2017-09-07 12:49 ` Linus Walleij
2017-09-07 12:49 ` [PATCH 2/7 v3] drm/pl111: Add all registers to debugfs Linus Walleij
2017-09-07 12:49   ` Linus Walleij
2017-09-07 12:49 ` [PATCH 3/7 v3] drm/pl111: Replace custom connector with panel bridge Linus Walleij
2017-09-07 12:49   ` Linus Walleij
2017-09-07 17:09   ` Eric Anholt
2017-09-07 17:09     ` Eric Anholt
2017-09-07 12:49 ` [PATCH 4/7 v3] drm/pl111: Enable PL110 variant Linus Walleij
2017-09-07 12:49   ` Linus Walleij
2017-09-07 12:49 ` [PATCH 5/7 v3] drm/pl111: Insert delay before powering up PL11x Linus Walleij
2017-09-07 12:49   ` Linus Walleij
2017-09-07 12:49 ` Linus Walleij [this message]
2017-09-07 12:49   ` [PATCH 6/7 v3] drm/pl111: Add optional variant display en/disable callbacks Linus Walleij
2017-09-07 12:49 ` [PATCH 7/7 v3] drm/pl111: Add handling of Versatile platforms Linus Walleij
2017-09-07 12:49   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170907124925.13805-6-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.