diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-04-11 03:34:21 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-04-11 03:34:21 +0000 |
commit | e0d447f602af294478ca8fc6f364bffd9a9e47ce (patch) | |
tree | fcebb5016517e810eb040a018b3d1945a00e59bd /sys | |
parent | b62d51d850f3e0957d9e9343f25017f6e46e90b5 (diff) |
drm/fb-helper: Mark screen buffers in system memory with FBINFO_VIRTFB
From Thomas Zimmermann
51f0af904fb621721d2c95c1eb349fb46af63a04 in linux 5.15.y/5.15.33
cd9f7f7ac5932129fe81b4c7559cfcb226ec7c5c in mainline linux
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/drm_fb_helper.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c index f7aa0ef99e6..d56b9c66ee3 100644 --- a/sys/dev/pci/drm/drm_fb_helper.c +++ b/sys/dev/pci/drm/drm_fb_helper.c @@ -2409,6 +2409,7 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, fbi->fbops = &drm_fbdev_fb_ops; fbi->screen_size = fb->height * fb->pitches[0]; fbi->fix.smem_len = fbi->screen_size; + fbi->flags = FBINFO_DEFAULT; drm_fb_helper_fill_info(fbi, fb_helper, sizes); @@ -2416,19 +2417,21 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, fbi->screen_buffer = vzalloc(fbi->screen_size); if (!fbi->screen_buffer) return -ENOMEM; + fbi->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST; fbi->fbdefio = &drm_fbdev_defio; - fb_deferred_io_init(fbi); } else { /* buffer is mapped for HW framebuffer */ ret = drm_client_buffer_vmap(fb_helper->buffer, &map); if (ret) return ret; - if (map.is_iomem) + if (map.is_iomem) { fbi->screen_base = map.vaddr_iomem; - else + } else { fbi->screen_buffer = map.vaddr; + fbi->flags |= FBINFO_VIRTFB; + } /* * Shamelessly leak the physical address to user-space. As |