[PATCH 8/8] drm/fb-helper: Handle I/O memory correctly when flushing shadow fb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux