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
adec9bc3
Commit
adec9bc3
authored
Jun 12, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/pwr: tidy
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
3d50d4dc
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
133 additions
and
193 deletions
+133
-193
drivers/gpu/drm/nouveau/core/engine/device/gm100.c
drivers/gpu/drm/nouveau/core/engine/device/gm100.c
+1
-1
drivers/gpu/drm/nouveau/core/engine/device/nv50.c
drivers/gpu/drm/nouveau/core/engine/device/nv50.c
+4
-4
drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
+8
-8
drivers/gpu/drm/nouveau/core/engine/device/nve0.c
drivers/gpu/drm/nouveau/core/engine/device/nve0.c
+6
-6
drivers/gpu/drm/nouveau/core/include/subdev/pwr.h
drivers/gpu/drm/nouveau/core/include/subdev/pwr.h
+4
-35
drivers/gpu/drm/nouveau/core/subdev/pwr/base.c
drivers/gpu/drm/nouveau/core/subdev/pwr/base.c
+19
-5
drivers/gpu/drm/nouveau/core/subdev/pwr/memx.c
drivers/gpu/drm/nouveau/core/subdev/pwr/memx.c
+1
-2
drivers/gpu/drm/nouveau/core/subdev/pwr/nv108.c
drivers/gpu/drm/nouveau/core/subdev/pwr/nv108.c
+11
-32
drivers/gpu/drm/nouveau/core/subdev/pwr/nva3.c
drivers/gpu/drm/nouveau/core/subdev/pwr/nva3.c
+15
-36
drivers/gpu/drm/nouveau/core/subdev/pwr/nvc0.c
drivers/gpu/drm/nouveau/core/subdev/pwr/nvc0.c
+11
-32
drivers/gpu/drm/nouveau/core/subdev/pwr/nvd0.c
drivers/gpu/drm/nouveau/core/subdev/pwr/nvd0.c
+11
-32
drivers/gpu/drm/nouveau/core/subdev/pwr/priv.h
drivers/gpu/drm/nouveau/core/subdev/pwr/priv.h
+42
-0
No files found.
drivers/gpu/drm/nouveau/core/engine/device/gm100.c
View file @
adec9bc3
...
@@ -78,7 +78,7 @@ gm100_identify(struct nouveau_device *device)
...
@@ -78,7 +78,7 @@ gm100_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
#if 0
#if 0
device->oclass[NVDEV_SUBDEV_PWR ] =
&
nv108_pwr_oclass;
device->oclass[NVDEV_SUBDEV_PWR ] =
nv108_pwr_oclass;
device->oclass[NVDEV_SUBDEV_VOLT ] = &nv40_volt_oclass;
device->oclass[NVDEV_SUBDEV_VOLT ] = &nv40_volt_oclass;
#endif
#endif
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
...
...
drivers/gpu/drm/nouveau/core/engine/device/nv50.c
View file @
adec9bc3
...
@@ -350,7 +350,7 @@ nv50_identify(struct nouveau_device *device)
...
@@ -350,7 +350,7 @@ nv50_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nv50_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nv50_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nv50_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nv50_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nva3_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nva3_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nv50_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nv50_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv84_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv84_fifo_oclass
;
...
@@ -380,7 +380,7 @@ nv50_identify(struct nouveau_device *device)
...
@@ -380,7 +380,7 @@ nv50_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nv50_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nv50_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nv50_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nv50_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nva3_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nva3_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nv50_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nv50_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv84_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv84_fifo_oclass
;
...
@@ -409,7 +409,7 @@ nv50_identify(struct nouveau_device *device)
...
@@ -409,7 +409,7 @@ nv50_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nv50_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nv50_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nv50_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nv50_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nva3_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nva3_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nv50_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nv50_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv84_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv84_fifo_oclass
;
...
@@ -438,7 +438,7 @@ nv50_identify(struct nouveau_device *device)
...
@@ -438,7 +438,7 @@ nv50_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nv50_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nv50_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nv50_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nv50_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nva3_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nva3_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nv50_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nv50_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv84_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv84_fifo_oclass
;
...
...
drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
View file @
adec9bc3
...
@@ -75,7 +75,7 @@ nvc0_identify(struct nouveau_device *device)
...
@@ -75,7 +75,7 @@ nvc0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
...
@@ -107,7 +107,7 @@ nvc0_identify(struct nouveau_device *device)
...
@@ -107,7 +107,7 @@ nvc0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
...
@@ -139,7 +139,7 @@ nvc0_identify(struct nouveau_device *device)
...
@@ -139,7 +139,7 @@ nvc0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
...
@@ -170,7 +170,7 @@ nvc0_identify(struct nouveau_device *device)
...
@@ -170,7 +170,7 @@ nvc0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
...
@@ -202,7 +202,7 @@ nvc0_identify(struct nouveau_device *device)
...
@@ -202,7 +202,7 @@ nvc0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
...
@@ -234,7 +234,7 @@ nvc0_identify(struct nouveau_device *device)
...
@@ -234,7 +234,7 @@ nvc0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
...
@@ -265,7 +265,7 @@ nvc0_identify(struct nouveau_device *device)
...
@@ -265,7 +265,7 @@ nvc0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvc0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvc0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
...
@@ -297,7 +297,7 @@ nvc0_identify(struct nouveau_device *device)
...
@@ -297,7 +297,7 @@ nvc0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nvc0_fifo_oclass
;
...
...
drivers/gpu/drm/nouveau/core/engine/device/nve0.c
View file @
adec9bc3
...
@@ -75,7 +75,7 @@ nve0_identify(struct nouveau_device *device)
...
@@ -75,7 +75,7 @@ nve0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
...
@@ -108,7 +108,7 @@ nve0_identify(struct nouveau_device *device)
...
@@ -108,7 +108,7 @@ nve0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
...
@@ -141,7 +141,7 @@ nve0_identify(struct nouveau_device *device)
...
@@ -141,7 +141,7 @@ nve0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
...
@@ -191,7 +191,7 @@ nve0_identify(struct nouveau_device *device)
...
@@ -191,7 +191,7 @@ nve0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
...
@@ -224,7 +224,7 @@ nve0_identify(struct nouveau_device *device)
...
@@ -224,7 +224,7 @@ nve0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nvd0_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nve0_fifo_oclass
;
...
@@ -257,7 +257,7 @@ nve0_identify(struct nouveau_device *device)
...
@@ -257,7 +257,7 @@ nve0_identify(struct nouveau_device *device)
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_INSTMEM
]
=
nv50_instmem_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VM
]
=
&
nvc0_vmmgr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_BAR
]
=
&
nvc0_bar_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
&
nv108_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_PWR
]
=
nv108_pwr_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_VOLT
]
=
&
nv40_volt_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_DMAOBJ
]
=
&
nvd0_dmaeng_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv108_fifo_oclass
;
device
->
oclass
[
NVDEV_ENGINE_FIFO
]
=
nv108_fifo_oclass
;
...
...
drivers/gpu/drm/nouveau/core/include/subdev/pwr.h
View file @
adec9bc3
...
@@ -7,18 +7,6 @@
...
@@ -7,18 +7,6 @@
struct
nouveau_pwr
{
struct
nouveau_pwr
{
struct
nouveau_subdev
base
;
struct
nouveau_subdev
base
;
struct
{
u32
limit
;
u32
*
data
;
u32
size
;
}
code
;
struct
{
u32
limit
;
u32
*
data
;
u32
size
;
}
data
;
struct
{
struct
{
u32
base
;
u32
base
;
u32
size
;
u32
size
;
...
@@ -44,29 +32,10 @@ nouveau_pwr(void *obj)
...
@@ -44,29 +32,10 @@ nouveau_pwr(void *obj)
return
(
void
*
)
nv_device
(
obj
)
->
subdev
[
NVDEV_SUBDEV_PWR
];
return
(
void
*
)
nv_device
(
obj
)
->
subdev
[
NVDEV_SUBDEV_PWR
];
}
}
#define nouveau_pwr_create(p, e, o, d) \
extern
struct
nouveau_oclass
*
nva3_pwr_oclass
;
nouveau_pwr_create_((p), (e), (o), sizeof(**d), (void **)d)
extern
struct
nouveau_oclass
*
nvc0_pwr_oclass
;
#define nouveau_pwr_destroy(p) \
extern
struct
nouveau_oclass
*
nvd0_pwr_oclass
;
nouveau_subdev_destroy(&(p)->base)
extern
struct
nouveau_oclass
*
nv108_pwr_oclass
;
#define nouveau_pwr_init(p) ({ \
struct nouveau_pwr *ppwr = (p); \
_nouveau_pwr_init(nv_object(ppwr)); \
})
#define nouveau_pwr_fini(p,s) ({ \
struct nouveau_pwr *ppwr = (p); \
_nouveau_pwr_fini(nv_object(ppwr), (s)); \
})
int
nouveau_pwr_create_
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
int
,
void
**
);
#define _nouveau_pwr_dtor _nouveau_subdev_dtor
int
_nouveau_pwr_init
(
struct
nouveau_object
*
);
int
_nouveau_pwr_fini
(
struct
nouveau_object
*
,
bool
);
extern
struct
nouveau_oclass
nva3_pwr_oclass
;
extern
struct
nouveau_oclass
nvc0_pwr_oclass
;
extern
struct
nouveau_oclass
nvd0_pwr_oclass
;
extern
struct
nouveau_oclass
nv108_pwr_oclass
;
/* interface to MEMX process running on PPWR */
/* interface to MEMX process running on PPWR */
struct
nouveau_memx
;
struct
nouveau_memx
;
...
...
drivers/gpu/drm/nouveau/core/subdev/pwr/base.c
View file @
adec9bc3
...
@@ -22,9 +22,10 @@
...
@@ -22,9 +22,10 @@
* Authors: Ben Skeggs
* Authors: Ben Skeggs
*/
*/
#include <subdev/pwr.h>
#include <subdev/timer.h>
#include <subdev/timer.h>
#include "priv.h"
static
int
static
int
nouveau_pwr_send
(
struct
nouveau_pwr
*
ppwr
,
u32
reply
[
2
],
nouveau_pwr_send
(
struct
nouveau_pwr
*
ppwr
,
u32
reply
[
2
],
u32
process
,
u32
message
,
u32
data0
,
u32
data1
)
u32
process
,
u32
message
,
u32
data0
,
u32
data1
)
...
@@ -177,6 +178,7 @@ _nouveau_pwr_fini(struct nouveau_object *object, bool suspend)
...
@@ -177,6 +178,7 @@ _nouveau_pwr_fini(struct nouveau_object *object, bool suspend)
int
int
_nouveau_pwr_init
(
struct
nouveau_object
*
object
)
_nouveau_pwr_init
(
struct
nouveau_object
*
object
)
{
{
const
struct
nvkm_pwr_impl
*
impl
=
(
void
*
)
object
->
oclass
;
struct
nouveau_pwr
*
ppwr
=
(
void
*
)
object
;
struct
nouveau_pwr
*
ppwr
=
(
void
*
)
object
;
int
ret
,
i
;
int
ret
,
i
;
...
@@ -195,15 +197,15 @@ _nouveau_pwr_init(struct nouveau_object *object)
...
@@ -195,15 +197,15 @@ _nouveau_pwr_init(struct nouveau_object *object)
/* upload data segment */
/* upload data segment */
nv_wr32
(
ppwr
,
0x10a1c0
,
0x01000000
);
nv_wr32
(
ppwr
,
0x10a1c0
,
0x01000000
);
for
(
i
=
0
;
i
<
ppwr
->
data
.
size
/
4
;
i
++
)
for
(
i
=
0
;
i
<
impl
->
data
.
size
/
4
;
i
++
)
nv_wr32
(
ppwr
,
0x10a1c4
,
ppwr
->
data
.
data
[
i
]);
nv_wr32
(
ppwr
,
0x10a1c4
,
impl
->
data
.
data
[
i
]);
/* upload code segment */
/* upload code segment */
nv_wr32
(
ppwr
,
0x10a180
,
0x01000000
);
nv_wr32
(
ppwr
,
0x10a180
,
0x01000000
);
for
(
i
=
0
;
i
<
ppwr
->
code
.
size
/
4
;
i
++
)
{
for
(
i
=
0
;
i
<
impl
->
code
.
size
/
4
;
i
++
)
{
if
((
i
&
0x3f
)
==
0
)
if
((
i
&
0x3f
)
==
0
)
nv_wr32
(
ppwr
,
0x10a188
,
i
>>
6
);
nv_wr32
(
ppwr
,
0x10a188
,
i
>>
6
);
nv_wr32
(
ppwr
,
0x10a184
,
ppwr
->
code
.
data
[
i
]);
nv_wr32
(
ppwr
,
0x10a184
,
impl
->
code
.
data
[
i
]);
}
}
/* start it running */
/* start it running */
...
@@ -245,3 +247,15 @@ nouveau_pwr_create_(struct nouveau_object *parent,
...
@@ -245,3 +247,15 @@ nouveau_pwr_create_(struct nouveau_object *parent,
init_waitqueue_head
(
&
ppwr
->
recv
.
wait
);
init_waitqueue_head
(
&
ppwr
->
recv
.
wait
);
return
0
;
return
0
;
}
}
int
_nouveau_pwr_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nouveau_pwr
*
ppwr
;
int
ret
=
nouveau_pwr_create
(
parent
,
engine
,
oclass
,
&
ppwr
);
*
pobject
=
nv_object
(
ppwr
);
return
ret
;
}
drivers/gpu/drm/nouveau/core/subdev/pwr/memx.c
View file @
adec9bc3
#ifndef __NVKM_PWR_MEMX_H__
#ifndef __NVKM_PWR_MEMX_H__
#define __NVKM_PWR_MEMX_H__
#define __NVKM_PWR_MEMX_H__
#include <subdev/pwr.h>
#include "priv.h"
#include <subdev/pwr/fuc/os.h>
struct
nouveau_memx
{
struct
nouveau_memx
{
struct
nouveau_pwr
*
ppwr
;
struct
nouveau_pwr
*
ppwr
;
...
...
drivers/gpu/drm/nouveau/core/subdev/pwr/nv108.c
View file @
adec9bc3
...
@@ -22,41 +22,20 @@
...
@@ -22,41 +22,20 @@
* Authors: Ben Skeggs
* Authors: Ben Skeggs
*/
*/
#include <subdev/pwr.h>
#include "priv.h"
#include "fuc/nv108.fuc.h"
#include "fuc/nv108.fuc.h"
struct
nv108_pwr_priv
{
struct
nouveau_oclass
*
struct
nouveau_pwr
base
;
nv108_pwr_oclass
=
&
(
struct
nvkm_pwr_impl
)
{
};
.
base
.
handle
=
NV_SUBDEV
(
PWR
,
0x00
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
static
int
.
ctor
=
_nouveau_pwr_ctor
,
nv108_pwr_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nv108_pwr_priv
*
priv
;
int
ret
;
ret
=
nouveau_pwr_create
(
parent
,
engine
,
oclass
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
return
ret
;
priv
->
base
.
code
.
data
=
nv108_pwr_code
;
priv
->
base
.
code
.
size
=
sizeof
(
nv108_pwr_code
);
priv
->
base
.
data
.
data
=
nv108_pwr_data
;
priv
->
base
.
data
.
size
=
sizeof
(
nv108_pwr_data
);
return
0
;
}
struct
nouveau_oclass
nv108_pwr_oclass
=
{
.
handle
=
NV_SUBDEV
(
PWR
,
0x00
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nv108_pwr_ctor
,
.
dtor
=
_nouveau_pwr_dtor
,
.
dtor
=
_nouveau_pwr_dtor
,
.
init
=
_nouveau_pwr_init
,
.
init
=
_nouveau_pwr_init
,
.
fini
=
_nouveau_pwr_fini
,
.
fini
=
_nouveau_pwr_fini
,
},
},
};
.
code
.
data
=
nv108_pwr_code
,
.
code
.
size
=
sizeof
(
nv108_pwr_code
),
.
data
.
data
=
nv108_pwr_data
,
.
data
.
size
=
sizeof
(
nv108_pwr_data
),
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/pwr/nva3.c
View file @
adec9bc3
...
@@ -22,50 +22,29 @@
...
@@ -22,50 +22,29 @@
* Authors: Ben Skeggs
* Authors: Ben Skeggs
*/
*/
#include <subdev/pwr.h>
#include "priv.h"
#include "fuc/nva3.fuc.h"
#include "fuc/nva3.fuc.h"
struct
nva3_pwr_priv
{
struct
nouveau_pwr
base
;
};
static
int
static
int
nva3_pwr_init
(
struct
nouveau_object
*
object
)
nva3_pwr_init
(
struct
nouveau_object
*
object
)
{
{
struct
nva3_pwr_priv
*
priv
=
(
void
*
)
object
;
struct
nouveau_pwr
*
ppwr
=
(
void
*
)
object
;
nv_mask
(
priv
,
0x022210
,
0x00000001
,
0x00000000
);
nv_mask
(
ppwr
,
0x022210
,
0x00000001
,
0x00000000
);
nv_mask
(
priv
,
0x022210
,
0x00000001
,
0x00000001
);
nv_mask
(
ppwr
,
0x022210
,
0x00000001
,
0x00000001
);
return
nouveau_pwr_init
(
&
priv
->
base
);
return
nouveau_pwr_init
(
ppwr
);
}
static
int
nva3_pwr_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nva3_pwr_priv
*
priv
;
int
ret
;
ret
=
nouveau_pwr_create
(
parent
,
engine
,
oclass
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
return
ret
;
priv
->
base
.
code
.
data
=
nva3_pwr_code
;
priv
->
base
.
code
.
size
=
sizeof
(
nva3_pwr_code
);
priv
->
base
.
data
.
data
=
nva3_pwr_data
;
priv
->
base
.
data
.
size
=
sizeof
(
nva3_pwr_data
);
return
0
;
}
}
struct
nouveau_oclass
struct
nouveau_oclass
*
nva3_pwr_oclass
=
{
nva3_pwr_oclass
=
&
(
struct
nvkm_pwr_impl
)
{
.
handle
=
NV_SUBDEV
(
PWR
,
0xa3
),
.
base
.
handle
=
NV_SUBDEV
(
PWR
,
0xa3
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nva3
_pwr_ctor
,
.
ctor
=
_nouveau
_pwr_ctor
,
.
dtor
=
_nouveau_pwr_dtor
,
.
dtor
=
_nouveau_pwr_dtor
,
.
init
=
nva3_pwr_init
,
.
init
=
nva3_pwr_init
,
.
fini
=
_nouveau_pwr_fini
,
.
fini
=
_nouveau_pwr_fini
,
},
},
};
.
code
.
data
=
nva3_pwr_code
,
.
code
.
size
=
sizeof
(
nva3_pwr_code
),
.
data
.
data
=
nva3_pwr_data
,
.
data
.
size
=
sizeof
(
nva3_pwr_data
),
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/pwr/nvc0.c
View file @
adec9bc3
...
@@ -22,41 +22,20 @@
...
@@ -22,41 +22,20 @@
* Authors: Ben Skeggs
* Authors: Ben Skeggs
*/
*/
#include <subdev/pwr.h>
#include "priv.h"
#include "fuc/nvc0.fuc.h"
#include "fuc/nvc0.fuc.h"
struct
nvc0_pwr_priv
{
struct
nouveau_oclass
*
struct
nouveau_pwr
base
;
nvc0_pwr_oclass
=
&
(
struct
nvkm_pwr_impl
)
{
};
.
base
.
handle
=
NV_SUBDEV
(
PWR
,
0xc0
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
static
int
.
ctor
=
_nouveau_pwr_ctor
,
nvc0_pwr_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nvc0_pwr_priv
*
priv
;
int
ret
;
ret
=
nouveau_pwr_create
(
parent
,
engine
,
oclass
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
return
ret
;
priv
->
base
.
code
.
data
=
nvc0_pwr_code
;
priv
->
base
.
code
.
size
=
sizeof
(
nvc0_pwr_code
);
priv
->
base
.
data
.
data
=
nvc0_pwr_data
;
priv
->
base
.
data
.
size
=
sizeof
(
nvc0_pwr_data
);
return
0
;
}
struct
nouveau_oclass
nvc0_pwr_oclass
=
{
.
handle
=
NV_SUBDEV
(
PWR
,
0xc0
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nvc0_pwr_ctor
,
.
dtor
=
_nouveau_pwr_dtor
,
.
dtor
=
_nouveau_pwr_dtor
,
.
init
=
_nouveau_pwr_init
,
.
init
=
_nouveau_pwr_init
,
.
fini
=
_nouveau_pwr_fini
,
.
fini
=
_nouveau_pwr_fini
,
},
},
};
.
code
.
data
=
nvc0_pwr_code
,
.
code
.
size
=
sizeof
(
nvc0_pwr_code
),
.
data
.
data
=
nvc0_pwr_data
,
.
data
.
size
=
sizeof
(
nvc0_pwr_data
),
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/pwr/nvd0.c
View file @
adec9bc3
...
@@ -22,41 +22,20 @@
...
@@ -22,41 +22,20 @@
* Authors: Ben Skeggs
* Authors: Ben Skeggs
*/
*/
#include <subdev/pwr.h>
#include "priv.h"
#include "fuc/nvd0.fuc.h"
#include "fuc/nvd0.fuc.h"
struct
nvd0_pwr_priv
{
struct
nouveau_oclass
*
struct
nouveau_pwr
base
;
nvd0_pwr_oclass
=
&
(
struct
nvkm_pwr_impl
)
{
};
.
base
.
handle
=
NV_SUBDEV
(
PWR
,
0xd0
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
static
int
.
ctor
=
_nouveau_pwr_ctor
,
nvd0_pwr_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
{
struct
nvd0_pwr_priv
*
priv
;
int
ret
;
ret
=
nouveau_pwr_create
(
parent
,
engine
,
oclass
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
return
ret
;
priv
->
base
.
code
.
data
=
nvd0_pwr_code
;
priv
->
base
.
code
.
size
=
sizeof
(
nvd0_pwr_code
);
priv
->
base
.
data
.
data
=
nvd0_pwr_data
;
priv
->
base
.
data
.
size
=
sizeof
(
nvd0_pwr_data
);
return
0
;
}
struct
nouveau_oclass
nvd0_pwr_oclass
=
{
.
handle
=
NV_SUBDEV
(
PWR
,
0xd0
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nvd0_pwr_ctor
,
.
dtor
=
_nouveau_pwr_dtor
,
.
dtor
=
_nouveau_pwr_dtor
,
.
init
=
_nouveau_pwr_init
,
.
init
=
_nouveau_pwr_init
,
.
fini
=
_nouveau_pwr_fini
,
.
fini
=
_nouveau_pwr_fini
,
},
},
};
.
code
.
data
=
nvd0_pwr_code
,
.
code
.
size
=
sizeof
(
nvd0_pwr_code
),
.
data
.
data
=
nvd0_pwr_data
,
.
data
.
size
=
sizeof
(
nvd0_pwr_data
),
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/pwr/priv.h
0 → 100644
View file @
adec9bc3
#ifndef __NVKM_PWR_PRIV_H__
#define __NVKM_PWR_PRIV_H__
#include <subdev/pwr.h>
#include <subdev/pwr/fuc/os.h>
#define nouveau_pwr_create(p, e, o, d) \
nouveau_pwr_create_((p), (e), (o), sizeof(**d), (void **)d)
#define nouveau_pwr_destroy(p) \
nouveau_subdev_destroy(&(p)->base)
#define nouveau_pwr_init(p) ({ \
struct nouveau_pwr *_ppwr = (p); \
_nouveau_pwr_init(nv_object(_ppwr)); \
})
#define nouveau_pwr_fini(p,s) ({ \
struct nouveau_pwr *_ppwr = (p); \
_nouveau_pwr_fini(nv_object(_ppwr), (s)); \
})
int
nouveau_pwr_create_
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
int
,
void
**
);
int
_nouveau_pwr_ctor
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
void
*
,
u32
,
struct
nouveau_object
**
);
#define _nouveau_pwr_dtor _nouveau_subdev_dtor
int
_nouveau_pwr_init
(
struct
nouveau_object
*
);
int
_nouveau_pwr_fini
(
struct
nouveau_object
*
,
bool
);
struct
nvkm_pwr_impl
{
struct
nouveau_oclass
base
;
struct
{
u32
*
data
;
u32
size
;
}
code
;
struct
{
u32
*
data
;
u32
size
;
}
data
;
};
#endif
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