summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vkms
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2019-06-07 00:27:44 +0200
committerRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>2019-06-27 04:00:55 +0200
commitfb4155fa4c0c0db488a9054502a4aef134a11c0f (patch)
tree2a8a4f2decaeb06a785c411c4898ee86fa4db1e2 /drivers/gpu/drm/vkms
parentdrm/vkms: Use spin_lock_irq in process context (diff)
downloadlinux-fb4155fa4c0c0db488a9054502a4aef134a11c0f.tar.xz
linux-fb4155fa4c0c0db488a9054502a4aef134a11c0f.zip
drm/vkms: Rename vkms_output.state_lock to crc_lock
Plus add a comment about what it actually protects. It's very little. Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Cc: Haneen Mohammed <hamohammed.sa@gmail.com> Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Tested-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190606222751.32567-4-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/vkms')
-rw-r--r--drivers/gpu/drm/vkms/vkms_crc.c4
-rw-r--r--drivers/gpu/drm/vkms/vkms_crtc.c6
-rw-r--r--drivers/gpu/drm/vkms/vkms_drv.h5
3 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_crc.c b/drivers/gpu/drm/vkms/vkms_crc.c
index d8a2872c58dd..4bb08c3611fc 100644
--- a/drivers/gpu/drm/vkms/vkms_crc.c
+++ b/drivers/gpu/drm/vkms/vkms_crc.c
@@ -168,14 +168,14 @@ void vkms_crc_work_handle(struct work_struct *work)
u64 frame_start, frame_end;
bool crc_pending;
- spin_lock_irq(&out->state_lock);
+ spin_lock_irq(&out->crc_lock);
frame_start = crtc_state->frame_start;
frame_end = crtc_state->frame_end;
crc_pending = crtc_state->crc_pending;
crtc_state->frame_start = 0;
crtc_state->frame_end = 0;
crtc_state->crc_pending = false;
- spin_unlock_irq(&out->state_lock);
+ spin_unlock_irq(&out->crc_lock);
/*
* We raced with the vblank hrtimer and previous work already computed
diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
index f392fa13015b..81bec95f163e 100644
--- a/drivers/gpu/drm/vkms/vkms_crtc.c
+++ b/drivers/gpu/drm/vkms/vkms_crtc.c
@@ -29,7 +29,7 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer)
/* update frame_start only if a queued vkms_crc_work_handle()
* has read the data
*/
- spin_lock(&output->state_lock);
+ spin_lock(&output->crc_lock);
if (!state->crc_pending)
state->frame_start = frame;
else
@@ -37,7 +37,7 @@ static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer)
state->frame_start, frame);
state->frame_end = frame;
state->crc_pending = true;
- spin_unlock(&output->state_lock);
+ spin_unlock(&output->crc_lock);
ret = queue_work(output->crc_workq, &state->crc_work);
if (!ret)
@@ -225,7 +225,7 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
drm_crtc_helper_add(crtc, &vkms_crtc_helper_funcs);
spin_lock_init(&vkms_out->lock);
- spin_lock_init(&vkms_out->state_lock);
+ spin_lock_init(&vkms_out->crc_lock);
vkms_out->crc_workq = alloc_ordered_workqueue("vkms_crc_workq", 0);
if (!vkms_out->crc_workq)
diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
index 2b37eb1062d3..98af63c9e5db 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.h
+++ b/drivers/gpu/drm/vkms/vkms_drv.h
@@ -49,6 +49,7 @@ struct vkms_crtc_state {
struct drm_crtc_state base;
struct work_struct crc_work;
+ /* below three are protected by vkms_output.crc_lock */
bool crc_pending;
u64 frame_start;
u64 frame_end;
@@ -66,8 +67,8 @@ struct vkms_output {
struct workqueue_struct *crc_workq;
/* protects concurrent access to crc_data */
spinlock_t lock;
- /* protects concurrent access to crtc_state */
- spinlock_t state_lock;
+
+ spinlock_t crc_lock;
};
struct vkms_device {