drm/vc4: Fix non-blocking commit getting stuck forever
[linux-block.git] / drivers / gpu / drm / vc4 / vc4_drv.h
index ef73e0aaf7261e5acf49af1e5c03628d6f7786bc..e979001c9233480a620a268abc2e192fdcf71191 100644 (file)
@@ -202,9 +202,6 @@ struct vc4_dev {
 
        int power_refcount;
 
-       /* Set to true when the load tracker is supported. */
-       bool load_tracker_available;
-
        /* Set to true when the load tracker is active. */
        bool load_tracker_enabled;
 
@@ -495,6 +492,25 @@ struct vc4_crtc {
        struct drm_pending_vblank_event *event;
 
        struct debugfs_regset32 regset;
+
+       /**
+        * @feeds_txp: True if the CRTC feeds our writeback controller.
+        */
+       bool feeds_txp;
+
+       /**
+        * @irq_lock: Spinlock protecting the resources shared between
+        * the atomic code and our vblank handler.
+        */
+       spinlock_t irq_lock;
+
+       /**
+        * @current_dlist: Start offset of the display list currently
+        * set in the HVS for that CRTC. Protected by @irq_lock, and
+        * copied in vc4_hvs_update_dlist() for the CRTC interrupt
+        * handler to have access to that value.
+        */
+       unsigned int current_dlist;
 };
 
 static inline struct vc4_crtc *
@@ -517,11 +533,13 @@ vc4_crtc_to_vc4_pv_data(const struct vc4_crtc *crtc)
        return container_of(data, struct vc4_pv_data, base);
 }
 
+struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc,
+                                        struct drm_crtc_state *state);
+
 struct vc4_crtc_state {
        struct drm_crtc_state base;
        /* Dlist area for this CRTC configuration. */
        struct drm_mm_node mm;
-       bool feed_txp;
        bool txp_armed;
        unsigned int assigned_channel;
 
@@ -532,6 +550,8 @@ struct vc4_crtc_state {
                unsigned int bottom;
        } margins;
 
+       unsigned long hvs_load;
+
        /* Transitional state below, only valid during atomic commits */
        bool update_muxing;
 };