dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
To: tomba@kernel.org, sumit.semwal@linaro.org, christian.koenig@amd.com
Cc: philipp@uvos.xyz, Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>,
	airlied@linux.ie, merlijn@wizzup.org,
	openpvrsgx-devgroup@letux.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org,
	linux-media@vger.kernel.org
Subject: [PATCH] drm: omapdrm: Fix implicit dma_buf fencing
Date: Wed,  5 Jan 2022 17:36:58 +0200	[thread overview]
Message-ID: <1641397018-29872-1-git-send-email-ivo.g.dimitrov.75@gmail.com> (raw)

Currently omapdrm driver does not initialize dma_buf_export_info resv
member, which leads to a new dma_resv being allocated and attached to
the exported dma_buf. This leads to the issue that fences created on
dma_buf objects imported by other drivers are ignored by omapdrm, as only
fences in gem object resv are waited on. This leads to various issues like
displaying incomplete frames.

Fix that by initializing dma_buf resv to the resv of the gem object being
exported.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
index f1f93cabb61e..a111e5c91925 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
@@ -88,6 +88,7 @@ struct dma_buf *omap_gem_prime_export(struct drm_gem_object *obj, int flags)
 	exp_info.size = omap_gem_mmap_size(obj);
 	exp_info.flags = flags;
 	exp_info.priv = obj;
+	exp_info.resv = obj->resv;
 
 	return drm_gem_dmabuf_export(obj->dev, &exp_info);
 }
-- 
2.20.1


             reply	other threads:[~2022-01-06  8:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 15:36 Ivaylo Dimitrov [this message]
2022-01-06  9:45 ` [Openpvrsgx-devgroup] [PATCH] drm: omapdrm: Fix implicit dma_buf fencing Tony Lindgren
2022-01-06 12:51   ` Merlijn Wajer
2022-01-06 13:43 ` Tomi Valkeinen
2022-01-06 16:26   ` Ivaylo Dimitrov
2022-01-06 17:48     ` [Openpvrsgx-devgroup] " H. Nikolaus Schaller

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=1641397018-29872-1-git-send-email-ivo.g.dimitrov.75@gmail.com \
    --to=ivo.g.dimitrov.75@gmail.com \
    --cc=airlied@linux.ie \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=openpvrsgx-devgroup@letux.org \
    --cc=philipp@uvos.xyz \
    --cc=sumit.semwal@linaro.org \
    --cc=tomba@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).