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
3f8e11e4
Commit
3f8e11e4
authored
Aug 15, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nv50/pm: mostly nailed down fan pwm frequency selection
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
11b7d895
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
4 deletions
+17
-4
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-0
drivers/gpu/drm/nouveau/nouveau_perf.c
drivers/gpu/drm/nouveau/nouveau_perf.c
+2
-3
drivers/gpu/drm/nouveau/nouveau_temp.c
drivers/gpu/drm/nouveau/nouveau_temp.c
+3
-0
drivers/gpu/drm/nouveau/nv50_pm.c
drivers/gpu/drm/nouveau/nv50_pm.c
+11
-1
No files found.
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
3f8e11e4
...
...
@@ -524,6 +524,7 @@ struct nouveau_pm_memtimings {
struct
nouveau_pm_fan
{
u32
min_duty
;
u32
max_duty
;
u32
pwm_freq
;
};
struct
nouveau_pm_engine
{
...
...
drivers/gpu/drm/nouveau/nouveau_perf.c
View file @
3f8e11e4
...
...
@@ -206,13 +206,12 @@ nouveau_perf_init(struct drm_device *dev)
if
(
version
<
0x40
)
{
recordlen
=
perf
[
3
]
+
(
perf
[
4
]
*
perf
[
5
]);
entries
=
perf
[
2
];
pm
->
pwm_divisor
=
ROM16
(
perf
[
6
]);
}
else
{
recordlen
=
perf
[
2
]
+
(
perf
[
3
]
*
perf
[
4
]);
entries
=
perf
[
5
];
}
if
(
version
<
0x30
)
pm
->
pwm_divisor
=
ROM16
(
perf
[
6
]);
}
else
{
if
(
bios
->
data
[
bios
->
offset
+
6
]
<
0x25
)
{
legacy_perf_init
(
dev
);
...
...
drivers/gpu/drm/nouveau/nouveau_temp.c
View file @
3f8e11e4
...
...
@@ -164,6 +164,9 @@ nouveau_temp_vbios_parse(struct drm_device *dev, u8 *temp)
pm
->
fan
.
min_duty
=
value
&
0xff
;
pm
->
fan
.
max_duty
=
(
value
&
0xff00
)
>>
8
;
break
;
case
0x26
:
pm
->
fan
.
pwm_freq
=
value
;
break
;
}
temp
+=
recordlen
;
}
...
...
drivers/gpu/drm/nouveau/nv50_pm.c
View file @
3f8e11e4
...
...
@@ -201,6 +201,8 @@ nv50_pm_fanspeed_get(struct drm_device *dev)
int
nv50_pm_fanspeed_set
(
struct
drm_device
*
dev
,
int
percent
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_pm_engine
*
pm
=
&
dev_priv
->
engine
.
pm
;
struct
pwm_info
pwm
;
u32
divs
,
duty
;
int
ret
;
...
...
@@ -209,12 +211,20 @@ nv50_pm_fanspeed_set(struct drm_device *dev, int percent)
if
(
ret
)
return
ret
;
divs
=
nv_rd32
(
dev
,
0x00e114
+
(
pwm
.
id
*
8
));
divs
=
pm
->
pwm_divisor
;
if
(
pm
->
fan
.
pwm_freq
)
{
/*XXX: PNVIO clock more than likely... */
divs
=
1350000
/
pm
->
fan
.
pwm_freq
;
if
(
dev_priv
->
chipset
<
0xa3
)
divs
/=
4
;
}
duty
=
((
divs
*
percent
)
+
99
)
/
100
;
if
(
pwm
.
invert
)
duty
=
divs
-
duty
;
nv_mask
(
dev
,
pwm
.
ctrl
,
0x00010001
<<
pwm
.
line
,
0x00000001
<<
pwm
.
line
);
nv_wr32
(
dev
,
0x00e114
+
(
pwm
.
id
*
8
),
divs
);
nv_wr32
(
dev
,
0x00e118
+
(
pwm
.
id
*
8
),
0x80000000
|
duty
);
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