linux/include/drm
Mario Kleiner 8f6fce03dd drm: Push latency sensitive bits of vblank scanoutpos timestamping into kms drivers.
A change in locking of some kms drivers (currently intel-kms) make
the old approach too inaccurate and also incompatible with the
PREEMPT_RT realtime kernel patchset.

The driver->get_scanout_position() method of intel-kms now needs
to aquire a spinlock, which clashes badly with the former
preempt_disable() calls in the drm, and it also introduces larger
delays and timing uncertainty on a contended lock than acceptable.

This patch changes the prototype of driver->get_scanout_position()
to require/allow kms drivers to perform the ktime_get() system time
queries which go along with actual scanout position readout in a way
that provides maximum precision and to return those timestamps to
the drm. kms drivers implementations of get_scanout_position() are
asked to implement timestamping and scanoutpos readout in a way
that is as precise as possible and compatible with preempt_disable()
on a PREMPT_RT kernel. A driver should follow this pattern in
get_scanout_position() for precision and compatibility:

spin_lock...(...);
preempt_disable_rt(); // On a PREEMPT_RT kernel, otherwise omit.
if (stime) *stime = ktime_get();
... Minimum amount of MMIO register reads to get scanout position ...
... no taking of locks allowed here! ...
if (etime) *etime = ktime_get();
preempt_enable_rt(); // On PREEMPT_RT kernel, otherwise omit.
spin_unlock...(...);

v2: Fix formatting of new multi-line code comments.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-06 11:53:41 +10:00
..
i2c drm/i2c: tda998x: add video and audio input configuration 2013-08-19 09:10:32 +10:00
ttm drm/ttm: convert to unified vma offset manager 2013-07-25 20:47:07 +10:00
drmP.h drm: Push latency sensitive bits of vblank scanoutpos timestamping into kms drivers. 2013-11-06 11:53:41 +10:00
drm_agpsupport.h drm: provide agp dummies for CONFIG_AGP=n 2013-08-09 07:22:11 +10:00
drm_buffer.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
drm_cache.h drm/ttm: consolidate cache flushing code in one place. 2009-08-27 09:53:47 +10:00
drm_core.h drm: Fix support for PCI domains 2010-08-10 08:20:20 +10:00
drm_crtc.h Merge branch 'drm-tda998x-3.12' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox into drm-next 2013-10-22 09:50:08 +01:00
drm_crtc_helper.h drm: return if changed in drm_helper_hpd_irq_event() 2013-10-23 14:21:07 +01:00
drm_dp_helper.h drm/dp: add helper for checking DP_ENHANCED_FRAME_CAP in DPCD 2013-10-09 18:17:06 +10:00
drm_edid.h Merge branch 'drm-next-3.12' of git://people.freedesktop.org/~agd5f/linux into drm-next 2013-09-02 09:31:40 +10:00
drm_encoder_slave.h drm: i2c encoder helper wrappers 2013-02-17 17:55:42 -05:00
drm_fb_cma_helper.h drm: Make drm_fb_cma_describe() static 2013-08-21 12:47:41 +10:00
drm_fb_helper.h drm: Remove pointless '-' characters from drm_fb_helper documentation 2013-05-10 14:46:11 +10:00
drm_fixed.h drm: fix 64 bit drm fixed point helpers 2013-07-30 17:24:13 -04:00
drm_flip_work.h drm: add flip-work helper 2013-08-19 10:32:26 +10:00
drm_gem_cma_helper.h drm/gem: create drm_gem_dumb_destroy 2013-08-07 09:59:24 +10:00
drm_global.h drm: move ttm global code to core drm 2010-08-04 09:46:06 +10:00
drm_hashtab.h drm: Add a hash-tab rcu-safe API 2012-11-28 18:36:05 +10:00
drm_mem_util.h introduce SIZE_MAX 2012-05-31 17:49:26 -07:00
drm_memory.h UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel system headers 2012-10-02 18:01:25 +01:00
drm_mm.h drm/mm: remove unused API 2013-08-07 10:16:50 +10:00
drm_os_linux.h drm: Remove mtrr_add and mtrr_del fallback hack for non-MTRR systems 2013-05-31 13:37:37 +10:00
drm_pciids.h drm/radeon: add some additional berlin pci ids 2013-09-11 11:44:30 -04:00
drm_rect.h drm: Fix drm_rect documentation 2013-05-23 12:51:32 +02:00
drm_sysfs.h drm: Enable drm drivers to add drm sysfs devices. 2009-08-19 16:08:51 +10:00
drm_usb.h drm: add usb framework 2011-02-07 13:09:42 +10:00
drm_vma_manager.h drm/vma: add access management helpers 2013-08-27 11:54:54 +10:00
exynos_drm.h drm/exynos: fimd: replace struct fb_videomode with videomode 2013-09-05 13:43:44 +09:00
gma_drm.h gma500: fix ioctl confict 2012-03-10 13:06:04 +00:00
i915_drm.h x86: add early quirk for reserving Intel graphics stolen memory v5 2013-09-03 19:17:57 +02:00
i915_pciids.h drm/i915: split PCI IDs out into i915_drm.h v4 2013-09-03 19:17:56 +02:00
i915_powerwell.h i915/drm: Add private api for power well usage 2013-06-06 17:32:16 +02:00
intel-gtt.h drm/i915: Fix gen2 mappable calculations 2013-02-15 10:30:38 +01:00