aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-07-30 07:27:09 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-07-31 17:58:18 -0400
commit4a8c21a1e9b3c35b21c5a4a4c16a009a193389bd (patch)
tree1b2d6994f5a5c9e39a54f0eb405181cbfdc63bd0 /drivers/gpu/drm/amd/amdgpu
parent8ab19ea619aeed8ca4a36c124e8edfd9b9491aba (diff)
drm/amdgpu: move bo_list defines to amdgpu_bo_list.h
Further demangle amdgpu.h Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Acked-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h40
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h70
2 files changed, 71 insertions, 39 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 4d4d6697fbce..447c4c7a36d6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -74,6 +74,7 @@
74#include "amdgpu_gart.h" 74#include "amdgpu_gart.h"
75#include "amdgpu_debugfs.h" 75#include "amdgpu_debugfs.h"
76#include "amdgpu_job.h" 76#include "amdgpu_job.h"
77#include "amdgpu_bo_list.h"
77 78
78/* 79/*
79 * Modules parameters. 80 * Modules parameters.
@@ -690,45 +691,6 @@ struct amdgpu_fpriv {
690}; 691};
691 692
692/* 693/*
693 * residency list
694 */
695struct amdgpu_bo_list_entry {
696 struct amdgpu_bo *robj;
697 struct ttm_validate_buffer tv;
698 struct amdgpu_bo_va *bo_va;
699 uint32_t priority;
700 struct page **user_pages;
701 int user_invalidated;
702};
703
704struct amdgpu_bo_list {
705 struct mutex lock;
706 struct rcu_head rhead;
707 struct kref refcount;
708 struct amdgpu_bo *gds_obj;
709 struct amdgpu_bo *gws_obj;
710 struct amdgpu_bo *oa_obj;
711 unsigned first_userptr;
712 unsigned num_entries;
713 struct amdgpu_bo_list_entry *array;
714};
715
716int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id,
717 struct amdgpu_bo_list **result);
718void amdgpu_bo_list_get_list(struct amdgpu_bo_list *list,
719 struct list_head *validated);
720void amdgpu_bo_list_put(struct amdgpu_bo_list *list);
721void amdgpu_bo_list_free(struct amdgpu_bo_list *list);
722int amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in,
723 struct drm_amdgpu_bo_list_entry **info_param);
724
725int amdgpu_bo_list_create(struct amdgpu_device *adev,
726 struct drm_file *filp,
727 struct drm_amdgpu_bo_list_entry *info,
728 unsigned num_entries,
729 struct amdgpu_bo_list **list);
730
731/*
732 * GFX stuff 694 * GFX stuff
733 */ 695 */
734#include "clearstate_defs.h" 696#include "clearstate_defs.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h
new file mode 100644
index 000000000000..833f846bfdad
--- /dev/null
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h
@@ -0,0 +1,70 @@
1/*
2 * Copyright 2018 Advanced Micro Devices, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 */
23#ifndef __AMDGPU_BO_LIST_H__
24#define __AMDGPU_BO_LIST_H__
25
26#include <drm/ttm/ttm_execbuf_util.h>
27#include <drm/amdgpu_drm.h>
28
29struct amdgpu_device;
30struct amdgpu_bo;
31struct amdgpu_bo_va;
32struct amdgpu_fpriv;
33
34struct amdgpu_bo_list_entry {
35 struct amdgpu_bo *robj;
36 struct ttm_validate_buffer tv;
37 struct amdgpu_bo_va *bo_va;
38 uint32_t priority;
39 struct page **user_pages;
40 int user_invalidated;
41};
42
43struct amdgpu_bo_list {
44 struct mutex lock;
45 struct rcu_head rhead;
46 struct kref refcount;
47 struct amdgpu_bo *gds_obj;
48 struct amdgpu_bo *gws_obj;
49 struct amdgpu_bo *oa_obj;
50 unsigned first_userptr;
51 unsigned num_entries;
52 struct amdgpu_bo_list_entry *array;
53};
54
55int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id,
56 struct amdgpu_bo_list **result);
57void amdgpu_bo_list_get_list(struct amdgpu_bo_list *list,
58 struct list_head *validated);
59void amdgpu_bo_list_put(struct amdgpu_bo_list *list);
60void amdgpu_bo_list_free(struct amdgpu_bo_list *list);
61int amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in,
62 struct drm_amdgpu_bo_list_entry **info_param);
63
64int amdgpu_bo_list_create(struct amdgpu_device *adev,
65 struct drm_file *filp,
66 struct drm_amdgpu_bo_list_entry *info,
67 unsigned num_entries,
68 struct amdgpu_bo_list **list);
69
70#endif