mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 02:16:17 +00:00
igt/gem_lut_handle: Fix errno checking
Regression from commit c1404e05b7477122b9923ba029593c2cb64671a7 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Apr 29 07:14:33 2014 +0100 errno is reset after each syscall Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
8741c2289f
commit
e46ff3f8c2
@ -82,9 +82,12 @@ static int exec(int fd, uint32_t handle, unsigned int flags)
|
|||||||
i915_execbuffer2_set_context_id(execbuf, 0);
|
i915_execbuffer2_set_context_id(execbuf, 0);
|
||||||
execbuf.rsvd2 = 0;
|
execbuf.rsvd2 = 0;
|
||||||
|
|
||||||
return drmIoctl(fd,
|
if (drmIoctl(fd,
|
||||||
DRM_IOCTL_I915_GEM_EXECBUFFER2,
|
DRM_IOCTL_I915_GEM_EXECBUFFER2,
|
||||||
&execbuf);
|
&execbuf))
|
||||||
|
return -errno;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsigned flags)
|
static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsigned flags)
|
||||||
@ -167,15 +170,15 @@ static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsign
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define _fail(x) ((x) == -ENOENT)
|
#define _fail(x) ((x) == -ENOENT)
|
||||||
#define ASSERT(x) do { \
|
#define ASSERT(x, y) do { \
|
||||||
if (!(x)) { \
|
if (!(x)) { \
|
||||||
fprintf(stderr, "%s:%d failed, errno=%d\n", \
|
fprintf(stderr, "%s:%d failed, errno=%d\n", \
|
||||||
__FUNCTION__, __LINE__, errno); \
|
__FUNCTION__, __LINE__, -y); \
|
||||||
abort(); \
|
abort(); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define fail(x) ASSERT(_fail(x))
|
#define fail(x) ASSERT(_fail(x), x)
|
||||||
#define pass(x) ASSERT(!_fail(x))
|
#define pass(x) ASSERT(!_fail(x), x)
|
||||||
|
|
||||||
igt_simple_main
|
igt_simple_main
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user