1. 24 11月, 2020 8 次提交
  2. 10 11月, 2020 1 次提交
  3. 09 11月, 2020 2 次提交
  4. 08 10月, 2020 1 次提交
  5. 02 10月, 2020 1 次提交
  6. 27 7月, 2020 1 次提交
  7. 11 7月, 2020 1 次提交
  8. 25 6月, 2020 1 次提交
    • D
      drm/fb-helper: Fix vt restore · dc5bdb68
      Daniel Vetter 提交于
      In the past we had a pile of hacks to orchestrate access between fbdev
      emulation and native kms clients. We've tried to streamline this, by
      always preferring the kms side above fbdev calls when a drm master
      exists, because drm master controls access to the display resources.
      
      Unfortunately this breaks existing userspace, specifically Xorg. When
      exiting Xorg first restores the console to text mode using the KDSET
      ioctl on the vt. This does nothing, because a drm master is still
      around. Then it drops the drm master status, which again does nothing,
      because logind is keeping additional drm fd open to be able to
      orchestrate vt switches. In the past this is the point where fbdev was
      restored, as part of the ->lastclose hook on the drm side.
      
      Now to fix this regression we don't want to go back to letting fbdev
      restore things whenever it feels like, or to the pile of hacks we've
      had before. Instead try and go with a minimal exception to make the
      KDSET case work again, and nothing else.
      
      This means that if userspace does a KDSET call when switching between
      graphical compositors, there will be some flickering with fbcon
      showing up for a bit. But a) that's not a regression and b) userspace
      can fix it by improving the vt switching dance - logind should have
      all the information it needs.
      
      While pondering all this I'm also wondering wheter we should have a
      SWITCH_MASTER ioctl to allow race-free master status handover. But
      that's for another day.
      
      v2: Somehow forgot to cc all the fbdev people.
      
      v3: Fix typo Alex spotted.
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=208179
      Cc: shlomo@fastmail.com
      Reported-and-Tested-by: shlomo@fastmail.com
      Cc: Michel Dänzer <michel@daenzer.net>
      Fixes: 64914da2 ("drm/fbdev-helper: don't force restores")
      Cc: Noralf Trønnes <noralf@tronnes.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v5.7+
      Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Nathan Chancellor <natechancellor@gmail.com>
      Cc: Qiujun Huang <hqjagain@gmail.com>
      Cc: Peter Rosin <peda@axentia.se>
      Cc: linux-fbdev@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200624092910.3280448-1-daniel.vetter@ffwll.ch
      dc5bdb68
  9. 15 5月, 2020 1 次提交
  10. 08 4月, 2020 1 次提交
  11. 27 3月, 2020 1 次提交
  12. 06 3月, 2020 1 次提交
  13. 11 2月, 2020 2 次提交
  14. 07 1月, 2020 1 次提交
  15. 30 12月, 2019 1 次提交
  16. 19 12月, 2019 1 次提交
  17. 05 12月, 2019 1 次提交
  18. 03 12月, 2019 1 次提交
  19. 19 11月, 2019 1 次提交
  20. 13 11月, 2019 1 次提交
  21. 07 11月, 2019 1 次提交
  22. 28 10月, 2019 1 次提交
  23. 01 10月, 2019 1 次提交
  24. 01 8月, 2019 2 次提交
  25. 09 7月, 2019 2 次提交
  26. 19 6月, 2019 1 次提交
  27. 12 6月, 2019 1 次提交
    • T
      drm: Reverse lock order in pan_display_legacy() · 1ff30dd8
      Thomas Zimmermann 提交于
      Acquiring drm_client_dev.modeset_mutex after the locks in drm_fb_helper.dev
      creates a deadlock with drm_setup_crtcs() as shown below:
      
        [    4.959319] fbcon: radeondrmfb (fb0) is primary device
        [    4.993952] Console: switching to colour frame buffer device 240x67
        [    4.994040]
        [    4.994041] ======================================================
        [    4.994041] WARNING: possible circular locking dependency detected
        [    4.994042] 5.2.0-rc4-1-default+ #39 Tainted: G            E
        [    4.994043] ------------------------------------------------------
        [    4.994043] systemd-udevd/369 is trying to acquire lock:
        [    4.994044] 00000000fb622acb (&client->modeset_mutex){+.+.}, at: drm_fb_helper_pan_display+0x103/0x1f0 [drm_kms_helper]
        [    4.994055]
        [    4.994055] but task is already holding lock:
        [    4.994055] 0000000028767ae4 (crtc_ww_class_mutex){+.+.}, at: drm_modeset_lock+0x42/0xf0 [drm]
        [    4.994072]
        [    4.994072] which lock already depends on the new lock.
        [    4.994072]
        [    4.994072]
        [    4.994072] the existing dependency chain (in reverse order) is:
        [    4.994073]
        [    4.994073] -> #3 (crtc_ww_class_mutex){+.+.}:
        [    4.994076]        lock_acquire+0x9e/0x170
        [    4.994079]        __ww_mutex_lock.constprop.18+0x97/0xf40
        [    4.994080]        ww_mutex_lock+0x30/0x90
        [    4.994091]        drm_modeset_lock+0x42/0xf0 [drm]
        [    4.994102]        drm_modeset_lock_all_ctx+0x1f/0xe0 [drm]
        [    4.994113]        drm_modeset_lock_all+0x5e/0x1a0 [drm]
        [    4.994163]        intel_modeset_init+0x60b/0xda0 [i915]
        ..
        [    4.994253]
        [    4.994253] -> #2 (crtc_ww_class_acquire){+.+.}:
        [    4.994255]        lock_acquire+0x9e/0x170
        [    4.994270]        drm_modeset_acquire_init+0xcc/0x100 [drm]
        [    4.994280]        drm_modeset_lock_all+0x44/0x1a0 [drm]
        [    4.994320]        intel_modeset_init+0x60b/0xda0 [i915]
        ..
        [    4.994403]
        [    4.994403] -> #1 (&dev->mode_config.mutex){+.+.}:
        [    4.994405]        lock_acquire+0x9e/0x170
        [    4.994408]        __mutex_lock+0x62/0x8c0
        [    4.994413]        drm_setup_crtcs+0x17c/0xc50 [drm_kms_helper]
        [    4.994418]        __drm_fb_helper_initial_config_and_unlock+0x34/0x530 [drm_kms_helper]
        [    4.994450]        radeon_fbdev_init+0x110/0x130 [radeon]
        ..
        [    4.994535]
        [    4.994535] -> #0 (&client->modeset_mutex){+.+.}:
        [    4.994537]        __lock_acquire+0xa85/0xe90
        [    4.994538]        lock_acquire+0x9e/0x170
        [    4.994540]        __mutex_lock+0x62/0x8c0
        [    4.994545]        drm_fb_helper_pan_display+0x103/0x1f0 [drm_kms_helper]
        [    4.994547]        fb_pan_display+0x92/0x120
        [    4.994549]        bit_update_start+0x1a/0x40
        [    4.994550]        fbcon_switch+0x392/0x580
        [    4.994552]        redraw_screen+0x12c/0x220
        [    4.994553]        do_bind_con_driver.cold.30+0xe1/0x10d
        [    4.994554]        do_take_over_console+0x113/0x190
        [    4.994555]        do_fbcon_takeover+0x58/0xb0
        [    4.994557]        notifier_call_chain+0x47/0x70
        [    4.994558]        blocking_notifier_call_chain+0x44/0x60
        [    4.994559]        register_framebuffer+0x231/0x310
        [    4.994564]        __drm_fb_helper_initial_config_and_unlock+0x2fd/0x530 [drm_kms_helper]
        [    4.994590]        radeon_fbdev_init+0x110/0x130 [radeon]
        ..
      
      This problem was introduced in
      
        d81294af	drm/fb-helper: Remove drm_fb_helper_crtc
      
      Reversing the lock ordering in pan_display_legacy() fixes the issue.
      
      Fixes: d81294af ("drm/fb-helper: Remove drm_fb_helper_crtc")
      Cc: Noralf Trønnes <noralf@tronnes.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: Sean Paul <sean@poorly.run>
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: NThomas Zimmermann <tzimmermann@suse.de>
      Suggested-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190611115716.7052-1-tzimmermann@suse.de
      1ff30dd8
  28. 11 6月, 2019 2 次提交