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.h42
1 files changed, 26 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f20ffe17df7..0a4f39b9a0e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -31,6 +31,7 @@
31#define _I915_DRV_H_ 31#define _I915_DRV_H_
32 32
33#include "i915_reg.h" 33#include "i915_reg.h"
34#include <linux/io-mapping.h>
34 35
35/* General customization: 36/* General customization:
36 */ 37 */
@@ -46,6 +47,8 @@ enum pipe {
46 PIPE_B, 47 PIPE_B,
47}; 48};
48 49
50#define I915_NUM_PIPE 2
51
49/* Interface history: 52/* Interface history:
50 * 53 *
51 * 1.1: Original. 54 * 1.1: Original.
@@ -87,13 +90,6 @@ struct mem_block {
87 struct drm_file *file_priv; /* NULL: free, -1: heap, other: real files */ 90 struct drm_file *file_priv; /* NULL: free, -1: heap, other: real files */
88}; 91};
89 92
90typedef struct _drm_i915_vbl_swap {
91 struct list_head head;
92 drm_drawable_t drw_id;
93 unsigned int pipe;
94 unsigned int sequence;
95} drm_i915_vbl_swap_t;
96
97struct opregion_header; 93struct opregion_header;
98struct opregion_acpi; 94struct opregion_acpi;
99struct opregion_swsci; 95struct opregion_swsci;
@@ -138,6 +134,7 @@ typedef struct drm_i915_private {
138 int user_irq_refcount; 134 int user_irq_refcount;
139 /** Cached value of IMR to avoid reads in updating the bitfield */ 135 /** Cached value of IMR to avoid reads in updating the bitfield */
140 u32 irq_mask_reg; 136 u32 irq_mask_reg;
137 u32 pipestat[2];
141 138
142 int tex_lru_log_granularity; 139 int tex_lru_log_granularity;
143 int allow_batchbuffer; 140 int allow_batchbuffer;
@@ -145,10 +142,6 @@ typedef struct drm_i915_private {
145 unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds; 142 unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds;
146 int vblank_pipe; 143 int vblank_pipe;
147 144
148 spinlock_t swaps_lock;
149 drm_i915_vbl_swap_t vbl_swaps;
150 unsigned int swaps_pending;
151
152 struct intel_opregion opregion; 145 struct intel_opregion opregion;
153 146
154 /* Register state */ 147 /* Register state */
@@ -156,6 +149,8 @@ typedef struct drm_i915_private {
156 u32 saveDSPACNTR; 149 u32 saveDSPACNTR;
157 u32 saveDSPBCNTR; 150 u32 saveDSPBCNTR;
158 u32 saveDSPARB; 151 u32 saveDSPARB;
152 u32 saveRENDERSTANDBY;
153 u32 saveHWS;
159 u32 savePIPEACONF; 154 u32 savePIPEACONF;
160 u32 savePIPEBCONF; 155 u32 savePIPEBCONF;
161 u32 savePIPEASRC; 156 u32 savePIPEASRC;
@@ -240,12 +235,11 @@ typedef struct drm_i915_private {
240 u8 saveDACDATA[256*3]; /* 256 3-byte colors */ 235 u8 saveDACDATA[256*3]; /* 256 3-byte colors */
241 u8 saveCR[37]; 236 u8 saveCR[37];
242 237
243 /** Work task for vblank-related ring access */
244 struct work_struct vblank_work;
245
246 struct { 238 struct {
247 struct drm_mm gtt_space; 239 struct drm_mm gtt_space;
248 240
241 struct io_mapping *gtt_mapping;
242
249 /** 243 /**
250 * List of objects currently involved in rendering from the 244 * List of objects currently involved in rendering from the
251 * ringbuffer. 245 * ringbuffer.
@@ -441,7 +435,6 @@ extern int i915_irq_wait(struct drm_device *dev, void *data,
441void i915_user_irq_get(struct drm_device *dev); 435void i915_user_irq_get(struct drm_device *dev);
442void i915_user_irq_put(struct drm_device *dev); 436void i915_user_irq_put(struct drm_device *dev);
443 437
444extern void i915_vblank_work_handler(struct work_struct *work);
445extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); 438extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS);
446extern void i915_driver_irq_preinstall(struct drm_device * dev); 439extern void i915_driver_irq_preinstall(struct drm_device * dev);
447extern int i915_driver_irq_postinstall(struct drm_device *dev); 440extern int i915_driver_irq_postinstall(struct drm_device *dev);
@@ -457,6 +450,13 @@ extern int i915_vblank_swap(struct drm_device *dev, void *data,
457 struct drm_file *file_priv); 450 struct drm_file *file_priv);
458extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask); 451extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask);
459 452
453void
454i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
455
456void
457i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
458
459
460/* i915_mem.c */ 460/* i915_mem.c */
461extern int i915_mem_alloc(struct drm_device *dev, void *data, 461extern int i915_mem_alloc(struct drm_device *dev, void *data,
462 struct drm_file *file_priv); 462 struct drm_file *file_priv);
@@ -502,6 +502,8 @@ int i915_gem_set_tiling(struct drm_device *dev, void *data,
502 struct drm_file *file_priv); 502 struct drm_file *file_priv);
503int i915_gem_get_tiling(struct drm_device *dev, void *data, 503int i915_gem_get_tiling(struct drm_device *dev, void *data,
504 struct drm_file *file_priv); 504 struct drm_file *file_priv);
505int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
506 struct drm_file *file_priv);
505void i915_gem_load(struct drm_device *dev); 507void i915_gem_load(struct drm_device *dev);
506int i915_gem_proc_init(struct drm_minor *minor); 508int i915_gem_proc_init(struct drm_minor *minor);
507void i915_gem_proc_cleanup(struct drm_minor *minor); 509void i915_gem_proc_cleanup(struct drm_minor *minor);
@@ -539,11 +541,18 @@ extern int i915_restore_state(struct drm_device *dev);
539extern int i915_save_state(struct drm_device *dev); 541extern int i915_save_state(struct drm_device *dev);
540extern int i915_restore_state(struct drm_device *dev); 542extern int i915_restore_state(struct drm_device *dev);
541 543
544#ifdef CONFIG_ACPI
542/* i915_opregion.c */ 545/* i915_opregion.c */
543extern int intel_opregion_init(struct drm_device *dev); 546extern int intel_opregion_init(struct drm_device *dev);
544extern void intel_opregion_free(struct drm_device *dev); 547extern void intel_opregion_free(struct drm_device *dev);
545extern void opregion_asle_intr(struct drm_device *dev); 548extern void opregion_asle_intr(struct drm_device *dev);
546extern void opregion_enable_asle(struct drm_device *dev); 549extern void opregion_enable_asle(struct drm_device *dev);
550#else
551static inline int intel_opregion_init(struct drm_device *dev) { return 0; }
552static inline void intel_opregion_free(struct drm_device *dev) { return; }
553static inline void opregion_asle_intr(struct drm_device *dev) { return; }
554static inline void opregion_enable_asle(struct drm_device *dev) { return; }
555#endif
547 556
548/** 557/**
549 * Lock test for when it's just for synchronization of ring access. 558 * Lock test for when it's just for synchronization of ring access.
@@ -610,8 +619,9 @@ extern void opregion_enable_asle(struct drm_device *dev);
610 * The area from dword 0x20 to 0x3ff is available for driver usage. 619 * The area from dword 0x20 to 0x3ff is available for driver usage.
611 */ 620 */
612#define READ_HWSP(dev_priv, reg) (((volatile u32*)(dev_priv->hw_status_page))[reg]) 621#define READ_HWSP(dev_priv, reg) (((volatile u32*)(dev_priv->hw_status_page))[reg])
613#define READ_BREADCRUMB(dev_priv) READ_HWSP(dev_priv, 5) 622#define READ_BREADCRUMB(dev_priv) READ_HWSP(dev_priv, I915_BREADCRUMB_INDEX)
614#define I915_GEM_HWS_INDEX 0x20 623#define I915_GEM_HWS_INDEX 0x20
624#define I915_BREADCRUMB_INDEX 0x21
615 625
616extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); 626extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
617 627