summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_fbdev_dma.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-03-20 16:07:50 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2023-03-22 13:32:52 +0100
commita51c7663f144606a5f08e772fa3e1e4f2277a614 (patch)
tree495e3d374ec7419791baf9505d9bf7a4c261d744 /drivers/gpu/drm/drm_fbdev_dma.c
parent61b5d0072a88cfd8c5fda31a7c19d105187c8841 (diff)
downloadlinux-a51c7663f144606a5f08e772fa3e1e4f2277a614.tar.gz
linux-a51c7663f144606a5f08e772fa3e1e4f2277a614.tar.bz2
linux-a51c7663f144606a5f08e772fa3e1e4f2277a614.zip
drm/fb-helper: Consolidate CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM
Consolidate all handling of CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM by making the module parameter optional in drm_fb_helper.c. Without the config option, modules can set smem_start in struct fb_info for internal usage, but not export if to userspace. The address can only be exported by enabling the option and setting the module parameter. Also update the comment. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Zack Rusin <zackr@vmware.com> Tested-by: Sui Jingfeng<suijingfeng@loongson.cn> Link: https://patchwork.freedesktop.org/patch/msgid/20230320150751.20399-8-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/drm_fbdev_dma.c')
-rw-r--r--drivers/gpu/drm/drm_fbdev_dma.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
index cf553ac12a0f..728deffcc0d9 100644
--- a/drivers/gpu/drm/drm_fbdev_dma.c
+++ b/drivers/gpu/drm/drm_fbdev_dma.c
@@ -136,16 +136,9 @@ static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,
info->flags |= FBINFO_READS_FAST; /* signal caching */
info->screen_size = sizes->surface_height * fb->pitches[0];
info->screen_buffer = map.vaddr;
+ info->fix.smem_start = page_to_phys(virt_to_page(info->screen_buffer));
info->fix.smem_len = info->screen_size;
-#if IS_ENABLED(CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM)
- /*
- * Shamelessly leak the physical address to user-space.
- */
- if (fb_helper->hint_leak_smem_start && !info->fix.smem_start)
- info->fix.smem_start = page_to_phys(virt_to_page(info->screen_buffer));
-#endif
-
return 0;
err_drm_client_buffer_vunmap: