drm/vkms: Use spin_lock_irq in process context

The worker is always in process context, no need for the _irqsafe
version. Same for the set_source callback, that's only called from the
debugfs handler in a syscall.

Cc: Shayenne Moura <shayenneluzmoura@gmail.com>
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-3-daniel.vetter@ffwll.ch
This commit is contained in:
Daniel Vetter 2019-06-07 00:27:43 +02:00 committed by Rodrigo Siqueira
parent 18d0952a83
commit a0e4e5754c

View File

@ -167,16 +167,15 @@ void vkms_crc_work_handle(struct work_struct *work)
u32 crc32 = 0;
u64 frame_start, frame_end;
bool crc_pending;
unsigned long flags;
spin_lock_irqsave(&out->state_lock, flags);
spin_lock_irq(&out->state_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_irqrestore(&out->state_lock, flags);
spin_unlock_irq(&out->state_lock);
/*
* We raced with the vblank hrtimer and previous work already computed
@ -255,7 +254,6 @@ int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name)
{
struct vkms_output *out = drm_crtc_to_vkms_output(crtc);
bool enabled = false;
unsigned long flags;
int ret = 0;
ret = vkms_crc_parse_source(src_name, &enabled);
@ -263,9 +261,9 @@ int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name)
/* make sure nothing is scheduled on crtc workq */
flush_workqueue(out->crc_workq);
spin_lock_irqsave(&out->lock, flags);
spin_lock_irq(&out->lock);
out->crc_enabled = enabled;
spin_unlock_irqrestore(&out->lock, flags);
spin_unlock_irq(&out->lock);
return ret;
}