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
0b627a0b
Commit
0b627a0b
authored
Oct 27, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/pm: change volt/fan before upclock, but after downclock
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
ff2b6c6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
13 deletions
+36
-13
drivers/gpu/drm/nouveau/nouveau_pm.c
drivers/gpu/drm/nouveau/nouveau_pm.c
+36
-13
No files found.
drivers/gpu/drm/nouveau/nouveau_pm.c
View file @
0b627a0b
...
...
@@ -97,39 +97,62 @@ nouveau_pwmfan_set(struct drm_device *dev, int percent)
}
static
int
nouveau_pm_perflvl_set
(
struct
drm_device
*
dev
,
struct
nouveau_pm_level
*
perflvl
)
nouveau_pm_perflvl_aux
(
struct
drm_device
*
dev
,
struct
nouveau_pm_level
*
perflvl
,
struct
nouveau_pm_level
*
a
,
struct
nouveau_pm_level
*
b
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_pm_engine
*
pm
=
&
dev_priv
->
engine
.
pm
;
void
*
state
;
int
ret
;
if
(
perflvl
==
pm
->
cur
)
return
0
;
/*XXX: not on all boards, we should control based on temperature
* on recent boards.. or maybe on some other factor we don't
* know about?
*/
if
(
perflvl
->
fanspeed
)
{
if
(
a
->
fanspeed
&&
b
->
fanspeed
&&
b
->
fanspeed
>
a
->
fanspeed
)
{
ret
=
nouveau_pwmfan_set
(
dev
,
perflvl
->
fanspeed
);
if
(
ret
&&
ret
!=
-
ENODEV
)
NV_ERROR
(
dev
,
"set fanspeed failed: %d
\n
"
,
ret
);
if
(
ret
&&
ret
!=
-
ENODEV
)
{
NV_ERROR
(
dev
,
"fanspeed set failed: %d
\n
"
,
ret
);
return
ret
;
}
}
if
(
pm
->
voltage
.
supported
&&
pm
->
voltage_set
&&
perflvl
->
volt_min
)
{
ret
=
pm
->
voltage_set
(
dev
,
perflvl
->
volt_min
);
if
(
ret
)
{
NV_ERROR
(
dev
,
"voltage_set %d failed: %d
\n
"
,
perflvl
->
volt_min
,
ret
);
if
(
pm
->
voltage
.
supported
&&
pm
->
voltage_set
)
{
if
(
a
->
volt_min
&&
b
->
volt_min
&&
b
->
volt_min
>
a
->
volt_min
)
{
ret
=
pm
->
voltage_set
(
dev
,
perflvl
->
volt_min
);
if
(
ret
)
{
NV_ERROR
(
dev
,
"voltage set failed: %d
\n
"
,
ret
);
return
ret
;
}
}
}
return
0
;
}
static
int
nouveau_pm_perflvl_set
(
struct
drm_device
*
dev
,
struct
nouveau_pm_level
*
perflvl
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_pm_engine
*
pm
=
&
dev_priv
->
engine
.
pm
;
void
*
state
;
int
ret
;
if
(
perflvl
==
pm
->
cur
)
return
0
;
ret
=
nouveau_pm_perflvl_aux
(
dev
,
perflvl
,
pm
->
cur
,
perflvl
);
if
(
ret
)
return
ret
;
state
=
pm
->
clocks_pre
(
dev
,
perflvl
);
if
(
IS_ERR
(
state
))
return
PTR_ERR
(
state
);
pm
->
clocks_set
(
dev
,
state
);
ret
=
nouveau_pm_perflvl_aux
(
dev
,
perflvl
,
perflvl
,
pm
->
cur
);
if
(
ret
)
return
ret
;
pm
->
cur
=
perflvl
;
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