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.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ba096f9a7641..85a072e80637 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -107,6 +107,11 @@ struct drm_i915_master_private {
107 drm_local_map_t *sarea; 107 drm_local_map_t *sarea;
108 struct _drm_i915_sarea *sarea_priv; 108 struct _drm_i915_sarea *sarea_priv;
109}; 109};
110#define I915_FENCE_REG_NONE -1
111
112struct drm_i915_fence_reg {
113 struct drm_gem_object *obj;
114};
110 115
111typedef struct drm_i915_private { 116typedef struct drm_i915_private {
112 struct drm_device *dev; 117 struct drm_device *dev;
@@ -149,6 +154,10 @@ typedef struct drm_i915_private {
149 154
150 struct intel_opregion opregion; 155 struct intel_opregion opregion;
151 156
157 struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
158 int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
159 int num_fence_regs; /* 8 on pre-965, 16 otherwise */
160
152 /* Register state */ 161 /* Register state */
153 u8 saveLBB; 162 u8 saveLBB;
154 u32 saveDSPACNTR; 163 u32 saveDSPACNTR;
@@ -367,6 +376,21 @@ struct drm_i915_gem_object {
367 * This is the same as gtt_space->start 376 * This is the same as gtt_space->start
368 */ 377 */
369 uint32_t gtt_offset; 378 uint32_t gtt_offset;
379 /**
380 * Required alignment for the object
381 */
382 uint32_t gtt_alignment;
383 /**
384 * Fake offset for use by mmap(2)
385 */
386 uint64_t mmap_offset;
387
388 /**
389 * Fence register bits (if any) for this object. Will be set
390 * as needed when mapped into the GTT.
391 * Protected by dev->struct_mutex.
392 */
393 int fence_reg;
370 394
371 /** Boolean whether this object has a valid gtt offset. */ 395 /** Boolean whether this object has a valid gtt offset. */
372 int gtt_bound; 396 int gtt_bound;
@@ -379,6 +403,7 @@ struct drm_i915_gem_object {
379 403
380 /** Current tiling mode for the object. */ 404 /** Current tiling mode for the object. */
381 uint32_t tiling_mode; 405 uint32_t tiling_mode;
406 uint32_t stride;
382 407
383 /** AGP mapping type (AGP_USER_MEMORY or AGP_USER_CACHED_MEMORY */ 408 /** AGP mapping type (AGP_USER_MEMORY or AGP_USER_CACHED_MEMORY */
384 uint32_t agp_type; 409 uint32_t agp_type;
@@ -493,6 +518,8 @@ int i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
493 struct drm_file *file_priv); 518 struct drm_file *file_priv);
494int i915_gem_mmap_ioctl(struct drm_device *dev, void *data, 519int i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
495 struct drm_file *file_priv); 520 struct drm_file *file_priv);
521int i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data,
522 struct drm_file *file_priv);
496int i915_gem_set_domain_ioctl(struct drm_device *dev, void *data, 523int i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
497 struct drm_file *file_priv); 524 struct drm_file *file_priv);
498int i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data, 525int i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
@@ -529,6 +556,7 @@ uint32_t i915_get_gem_seqno(struct drm_device *dev);
529void i915_gem_retire_requests(struct drm_device *dev); 556void i915_gem_retire_requests(struct drm_device *dev);
530void i915_gem_retire_work_handler(struct work_struct *work); 557void i915_gem_retire_work_handler(struct work_struct *work);
531void i915_gem_clflush_object(struct drm_gem_object *obj); 558void i915_gem_clflush_object(struct drm_gem_object *obj);
559int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
532 560
533/* i915_gem_tiling.c */ 561/* i915_gem_tiling.c */
534void i915_gem_detect_bit_6_swizzle(struct drm_device *dev); 562void i915_gem_detect_bit_6_swizzle(struct drm_device *dev);
@@ -584,6 +612,13 @@ static inline void opregion_enable_asle(struct drm_device *dev) { return; }
584#define I915_WRITE16(reg, val) writel(val, dev_priv->regs + (reg)) 612#define I915_WRITE16(reg, val) writel(val, dev_priv->regs + (reg))
585#define I915_READ8(reg) readb(dev_priv->regs + (reg)) 613#define I915_READ8(reg) readb(dev_priv->regs + (reg))
586#define I915_WRITE8(reg, val) writeb(val, dev_priv->regs + (reg)) 614#define I915_WRITE8(reg, val) writeb(val, dev_priv->regs + (reg))
615#ifdef writeq
616#define I915_WRITE64(reg, val) writeq(val, dev_priv->regs + (reg))
617#else
618#define I915_WRITE64(reg, val) (writel(val, dev_priv->regs + (reg)), \
619 writel(upper_32_bits(val), dev_priv->regs + \
620 (reg) + 4))
621#endif
587 622
588#define I915_VERBOSE 0 623#define I915_VERBOSE 0
589 624