summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_object.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-02-01 09:06:26 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-02-01 09:06:26 +0100
commit45bf86e7731606a475b7f989486de23b0784bfe7 (patch)
treedac8a776783d6322bedf346060fb6000251c8b40 /drivers/gpu/drm/i915/i915_gem_object.h
parent059c7a5a748d4e7481d8b1b4cf0e182cb81496ad (diff)
parent18566acac18f5784347bc5fe636a26897d1c963b (diff)
downloadblackbird-op-linux-45bf86e7731606a475b7f989486de23b0784bfe7.tar.gz
blackbird-op-linux-45bf86e7731606a475b7f989486de23b0784bfe7.zip
Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next
Backmerge to resync and also so that Ville can apply a cleanup patch from Takashi. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_object.h')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_object.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_object.h b/drivers/gpu/drm/i915/i915_gem_object.h
index 6a368de9d81e..290eaa7fc9eb 100644
--- a/drivers/gpu/drm/i915/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/i915_gem_object.h
@@ -317,6 +317,29 @@ i915_gem_object_get_stride(struct drm_i915_gem_object *obj)
return obj->tiling_and_stride & STRIDE_MASK;
}
+static inline unsigned int
+i915_gem_tile_height(unsigned int tiling)
+{
+ GEM_BUG_ON(!tiling);
+ return tiling == I915_TILING_Y ? 32 : 8;
+}
+
+static inline unsigned int
+i915_gem_object_get_tile_height(struct drm_i915_gem_object *obj)
+{
+ return i915_gem_tile_height(i915_gem_object_get_tiling(obj));
+}
+
+static inline unsigned int
+i915_gem_object_get_tile_row_size(struct drm_i915_gem_object *obj)
+{
+ return (i915_gem_object_get_stride(obj) *
+ i915_gem_object_get_tile_height(obj));
+}
+
+int i915_gem_object_set_tiling(struct drm_i915_gem_object *obj,
+ unsigned int tiling, unsigned int stride);
+
static inline struct intel_engine_cs *
i915_gem_object_last_write_engine(struct drm_i915_gem_object *obj)
{
OpenPOWER on IntegriCloud