Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e8f3de96
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
提交
e8f3de96
编写于
10月 16, 2017
作者:
R
Rob Clark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/msm/adreno: split out helper to load fw
Prep work for the next patch. Signed-off-by:
N
Rob Clark
<
robdclark@gmail.com
>
上级
eec874ce
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
18 deletion
+34
-18
drivers/gpu/drm/msm/adreno/a5xx_gpu.c
drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+6
-5
drivers/gpu/drm/msm/adreno/a5xx_power.c
drivers/gpu/drm/msm/adreno/a5xx_power.c
+2
-1
drivers/gpu/drm/msm/adreno/adreno_gpu.c
drivers/gpu/drm/msm/adreno/adreno_gpu.c
+24
-12
drivers/gpu/drm/msm/adreno/adreno_gpu.h
drivers/gpu/drm/msm/adreno/adreno_gpu.h
+2
-0
未找到文件。
drivers/gpu/drm/msm/adreno/a5xx_gpu.c
浏览文件 @
e8f3de96
...
...
@@ -26,8 +26,9 @@ static void a5xx_dump(struct msm_gpu *gpu);
#define GPU_PAS_ID 13
static
int
zap_shader_load_mdt
(
struct
device
*
dev
,
const
char
*
fwname
)
static
int
zap_shader_load_mdt
(
struct
msm_gpu
*
gpu
,
const
char
*
fwname
)
{
struct
device
*
dev
=
&
gpu
->
pdev
->
dev
;
const
struct
firmware
*
fw
;
struct
device_node
*
np
;
struct
resource
r
;
...
...
@@ -55,10 +56,10 @@ static int zap_shader_load_mdt(struct device *dev, const char *fwname)
mem_size
=
resource_size
(
&
r
);
/* Request the MDT file for the firmware */
ret
=
request_firmware
(
&
fw
,
fwname
,
dev
);
if
(
ret
)
{
fw
=
adreno_request_fw
(
to_adreno_gpu
(
gpu
),
fwname
);
if
(
IS_ERR
(
fw
)
)
{
DRM_DEV_ERROR
(
dev
,
"Unable to load %s
\n
"
,
fwname
);
return
ret
;
return
PTR_ERR
(
fw
)
;
}
/* Figure out how much memory we need */
...
...
@@ -381,7 +382,7 @@ static int a5xx_zap_shader_init(struct msm_gpu *gpu)
return
-
ENODEV
;
}
ret
=
zap_shader_load_mdt
(
&
pdev
->
dev
,
adreno_gpu
->
info
->
zapfw
);
ret
=
zap_shader_load_mdt
(
gpu
,
adreno_gpu
->
info
->
zapfw
);
loaded
=
!
ret
;
...
...
drivers/gpu/drm/msm/adreno/a5xx_power.c
浏览文件 @
e8f3de96
...
...
@@ -264,7 +264,8 @@ void a5xx_gpmu_ucode_init(struct msm_gpu *gpu)
return
;
/* Get the firmware */
if
(
request_firmware
(
&
fw
,
adreno_gpu
->
info
->
gpmufw
,
drm
->
dev
))
{
fw
=
adreno_request_fw
(
adreno_gpu
,
adreno_gpu
->
info
->
gpmufw
);
if
(
IS_ERR
(
fw
))
{
DRM_ERROR
(
"%s: Could not get GPMU firmware. GPMU will not be active
\n
"
,
gpu
->
name
);
return
;
...
...
drivers/gpu/drm/msm/adreno/adreno_gpu.c
浏览文件 @
e8f3de96
...
...
@@ -64,29 +64,41 @@ int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value)
}
}
static
int
adreno_load_fw
(
struct
adreno_gpu
*
adreno_gpu
)
const
struct
firmware
*
adreno_request_fw
(
struct
adreno_gpu
*
adreno_gpu
,
const
char
*
fwname
)
{
struct
drm_device
*
drm
=
adreno_gpu
->
base
.
dev
;
const
struct
firmware
*
fw
=
NULL
;
int
ret
;
ret
=
request_firmware
(
&
fw
,
fwname
,
drm
->
dev
);
if
(
ret
)
{
dev_err
(
drm
->
dev
,
"failed to load %s: %d
\n
"
,
fwname
,
ret
);
return
ERR_PTR
(
ret
);
}
return
fw
;
}
static
int
adreno_load_fw
(
struct
adreno_gpu
*
adreno_gpu
)
{
const
struct
firmware
*
fw
;
if
(
adreno_gpu
->
pm4
)
return
0
;
ret
=
request_firmware
(
&
adreno_gpu
->
pm4
,
adreno_gpu
->
info
->
pm4fw
,
drm
->
dev
);
if
(
ret
)
{
dev_err
(
drm
->
dev
,
"failed to load %s PM4 firmware: %d
\n
"
,
adreno_gpu
->
info
->
pm4fw
,
ret
);
return
ret
;
}
fw
=
adreno_request_fw
(
adreno_gpu
,
adreno_gpu
->
info
->
pm4fw
);
if
(
IS_ERR
(
fw
))
return
PTR_ERR
(
fw
);
adreno_gpu
->
pm4
=
fw
;
ret
=
request_firmware
(
&
adreno_gpu
->
pfp
,
adreno_gpu
->
info
->
pfpfw
,
drm
->
dev
);
if
(
ret
)
{
dev_err
(
drm
->
dev
,
"failed to load %s PFP firmware: %d
\n
"
,
adreno_gpu
->
info
->
pfpfw
,
ret
);
fw
=
adreno_request_fw
(
adreno_gpu
,
adreno_gpu
->
info
->
pfpfw
);
if
(
IS_ERR
(
fw
))
{
release_firmware
(
adreno_gpu
->
pm4
);
adreno_gpu
->
pm4
=
NULL
;
return
ret
;
return
PTR_ERR
(
fw
)
;
}
adreno_gpu
->
pfp
=
fw
;
return
0
;
}
...
...
drivers/gpu/drm/msm/adreno/adreno_gpu.h
浏览文件 @
e8f3de96
...
...
@@ -196,6 +196,8 @@ static inline int adreno_is_a530(struct adreno_gpu *gpu)
}
int
adreno_get_param
(
struct
msm_gpu
*
gpu
,
uint32_t
param
,
uint64_t
*
value
);
const
struct
firmware
*
adreno_request_fw
(
struct
adreno_gpu
*
adreno_gpu
,
const
char
*
fwname
);
int
adreno_hw_init
(
struct
msm_gpu
*
gpu
);
uint32_t
adreno_last_fence
(
struct
msm_gpu
*
gpu
);
void
adreno_recover
(
struct
msm_gpu
*
gpu
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录