mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 21:32:56 +00:00
lib/drmtest: extract gem_mmap
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -384,22 +384,6 @@ static void connector_find_preferred_mode(struct connector *c)
|
||||
c->connector = connector;
|
||||
}
|
||||
|
||||
static void *gem_mmap(int fd, uint32_t handle, int size, int prot)
|
||||
{
|
||||
struct drm_i915_gem_mmap_gtt mmap_arg;
|
||||
void *ptr;
|
||||
|
||||
mmap_arg.handle = handle;
|
||||
if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg))
|
||||
return NULL;
|
||||
|
||||
ptr = mmap(0, size, prot, MAP_SHARED, fd, mmap_arg.offset);
|
||||
if (ptr == MAP_FAILED)
|
||||
ptr = NULL;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
allocate_surface(int fd, int width, int height, uint32_t depth,
|
||||
uint32_t *handle, int tiled)
|
||||
|
||||
Reference in New Issue
Block a user