diff options
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_drv.h')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 75e6d10281a8..ee564f0a4fb0 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | |||
@@ -79,6 +79,7 @@ struct vmw_resource { | |||
79 | int id; | 79 | int id; |
80 | enum ttm_object_type res_type; | 80 | enum ttm_object_type res_type; |
81 | bool avail; | 81 | bool avail; |
82 | void (*remove_from_lists) (struct vmw_resource *res); | ||
82 | void (*hw_destroy) (struct vmw_resource *res); | 83 | void (*hw_destroy) (struct vmw_resource *res); |
83 | void (*res_free) (struct vmw_resource *res); | 84 | void (*res_free) (struct vmw_resource *res); |
84 | struct list_head validate_head; | 85 | struct list_head validate_head; |
@@ -99,9 +100,11 @@ struct vmw_cursor_snooper { | |||
99 | }; | 100 | }; |
100 | 101 | ||
101 | struct vmw_framebuffer; | 102 | struct vmw_framebuffer; |
103 | struct vmw_surface_offset; | ||
102 | 104 | ||
103 | struct vmw_surface { | 105 | struct vmw_surface { |
104 | struct vmw_resource res; | 106 | struct vmw_resource res; |
107 | struct list_head lru_head; /* Protected by the resource lock */ | ||
105 | uint32_t flags; | 108 | uint32_t flags; |
106 | uint32_t format; | 109 | uint32_t format; |
107 | uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES]; | 110 | uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES]; |
@@ -112,6 +115,9 @@ struct vmw_surface { | |||
112 | 115 | ||
113 | /* TODO so far just a extra pointer */ | 116 | /* TODO so far just a extra pointer */ |
114 | struct vmw_cursor_snooper snooper; | 117 | struct vmw_cursor_snooper snooper; |
118 | struct ttm_buffer_object *backup; | ||
119 | struct vmw_surface_offset *offsets; | ||
120 | uint32_t backup_size; | ||
115 | }; | 121 | }; |
116 | 122 | ||
117 | struct vmw_marker_queue { | 123 | struct vmw_marker_queue { |
@@ -310,6 +316,16 @@ struct vmw_private { | |||
310 | struct ttm_buffer_object *pinned_bo; | 316 | struct ttm_buffer_object *pinned_bo; |
311 | uint32_t query_cid; | 317 | uint32_t query_cid; |
312 | bool dummy_query_bo_pinned; | 318 | bool dummy_query_bo_pinned; |
319 | |||
320 | /* | ||
321 | * Surface swapping. The "surface_lru" list is protected by the | ||
322 | * resource lock in order to be able to destroy a surface and take | ||
323 | * it off the lru atomically. "used_memory_size" is currently | ||
324 | * protected by the cmdbuf mutex for simplicity. | ||
325 | */ | ||
326 | |||
327 | struct list_head surface_lru; | ||
328 | uint32_t used_memory_size; | ||
313 | }; | 329 | }; |
314 | 330 | ||
315 | static inline struct vmw_private *vmw_priv(struct drm_device *dev) | 331 | static inline struct vmw_private *vmw_priv(struct drm_device *dev) |
@@ -389,6 +405,8 @@ extern int vmw_surface_reference_ioctl(struct drm_device *dev, void *data, | |||
389 | extern int vmw_surface_check(struct vmw_private *dev_priv, | 405 | extern int vmw_surface_check(struct vmw_private *dev_priv, |
390 | struct ttm_object_file *tfile, | 406 | struct ttm_object_file *tfile, |
391 | uint32_t handle, int *id); | 407 | uint32_t handle, int *id); |
408 | extern int vmw_surface_validate(struct vmw_private *dev_priv, | ||
409 | struct vmw_surface *srf); | ||
392 | extern void vmw_dmabuf_bo_free(struct ttm_buffer_object *bo); | 410 | extern void vmw_dmabuf_bo_free(struct ttm_buffer_object *bo); |
393 | extern int vmw_dmabuf_init(struct vmw_private *dev_priv, | 411 | extern int vmw_dmabuf_init(struct vmw_private *dev_priv, |
394 | struct vmw_dma_buffer *vmw_bo, | 412 | struct vmw_dma_buffer *vmw_bo, |
@@ -412,6 +430,7 @@ extern int vmw_user_stream_lookup(struct vmw_private *dev_priv, | |||
412 | struct ttm_object_file *tfile, | 430 | struct ttm_object_file *tfile, |
413 | uint32_t *inout_id, | 431 | uint32_t *inout_id, |
414 | struct vmw_resource **out); | 432 | struct vmw_resource **out); |
433 | extern void vmw_resource_unreserve(struct list_head *list); | ||
415 | 434 | ||
416 | /** | 435 | /** |
417 | * DMA buffer helper routines - vmwgfx_dmabuf.c | 436 | * DMA buffer helper routines - vmwgfx_dmabuf.c |
@@ -486,6 +505,7 @@ extern struct ttm_placement vmw_vram_gmr_placement; | |||
486 | extern struct ttm_placement vmw_vram_gmr_ne_placement; | 505 | extern struct ttm_placement vmw_vram_gmr_ne_placement; |
487 | extern struct ttm_placement vmw_sys_placement; | 506 | extern struct ttm_placement vmw_sys_placement; |
488 | extern struct ttm_placement vmw_evictable_placement; | 507 | extern struct ttm_placement vmw_evictable_placement; |
508 | extern struct ttm_placement vmw_srf_placement; | ||
489 | extern struct ttm_bo_driver vmw_bo_driver; | 509 | extern struct ttm_bo_driver vmw_bo_driver; |
490 | extern int vmw_dma_quiescent(struct drm_device *dev); | 510 | extern int vmw_dma_quiescent(struct drm_device *dev); |
491 | 511 | ||
@@ -508,6 +528,12 @@ extern void | |||
508 | vmw_execbuf_release_pinned_bo(struct vmw_private *dev_priv, | 528 | vmw_execbuf_release_pinned_bo(struct vmw_private *dev_priv, |
509 | bool only_on_cid_match, uint32_t cid); | 529 | bool only_on_cid_match, uint32_t cid); |
510 | 530 | ||
531 | extern int vmw_execbuf_fence_commands(struct drm_file *file_priv, | ||
532 | struct vmw_private *dev_priv, | ||
533 | struct vmw_fence_obj **p_fence, | ||
534 | uint32_t *p_handle); | ||
535 | |||
536 | |||
511 | /** | 537 | /** |
512 | * IRQs and wating - vmwgfx_irq.c | 538 | * IRQs and wating - vmwgfx_irq.c |
513 | */ | 539 | */ |