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
83f56106
Commit
83f56106
authored
Aug 20, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/mmu: switch to device pri macros
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
25e3a463
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
26 deletions
+32
-26
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c
+6
-5
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv41.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv41.c
+8
-6
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c
+15
-13
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
+3
-2
No files found.
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c
View file @
83f56106
...
@@ -154,7 +154,8 @@ static void
...
@@ -154,7 +154,8 @@ static void
gf100_vm_flush
(
struct
nvkm_vm
*
vm
)
gf100_vm_flush
(
struct
nvkm_vm
*
vm
)
{
{
struct
nvkm_mmu
*
mmu
=
(
void
*
)
vm
->
mmu
;
struct
nvkm_mmu
*
mmu
=
(
void
*
)
vm
->
mmu
;
struct
nvkm_bar
*
bar
=
nvkm_bar
(
mmu
);
struct
nvkm_device
*
device
=
mmu
->
subdev
.
device
;
struct
nvkm_bar
*
bar
=
device
->
bar
;
struct
nvkm_vm_pgd
*
vpgd
;
struct
nvkm_vm_pgd
*
vpgd
;
u32
type
;
u32
type
;
...
@@ -171,16 +172,16 @@ gf100_vm_flush(struct nvkm_vm *vm)
...
@@ -171,16 +172,16 @@ gf100_vm_flush(struct nvkm_vm *vm)
*/
*/
if
(
!
nv_wait_ne
(
mmu
,
0x100c80
,
0x00ff0000
,
0x00000000
))
{
if
(
!
nv_wait_ne
(
mmu
,
0x100c80
,
0x00ff0000
,
0x00000000
))
{
nv_error
(
mmu
,
"vm timeout 0: 0x%08x %d
\n
"
,
nv_error
(
mmu
,
"vm timeout 0: 0x%08x %d
\n
"
,
nv
_rd32
(
mmu
,
0x100c80
),
type
);
nv
km_rd32
(
device
,
0x100c80
),
type
);
}
}
nv
_wr32
(
mmu
,
0x100cb8
,
vpgd
->
obj
->
addr
>>
8
);
nv
km_wr32
(
device
,
0x100cb8
,
vpgd
->
obj
->
addr
>>
8
);
nv
_wr32
(
mmu
,
0x100cbc
,
0x80000000
|
type
);
nv
km_wr32
(
device
,
0x100cbc
,
0x80000000
|
type
);
/* wait for flush to be queued? */
/* wait for flush to be queued? */
if
(
!
nv_wait
(
mmu
,
0x100c80
,
0x00008000
,
0x00008000
))
{
if
(
!
nv_wait
(
mmu
,
0x100c80
,
0x00008000
,
0x00008000
))
{
nv_error
(
mmu
,
"vm timeout 1: 0x%08x %d
\n
"
,
nv_error
(
mmu
,
"vm timeout 1: 0x%08x %d
\n
"
,
nv
_rd32
(
mmu
,
0x100c80
),
type
);
nv
km_rd32
(
device
,
0x100c80
),
type
);
}
}
}
}
mutex_unlock
(
&
nv_subdev
(
mmu
)
->
mutex
);
mutex_unlock
(
&
nv_subdev
(
mmu
)
->
mutex
);
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv41.c
View file @
83f56106
...
@@ -65,14 +65,15 @@ static void
...
@@ -65,14 +65,15 @@ static void
nv41_vm_flush
(
struct
nvkm_vm
*
vm
)
nv41_vm_flush
(
struct
nvkm_vm
*
vm
)
{
{
struct
nv04_mmu
*
mmu
=
(
void
*
)
vm
->
mmu
;
struct
nv04_mmu
*
mmu
=
(
void
*
)
vm
->
mmu
;
struct
nvkm_device
*
device
=
mmu
->
base
.
subdev
.
device
;
mutex_lock
(
&
nv_subdev
(
mmu
)
->
mutex
);
mutex_lock
(
&
nv_subdev
(
mmu
)
->
mutex
);
nv
_wr32
(
mmu
,
0x100810
,
0x00000022
);
nv
km_wr32
(
device
,
0x100810
,
0x00000022
);
if
(
!
nv_wait
(
mmu
,
0x100810
,
0x00000020
,
0x00000020
))
{
if
(
!
nv_wait
(
mmu
,
0x100810
,
0x00000020
,
0x00000020
))
{
nv_warn
(
mmu
,
"flush timeout, 0x%08x
\n
"
,
nv_warn
(
mmu
,
"flush timeout, 0x%08x
\n
"
,
nv
_rd32
(
mmu
,
0x100810
));
nv
km_rd32
(
device
,
0x100810
));
}
}
nv
_wr32
(
mmu
,
0x100810
,
0x00000000
);
nv
km_wr32
(
device
,
0x100810
,
0x00000000
);
mutex_unlock
(
&
nv_subdev
(
mmu
)
->
mutex
);
mutex_unlock
(
&
nv_subdev
(
mmu
)
->
mutex
);
}
}
...
@@ -131,6 +132,7 @@ static int
...
@@ -131,6 +132,7 @@ static int
nv41_mmu_init
(
struct
nvkm_object
*
object
)
nv41_mmu_init
(
struct
nvkm_object
*
object
)
{
{
struct
nv04_mmu
*
mmu
=
(
void
*
)
object
;
struct
nv04_mmu
*
mmu
=
(
void
*
)
object
;
struct
nvkm_device
*
device
=
mmu
->
base
.
subdev
.
device
;
struct
nvkm_gpuobj
*
dma
=
mmu
->
vm
->
pgt
[
0
].
obj
[
0
];
struct
nvkm_gpuobj
*
dma
=
mmu
->
vm
->
pgt
[
0
].
obj
[
0
];
int
ret
;
int
ret
;
...
@@ -138,9 +140,9 @@ nv41_mmu_init(struct nvkm_object *object)
...
@@ -138,9 +140,9 @@ nv41_mmu_init(struct nvkm_object *object)
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
nv
_wr32
(
mmu
,
0x100800
,
dma
->
addr
|
0x00000002
);
nv
km_wr32
(
device
,
0x100800
,
dma
->
addr
|
0x00000002
);
nv
_mask
(
mmu
,
0x10008c
,
0x00000100
,
0x00000100
);
nv
km_mask
(
device
,
0x10008c
,
0x00000100
,
0x00000100
);
nv
_wr32
(
mmu
,
0x100820
,
0x00000000
);
nv
km_wr32
(
device
,
0x100820
,
0x00000000
);
return
0
;
return
0
;
}
}
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c
View file @
83f56106
...
@@ -140,11 +140,12 @@ static void
...
@@ -140,11 +140,12 @@ static void
nv44_vm_flush
(
struct
nvkm_vm
*
vm
)
nv44_vm_flush
(
struct
nvkm_vm
*
vm
)
{
{
struct
nv04_mmu
*
mmu
=
(
void
*
)
vm
->
mmu
;
struct
nv04_mmu
*
mmu
=
(
void
*
)
vm
->
mmu
;
nv_wr32
(
mmu
,
0x100814
,
mmu
->
base
.
limit
-
NV44_GART_PAGE
);
struct
nvkm_device
*
device
=
mmu
->
base
.
subdev
.
device
;
nv_wr32
(
mmu
,
0x100808
,
0x00000020
);
nvkm_wr32
(
device
,
0x100814
,
mmu
->
base
.
limit
-
NV44_GART_PAGE
);
nvkm_wr32
(
device
,
0x100808
,
0x00000020
);
if
(
!
nv_wait
(
mmu
,
0x100808
,
0x00000001
,
0x00000001
))
if
(
!
nv_wait
(
mmu
,
0x100808
,
0x00000001
,
0x00000001
))
nv_error
(
mmu
,
"timeout: 0x%08x
\n
"
,
nv
_rd32
(
mmu
,
0x100808
));
nv_error
(
mmu
,
"timeout: 0x%08x
\n
"
,
nv
km_rd32
(
device
,
0x100808
));
nv
_wr32
(
mmu
,
0x100808
,
0x00000000
);
nv
km_wr32
(
device
,
0x100808
,
0x00000000
);
}
}
/*******************************************************************************
/*******************************************************************************
...
@@ -208,6 +209,7 @@ static int
...
@@ -208,6 +209,7 @@ static int
nv44_mmu_init
(
struct
nvkm_object
*
object
)
nv44_mmu_init
(
struct
nvkm_object
*
object
)
{
{
struct
nv04_mmu
*
mmu
=
(
void
*
)
object
;
struct
nv04_mmu
*
mmu
=
(
void
*
)
object
;
struct
nvkm_device
*
device
=
mmu
->
base
.
subdev
.
device
;
struct
nvkm_gpuobj
*
gart
=
mmu
->
vm
->
pgt
[
0
].
obj
[
0
];
struct
nvkm_gpuobj
*
gart
=
mmu
->
vm
->
pgt
[
0
].
obj
[
0
];
u32
addr
;
u32
addr
;
int
ret
;
int
ret
;
...
@@ -220,17 +222,17 @@ nv44_mmu_init(struct nvkm_object *object)
...
@@ -220,17 +222,17 @@ nv44_mmu_init(struct nvkm_object *object)
* allocated on 512KiB alignment, and not exceed a total size
* allocated on 512KiB alignment, and not exceed a total size
* of 512KiB for this to work correctly
* of 512KiB for this to work correctly
*/
*/
addr
=
nv
_rd32
(
mmu
,
0x10020c
);
addr
=
nv
km_rd32
(
device
,
0x10020c
);
addr
-=
((
gart
->
addr
>>
19
)
+
1
)
<<
19
;
addr
-=
((
gart
->
addr
>>
19
)
+
1
)
<<
19
;
nv
_wr32
(
mmu
,
0x100850
,
0x80000000
);
nv
km_wr32
(
device
,
0x100850
,
0x80000000
);
nv
_wr32
(
mmu
,
0x100818
,
mmu
->
null
);
nv
km_wr32
(
device
,
0x100818
,
mmu
->
null
);
nv
_wr32
(
mmu
,
0x100804
,
NV44_GART_SIZE
);
nv
km_wr32
(
device
,
0x100804
,
NV44_GART_SIZE
);
nv
_wr32
(
mmu
,
0x100850
,
0x00008000
);
nv
km_wr32
(
device
,
0x100850
,
0x00008000
);
nv
_mask
(
mmu
,
0x10008c
,
0x00000200
,
0x00000200
);
nv
km_mask
(
device
,
0x10008c
,
0x00000200
,
0x00000200
);
nv
_wr32
(
mmu
,
0x100820
,
0x00000000
);
nv
km_wr32
(
device
,
0x100820
,
0x00000000
);
nv
_wr32
(
mmu
,
0x10082c
,
0x00000001
);
nv
km_wr32
(
device
,
0x10082c
,
0x00000001
);
nv
_wr32
(
mmu
,
0x100800
,
addr
|
0x00000010
);
nv
km_wr32
(
device
,
0x100800
,
addr
|
0x00000010
);
return
0
;
return
0
;
}
}
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
View file @
83f56106
...
@@ -146,7 +146,8 @@ static void
...
@@ -146,7 +146,8 @@ static void
nv50_vm_flush
(
struct
nvkm_vm
*
vm
)
nv50_vm_flush
(
struct
nvkm_vm
*
vm
)
{
{
struct
nvkm_mmu
*
mmu
=
(
void
*
)
vm
->
mmu
;
struct
nvkm_mmu
*
mmu
=
(
void
*
)
vm
->
mmu
;
struct
nvkm_bar
*
bar
=
nvkm_bar
(
mmu
);
struct
nvkm_device
*
device
=
mmu
->
subdev
.
device
;
struct
nvkm_bar
*
bar
=
device
->
bar
;
struct
nvkm_engine
*
engine
;
struct
nvkm_engine
*
engine
;
int
i
,
vme
;
int
i
,
vme
;
...
@@ -180,7 +181,7 @@ nv50_vm_flush(struct nvkm_vm *vm)
...
@@ -180,7 +181,7 @@ nv50_vm_flush(struct nvkm_vm *vm)
continue
;
continue
;
}
}
nv
_wr32
(
mmu
,
0x100c80
,
(
vme
<<
16
)
|
1
);
nv
km_wr32
(
device
,
0x100c80
,
(
vme
<<
16
)
|
1
);
if
(
!
nv_wait
(
mmu
,
0x100c80
,
0x00000001
,
0x00000000
))
if
(
!
nv_wait
(
mmu
,
0x100c80
,
0x00000001
,
0x00000000
))
nv_error
(
mmu
,
"vm flush timeout: engine %d
\n
"
,
vme
);
nv_error
(
mmu
,
"vm flush timeout: engine %d
\n
"
,
vme
);
}
}
...
...
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