Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/fb_helper: Rename field fbdev to info in struct drm_fb_helper

Rename struct drm_fb_helper.fbdev to info. The current name is
misleading as it overlaps with generic fbdev naming conventions.
Adapt to the usual naming in fbdev drivers by calling the field
'info'. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221103151446.2638-13-tzimmermann@suse.de

+36 -37
+20 -20
drivers/gpu/drm/drm_fb_helper.c
··· 368 368 resume_work); 369 369 370 370 console_lock(); 371 - fb_set_suspend(helper->fbdev, 0); 371 + fb_set_suspend(helper->info, 0); 372 372 console_unlock(); 373 373 } 374 374 ··· 401 401 break; 402 402 } 403 403 404 - src = fb_helper->fbdev->screen_buffer + offset; 404 + src = fb_helper->info->screen_buffer + offset; 405 405 iosys_map_incr(dst, offset); /* go to first pixel within clip rect */ 406 406 407 407 for (y = clip->y1; y < clip->y2; y++) { ··· 598 598 goto err_free_cmap; 599 599 } 600 600 601 - fb_helper->fbdev = info; 601 + fb_helper->info = info; 602 602 info->skip_vt_switch = true; 603 603 604 604 return info; ··· 621 621 */ 622 622 void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper) 623 623 { 624 - if (fb_helper && fb_helper->fbdev) 625 - unregister_framebuffer(fb_helper->fbdev); 624 + if (fb_helper && fb_helper->info) 625 + unregister_framebuffer(fb_helper->info); 626 626 } 627 627 EXPORT_SYMBOL(drm_fb_helper_unregister_fbi); 628 628 ··· 647 647 cancel_work_sync(&fb_helper->resume_work); 648 648 cancel_work_sync(&fb_helper->damage_work); 649 649 650 - info = fb_helper->fbdev; 650 + info = fb_helper->info; 651 651 if (info) { 652 652 if (info->cmap.len) 653 653 fb_dealloc_cmap(&info->cmap); 654 654 framebuffer_release(info); 655 655 } 656 - fb_helper->fbdev = NULL; 656 + fb_helper->info = NULL; 657 657 658 658 mutex_lock(&kernel_fb_helper_lock); 659 659 if (!list_empty(&fb_helper->kernel_fb_list)) { ··· 914 914 */ 915 915 void drm_fb_helper_set_suspend(struct drm_fb_helper *fb_helper, bool suspend) 916 916 { 917 - if (fb_helper && fb_helper->fbdev) 918 - fb_set_suspend(fb_helper->fbdev, suspend); 917 + if (fb_helper && fb_helper->info) 918 + fb_set_suspend(fb_helper->info, suspend); 919 919 } 920 920 EXPORT_SYMBOL(drm_fb_helper_set_suspend); 921 921 ··· 938 938 void drm_fb_helper_set_suspend_unlocked(struct drm_fb_helper *fb_helper, 939 939 bool suspend) 940 940 { 941 - if (!fb_helper || !fb_helper->fbdev) 941 + if (!fb_helper || !fb_helper->info) 942 942 return; 943 943 944 944 /* make sure there's no pending/ongoing resume */ 945 945 flush_work(&fb_helper->resume_work); 946 946 947 947 if (suspend) { 948 - if (fb_helper->fbdev->state != FBINFO_STATE_RUNNING) 948 + if (fb_helper->info->state != FBINFO_STATE_RUNNING) 949 949 return; 950 950 951 951 console_lock(); 952 952 953 953 } else { 954 - if (fb_helper->fbdev->state == FBINFO_STATE_RUNNING) 954 + if (fb_helper->info->state == FBINFO_STATE_RUNNING) 955 955 return; 956 956 957 957 if (!console_trylock()) { ··· 960 960 } 961 961 } 962 962 963 - fb_set_suspend(fb_helper->fbdev, suspend); 963 + fb_set_suspend(fb_helper->info, suspend); 964 964 console_unlock(); 965 965 } 966 966 EXPORT_SYMBOL(drm_fb_helper_set_suspend_unlocked); ··· 1850 1850 /* 1851 1851 * This is a continuation of drm_setup_crtcs() that sets up anything related 1852 1852 * to the framebuffer. During initialization, drm_setup_crtcs() is called before 1853 - * the framebuffer has been allocated (fb_helper->fb and fb_helper->fbdev). 1853 + * the framebuffer has been allocated (fb_helper->fb and fb_helper->info). 1854 1854 * So, any setup that touches those fields needs to be done here instead of in 1855 1855 * drm_setup_crtcs(). 1856 1856 */ ··· 1858 1858 { 1859 1859 struct drm_client_dev *client = &fb_helper->client; 1860 1860 struct drm_connector_list_iter conn_iter; 1861 - struct fb_info *info = fb_helper->fbdev; 1861 + struct fb_info *info = fb_helper->info; 1862 1862 unsigned int rotation, sw_rotations = 0; 1863 1863 struct drm_connector *connector; 1864 1864 struct drm_mode_set *modeset; ··· 1942 1942 1943 1943 fb_helper->deferred_setup = false; 1944 1944 1945 - info = fb_helper->fbdev; 1945 + info = fb_helper->info; 1946 1946 info->var.pixclock = 0; 1947 1947 /* Shamelessly allow physical address leaking to userspace */ 1948 1948 #if IS_ENABLED(CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM) ··· 2077 2077 drm_setup_crtcs_fb(fb_helper); 2078 2078 mutex_unlock(&fb_helper->lock); 2079 2079 2080 - drm_fb_helper_set_par(fb_helper->fbdev); 2080 + drm_fb_helper_set_par(fb_helper->info); 2081 2081 2082 2082 return 0; 2083 2083 } ··· 2135 2135 2136 2136 static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper) 2137 2137 { 2138 - struct fb_info *fbi = fb_helper->fbdev; 2138 + struct fb_info *fbi = fb_helper->info; 2139 2139 void *shadow = NULL; 2140 2140 2141 2141 if (!fb_helper->dev) ··· 2495 2495 { 2496 2496 struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client); 2497 2497 2498 - if (fb_helper->fbdev) 2498 + if (fb_helper->info) 2499 2499 /* drm_fbdev_fb_destroy() takes care of cleanup */ 2500 2500 drm_fb_helper_unregister_fbi(fb_helper); 2501 2501 else ··· 2546 2546 drm_fbdev_cleanup(fb_helper); 2547 2547 err: 2548 2548 fb_helper->dev = NULL; 2549 - fb_helper->fbdev = NULL; 2549 + fb_helper->info = NULL; 2550 2550 2551 2551 drm_err(dev, "fbdev: Failed to setup generic emulation (ret=%d)\n", ret); 2552 2552
+1 -1
drivers/gpu/drm/i915/display/intel_fbdev.c
··· 627 627 if (!ifbdev || !ifbdev->vma) 628 628 goto set_suspend; 629 629 630 - info = ifbdev->helper.fbdev; 630 + info = ifbdev->helper.info; 631 631 632 632 if (synchronous) { 633 633 /* Flush any pending work to turn the console on, and then
+11 -12
drivers/gpu/drm/nouveau/nouveau_fbcon.c
··· 231 231 nouveau_fbcon_accel_save_disable(struct drm_device *dev) 232 232 { 233 233 struct nouveau_drm *drm = nouveau_drm(dev); 234 - if (drm->fbcon && drm->fbcon->helper.fbdev) { 235 - drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags; 236 - drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED; 234 + if (drm->fbcon && drm->fbcon->helper.info) { 235 + drm->fbcon->saved_flags = drm->fbcon->helper.info->flags; 236 + drm->fbcon->helper.info->flags |= FBINFO_HWACCEL_DISABLED; 237 237 } 238 238 } 239 239 ··· 241 241 nouveau_fbcon_accel_restore(struct drm_device *dev) 242 242 { 243 243 struct nouveau_drm *drm = nouveau_drm(dev); 244 - if (drm->fbcon && drm->fbcon->helper.fbdev) { 245 - drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags; 246 - } 244 + if (drm->fbcon && drm->fbcon->helper.info) 245 + drm->fbcon->helper.info->flags = drm->fbcon->saved_flags; 247 246 } 248 247 249 248 static void ··· 252 253 struct nouveau_fbdev *fbcon = drm->fbcon; 253 254 if (fbcon && drm->channel) { 254 255 console_lock(); 255 - if (fbcon->helper.fbdev) 256 - fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED; 256 + if (fbcon->helper.info) 257 + fbcon->helper.info->flags |= FBINFO_HWACCEL_DISABLED; 257 258 console_unlock(); 258 259 nouveau_channel_idle(drm->channel); 259 260 nvif_object_dtor(&fbcon->twod); ··· 271 272 { 272 273 struct nouveau_drm *drm = nouveau_drm(dev); 273 274 struct nouveau_fbdev *fbcon = drm->fbcon; 274 - struct fb_info *info = fbcon->helper.fbdev; 275 + struct fb_info *info = fbcon->helper.info; 275 276 int ret; 276 277 277 278 if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) ··· 289 290 static void 290 291 nouveau_fbcon_zfill(struct drm_device *dev, struct nouveau_fbdev *fbcon) 291 292 { 292 - struct fb_info *info = fbcon->helper.fbdev; 293 + struct fb_info *info = fbcon->helper.info; 293 294 struct fb_fillrect rect; 294 295 295 296 /* Clear the entire fbcon. The drm will program every connector ··· 585 586 if (ret) 586 587 goto fini; 587 588 588 - if (fbcon->helper.fbdev) 589 - fbcon->helper.fbdev->pixmap.buf_align = 4; 589 + if (fbcon->helper.info) 590 + fbcon->helper.info->pixmap.buf_align = 4; 590 591 return 0; 591 592 592 593 fini:
+1 -1
drivers/gpu/drm/omapdrm/omap_fbdev.c
··· 38 38 static void pan_worker(struct work_struct *work) 39 39 { 40 40 struct omap_fbdev *fbdev = container_of(work, struct omap_fbdev, work); 41 - struct fb_info *fbi = fbdev->base.fbdev; 41 + struct fb_info *fbi = fbdev->base.info; 42 42 int npages; 43 43 44 44 /* DMM roll shifts in 4K pages: */
+1 -1
drivers/gpu/drm/tegra/fb.c
··· 261 261 262 262 fb = fbdev->fb; 263 263 helper->fb = fb; 264 - helper->fbdev = info; 264 + helper->info = info; 265 265 266 266 info->fbops = &tegra_fb_ops; 267 267
+2 -2
include/drm/drm_fb_helper.h
··· 96 96 * @fb: Scanout framebuffer object 97 97 * @dev: DRM device 98 98 * @funcs: driver callbacks for fb helper 99 - * @fbdev: emulated fbdev device info struct 99 + * @info: emulated fbdev device info struct 100 100 * @pseudo_palette: fake palette of 16 colors 101 101 * @damage_clip: clip rectangle used with deferred_io to accumulate damage to 102 102 * the screen buffer ··· 127 127 struct drm_framebuffer *fb; 128 128 struct drm_device *dev; 129 129 const struct drm_fb_helper_funcs *funcs; 130 - struct fb_info *fbdev; 130 + struct fb_info *info; 131 131 u32 pseudo_palette[17]; 132 132 struct drm_clip_rect damage_clip; 133 133 spinlock_t damage_lock;