summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorDave Airlie2016-06-01 23:50:23 +0200
committerDave Airlie2016-06-01 23:50:23 +0200
commit65439b68bb10afd877af05463bbff5d25200fd06 (patch)
tree846aeadab033ec39a3ed942c82976b40ea4994a2 /include/drm
parentLinux 4.7-rc1 (diff)
parentdrm/vc4: Use lockless gem BO free callback (diff)
downloadkernel-qcow2-linux-65439b68bb10afd877af05463bbff5d25200fd06.tar.gz
kernel-qcow2-linux-65439b68bb10afd877af05463bbff5d25200fd06.tar.xz
kernel-qcow2-linux-65439b68bb10afd877af05463bbff5d25200fd06.zip
Merge tag 'topic/drm-misc-2016-06-01' of git://anongit.freedesktop.org/drm-intel into drm-next
Frist -misc pull for 4.8, with pretty much just random all over plus a few more lockless gem BO patches acked/reviewed by driver maintainers. I'm starting a bit earlier this time around because there's a few invasive patch series to land (nonblocking atomic prep work, fence prep work, rst/sphinx kerneldoc finally happening) and I need a baseline with all the branches merged. * tag 'topic/drm-misc-2016-06-01' of git://anongit.freedesktop.org/drm-intel: (21 commits) drm/vc4: Use lockless gem BO free callback drm/vc4: Use drm_gem_object_unreference_unlocked drm: Initialize a linear gamma table by default drm/vgem: Use lockless gem BO free callback drm/qxl: Don't set a gamma table size drm/msm: Nuke dummy gamma_set/get functions drm/cirrus: Drop redundnant gamma size check drm/fb-helper: Remove dead code in setcolreg drm/mediatek: Use lockless gem BO free callback drm/hisilicon: Use lockless gem BO free callback drm/hlcd: Use lockless gem BO free callback vga_switcheroo: Support deferred probing of audio clients vga_switcheroo: Add helper for deferred probing virtio-gpu: fix output lookup drm/doc: Unify KMS Locking docs drm/atomic-helper: Do not call ->mode_fixup for CRTC which will be disabled Fix annoyingly awkward typo in drm_edid_load.c drm/doc: Drop vblank_disable_allow wording drm: use seqlock for vblank time/count drm/mm: avoid possible null pointer dereference ...
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drmP.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 84f1a8eefbdb..af8b71b2e5bd 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -52,6 +52,7 @@
#include <linux/poll.h>
#include <linux/ratelimit.h>
#include <linux/sched.h>
+#include <linux/seqlock.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/vmalloc.h>
@@ -392,11 +393,6 @@ struct drm_master {
void *driver_priv;
};
-/* Size of ringbuffer for vblank timestamps. Just double-buffer
- * in initial implementation.
- */
-#define DRM_VBLANKTIME_RBSIZE 2
-
/* Flags and return codes for get_vblank_timestamp() driver function. */
#define DRM_CALLED_FROM_VBLIRQ 1
#define DRM_VBLANKTIME_SCANOUTPOS_METHOD (1 << 0)
@@ -725,10 +721,10 @@ struct drm_vblank_crtc {
wait_queue_head_t queue; /**< VBLANK wait queue */
struct timer_list disable_timer; /* delayed disable timer */
- /* vblank counter, protected by dev->vblank_time_lock for writes */
- u32 count;
- /* vblank timestamps, protected by dev->vblank_time_lock for writes */
- struct timeval time[DRM_VBLANKTIME_RBSIZE];
+ seqlock_t seqlock; /* protects vblank count and time */
+
+ u32 count; /* vblank counter */
+ struct timeval time; /* vblank timestamp */
atomic_t refcount; /* number of users of vblank interruptsper crtc */
u32 last; /* protected by dev->vbl_lock, used */