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
01670a79
Commit
01670a79
authored
Nov 01, 2017
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau: allocate mmu object for every client
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
359088d5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/nouveau/nouveau_drm.c
+20
-0
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+2
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_drm.c
View file @
01670a79
...
...
@@ -116,6 +116,7 @@ nouveau_cli_fini(struct nouveau_cli *cli)
{
usif_client_fini
(
cli
);
nouveau_vmm_fini
(
&
cli
->
vmm
);
nvif_mmu_fini
(
&
cli
->
mmu
);
nvif_device_fini
(
&
cli
->
device
);
mutex_lock
(
&
cli
->
drm
->
master
.
lock
);
nvif_client_fini
(
&
cli
->
base
);
...
...
@@ -126,6 +127,13 @@ static int
nouveau_cli_init
(
struct
nouveau_drm
*
drm
,
const
char
*
sname
,
struct
nouveau_cli
*
cli
)
{
static
const
struct
nvif_mclass
mmus
[]
=
{
{
NVIF_CLASS_MMU_GF100
,
-
1
},
{
NVIF_CLASS_MMU_NV50
,
-
1
},
{
NVIF_CLASS_MMU_NV04
,
-
1
},
{}
};
u64
device
=
nouveau_name
(
drm
->
dev
);
int
ret
;
...
...
@@ -160,6 +168,18 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
goto
done
;
}
ret
=
nvif_mclass
(
&
cli
->
device
.
object
,
mmus
);
if
(
ret
<
0
)
{
NV_ERROR
(
drm
,
"No supported MMU class
\n
"
);
goto
done
;
}
ret
=
nvif_mmu_init
(
&
cli
->
device
.
object
,
mmus
[
ret
].
oclass
,
&
cli
->
mmu
);
if
(
ret
)
{
NV_ERROR
(
drm
,
"MMU allocation failed: %d
\n
"
,
ret
);
goto
done
;
}
done:
if
(
ret
)
nouveau_cli_fini
(
cli
);
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
01670a79
...
...
@@ -42,6 +42,7 @@
#include <nvif/client.h>
#include <nvif/device.h>
#include <nvif/ioctl.h>
#include <nvif/mmu.h>
#include <drm/drmP.h>
...
...
@@ -91,6 +92,7 @@ struct nouveau_cli {
struct
mutex
mutex
;
struct
nvif_device
device
;
struct
nvif_mmu
mmu
;
struct
nouveau_vmm
vmm
;
struct
nvkm_vm
*
vm
;
...
...
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