drm/vc4: crtc: Copy assigned channel to the CRTC
[linux-2.6-microblaze.git] / drivers / gpu / drm / vc4 / vc4_hvs.c
index f8ed0f6..604933e 100644 (file)
@@ -393,6 +393,18 @@ static void vc4_hvs_update_dlist(struct drm_crtc *crtc)
        spin_unlock_irqrestore(&vc4_crtc->irq_lock, flags);
 }
 
+void vc4_hvs_atomic_begin(struct drm_crtc *crtc,
+                         struct drm_atomic_state *state)
+{
+       struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
+       struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
+       unsigned long flags;
+
+       spin_lock_irqsave(&vc4_crtc->irq_lock, flags);
+       vc4_crtc->current_hvs_channel = vc4_state->assigned_channel;
+       spin_unlock_irqrestore(&vc4_crtc->irq_lock, flags);
+}
+
 void vc4_hvs_atomic_enable(struct drm_crtc *crtc,
                           struct drm_atomic_state *state)
 {