cc662126b4
This is really just an alias of mmap_gtt. The 'mmap offset' nomenclature comes from the value returned by this ioctl which is the offset into the device fd which userpace uses with mmap(2). mmap_gtt was our initial mmap_offset implementation, this extends our CPU mmap support to allow additional fault handlers that depends on the object's backing pages. Note that we multiplex mmap_gtt and mmap_offset through the same ioctl, and use the zero extending behaviour of drm to differentiate between them, when we inspect the flags. To support multiple mmap types on an object we need to support multiple mmap_offsets for an object (each offset in the global device address space corresponding to a unique instance of the object for a file + mmap type). As we drop the simplified drm core idea of a single mmap_offset, we need to provide replacement hooks for the dumb mmap interface as well. Link: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1675 Testcase: igt/gem_mmap_offset Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20191204120032.3682839-1-chris@chris-wilson.co.uk
32 lines
766 B
C
32 lines
766 B
C
/*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright © 2019 Intel Corporation
|
|
*/
|
|
|
|
#ifndef __I915_GEM_MMAN_H__
|
|
#define __I915_GEM_MMAN_H__
|
|
|
|
#include <linux/mm_types.h>
|
|
#include <linux/types.h>
|
|
|
|
struct drm_device;
|
|
struct drm_file;
|
|
struct drm_i915_gem_object;
|
|
struct file;
|
|
struct i915_mmap_offset;
|
|
struct mutex;
|
|
|
|
int i915_gem_mmap_gtt_version(void);
|
|
int i915_gem_mmap(struct file *filp, struct vm_area_struct *vma);
|
|
|
|
int i915_gem_dumb_mmap_offset(struct drm_file *file_priv,
|
|
struct drm_device *dev,
|
|
u32 handle, u64 *offset);
|
|
|
|
void __i915_gem_object_release_mmap_gtt(struct drm_i915_gem_object *obj);
|
|
void i915_gem_object_release_mmap(struct drm_i915_gem_object *obj);
|
|
void i915_gem_object_release_mmap_offset(struct drm_i915_gem_object *obj);
|
|
|
|
#endif
|