All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: daniel@ffwll.ch, christian.koenig@amd.com, noralf@tronnes.org
Cc: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Subject: [PATCH 8/8] drm/fb-helper: Handle I/O memory correctly when flushing shadow fb
Date: Wed,  6 Nov 2019 10:31:21 +0100	[thread overview]
Message-ID: <20191106093121.21762-9-tzimmermann@suse.de> (raw)
In-Reply-To: <20191106093121.21762-1-tzimmermann@suse.de>

The fbdev console's framebuffer can be located in I/O memory, such
as video RAM. When flushing the shadow fb, we test for this case and
use I/O-based memcpy() instead. The shadow fb is always in system
memory.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/drm_fb_helper.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 174e6d97223f..e76c42f8852e 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -393,10 +393,14 @@ static void drm_fb_helper_dirty_blit_real(struct drm_fb_helper *fb_helper,
 	void *src = fb_helper->fbdev->screen_buffer + offset;
 	void *dst = fb_helper->buffer->vaddr + offset;
 	size_t len = (clip->x2 - clip->x1) * cpp;
+	bool is_iomem = fb_helper->buffer->vaddr_is_iomem;
 	unsigned int y;
 
 	for (y = clip->y1; y < clip->y2; y++) {
-		memcpy(dst, src, len);
+		if (is_iomem)
+			memcpy_toio((void __iomem *)dst, src, len);
+		else
+			memcpy(dst, src, len);
 		src += fb->pitches[0];
 		dst += fb->pitches[0];
 	}
-- 
2.23.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-11-06  9:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06  9:31 [RFC][PATCH 0/8] Support I/O memory in generic fbdev emulation Thomas Zimmermann
2019-11-06  9:31 ` [PATCH 1/8] drm/vram-helper: Tell caller if vmap() returned I/O memory Thomas Zimmermann
2019-11-06  9:31 ` [PATCH 2/8] drm/qxl: Tell caller if kmap() " Thomas Zimmermann
2019-11-06  9:31 ` [PATCH 3/8] drm: Add is_iomem return parameter to struct drm_gem_object_funcs.vmap Thomas Zimmermann
2019-11-06  9:31 ` [PATCH 4/8] drm/gem: Return I/O-memory flag from drm_gem_vram() Thomas Zimmermann
2019-11-06  9:31 ` [PATCH 5/8] drm/client: Return I/O memory flag from drm_client_buffer_vmap() Thomas Zimmermann
2019-11-06  9:31 ` [PATCH 6/8] fbdev: Export default read and write operations as fb_cfb_{read, write}() Thomas Zimmermann
2019-11-06  9:31 ` [PATCH 7/8] drm/fb-helper: Select between fb_{sys, cfb}_read() and _write() Thomas Zimmermann
2019-11-06  9:31 ` Thomas Zimmermann [this message]
2019-11-06 10:05 ` [RFC][PATCH 0/8] Support I/O memory in generic fbdev emulation Daniel Vetter

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=20191106093121.21762-9-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=noralf@tronnes.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.