All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: dri-devel@lists.freedesktop.org,
	Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: linux-kernel@vger.kernel.org, Eric Anholt <eric@anholt.net>
Subject: [PATCH 1/4] drm/vc4: Hook up plane prepare_fb to lookup dma-buf reservations.
Date: Wed, 21 Jun 2017 11:49:59 -0700	[thread overview]
Message-ID: <20170621185002.28563-1-eric@anholt.net> (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

             reply	other threads:[~2017-06-21 18:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21 18:49 Eric Anholt [this message]
2017-06-21 18:50 ` [PATCH 2/4] drm/vc4: Wait for fences interruptibly in blocking mode Eric Anholt
2017-06-21 18:50   ` Eric Anholt
2017-06-22  7:22   ` Boris Brezillon
2017-06-22  7:22     ` Boris Brezillon
2017-06-21 18:50 ` [PATCH 3/4] drm/vc4: Use the atomic state's commit workqueue Eric Anholt
2017-06-21 18:50   ` Eric Anholt
2017-06-22  7:16   ` Daniel Vetter
2017-06-22  7:16     ` Daniel Vetter
2017-06-22 18:27     ` Eric Anholt
2017-06-22  8:06   ` Boris Brezillon
2017-06-22  8:06     ` Boris Brezillon
2017-06-21 18:50 ` [PATCH 4/4] drm/vc4: Remove dead vc4_event_pending() Eric Anholt
2017-06-21 18:50   ` Eric Anholt
2017-06-21 19:54   ` Boris Brezillon
2017-06-21 19:54     ` Boris Brezillon
2017-06-22  8:03 ` [PATCH 1/4] drm/vc4: Hook up plane prepare_fb to lookup dma-buf reservations Boris Brezillon
2017-06-22  8:03   ` Boris Brezillon

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=20170621185002.28563-1-eric@anholt.net \
    --to=eric@anholt.net \
    --cc=boris.brezillon@free-electrons.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.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.