xref: /openbmc/linux/drivers/gpu/drm/i915/gt/shmem_utils.h (revision a16be368)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2020 Intel Corporation
4  */
5 
6 #ifndef SHMEM_UTILS_H
7 #define SHMEM_UTILS_H
8 
9 #include <linux/types.h>
10 
11 struct drm_i915_gem_object;
12 struct file;
13 
14 struct file *shmem_create_from_data(const char *name, void *data, size_t len);
15 struct file *shmem_create_from_object(struct drm_i915_gem_object *obj);
16 
17 void *shmem_pin_map(struct file *file);
18 void shmem_unpin_map(struct file *file, void *ptr);
19 
20 int shmem_read(struct file *file, loff_t off, void *dst, size_t len);
21 int shmem_write(struct file *file, loff_t off, void *src, size_t len);
22 
23 #endif /* SHMEM_UTILS_H */
24