Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
64a4222f
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看板
提交
64a4222f
编写于
5月 28, 2010
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branches 'video' and 'video-edid' into release
上级
91dd6964
eeb4bcb4
e92a7162
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
119 addition
and
9 deletion
+119
-9
drivers/acpi/video.c
drivers/acpi/video.c
+102
-8
drivers/acpi/video_detect.c
drivers/acpi/video_detect.c
+1
-1
include/acpi/video.h
include/acpi/video.h
+16
-0
未找到文件。
drivers/acpi/video.c
浏览文件 @
64a4222f
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include <acpi/acpi_bus.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/acpi_drivers.h>
#include <linux/suspend.h>
#include <linux/suspend.h>
#include <acpi/video.h>
#define PREFIX "ACPI: "
#define PREFIX "ACPI: "
...
@@ -65,11 +66,6 @@
...
@@ -65,11 +66,6 @@
#define MAX_NAME_LEN 20
#define MAX_NAME_LEN 20
#define ACPI_VIDEO_DISPLAY_CRT 1
#define ACPI_VIDEO_DISPLAY_TV 2
#define ACPI_VIDEO_DISPLAY_DVI 3
#define ACPI_VIDEO_DISPLAY_LCD 4
#define _COMPONENT ACPI_VIDEO_COMPONENT
#define _COMPONENT ACPI_VIDEO_COMPONENT
ACPI_MODULE_NAME
(
"video"
);
ACPI_MODULE_NAME
(
"video"
);
...
@@ -1747,12 +1743,28 @@ acpi_video_get_device_attr(struct acpi_video_bus *video, unsigned long device_id
...
@@ -1747,12 +1743,28 @@ acpi_video_get_device_attr(struct acpi_video_bus *video, unsigned long device_id
return
NULL
;
return
NULL
;
}
}
static
int
acpi_video_get_device_type
(
struct
acpi_video_bus
*
video
,
unsigned
long
device_id
)
{
struct
acpi_video_enumerated_device
*
ids
;
int
i
;
for
(
i
=
0
;
i
<
video
->
attached_count
;
i
++
)
{
ids
=
&
video
->
attached_array
[
i
];
if
((
ids
->
value
.
int_val
&
0xffff
)
==
device_id
)
return
ids
->
value
.
int_val
;
}
return
0
;
}
static
int
static
int
acpi_video_bus_get_one_device
(
struct
acpi_device
*
device
,
acpi_video_bus_get_one_device
(
struct
acpi_device
*
device
,
struct
acpi_video_bus
*
video
)
struct
acpi_video_bus
*
video
)
{
{
unsigned
long
long
device_id
;
unsigned
long
long
device_id
;
int
status
;
int
status
,
device_type
;
struct
acpi_video_device
*
data
;
struct
acpi_video_device
*
data
;
struct
acpi_video_device_attrib
*
attribute
;
struct
acpi_video_device_attrib
*
attribute
;
...
@@ -1797,8 +1809,25 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
...
@@ -1797,8 +1809,25 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
}
}
if
(
attribute
->
bios_can_detect
)
if
(
attribute
->
bios_can_detect
)
data
->
flags
.
bios
=
1
;
data
->
flags
.
bios
=
1
;
}
else
}
else
{
data
->
flags
.
unknown
=
1
;
/* Check for legacy IDs */
device_type
=
acpi_video_get_device_type
(
video
,
device_id
);
/* Ignore bits 16 and 18-20 */
switch
(
device_type
&
0xffe2ffff
)
{
case
ACPI_VIDEO_DISPLAY_LEGACY_MONITOR
:
data
->
flags
.
crt
=
1
;
break
;
case
ACPI_VIDEO_DISPLAY_LEGACY_PANEL
:
data
->
flags
.
lcd
=
1
;
break
;
case
ACPI_VIDEO_DISPLAY_LEGACY_TV
:
data
->
flags
.
tvout
=
1
;
break
;
default:
data
->
flags
.
unknown
=
1
;
}
}
acpi_video_device_bind
(
video
,
data
);
acpi_video_device_bind
(
video
,
data
);
acpi_video_device_find_cap
(
data
);
acpi_video_device_find_cap
(
data
);
...
@@ -2032,6 +2061,71 @@ acpi_video_switch_brightness(struct acpi_video_device *device, int event)
...
@@ -2032,6 +2061,71 @@ acpi_video_switch_brightness(struct acpi_video_device *device, int event)
return
result
;
return
result
;
}
}
int
acpi_video_get_edid
(
struct
acpi_device
*
device
,
int
type
,
int
device_id
,
void
**
edid
)
{
struct
acpi_video_bus
*
video
;
struct
acpi_video_device
*
video_device
;
union
acpi_object
*
buffer
=
NULL
;
acpi_status
status
;
int
i
,
length
;
if
(
!
device
||
!
acpi_driver_data
(
device
))
return
-
EINVAL
;
video
=
acpi_driver_data
(
device
);
for
(
i
=
0
;
i
<
video
->
attached_count
;
i
++
)
{
video_device
=
video
->
attached_array
[
i
].
bind_info
;
length
=
256
;
if
(
!
video_device
)
continue
;
if
(
type
)
{
switch
(
type
)
{
case
ACPI_VIDEO_DISPLAY_CRT
:
if
(
!
video_device
->
flags
.
crt
)
continue
;
break
;
case
ACPI_VIDEO_DISPLAY_TV
:
if
(
!
video_device
->
flags
.
tvout
)
continue
;
break
;
case
ACPI_VIDEO_DISPLAY_DVI
:
if
(
!
video_device
->
flags
.
dvi
)
continue
;
break
;
case
ACPI_VIDEO_DISPLAY_LCD
:
if
(
!
video_device
->
flags
.
lcd
)
continue
;
break
;
}
}
else
if
(
video_device
->
device_id
!=
device_id
)
{
continue
;
}
status
=
acpi_video_device_EDID
(
video_device
,
&
buffer
,
length
);
if
(
ACPI_FAILURE
(
status
)
||
!
buffer
||
buffer
->
type
!=
ACPI_TYPE_BUFFER
)
{
length
=
128
;
status
=
acpi_video_device_EDID
(
video_device
,
&
buffer
,
length
);
if
(
ACPI_FAILURE
(
status
)
||
!
buffer
||
buffer
->
type
!=
ACPI_TYPE_BUFFER
)
{
continue
;
}
}
*
edid
=
buffer
->
buffer
.
pointer
;
return
length
;
}
return
-
ENODEV
;
}
EXPORT_SYMBOL
(
acpi_video_get_edid
);
static
int
static
int
acpi_video_bus_get_devices
(
struct
acpi_video_bus
*
video
,
acpi_video_bus_get_devices
(
struct
acpi_video_bus
*
video
,
struct
acpi_device
*
device
)
struct
acpi_device
*
device
)
...
...
drivers/acpi/video_detect.c
浏览文件 @
64a4222f
...
@@ -250,7 +250,7 @@ static int __init acpi_backlight(char *str)
...
@@ -250,7 +250,7 @@ static int __init acpi_backlight(char *str)
ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR
;
ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR
;
if
(
!
strcmp
(
"video"
,
str
))
if
(
!
strcmp
(
"video"
,
str
))
acpi_video_support
|=
acpi_video_support
|=
ACPI_VIDEO_
OUTPUT_SWITCHING
_FORCE_VIDEO
;
ACPI_VIDEO_
BACKLIGHT
_FORCE_VIDEO
;
}
}
return
1
;
return
1
;
}
}
...
...
include/acpi/video.h
浏览文件 @
64a4222f
#ifndef __ACPI_VIDEO_H
#ifndef __ACPI_VIDEO_H
#define __ACPI_VIDEO_H
#define __ACPI_VIDEO_H
#define ACPI_VIDEO_DISPLAY_CRT 1
#define ACPI_VIDEO_DISPLAY_TV 2
#define ACPI_VIDEO_DISPLAY_DVI 3
#define ACPI_VIDEO_DISPLAY_LCD 4
#define ACPI_VIDEO_DISPLAY_LEGACY_MONITOR 0x0100
#define ACPI_VIDEO_DISPLAY_LEGACY_PANEL 0x0110
#define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200
#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)
#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)
extern
int
acpi_video_register
(
void
);
extern
int
acpi_video_register
(
void
);
extern
void
acpi_video_unregister
(
void
);
extern
void
acpi_video_unregister
(
void
);
extern
int
acpi_video_get_edid
(
struct
acpi_device
*
device
,
int
type
,
int
device_id
,
void
**
edid
);
#else
#else
static
inline
int
acpi_video_register
(
void
)
{
return
0
;
}
static
inline
int
acpi_video_register
(
void
)
{
return
0
;
}
static
inline
void
acpi_video_unregister
(
void
)
{
return
;
}
static
inline
void
acpi_video_unregister
(
void
)
{
return
;
}
static
inline
int
acpi_video_get_edid
(
struct
acpi_device
*
device
,
int
type
,
int
device_id
,
void
**
edid
)
{
return
-
ENODEV
;
}
#endif
#endif
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录