Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
64f1c11a
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
64f1c11a
编写于
9月 17, 2010
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: restore perflvl on resume, and restore boot perflvl on unload
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
6f876986
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
49 addition
and
19 deletion
+49
-19
drivers/gpu/drm/nouveau/nouveau_drv.c
drivers/gpu/drm/nouveau/nouveau_drv.c
+3
-0
drivers/gpu/drm/nouveau/nouveau_pm.c
drivers/gpu/drm/nouveau/nouveau_pm.c
+45
-19
drivers/gpu/drm/nouveau/nouveau_pm.h
drivers/gpu/drm/nouveau/nouveau_pm.h
+1
-0
未找到文件。
drivers/gpu/drm/nouveau/nouveau_drv.c
浏览文件 @
64f1c11a
...
...
@@ -31,6 +31,7 @@
#include "nouveau_hw.h"
#include "nouveau_fb.h"
#include "nouveau_fbcon.h"
#include "nouveau_pm.h"
#include "nv50_display.h"
#include "drm_pciids.h"
...
...
@@ -279,6 +280,8 @@ nouveau_pci_resume(struct pci_dev *pdev)
if
(
ret
)
return
ret
;
nouveau_pm_resume
(
dev
);
if
(
dev_priv
->
gart_info
.
type
==
NOUVEAU_GART_AGP
)
{
ret
=
nouveau_mem_init_agp
(
dev
);
if
(
ret
)
{
...
...
drivers/gpu/drm/nouveau/nouveau_pm.c
浏览文件 @
64f1c11a
...
...
@@ -46,13 +46,39 @@ nouveau_pm_clock_set(struct drm_device *dev, u8 id, u32 khz)
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
;
int
ret
;
if
(
perflvl
==
pm
->
cur
)
return
0
;
if
(
pm
->
voltage
.
supported
&&
pm
->
voltage_set
&&
perflvl
->
voltage
)
{
ret
=
pm
->
voltage_set
(
dev
,
perflvl
->
voltage
);
if
(
ret
)
{
NV_ERROR
(
dev
,
"voltage_set %d failed: %d
\n
"
,
perflvl
->
voltage
,
ret
);
}
}
nouveau_pm_clock_set
(
dev
,
PLL_CORE
,
perflvl
->
core
);
nouveau_pm_clock_set
(
dev
,
PLL_SHADER
,
perflvl
->
shader
);
nouveau_pm_clock_set
(
dev
,
PLL_MEMORY
,
perflvl
->
memory
);
nouveau_pm_clock_set
(
dev
,
PLL_UNK05
,
perflvl
->
unk05
);
pm
->
cur
=
perflvl
;
return
0
;
}
static
int
nouveau_pm_profile_set
(
struct
drm_device
*
dev
,
const
char
*
profile
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_pm_engine
*
pm
=
&
dev_priv
->
engine
.
pm
;
struct
nouveau_pm_level
*
perflvl
=
NULL
;
int
ret
;
/* safety precaution, for now */
if
(
nouveau_perflvl_wr
!=
7777
)
...
...
@@ -78,25 +104,8 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile)
return
-
EINVAL
;
}
if
(
perflvl
==
pm
->
cur
)
return
0
;
NV_INFO
(
dev
,
"setting performance level: %s
\n
"
,
profile
);
if
(
pm
->
voltage
.
supported
&&
pm
->
voltage_set
&&
perflvl
->
voltage
)
{
ret
=
pm
->
voltage_set
(
dev
,
perflvl
->
voltage
);
if
(
ret
)
{
NV_ERROR
(
dev
,
"voltage_set %d failed: %d
\n
"
,
perflvl
->
voltage
,
ret
);
}
}
nouveau_pm_clock_set
(
dev
,
PLL_CORE
,
perflvl
->
core
);
nouveau_pm_clock_set
(
dev
,
PLL_SHADER
,
perflvl
->
shader
);
nouveau_pm_clock_set
(
dev
,
PLL_MEMORY
,
perflvl
->
memory
);
nouveau_pm_clock_set
(
dev
,
PLL_UNK05
,
perflvl
->
unk05
);
pm
->
cur
=
perflvl
;
return
0
;
return
nouveau_pm_perflvl_set
(
dev
,
perflvl
);
}
static
int
...
...
@@ -285,6 +294,9 @@ nouveau_pm_fini(struct drm_device *dev)
struct
device
*
d
=
&
dev
->
pdev
->
dev
;
int
i
;
if
(
pm
->
cur
!=
&
pm
->
boot
)
nouveau_pm_perflvl_set
(
dev
,
&
pm
->
boot
);
device_remove_file
(
d
,
&
dev_attr_performance_level
);
for
(
i
=
0
;
i
<
pm
->
nr_perflvl
;
i
++
)
{
struct
nouveau_pm_level
*
pl
=
&
pm
->
perflvl
[
i
];
...
...
@@ -299,3 +311,17 @@ nouveau_pm_fini(struct drm_device *dev)
nouveau_volt_fini
(
dev
);
}
void
nouveau_pm_resume
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_pm_engine
*
pm
=
&
dev_priv
->
engine
.
pm
;
struct
nouveau_pm_level
*
perflvl
;
if
(
pm
->
cur
==
&
pm
->
boot
)
return
;
perflvl
=
pm
->
cur
;
pm
->
cur
=
&
pm
->
boot
;
nouveau_pm_perflvl_set
(
dev
,
perflvl
);
}
drivers/gpu/drm/nouveau/nouveau_pm.h
浏览文件 @
64f1c11a
...
...
@@ -28,6 +28,7 @@
/* nouveau_pm.c */
int
nouveau_pm_init
(
struct
drm_device
*
dev
);
void
nouveau_pm_fini
(
struct
drm_device
*
dev
);
void
nouveau_pm_resume
(
struct
drm_device
*
dev
);
/* nouveau_volt.c */
void
nouveau_volt_init
(
struct
drm_device
*
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录