mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 05:13:47 +00:00
lib/drmtest: add gem_flink and gem_open
Requires us to rename a few things in the gem_flink test to avoid variable shadowing. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -432,6 +432,31 @@ int gem_get_cacheing(int fd, uint32_t handle)
|
||||
return arg.cacheing;
|
||||
}
|
||||
|
||||
uint32_t gem_open(int fd, uint32_t name)
|
||||
{
|
||||
struct drm_gem_open open_struct;
|
||||
int ret;
|
||||
|
||||
open_struct.name = name;
|
||||
ret = ioctl(fd, DRM_IOCTL_GEM_OPEN, &open_struct);
|
||||
assert(ret == 0);
|
||||
assert(open_struct.handle != 0);
|
||||
|
||||
return open_struct.handle;
|
||||
}
|
||||
|
||||
uint32_t gem_flink(int fd, uint32_t handle)
|
||||
{
|
||||
struct drm_gem_flink flink;
|
||||
int ret;
|
||||
|
||||
flink.handle = handle;
|
||||
ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink);
|
||||
assert(ret == 0);
|
||||
|
||||
return flink.name;
|
||||
}
|
||||
|
||||
void gem_close(int fd, uint32_t handle)
|
||||
{
|
||||
struct drm_gem_close close_bo;
|
||||
|
||||
@@ -56,6 +56,8 @@ int gem_get_num_rings(int fd);
|
||||
int gem_has_cacheing(int fd);
|
||||
void gem_set_cacheing(int fd, uint32_t handle, int cacheing);
|
||||
int gem_get_cacheing(int fd, uint32_t handle);
|
||||
uint32_t gem_flink(int fd, uint32_t handle);
|
||||
uint32_t gem_open(int fd, uint32_t name);
|
||||
void gem_close(int fd, uint32_t handle);
|
||||
void gem_write(int fd, uint32_t handle, uint32_t offset, const void *buf, uint32_t size);
|
||||
void gem_read(int fd, uint32_t handle, uint32_t offset, void *buf, uint32_t size);
|
||||
|
||||
Reference in New Issue
Block a user