mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-11 16:32:58 +00:00
ioctl_wrappers: Pass in offset to CPU mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -471,7 +471,8 @@ void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot)
|
||||
* gem_mmap__cpu:
|
||||
* @fd: open i915 drm file descriptor
|
||||
* @handle: gem buffer object handle
|
||||
* @size: size of the gem buffer
|
||||
* @offset: offset in the gem buffer of te mmap arena
|
||||
* @size: size of the mmap arena
|
||||
* @prot: memory protection bits as used by mmap()
|
||||
*
|
||||
* This functions wraps up procedure to establish a memory mapping through
|
||||
@@ -479,13 +480,13 @@ void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot)
|
||||
*
|
||||
* Returns: A pointer to the created memory mapping.
|
||||
*/
|
||||
void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot)
|
||||
void *gem_mmap__cpu(int fd, uint32_t handle, int offset, int size, int prot)
|
||||
{
|
||||
struct drm_i915_gem_mmap mmap_arg;
|
||||
|
||||
memset(&mmap_arg, 0, sizeof(mmap_arg));
|
||||
mmap_arg.handle = handle;
|
||||
mmap_arg.offset = 0;
|
||||
mmap_arg.offset = offset;
|
||||
mmap_arg.size = size;
|
||||
if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg))
|
||||
return NULL;
|
||||
|
||||
@@ -61,7 +61,7 @@ uint32_t gem_create(int fd, int size);
|
||||
void gem_execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf);
|
||||
|
||||
void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot);
|
||||
void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot);
|
||||
void *gem_mmap__cpu(int fd, uint32_t handle, int offset, int size, int prot);
|
||||
/**
|
||||
* gem_mmap:
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user