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
nexedi
linux
Commits
f66c57d9
Commit
f66c57d9
authored
Nov 01, 2017
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/fifo: initialise vmm with new interfaces
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
85f7c3a0
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
31 additions
and
57 deletions
+31
-57
drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
+1
-1
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c
+18
-15
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c
+1
-5
drivers/gpu/drm/nouveau/nvkm/engine/fifo/changf100.h
drivers/gpu/drm/nouveau/nvkm/engine/fifo/changf100.h
+0
-2
drivers/gpu/drm/nouveau/nvkm/engine/fifo/changk104.h
drivers/gpu/drm/nouveau/nvkm/engine/fifo/changk104.h
+0
-2
drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c
+1
-7
drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.h
drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.h
+0
-1
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c
+3
-10
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c
+3
-10
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+4
-4
No files found.
drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
View file @
f66c57d9
...
@@ -22,7 +22,7 @@ struct nvkm_fifo_chan {
...
@@ -22,7 +22,7 @@ struct nvkm_fifo_chan {
u16
chid
;
u16
chid
;
struct
nvkm_gpuobj
*
inst
;
struct
nvkm_gpuobj
*
inst
;
struct
nvkm_gpuobj
*
push
;
struct
nvkm_gpuobj
*
push
;
struct
nvkm_vm
*
v
m
;
struct
nvkm_vm
m
*
vm
m
;
void
__iomem
*
user
;
void
__iomem
*
user
;
u64
addr
;
u64
addr
;
u32
size
;
u32
size
;
...
...
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c
View file @
f66c57d9
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <core/gpuobj.h>
#include <core/gpuobj.h>
#include <core/oproxy.h>
#include <core/oproxy.h>
#include <subdev/mmu.h>
#include <subdev/mmu.h>
#include <subdev/mmu/priv.h>
#include <engine/dma.h>
#include <engine/dma.h>
struct
nvkm_fifo_chan_object
{
struct
nvkm_fifo_chan_object
{
...
@@ -117,8 +118,8 @@ nvkm_fifo_chan_child_del(struct nvkm_oproxy *base)
...
@@ -117,8 +118,8 @@ nvkm_fifo_chan_child_del(struct nvkm_oproxy *base)
if
(
chan
->
func
->
engine_dtor
)
if
(
chan
->
func
->
engine_dtor
)
chan
->
func
->
engine_dtor
(
chan
,
engine
);
chan
->
func
->
engine_dtor
(
chan
,
engine
);
nvkm_object_del
(
&
engn
->
object
);
nvkm_object_del
(
&
engn
->
object
);
if
(
chan
->
vm
)
if
(
chan
->
vm
m
)
atomic_dec
(
&
chan
->
vm
->
engref
[
engine
->
subdev
.
index
]);
atomic_dec
(
&
chan
->
vm
m
->
engref
[
engine
->
subdev
.
index
]);
}
}
}
}
...
@@ -151,8 +152,8 @@ nvkm_fifo_chan_child_new(const struct nvkm_oclass *oclass, void *data, u32 size,
...
@@ -151,8 +152,8 @@ nvkm_fifo_chan_child_new(const struct nvkm_oclass *oclass, void *data, u32 size,
.
engine
=
oclass
->
engine
,
.
engine
=
oclass
->
engine
,
};
};
if
(
chan
->
vm
)
if
(
chan
->
vm
m
)
atomic_inc
(
&
chan
->
vm
->
engref
[
engine
->
subdev
.
index
]);
atomic_inc
(
&
chan
->
vm
m
->
engref
[
engine
->
subdev
.
index
]);
if
(
engine
->
func
->
fifo
.
cclass
)
{
if
(
engine
->
func
->
fifo
.
cclass
)
{
ret
=
engine
->
func
->
fifo
.
cclass
(
chan
,
&
cclass
,
ret
=
engine
->
func
->
fifo
.
cclass
(
chan
,
&
cclass
,
...
@@ -327,7 +328,10 @@ nvkm_fifo_chan_dtor(struct nvkm_object *object)
...
@@ -327,7 +328,10 @@ nvkm_fifo_chan_dtor(struct nvkm_object *object)
if
(
chan
->
user
)
if
(
chan
->
user
)
iounmap
(
chan
->
user
);
iounmap
(
chan
->
user
);
nvkm_vm_ref
(
NULL
,
&
chan
->
vm
,
NULL
);
if
(
chan
->
vmm
)
{
nvkm_vmm_part
(
chan
->
vmm
,
chan
->
inst
->
memory
);
nvkm_vmm_unref
(
&
chan
->
vmm
);
}
nvkm_gpuobj_del
(
&
chan
->
push
);
nvkm_gpuobj_del
(
&
chan
->
push
);
nvkm_gpuobj_del
(
&
chan
->
inst
);
nvkm_gpuobj_del
(
&
chan
->
inst
);
...
@@ -355,7 +359,6 @@ nvkm_fifo_chan_ctor(const struct nvkm_fifo_chan_func *func,
...
@@ -355,7 +359,6 @@ nvkm_fifo_chan_ctor(const struct nvkm_fifo_chan_func *func,
{
{
struct
nvkm_client
*
client
=
oclass
->
client
;
struct
nvkm_client
*
client
=
oclass
->
client
;
struct
nvkm_device
*
device
=
fifo
->
engine
.
subdev
.
device
;
struct
nvkm_device
*
device
=
fifo
->
engine
.
subdev
.
device
;
struct
nvkm_mmu
*
mmu
=
device
->
mmu
;
struct
nvkm_dmaobj
*
dmaobj
;
struct
nvkm_dmaobj
*
dmaobj
;
unsigned
long
flags
;
unsigned
long
flags
;
int
ret
;
int
ret
;
...
@@ -384,16 +387,16 @@ nvkm_fifo_chan_ctor(const struct nvkm_fifo_chan_func *func,
...
@@ -384,16 +387,16 @@ nvkm_fifo_chan_ctor(const struct nvkm_fifo_chan_func *func,
}
}
/* channel address space */
/* channel address space */
if
(
!
vm
&&
mmu
)
{
if
(
!
device
->
mmu
->
func
->
vmm
.
global
)
{
if
(
!
client
->
vm
||
client
->
vm
->
mmu
==
mmu
)
{
struct
nvkm_vmm
*
vmm
=
client
->
vm
;
ret
=
nvkm_vm_ref
(
client
->
vm
,
&
chan
->
vm
,
NULL
);
if
(
vmm
->
mmu
!=
device
->
mmu
)
return
-
EINVAL
;
ret
=
nvkm_vmm_join
(
vmm
,
chan
->
inst
->
memory
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
}
else
{
return
-
EINVAL
;
chan
->
vmm
=
nvkm_vmm_ref
(
vmm
);
}
}
else
{
return
-
ENOENT
;
}
}
/* allocate channel id */
/* allocate channel id */
...
...
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c
View file @
f66c57d9
...
@@ -277,9 +277,5 @@ g84_fifo_chan_ctor(struct nv50_fifo *fifo, u64 vm, u64 push,
...
@@ -277,9 +277,5 @@ g84_fifo_chan_ctor(struct nv50_fifo *fifo, u64 vm, u64 push,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_ramht_new
(
device
,
0x8000
,
16
,
chan
->
base
.
inst
,
&
chan
->
ramht
);
return
nvkm_ramht_new
(
device
,
0x8000
,
16
,
chan
->
base
.
inst
,
&
chan
->
ramht
);
if
(
ret
)
return
ret
;
return
nvkm_vm_ref
(
chan
->
base
.
vm
,
&
chan
->
vm
,
chan
->
base
.
inst
->
memory
);
}
}
drivers/gpu/drm/nouveau/nvkm/engine/fifo/changf100.h
View file @
f66c57d9
...
@@ -11,8 +11,6 @@ struct gf100_fifo_chan {
...
@@ -11,8 +11,6 @@ struct gf100_fifo_chan {
struct
list_head
head
;
struct
list_head
head
;
bool
killed
;
bool
killed
;
struct
nvkm_vm
*
vm
;
struct
{
struct
{
struct
nvkm_gpuobj
*
inst
;
struct
nvkm_gpuobj
*
inst
;
struct
nvkm_vma
vma
;
struct
nvkm_vma
vma
;
...
...
drivers/gpu/drm/nouveau/nvkm/engine/fifo/changk104.h
View file @
f66c57d9
...
@@ -12,8 +12,6 @@ struct gk104_fifo_chan {
...
@@ -12,8 +12,6 @@ struct gk104_fifo_chan {
struct
list_head
head
;
struct
list_head
head
;
bool
killed
;
bool
killed
;
struct
nvkm_vm
*
vm
;
struct
{
struct
{
struct
nvkm_gpuobj
*
inst
;
struct
nvkm_gpuobj
*
inst
;
struct
nvkm_vma
vma
;
struct
nvkm_vma
vma
;
...
...
drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c
View file @
f66c57d9
...
@@ -206,8 +206,6 @@ void *
...
@@ -206,8 +206,6 @@ void *
nv50_fifo_chan_dtor
(
struct
nvkm_fifo_chan
*
base
)
nv50_fifo_chan_dtor
(
struct
nvkm_fifo_chan
*
base
)
{
{
struct
nv50_fifo_chan
*
chan
=
nv50_fifo_chan
(
base
);
struct
nv50_fifo_chan
*
chan
=
nv50_fifo_chan
(
base
);
if
(
chan
->
base
.
inst
)
nvkm_vm_ref
(
NULL
,
&
chan
->
vm
,
chan
->
base
.
inst
->
memory
);
nvkm_ramht_del
(
&
chan
->
ramht
);
nvkm_ramht_del
(
&
chan
->
ramht
);
nvkm_gpuobj_del
(
&
chan
->
pgd
);
nvkm_gpuobj_del
(
&
chan
->
pgd
);
nvkm_gpuobj_del
(
&
chan
->
eng
);
nvkm_gpuobj_del
(
&
chan
->
eng
);
...
@@ -263,9 +261,5 @@ nv50_fifo_chan_ctor(struct nv50_fifo *fifo, u64 vm, u64 push,
...
@@ -263,9 +261,5 @@ nv50_fifo_chan_ctor(struct nv50_fifo *fifo, u64 vm, u64 push,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_ramht_new
(
device
,
0x8000
,
16
,
chan
->
base
.
inst
,
&
chan
->
ramht
);
return
nvkm_ramht_new
(
device
,
0x8000
,
16
,
chan
->
base
.
inst
,
&
chan
->
ramht
);
if
(
ret
)
return
ret
;
return
nvkm_vm_ref
(
chan
->
base
.
vm
,
&
chan
->
vm
,
chan
->
base
.
inst
->
memory
);
}
}
drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.h
View file @
f66c57d9
...
@@ -13,7 +13,6 @@ struct nv50_fifo_chan {
...
@@ -13,7 +13,6 @@ struct nv50_fifo_chan {
struct
nvkm_gpuobj
*
eng
;
struct
nvkm_gpuobj
*
eng
;
struct
nvkm_gpuobj
*
pgd
;
struct
nvkm_gpuobj
*
pgd
;
struct
nvkm_ramht
*
ramht
;
struct
nvkm_ramht
*
ramht
;
struct
nvkm_vm
*
vm
;
struct
nvkm_gpuobj
*
engn
[
NVKM_SUBDEV_NR
];
struct
nvkm_gpuobj
*
engn
[
NVKM_SUBDEV_NR
];
};
};
...
...
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c
View file @
f66c57d9
...
@@ -150,12 +150,12 @@ gf100_fifo_gpfifo_engine_ctor(struct nvkm_fifo_chan *base,
...
@@ -150,12 +150,12 @@ gf100_fifo_gpfifo_engine_ctor(struct nvkm_fifo_chan *base,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_vm_get
(
chan
->
v
m
,
chan
->
engn
[
engn
].
inst
->
size
,
12
,
ret
=
nvkm_vm_get
(
chan
->
base
.
vm
m
,
chan
->
engn
[
engn
].
inst
->
size
,
12
,
NV_MEM_ACCESS_RW
,
&
chan
->
engn
[
engn
].
vma
);
NV_MEM_ACCESS_RW
,
&
chan
->
engn
[
engn
].
vma
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
return
nvkm_memory_map
(
chan
->
engn
[
engn
].
inst
,
0
,
chan
->
v
m
,
return
nvkm_memory_map
(
chan
->
engn
[
engn
].
inst
,
0
,
chan
->
base
.
vm
m
,
&
chan
->
engn
[
engn
].
vma
,
NULL
,
0
);
&
chan
->
engn
[
engn
].
vma
,
NULL
,
0
);
}
}
...
@@ -199,10 +199,7 @@ gf100_fifo_gpfifo_init(struct nvkm_fifo_chan *base)
...
@@ -199,10 +199,7 @@ gf100_fifo_gpfifo_init(struct nvkm_fifo_chan *base)
static
void
*
static
void
*
gf100_fifo_gpfifo_dtor
(
struct
nvkm_fifo_chan
*
base
)
gf100_fifo_gpfifo_dtor
(
struct
nvkm_fifo_chan
*
base
)
{
{
struct
gf100_fifo_chan
*
chan
=
gf100_fifo_chan
(
base
);
return
gf100_fifo_chan
(
base
);
if
(
chan
->
base
.
inst
)
nvkm_vm_ref
(
NULL
,
&
chan
->
vm
,
chan
->
base
.
inst
->
memory
);
return
chan
;
}
}
static
const
struct
nvkm_fifo_chan_func
static
const
struct
nvkm_fifo_chan_func
...
@@ -262,10 +259,6 @@ gf100_fifo_gpfifo_new(struct nvkm_fifo *base, const struct nvkm_oclass *oclass,
...
@@ -262,10 +259,6 @@ gf100_fifo_gpfifo_new(struct nvkm_fifo *base, const struct nvkm_oclass *oclass,
args
->
v0
.
chid
=
chan
->
base
.
chid
;
args
->
v0
.
chid
=
chan
->
base
.
chid
;
ret
=
nvkm_vm_ref
(
chan
->
base
.
vm
,
&
chan
->
vm
,
chan
->
base
.
inst
->
memory
);
if
(
ret
)
return
ret
;
/* clear channel control registers */
/* clear channel control registers */
usermem
=
chan
->
base
.
chid
*
0x1000
;
usermem
=
chan
->
base
.
chid
*
0x1000
;
...
...
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c
View file @
f66c57d9
...
@@ -162,12 +162,12 @@ gk104_fifo_gpfifo_engine_ctor(struct nvkm_fifo_chan *base,
...
@@ -162,12 +162,12 @@ gk104_fifo_gpfifo_engine_ctor(struct nvkm_fifo_chan *base,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_vm_get
(
chan
->
v
m
,
chan
->
engn
[
engn
].
inst
->
size
,
12
,
ret
=
nvkm_vm_get
(
chan
->
base
.
vm
m
,
chan
->
engn
[
engn
].
inst
->
size
,
12
,
NV_MEM_ACCESS_RW
,
&
chan
->
engn
[
engn
].
vma
);
NV_MEM_ACCESS_RW
,
&
chan
->
engn
[
engn
].
vma
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
return
nvkm_memory_map
(
chan
->
engn
[
engn
].
inst
,
0
,
chan
->
v
m
,
return
nvkm_memory_map
(
chan
->
engn
[
engn
].
inst
,
0
,
chan
->
base
.
vm
m
,
&
chan
->
engn
[
engn
].
vma
,
NULL
,
0
);
&
chan
->
engn
[
engn
].
vma
,
NULL
,
0
);
}
}
...
@@ -212,10 +212,7 @@ gk104_fifo_gpfifo_init(struct nvkm_fifo_chan *base)
...
@@ -212,10 +212,7 @@ gk104_fifo_gpfifo_init(struct nvkm_fifo_chan *base)
static
void
*
static
void
*
gk104_fifo_gpfifo_dtor
(
struct
nvkm_fifo_chan
*
base
)
gk104_fifo_gpfifo_dtor
(
struct
nvkm_fifo_chan
*
base
)
{
{
struct
gk104_fifo_chan
*
chan
=
gk104_fifo_chan
(
base
);
return
gk104_fifo_chan
(
base
);
if
(
chan
->
base
.
inst
)
nvkm_vm_ref
(
NULL
,
&
chan
->
vm
,
chan
->
base
.
inst
->
memory
);
return
chan
;
}
}
static
const
struct
nvkm_fifo_chan_func
static
const
struct
nvkm_fifo_chan_func
...
@@ -301,10 +298,6 @@ gk104_fifo_gpfifo_new_(const struct gk104_fifo_chan_func *func,
...
@@ -301,10 +298,6 @@ gk104_fifo_gpfifo_new_(const struct gk104_fifo_chan_func *func,
*
chid
=
chan
->
base
.
chid
;
*
chid
=
chan
->
base
.
chid
;
ret
=
nvkm_vm_ref
(
chan
->
base
.
vm
,
&
chan
->
vm
,
chan
->
base
.
inst
->
memory
);
if
(
ret
)
return
ret
;
/* Clear channel control registers. */
/* Clear channel control registers. */
usermem
=
chan
->
base
.
chid
*
0x200
;
usermem
=
chan
->
base
.
chid
*
0x200
;
ilength
=
order_base_2
(
ilength
/
8
);
ilength
=
order_base_2
(
ilength
/
8
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
View file @
f66c57d9
...
@@ -398,12 +398,12 @@ gf100_gr_chan_new(struct nvkm_gr *base, struct nvkm_fifo_chan *fifoch,
...
@@ -398,12 +398,12 @@ gf100_gr_chan_new(struct nvkm_gr *base, struct nvkm_fifo_chan *fifoch,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_vm_get
(
fifoch
->
vm
,
0x1000
,
12
,
NV_MEM_ACCESS_RW
|
ret
=
nvkm_vm_get
(
fifoch
->
vm
m
,
0x1000
,
12
,
NV_MEM_ACCESS_RW
|
NV_MEM_ACCESS_SYS
,
&
chan
->
mmio_vma
);
NV_MEM_ACCESS_SYS
,
&
chan
->
mmio_vma
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_memory_map
(
chan
->
mmio
,
0
,
fifoch
->
vm
,
ret
=
nvkm_memory_map
(
chan
->
mmio
,
0
,
fifoch
->
vm
m
,
&
chan
->
mmio_vma
,
NULL
,
0
);
&
chan
->
mmio_vma
,
NULL
,
0
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -416,13 +416,13 @@ gf100_gr_chan_new(struct nvkm_gr *base, struct nvkm_fifo_chan *fifoch,
...
@@ -416,13 +416,13 @@ gf100_gr_chan_new(struct nvkm_gr *base, struct nvkm_fifo_chan *fifoch,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_vm_get
(
fifoch
->
vm
,
ret
=
nvkm_vm_get
(
fifoch
->
vm
m
,
nvkm_memory_size
(
chan
->
data
[
i
].
mem
),
12
,
nvkm_memory_size
(
chan
->
data
[
i
].
mem
),
12
,
data
->
access
,
&
chan
->
data
[
i
].
vma
);
data
->
access
,
&
chan
->
data
[
i
].
vma
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_memory_map
(
chan
->
data
[
i
].
mem
,
0
,
fifoch
->
vm
,
ret
=
nvkm_memory_map
(
chan
->
data
[
i
].
mem
,
0
,
fifoch
->
vm
m
,
&
chan
->
data
[
i
].
vma
,
NULL
,
0
);
&
chan
->
data
[
i
].
vma
,
NULL
,
0
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
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