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


Groups > linux.kernel > #1671946

[PATCH 1/4] drm/vc4: Hook up plane prepare_fb to lookup dma-buf reservations.

From Eric Anholt <eric@anholt.net>
Newsgroups linux.kernel
Subject [PATCH 1/4] drm/vc4: Hook up plane prepare_fb to lookup dma-buf reservations.
Date 2017-06-21 21:00 +0200
Message-ID <tUT17-1FF-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This way drm_atomic_helper_wait_for_fences() will actually do
something.  The vc4_seqno_cb has been doing the fence waits on V3D
manually, so far.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index fa6809d8b0fe..8853e9a4f005 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -759,9 +759,26 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb)
 	vc4_state->dlist[vc4_state->ptr0_offset] = addr;
 }
 
+static int vc4_prepare_fb(struct drm_plane *plane,
+			  struct drm_plane_state *state)
+{
+	struct vc4_bo *bo;
+	struct dma_fence *fence;
+
+	if ((plane->state->fb == state->fb) || !state->fb)
+		return 0;
+
+	bo = to_vc4_bo(&drm_fb_cma_get_gem_obj(state->fb, 0)->base);
+	fence = reservation_object_get_excl_rcu(bo->resv);
+	drm_atomic_set_fence_for_plane(state, fence);
+
+	return 0;
+}
+
 static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = {
 	.atomic_check = vc4_plane_atomic_check,
 	.atomic_update = vc4_plane_atomic_update,
+	.prepare_fb = vc4_prepare_fb,
 };
 
 static void vc4_plane_destroy(struct drm_plane *plane)
-- 
2.11.0

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


Thread

[PATCH 1/4] drm/vc4: Hook up plane prepare_fb to lookup dma-buf reservations. Eric Anholt <eric@anholt.net> - 2017-06-21 21:00 +0200
  [PATCH 3/4] drm/vc4: Use the atomic state's commit workqueue. Eric Anholt <eric@anholt.net> - 2017-06-21 21:00 +0200
    Re: [PATCH 3/4] drm/vc4: Use the atomic state's commit workqueue. Daniel Vetter <daniel@ffwll.ch> - 2017-06-22 09:20 +0200
      Re: [PATCH 3/4] drm/vc4: Use the atomic state's commit workqueue. Eric Anholt <eric@anholt.net> - 2017-06-22 20:30 +0200
    Re: [PATCH 3/4] drm/vc4: Use the atomic state's commit workqueue. Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-06-22 10:10 +0200
  [PATCH 2/4] drm/vc4: Wait for fences interruptibly in blocking mode. Eric Anholt <eric@anholt.net> - 2017-06-21 21:00 +0200
    Re: [PATCH 2/4] drm/vc4: Wait for fences interruptibly in blocking  mode. Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-06-22 09:30 +0200
  [PATCH 4/4] drm/vc4: Remove dead vc4_event_pending(). Eric Anholt <eric@anholt.net> - 2017-06-21 21:00 +0200
    Re: [PATCH 4/4] drm/vc4: Remove dead vc4_event_pending(). Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-06-21 22:00 +0200
  Re: [PATCH 1/4] drm/vc4: Hook up plane prepare_fb to lookup dma-buf  reservations. Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-06-22 10:10 +0200

csiph-web