kernel_optimize_test/include/drm
Daniel Vetter 99264a61df drm/vblank: Fixup and document timestamp update/read barriers
This was a bit too much cargo-culted, so lets make it solid:
- vblank->count doesn't need to be an atomic, writes are always done
  under the protection of dev->vblank_time_lock. Switch to an unsigned
  long instead and update comments. Note that atomic_read is just a
  normal read of a volatile variable, so no need to audit all the
  read-side access specifically.

- The barriers for the vblank counter seqlock weren't complete: The
  read-side was missing the first barrier between the counter read and
  the timestamp read, it only had a barrier between the ts and the
  counter read. We need both.

- Barriers weren't properly documented. Since barriers only work if
  you have them on boths sides of the transaction it's prudent to
  reference where the other side is. To avoid duplicating the
  write-side comment 3 times extract a little store_vblank() helper.
  In that helper also assert that we do indeed hold
  dev->vblank_time_lock, since in some cases the lock is acquired a
  few functions up in the callchain.

Spotted while reviewing a patch from Chris Wilson to add a fastpath to
the vblank_wait ioctl.

v2: Add comment to better explain how store_vblank works, suggested by
Chris.

v3: Peter noticed that as-is the 2nd smp_wmb is redundant with the
implicit barrier in the spin_unlock. But that can only be proven by
auditing all callers and my point in extracting this little helper was
to localize all the locking into just one place. Hence I think that
additional optimization is too risky.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Michel Dänzer <michel@daenzer.net>
Cc: Peter Hurley <peter@hurleysoftware.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-05-04 10:57:00 +02:00
..
bridge drm/bridge: make bridge registration independent of drm flow 2015-01-28 08:45:40 +01:00
i2c
ttm drm/ttm: device address space != CPU address space 2015-03-05 09:04:39 +10:00
ati_pcigart.h
drm_agpsupport.h
drm_atomic_helper.h drm/atomic-helper: Rename commmit_post/pre_planes 2015-02-24 01:57:46 +01:00
drm_atomic.h drm/atomic: Add for_each_{connector,crtc,plane}_in_state helper macros 2015-04-11 18:50:22 +02:00
drm_cache.h
drm_core.h
drm_crtc_helper.h drm: make crtc/encoder/connector/plane helper_private a const pointer 2015-04-13 15:00:13 +02:00
drm_crtc.h drm: fix trivial typo mistake 2015-04-14 12:41:03 +02:00
drm_displayid.h drm/displayid: add displayid defines and edid extension (v2) 2014-12-09 09:56:46 +10:00
drm_dp_helper.h drm/dp: Use large transactions for I2C over AUX 2015-03-11 22:04:56 +01:00
drm_dp_mst_helper.h drm/dp_mst: add a function to retrieve vcpi slots 2015-03-19 12:26:45 -04:00
drm_edid.h drm/edid: add #defines for ELD versions 2015-04-13 14:59:58 +02:00
drm_encoder_slave.h
drm_fb_cma_helper.h
drm_fb_helper.h drm/fb: document drm_fb_helper_surface_size 2015-03-11 22:07:33 +01:00
drm_fixed.h
drm_flip_work.h drm: flip-work: change drm_flip_work_init prototype 2014-11-15 09:29:14 +10:00
drm_gem_cma_helper.h drm/cma: Introduce drm_gem_cma_dumb_create_internal() 2014-11-13 13:27:17 +01:00
drm_gem.h drm: Use kref_put_mutex in drm_gem_object_unreference_unlocked 2015-04-07 18:11:25 +02:00
drm_global.h
drm_hashtab.h
drm_legacy.h drm: move drm_mmap to <drm/drm_legacy.h> 2014-09-24 11:43:07 +10:00
drm_mem_util.h
drm_mipi_dsi.h drm/dsi: Do not require .owner field to be set 2014-11-13 13:56:17 +01:00
drm_mm.h drm/mm: Support 4 GiB and larger ranges 2015-03-05 09:01:37 +10:00
drm_modes.h drm: Fix the CRTC_STEREO_DOUBLE_ONLY define to include stero modes 2015-02-23 11:19:35 +01:00
drm_modeset_lock.h drm: Per-plane locking 2014-11-12 17:56:12 +10:00
drm_of.h
drm_os_linux.h
drm_panel.h
drm_pciids.h drm/radeon: remove invalid pci id 2014-10-28 10:44:36 -04:00
drm_plane_helper.h drm: make crtc/encoder/connector/plane helper_private a const pointer 2015-04-13 15:00:13 +02:00
drm_rect.h
drm_sysfs.h
drm_vma_manager.h
drmP.h drm/vblank: Fixup and document timestamp update/read barriers 2015-05-04 10:57:00 +02:00
exynos_drm.h
gma_drm.h
i915_component.h drm/i915: add component support 2015-01-12 02:48:20 +01:00
i915_drm.h
i915_pciids.h drm/i915: remove indirection in the PCI ID macros 2015-03-17 22:30:21 +01:00
intel-gtt.h