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
bc4624ca
Commit
bc4624ca
authored
Feb 11, 2010
by
Rafał Miłecki
Committed by
Dave Airlie
Feb 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/radeon/kms: simplify picking power state
Signed-off-by:
Dave Airlie
<
airlied@redhat.com
>
parent
27459324
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
39 deletions
+18
-39
drivers/gpu/drm/radeon/radeon_pm.c
drivers/gpu/drm/radeon/radeon_pm.c
+18
-39
No files found.
drivers/gpu/drm/radeon/radeon_pm.c
View file @
bc4624ca
...
...
@@ -81,60 +81,39 @@ static void radeon_print_power_mode_info(struct radeon_device *rdev)
static
struct
radeon_power_state
*
radeon_pick_power_state
(
struct
radeon_device
*
rdev
,
enum
radeon_pm_state_type
type
)
{
int
i
;
struct
radeon_power_state
*
power_state
=
NULL
;
int
i
,
j
;
enum
radeon_pm_state_type
wanted_types
[
2
];
int
wanted_count
;
switch
(
type
)
{
case
POWER_STATE_TYPE_DEFAULT
:
default:
return
rdev
->
pm
.
default_power_state
;
case
POWER_STATE_TYPE_POWERSAVE
:
for
(
i
=
0
;
i
<
rdev
->
pm
.
num_power_states
;
i
++
)
{
if
(
rdev
->
pm
.
power_state
[
i
].
type
==
POWER_STATE_TYPE_POWERSAVE
)
{
power_state
=
&
rdev
->
pm
.
power_state
[
i
];
break
;
}
}
if
(
power_state
==
NULL
)
{
for
(
i
=
0
;
i
<
rdev
->
pm
.
num_power_states
;
i
++
)
{
if
(
rdev
->
pm
.
power_state
[
i
].
type
==
POWER_STATE_TYPE_BATTERY
)
{
power_state
=
&
rdev
->
pm
.
power_state
[
i
];
break
;
}
}
}
wanted_types
[
0
]
=
POWER_STATE_TYPE_POWERSAVE
;
wanted_types
[
1
]
=
POWER_STATE_TYPE_BATTERY
;
wanted_count
=
2
;
break
;
case
POWER_STATE_TYPE_BATTERY
:
for
(
i
=
0
;
i
<
rdev
->
pm
.
num_power_states
;
i
++
)
{
if
(
rdev
->
pm
.
power_state
[
i
].
type
==
POWER_STATE_TYPE_BATTERY
)
{
power_state
=
&
rdev
->
pm
.
power_state
[
i
];
break
;
}
}
if
(
power_state
==
NULL
)
{
for
(
i
=
0
;
i
<
rdev
->
pm
.
num_power_states
;
i
++
)
{
if
(
rdev
->
pm
.
power_state
[
i
].
type
==
POWER_STATE_TYPE_POWERSAVE
)
{
power_state
=
&
rdev
->
pm
.
power_state
[
i
];
break
;
}
}
}
wanted_types
[
0
]
=
POWER_STATE_TYPE_BATTERY
;
wanted_types
[
1
]
=
POWER_STATE_TYPE_POWERSAVE
;
wanted_count
=
2
;
break
;
case
POWER_STATE_TYPE_BALANCED
:
case
POWER_STATE_TYPE_PERFORMANCE
:
for
(
i
=
0
;
i
<
rdev
->
pm
.
num_power_states
;
i
++
)
{
if
(
rdev
->
pm
.
power_state
[
i
].
type
==
type
)
{
power_state
=
&
rdev
->
pm
.
power_state
[
i
];
break
;
}
}
wanted_types
[
0
]
=
type
;
wanted_count
=
1
;
break
;
}
if
(
power_state
==
NULL
)
return
rdev
->
pm
.
default_power_state
;
for
(
i
=
0
;
i
<
wanted_count
;
i
++
)
{
for
(
j
=
0
;
j
<
rdev
->
pm
.
num_power_states
;
j
++
)
{
if
(
rdev
->
pm
.
power_state
[
j
].
type
==
wanted_types
[
i
])
return
&
rdev
->
pm
.
power_state
[
j
];
}
}
return
power_state
;
return
rdev
->
pm
.
default_
power_state
;
}
static
struct
radeon_pm_clock_info
*
radeon_pick_clock_mode
(
struct
radeon_device
*
rdev
,
...
...
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