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
d3981190
Commit
d3981190
authored
May 30, 2016
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/mc: take nvkm_device as argument to public functions
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
d6adbe94
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
50 additions
and
46 deletions
+50
-46
drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h
+5
-5
drivers/gpu/drm/nouveau/nvkm/core/subdev.c
drivers/gpu/drm/nouveau/nvkm/core/subdev.c
+1
-1
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
+4
-6
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.c
+2
-2
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c
+2
-2
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk104.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk104.c
+2
-2
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+4
-4
drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c
+24
-16
drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c
+6
-8
No files found.
drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h
View file @
d3981190
...
@@ -7,11 +7,11 @@ struct nvkm_mc {
...
@@ -7,11 +7,11 @@ struct nvkm_mc {
struct
nvkm_subdev
subdev
;
struct
nvkm_subdev
subdev
;
};
};
void
nvkm_mc_intr
(
struct
nvkm_
mc
*
,
bool
*
handled
);
void
nvkm_mc_intr
(
struct
nvkm_
device
*
,
bool
*
handled
);
void
nvkm_mc_intr_unarm
(
struct
nvkm_
mc
*
);
void
nvkm_mc_intr_unarm
(
struct
nvkm_
device
*
);
void
nvkm_mc_intr_rearm
(
struct
nvkm_
mc
*
);
void
nvkm_mc_intr_rearm
(
struct
nvkm_
device
*
);
void
nvkm_mc_reset
(
struct
nvkm_
mc
*
,
enum
nvkm_devidx
);
void
nvkm_mc_reset
(
struct
nvkm_
device
*
,
enum
nvkm_devidx
);
void
nvkm_mc_unk260
(
struct
nvkm_
mc
*
,
u32
data
);
void
nvkm_mc_unk260
(
struct
nvkm_
device
*
,
u32
data
);
int
nv04_mc_new
(
struct
nvkm_device
*
,
int
,
struct
nvkm_mc
**
);
int
nv04_mc_new
(
struct
nvkm_device
*
,
int
,
struct
nvkm_mc
**
);
int
nv11_mc_new
(
struct
nvkm_device
*
,
int
,
struct
nvkm_mc
**
);
int
nv11_mc_new
(
struct
nvkm_device
*
,
int
,
struct
nvkm_mc
**
);
...
...
drivers/gpu/drm/nouveau/nvkm/core/subdev.c
View file @
d3981190
...
@@ -105,7 +105,7 @@ nvkm_subdev_fini(struct nvkm_subdev *subdev, bool suspend)
...
@@ -105,7 +105,7 @@ nvkm_subdev_fini(struct nvkm_subdev *subdev, bool suspend)
}
}
}
}
nvkm_mc_reset
(
device
->
mc
,
subdev
->
index
);
nvkm_mc_reset
(
device
,
subdev
->
index
);
time
=
ktime_to_us
(
ktime_get
())
-
time
;
time
=
ktime_to_us
(
ktime_get
())
-
time
;
nvkm_trace
(
subdev
,
"%s completed in %lldus
\n
"
,
action
,
time
);
nvkm_trace
(
subdev
,
"%s completed in %lldus
\n
"
,
action
,
time
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
View file @
d3981190
...
@@ -191,13 +191,11 @@ static irqreturn_t
...
@@ -191,13 +191,11 @@ static irqreturn_t
nvkm_device_tegra_intr
(
int
irq
,
void
*
arg
)
nvkm_device_tegra_intr
(
int
irq
,
void
*
arg
)
{
{
struct
nvkm_device_tegra
*
tdev
=
arg
;
struct
nvkm_device_tegra
*
tdev
=
arg
;
struct
nvkm_
mc
*
mc
=
tdev
->
device
.
mc
;
struct
nvkm_
device
*
device
=
&
tdev
->
device
;
bool
handled
=
false
;
bool
handled
=
false
;
if
(
likely
(
mc
))
{
nvkm_mc_intr_unarm
(
device
);
nvkm_mc_intr_unarm
(
mc
);
nvkm_mc_intr
(
device
,
&
handled
);
nvkm_mc_intr
(
mc
,
&
handled
);
nvkm_mc_intr_rearm
(
device
);
nvkm_mc_intr_rearm
(
mc
);
}
return
handled
?
IRQ_HANDLED
:
IRQ_NONE
;
return
handled
?
IRQ_HANDLED
:
IRQ_NONE
;
}
}
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.c
View file @
d3981190
...
@@ -1240,7 +1240,7 @@ gf100_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
...
@@ -1240,7 +1240,7 @@ gf100_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
const
struct
gf100_grctx_func
*
grctx
=
gr
->
func
->
grctx
;
const
struct
gf100_grctx_func
*
grctx
=
gr
->
func
->
grctx
;
u32
idle_timeout
;
u32
idle_timeout
;
nvkm_mc_unk260
(
device
->
mc
,
0
);
nvkm_mc_unk260
(
device
,
0
);
gf100_gr_mmio
(
gr
,
grctx
->
hub
);
gf100_gr_mmio
(
gr
,
grctx
->
hub
);
gf100_gr_mmio
(
gr
,
grctx
->
gpc
);
gf100_gr_mmio
(
gr
,
grctx
->
gpc
);
...
@@ -1264,7 +1264,7 @@ gf100_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
...
@@ -1264,7 +1264,7 @@ gf100_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
gf100_gr_icmd
(
gr
,
grctx
->
icmd
);
gf100_gr_icmd
(
gr
,
grctx
->
icmd
);
nvkm_wr32
(
device
,
0x404154
,
idle_timeout
);
nvkm_wr32
(
device
,
0x404154
,
idle_timeout
);
gf100_gr_mthd
(
gr
,
grctx
->
mthd
);
gf100_gr_mthd
(
gr
,
grctx
->
mthd
);
nvkm_mc_unk260
(
device
->
mc
,
1
);
nvkm_mc_unk260
(
device
,
1
);
}
}
int
int
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c
View file @
d3981190
...
@@ -226,7 +226,7 @@ gf117_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
...
@@ -226,7 +226,7 @@ gf117_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
u32
idle_timeout
;
u32
idle_timeout
;
int
i
;
int
i
;
nvkm_mc_unk260
(
device
->
mc
,
0
);
nvkm_mc_unk260
(
device
,
0
);
gf100_gr_mmio
(
gr
,
grctx
->
hub
);
gf100_gr_mmio
(
gr
,
grctx
->
hub
);
gf100_gr_mmio
(
gr
,
grctx
->
gpc
);
gf100_gr_mmio
(
gr
,
grctx
->
gpc
);
...
@@ -253,7 +253,7 @@ gf117_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
...
@@ -253,7 +253,7 @@ gf117_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
gf100_gr_icmd
(
gr
,
grctx
->
icmd
);
gf100_gr_icmd
(
gr
,
grctx
->
icmd
);
nvkm_wr32
(
device
,
0x404154
,
idle_timeout
);
nvkm_wr32
(
device
,
0x404154
,
idle_timeout
);
gf100_gr_mthd
(
gr
,
grctx
->
mthd
);
gf100_gr_mthd
(
gr
,
grctx
->
mthd
);
nvkm_mc_unk260
(
device
->
mc
,
1
);
nvkm_mc_unk260
(
device
,
1
);
}
}
const
struct
gf100_grctx_func
const
struct
gf100_grctx_func
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgk104.c
View file @
d3981190
...
@@ -950,7 +950,7 @@ gk104_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
...
@@ -950,7 +950,7 @@ gk104_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
u32
idle_timeout
;
u32
idle_timeout
;
int
i
;
int
i
;
nvkm_mc_unk260
(
device
->
mc
,
0
);
nvkm_mc_unk260
(
device
,
0
);
gf100_gr_mmio
(
gr
,
grctx
->
hub
);
gf100_gr_mmio
(
gr
,
grctx
->
hub
);
gf100_gr_mmio
(
gr
,
grctx
->
gpc
);
gf100_gr_mmio
(
gr
,
grctx
->
gpc
);
...
@@ -979,7 +979,7 @@ gk104_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
...
@@ -979,7 +979,7 @@ gk104_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
gf100_gr_icmd
(
gr
,
grctx
->
icmd
);
gf100_gr_icmd
(
gr
,
grctx
->
icmd
);
nvkm_wr32
(
device
,
0x404154
,
idle_timeout
);
nvkm_wr32
(
device
,
0x404154
,
idle_timeout
);
gf100_gr_mthd
(
gr
,
grctx
->
mthd
);
gf100_gr_mthd
(
gr
,
grctx
->
mthd
);
nvkm_mc_unk260
(
device
->
mc
,
1
);
nvkm_mc_unk260
(
device
,
1
);
nvkm_mask
(
device
,
0x418800
,
0x00200000
,
0x00200000
);
nvkm_mask
(
device
,
0x418800
,
0x00200000
,
0x00200000
);
nvkm_mask
(
device
,
0x41be10
,
0x00800000
,
0x00800000
);
nvkm_mask
(
device
,
0x41be10
,
0x00800000
,
0x00800000
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
View file @
d3981190
...
@@ -1460,7 +1460,7 @@ gf100_gr_init_ctxctl(struct gf100_gr *gr)
...
@@ -1460,7 +1460,7 @@ gf100_gr_init_ctxctl(struct gf100_gr *gr)
if
(
gr
->
firmware
)
{
if
(
gr
->
firmware
)
{
/* load fuc microcode */
/* load fuc microcode */
nvkm_mc_unk260
(
device
->
mc
,
0
);
nvkm_mc_unk260
(
device
,
0
);
/* securely-managed falcons must be reset using secure boot */
/* securely-managed falcons must be reset using secure boot */
if
(
nvkm_secboot_is_managed
(
sb
,
NVKM_SECBOOT_FALCON_FECS
))
if
(
nvkm_secboot_is_managed
(
sb
,
NVKM_SECBOOT_FALCON_FECS
))
...
@@ -1474,7 +1474,7 @@ gf100_gr_init_ctxctl(struct gf100_gr *gr)
...
@@ -1474,7 +1474,7 @@ gf100_gr_init_ctxctl(struct gf100_gr *gr)
gf100_gr_init_fw
(
gr
,
0x41a000
,
&
gr
->
fuc41ac
,
gf100_gr_init_fw
(
gr
,
0x41a000
,
&
gr
->
fuc41ac
,
&
gr
->
fuc41ad
);
&
gr
->
fuc41ad
);
nvkm_mc_unk260
(
device
->
mc
,
1
);
nvkm_mc_unk260
(
device
,
1
);
/* start both of them running */
/* start both of them running */
nvkm_wr32
(
device
,
0x409840
,
0xffffffff
);
nvkm_wr32
(
device
,
0x409840
,
0xffffffff
);
...
@@ -1576,7 +1576,7 @@ gf100_gr_init_ctxctl(struct gf100_gr *gr)
...
@@ -1576,7 +1576,7 @@ gf100_gr_init_ctxctl(struct gf100_gr *gr)
}
}
/* load HUB microcode */
/* load HUB microcode */
nvkm_mc_unk260
(
device
->
mc
,
0
);
nvkm_mc_unk260
(
device
,
0
);
nvkm_wr32
(
device
,
0x4091c0
,
0x01000000
);
nvkm_wr32
(
device
,
0x4091c0
,
0x01000000
);
for
(
i
=
0
;
i
<
gr
->
func
->
fecs
.
ucode
->
data
.
size
/
4
;
i
++
)
for
(
i
=
0
;
i
<
gr
->
func
->
fecs
.
ucode
->
data
.
size
/
4
;
i
++
)
nvkm_wr32
(
device
,
0x4091c4
,
gr
->
func
->
fecs
.
ucode
->
data
.
data
[
i
]);
nvkm_wr32
(
device
,
0x4091c4
,
gr
->
func
->
fecs
.
ucode
->
data
.
data
[
i
]);
...
@@ -1599,7 +1599,7 @@ gf100_gr_init_ctxctl(struct gf100_gr *gr)
...
@@ -1599,7 +1599,7 @@ gf100_gr_init_ctxctl(struct gf100_gr *gr)
nvkm_wr32
(
device
,
0x41a188
,
i
>>
6
);
nvkm_wr32
(
device
,
0x41a188
,
i
>>
6
);
nvkm_wr32
(
device
,
0x41a184
,
gr
->
func
->
gpccs
.
ucode
->
code
.
data
[
i
]);
nvkm_wr32
(
device
,
0x41a184
,
gr
->
func
->
gpccs
.
ucode
->
code
.
data
[
i
]);
}
}
nvkm_mc_unk260
(
device
->
mc
,
1
);
nvkm_mc_unk260
(
device
,
1
);
/* load register lists */
/* load register lists */
gf100_gr_init_csdata
(
gr
,
grctx
->
hub
,
0x409000
,
0x000
,
0x000000
);
gf100_gr_init_csdata
(
gr
,
grctx
->
hub
,
0x409000
,
0x000
,
0x000000
);
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c
View file @
d3981190
...
@@ -27,22 +27,27 @@
...
@@ -27,22 +27,27 @@
#include <subdev/top.h>
#include <subdev/top.h>
void
void
nvkm_mc_unk260
(
struct
nvkm_
mc
*
mc
,
u32
data
)
nvkm_mc_unk260
(
struct
nvkm_
device
*
device
,
u32
data
)
{
{
if
(
mc
->
func
->
unk260
)
struct
nvkm_mc
*
mc
=
device
->
mc
;
if
(
likely
(
mc
)
&&
mc
->
func
->
unk260
)
mc
->
func
->
unk260
(
mc
,
data
);
mc
->
func
->
unk260
(
mc
,
data
);
}
}
void
void
nvkm_mc_intr_unarm
(
struct
nvkm_
mc
*
mc
)
nvkm_mc_intr_unarm
(
struct
nvkm_
device
*
device
)
{
{
return
mc
->
func
->
intr_unarm
(
mc
);
struct
nvkm_mc
*
mc
=
device
->
mc
;
if
(
likely
(
mc
))
mc
->
func
->
intr_unarm
(
mc
);
}
}
void
void
nvkm_mc_intr_rearm
(
struct
nvkm_
mc
*
mc
)
nvkm_mc_intr_rearm
(
struct
nvkm_
device
*
device
)
{
{
return
mc
->
func
->
intr_rearm
(
mc
);
struct
nvkm_mc
*
mc
=
device
->
mc
;
if
(
likely
(
mc
))
mc
->
func
->
intr_rearm
(
mc
);
}
}
static
u32
static
u32
...
@@ -55,14 +60,18 @@ nvkm_mc_intr_mask(struct nvkm_mc *mc)
...
@@ -55,14 +60,18 @@ nvkm_mc_intr_mask(struct nvkm_mc *mc)
}
}
void
void
nvkm_mc_intr
(
struct
nvkm_
mc
*
mc
,
bool
*
handled
)
nvkm_mc_intr
(
struct
nvkm_
device
*
device
,
bool
*
handled
)
{
{
struct
nvkm_
device
*
device
=
mc
->
subdev
.
device
;
struct
nvkm_
mc
*
mc
=
device
->
mc
;
struct
nvkm_subdev
*
subdev
;
struct
nvkm_subdev
*
subdev
;
const
struct
nvkm_mc_map
*
map
=
mc
->
func
->
intr
;
const
struct
nvkm_mc_map
*
map
;
u32
stat
,
intr
=
nvkm_mc_intr_mask
(
mc
)
;
u32
stat
,
intr
;
u64
subdevs
;
u64
subdevs
;
if
(
unlikely
(
!
mc
))
return
;
intr
=
nvkm_mc_intr_mask
(
mc
);
stat
=
nvkm_top_intr
(
device
,
intr
,
&
subdevs
);
stat
=
nvkm_top_intr
(
device
,
intr
,
&
subdevs
);
while
(
subdevs
)
{
while
(
subdevs
)
{
enum
nvkm_devidx
subidx
=
__ffs64
(
subdevs
);
enum
nvkm_devidx
subidx
=
__ffs64
(
subdevs
);
...
@@ -72,14 +81,13 @@ nvkm_mc_intr(struct nvkm_mc *mc, bool *handled)
...
@@ -72,14 +81,13 @@ nvkm_mc_intr(struct nvkm_mc *mc, bool *handled)
subdevs
&=
~
BIT_ULL
(
subidx
);
subdevs
&=
~
BIT_ULL
(
subidx
);
}
}
while
(
map
->
stat
)
{
for
(
map
=
mc
->
func
->
intr
;
map
->
stat
;
map
++
)
{
if
(
intr
&
map
->
stat
)
{
if
(
intr
&
map
->
stat
)
{
subdev
=
nvkm_device_subdev
(
device
,
map
->
unit
);
subdev
=
nvkm_device_subdev
(
device
,
map
->
unit
);
if
(
subdev
)
if
(
subdev
)
nvkm_subdev_intr
(
subdev
);
nvkm_subdev_intr
(
subdev
);
stat
&=
~
map
->
stat
;
stat
&=
~
map
->
stat
;
}
}
map
++
;
}
}
if
(
stat
)
if
(
stat
)
...
@@ -111,8 +119,9 @@ nvkm_mc_reset_(struct nvkm_mc *mc, enum nvkm_devidx devidx)
...
@@ -111,8 +119,9 @@ nvkm_mc_reset_(struct nvkm_mc *mc, enum nvkm_devidx devidx)
}
}
void
void
nvkm_mc_reset
(
struct
nvkm_
mc
*
mc
,
enum
nvkm_devidx
devidx
)
nvkm_mc_reset
(
struct
nvkm_
device
*
device
,
enum
nvkm_devidx
devidx
)
{
{
struct
nvkm_mc
*
mc
=
device
->
mc
;
if
(
likely
(
mc
))
if
(
likely
(
mc
))
nvkm_mc_reset_
(
mc
,
devidx
);
nvkm_mc_reset_
(
mc
,
devidx
);
}
}
...
@@ -120,8 +129,7 @@ nvkm_mc_reset(struct nvkm_mc *mc, enum nvkm_devidx devidx)
...
@@ -120,8 +129,7 @@ nvkm_mc_reset(struct nvkm_mc *mc, enum nvkm_devidx devidx)
static
int
static
int
nvkm_mc_fini
(
struct
nvkm_subdev
*
subdev
,
bool
suspend
)
nvkm_mc_fini
(
struct
nvkm_subdev
*
subdev
,
bool
suspend
)
{
{
struct
nvkm_mc
*
mc
=
nvkm_mc
(
subdev
);
nvkm_mc_intr_unarm
(
subdev
->
device
);
nvkm_mc_intr_unarm
(
mc
);
return
0
;
return
0
;
}
}
...
@@ -131,7 +139,7 @@ nvkm_mc_init(struct nvkm_subdev *subdev)
...
@@ -131,7 +139,7 @@ nvkm_mc_init(struct nvkm_subdev *subdev)
struct
nvkm_mc
*
mc
=
nvkm_mc
(
subdev
);
struct
nvkm_mc
*
mc
=
nvkm_mc
(
subdev
);
if
(
mc
->
func
->
init
)
if
(
mc
->
func
->
init
)
mc
->
func
->
init
(
mc
);
mc
->
func
->
init
(
mc
);
nvkm_mc_intr_rearm
(
mc
);
nvkm_mc_intr_rearm
(
subdev
->
device
);
return
0
;
return
0
;
}
}
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c
View file @
d3981190
...
@@ -69,15 +69,13 @@ static irqreturn_t
...
@@ -69,15 +69,13 @@ static irqreturn_t
nvkm_pci_intr
(
int
irq
,
void
*
arg
)
nvkm_pci_intr
(
int
irq
,
void
*
arg
)
{
{
struct
nvkm_pci
*
pci
=
arg
;
struct
nvkm_pci
*
pci
=
arg
;
struct
nvkm_
mc
*
mc
=
pci
->
subdev
.
device
->
mc
;
struct
nvkm_
device
*
device
=
pci
->
subdev
.
device
;
bool
handled
=
false
;
bool
handled
=
false
;
if
(
likely
(
mc
))
{
nvkm_mc_intr_unarm
(
device
);
nvkm_mc_intr_unarm
(
mc
);
if
(
pci
->
msi
)
if
(
pci
->
msi
)
pci
->
func
->
msi_rearm
(
pci
);
pci
->
func
->
msi_rearm
(
pci
);
nvkm_mc_intr
(
device
,
&
handled
);
nvkm_mc_intr
(
mc
,
&
handled
);
nvkm_mc_intr_rearm
(
device
);
nvkm_mc_intr_rearm
(
mc
);
}
return
handled
?
IRQ_HANDLED
:
IRQ_NONE
;
return
handled
?
IRQ_HANDLED
:
IRQ_NONE
;
}
}
...
...
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