mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

To enable partial memory mapping of GPU virtual memory, it's necessary to introduce an offset to the object's memory (obj->mm.pages) scatterlist. This adjustment compensates for instances when userspace mappings do not start from the beginning of the object. Based on a patch by Chris Wilson. Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com> Cc: Chris Wilson <chris.p.wilson@linux.intel.com> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240807100521.478266-3-andi.shyti@linux.intel.com
36 lines
856 B
C
36 lines
856 B
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2021 Intel Corporation
|
|
*/
|
|
|
|
#ifndef __I915_MM_H__
|
|
#define __I915_MM_H__
|
|
|
|
#include <linux/bug.h>
|
|
#include <linux/types.h>
|
|
|
|
struct vm_area_struct;
|
|
struct io_mapping;
|
|
struct scatterlist;
|
|
|
|
#if IS_ENABLED(CONFIG_X86)
|
|
int remap_io_mapping(struct vm_area_struct *vma,
|
|
unsigned long addr, unsigned long pfn, unsigned long size,
|
|
struct io_mapping *iomap);
|
|
#else
|
|
static inline
|
|
int remap_io_mapping(struct vm_area_struct *vma,
|
|
unsigned long addr, unsigned long pfn, unsigned long size,
|
|
struct io_mapping *iomap)
|
|
{
|
|
WARN_ONCE(1, "Architecture has no drm_cache.c support\n");
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
int remap_io_sg(struct vm_area_struct *vma,
|
|
unsigned long addr, unsigned long size,
|
|
struct scatterlist *sgl, unsigned long offset,
|
|
resource_size_t iobase);
|
|
|
|
#endif /* __I915_MM_H__ */
|