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
6d39b83f
Commit
6d39b83f
authored
Mar 11, 2016
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/fifo/gk104: rename spoon to pbdma, and move detection to oneinit
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
1015d811
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
+12
-9
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h
+2
-1
No files found.
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
View file @
6d39b83f
...
@@ -660,9 +660,15 @@ int
...
@@ -660,9 +660,15 @@ int
gk104_fifo_oneinit
(
struct
nvkm_fifo
*
base
)
gk104_fifo_oneinit
(
struct
nvkm_fifo
*
base
)
{
{
struct
gk104_fifo
*
fifo
=
gk104_fifo
(
base
);
struct
gk104_fifo
*
fifo
=
gk104_fifo
(
base
);
struct
nvkm_device
*
device
=
fifo
->
base
.
engine
.
subdev
.
device
;
struct
nvkm_subdev
*
subdev
=
&
fifo
->
base
.
engine
.
subdev
;
struct
nvkm_device
*
device
=
subdev
->
device
;
int
ret
,
i
;
int
ret
,
i
;
/* Determine number of PBDMAs by checking valid enable bits. */
nvkm_wr32
(
device
,
0x000204
,
0xffffffff
);
fifo
->
pbdma_nr
=
hweight32
(
nvkm_rd32
(
device
,
0x000204
));
nvkm_debug
(
subdev
,
"%d PBDMA(s)
\n
"
,
fifo
->
pbdma_nr
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
fifo
->
engine
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
fifo
->
engine
);
i
++
)
{
ret
=
nvkm_memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
ret
=
nvkm_memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
0x8000
,
0x1000
,
false
,
0x8000
,
0x1000
,
false
,
...
@@ -699,24 +705,21 @@ void
...
@@ -699,24 +705,21 @@ void
gk104_fifo_init
(
struct
nvkm_fifo
*
base
)
gk104_fifo_init
(
struct
nvkm_fifo
*
base
)
{
{
struct
gk104_fifo
*
fifo
=
gk104_fifo
(
base
);
struct
gk104_fifo
*
fifo
=
gk104_fifo
(
base
);
struct
nvkm_subdev
*
subdev
=
&
fifo
->
base
.
engine
.
subdev
;
struct
nvkm_device
*
device
=
fifo
->
base
.
engine
.
subdev
.
device
;
struct
nvkm_device
*
device
=
subdev
->
device
;
int
i
;
int
i
;
/* enable all available PBDMA units */
/* Enable PBDMAs. */
nvkm_wr32
(
device
,
0x000204
,
0xffffffff
);
nvkm_wr32
(
device
,
0x000204
,
(
1
<<
fifo
->
pbdma_nr
)
-
1
);
fifo
->
spoon_nr
=
hweight32
(
nvkm_rd32
(
device
,
0x000204
));
nvkm_debug
(
subdev
,
"%d PBDMA unit(s)
\n
"
,
fifo
->
spoon_nr
);
/* PBDMA[n] */
/* PBDMA[n] */
for
(
i
=
0
;
i
<
fifo
->
spoon
_nr
;
i
++
)
{
for
(
i
=
0
;
i
<
fifo
->
pbdma
_nr
;
i
++
)
{
nvkm_mask
(
device
,
0x04013c
+
(
i
*
0x2000
),
0x10000100
,
0x00000000
);
nvkm_mask
(
device
,
0x04013c
+
(
i
*
0x2000
),
0x10000100
,
0x00000000
);
nvkm_wr32
(
device
,
0x040108
+
(
i
*
0x2000
),
0xffffffff
);
/* INTR */
nvkm_wr32
(
device
,
0x040108
+
(
i
*
0x2000
),
0xffffffff
);
/* INTR */
nvkm_wr32
(
device
,
0x04010c
+
(
i
*
0x2000
),
0xfffffeff
);
/* INTREN */
nvkm_wr32
(
device
,
0x04010c
+
(
i
*
0x2000
),
0xfffffeff
);
/* INTREN */
}
}
/* PBDMA[n].HCE */
/* PBDMA[n].HCE */
for
(
i
=
0
;
i
<
fifo
->
spoon
_nr
;
i
++
)
{
for
(
i
=
0
;
i
<
fifo
->
pbdma
_nr
;
i
++
)
{
nvkm_wr32
(
device
,
0x040148
+
(
i
*
0x2000
),
0xffffffff
);
/* INTR */
nvkm_wr32
(
device
,
0x040148
+
(
i
*
0x2000
),
0xffffffff
);
/* INTR */
nvkm_wr32
(
device
,
0x04014c
+
(
i
*
0x2000
),
0xffffffff
);
/* INTREN */
nvkm_wr32
(
device
,
0x04014c
+
(
i
*
0x2000
),
0xffffffff
);
/* INTREN */
}
}
...
...
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h
View file @
6d39b83f
...
@@ -19,12 +19,13 @@ struct gk104_fifo {
...
@@ -19,12 +19,13 @@ struct gk104_fifo {
struct
work_struct
fault
;
struct
work_struct
fault
;
u64
mask
;
u64
mask
;
int
pbdma_nr
;
struct
gk104_fifo_engn
engine
[
7
];
struct
gk104_fifo_engn
engine
[
7
];
struct
{
struct
{
struct
nvkm_memory
*
mem
;
struct
nvkm_memory
*
mem
;
struct
nvkm_vma
bar
;
struct
nvkm_vma
bar
;
}
user
;
}
user
;
int
spoon_nr
;
};
};
int
gk104_fifo_new_
(
const
struct
nvkm_fifo_func
*
,
struct
nvkm_device
*
,
int
gk104_fifo_new_
(
const
struct
nvkm_fifo_func
*
,
struct
nvkm_device
*
,
...
...
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