Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
ceac3099
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看板
提交
ceac3099
编写于
11月 23, 2010
作者:
B
Ben Skeggs
提交者:
Francisco Jerez
12月 08, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: implicitly insert non-DMA objects into RAMHT
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
d908175c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
43 addition
and
80 deletion
+43
-80
drivers/gpu/drm/nouveau/nouveau_dma.c
drivers/gpu/drm/nouveau/nouveau_dma.c
+2
-8
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-2
drivers/gpu/drm/nouveau/nouveau_fence.c
drivers/gpu/drm/nouveau/nouveau_fence.c
+1
-6
drivers/gpu/drm/nouveau/nouveau_object.c
drivers/gpu/drm/nouveau/nouveau_object.c
+27
-32
drivers/gpu/drm/nouveau/nv04_fbcon.c
drivers/gpu/drm/nouveau/nv04_fbcon.c
+10
-24
drivers/gpu/drm/nouveau/nv50_fbcon.c
drivers/gpu/drm/nouveau/nv50_fbcon.c
+2
-8
未找到文件。
drivers/gpu/drm/nouveau/nouveau_dma.c
浏览文件 @
ceac3099
...
...
@@ -59,17 +59,11 @@ nouveau_dma_init(struct nouveau_channel *chan)
{
struct
drm_device
*
dev
=
chan
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_gpuobj
*
obj
=
NULL
;
int
ret
,
i
;
/* Create NV_MEMORY_TO_MEMORY_FORMAT for buffer moves */
ret
=
nouveau_gpuobj_gr_new
(
chan
,
dev_priv
->
card_type
<
NV_50
?
0x0039
:
0x5039
,
&
obj
);
if
(
ret
)
return
ret
;
ret
=
nouveau_ramht_insert
(
chan
,
NvM2MF
,
obj
);
nouveau_gpuobj_ref
(
NULL
,
&
obj
);
ret
=
nouveau_gpuobj_gr_new
(
chan
,
NvM2MF
,
dev_priv
->
card_type
<
NV_50
?
0x0039
:
0x5039
);
if
(
ret
)
return
ret
;
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
ceac3099
...
...
@@ -887,8 +887,7 @@ extern int nouveau_gpuobj_new_fake(struct drm_device *, u32 pinst, u64 vinst,
extern
int
nouveau_gpuobj_dma_new
(
struct
nouveau_channel
*
,
int
class
,
uint64_t
offset
,
uint64_t
size
,
int
access
,
int
target
,
struct
nouveau_gpuobj
**
);
extern
int
nouveau_gpuobj_gr_new
(
struct
nouveau_channel
*
,
int
class
,
struct
nouveau_gpuobj
**
);
extern
int
nouveau_gpuobj_gr_new
(
struct
nouveau_channel
*
,
u32
handle
,
int
class
);
extern
int
nv50_gpuobj_dma_new
(
struct
nouveau_channel
*
,
int
class
,
u64
base
,
u64
size
,
int
target
,
int
access
,
u32
type
,
u32
comp
,
struct
nouveau_gpuobj
**
pobj
);
...
...
drivers/gpu/drm/nouveau/nouveau_fence.c
浏览文件 @
ceac3099
...
...
@@ -438,12 +438,7 @@ nouveau_fence_channel_init(struct nouveau_channel *chan)
int
ret
;
/* Create an NV_SW object for various sync purposes */
ret
=
nouveau_gpuobj_gr_new
(
chan
,
NV_SW
,
&
obj
);
if
(
ret
)
return
ret
;
ret
=
nouveau_ramht_insert
(
chan
,
NvSw
,
obj
);
nouveau_gpuobj_ref
(
NULL
,
&
obj
);
ret
=
nouveau_gpuobj_gr_new
(
chan
,
NvSw
,
NV_SW
);
if
(
ret
)
return
ret
;
...
...
drivers/gpu/drm/nouveau/nouveau_object.c
浏览文件 @
ceac3099
...
...
@@ -608,13 +608,9 @@ static int
nouveau_gpuobj_sw_new
(
struct
nouveau_channel
*
chan
,
int
class
,
struct
nouveau_gpuobj
**
gpuobj_ret
)
{
struct
drm_nouveau_private
*
dev_priv
;
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
nouveau_gpuobj
*
gpuobj
;
if
(
!
chan
||
!
gpuobj_ret
||
*
gpuobj_ret
!=
NULL
)
return
-
EINVAL
;
dev_priv
=
chan
->
dev
->
dev_private
;
gpuobj
=
kzalloc
(
sizeof
(
*
gpuobj
),
GFP_KERNEL
);
if
(
!
gpuobj
)
return
-
ENOMEM
;
...
...
@@ -632,12 +628,12 @@ nouveau_gpuobj_sw_new(struct nouveau_channel *chan, int class,
}
int
nouveau_gpuobj_gr_new
(
struct
nouveau_channel
*
chan
,
int
class
,
struct
nouveau_gpuobj
**
gpuobj
)
nouveau_gpuobj_gr_new
(
struct
nouveau_channel
*
chan
,
u32
handle
,
int
class
)
{
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
drm_device
*
dev
=
chan
->
dev
;
struct
nouveau_gpuobj_class
*
oc
;
struct
nouveau_gpuobj
*
gpuobj
;
int
ret
;
NV_DEBUG
(
dev
,
"ch%d class=0x%04x
\n
"
,
chan
->
id
,
class
);
...
...
@@ -651,10 +647,12 @@ nouveau_gpuobj_gr_new(struct nouveau_channel *chan, int class,
return
-
EINVAL
;
found:
if
(
oc
->
engine
==
NVOBJ_ENGINE_SW
)
return
nouveau_gpuobj_sw_new
(
chan
,
class
,
gpuobj
);
switch
(
oc
->
engine
)
{
case
NVOBJ_ENGINE_SW
:
ret
=
nouveau_gpuobj_sw_new
(
chan
,
class
,
&
gpuobj
);
if
(
ret
)
return
ret
;
goto
insert
;
case
NVOBJ_ENGINE_GR
:
if
(
dev_priv
->
card_type
>=
NV_50
&&
!
chan
->
ramin_grctx
)
{
struct
nouveau_pgraph_engine
*
pgraph
=
...
...
@@ -681,41 +679,47 @@ nouveau_gpuobj_gr_new(struct nouveau_channel *chan, int class,
nouveau_gpuobj_class_instmem_size
(
dev
,
class
),
16
,
NVOBJ_FLAG_ZERO_ALLOC
|
NVOBJ_FLAG_ZERO_FREE
,
gpuobj
);
&
gpuobj
);
if
(
ret
)
{
NV_ERROR
(
dev
,
"error creating gpuobj: %d
\n
"
,
ret
);
return
ret
;
}
if
(
dev_priv
->
card_type
>=
NV_50
)
{
nv_wo32
(
*
gpuobj
,
0
,
class
);
nv_wo32
(
*
gpuobj
,
20
,
0x00010000
);
nv_wo32
(
gpuobj
,
0
,
class
);
nv_wo32
(
gpuobj
,
20
,
0x00010000
);
}
else
{
switch
(
class
)
{
case
NV_CLASS_NULL
:
nv_wo32
(
*
gpuobj
,
0
,
0x00001030
);
nv_wo32
(
*
gpuobj
,
4
,
0xFFFFFFFF
);
nv_wo32
(
gpuobj
,
0
,
0x00001030
);
nv_wo32
(
gpuobj
,
4
,
0xFFFFFFFF
);
break
;
default:
if
(
dev_priv
->
card_type
>=
NV_40
)
{
nv_wo32
(
*
gpuobj
,
0
,
class
);
nv_wo32
(
gpuobj
,
0
,
class
);
#ifdef __BIG_ENDIAN
nv_wo32
(
*
gpuobj
,
8
,
0x01000000
);
nv_wo32
(
gpuobj
,
8
,
0x01000000
);
#endif
}
else
{
#ifdef __BIG_ENDIAN
nv_wo32
(
*
gpuobj
,
0
,
class
|
0x00080000
);
nv_wo32
(
gpuobj
,
0
,
class
|
0x00080000
);
#else
nv_wo32
(
*
gpuobj
,
0
,
class
);
nv_wo32
(
gpuobj
,
0
,
class
);
#endif
}
}
}
dev_priv
->
engine
.
instmem
.
flush
(
dev
);
(
*
gpuobj
)
->
engine
=
oc
->
engine
;
(
*
gpuobj
)
->
class
=
oc
->
id
;
return
0
;
gpuobj
->
engine
=
oc
->
engine
;
gpuobj
->
class
=
oc
->
id
;
insert:
ret
=
nouveau_ramht_insert
(
chan
,
handle
,
gpuobj
);
if
(
ret
)
NV_ERROR
(
dev
,
"error adding gpuobj to RAMHT: %d
\n
"
,
ret
);
nouveau_gpuobj_ref
(
NULL
,
&
gpuobj
);
return
ret
;
}
static
int
...
...
@@ -971,7 +975,6 @@ int nouveau_ioctl_grobj_alloc(struct drm_device *dev, void *data,
struct
drm_file
*
file_priv
)
{
struct
drm_nouveau_grobj_alloc
*
init
=
data
;
struct
nouveau_gpuobj
*
gr
=
NULL
;
struct
nouveau_channel
*
chan
;
int
ret
;
...
...
@@ -987,18 +990,10 @@ int nouveau_ioctl_grobj_alloc(struct drm_device *dev, void *data,
goto
out
;
}
ret
=
nouveau_gpuobj_gr_new
(
chan
,
init
->
class
,
&
gr
);
ret
=
nouveau_gpuobj_gr_new
(
chan
,
init
->
handle
,
init
->
class
);
if
(
ret
)
{
NV_ERROR
(
dev
,
"Error creating object: %d (%d/0x%08x)
\n
"
,
ret
,
init
->
channel
,
init
->
handle
);
goto
out
;
}
ret
=
nouveau_ramht_insert
(
chan
,
init
->
handle
,
gr
);
nouveau_gpuobj_ref
(
NULL
,
&
gr
);
if
(
ret
)
{
NV_ERROR
(
dev
,
"Error referencing object: %d (%d/0x%08x)
\n
"
,
ret
,
init
->
channel
,
init
->
handle
);
}
out:
...
...
drivers/gpu/drm/nouveau/nv04_fbcon.c
浏览文件 @
ceac3099
...
...
@@ -137,22 +137,6 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
return
0
;
}
static
int
nv04_fbcon_grobj_new
(
struct
drm_device
*
dev
,
int
class
,
uint32_t
handle
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_gpuobj
*
obj
=
NULL
;
int
ret
;
ret
=
nouveau_gpuobj_gr_new
(
dev_priv
->
channel
,
class
,
&
obj
);
if
(
ret
)
return
ret
;
ret
=
nouveau_ramht_insert
(
dev_priv
->
channel
,
handle
,
obj
);
nouveau_gpuobj_ref
(
NULL
,
&
obj
);
return
ret
;
}
int
nv04_fbcon_accel_init
(
struct
fb_info
*
info
)
{
...
...
@@ -192,29 +176,31 @@ nv04_fbcon_accel_init(struct fb_info *info)
return
-
EINVAL
;
}
ret
=
nv04_fbcon_grobj_new
(
dev
,
dev_priv
->
card_type
>=
NV_10
?
0x0062
:
0x0042
,
NvCtxSurf2D
);
ret
=
nouveau_gpuobj_gr_new
(
chan
,
NvCtxSurf2D
,
dev_priv
->
card_type
>=
NV_10
?
0x0062
:
0x0042
);
if
(
ret
)
return
ret
;
ret
=
n
v04_fbcon_grobj_new
(
dev
,
0x0019
,
NvClipRect
);
ret
=
n
ouveau_gpuobj_gr_new
(
chan
,
NvClipRect
,
0x0019
);
if
(
ret
)
return
ret
;
ret
=
n
v04_fbcon_grobj_new
(
dev
,
0x0043
,
NvRop
);
ret
=
n
ouveau_gpuobj_gr_new
(
chan
,
NvRop
,
0x0043
);
if
(
ret
)
return
ret
;
ret
=
n
v04_fbcon_grobj_new
(
dev
,
0x0044
,
NvImagePatt
);
ret
=
n
ouveau_gpuobj_gr_new
(
chan
,
NvImagePatt
,
0x0044
);
if
(
ret
)
return
ret
;
ret
=
n
v04_fbcon_grobj_new
(
dev
,
0x004a
,
NvGdiRect
);
ret
=
n
ouveau_gpuobj_gr_new
(
chan
,
NvGdiRect
,
0x004a
);
if
(
ret
)
return
ret
;
ret
=
nv04_fbcon_grobj_new
(
dev
,
dev_priv
->
chipset
>=
0x11
?
0x009f
:
0x005f
,
NvImageBlit
);
ret
=
nouveau_gpuobj_gr_new
(
chan
,
NvImageBlit
,
dev_priv
->
chipset
>=
0x11
?
0x009f
:
0x005f
);
if
(
ret
)
return
ret
;
...
...
drivers/gpu/drm/nouveau/nv50_fbcon.c
浏览文件 @
ceac3099
...
...
@@ -134,9 +134,8 @@ nv50_fbcon_accel_init(struct fb_info *info)
struct
drm_device
*
dev
=
nfbdev
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_channel
*
chan
=
dev_priv
->
channel
;
struct
nouveau_gpuobj
*
eng2d
=
NULL
;
uint64_t
fb
;
int
ret
,
format
;
uint64_t
fb
;
fb
=
info
->
fix
.
smem_start
-
dev_priv
->
fb_phys
+
dev_priv
->
vm_vram_base
;
...
...
@@ -167,12 +166,7 @@ nv50_fbcon_accel_init(struct fb_info *info)
return
-
EINVAL
;
}
ret
=
nouveau_gpuobj_gr_new
(
dev_priv
->
channel
,
0x502d
,
&
eng2d
);
if
(
ret
)
return
ret
;
ret
=
nouveau_ramht_insert
(
dev_priv
->
channel
,
Nv2D
,
eng2d
);
nouveau_gpuobj_ref
(
NULL
,
&
eng2d
);
ret
=
nouveau_gpuobj_gr_new
(
dev_priv
->
channel
,
Nv2D
,
0x502d
);
if
(
ret
)
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录