drm/i915/skl: Add DDB allocation management structures
authorDamien Lespiau <damien.lespiau@intel.com>
Tue, 4 Nov 2014 17:06:41 +0000 (17:06 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 7 Nov 2014 17:42:04 +0000 (18:42 +0100)
We now need to allocate space in the DDB for planes being scanned out
ourselves. The data structure to represent an allocation mirrors what
we'll need to write in the registers later on: (start, end).

We add that allocation datat to the skl_wm_values structure as part of
the values to program the hardware with.

v2: Split planes and cursor for consistency.

v3: Make the skl_ddb_entry_size() parameter const

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h

index 19bc2d057a87d63aa6d1e72208768984903e55d0..aa8607a9e49c2dfa76a346221cb16673b1add3a7 100644 (file)
@@ -1387,8 +1387,27 @@ struct ilk_wm_values {
        enum intel_ddb_partitioning partitioning;
 };
 
+struct skl_ddb_entry {
+       uint16_t start, end;    /* in number of blocks */
+};
+
+static inline uint16_t skl_ddb_entry_size(const struct skl_ddb_entry *entry)
+{
+       /* end not set, clearly no allocation here. start can be 0 though */
+       if (entry->end == 0)
+               return 0;
+
+       return entry->end - entry->start + 1;
+}
+
+struct skl_ddb_allocation {
+       struct skl_ddb_entry plane[I915_MAX_PIPES][I915_MAX_PLANES];
+       struct skl_ddb_entry cursor[I915_MAX_PIPES];
+};
+
 struct skl_wm_values {
        bool dirty[I915_MAX_PIPES];
+       struct skl_ddb_allocation ddb;
        uint32_t wm_linetime[I915_MAX_PIPES];
        uint32_t plane[I915_MAX_PIPES][I915_MAX_PLANES][8];
        uint32_t cursor[I915_MAX_PIPES][8];