diff options
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_drv.h')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 356dc935ec13..eaad52095339 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | |||
@@ -41,12 +41,13 @@ | |||
41 | 41 | ||
42 | #define VMWGFX_DRIVER_DATE "20100209" | 42 | #define VMWGFX_DRIVER_DATE "20100209" |
43 | #define VMWGFX_DRIVER_MAJOR 1 | 43 | #define VMWGFX_DRIVER_MAJOR 1 |
44 | #define VMWGFX_DRIVER_MINOR 0 | 44 | #define VMWGFX_DRIVER_MINOR 2 |
45 | #define VMWGFX_DRIVER_PATCHLEVEL 0 | 45 | #define VMWGFX_DRIVER_PATCHLEVEL 0 |
46 | #define VMWGFX_FILE_PAGE_OFFSET 0x00100000 | 46 | #define VMWGFX_FILE_PAGE_OFFSET 0x00100000 |
47 | #define VMWGFX_FIFO_STATIC_SIZE (1024*1024) | 47 | #define VMWGFX_FIFO_STATIC_SIZE (1024*1024) |
48 | #define VMWGFX_MAX_RELOCATIONS 2048 | 48 | #define VMWGFX_MAX_RELOCATIONS 2048 |
49 | #define VMWGFX_MAX_GMRS 2048 | 49 | #define VMWGFX_MAX_GMRS 2048 |
50 | #define VMWGFX_MAX_DISPLAYS 16 | ||
50 | 51 | ||
51 | struct vmw_fpriv { | 52 | struct vmw_fpriv { |
52 | struct drm_master *locked_master; | 53 | struct drm_master *locked_master; |
@@ -102,6 +103,13 @@ struct vmw_surface { | |||
102 | struct vmw_cursor_snooper snooper; | 103 | struct vmw_cursor_snooper snooper; |
103 | }; | 104 | }; |
104 | 105 | ||
106 | struct vmw_fence_queue { | ||
107 | struct list_head head; | ||
108 | struct timespec lag; | ||
109 | struct timespec lag_time; | ||
110 | spinlock_t lock; | ||
111 | }; | ||
112 | |||
105 | struct vmw_fifo_state { | 113 | struct vmw_fifo_state { |
106 | unsigned long reserved_size; | 114 | unsigned long reserved_size; |
107 | __le32 *dynamic_buffer; | 115 | __le32 *dynamic_buffer; |
@@ -115,6 +123,7 @@ struct vmw_fifo_state { | |||
115 | uint32_t capabilities; | 123 | uint32_t capabilities; |
116 | struct mutex fifo_mutex; | 124 | struct mutex fifo_mutex; |
117 | struct rw_semaphore rwsem; | 125 | struct rw_semaphore rwsem; |
126 | struct vmw_fence_queue fence_queue; | ||
118 | }; | 127 | }; |
119 | 128 | ||
120 | struct vmw_relocation { | 129 | struct vmw_relocation { |
@@ -144,6 +153,14 @@ struct vmw_master { | |||
144 | struct ttm_lock lock; | 153 | struct ttm_lock lock; |
145 | }; | 154 | }; |
146 | 155 | ||
156 | struct vmw_vga_topology_state { | ||
157 | uint32_t width; | ||
158 | uint32_t height; | ||
159 | uint32_t primary; | ||
160 | uint32_t pos_x; | ||
161 | uint32_t pos_y; | ||
162 | }; | ||
163 | |||
147 | struct vmw_private { | 164 | struct vmw_private { |
148 | struct ttm_bo_device bdev; | 165 | struct ttm_bo_device bdev; |
149 | struct ttm_bo_global_ref bo_global_ref; | 166 | struct ttm_bo_global_ref bo_global_ref; |
@@ -171,14 +188,19 @@ struct vmw_private { | |||
171 | * VGA registers. | 188 | * VGA registers. |
172 | */ | 189 | */ |
173 | 190 | ||
191 | struct vmw_vga_topology_state vga_save[VMWGFX_MAX_DISPLAYS]; | ||
174 | uint32_t vga_width; | 192 | uint32_t vga_width; |
175 | uint32_t vga_height; | 193 | uint32_t vga_height; |
176 | uint32_t vga_depth; | 194 | uint32_t vga_depth; |
177 | uint32_t vga_bpp; | 195 | uint32_t vga_bpp; |
178 | uint32_t vga_pseudo; | 196 | uint32_t vga_pseudo; |
179 | uint32_t vga_red_mask; | 197 | uint32_t vga_red_mask; |
180 | uint32_t vga_blue_mask; | ||
181 | uint32_t vga_green_mask; | 198 | uint32_t vga_green_mask; |
199 | uint32_t vga_blue_mask; | ||
200 | uint32_t vga_bpl; | ||
201 | uint32_t vga_pitchlock; | ||
202 | |||
203 | uint32_t num_displays; | ||
182 | 204 | ||
183 | /* | 205 | /* |
184 | * Framebuffer info. | 206 | * Framebuffer info. |
@@ -393,6 +415,7 @@ extern int vmw_fifo_send_fence(struct vmw_private *dev_priv, | |||
393 | extern void vmw_fifo_ping_host(struct vmw_private *dev_priv, uint32_t reason); | 415 | extern void vmw_fifo_ping_host(struct vmw_private *dev_priv, uint32_t reason); |
394 | extern int vmw_fifo_mmap(struct file *filp, struct vm_area_struct *vma); | 416 | extern int vmw_fifo_mmap(struct file *filp, struct vm_area_struct *vma); |
395 | extern bool vmw_fifo_have_3d(struct vmw_private *dev_priv); | 417 | extern bool vmw_fifo_have_3d(struct vmw_private *dev_priv); |
418 | extern bool vmw_fifo_have_pitchlock(struct vmw_private *dev_priv); | ||
396 | 419 | ||
397 | /** | 420 | /** |
398 | * TTM glue - vmwgfx_ttm_glue.c | 421 | * TTM glue - vmwgfx_ttm_glue.c |
@@ -441,6 +464,23 @@ extern int vmw_fallback_wait(struct vmw_private *dev_priv, | |||
441 | uint32_t sequence, | 464 | uint32_t sequence, |
442 | bool interruptible, | 465 | bool interruptible, |
443 | unsigned long timeout); | 466 | unsigned long timeout); |
467 | extern void vmw_update_sequence(struct vmw_private *dev_priv, | ||
468 | struct vmw_fifo_state *fifo_state); | ||
469 | |||
470 | |||
471 | /** | ||
472 | * Rudimentary fence objects currently used only for throttling - | ||
473 | * vmwgfx_fence.c | ||
474 | */ | ||
475 | |||
476 | extern void vmw_fence_queue_init(struct vmw_fence_queue *queue); | ||
477 | extern void vmw_fence_queue_takedown(struct vmw_fence_queue *queue); | ||
478 | extern int vmw_fence_push(struct vmw_fence_queue *queue, | ||
479 | uint32_t sequence); | ||
480 | extern int vmw_fence_pull(struct vmw_fence_queue *queue, | ||
481 | uint32_t signaled_sequence); | ||
482 | extern int vmw_wait_lag(struct vmw_private *dev_priv, | ||
483 | struct vmw_fence_queue *queue, uint32_t us); | ||
444 | 484 | ||
445 | /** | 485 | /** |
446 | * Kernel framebuffer - vmwgfx_fb.c | 486 | * Kernel framebuffer - vmwgfx_fb.c |
@@ -466,6 +506,11 @@ void vmw_kms_cursor_snoop(struct vmw_surface *srf, | |||
466 | struct ttm_object_file *tfile, | 506 | struct ttm_object_file *tfile, |
467 | struct ttm_buffer_object *bo, | 507 | struct ttm_buffer_object *bo, |
468 | SVGA3dCmdHeader *header); | 508 | SVGA3dCmdHeader *header); |
509 | void vmw_kms_write_svga(struct vmw_private *vmw_priv, | ||
510 | unsigned width, unsigned height, unsigned pitch, | ||
511 | unsigned bbp, unsigned depth); | ||
512 | int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data, | ||
513 | struct drm_file *file_priv); | ||
469 | 514 | ||
470 | /** | 515 | /** |
471 | * Overlay control - vmwgfx_overlay.c | 516 | * Overlay control - vmwgfx_overlay.c |