xref: /linux/drivers/gpu/drm/loongson/lsdc_gem.h (revision 6e7fd890f1d6ac83805409e9c346240de2705584)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2023 Loongson Technology Corporation Limited
4  */
5 
6 #ifndef __LSDC_GEM_H__
7 #define __LSDC_GEM_H__
8 
9 #include <drm/drm_device.h>
10 #include <drm/drm_gem.h>
11 
12 struct drm_gem_object *
13 lsdc_prime_import_sg_table(struct drm_device *ddev,
14 			   struct dma_buf_attachment *attach,
15 			   struct sg_table *sg);
16 
17 int lsdc_dumb_map_offset(struct drm_file *file,
18 			 struct drm_device *dev,
19 			 u32 handle,
20 			 uint64_t *offset);
21 
22 int lsdc_dumb_create(struct drm_file *file,
23 		     struct drm_device *ddev,
24 		     struct drm_mode_create_dumb *args);
25 
26 void lsdc_gem_init(struct drm_device *ddev);
27 int lsdc_show_buffer_object(struct seq_file *m, void *arg);
28 
29 struct drm_gem_object *
30 lsdc_gem_object_create(struct drm_device *ddev,
31 		       u32 domain,
32 		       size_t size,
33 		       bool kerenl,
34 		       struct sg_table *sg,
35 		       struct dma_resv *resv);
36 
37 #endif
38