Rev 1428 | Rev 2997 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1428 | Rev 1963 | ||
---|---|---|---|
Line 73... | Line 73... | ||
73 | * @bo: radeon object for which we query the offset |
73 | * @bo: radeon object for which we query the offset |
74 | * |
74 | * |
75 | * Returns current GPU offset of the object. |
75 | * Returns current GPU offset of the object. |
76 | * |
76 | * |
77 | * Note: object should either be pinned or reserved when calling this |
77 | * Note: object should either be pinned or reserved when calling this |
78 | * function, it might be usefull to add check for this for debugging. |
78 | * function, it might be useful to add check for this for debugging. |
79 | */ |
79 | */ |
80 | static inline u64 radeon_bo_gpu_offset(struct radeon_bo *bo) |
80 | static inline u64 radeon_bo_gpu_offset(struct radeon_bo *bo) |
81 | { |
81 | { |
82 | return bo->tbo.offset; |
82 | return bo->tbo.offset; |
83 | } |
83 | } |
Line 110... | Line 110... | ||
110 | bool no_wait) |
110 | bool no_wait) |
111 | { |
111 | { |
112 | int r; |
112 | int r; |
Line 113... | Line 113... | ||
113 | 113 | ||
114 | r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); |
114 | r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); |
115 | if (unlikely(r != 0)) { |
- | |
116 | if (r != -ERESTARTSYS) |
- | |
117 | dev_err(bo->rdev->dev, "%p reserve failed for wait\n", bo); |
115 | if (unlikely(r != 0)) |
118 | return r; |
- | |
119 | } |
116 | return r; |
120 | spin_lock(&bo->tbo.lock); |
117 | // spin_lock(&bo->tbo.bdev->fence_lock); |
121 | if (mem_type) |
118 | if (mem_type) |
122 | *mem_type = bo->tbo.mem.mem_type; |
119 | *mem_type = bo->tbo.mem.mem_type; |
123 | if (bo->tbo.sync_obj) |
120 | if (bo->tbo.sync_obj) |
124 | r = ttm_bo_wait(&bo->tbo, true, true, no_wait); |
121 | r = ttm_bo_wait(&bo->tbo, true, true, no_wait); |
125 | spin_unlock(&bo->tbo.lock); |
122 | // spin_unlock(&bo->tbo.bdev->fence_lock); |
126 | ttm_bo_unreserve(&bo->tbo); |
123 | ttm_bo_unreserve(&bo->tbo); |
127 | return r; |
124 | return r; |
Line 128... | Line 125... | ||
128 | } |
125 | } |
129 | 126 | ||
130 | extern int radeon_bo_create(struct radeon_device *rdev, |
127 | extern int radeon_bo_create(struct radeon_device *rdev, |
131 | struct drm_gem_object *gobj, unsigned long size, |
128 | unsigned long size, int byte_align, |
132 | bool kernel, u32 domain, |
129 | bool kernel, u32 domain, |
133 | struct radeon_bo **bo_ptr); |
130 | struct radeon_bo **bo_ptr); |
134 | extern int radeon_bo_kmap(struct radeon_bo *bo, void **ptr); |
131 | extern int radeon_bo_kmap(struct radeon_bo *bo, void **ptr); |
Line 140... | Line 137... | ||
140 | extern void radeon_bo_force_delete(struct radeon_device *rdev); |
137 | extern void radeon_bo_force_delete(struct radeon_device *rdev); |
141 | extern int radeon_bo_init(struct radeon_device *rdev); |
138 | extern int radeon_bo_init(struct radeon_device *rdev); |
142 | extern void radeon_bo_fini(struct radeon_device *rdev); |
139 | extern void radeon_bo_fini(struct radeon_device *rdev); |
143 | extern void radeon_bo_list_add_object(struct radeon_bo_list *lobj, |
140 | extern void radeon_bo_list_add_object(struct radeon_bo_list *lobj, |
144 | struct list_head *head); |
141 | struct list_head *head); |
145 | extern int radeon_bo_list_reserve(struct list_head *head); |
- | |
146 | extern void radeon_bo_list_unreserve(struct list_head *head); |
- | |
147 | extern int radeon_bo_list_validate(struct list_head *head); |
142 | extern int radeon_bo_list_validate(struct list_head *head); |
148 | extern void radeon_bo_list_fence(struct list_head *head, void *fence); |
- | |
149 | extern int radeon_bo_fbdev_mmap(struct radeon_bo *bo, |
143 | extern int radeon_bo_fbdev_mmap(struct radeon_bo *bo, |
150 | struct vm_area_struct *vma); |
144 | struct vm_area_struct *vma); |
151 | extern int radeon_bo_set_tiling_flags(struct radeon_bo *bo, |
145 | extern int radeon_bo_set_tiling_flags(struct radeon_bo *bo, |
152 | u32 tiling_flags, u32 pitch); |
146 | u32 tiling_flags, u32 pitch); |
153 | extern void radeon_bo_get_tiling_flags(struct radeon_bo *bo, |
147 | extern void radeon_bo_get_tiling_flags(struct radeon_bo *bo, |
154 | u32 *tiling_flags, u32 *pitch); |
148 | u32 *tiling_flags, u32 *pitch); |
155 | extern int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved, |
149 | extern int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved, |
156 | bool force_drop); |
150 | bool force_drop); |
157 | extern void radeon_bo_move_notify(struct ttm_buffer_object *bo, |
151 | extern void radeon_bo_move_notify(struct ttm_buffer_object *bo, |
158 | struct ttm_mem_reg *mem); |
152 | struct ttm_mem_reg *mem); |
159 | extern void radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo); |
153 | extern int radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo); |
160 | extern int radeon_bo_get_surface_reg(struct radeon_bo *bo); |
154 | extern int radeon_bo_get_surface_reg(struct radeon_bo *bo); |
161 | #endif><> |
155 | #endif><> |