summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-08-12 03:48:23 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-08-12 03:48:23 +0000
commit5ce16db384b557d6495314b37ea1f15896ddc113 (patch)
treee0404fbd5e44b83c504aa6093bd27b7b0d17e3a3 /sys/dev/pci
parent876c286a4e065eefe0291b5cc434280748d8b93a (diff)
drm/drm_fb_helper: fix fbdev with sparc64
From Sam Ravnborg cea0a7943a30a6d0320c8558a844dd27e8f0aa8b in linux 5.7.y/5.7.15 2a1658bf922ffd9b7907e270a7d9cdc9643fc45d in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/drm_fb_helper.c6
-rw-r--r--sys/dev/pci/drm/include/drm/drm_mode_config.h12
2 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c
index 13929cc0b08..60fe7c8d8b0 100644
--- a/sys/dev/pci/drm/drm_fb_helper.c
+++ b/sys/dev/pci/drm/drm_fb_helper.c
@@ -405,7 +405,11 @@ static void drm_fb_helper_dirty_blit_real(struct drm_fb_helper *fb_helper,
unsigned int y;
for (y = clip->y1; y < clip->y2; y++) {
- memcpy(dst, src, len);
+ if (!fb_helper->dev->mode_config.fbdev_use_iomem)
+ memcpy(dst, src, len);
+ else
+ memcpy_toio((void __iomem *)dst, src, len);
+
src += fb->pitches[0];
dst += fb->pitches[0];
}
diff --git a/sys/dev/pci/drm/include/drm/drm_mode_config.h b/sys/dev/pci/drm/include/drm/drm_mode_config.h
index d22c3f0ac67..e4185da28dc 100644
--- a/sys/dev/pci/drm/include/drm/drm_mode_config.h
+++ b/sys/dev/pci/drm/include/drm/drm_mode_config.h
@@ -866,6 +866,18 @@ struct drm_mode_config {
bool prefer_shadow_fbdev;
/**
+ * @fbdev_use_iomem:
+ *
+ * Set to true if framebuffer reside in iomem.
+ * When set to true memcpy_toio() is used when copying the framebuffer in
+ * drm_fb_helper.drm_fb_helper_dirty_blit_real().
+ *
+ * FIXME: This should be replaced with a per-mapping is_iomem
+ * flag (like ttm does), and then used everywhere in fbdev code.
+ */
+ bool fbdev_use_iomem;
+
+ /**
* @quirk_addfb_prefer_xbgr_30bpp:
*
* Special hack for legacy ADDFB to keep nouveau userspace happy. Should