mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 17:36:11 +00:00
lib: Add gem_bo_busy
Move gem_bo_busy() from gem_wait_render_timeout.c to lib. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
parent
525788a736
commit
49f4860d5c
@ -641,6 +641,16 @@ void gem_sw_finish(int fd, uint32_t handle)
|
||||
do_ioctl(fd, DRM_IOCTL_I915_GEM_SW_FINISH, &finish);
|
||||
}
|
||||
|
||||
bool gem_bo_busy(int fd, uint32_t handle)
|
||||
{
|
||||
struct drm_i915_gem_busy busy;
|
||||
|
||||
busy.handle = handle;
|
||||
|
||||
do_ioctl(fd, DRM_IOCTL_I915_GEM_BUSY, &busy);
|
||||
|
||||
return !!busy.busy;
|
||||
}
|
||||
|
||||
/* prime */
|
||||
int prime_handle_to_fd(int fd, uint32_t handle)
|
||||
|
@ -87,6 +87,8 @@ uint32_t gem_context_create(int fd);
|
||||
|
||||
void gem_sw_finish(int fd, uint32_t handle);
|
||||
|
||||
bool gem_bo_busy(int fd, uint32_t handle);
|
||||
|
||||
/* feature test helpers */
|
||||
bool gem_uses_aliasing_ppgtt(int fd);
|
||||
int gem_available_fences(int fd);
|
||||
|
@ -80,17 +80,6 @@ gem_bo_wait_timeout(int fd, uint32_t handle, uint64_t *timeout_ns)
|
||||
return ret ? -errno : 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
gem_bo_busy(int fd, uint32_t handle)
|
||||
{
|
||||
struct drm_i915_gem_busy busy;
|
||||
|
||||
busy.handle = handle;
|
||||
do_or_die(drmIoctl(fd, DRM_IOCTL_I915_GEM_BUSY, &busy));
|
||||
|
||||
return !!busy.busy;
|
||||
}
|
||||
|
||||
static void blt_color_fill(struct intel_batchbuffer *batch,
|
||||
drm_intel_bo *buf,
|
||||
const unsigned int pages)
|
||||
|
Loading…
x
Reference in New Issue
Block a user