Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
cd459e77
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看板
提交
cd459e77
编写于
8月 20, 2015
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/sw/nv04: replace direct context access with GetRef method
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
1d2a1e53
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
65 addition
and
10 deletion
+65
-10
drivers/gpu/drm/nouveau/include/nvif/class.h
drivers/gpu/drm/nouveau/include/nvif/class.h
+12
-0
drivers/gpu/drm/nouveau/include/nvif/device.h
drivers/gpu/drm/nouveau/include/nvif/device.h
+0
-1
drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
+0
-1
drivers/gpu/drm/nouveau/nv04_fence.c
drivers/gpu/drm/nouveau/nv04_fence.c
+4
-2
drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c
drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c
+49
-6
未找到文件。
drivers/gpu/drm/nouveau/include/nvif/class.h
浏览文件 @
cd459e77
...
...
@@ -580,6 +580,18 @@ struct nv50_disp_overlay_v0 {
#define NV50_DISP_OVERLAY_V0_NTFY_UEVENT 0x00
/*******************************************************************************
* software
******************************************************************************/
#define NV04_NVSW_GET_REF 0x00
struct
nv04_nvsw_get_ref_v0
{
__u8
version
;
__u8
pad01
[
3
];
__u32
ref
;
};
/*******************************************************************************
* fermi
******************************************************************************/
...
...
drivers/gpu/drm/nouveau/include/nvif/device.h
浏览文件 @
cd459e77
...
...
@@ -65,6 +65,5 @@ u64 nvif_device_time(struct nvif_device *);
#include <engine/sw.h>
#define nvxx_fifo(a) nvkm_fifo(nvxx_device(a))
#define nvxx_fifo_chan(a) ((struct nvkm_fifo_chan *)nvxx_object(a))
#define nvxx_gr(a) nvkm_gr(nvxx_device(a))
#endif
drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
浏览文件 @
cd459e77
...
...
@@ -9,7 +9,6 @@ struct nvkm_fifo_chan {
u64
addr
;
u32
size
;
u16
chid
;
atomic_t
refcnt
;
/* NV04_NVSW_SET_REF */
};
static
inline
struct
nvkm_fifo_chan
*
...
...
drivers/gpu/drm/nouveau/nv04_fence.c
浏览文件 @
cd459e77
...
...
@@ -57,8 +57,10 @@ nv04_fence_sync(struct nouveau_fence *fence,
static
u32
nv04_fence_read
(
struct
nouveau_channel
*
chan
)
{
struct
nvkm_fifo_chan
*
fifo
=
nvxx_fifo_chan
(
&
chan
->
user
);
return
atomic_read
(
&
fifo
->
refcnt
);
struct
nv04_nvsw_get_ref_v0
args
=
{};
WARN_ON
(
nvif_object_mthd
(
&
chan
->
nvsw
,
NV04_NVSW_GET_REF
,
&
args
,
sizeof
(
args
)));
return
args
.
ref
;
}
static
void
...
...
drivers/gpu/drm/nouveau/nvkm/engine/sw/nv04.c
浏览文件 @
cd459e77
...
...
@@ -22,9 +22,15 @@
* Authors: Ben Skeggs
*/
#include <engine/sw.h>
#include <engine/fifo.h>
#include <nvif/class.h>
#include <nvif/ioctl.h>
#include <nvif/unpack.h>
struct
nv04_sw_chan
{
struct
nvkm_sw_chan
base
;
atomic_t
ref
;
};
/*******************************************************************************
* software object classes
...
...
@@ -33,9 +39,8 @@
static
int
nv04_sw_set_ref
(
struct
nvkm_object
*
object
,
u32
mthd
,
void
*
data
,
u32
size
)
{
struct
nvkm_object
*
channel
=
(
void
*
)
nv_engctx
(
object
->
parent
);
struct
nvkm_fifo_chan
*
fifo
=
(
void
*
)
channel
->
parent
;
atomic_set
(
&
fifo
->
refcnt
,
*
(
u32
*
)
data
);
struct
nv04_sw_chan
*
chan
=
(
void
*
)
nv_engctx
(
object
->
parent
);
atomic_set
(
&
chan
->
ref
,
*
(
u32
*
)
data
);
return
0
;
}
...
...
@@ -55,9 +60,46 @@ nv04_sw_omthds[] = {
{}
};
static
int
nv04_sw_mthd_get_ref
(
struct
nvkm_object
*
object
,
void
*
data
,
u32
size
)
{
struct
nv04_sw_chan
*
chan
=
(
void
*
)
object
->
parent
;
union
{
struct
nv04_nvsw_get_ref_v0
v0
;
}
*
args
=
data
;
int
ret
;
if
(
nvif_unpack
(
args
->
v0
,
0
,
0
,
false
))
{
args
->
v0
.
ref
=
atomic_read
(
&
chan
->
ref
);
}
return
ret
;
}
static
int
nv04_sw_mthd
(
struct
nvkm_object
*
object
,
u32
mthd
,
void
*
data
,
u32
size
)
{
switch
(
mthd
)
{
case
NV04_NVSW_GET_REF
:
return
nv04_sw_mthd_get_ref
(
object
,
data
,
size
);
default:
break
;
}
return
-
EINVAL
;
}
static
struct
nvkm_ofuncs
nv04_sw_ofuncs
=
{
.
ctor
=
_nvkm_object_ctor
,
.
dtor
=
nvkm_object_destroy
,
.
init
=
_nvkm_object_init
,
.
fini
=
_nvkm_object_fini
,
.
mthd
=
nv04_sw_mthd
,
};
static
struct
nvkm_oclass
nv04_sw_sclass
[]
=
{
{
NVIF_IOCTL_NEW_V0_SW_NV04
,
&
nv
km_object
_ofuncs
,
nv04_sw_omthds
},
{
NVIF_IOCTL_NEW_V0_SW_NV04
,
&
nv
04_sw
_ofuncs
,
nv04_sw_omthds
},
{}
};
...
...
@@ -70,7 +112,7 @@ nv04_sw_context_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_object
**
pobject
)
{
struct
nv
km
_sw_chan
*
chan
;
struct
nv
04
_sw_chan
*
chan
;
int
ret
;
ret
=
nvkm_sw_context_create
(
parent
,
engine
,
oclass
,
&
chan
);
...
...
@@ -78,6 +120,7 @@ nv04_sw_context_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
ret
)
return
ret
;
atomic_set
(
&
chan
->
ref
,
0
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录