Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
4709bff0
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4709bff0
编写于
9月 13, 2010
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: make bios code easier to use externally
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
855a95e4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
50 addition
and
23 deletion
+50
-23
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_bios.c
+31
-23
drivers/gpu/drm/nouveau/nouveau_bios.h
drivers/gpu/drm/nouveau/nouveau_bios.h
+19
-0
未找到文件。
drivers/gpu/drm/nouveau/nouveau_bios.c
浏览文件 @
4709bff0
...
...
@@ -43,9 +43,6 @@
#define BIOSLOG(sip, fmt, arg...) NV_DEBUG(sip->dev, fmt, ##arg)
#define LOG_OLD_VALUE(x)
#define ROM16(x) le16_to_cpu(*(uint16_t *)&(x))
#define ROM32(x) le32_to_cpu(*(uint32_t *)&(x))
struct
init_exec
{
bool
execute
;
bool
repeat
;
...
...
@@ -272,12 +269,6 @@ struct init_tbl_entry {
int
(
*
handler
)(
struct
nvbios
*
,
uint16_t
,
struct
init_exec
*
);
};
struct
bit_entry
{
uint8_t
id
[
2
];
uint16_t
length
;
uint16_t
offset
;
};
static
int
parse_init_table
(
struct
nvbios
*
,
unsigned
int
,
struct
init_exec
*
);
#define MACRO_INDEX_SIZE 2
...
...
@@ -5365,7 +5356,7 @@ parse_bit_M_tbl_entry(struct drm_device *dev, struct nvbios *bios,
if
(
bitentry
->
length
<
0x5
)
return
0
;
if
(
bitentry
->
id
[
1
]
<
2
)
{
if
(
bitentry
->
version
<
2
)
{
bios
->
ram_restrict_group_count
=
bios
->
data
[
bitentry
->
offset
+
2
];
bios
->
ram_restrict_tbl_ptr
=
ROM16
(
bios
->
data
[
bitentry
->
offset
+
3
]);
}
else
{
...
...
@@ -5475,27 +5466,40 @@ struct bit_table {
#define BIT_TABLE(id, funcid) ((struct bit_table){ id, parse_bit_##funcid##_tbl_entry })
int
bit_table
(
struct
drm_device
*
dev
,
u8
id
,
struct
bit_entry
*
bit
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nvbios
*
bios
=
&
dev_priv
->
vbios
;
u8
entries
,
*
entry
;
entries
=
bios
->
data
[
bios
->
offset
+
10
];
entry
=
&
bios
->
data
[
bios
->
offset
+
12
];
while
(
entries
--
)
{
if
(
entry
[
0
]
==
id
)
{
bit
->
id
=
entry
[
0
];
bit
->
version
=
entry
[
1
];
bit
->
length
=
ROM16
(
entry
[
2
]);
bit
->
offset
=
ROM16
(
entry
[
4
]);
bit
->
data
=
ROMPTR
(
bios
,
entry
[
4
]);
return
0
;
}
entry
+=
bios
->
data
[
bios
->
offset
+
9
];
}
return
-
ENOENT
;
}
static
int
parse_bit_table
(
struct
nvbios
*
bios
,
const
uint16_t
bitoffset
,
struct
bit_table
*
table
)
{
struct
drm_device
*
dev
=
bios
->
dev
;
uint8_t
maxentries
=
bios
->
data
[
bitoffset
+
4
];
int
i
,
offset
;
struct
bit_entry
bitentry
;
for
(
i
=
0
,
offset
=
bitoffset
+
6
;
i
<
maxentries
;
i
++
,
offset
+=
6
)
{
bitentry
.
id
[
0
]
=
bios
->
data
[
offset
];
if
(
bitentry
.
id
[
0
]
!=
table
->
id
)
continue
;
bitentry
.
id
[
1
]
=
bios
->
data
[
offset
+
1
];
bitentry
.
length
=
ROM16
(
bios
->
data
[
offset
+
2
]);
bitentry
.
offset
=
ROM16
(
bios
->
data
[
offset
+
4
]);
if
(
bit_table
(
dev
,
table
->
id
,
&
bitentry
)
==
0
)
return
table
->
parse_fn
(
dev
,
bios
,
&
bitentry
);
}
NV_INFO
(
dev
,
"BIT table '%c' not found
\n
"
,
table
->
id
);
return
-
ENOSYS
;
...
...
@@ -6752,6 +6756,8 @@ static int nouveau_parse_vbios_struct(struct drm_device *dev)
bit_signature
,
sizeof
(
bit_signature
));
if
(
offset
)
{
NV_TRACE
(
dev
,
"BIT BIOS found
\n
"
);
bios
->
type
=
NVBIOS_BIT
;
bios
->
offset
=
offset
;
return
parse_bit_structure
(
bios
,
offset
+
6
);
}
...
...
@@ -6759,6 +6765,8 @@ static int nouveau_parse_vbios_struct(struct drm_device *dev)
bmp_signature
,
sizeof
(
bmp_signature
));
if
(
offset
)
{
NV_TRACE
(
dev
,
"BMP BIOS found
\n
"
);
bios
->
type
=
NVBIOS_BMP
;
bios
->
offset
=
offset
;
return
parse_bmp_structure
(
dev
,
bios
,
offset
);
}
...
...
drivers/gpu/drm/nouveau/nouveau_bios.h
浏览文件 @
4709bff0
...
...
@@ -34,6 +34,20 @@
#define DCB_LOC_ON_CHIP 0
#define ROM16(x) le16_to_cpu(*(uint16_t *)&(x))
#define ROM32(x) le32_to_cpu(*(uint32_t *)&(x))
#define ROMPTR(bios, x) (ROM16(x) ? &(bios)->data[ROM16(x)] : NULL)
struct
bit_entry
{
uint8_t
id
;
uint8_t
version
;
uint16_t
length
;
uint16_t
offset
;
uint8_t
*
data
;
};
int
bit_table
(
struct
drm_device
*
,
u8
id
,
struct
bit_entry
*
);
struct
dcb_i2c_entry
{
uint32_t
entry
;
uint8_t
port_type
;
...
...
@@ -224,6 +238,11 @@ struct pll_lims {
struct
nvbios
{
struct
drm_device
*
dev
;
enum
{
NVBIOS_BMP
,
NVBIOS_BIT
}
type
;
uint16_t
offset
;
uint8_t
chip_version
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录