aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0a91554e0aa1..8a92174109c2 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1361,6 +1361,37 @@ struct drm_i915_gem_object {
1361 1361
1362#define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base) 1362#define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
1363 1363
1364/* Offset of the first PTE pointing to this object */
1365static inline unsigned long
1366i915_gem_obj_ggtt_offset(struct drm_i915_gem_object *o)
1367{
1368 return o->gtt_space->start;
1369}
1370
1371/* Whether or not this object is currently mapped by the translation tables */
1372static inline bool
1373i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *o)
1374{
1375 return o->gtt_space != NULL;
1376}
1377
1378/* The size used in the translation tables may be larger than the actual size of
1379 * the object on GEN2/GEN3 because of the way tiling is handled. See
1380 * i915_gem_get_gtt_size() for more details.
1381 */
1382static inline unsigned long
1383i915_gem_obj_ggtt_size(struct drm_i915_gem_object *o)
1384{
1385 return o->gtt_space->size;
1386}
1387
1388static inline void
1389i915_gem_obj_ggtt_set_color(struct drm_i915_gem_object *o,
1390 enum i915_cache_level color)
1391{
1392 o->gtt_space->color = color;
1393}
1394
1364/** 1395/**
1365 * Request queue structure. 1396 * Request queue structure.
1366 * 1397 *