xref: /openbmc/linux/drivers/gpu/drm/i915/i915_mm.h (revision 2427f03f)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2021 Intel Corporation
4  */
5 
6 #ifndef __I915_MM_H__
7 #define __I915_MM_H__
8 
9 #include <linux/types.h>
10 
11 struct vm_area_struct;
12 struct io_mapping;
13 struct scatterlist;
14 
15 #if IS_ENABLED(CONFIG_X86)
16 int remap_io_mapping(struct vm_area_struct *vma,
17 		     unsigned long addr, unsigned long pfn, unsigned long size,
18 		     struct io_mapping *iomap);
19 #else
20 static inline
21 int remap_io_mapping(struct vm_area_struct *vma,
22 		     unsigned long addr, unsigned long pfn, unsigned long size,
23 		     struct io_mapping *iomap)
24 {
25 	pr_err("Architecture has no %s() and shouldn't be calling this function\n", __func__);
26 	WARN_ON_ONCE(1);
27 	return 0;
28 }
29 #endif
30 
31 int remap_io_sg(struct vm_area_struct *vma,
32 		unsigned long addr, unsigned long size,
33 		struct scatterlist *sgl, resource_size_t iobase);
34 
35 #endif /* __I915_MM_H__ */
36