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
d4c4cc83
Commit
d4c4cc83
authored
Aug 20, 2015
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/mc: abstract interface to master intr registers
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
0a34fb31
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
84 additions
and
11 deletions
+84
-11
drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c
+21
-11
drivers/gpu/drm/nouveau/nvkm/subdev/mc/g94.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/g94.c
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/g98.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/g98.c
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf100.c
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf106.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf106.c
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/gk20a.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/gk20a.c
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c
+24
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv40.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv40.c
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv44.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv44.c
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv4c.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv4c.c
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv50.c
+3
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h
drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h
+9
-0
No files found.
drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h
View file @
d4c4cc83
...
...
@@ -10,6 +10,9 @@ struct nvkm_mc {
bool
use_msi
;
};
void
nvkm_mc_intr_unarm
(
struct
nvkm_mc
*
);
void
nvkm_mc_intr_rearm
(
struct
nvkm_mc
*
);
u32
nvkm_mc_intr_mask
(
struct
nvkm_mc
*
);
void
nvkm_mc_unk260
(
struct
nvkm_mc
*
,
u32
data
);
int
nv04_mc_new
(
struct
nvkm_device
*
,
int
,
struct
nvkm_mc
**
);
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c
View file @
d4c4cc83
...
...
@@ -32,13 +32,24 @@ nvkm_mc_unk260(struct nvkm_mc *mc, u32 data)
mc
->
func
->
unk260
(
mc
,
data
);
}
static
inline
u32
void
nvkm_mc_intr_unarm
(
struct
nvkm_mc
*
mc
)
{
return
mc
->
func
->
intr_unarm
(
mc
);
}
void
nvkm_mc_intr_rearm
(
struct
nvkm_mc
*
mc
)
{
return
mc
->
func
->
intr_rearm
(
mc
);
}
u32
nvkm_mc_intr_mask
(
struct
nvkm_mc
*
mc
)
{
struct
nvkm_device
*
device
=
mc
->
subdev
.
device
;
u32
intr
=
nvkm_rd32
(
device
,
0x000100
);
if
(
intr
==
0xffffffff
)
/* likely fallen off the bus */
intr
=
0x00000000
;
u32
intr
=
mc
->
func
->
intr_mask
(
mc
);
if
(
WARN_ON_ONCE
(
intr
==
0xffffffff
))
intr
=
0
;
/* likely fallen off the bus */
return
intr
;
}
...
...
@@ -52,8 +63,7 @@ nvkm_mc_intr(int irq, void *arg)
struct
nvkm_subdev
*
unit
;
u32
intr
;
nvkm_wr32
(
device
,
0x000140
,
0x00000000
);
nvkm_rd32
(
device
,
0x000140
);
nvkm_mc_intr_unarm
(
mc
);
intr
=
nvkm_mc_intr_mask
(
mc
);
if
(
mc
->
use_msi
)
mc
->
func
->
msi_rearm
(
mc
);
...
...
@@ -74,14 +84,15 @@ nvkm_mc_intr(int irq, void *arg)
nvkm_error
(
subdev
,
"unknown intr %08x
\n
"
,
stat
);
}
nvkm_
wr32
(
device
,
0x000140
,
0x00000001
);
nvkm_
mc_intr_rearm
(
mc
);
return
intr
?
IRQ_HANDLED
:
IRQ_NONE
;
}
static
int
nvkm_mc_fini
(
struct
nvkm_subdev
*
subdev
,
bool
suspend
)
{
nvkm_wr32
(
subdev
->
device
,
0x000140
,
0x00000000
);
struct
nvkm_mc
*
mc
=
nvkm_mc
(
subdev
);
nvkm_mc_intr_unarm
(
mc
);
return
0
;
}
...
...
@@ -96,10 +107,9 @@ static int
nvkm_mc_init
(
struct
nvkm_subdev
*
subdev
)
{
struct
nvkm_mc
*
mc
=
nvkm_mc
(
subdev
);
struct
nvkm_device
*
device
=
mc
->
subdev
.
device
;
if
(
mc
->
func
->
init
)
mc
->
func
->
init
(
mc
);
nvkm_
wr32
(
device
,
0x000140
,
0x00000001
);
nvkm_
mc_intr_rearm
(
mc
);
return
0
;
}
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/g94.c
View file @
d4c4cc83
...
...
@@ -27,6 +27,9 @@ static const struct nvkm_mc_func
g94_mc
=
{
.
init
=
nv50_mc_init
,
.
intr
=
nv50_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
.
msi_rearm
=
nv40_mc_msi_rearm
,
};
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/g98.c
View file @
d4c4cc83
...
...
@@ -48,6 +48,9 @@ static const struct nvkm_mc_func
g98_mc
=
{
.
init
=
nv50_mc_init
,
.
intr
=
g98_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
.
msi_rearm
=
nv40_mc_msi_rearm
,
};
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf100.c
View file @
d4c4cc83
...
...
@@ -64,6 +64,9 @@ static const struct nvkm_mc_func
gf100_mc
=
{
.
init
=
nv50_mc_init
,
.
intr
=
gf100_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
.
msi_rearm
=
gf100_mc_msi_rearm
,
.
unk260
=
gf100_mc_unk260
,
};
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf106.c
View file @
d4c4cc83
...
...
@@ -27,6 +27,9 @@ static const struct nvkm_mc_func
gf106_mc
=
{
.
init
=
nv50_mc_init
,
.
intr
=
gf100_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
.
msi_rearm
=
nv40_mc_msi_rearm
,
.
unk260
=
gf100_mc_unk260
,
};
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/gk20a.c
View file @
d4c4cc83
...
...
@@ -27,6 +27,9 @@ static const struct nvkm_mc_func
gk20a_mc
=
{
.
init
=
nv50_mc_init
,
.
intr
=
gf100_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
.
msi_rearm
=
nv40_mc_msi_rearm
,
};
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c
View file @
d4c4cc83
...
...
@@ -38,6 +38,27 @@ nv04_mc_intr[] = {
{}
};
void
nv04_mc_intr_unarm
(
struct
nvkm_mc
*
mc
)
{
struct
nvkm_device
*
device
=
mc
->
subdev
.
device
;
nvkm_wr32
(
device
,
0x000140
,
0x00000000
);
nvkm_rd32
(
device
,
0x000140
);
}
void
nv04_mc_intr_rearm
(
struct
nvkm_mc
*
mc
)
{
struct
nvkm_device
*
device
=
mc
->
subdev
.
device
;
nvkm_wr32
(
device
,
0x000140
,
0x00000001
);
}
u32
nv04_mc_intr_mask
(
struct
nvkm_mc
*
mc
)
{
return
nvkm_rd32
(
mc
->
subdev
.
device
,
0x000100
);
}
void
nv04_mc_init
(
struct
nvkm_mc
*
mc
)
{
...
...
@@ -50,6 +71,9 @@ static const struct nvkm_mc_func
nv04_mc
=
{
.
init
=
nv04_mc_init
,
.
intr
=
nv04_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
};
int
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv40.c
View file @
d4c4cc83
...
...
@@ -33,6 +33,9 @@ static const struct nvkm_mc_func
nv40_mc
=
{
.
init
=
nv04_mc_init
,
.
intr
=
nv04_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
.
msi_rearm
=
nv40_mc_msi_rearm
,
};
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv44.c
View file @
d4c4cc83
...
...
@@ -41,6 +41,9 @@ static const struct nvkm_mc_func
nv44_mc
=
{
.
init
=
nv44_mc_init
,
.
intr
=
nv04_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
.
msi_rearm
=
nv40_mc_msi_rearm
,
};
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv4c.c
View file @
d4c4cc83
...
...
@@ -27,6 +27,9 @@ static const struct nvkm_mc_func
nv4c_mc
=
{
.
init
=
nv44_mc_init
,
.
intr
=
nv04_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
};
int
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv50.c
View file @
d4c4cc83
...
...
@@ -59,6 +59,9 @@ static const struct nvkm_mc_func
nv50_mc
=
{
.
init
=
nv50_mc_init
,
.
intr
=
nv50_mc_intr
,
.
intr_unarm
=
nv04_mc_intr_unarm
,
.
intr_rearm
=
nv04_mc_intr_rearm
,
.
intr_mask
=
nv04_mc_intr_mask
,
.
msi_rearm
=
nv50_mc_msi_rearm
,
};
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h
View file @
d4c4cc83
...
...
@@ -14,12 +14,21 @@ struct nvkm_mc_intr {
struct
nvkm_mc_func
{
void
(
*
init
)(
struct
nvkm_mc
*
);
const
struct
nvkm_mc_intr
*
intr
;
/* disable reporting of interrupts to host */
void
(
*
intr_unarm
)(
struct
nvkm_mc
*
);
/* enable reporting of interrupts to host */
void
(
*
intr_rearm
)(
struct
nvkm_mc
*
);
/* retrieve pending interrupt mask (NV_PMC_INTR) */
u32
(
*
intr_mask
)(
struct
nvkm_mc
*
);
void
(
*
msi_rearm
)(
struct
nvkm_mc
*
);
void
(
*
unk260
)(
struct
nvkm_mc
*
,
u32
);
};
void
nv04_mc_init
(
struct
nvkm_mc
*
);
extern
const
struct
nvkm_mc_intr
nv04_mc_intr
[];
void
nv04_mc_intr_unarm
(
struct
nvkm_mc
*
);
void
nv04_mc_intr_rearm
(
struct
nvkm_mc
*
);
u32
nv04_mc_intr_mask
(
struct
nvkm_mc
*
);
void
nv40_mc_msi_rearm
(
struct
nvkm_mc
*
);
...
...
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