offset = args->offset;
- read = obj->filp->f_op->read(obj->filp, (char __user *)args->data,
+ read = obj->filp->f_op->read(obj->filp, (char __user *)(uintptr_t)args->data_ptr,
args->size, &offset);
if (read != args->size) {
drm_gem_object_unreference(dev, obj);
offset = args->offset;
down_write(¤t->mm->mmap_sem);
- args->addr = (void *)do_mmap(obj->filp, 0, args->size,
+ args->addr_ptr = (uint64_t) do_mmap(obj->filp, 0, args->size,
PROT_READ | PROT_WRITE, MAP_SHARED,
args->offset);
up_write(¤t->mm->mmap_sem);
offset = args->offset;
- written = obj->filp->f_op->write(obj->filp, (char __user *)args->data,
+ written = obj->filp->f_op->write(obj->filp, (char __user *)args->data_ptr,
args->size, &offset);
if (written != args->size) {
drm_gem_object_unreference(dev, obj);
struct drm_gem_object *obj)
{
struct drm_i915_gem_relocation_entry reloc;
+ struct drm_i915_gem_relocation_entry __user *relocs;
struct drm_i915_gem_object *obj_priv = obj->driver_private;
int i;
return -ENOMEM;
}
+ relocs = (struct drm_i915_gem_relocation_entry __user *) (uintptr_t) entry->relocs_ptr;
/* Apply the relocations, using the GTT aperture to avoid cache
* flushing requirements.
*/
uint32_t reloc_val, *reloc_entry;
int ret;
- ret = copy_from_user(&reloc, entry->relocs + i, sizeof(reloc));
+ ret = copy_from_user(&reloc, relocs + i, sizeof(reloc));
if (ret != 0)
return ret;
reloc_val = target_obj_priv->gtt_offset + reloc.delta;
DRM_DEBUG("Applied relocation: %p@0x%08x = 0x%08x\n",
- obj, reloc.offset, reloc_val);
+ obj, (unsigned int) reloc.offset, reloc_val);
*reloc_entry = reloc_val;
iounmap(reloc_page);
goto err;
}
ret = copy_from_user(validate_list,
- (struct drm_i915_relocation_entry __user*)
- args->buffers,
+ (struct drm_i915_relocation_entry __user*)(uintptr_t)
+ args->buffers_ptr,
sizeof(*validate_list) * args->buffer_count);
if (ret != 0)
goto err;
validate_list[i].buffer_offset = obj_priv->gtt_offset;
}
ret = copy_to_user(validate_list,
- (struct drm_i915_relocation_entry __user*)
- args->buffers,
+ (struct drm_i915_relocation_entry __user*)(uintptr_t)
+ args->buffers_ptr,
sizeof(*validate_list) * args->buffer_count);
/* Clean up and return */
*
* The (page-aligned) allocated size for the object will be returned.
*/
- uint32_t size;
+ uint64_t size;
/**
* Returned handle for the object.
*
* Object handles are nonzero.
*/
uint32_t handle;
+ uint32_t pad;
};
struct drm_gem_unreference {
/** Handle of the object to be unreferenced. */
uint32_t handle;
+ uint32_t pad;
};
struct drm_gem_link {
/** Handle for the object being given a name. */
uint32_t handle;
+ uint32_t pad;
/** Requested file name to export the object under. */
- char *name;
+ uint64_t name_ptr; /* char *, but pointers are not 32/64 compatible */
/** Requested file mode to export the object under. */
mode_t mode;
};
struct drm_gem_pread {
/** Handle for the object being read. */
uint32_t handle;
+ uint32_t pad;
/** Offset into the object to read from */
- off_t offset;
+ uint64_t offset;
/** Length of data to read */
- size_t size;
+ uint64_t size;
/** Pointer to write the data into. */
- void *data;
+ uint64_t data_ptr; /* void *, but pointers are not 32/64 compatible */
};
struct drm_gem_pwrite {
/** Handle for the object being written to. */
uint32_t handle;
+ uint32_t pad;
/** Offset into the object to write to */
- off_t offset;
+ uint64_t offset;
/** Length of data to write */
- size_t size;
+ uint64_t size;
/** Pointer to read the data from. */
- void *data;
+ uint64_t data_ptr; /* void *, but pointers are not 32/64 compatible */
};
struct drm_gem_mmap {
/** Handle for the object being mapped. */
uint32_t handle;
+ uint32_t pad;
/** Offset in the object to map. */
- off_t offset;
+ uint64_t offset;
/**
* Length of data to map.
*
* The value will be page-aligned.
*/
- size_t size;
+ uint64_t size;
/** Returned pointer the data was mapped at */
- void *addr;
+ uint64_t addr_ptr; /* void *, but pointers are not 32/64 compatible */
};
/**
* Beginning offset in the GTT to be managed by the DRM memory
* manager.
*/
- off_t gtt_start;
+ uint64_t gtt_start;
/**
* Ending offset in the GTT to be managed by the DRM memory
* manager.
*/
- off_t gtt_end;
+ uint64_t gtt_end;
};
struct drm_i915_gem_relocation_entry {
*/
uint32_t target_handle;
- /** Offset in the buffer the relocation entry will be written into */
- uint32_t offset;
-
/**
* Value to be added to the offset of the target buffer to make up
* the relocation entry.
*/
uint32_t delta;
+ /** Offset in the buffer the relocation entry will be written into */
+ uint64_t offset;
+
/**
* Offset value of the target buffer that the relocation entry was last
* written as.
* and writing the relocation. This value is written back out by
* the execbuffer ioctl when the relocation is written.
*/
- uint32_t presumed_offset;
+ uint64_t presumed_offset;
};
struct drm_i915_gem_validate_entry {
*/
uint32_t buffer_offset;
/** List of relocations to be performed on this buffer */
- struct drm_i915_gem_relocation_entry *relocs;
+ uint64_t relocs_ptr; /* struct drm_i915_gem_relocation_entry *relocs */
uint32_t relocation_count;
+ uint32_t pad;
};
struct drm_i915_gem_execbuffer {
* a buffer is performing refer to buffers that have already appeared
* in the validate list.
*/
- struct drm_i915_gem_validate_entry *buffers;
+ uint64_t buffers_ptr; /* struct drm_i915_gem_validate_entry *buffers */
uint32_t buffer_count;
/** Offset in the batchbuffer to start execution from. */
uint32_t DR1;
uint32_t DR4;
uint32_t num_cliprects;
- struct drm_clip_rect *cliprects;
+ uint64_t cliprects_ptr; /* struct drm_clip_rect *cliprects */
};
struct drm_i915_gem_pin {
/** Handle of the buffer to be pinned. */
uint32_t handle;
+ uint32_t pad;
/** Returned GTT offset of the buffer. */
uint64_t offset;
struct drm_i915_gem_unpin {
/** Handle of the buffer to be unpinned. */
uint32_t handle;
+ uint32_t pad;
};