linux-hardened/include/drm
Lyude Paul 39b50c6038 drm/atomic_helper: Stop modesets on unregistered connectors harder
Unfortunately, it appears our fix in:
commit b5d29843d8 ("drm/atomic_helper: Allow DPMS On<->Off changes
for unregistered connectors")

Which attempted to work around the problems introduced by:
commit 4d80273976 ("drm/atomic_helper: Disallow new modesets on
unregistered connectors")

Is still not the right solution, as modesets can still be triggered
outside of drm_atomic_set_crtc_for_connector().

So in order to fix this, while still being careful that we don't break
modesets that a driver may perform before being registered with
userspace, we replace connector->registered with a tristate member,
connector->registration_state. This allows us to keep track of whether
or not a connector is still initializing and hasn't been exposed to
userspace, is currently registered and exposed to userspace, or has been
legitimately removed from the system after having once been present.

Using this info, we can prevent userspace from performing new modesets
on unregistered connectors while still allowing the driver to perform
modesets on unregistered connectors before the driver has finished being
registered.

Changes since v1:
- Fix WARN_ON() in drm_connector_cleanup() that CI caught with this
  patchset in igt@drv_module_reload@basic-reload-inject and
  igt@drv_module_reload@basic-reload by checking if the connector is
  registered instead of unregistered, as calling drm_connector_cleanup()
  on a connector that hasn't been registered with userspace yet should
  stay valid.
- Remove unregistered_connector_check(), and just go back to what we
  were doing before in commit 4d80273976 ("drm/atomic_helper: Disallow
  new modesets on unregistered connectors") except replacing
  READ_ONCE(connector->registered) with drm_connector_is_unregistered().
  This gets rid of the behavior of allowing DPMS On<->Off, but that should
  be fine as it's more consistent with the UAPI we had before - danvet
- s/drm_connector_unregistered/drm_connector_is_unregistered/ - danvet
- Update documentation, fix some typos.

Fixes: b5d29843d8 ("drm/atomic_helper: Allow DPMS On<->Off changes for unregistered connectors")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: stable@vger.kernel.org
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181016203946.9601-1-lyude@redhat.com
2018-10-17 13:50:14 -04:00
..
bridge
i2c
tinydrm drm/tinydrm: Fix doc build warnings 2018-07-11 22:24:02 +02:00
ttm drm/ttm: add bulk move function on LRU 2018-08-27 11:11:21 -05:00
amd_asic_type.h drm/amdgpu: simplify Raven, Raven2, and Picasso handling 2018-09-14 09:38:03 -05:00
ati_pcigart.h
drm_agpsupport.h
drm_atomic.h drm: extract drm_atomic_uapi.c 2018-09-09 14:19:18 +02:00
drm_atomic_helper.h drm: Add drm/drm_util.h header file 2018-09-09 14:18:11 +02:00
drm_atomic_uapi.h drm: extract drm_atomic_uapi.c 2018-09-09 14:19:18 +02:00
drm_audio_component.h ALSA: hda: Make audio component support more generic 2018-07-17 22:25:48 +02:00
drm_auth.h
drm_blend.h drm: Add per-plane pixel blend mode property 2018-08-24 17:31:37 +01:00
drm_bridge.h
drm_cache.h
drm_client.h drm/debugfs: Add internal client debugfs file 2018-07-10 14:53:35 +02:00
drm_color_mgmt.h drm: drop drmP.h include from drm_plane.c 2018-09-09 14:19:17 +02:00
drm_connector.h drm/atomic_helper: Stop modesets on unregistered connectors harder 2018-10-17 13:50:14 -04:00
drm_crtc.h drm/crc: Cleanup crtc_crc_open function 2018-08-22 09:47:58 -07:00
drm_crtc_helper.h
drm_debugfs.h
drm_debugfs_crc.h
drm_device.h drm: Introduce per-device driver_features 2018-09-13 18:44:06 +03:00
drm_displayid.h
drm_dp_dual_mode_helper.h
drm_dp_helper.h drm: Change limited M/N quirk to constant N quirk. 2018-09-19 16:44:12 +03:00
drm_dp_mst_helper.h
drm_drv.h drm: Introduce per-device driver_features 2018-09-13 18:44:06 +03:00
drm_edid.h
drm_encoder.h drm: Add drm/drm_util.h header file 2018-09-09 14:18:11 +02:00
drm_encoder_slave.h
drm_fb_cma_helper.h drm: Remove drm_fbdev_cma_set_suspend() 2018-08-07 22:06:49 +02:00
drm_fb_helper.h drm/fb-helper: document remove*_conflicting_framebuffers() 2018-09-07 22:07:49 +02:00
drm_file.h
drm_fixed.h
drm_flip_work.h
drm_fourcc.h drm: byteorder: add DRM_FORMAT_HOST_* 2018-09-06 08:40:18 +02:00
drm_framebuffer.h
drm_gem.h
drm_gem_cma_helper.h
drm_gem_framebuffer_helper.h
drm_global.h
drm_hashtab.h
drm_hdcp.h
drm_ioctl.h
drm_irq.h
drm_lease.h
drm_legacy.h
drm_mipi_dsi.h
drm_mm.h
drm_mode_config.h drm: fix drm_mode_addfb() on big endian machines. 2018-09-06 08:40:19 +02:00
drm_mode_object.h
drm_modes.h drm: drop _mode_ from remaining connector functions 2018-07-13 18:40:27 +02:00
drm_modeset_helper.h
drm_modeset_helper_vtables.h drm: drop _mode_ from update_edit_property() 2018-07-13 18:40:27 +02:00
drm_modeset_lock.h
drm_of.h
drm_os_linux.h
drm_panel.h drm: Add kerneldoc description for "link"-member in struct drm_panel 2018-08-16 11:46:49 +02:00
drm_pci.h
drm_pciids.h
drm_plane.h drm: drop drmP.h include from drm_plane.c 2018-09-09 14:19:17 +02:00
drm_plane_helper.h
drm_prime.h
drm_print.h Merge drm/drm-next into drm-misc-next 2018-08-27 10:00:03 -04:00
drm_property.h drm: drop drmP.h include from drm_plane.c 2018-09-09 14:19:17 +02:00
drm_rect.h
drm_scdc_helper.h
drm_simple_kms_helper.h
drm_syncobj.h drm: expand replace_fence to support timeline point v2 2018-09-06 11:09:31 +02:00
drm_sysfs.h
drm_util.h drm: Add drm/drm_util.h header file 2018-09-09 14:18:11 +02:00
drm_utils.h
drm_vblank.h
drm_vma_manager.h drm/i915: Prevent writing into a read-only object via a GGTT mmap 2018-07-13 16:14:04 +01:00
drm_writeback.h drm/atomic: Avoid connector to writeback_connector casts 2018-07-07 07:51:19 +02:00
drmP.h drm: Add drm/drm_util.h header file 2018-09-09 14:18:11 +02:00
gma_drm.h
gpu_scheduler.h drm/scheduler: Add stopped flag to drm_sched_entity 2018-08-27 11:11:10 -05:00
i915_component.h drm/i915: Split audio component to a generic type 2018-07-17 22:25:19 +02:00
i915_drm.h x86/gpu: reserve ICL's graphics stolen memory 2018-07-10 16:28:47 -07:00
i915_pciids.h drm/i915/aml: Add new Amber Lake PCI ID 2018-10-11 10:59:34 -07:00
intel-gtt.h
intel_lpe_audio.h
spsc_queue.h