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
9155c162
Commit
9155c162
authored
Aug 20, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/bar: switch to device pri macros
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
94bab102
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
14 deletions
+18
-14
drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
+5
-4
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c
+13
-10
No files found.
drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
View file @
9155c162
...
@@ -190,18 +190,19 @@ int
...
@@ -190,18 +190,19 @@ int
gf100_bar_init
(
struct
nvkm_object
*
object
)
gf100_bar_init
(
struct
nvkm_object
*
object
)
{
{
struct
gf100_bar
*
bar
=
(
void
*
)
object
;
struct
gf100_bar
*
bar
=
(
void
*
)
object
;
struct
nvkm_device
*
device
=
bar
->
base
.
subdev
.
device
;
int
ret
;
int
ret
;
ret
=
nvkm_bar_init
(
&
bar
->
base
);
ret
=
nvkm_bar_init
(
&
bar
->
base
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
nv
_mask
(
bar
,
0x000200
,
0x00000100
,
0x00000000
);
nv
km_mask
(
device
,
0x000200
,
0x00000100
,
0x00000000
);
nv
_mask
(
bar
,
0x000200
,
0x00000100
,
0x00000100
);
nv
km_mask
(
device
,
0x000200
,
0x00000100
,
0x00000100
);
nv
_wr32
(
bar
,
0x001704
,
0x80000000
|
bar
->
bar
[
1
].
mem
->
addr
>>
12
);
nv
km_wr32
(
device
,
0x001704
,
0x80000000
|
bar
->
bar
[
1
].
mem
->
addr
>>
12
);
if
(
bar
->
bar
[
0
].
mem
)
if
(
bar
->
bar
[
0
].
mem
)
nv
_wr32
(
bar
,
0x001714
,
nv
km_wr32
(
device
,
0x001714
,
0xc0000000
|
bar
->
bar
[
0
].
mem
->
addr
>>
12
);
0xc0000000
|
bar
->
bar
[
0
].
mem
->
addr
>>
12
);
return
0
;
return
0
;
}
}
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c
View file @
9155c162
...
@@ -81,9 +81,10 @@ static void
...
@@ -81,9 +81,10 @@ static void
nv50_bar_flush
(
struct
nvkm_bar
*
obj
)
nv50_bar_flush
(
struct
nvkm_bar
*
obj
)
{
{
struct
nv50_bar
*
bar
=
container_of
(
obj
,
typeof
(
*
bar
),
base
);
struct
nv50_bar
*
bar
=
container_of
(
obj
,
typeof
(
*
bar
),
base
);
struct
nvkm_device
*
device
=
bar
->
base
.
subdev
.
device
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
bar
->
lock
,
flags
);
spin_lock_irqsave
(
&
bar
->
lock
,
flags
);
nv
_wr32
(
bar
,
0x00330c
,
0x00000001
);
nv
km_wr32
(
device
,
0x00330c
,
0x00000001
);
if
(
!
nv_wait
(
bar
,
0x00330c
,
0x00000002
,
0x00000000
))
if
(
!
nv_wait
(
bar
,
0x00330c
,
0x00000002
,
0x00000000
))
nv_warn
(
bar
,
"flush timeout
\n
"
);
nv_warn
(
bar
,
"flush timeout
\n
"
);
spin_unlock_irqrestore
(
&
bar
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
bar
->
lock
,
flags
);
...
@@ -93,9 +94,10 @@ void
...
@@ -93,9 +94,10 @@ void
g84_bar_flush
(
struct
nvkm_bar
*
obj
)
g84_bar_flush
(
struct
nvkm_bar
*
obj
)
{
{
struct
nv50_bar
*
bar
=
container_of
(
obj
,
typeof
(
*
bar
),
base
);
struct
nv50_bar
*
bar
=
container_of
(
obj
,
typeof
(
*
bar
),
base
);
struct
nvkm_device
*
device
=
bar
->
base
.
subdev
.
device
;
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
bar
->
lock
,
flags
);
spin_lock_irqsave
(
&
bar
->
lock
,
flags
);
nv
_wr32
(
bar
,
0x070000
,
0x00000001
);
nv
km_wr32
(
device
,
0x070000
,
0x00000001
);
if
(
!
nv_wait
(
bar
,
0x070000
,
0x00000002
,
0x00000000
))
if
(
!
nv_wait
(
bar
,
0x070000
,
0x00000002
,
0x00000000
))
nv_warn
(
bar
,
"flush timeout
\n
"
);
nv_warn
(
bar
,
"flush timeout
\n
"
);
spin_unlock_irqrestore
(
&
bar
->
lock
,
flags
);
spin_unlock_irqrestore
(
&
bar
->
lock
,
flags
);
...
@@ -228,26 +230,27 @@ static int
...
@@ -228,26 +230,27 @@ static int
nv50_bar_init
(
struct
nvkm_object
*
object
)
nv50_bar_init
(
struct
nvkm_object
*
object
)
{
{
struct
nv50_bar
*
bar
=
(
void
*
)
object
;
struct
nv50_bar
*
bar
=
(
void
*
)
object
;
struct
nvkm_device
*
device
=
bar
->
base
.
subdev
.
device
;
int
ret
,
i
;
int
ret
,
i
;
ret
=
nvkm_bar_init
(
&
bar
->
base
);
ret
=
nvkm_bar_init
(
&
bar
->
base
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
nv
_mask
(
bar
,
0x000200
,
0x00000100
,
0x00000000
);
nv
km_mask
(
device
,
0x000200
,
0x00000100
,
0x00000000
);
nv
_mask
(
bar
,
0x000200
,
0x00000100
,
0x00000100
);
nv
km_mask
(
device
,
0x000200
,
0x00000100
,
0x00000100
);
nv
_wr32
(
bar
,
0x100c80
,
0x00060001
);
nv
km_wr32
(
device
,
0x100c80
,
0x00060001
);
if
(
!
nv_wait
(
bar
,
0x100c80
,
0x00000001
,
0x00000000
))
{
if
(
!
nv_wait
(
bar
,
0x100c80
,
0x00000001
,
0x00000000
))
{
nv_error
(
bar
,
"vm flush timeout
\n
"
);
nv_error
(
bar
,
"vm flush timeout
\n
"
);
return
-
EBUSY
;
return
-
EBUSY
;
}
}
nv
_wr32
(
bar
,
0x001704
,
0x00000000
|
bar
->
mem
->
addr
>>
12
);
nv
km_wr32
(
device
,
0x001704
,
0x00000000
|
bar
->
mem
->
addr
>>
12
);
nv
_wr32
(
bar
,
0x001704
,
0x40000000
|
bar
->
mem
->
addr
>>
12
);
nv
km_wr32
(
device
,
0x001704
,
0x40000000
|
bar
->
mem
->
addr
>>
12
);
nv
_wr32
(
bar
,
0x001708
,
0x80000000
|
bar
->
bar1
->
node
->
offset
>>
4
);
nv
km_wr32
(
device
,
0x001708
,
0x80000000
|
bar
->
bar1
->
node
->
offset
>>
4
);
nv
_wr32
(
bar
,
0x00170c
,
0x80000000
|
bar
->
bar3
->
node
->
offset
>>
4
);
nv
km_wr32
(
device
,
0x00170c
,
0x80000000
|
bar
->
bar3
->
node
->
offset
>>
4
);
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
8
;
i
++
)
nv
_wr32
(
bar
,
0x001900
+
(
i
*
4
),
0x00000000
);
nv
km_wr32
(
device
,
0x001900
+
(
i
*
4
),
0x00000000
);
return
0
;
return
0
;
}
}
...
...
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