linux_dsm_epyc7002/drivers/gpu/drm/i915
Daniel Vetter fc8fd40eb2 drm: Rip out totally bogus vga_switcheroo->can_switch locking
So I just wanted to add a new field to struct drm_device and
accidentally stumbled over something. According to comments
dev->open_count is protected by dev->count_lock, but that's totally
not the case. It's protected by drm_global_mutex.

Unfortunately the vga switcheroo callbacks took this comment at face
value. The problem is that we can't just take the drm_global_mutex
because:
- It would lead to a locking inversion with the driver load/unload
  paths.
- It wouldn't actually protect anything, for that we'd need to wrap
  the entire vga switcheroo code in the drm_global_mutex. And I'm not
  sure whether that would actually solve anything.

What we probably want is a try_to_grab_switcheroo reference kind of
thing which is used in the driver's ->open callback. Then we could
move all that ->can_switch madness into the vga switcheroo core where
it really belongs.

But since that would amount to real work take the easy way out and
just add a comment. It's definitely not going to make anything worse
since doing switcheroo state changes while restarting X just isn't
recommended. Even though the delayed switching code does exactly that.

v2:
- Simplify the ->can_switch implementations more (Thierry)
- Fix comment about the dev->open_count locking (Thierry)

Cc: Thierry Reding <treding@nvidia.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> (v1)
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-23 10:32:33 +02:00
..
dvo_ch7xxx.c
dvo_ch7017.c
dvo_ivch.c
dvo_ns2501.c
dvo_sil164.c
dvo_tfp410.c
dvo.h
i915_cmd_parser.c Merge tag 'drm-intel-next-2014-03-21' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-04-03 07:51:54 +10:00
i915_debugfs.c Merge tag 'drm-intel-fixes-2014-04-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-04-05 16:14:21 +10:00
i915_dma.c drm: Rip out totally bogus vga_switcheroo->can_switch locking 2014-04-23 10:32:33 +02:00
i915_drv.c drm/irq: remove cargo-culted locking from irq_install/uninstall 2014-04-22 11:41:12 +02:00
i915_drv.h drm/i915: Always use kref tracking for all contexts. 2014-04-11 13:29:51 +03:00
i915_gem_context.c drm/i915: Always use kref tracking for all contexts. 2014-04-11 13:29:51 +03:00
i915_gem_debug.c drm/i915: prefer struct drm_i915_private to drm_i915_private_t 2014-03-31 15:34:21 +02:00
i915_gem_dmabuf.c
i915_gem_evict.c drm/i915: prefer struct drm_i915_private to drm_i915_private_t 2014-03-31 15:34:21 +02:00
i915_gem_execbuffer.c drm/i915: Always use kref tracking for all contexts. 2014-04-11 13:29:51 +03:00
i915_gem_gtt.c Merge tag 'drm-intel-fixes-2014-04-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-04-05 16:14:21 +10:00
i915_gem_stolen.c
i915_gem_tiling.c drm/i915: prefer struct drm_i915_private to drm_i915_private_t 2014-03-31 15:34:21 +02:00
i915_gem.c drm/irq: remove cargo-culted locking from irq_install/uninstall 2014-04-22 11:41:12 +02:00
i915_gpu_error.c drm/i915: prefer struct drm_i915_private to drm_i915_private_t 2014-03-31 15:34:21 +02:00
i915_ioc32.c
i915_irq.c Merge tag 'drm-intel-fixes-2014-04-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-04-05 16:14:21 +10:00
i915_params.c
i915_reg.h
i915_suspend.c
i915_sysfs.c
i915_trace_points.c
i915_trace.h
i915_ums.c
intel_acpi.c
intel_bios.c drm/i915: check VBT for supported backlight type 2014-04-11 13:22:27 +03:00
intel_bios.h drm/i915: check VBT for supported backlight type 2014-04-11 13:22:27 +03:00
intel_crt.c Skip intel_crt_init for Dell XPS 8700 2014-04-04 09:30:53 +02:00
intel_ddi.c drm/i915: fix WARNs when reading DDI state while suspended 2014-04-01 22:53:45 +02:00
intel_display.c Merge tag 'drm-intel-fixes-2014-04-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-04-05 16:14:21 +10:00
intel_dp.c drm/i915: support address only i2c-over-aux transactions 2014-04-08 16:12:37 +02:00
intel_drv.h drm/i915: vlv: reserve the GT power context only once during driver init 2014-04-01 22:30:01 +02:00
intel_dsi_cmd.c
intel_dsi_cmd.h
intel_dsi_pll.c
intel_dsi.c
intel_dsi.h
intel_dvo.c
intel_fbdev.c Merge tag 'drm-intel-fixes-2014-04-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-04-05 16:14:21 +10:00
intel_hdmi.c
intel_i2c.c
intel_lvds.c Merge tag 'drm-intel-next-2014-03-21' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-04-03 07:51:54 +10:00
intel_modes.c
intel_opregion.c
intel_overlay.c Merge tag 'drm-intel-fixes-2014-04-04' of git://anongit.freedesktop.org/drm-intel into drm-next 2014-04-05 16:14:21 +10:00
intel_panel.c drm/i915: do not setup backlight if not available according to VBT 2014-04-11 13:22:57 +03:00
intel_pm.c drm/i915: Disable self-refresh for untiled fbs on i915gm 2014-04-10 10:56:25 +03:00
intel_ringbuffer.c drm/i915/ringbuffer: prefer struct drm_i915_private to drm_i915_private_t 2014-03-31 15:32:56 +02:00
intel_ringbuffer.h
intel_sdvo_regs.h
intel_sdvo.c
intel_sideband.c
intel_sprite.c
intel_tv.c
intel_uncore.c drm/i915: get runtime PM at i915_reg_read_ioctl 2014-04-01 22:41:47 +02:00
Kconfig
Makefile