mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-11 16:32:58 +00:00
lib: Share common __gem_execbuf()
An oft-repeated function to check EXECBUFFER2 for a particular fail condition. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -178,14 +178,6 @@ static int gem_linear_blt(int fd,
|
||||
return (b+2 - batch) * sizeof(uint32_t);
|
||||
}
|
||||
|
||||
static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
|
||||
{
|
||||
int err = 0;
|
||||
if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf))
|
||||
err = -errno;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int run(int object, int batch, int time, int reps)
|
||||
{
|
||||
struct drm_i915_gem_execbuffer2 execbuf;
|
||||
|
||||
@@ -49,15 +49,6 @@
|
||||
#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
|
||||
#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
|
||||
|
||||
static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
|
||||
{
|
||||
int err = 0;
|
||||
if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf))
|
||||
err = -errno;
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
static double elapsed(const struct timespec *start,
|
||||
const struct timespec *end)
|
||||
{
|
||||
|
||||
@@ -56,14 +56,6 @@ static double elapsed(const struct timespec *start,
|
||||
return (end->tv_sec - start->tv_sec) + 1e-9*(end->tv_nsec - start->tv_nsec);
|
||||
}
|
||||
|
||||
static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
|
||||
{
|
||||
int err = 0;
|
||||
if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf))
|
||||
err = -errno;
|
||||
return err;
|
||||
}
|
||||
|
||||
static uint32_t batch(int fd)
|
||||
{
|
||||
const uint32_t buf[] = {MI_BATCH_BUFFER_END};
|
||||
|
||||
@@ -55,14 +55,6 @@ static double elapsed(const struct timespec *start,
|
||||
return (end->tv_sec - start->tv_sec) + 1e-9*(end->tv_nsec - start->tv_nsec);
|
||||
}
|
||||
|
||||
static int __gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)
|
||||
{
|
||||
int err = 0;
|
||||
if (drmIoctl(fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf))
|
||||
err = -errno;
|
||||
return err;
|
||||
}
|
||||
|
||||
static uint32_t batch(int fd)
|
||||
{
|
||||
const uint32_t buf[] = {MI_BATCH_BUFFER_END};
|
||||
|
||||
Reference in New Issue
Block a user