.. | .. |
---|
30 | 30 | |
---|
31 | 31 | #include "vmwgfx_drv.h" |
---|
32 | 32 | |
---|
| 33 | +/* |
---|
| 34 | + * Extra memory required by the resource id's ida storage, which is allocated |
---|
| 35 | + * separately from the base object itself. We estimate an on-average 128 bytes |
---|
| 36 | + * per ida. |
---|
| 37 | + */ |
---|
33 | 38 | #define VMW_IDA_ACC_SIZE 128 |
---|
34 | 39 | |
---|
35 | 40 | enum vmw_cmdbuf_res_state { |
---|
.. | .. |
---|
66 | 71 | * @commit_notify: If the resource is a command buffer managed resource, |
---|
67 | 72 | * callback to notify that a define or remove command |
---|
68 | 73 | * has been committed to the device. |
---|
| 74 | + * @dirty_alloc: Allocate a dirty tracker. NULL if dirty-tracking is not |
---|
| 75 | + * supported. |
---|
| 76 | + * @dirty_free: Free the dirty tracker. |
---|
| 77 | + * @dirty_sync: Upload the dirty mob contents to the resource. |
---|
| 78 | + * @dirty_add_range: Add a sequential dirty range to the resource |
---|
| 79 | + * dirty tracker. |
---|
| 80 | + * @clean: Clean the resource. |
---|
69 | 81 | */ |
---|
70 | 82 | struct vmw_res_func { |
---|
71 | 83 | enum vmw_res_type res_type; |
---|
.. | .. |
---|
73 | 85 | const char *type_name; |
---|
74 | 86 | struct ttm_placement *backup_placement; |
---|
75 | 87 | bool may_evict; |
---|
| 88 | + u32 prio; |
---|
| 89 | + u32 dirty_prio; |
---|
76 | 90 | |
---|
77 | 91 | int (*create) (struct vmw_resource *res); |
---|
78 | 92 | int (*destroy) (struct vmw_resource *res); |
---|
.. | .. |
---|
83 | 97 | struct ttm_validate_buffer *val_buf); |
---|
84 | 98 | void (*commit_notify)(struct vmw_resource *res, |
---|
85 | 99 | enum vmw_cmdbuf_res_state state); |
---|
| 100 | + int (*dirty_alloc)(struct vmw_resource *res); |
---|
| 101 | + void (*dirty_free)(struct vmw_resource *res); |
---|
| 102 | + int (*dirty_sync)(struct vmw_resource *res); |
---|
| 103 | + void (*dirty_range_add)(struct vmw_resource *res, size_t start, |
---|
| 104 | + size_t end); |
---|
| 105 | + int (*clean)(struct vmw_resource *res); |
---|
86 | 106 | }; |
---|
87 | 107 | |
---|
88 | 108 | /** |
---|
.. | .. |
---|
120 | 140 | bool delay_id, |
---|
121 | 141 | void (*res_free) (struct vmw_resource *res), |
---|
122 | 142 | const struct vmw_res_func *func); |
---|
123 | | -void vmw_resource_activate(struct vmw_resource *res, |
---|
124 | | - void (*hw_destroy) (struct vmw_resource *)); |
---|
125 | 143 | int |
---|
126 | 144 | vmw_simple_resource_create_ioctl(struct drm_device *dev, |
---|
127 | 145 | void *data, |
---|