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


Groups > linux.kernel > #1686591

[PATCH 3/4] drm/sun4i: engine: Add commit_poll function

From Maxime Ripard <maxime.ripard@free-electrons.com>
Newsgroups linux.kernel
Subject [PATCH 3/4] drm/sun4i: engine: Add commit_poll function
Date 2017-07-13 16:50 +0200
Message-ID <u2NBf-6SY-9@gated-at.bofh.it> (permalink)
References <u2NBf-6SY-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On the earlier Allwinner chips, with the first iteration of the display
engine, the backend commit bit needs to be polled before making any
register access to the backend.

Add an operation for that, that will be called in atomic_begin in order to
be sure to have that bit cleared before we do any modifications.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/gpu/drm/sun4i/sun4i_crtc.c   |  2 ++
 drivers/gpu/drm/sun4i/sunxi_engine.h | 14 ++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c
index f8c70439d1e2..2eba1d8639d8 100644
--- a/drivers/gpu/drm/sun4i/sun4i_crtc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c
@@ -45,6 +45,8 @@ static void sun4i_crtc_atomic_begin(struct drm_crtc *crtc,
 		spin_unlock_irqrestore(&dev->event_lock, flags);
 		crtc->state->event = NULL;
 	 }
+
+	WARN_ON(sunxi_engine_commit_poll(engine));
 }
 
 static void sun4i_crtc_atomic_flush(struct drm_crtc *crtc,
diff --git a/drivers/gpu/drm/sun4i/sunxi_engine.h b/drivers/gpu/drm/sun4i/sunxi_engine.h
index 4cb70ae65c79..6618e182613c 100644
--- a/drivers/gpu/drm/sun4i/sunxi_engine.h
+++ b/drivers/gpu/drm/sun4i/sunxi_engine.h
@@ -17,6 +17,7 @@ struct sunxi_engine;
 
 struct sunxi_engine_ops {
 	void (*commit)(struct sunxi_engine *engine);
+	int (*commit_poll)(struct sunxi_engine *engine);
 	struct drm_plane **(*layers_init)(struct drm_device *drm,
 					  struct sunxi_engine *engine);
 
@@ -55,6 +56,19 @@ sunxi_engine_commit(struct sunxi_engine *engine)
 }
 
 /**
+ * sunxi_engine_commit_poll() - wait for all changes to be committed
+ * @engine:	pointer to the engine
+ */
+static inline int
+sunxi_engine_commit_poll(struct sunxi_engine *engine)
+{
+	if (engine->ops && engine->ops->commit_poll)
+		return engine->ops->commit_poll(engine);
+
+	return 0;
+}
+
+/**
  * sunxi_engine_layers_init() - Create planes (layers) for the engine
  * @drm:	pointer to the drm_device for which planes will be created
  * @engine:	pointer to the engine
-- 
git-series 0.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] drm/sun4i: Fix a register access bug Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-13 16:50 +0200
  [PATCH 4/4] drm/sun4i: make sure we don't have a commit pending Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-13 16:50 +0200
    Re: [PATCH 4/4] drm/sun4i: make sure we don't have a commit pending Chen-Yu Tsai <wens@csie.org> - 2017-07-14 11:00 +0200
      Re: [PATCH 4/4] drm/sun4i: make sure we don't have a commit pending Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-17 09:00 +0200
        Re: [PATCH 4/4] drm/sun4i: make sure we don't have a commit pending Chen-Yu Tsai <wens@csie.org> - 2017-07-17 09:00 +0200
          Re: [PATCH 4/4] drm/sun4i: make sure we don't have a commit pending Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-18 09:10 +0200
            Re: [PATCH 4/4] drm/sun4i: make sure we don't have a commit pending Daniel Vetter <daniel@ffwll.ch> - 2017-07-18 09:40 +0200
  [PATCH 3/4] drm/sun4i: engine: Add commit_poll function Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-13 16:50 +0200
  [PATCH 2/4] drm/sun4i: Use the runtime_pm commit_tail variant Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-13 16:50 +0200
  [PATCH 1/4] drm/atomic: implement drm_atomic_helper_commit_tail for runtime_pm users Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-13 16:50 +0200
    Re: [PATCH 1/4] drm/atomic: implement drm_atomic_helper_commit_tail  for runtime_pm users Daniel Vetter <daniel@ffwll.ch> - 2017-07-13 21:40 +0200
    Re: [PATCH 1/4] drm/atomic: implement drm_atomic_helper_commit_tail for runtime_pm users Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2017-07-14 01:50 +0200
      Re: [PATCH 1/4] drm/atomic: implement drm_atomic_helper_commit_tail  for runtime_pm users Daniel Vetter <daniel@ffwll.ch> - 2017-07-14 07:40 +0200
      Re: [PATCH 1/4] drm/atomic: implement drm_atomic_helper_commit_tail  for runtime_pm users Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-07-18 09:10 +0200

csiph-web