Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
02076da9
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
02076da9
编写于
12月 17, 2009
作者:
F
Francisco Jerez
提交者:
Dave Airlie
1月 11, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: Clean up the nv17-nv4x load detection code a bit.
Signed-off-by:
N
Francisco Jerez
<
currojerez@riseup.net
>
上级
e55ca7e6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
31 deletion
+37
-31
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-5
drivers/gpu/drm/nouveau/nv04_dac.c
drivers/gpu/drm/nouveau/nv04_dac.c
+19
-16
drivers/gpu/drm/nouveau/nv17_tv.c
drivers/gpu/drm/nouveau/nv17_tv.c
+17
-10
未找到文件。
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
02076da9
...
...
@@ -1074,8 +1074,7 @@ extern long nouveau_compat_ioctl(struct file *file, unsigned int cmd,
/* nv04_dac.c */
extern
int
nv04_dac_create
(
struct
drm_device
*
dev
,
struct
dcb_entry
*
entry
);
extern
enum
drm_connector_status
nv17_dac_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
);
extern
uint32_t
nv17_dac_sample_load
(
struct
drm_encoder
*
encoder
);
extern
int
nv04_dac_output_offset
(
struct
drm_encoder
*
encoder
);
extern
void
nv04_dac_update_dacclk
(
struct
drm_encoder
*
encoder
,
bool
enable
);
...
...
@@ -1093,9 +1092,6 @@ extern int nv04_tv_create(struct drm_device *dev, struct dcb_entry *entry);
/* nv17_tv.c */
extern
int
nv17_tv_create
(
struct
drm_device
*
dev
,
struct
dcb_entry
*
entry
);
extern
enum
drm_connector_status
nv17_tv_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
,
uint32_t
pin_mask
);
/* nv04_display.c */
extern
int
nv04_display_create
(
struct
drm_device
*
);
...
...
drivers/gpu/drm/nouveau/nv04_dac.c
浏览文件 @
02076da9
...
...
@@ -212,16 +212,15 @@ static enum drm_connector_status nv04_dac_detect(struct drm_encoder *encoder,
return
connector_status_disconnected
;
}
enum
drm_connector_status
nv17_dac_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
)
uint32_t
nv17_dac_sample_load
(
struct
drm_encoder
*
encoder
)
{
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
dcb_entry
*
dcb
=
nouveau_encoder
(
encoder
)
->
dcb
;
uint32_t
testval
,
regoffset
=
nv04_dac_output_offset
(
encoder
);
uint32_t
sample
,
testval
,
regoffset
=
nv04_dac_output_offset
(
encoder
);
uint32_t
saved_powerctrl_2
=
0
,
saved_powerctrl_4
=
0
,
saved_routput
,
saved_rtest_ctrl
,
saved_gpio0
,
saved_gpio1
,
temp
,
routput
;
int
head
,
present
=
0
;
int
head
;
#define RGB_TEST_DATA(r, g, b) (r << 0 | g << 10 | b << 20)
if
(
dcb
->
type
==
OUTPUT_TV
)
{
...
...
@@ -287,13 +286,7 @@ enum drm_connector_status nv17_dac_detect(struct drm_encoder *encoder,
temp
|
NV_PRAMDAC_TEST_CONTROL_TP_INS_EN_ASSERTED
);
msleep
(
5
);
temp
=
NVReadRAMDAC
(
dev
,
0
,
NV_PRAMDAC_TEST_CONTROL
+
regoffset
);
if
(
dcb
->
type
==
OUTPUT_TV
)
present
=
(
nv17_tv_detect
(
encoder
,
connector
,
temp
)
==
connector_status_connected
);
else
present
=
temp
&
NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI
;
sample
=
NVReadRAMDAC
(
dev
,
0
,
NV_PRAMDAC_TEST_CONTROL
+
regoffset
);
temp
=
NVReadRAMDAC
(
dev
,
head
,
NV_PRAMDAC_TEST_CONTROL
);
NVWriteRAMDAC
(
dev
,
head
,
NV_PRAMDAC_TEST_CONTROL
,
...
...
@@ -310,15 +303,25 @@ enum drm_connector_status nv17_dac_detect(struct drm_encoder *encoder,
nv17_gpio_set
(
dev
,
DCB_GPIO_TVDAC1
,
saved_gpio1
);
nv17_gpio_set
(
dev
,
DCB_GPIO_TVDAC0
,
saved_gpio0
);
if
(
present
)
{
NV_INFO
(
dev
,
"Load detected on output %c
\n
"
,
'@'
+
ffs
(
dcb
->
or
));
return
sample
;
}
static
enum
drm_connector_status
nv17_dac_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
)
{
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
dcb_entry
*
dcb
=
nouveau_encoder
(
encoder
)
->
dcb
;
uint32_t
sample
=
nv17_dac_sample_load
(
encoder
);
if
(
sample
&
NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI
)
{
NV_INFO
(
dev
,
"Load detected on output %c
\n
"
,
'@'
+
ffs
(
dcb
->
or
));
return
connector_status_connected
;
}
else
{
return
connector_status_disconnected
;
}
return
connector_status_disconnected
;
}
static
bool
nv04_dac_mode_fixup
(
struct
drm_encoder
*
encoder
,
struct
drm_display_mode
*
mode
,
struct
drm_display_mode
*
adjusted_mode
)
...
...
drivers/gpu/drm/nouveau/nv17_tv.c
浏览文件 @
02076da9
...
...
@@ -33,13 +33,15 @@
#include "nouveau_hw.h"
#include "nv17_tv.h"
enum
drm_connector_status
nv17_tv_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
,
uint32_t
pin_mask
)
static
enum
drm_connector_status
nv17_tv_detect
(
struct
drm_encoder
*
encoder
,
struct
drm_connector
*
connector
)
{
struct
drm_device
*
dev
=
encoder
->
dev
;
struct
drm_mode_config
*
conf
=
&
dev
->
mode_config
;
struct
nv17_tv_encoder
*
tv_enc
=
to_tv_enc
(
encoder
);
struct
dcb_entry
*
dcb
=
tv_enc
->
base
.
dcb
;
tv_enc
->
pin_mask
=
pin_mask
>>
28
&
0xe
;
tv_enc
->
pin_mask
=
nv17_dac_sample_load
(
encoder
)
>>
28
&
0xe
;
switch
(
tv_enc
->
pin_mask
)
{
case
0x2
:
...
...
@@ -50,7 +52,7 @@ enum drm_connector_status nv17_tv_detect(struct drm_encoder *encoder,
tv_enc
->
subconnector
=
DRM_MODE_SUBCONNECTOR_SVIDEO
;
break
;
case
0xe
:
if
(
nouveau_encoder
(
encoder
)
->
dcb
->
tvconf
.
has_component_output
)
if
(
dcb
->
tvconf
.
has_component_output
)
tv_enc
->
subconnector
=
DRM_MODE_SUBCONNECTOR_Component
;
else
tv_enc
->
subconnector
=
DRM_MODE_SUBCONNECTOR_SCART
;
...
...
@@ -61,11 +63,16 @@ enum drm_connector_status nv17_tv_detect(struct drm_encoder *encoder,
}
drm_connector_property_set_value
(
connector
,
encoder
->
dev
->
mode_config
.
tv_subconnector_property
,
tv_enc
->
subconnector
);
conf
->
tv_subconnector_property
,
tv_enc
->
subconnector
);
return
tv_enc
->
subconnector
?
connector_status_connected
:
connector_status_disconnected
;
if
(
tv_enc
->
subconnector
)
{
NV_INFO
(
dev
,
"Load detected on output %c
\n
"
,
'@'
+
ffs
(
dcb
->
or
));
return
connector_status_connected
;
}
else
{
return
connector_status_disconnected
;
}
}
static
const
struct
{
...
...
@@ -633,7 +640,7 @@ static struct drm_encoder_helper_funcs nv17_tv_helper_funcs = {
.
prepare
=
nv17_tv_prepare
,
.
commit
=
nv17_tv_commit
,
.
mode_set
=
nv17_tv_mode_set
,
.
detect
=
nv17_
dac
_detect
,
.
detect
=
nv17_
tv
_detect
,
};
static
struct
drm_encoder_slave_funcs
nv17_tv_slave_funcs
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录