struct armada_ovl_plane {
struct drm_plane base;
- spinlock_t lock;
struct drm_framebuffer *old_fb;
uint32_t src_hw;
uint32_t dst_hw;
{
struct drm_framebuffer *old_fb;
- spin_lock(&dplane->lock);
- old_fb = dplane->old_fb;
- dplane->old_fb = fb;
- spin_unlock(&dplane->lock);
+ old_fb = xchg(&dplane->old_fb, fb);
if (old_fb)
armada_drm_queue_unref_work(dplane->base.dev, old_fb);
if (plane->fb)
drm_framebuffer_unreference(plane->fb);
- spin_lock_irq(&dplane->lock);
- fb = dplane->old_fb;
- dplane->old_fb = NULL;
- spin_unlock_irq(&dplane->lock);
+ fb = xchg(&dplane->old_fb, NULL);
if (fb)
drm_framebuffer_unreference(fb);
if (!dplane)
return -ENOMEM;
- spin_lock_init(&dplane->lock);
init_waitqueue_head(&dplane->vbl.wait);
armada_drm_vbl_event_init(&dplane->vbl.update, armada_ovl_plane_vbl,
dplane);