All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, Eric Anholt <eric@anholt.net>,
	Dave Emett <david.emett@broadcom.com>
Subject: [PATCH 3/3] drm/v3d: Fix prime imports of buffers from other drivers.
Date: Wed, 28 Nov 2018 15:09:27 -0800	[thread overview]
Message-ID: <20181128230927.10951-3-eric@anholt.net> (raw)
In-Reply-To: <20181128230927.10951-1-eric@anholt.net>

v3d_bo_get_pages() checks this to decide to map the imported buffer
instead of the backing shmem file.  The caller was about to set this
value anyway, and there's no error path in between.  Ideally we
wouldn't even allocate the shmem file for our imports, but that's a
more invasive fix.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")
Cc: Dave Emett <david.emett@broadcom.com>
---

I've been sitting on this one because I don't like it and was hoping
the shmem library would pan out.  This is a useful patch for now,
though.

 drivers/gpu/drm/v3d/v3d_bo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c
index 54d96518a131..a08766d39eab 100644
--- a/drivers/gpu/drm/v3d/v3d_bo.c
+++ b/drivers/gpu/drm/v3d/v3d_bo.c
@@ -293,6 +293,7 @@ v3d_prime_import_sg_table(struct drm_device *dev,
 	bo->resv = attach->dmabuf->resv;
 
 	bo->sgt = sgt;
+	obj->import_attach = attach;
 	v3d_bo_get_pages(bo);
 
 	v3d_mmu_insert_ptes(bo);
-- 
2.20.0.rc1


  parent reply	other threads:[~2018-11-28 23:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28 23:09 [PATCH 1/3] drm/v3d: Add support for submitting jobs to the TFU Eric Anholt
2018-11-28 23:09 ` [PATCH 2/3] drm/v3d: Drop the "dev" argument to lock/unlock of BO reservations Eric Anholt
2018-11-29  9:36   ` Daniel Vetter
2018-11-28 23:09 ` Eric Anholt [this message]
2018-11-29  9:38   ` [PATCH 3/3] drm/v3d: Fix prime imports of buffers from other drivers Daniel Vetter
2018-11-29 17:37   ` Dave Emett
2018-11-29 15:20 ` [PATCH 1/3] drm/v3d: Add support for submitting jobs to the TFU Dave Emett

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=20181128230927.10951-3-eric@anholt.net \
    --to=eric@anholt.net \
    --cc=david.emett@broadcom.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.