forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/gpu/drm/vmwgfx/vmwgfx_resource_priv.h
....@@ -30,6 +30,11 @@
3030
3131 #include "vmwgfx_drv.h"
3232
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
+ */
3338 #define VMW_IDA_ACC_SIZE 128
3439
3540 enum vmw_cmdbuf_res_state {
....@@ -66,6 +71,13 @@
6671 * @commit_notify: If the resource is a command buffer managed resource,
6772 * callback to notify that a define or remove command
6873 * 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.
6981 */
7082 struct vmw_res_func {
7183 enum vmw_res_type res_type;
....@@ -73,6 +85,8 @@
7385 const char *type_name;
7486 struct ttm_placement *backup_placement;
7587 bool may_evict;
88
+ u32 prio;
89
+ u32 dirty_prio;
7690
7791 int (*create) (struct vmw_resource *res);
7892 int (*destroy) (struct vmw_resource *res);
....@@ -83,6 +97,12 @@
8397 struct ttm_validate_buffer *val_buf);
8498 void (*commit_notify)(struct vmw_resource *res,
8599 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);
86106 };
87107
88108 /**
....@@ -120,8 +140,6 @@
120140 bool delay_id,
121141 void (*res_free) (struct vmw_resource *res),
122142 const struct vmw_res_func *func);
123
-void vmw_resource_activate(struct vmw_resource *res,
124
- void (*hw_destroy) (struct vmw_resource *));
125143 int
126144 vmw_simple_resource_create_ioctl(struct drm_device *dev,
127145 void *data,