提交 94477bff 编写于 作者: S Sinclair Yeh

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: NSinclair Yeh <syeh@vmware.com>
Reviewed-by: NThomas 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.
上级 04319d89
...@@ -1034,9 +1034,9 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo, ...@@ -1034,9 +1034,9 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo,
return ret; return ret;
} }
static bool ttm_bo_mem_compat(struct ttm_placement *placement, bool ttm_bo_mem_compat(struct ttm_placement *placement,
struct ttm_mem_reg *mem, struct ttm_mem_reg *mem,
uint32_t *new_flags) uint32_t *new_flags)
{ {
int i; int i;
...@@ -1068,6 +1068,7 @@ static bool ttm_bo_mem_compat(struct ttm_placement *placement, ...@@ -1068,6 +1068,7 @@ static bool ttm_bo_mem_compat(struct ttm_placement *placement,
return false; return false;
} }
EXPORT_SYMBOL(ttm_bo_mem_compat);
int ttm_bo_validate(struct ttm_buffer_object *bo, int ttm_bo_validate(struct ttm_buffer_object *bo,
struct ttm_placement *placement, struct ttm_placement *placement,
......
...@@ -316,6 +316,20 @@ ttm_bo_reference(struct ttm_buffer_object *bo) ...@@ -316,6 +316,20 @@ ttm_bo_reference(struct ttm_buffer_object *bo)
*/ */
extern int ttm_bo_wait(struct ttm_buffer_object *bo, extern int ttm_bo_wait(struct ttm_buffer_object *bo,
bool interruptible, bool no_wait); bool interruptible, bool no_wait);
/**
* ttm_bo_mem_compat - Check if proposed placement is compatible with a bo
*
* @placement: Return immediately if buffer is busy.
* @mem: The struct ttm_mem_reg indicating the region where the bo resides
* @new_flags: Describes compatible placement found
*
* Returns true if the placement is compatible
*/
extern bool ttm_bo_mem_compat(struct ttm_placement *placement,
struct ttm_mem_reg *mem,
uint32_t *new_flags);
/** /**
* ttm_bo_validate * ttm_bo_validate
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册