1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2019 Intel Corporation
4  */
5 
6 #ifndef __I915_GEM_LMEM_H
7 #define __I915_GEM_LMEM_H
8 
9 #include <linux/types.h>
10 
11 struct drm_i915_private;
12 struct drm_i915_gem_object;
13 struct intel_memory_region;
14 
15 extern const struct drm_i915_gem_object_ops i915_gem_lmem_obj_ops;
16 
17 void __iomem *i915_gem_object_lmem_io_map(struct drm_i915_gem_object *obj,
18 					  unsigned long n, unsigned long size);
19 void __iomem *i915_gem_object_lmem_io_map_page(struct drm_i915_gem_object *obj,
20 					       unsigned long n);
21 void __iomem *
22 i915_gem_object_lmem_io_map_page_atomic(struct drm_i915_gem_object *obj,
23 					unsigned long n);
24 
25 bool i915_gem_object_is_lmem(struct drm_i915_gem_object *obj);
26 
27 struct drm_i915_gem_object *
28 i915_gem_object_create_lmem(struct drm_i915_private *i915,
29 			    resource_size_t size,
30 			    unsigned int flags);
31 
32 struct drm_i915_gem_object *
33 __i915_gem_lmem_object_create(struct intel_memory_region *mem,
34 			      resource_size_t size,
35 			      unsigned int flags);
36 
37 #endif /* !__I915_GEM_LMEM_H */
38