Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
fc584e1a
Commit
fc584e1a
authored
Nov 01, 2017
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/bar/nv50: initialise vmm with new interfaces
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
f9463a4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
18 deletions
+19
-18
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c
+17
-16
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.h
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.h
+2
-2
No files found.
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c
View file @
fc584e1a
...
...
@@ -46,7 +46,7 @@ nv50_bar_flush(struct nvkm_bar *base)
struct
nvkm_vmm
*
nv50_bar_bar1_vmm
(
struct
nvkm_bar
*
base
)
{
return
nv50_bar
(
base
)
->
bar1_vm
;
return
nv50_bar
(
base
)
->
bar1_vm
m
;
}
void
...
...
@@ -72,7 +72,7 @@ nv50_bar_bar1_init(struct nvkm_bar *base)
struct
nvkm_vmm
*
nv50_bar_bar2_vmm
(
struct
nvkm_bar
*
base
)
{
return
nv50_bar
(
base
)
->
bar2_vm
;
return
nv50_bar
(
base
)
->
bar2_vm
m
;
}
void
...
...
@@ -109,7 +109,6 @@ nv50_bar_oneinit(struct nvkm_bar *base)
struct
nvkm_device
*
device
=
bar
->
base
.
subdev
.
device
;
static
struct
lock_class_key
bar1_lock
;
static
struct
lock_class_key
bar2_lock
;
struct
nvkm_vm
*
vm
;
u64
start
,
limit
;
int
ret
;
...
...
@@ -130,18 +129,19 @@ nv50_bar_oneinit(struct nvkm_bar *base)
start
=
0x0100000000ULL
;
limit
=
start
+
device
->
func
->
resource_size
(
device
,
3
);
ret
=
nvkm_vm_new
(
device
,
start
,
limit
-
start
,
start
,
&
bar2_lock
,
&
vm
);
ret
=
nvkm_vmm_new
(
device
,
start
,
limit
--
-
start
,
NULL
,
0
,
&
bar2_lock
,
"bar2"
,
&
bar
->
bar2_vmm
);
if
(
ret
)
return
ret
;
atomic_inc
(
&
vm
->
engref
[
NVKM_SUBDEV_BAR
]);
atomic_inc
(
&
bar
->
bar2_vmm
->
engref
[
NVKM_SUBDEV_BAR
]);
bar
->
bar2_vmm
->
debug
=
bar
->
base
.
subdev
.
debug
;
ret
=
nvkm_vm
_boot
(
vm
,
limit
--
-
start
);
ret
=
nvkm_vm
m_boot
(
bar
->
bar2_vmm
);
if
(
ret
)
return
ret
;
ret
=
nvkm_vm_ref
(
vm
,
&
bar
->
bar2_vm
,
bar
->
mem
->
memory
);
nvkm_vm_ref
(
NULL
,
&
vm
,
NULL
);
ret
=
nvkm_vmm_join
(
bar
->
bar2_vmm
,
bar
->
mem
->
memory
);
if
(
ret
)
return
ret
;
...
...
@@ -166,14 +166,13 @@ nv50_bar_oneinit(struct nvkm_bar *base)
start
=
0x0000000000ULL
;
limit
=
start
+
device
->
func
->
resource_size
(
device
,
1
);
ret
=
nvkm_vm_new
(
device
,
start
,
limit
--
-
start
,
start
,
&
bar1_lock
,
&
vm
);
if
(
ret
)
return
ret
;
ret
=
nvkm_vmm_new
(
device
,
start
,
limit
--
-
start
,
NULL
,
0
,
&
bar1_lock
,
"bar1"
,
&
bar
->
bar1_vmm
);
atomic_inc
(
&
vm
->
engref
[
NVKM_SUBDEV_BAR
]);
atomic_inc
(
&
bar
->
bar1_vmm
->
engref
[
NVKM_SUBDEV_BAR
]);
bar
->
bar1_vmm
->
debug
=
bar
->
base
.
subdev
.
debug
;
ret
=
nvkm_vm_ref
(
vm
,
&
bar
->
bar1_vm
,
bar
->
mem
->
memory
);
nvkm_vm_ref
(
NULL
,
&
vm
,
NULL
);
ret
=
nvkm_vmm_join
(
bar
->
bar1_vmm
,
bar
->
mem
->
memory
);
if
(
ret
)
return
ret
;
...
...
@@ -199,9 +198,11 @@ nv50_bar_dtor(struct nvkm_bar *base)
struct
nv50_bar
*
bar
=
nv50_bar
(
base
);
if
(
bar
->
mem
)
{
nvkm_gpuobj_del
(
&
bar
->
bar1
);
nvkm_vm_ref
(
NULL
,
&
bar
->
bar1_vm
,
bar
->
mem
->
memory
);
nvkm_vmm_part
(
bar
->
bar1_vmm
,
bar
->
mem
->
memory
);
nvkm_vmm_unref
(
&
bar
->
bar1_vmm
);
nvkm_gpuobj_del
(
&
bar
->
bar2
);
nvkm_vm_ref
(
NULL
,
&
bar
->
bar2_vm
,
bar
->
mem
->
memory
);
nvkm_vmm_part
(
bar
->
bar2_vmm
,
bar
->
mem
->
memory
);
nvkm_vmm_unref
(
&
bar
->
bar2_vmm
);
nvkm_gpuobj_del
(
&
bar
->
pgd
);
nvkm_gpuobj_del
(
&
bar
->
pad
);
nvkm_gpuobj_del
(
&
bar
->
mem
);
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.h
View file @
fc584e1a
...
...
@@ -9,9 +9,9 @@ struct nv50_bar {
struct
nvkm_gpuobj
*
mem
;
struct
nvkm_gpuobj
*
pad
;
struct
nvkm_gpuobj
*
pgd
;
struct
nvkm_vm
*
bar1_v
m
;
struct
nvkm_vm
m
*
bar1_vm
m
;
struct
nvkm_gpuobj
*
bar1
;
struct
nvkm_vm
*
bar2_v
m
;
struct
nvkm_vm
m
*
bar2_vm
m
;
struct
nvkm_gpuobj
*
bar2
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment