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

Configure Feed

Select the types of activity you want to include in your feed.

drm/fbdev-helper: Remove drm_fb_helper_debug_enter/_leave()

Remove the debug_enter/debug_leave helpers, as there are no DRM
drivers supporting debugging with kgdb. Remove code to keep track
of existing fbdev-emulation state. None of this required any longer.

Also remove mode_set_base_atomic from struct drm_crtc_helper_funcs,
which has no callers or implementations.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
Acked-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
Link: https://patch.msgid.link/20251125130634.1080966-5-tzimmermann@suse.de

-152
-108
drivers/gpu/drm/drm_fb_helper.c
··· 77 77 "Allow unsafe leaking fbdev physical smem address [default=false]"); 78 78 #endif 79 79 80 - static LIST_HEAD(kernel_fb_helper_list); 81 - static DEFINE_MUTEX(kernel_fb_helper_lock); 82 - 83 80 /** 84 81 * DOC: fbdev helpers 85 82 * ··· 113 116 * callback it will also schedule dirty_work with the damage collected from the 114 117 * mmap page writes. 115 118 */ 116 - 117 - static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc) 118 - { 119 - uint16_t *r_base, *g_base, *b_base; 120 - 121 - if (crtc->funcs->gamma_set == NULL) 122 - return; 123 - 124 - r_base = crtc->gamma_store; 125 - g_base = r_base + crtc->gamma_size; 126 - b_base = g_base + crtc->gamma_size; 127 - 128 - crtc->funcs->gamma_set(crtc, r_base, g_base, b_base, 129 - crtc->gamma_size, NULL); 130 - } 131 - 132 - /** 133 - * drm_fb_helper_debug_enter - implementation for &fb_ops.fb_debug_enter 134 - * @info: fbdev registered by the helper 135 - */ 136 - int drm_fb_helper_debug_enter(struct fb_info *info) 137 - { 138 - struct drm_fb_helper *helper = info->par; 139 - const struct drm_crtc_helper_funcs *funcs; 140 - struct drm_mode_set *mode_set; 141 - 142 - list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { 143 - mutex_lock(&helper->client.modeset_mutex); 144 - drm_client_for_each_modeset(mode_set, &helper->client) { 145 - if (!mode_set->crtc->enabled) 146 - continue; 147 - 148 - funcs = mode_set->crtc->helper_private; 149 - if (funcs->mode_set_base_atomic == NULL) 150 - continue; 151 - 152 - if (drm_drv_uses_atomic_modeset(mode_set->crtc->dev)) 153 - continue; 154 - 155 - funcs->mode_set_base_atomic(mode_set->crtc, 156 - mode_set->fb, 157 - mode_set->x, 158 - mode_set->y, 159 - ENTER_ATOMIC_MODE_SET); 160 - } 161 - mutex_unlock(&helper->client.modeset_mutex); 162 - } 163 - 164 - return 0; 165 - } 166 - EXPORT_SYMBOL(drm_fb_helper_debug_enter); 167 - 168 - /** 169 - * drm_fb_helper_debug_leave - implementation for &fb_ops.fb_debug_leave 170 - * @info: fbdev registered by the helper 171 - */ 172 - int drm_fb_helper_debug_leave(struct fb_info *info) 173 - { 174 - struct drm_fb_helper *helper = info->par; 175 - struct drm_client_dev *client = &helper->client; 176 - struct drm_device *dev = helper->dev; 177 - struct drm_crtc *crtc; 178 - const struct drm_crtc_helper_funcs *funcs; 179 - struct drm_mode_set *mode_set; 180 - struct drm_framebuffer *fb; 181 - 182 - mutex_lock(&client->modeset_mutex); 183 - drm_client_for_each_modeset(mode_set, client) { 184 - crtc = mode_set->crtc; 185 - if (drm_drv_uses_atomic_modeset(crtc->dev)) 186 - continue; 187 - 188 - funcs = crtc->helper_private; 189 - fb = crtc->primary->fb; 190 - 191 - if (!crtc->enabled) 192 - continue; 193 - 194 - if (!fb) { 195 - drm_err(dev, "no fb to restore?\n"); 196 - continue; 197 - } 198 - 199 - if (funcs->mode_set_base_atomic == NULL) 200 - continue; 201 - 202 - drm_fb_helper_restore_lut_atomic(mode_set->crtc); 203 - funcs->mode_set_base_atomic(mode_set->crtc, fb, crtc->x, 204 - crtc->y, LEAVE_ATOMIC_MODE_SET); 205 - } 206 - mutex_unlock(&client->modeset_mutex); 207 - 208 - return 0; 209 - } 210 - EXPORT_SYMBOL(drm_fb_helper_debug_leave); 211 119 212 120 static int 213 121 __drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper, ··· 301 399 if (!preferred_bpp) 302 400 preferred_bpp = 32; 303 401 304 - INIT_LIST_HEAD(&helper->kernel_fb_list); 305 402 spin_lock_init(&helper->damage_lock); 306 403 INIT_WORK(&helper->resume_work, drm_fb_helper_resume_worker); 307 404 INIT_WORK(&helper->damage_work, drm_fb_helper_damage_work); ··· 441 540 cancel_work_sync(&fb_helper->damage_work); 442 541 443 542 drm_fb_helper_release_info(fb_helper); 444 - 445 - mutex_lock(&kernel_fb_helper_lock); 446 - if (!list_empty(&fb_helper->kernel_fb_list)) 447 - list_del(&fb_helper->kernel_fb_list); 448 - mutex_unlock(&kernel_fb_helper_lock); 449 543 450 544 if (!fb_helper->client.funcs) 451 545 drm_client_release(&fb_helper->client); ··· 1675 1779 1676 1780 drm_info(dev, "fb%d: %s frame buffer device\n", 1677 1781 info->node, info->fix.id); 1678 - 1679 - mutex_lock(&kernel_fb_helper_lock); 1680 - list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); 1681 - mutex_unlock(&kernel_fb_helper_lock); 1682 1782 1683 1783 return 0; 1684 1784
-21
include/drm/drm_fb_helper.h
··· 167 167 struct mutex lock; 168 168 169 169 /** 170 - * @kernel_fb_list: 171 - * 172 - * Entry on the global kernel_fb_helper_list, used for kgdb entry/exit. 173 - */ 174 - struct list_head kernel_fb_list; 175 - 176 - /** 177 170 * @delayed_hotplug: 178 171 * 179 172 * A hotplug was received while fbdev wasn't in control of the DRM ··· 229 236 .fb_setcmap = drm_fb_helper_setcmap, \ 230 237 .fb_blank = drm_fb_helper_blank, \ 231 238 .fb_pan_display = drm_fb_helper_pan_display, \ 232 - .fb_debug_enter = drm_fb_helper_debug_enter, \ 233 - .fb_debug_leave = drm_fb_helper_debug_leave, \ 234 239 .fb_ioctl = drm_fb_helper_ioctl 235 240 236 241 #ifdef CONFIG_DRM_FBDEV_EMULATION ··· 271 280 272 281 int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); 273 282 int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper); 274 - int drm_fb_helper_debug_enter(struct fb_info *info); 275 - int drm_fb_helper_debug_leave(struct fb_info *info); 276 283 #else 277 284 static inline void drm_fb_helper_prepare(struct drm_device *dev, 278 285 struct drm_fb_helper *helper, ··· 373 384 } 374 385 375 386 static inline int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper) 376 - { 377 - return 0; 378 - } 379 - 380 - static inline int drm_fb_helper_debug_enter(struct fb_info *info) 381 - { 382 - return 0; 383 - } 384 - 385 - static inline int drm_fb_helper_debug_leave(struct fb_info *info) 386 387 { 387 388 return 0; 388 389 }
-23
include/drm/drm_modeset_helper_vtables.h
··· 52 52 struct drm_writeback_connector; 53 53 struct drm_writeback_job; 54 54 55 - enum mode_set_atomic { 56 - LEAVE_ATOMIC_MODE_SET, 57 - ENTER_ATOMIC_MODE_SET, 58 - }; 59 - 60 55 /** 61 56 * struct drm_crtc_helper_funcs - helper operations for CRTCs 62 57 * ··· 247 252 */ 248 253 int (*mode_set_base)(struct drm_crtc *crtc, int x, int y, 249 254 struct drm_framebuffer *old_fb); 250 - 251 - /** 252 - * @mode_set_base_atomic: 253 - * 254 - * This callback is used by the fbdev helpers to set a new framebuffer 255 - * and scanout without sleeping, i.e. from an atomic calling context. It 256 - * is only used to implement kgdb support. 257 - * 258 - * This callback is optional and only needed for kgdb support in the fbdev 259 - * helpers. 260 - * 261 - * RETURNS: 262 - * 263 - * 0 on success or a negative error code on failure. 264 - */ 265 - int (*mode_set_base_atomic)(struct drm_crtc *crtc, 266 - struct drm_framebuffer *fb, int x, int y, 267 - enum mode_set_atomic); 268 255 269 256 /** 270 257 * @disable: