diff options
author | Sinclair Yeh <syeh@vmware.com> | 2016-06-29 15:58:49 -0400 |
---|---|---|
committer | Sinclair Yeh <syeh@vmware.com> | 2016-07-01 13:47:49 -0400 |
commit | 94477bff390aa4612d2332c8abafaae0a13d6923 (patch) | |
tree | c80653a097332502fc4cab07b88aee4142b5d6c2 | |
parent | 04319d89fbec72dfd60738003c3813b97c1d5f5a (diff) |
drm/ttm: Make ttm_bo_mem_compat available
There are cases where it is desired to see if a proposed placement
is compatible with a buffer object before calling ttm_bo_validate().
Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: <stable@vger.kernel.org>
---
This is the first of a 3-patch series to fix a black screen
issue observed on Ubuntu 16.04 server.
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 7 | ||||
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 14 |
2 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 39386f50af87..a71cf98c655f 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -1034,9 +1034,9 @@ out_unlock: | |||
1034 | return ret; | 1034 | return ret; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | static bool ttm_bo_mem_compat(struct ttm_placement *placement, | 1037 | bool ttm_bo_mem_compat(struct ttm_placement *placement, |
1038 | struct ttm_mem_reg *mem, | 1038 | struct ttm_mem_reg *mem, |
1039 | uint32_t *new_flags) | 1039 | uint32_t *new_flags) |
1040 | { | 1040 | { |
1041 | int i; | 1041 | int i; |
1042 | 1042 | ||
@@ -1068,6 +1068,7 @@ static bool ttm_bo_mem_compat(struct ttm_placement *placement, | |||
1068 | 1068 | ||
1069 | return false; | 1069 | return false; |
1070 | } | 1070 | } |
1071 | EXPORT_SYMBOL(ttm_bo_mem_compat); | ||
1071 | 1072 | ||
1072 | int ttm_bo_validate(struct ttm_buffer_object *bo, | 1073 | int ttm_bo_validate(struct ttm_buffer_object *bo, |
1073 | struct ttm_placement *placement, | 1074 | struct ttm_placement *placement, |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index c801d9028e37..4cecb0b75b9c 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -316,6 +316,20 @@ ttm_bo_reference(struct ttm_buffer_object *bo) | |||
316 | */ | 316 | */ |
317 | extern int ttm_bo_wait(struct ttm_buffer_object *bo, | 317 | extern int ttm_bo_wait(struct ttm_buffer_object *bo, |
318 | bool interruptible, bool no_wait); | 318 | bool interruptible, bool no_wait); |
319 | |||
320 | /** | ||
321 | * ttm_bo_mem_compat - Check if proposed placement is compatible with a bo | ||
322 | * | ||
323 | * @placement: Return immediately if buffer is busy. | ||
324 | * @mem: The struct ttm_mem_reg indicating the region where the bo resides | ||
325 | * @new_flags: Describes compatible placement found | ||
326 | * | ||
327 | * Returns true if the placement is compatible | ||
328 | */ | ||
329 | extern bool ttm_bo_mem_compat(struct ttm_placement *placement, | ||
330 | struct ttm_mem_reg *mem, | ||
331 | uint32_t *new_flags); | ||
332 | |||
319 | /** | 333 | /** |
320 | * ttm_bo_validate | 334 | * ttm_bo_validate |
321 | * | 335 | * |