diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-09-30 15:14:26 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-10-17 17:10:11 -0400 |
commit | 0a3e67a4caac273a3bfc4ced3da364830b1ab241 (patch) | |
tree | 02a2e5e76d9dffcb556d09b0eee4d34ebe5d81cb /drivers/gpu/drm/i915/i915_drv.h | |
parent | 2df68b439fcb97a4c55f81516206ef4ee325e28d (diff) |
drm: Rework vblank-wait handling to allow interrupt reduction.
Previously, drivers supporting vblank interrupt waits would run the interrupt
all the time, or all the time that any 3d client was running, preventing the
CPU from sleeping for long when the system was otherwise idle. Now, interrupts
are disabled any time that no client is waiting on a vblank event. The new
method uses vblank counters on the chipsets when the interrupts are turned
off, rather than counting interrupts, so that we can continue to present
accurate vblank numbers.
Co-author: Michel Dänzer <michel@tungstengraphics.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 71326ca9367a..d1a02bead458 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -83,10 +83,15 @@ struct mem_block { | |||
83 | typedef struct _drm_i915_vbl_swap { | 83 | typedef struct _drm_i915_vbl_swap { |
84 | struct list_head head; | 84 | struct list_head head; |
85 | drm_drawable_t drw_id; | 85 | drm_drawable_t drw_id; |
86 | unsigned int pipe; | 86 | unsigned int plane; |
87 | unsigned int sequence; | 87 | unsigned int sequence; |
88 | } drm_i915_vbl_swap_t; | 88 | } drm_i915_vbl_swap_t; |
89 | 89 | ||
90 | struct opregion_header; | ||
91 | struct opregion_acpi; | ||
92 | struct opregion_swsci; | ||
93 | struct opregion_asle; | ||
94 | |||
90 | struct intel_opregion { | 95 | struct intel_opregion { |
91 | struct opregion_header *header; | 96 | struct opregion_header *header; |
92 | struct opregion_acpi *acpi; | 97 | struct opregion_acpi *acpi; |
@@ -105,7 +110,7 @@ typedef struct drm_i915_private { | |||
105 | drm_dma_handle_t *status_page_dmah; | 110 | drm_dma_handle_t *status_page_dmah; |
106 | void *hw_status_page; | 111 | void *hw_status_page; |
107 | dma_addr_t dma_status_page; | 112 | dma_addr_t dma_status_page; |
108 | unsigned long counter; | 113 | uint32_t counter; |
109 | unsigned int status_gfx_addr; | 114 | unsigned int status_gfx_addr; |
110 | drm_local_map_t hws_map; | 115 | drm_local_map_t hws_map; |
111 | 116 | ||
@@ -247,16 +252,17 @@ extern int i915_irq_emit(struct drm_device *dev, void *data, | |||
247 | extern int i915_irq_wait(struct drm_device *dev, void *data, | 252 | extern int i915_irq_wait(struct drm_device *dev, void *data, |
248 | struct drm_file *file_priv); | 253 | struct drm_file *file_priv); |
249 | 254 | ||
250 | extern int i915_driver_vblank_wait(struct drm_device *dev, unsigned int *sequence); | ||
251 | extern int i915_driver_vblank_wait2(struct drm_device *dev, unsigned int *sequence); | ||
252 | extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); | 255 | extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); |
253 | extern void i915_driver_irq_preinstall(struct drm_device * dev); | 256 | extern void i915_driver_irq_preinstall(struct drm_device * dev); |
254 | extern void i915_driver_irq_postinstall(struct drm_device * dev); | 257 | extern int i915_driver_irq_postinstall(struct drm_device *dev); |
255 | extern void i915_driver_irq_uninstall(struct drm_device * dev); | 258 | extern void i915_driver_irq_uninstall(struct drm_device * dev); |
256 | extern int i915_vblank_pipe_set(struct drm_device *dev, void *data, | 259 | extern int i915_vblank_pipe_set(struct drm_device *dev, void *data, |
257 | struct drm_file *file_priv); | 260 | struct drm_file *file_priv); |
258 | extern int i915_vblank_pipe_get(struct drm_device *dev, void *data, | 261 | extern int i915_vblank_pipe_get(struct drm_device *dev, void *data, |
259 | struct drm_file *file_priv); | 262 | struct drm_file *file_priv); |
263 | extern int i915_enable_vblank(struct drm_device *dev, int crtc); | ||
264 | extern void i915_disable_vblank(struct drm_device *dev, int crtc); | ||
265 | extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc); | ||
260 | extern int i915_vblank_swap(struct drm_device *dev, void *data, | 266 | extern int i915_vblank_swap(struct drm_device *dev, void *data, |
261 | struct drm_file *file_priv); | 267 | struct drm_file *file_priv); |
262 | extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask); | 268 | extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask); |
@@ -278,6 +284,10 @@ extern void i915_mem_release(struct drm_device * dev, | |||
278 | extern int i915_save_state(struct drm_device *dev); | 284 | extern int i915_save_state(struct drm_device *dev); |
279 | extern int i915_restore_state(struct drm_device *dev); | 285 | extern int i915_restore_state(struct drm_device *dev); |
280 | 286 | ||
287 | /* i915_suspend.c */ | ||
288 | extern int i915_save_state(struct drm_device *dev); | ||
289 | extern int i915_restore_state(struct drm_device *dev); | ||
290 | |||
281 | /* i915_opregion.c */ | 291 | /* i915_opregion.c */ |
282 | extern int intel_opregion_init(struct drm_device *dev); | 292 | extern int intel_opregion_init(struct drm_device *dev); |
283 | extern void intel_opregion_free(struct drm_device *dev); | 293 | extern void intel_opregion_free(struct drm_device *dev); |