Rev 4569 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4569 | Rev 5078 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | #include |
34 | #include |
35 | #include |
35 | #include |
36 | //#include |
36 | //#include |
37 | #include |
37 | #include |
38 | #include |
38 | #include |
39 | //#include |
39 | #include |
40 | #include |
40 | #include |
41 | //#include |
41 | //#include |
42 | #include "vmwgfx_fence.h" |
42 | #include "vmwgfx_fence.h" |
Line 43... | Line 43... | ||
43 | 43 | ||
44 | #define VMWGFX_DRIVER_DATE "20121114" |
44 | #define VMWGFX_DRIVER_DATE "20140704" |
45 | #define VMWGFX_DRIVER_MAJOR 2 |
45 | #define VMWGFX_DRIVER_MAJOR 2 |
46 | #define VMWGFX_DRIVER_MINOR 5 |
46 | #define VMWGFX_DRIVER_MINOR 6 |
47 | #define VMWGFX_DRIVER_PATCHLEVEL 0 |
47 | #define VMWGFX_DRIVER_PATCHLEVEL 1 |
48 | #define VMWGFX_FILE_PAGE_OFFSET 0x00100000 |
48 | #define VMWGFX_FILE_PAGE_OFFSET 0x00100000 |
49 | #define VMWGFX_FIFO_STATIC_SIZE (1024*1024) |
49 | #define VMWGFX_FIFO_STATIC_SIZE (1024*1024) |
50 | #define VMWGFX_MAX_RELOCATIONS 2048 |
50 | #define VMWGFX_MAX_RELOCATIONS 2048 |
51 | #define VMWGFX_MAX_VALIDATIONS 2048 |
51 | #define VMWGFX_MAX_VALIDATIONS 2048 |
Line 87... | Line 87... | ||
87 | u32 v; |
87 | u32 v; |
88 | asm volatile("inl %1,%0" : "=a" (v) : "dN" (port)); |
88 | asm volatile("inl %1,%0" : "=a" (v) : "dN" (port)); |
89 | return v; |
89 | return v; |
90 | } |
90 | } |
Line 91... | Line -... | ||
91 | - | ||
92 | struct ttm_lock{}; |
- | |
Line 93... | Line 91... | ||
93 | struct ww_acquire_ctx{}; |
91 | |
94 | 92 | ||
95 | struct vmw_fpriv { |
93 | struct vmw_fpriv { |
96 | // struct drm_master *locked_master; |
94 | // struct drm_master *locked_master; |
- | 95 | struct ttm_object_file *tfile; |
|
97 | struct ttm_object_file *tfile; |
96 | struct list_head fence_events; |
Line 98... | Line 97... | ||
98 | struct list_head fence_events; |
97 | bool gb_aware; |
99 | }; |
98 | }; |
100 | 99 | ||
Line 135... | Line 134... | ||
135 | struct list_head binding_head; /* Protected by binding_mutex */ |
134 | struct list_head binding_head; /* Protected by binding_mutex */ |
136 | void (*res_free) (struct vmw_resource *res); |
135 | void (*res_free) (struct vmw_resource *res); |
137 | void (*hw_destroy) (struct vmw_resource *res); |
136 | void (*hw_destroy) (struct vmw_resource *res); |
138 | }; |
137 | }; |
Line -... | Line 138... | ||
- | 138 | ||
- | 139 | ||
- | 140 | /* |
|
- | 141 | * Resources that are managed using ioctls. |
|
139 | 142 | */ |
|
140 | enum vmw_res_type { |
143 | enum vmw_res_type { |
141 | vmw_res_context, |
144 | vmw_res_context, |
142 | vmw_res_surface, |
145 | vmw_res_surface, |
143 | vmw_res_stream, |
146 | vmw_res_stream, |
144 | vmw_res_shader, |
147 | vmw_res_shader, |
145 | vmw_res_max |
148 | vmw_res_max |
Line -... | Line 149... | ||
- | 149 | }; |
|
- | 150 | ||
- | 151 | /* |
|
- | 152 | * Resources that are managed using command streams. |
|
- | 153 | */ |
|
- | 154 | enum vmw_cmdbuf_res_type { |
|
- | 155 | vmw_cmdbuf_res_compat_shader |
|
- | 156 | }; |
|
- | 157 | ||
146 | }; |
158 | struct vmw_cmdbuf_res_manager; |
147 | 159 | ||
148 | struct vmw_cursor_snooper { |
160 | struct vmw_cursor_snooper { |
149 | struct drm_crtc *crtc; |
161 | struct drm_crtc *crtc; |
150 | size_t age; |
162 | size_t age; |
Line 170... | Line 182... | ||
170 | uint32_t multisample_count; |
182 | uint32_t multisample_count; |
171 | }; |
183 | }; |
Line 172... | Line 184... | ||
172 | 184 | ||
173 | struct vmw_marker_queue { |
185 | struct vmw_marker_queue { |
174 | struct list_head head; |
186 | struct list_head head; |
175 | struct timespec lag; |
187 | u64 lag; |
176 | struct timespec lag_time; |
188 | u64 lag_time; |
177 | spinlock_t lock; |
189 | spinlock_t lock; |
Line 178... | Line 190... | ||
178 | }; |
190 | }; |
179 | 191 | ||
Line 287... | Line 299... | ||
287 | */ |
299 | */ |
288 | struct vmw_ctx_bindinfo { |
300 | struct vmw_ctx_bindinfo { |
289 | struct vmw_resource *ctx; |
301 | struct vmw_resource *ctx; |
290 | struct vmw_resource *res; |
302 | struct vmw_resource *res; |
291 | enum vmw_ctx_binding_type bt; |
303 | enum vmw_ctx_binding_type bt; |
- | 304 | bool scrubbed; |
|
292 | union { |
305 | union { |
293 | SVGA3dShaderType shader_type; |
306 | SVGA3dShaderType shader_type; |
294 | SVGA3dRenderTargetType rt_type; |
307 | SVGA3dRenderTargetType rt_type; |
295 | uint32 texture_stage; |
308 | uint32 texture_stage; |
296 | } i1; |
309 | } i1; |
Line 333... | Line 346... | ||
333 | 346 | ||
334 | struct vmw_sw_context{ |
347 | struct vmw_sw_context{ |
335 | struct drm_open_hash res_ht; |
348 | struct drm_open_hash res_ht; |
336 | bool res_ht_initialized; |
349 | bool res_ht_initialized; |
337 | bool kernel; /**< is the called made from the kernel */ |
350 | bool kernel; /**< is the called made from the kernel */ |
338 | struct ttm_object_file *tfile; |
351 | struct vmw_fpriv *fp; |
339 | struct list_head validate_nodes; |
352 | struct list_head validate_nodes; |
340 | struct vmw_relocation relocs[VMWGFX_MAX_RELOCATIONS]; |
353 | struct vmw_relocation relocs[VMWGFX_MAX_RELOCATIONS]; |
341 | uint32_t cur_reloc; |
354 | uint32_t cur_reloc; |
342 | struct vmw_validate_buffer val_bufs[VMWGFX_MAX_VALIDATIONS]; |
355 | struct vmw_validate_buffer val_bufs[VMWGFX_MAX_VALIDATIONS]; |
Line 351... | Line 364... | ||
351 | struct vmw_res_cache_entry res_cache[vmw_res_max]; |
364 | struct vmw_res_cache_entry res_cache[vmw_res_max]; |
352 | struct vmw_resource *last_query_ctx; |
365 | struct vmw_resource *last_query_ctx; |
353 | bool needs_post_query_barrier; |
366 | bool needs_post_query_barrier; |
354 | struct vmw_resource *error_resource; |
367 | struct vmw_resource *error_resource; |
355 | struct vmw_ctx_binding_state staged_bindings; |
368 | struct vmw_ctx_binding_state staged_bindings; |
- | 369 | struct list_head staged_cmd_res; |
|
356 | }; |
370 | }; |
Line 357... | Line 371... | ||
357 | 371 | ||
358 | struct vmw_legacy_display; |
372 | struct vmw_legacy_display; |
Line 395... | Line 409... | ||
395 | int mmio_mtrr; |
409 | int mmio_mtrr; |
396 | uint32_t capabilities; |
410 | uint32_t capabilities; |
397 | uint32_t max_gmr_ids; |
411 | uint32_t max_gmr_ids; |
398 | uint32_t max_gmr_pages; |
412 | uint32_t max_gmr_pages; |
399 | uint32_t max_mob_pages; |
413 | uint32_t max_mob_pages; |
- | 414 | uint32_t max_mob_size; |
|
400 | uint32_t memory_size; |
415 | uint32_t memory_size; |
401 | bool has_gmr; |
416 | bool has_gmr; |
402 | bool has_mob; |
417 | bool has_mob; |
403 | struct mutex hw_mutex; |
418 | struct mutex hw_mutex; |
Line 495... | Line 510... | ||
495 | 510 | ||
496 | struct mutex release_mutex; |
511 | struct mutex release_mutex; |
Line 497... | Line 512... | ||
497 | uint32_t num_3d_resources; |
512 | uint32_t num_3d_resources; |
- | 513 | ||
- | 514 | /* |
|
- | 515 | * Replace this with an rwsem as soon as we have down_xx_interruptible() |
|
- | 516 | */ |
|
- | 517 | struct ttm_lock reservation_sem; |
|
498 | 518 | ||
499 | /* |
519 | /* |
500 | * Query processing. These members |
520 | * Query processing. These members |
Line 501... | Line 521... | ||
501 | * are protected by the cmdbuf mutex. |
521 | * are protected by the cmdbuf mutex. |
Line 584... | Line 604... | ||
584 | */ |
604 | */ |
585 | struct vmw_user_resource_conv; |
605 | struct vmw_user_resource_conv; |
Line 586... | Line 606... | ||
586 | 606 | ||
587 | extern void vmw_resource_unreference(struct vmw_resource **p_res); |
607 | extern void vmw_resource_unreference(struct vmw_resource **p_res); |
- | 608 | extern struct vmw_resource *vmw_resource_reference(struct vmw_resource *res); |
|
- | 609 | extern struct vmw_resource * |
|
588 | extern struct vmw_resource *vmw_resource_reference(struct vmw_resource *res); |
610 | vmw_resource_reference_unless_doomed(struct vmw_resource *res); |
589 | extern int vmw_resource_validate(struct vmw_resource *res); |
611 | extern int vmw_resource_validate(struct vmw_resource *res); |
590 | extern int vmw_resource_reserve(struct vmw_resource *res, bool no_backup); |
612 | extern int vmw_resource_reserve(struct vmw_resource *res, bool no_backup); |
591 | extern bool vmw_resource_needs_backup(const struct vmw_resource *res); |
613 | extern bool vmw_resource_needs_backup(const struct vmw_resource *res); |
592 | extern int vmw_user_lookup_handle(struct vmw_private *dev_priv, |
614 | extern int vmw_user_lookup_handle(struct vmw_private *dev_priv, |
Line 958... | Line 980... | ||
958 | const struct vmw_ctx_bindinfo *ci); |
980 | const struct vmw_ctx_bindinfo *ci); |
959 | extern void |
981 | extern void |
960 | vmw_context_binding_state_transfer(struct vmw_resource *res, |
982 | vmw_context_binding_state_transfer(struct vmw_resource *res, |
961 | struct vmw_ctx_binding_state *cbs); |
983 | struct vmw_ctx_binding_state *cbs); |
962 | extern void vmw_context_binding_res_list_kill(struct list_head *head); |
984 | extern void vmw_context_binding_res_list_kill(struct list_head *head); |
- | 985 | extern void vmw_context_binding_res_list_scrub(struct list_head *head); |
|
- | 986 | extern int vmw_context_rebind_all(struct vmw_resource *ctx); |
|
- | 987 | extern struct list_head *vmw_context_binding_list(struct vmw_resource *ctx); |
|
Line 963... | Line 988... | ||
963 | 988 | ||
964 | /* |
989 | /* |
965 | * Surface management - vmwgfx_surface.c |
990 | * Surface management - vmwgfx_surface.c |
Line 977... | Line 1002... | ||
977 | /* |
1002 | /* |
978 | * Shader management - vmwgfx_shader.c |
1003 | * Shader management - vmwgfx_shader.c |
979 | */ |
1004 | */ |
Line 980... | Line 1005... | ||
980 | 1005 | ||
- | 1006 | extern const struct vmw_user_resource_conv *user_shader_converter; |
|
- | 1007 | extern struct vmw_cmdbuf_res_manager * |
|
- | 1008 | vmw_cmdbuf_res_man_create(struct vmw_private *dev_priv); |
|
- | 1009 | extern void vmw_cmdbuf_res_man_destroy(struct vmw_cmdbuf_res_manager *man); |
|
- | 1010 | extern size_t vmw_cmdbuf_res_man_size(void); |
|
- | 1011 | extern struct vmw_resource * |
|
- | 1012 | vmw_cmdbuf_res_lookup(struct vmw_cmdbuf_res_manager *man, |
|
- | 1013 | enum vmw_cmdbuf_res_type res_type, |
|
- | 1014 | u32 user_key); |
|
- | 1015 | extern void vmw_cmdbuf_res_revert(struct list_head *list); |
|
- | 1016 | extern void vmw_cmdbuf_res_commit(struct list_head *list); |
|
- | 1017 | extern int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man, |
|
- | 1018 | enum vmw_cmdbuf_res_type res_type, |
|
- | 1019 | u32 user_key, |
|
- | 1020 | struct vmw_resource *res, |
|
- | 1021 | struct list_head *list); |
|
- | 1022 | extern int vmw_cmdbuf_res_remove(struct vmw_cmdbuf_res_manager *man, |
|
- | 1023 | enum vmw_cmdbuf_res_type res_type, |
|
- | 1024 | u32 user_key, |
|
- | 1025 | struct list_head *list); |
|
- | 1026 | ||
981 | extern const struct vmw_user_resource_conv *user_shader_converter; |
1027 | |
982 | /** |
1028 | /** |
983 | * Inline helper functions |
1029 | * Inline helper functions |
Line 984... | Line 1030... | ||
984 | */ |
1030 | */ |