Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] RFC: hot-unplug safe connector list locking
@ 2016-06-21  9:10 Daniel Vetter
  2016-06-21  9:10 ` [PATCH 01/10] drm/amd-kfd: Clean up inline handling Daniel Vetter
                   ` (10 more replies)
  0 siblings, 11 replies; 22+ messages in thread
From: Daniel Vetter @ 2016-06-21  9:10 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development

Hi all,

This is a bit nightmare fuel, but I think it's the best we can aim for:
- locking doesn't leak to callers/drivers, no headaches with locking inversions
- it allows us (once fbdev is fixed) to drop the modeset_lock_all from mst
  unplug, cleaning up our locking hirarchy quite a bit

As a teaser of what this enables I've thrown three patches on top to drop a bit
of now superflous locking.

Todo:
- survive nightmares when reviewing this
- make sure all bits in i915 are covered (mostly depends upon Maarten's atomic
  iterator cleanup, which is progressing well)
- apply same love to amdgpu/radeon to handle hot-unplugging there too

Some of the other approaches I've discussed with Dave on irc, but didn't
implemented here:
- Go with a reallocating (rcu-protected) array instead of connector_list. Has
  the upside of catching every offender, but the downside of forcing churn onto
  every driver which doesn't care.
- Rework locking to again protect the connector_list with mode_config.mutex. Imo
  too hairy since that leaks the locking context out of every
  drm_connector_unreference (since it's no longer a pure leaf lock protecting
  things). Which tends to be real painful.
- Hope it works - we have the oopses already to prove otherwise :(

I think this implementation here strikes the best balance between invasiveness
and keeping locking concerns separated as much as possible. The one downside is
the implementation of the hot-unplug safe connector_list iterator.

Comments, screams of agony, testing and review highly welcome.

Cheers, Daniel

Daniel Vetter (10):
  drm/amd-kfd: Clean up inline handling
  drm: Don't compute obj counts expensively in get_resources
  drm: Add explicit iter struct to drm_for_each_connector
  drm/i915: Use use the drm_for_each_connector in i915_debugfs.c
  drm/i915: Roll out drm_for_each_connector in intel_hotplug.c
  drm: Drop cargo-culted modeset_lock_all from encoder/plane
    init/cleanup
  drm: Revamp connector_list protection
  drm: Drop mode_config.mutex from connector_register_all
  drm: Drop mode_config.mutex from get_resources ioctl
  drm: Drop mode_config.mutex from _reset()

 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |   4 +-
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h              |   3 -
 drivers/gpu/drm/drm_atomic.c                       |   3 +-
 drivers/gpu/drm/drm_atomic_helper.c                |  12 ++-
 drivers/gpu/drm/drm_crtc.c                         | 109 ++++++++++++---------
 drivers/gpu/drm/drm_crtc_helper.c                  |  21 ++--
 drivers/gpu/drm/drm_edid.c                         |   3 +-
 drivers/gpu/drm/drm_fb_helper.c                    |   3 +-
 drivers/gpu/drm/drm_plane_helper.c                 |   3 +-
 drivers/gpu/drm/drm_probe_helper.c                 |   9 +-
 drivers/gpu/drm/exynos/exynos_drm_drv.c            |   6 +-
 drivers/gpu/drm/i915/i915_debugfs.c                |  22 ++---
 drivers/gpu/drm/i915/intel_display.c               |   6 +-
 drivers/gpu/drm/i915/intel_dp_mst.c                |   2 +-
 drivers/gpu/drm/i915/intel_hotplug.c               |  16 +--
 drivers/gpu/drm/vc4/vc4_crtc.c                     |   3 +-
 include/drm/drm_crtc.h                             |  79 +++++++++++----
 17 files changed, 189 insertions(+), 115 deletions(-)

-- 
2.8.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-06-22  9:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-21  9:10 [PATCH 00/10] RFC: hot-unplug safe connector list locking Daniel Vetter
2016-06-21  9:10 ` [PATCH 01/10] drm/amd-kfd: Clean up inline handling Daniel Vetter
2016-06-21 19:11   ` Oded Gabbay
2016-06-21 19:22     ` Daniel Vetter
2016-06-22  7:35     ` Daniel Vetter
2016-06-21  9:10 ` [PATCH 02/10] drm: Don't compute obj counts expensively in get_resources Daniel Vetter
2016-06-21  9:48   ` Chris Wilson
2016-06-21 12:21     ` Daniel Vetter
2016-06-21 12:29   ` [PATCH] " Daniel Vetter
2016-06-21 12:40     ` Chris Wilson
2016-06-21  9:10 ` [PATCH 03/10] drm: Add explicit iter struct to drm_for_each_connector Daniel Vetter
2016-06-21  9:10 ` [PATCH 04/10] drm/i915: Use use the drm_for_each_connector in i915_debugfs.c Daniel Vetter
2016-06-21  9:10 ` [PATCH 05/10] drm/i915: Roll out drm_for_each_connector in intel_hotplug.c Daniel Vetter
2016-06-21  9:10 ` [PATCH 06/10] drm: Drop cargo-culted modeset_lock_all from encoder/plane init/cleanup Daniel Vetter
2016-06-21  9:10 ` [PATCH 07/10] drm: Revamp connector_list protection Daniel Vetter
2016-06-22  9:09   ` Daniel Vetter
2016-06-21  9:10 ` [PATCH 08/10] drm: Drop mode_config.mutex from connector_register_all Daniel Vetter
2016-06-21  9:10 ` [PATCH 09/10] drm: Drop mode_config.mutex from get_resources ioctl Daniel Vetter
2016-06-21  9:44   ` Chris Wilson
2016-06-21 12:41     ` [PATCH] " Daniel Vetter
2016-06-21  9:10 ` [PATCH 10/10] drm: Drop mode_config.mutex from _reset() Daniel Vetter
2016-06-21 10:28 ` ✗ Ro.CI.BAT: warning for RFC: hot-unplug safe connector list locking Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox