ioctl_wrappers: Pass in offset to CPU mmaps

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2014-11-04 12:06:17 +00:00
parent 676ccf862c
commit 6fff1f8787
13 changed files with 24 additions and 23 deletions
+4 -3
View File
@@ -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;
+1 -1
View File
@@ -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:
*