linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@redhat.com, airlied@linux.ie, daniel@ffwll.ch,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	noralf@tronnes.org, drawat.floss@gmail.com, kraxel@redhat.com,
	hdegoede@redhat.com, sean@poorly.run,
	rodrigosiqueiramelo@gmail.com, melissa.srw@gmail.com,
	sam@ravnborg.org
Cc: dri-devel@lists.freedesktop.org, linux-hyperv@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 03/11] drm/gud: Get offset-adjusted mapping from drm_gem_fb_vmap()
Date: Tue,  3 Aug 2021 14:59:20 +0200	[thread overview]
Message-ID: <20210803125928.27780-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20210803125928.27780-1-tzimmermann@suse.de>

Pass the data parameter to drm_gem_fb_vmap() to retrieve pointers
to the data. This address is different from the mapping addresses
for framebuffers with non-zero offsets. Replaces gud's internal
computation.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/gud/gud_pipe.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/gud/gud_pipe.c b/drivers/gpu/drm/gud/gud_pipe.c
index 6270a1a32a65..b9b0e435ea0f 100644
--- a/drivers/gpu/drm/gud/gud_pipe.c
+++ b/drivers/gpu/drm/gud/gud_pipe.c
@@ -153,6 +153,7 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
 	struct dma_buf_attachment *import_attach = fb->obj[0]->import_attach;
 	u8 compression = gdrm->compression;
 	struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
+	struct dma_buf_map map_data[DRM_FORMAT_MAX_PLANES];
 	void *vaddr, *buf;
 	size_t pitch, len;
 	int ret = 0;
@@ -162,11 +163,11 @@ static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
 	if (len > gdrm->bulk_len)
 		return -E2BIG;
 
-	ret = drm_gem_fb_vmap(fb, map, NULL);
+	ret = drm_gem_fb_vmap(fb, map, map_data);
 	if (ret)
 		return ret;
 
-	vaddr = map[0].vaddr + fb->offsets[0];
+	vaddr = map_data[0].vaddr;
 
 	ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE);
 	if (ret)
-- 
2.32.0


  parent reply	other threads:[~2021-08-03 12:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 12:59 [PATCH 00/11] Provide offset-adjusted framebuffer mappings Thomas Zimmermann
2021-08-03 12:59 ` [PATCH 01/11] drm/gem: Provide offset-adjusted framebuffer BO mappings Thomas Zimmermann
2021-08-03 12:59 ` [PATCH 02/11] drm/ast: Use offset-adjusted shadow-plane mappings Thomas Zimmermann
2021-08-03 12:59 ` Thomas Zimmermann [this message]
2021-08-03 12:59 ` [PATCH 04/11] drm/hyperv: " Thomas Zimmermann
2021-08-03 12:59 ` [PATCH 05/11] drm/mgag200: " Thomas Zimmermann
2021-08-03 12:59 ` [PATCH 06/11] drm/cirrus: " Thomas Zimmermann
2021-08-03 12:59 ` [PATCH 07/11] drm/gm12u320: " Thomas Zimmermann
2021-08-03 12:59 ` [PATCH 08/11] drm/simpledrm: Use offset-adjusted shadow-plane mapping Thomas Zimmermann
2021-08-03 12:59 ` [PATCH 09/11] drm/udl: " Thomas Zimmermann
2021-08-03 12:59 ` [PATCH 10/11] drm/vbox: Use offset-adjusted shadow-plane mappings Thomas Zimmermann
2021-08-03 12:59 ` [PATCH 11/11] drm/vkms: Use offset-adjusted shadow-plane mappings and output Thomas Zimmermann
     [not found] ` <YQls/oxklkZWqEnD@ravnborg.org>
2021-08-04 18:22   ` [PATCH 00/11] Provide offset-adjusted framebuffer mappings Thomas Zimmermann

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=20210803125928.27780-4-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=drawat.floss@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=melissa.srw@gmail.com \
    --cc=mripard@kernel.org \
    --cc=noralf@tronnes.org \
    --cc=rodrigosiqueiramelo@gmail.com \
    --cc=sam@ravnborg.org \
    --cc=sean@poorly.run \
    --cc=virtualization@lists.linux-foundation.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).