Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
75faef78
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
162
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看板
提交
75faef78
编写于
11年前
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nv50-nvaf/fb: split fbram oclass in preparation for reclocking
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
20cdeaf9
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
184 addition
and
52 deletion
+184
-52
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+2
-0
drivers/gpu/drm/nouveau/core/subdev/fb/nv50.h
drivers/gpu/drm/nouveau/core/subdev/fb/nv50.h
+7
-0
drivers/gpu/drm/nouveau/core/subdev/fb/nva3.c
drivers/gpu/drm/nouveau/core/subdev/fb/nva3.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/fb/nvaa.c
drivers/gpu/drm/nouveau/core/subdev/fb/nvaa.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/fb/nvaf.c
drivers/gpu/drm/nouveau/core/subdev/fb/nvaf.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/fb/priv.h
drivers/gpu/drm/nouveau/core/subdev/fb/priv.h
+2
-0
drivers/gpu/drm/nouveau/core/subdev/fb/ramnv50.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramnv50.c
+49
-49
drivers/gpu/drm/nouveau/core/subdev/fb/ramnva3.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramnva3.c
+55
-0
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvaa.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvaa.c
+66
-0
未找到文件。
drivers/gpu/drm/nouveau/Makefile
浏览文件 @
75faef78
...
...
@@ -93,6 +93,8 @@ nouveau-y += core/subdev/fb/ramnv44.o
nouveau-y
+=
core/subdev/fb/ramnv49.o
nouveau-y
+=
core/subdev/fb/ramnv4e.o
nouveau-y
+=
core/subdev/fb/ramnv50.o
nouveau-y
+=
core/subdev/fb/ramnva3.o
nouveau-y
+=
core/subdev/fb/ramnvaa.o
nouveau-y
+=
core/subdev/fb/ramnvc0.o
nouveau-y
+=
core/subdev/gpio/base.o
nouveau-y
+=
core/subdev/gpio/nv10.o
...
...
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/core/subdev/fb/nv50.h
浏览文件 @
75faef78
...
...
@@ -20,6 +20,13 @@ struct nv50_fb_impl {
u32
trap
;
};
#define nv50_ram_create(p,e,o,d) \
nv50_ram_create_((p), (e), (o), sizeof(**d), (void **)d)
int
nv50_ram_create_
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
int
,
void
**
);
int
nv50_ram_get
(
struct
nouveau_fb
*
,
u64
size
,
u32
align
,
u32
ncmin
,
u32
memtype
,
struct
nouveau_mem
**
);
void
nv50_ram_put
(
struct
nouveau_fb
*
,
struct
nouveau_mem
**
);
void
__nv50_ram_put
(
struct
nouveau_fb
*
,
struct
nouveau_mem
*
);
extern
int
nv50_fb_memtype
[
0x80
];
...
...
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/core/subdev/fb/nva3.c
浏览文件 @
75faef78
...
...
@@ -34,6 +34,6 @@ nva3_fb_oclass = &(struct nv50_fb_impl) {
.
fini
=
_nouveau_fb_fini
,
},
.
base
.
memtype
=
nv50_fb_memtype_valid
,
.
base
.
ram
=
&
nv
50
_ram_oclass
,
.
base
.
ram
=
&
nv
a3
_ram_oclass
,
.
trap
=
0x000d0fff
,
}.
base
.
base
;
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/core/subdev/fb/nvaa.c
浏览文件 @
75faef78
...
...
@@ -34,6 +34,6 @@ nvaa_fb_oclass = &(struct nv50_fb_impl) {
.
fini
=
_nouveau_fb_fini
,
},
.
base
.
memtype
=
nv50_fb_memtype_valid
,
.
base
.
ram
=
&
nv
50
_ram_oclass
,
.
base
.
ram
=
&
nv
aa
_ram_oclass
,
.
trap
=
0x001d07ff
,
}.
base
.
base
;
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/core/subdev/fb/nvaf.c
浏览文件 @
75faef78
...
...
@@ -34,6 +34,6 @@ nvaf_fb_oclass = &(struct nv50_fb_impl) {
.
fini
=
_nouveau_fb_fini
,
},
.
base
.
memtype
=
nv50_fb_memtype_valid
,
.
base
.
ram
=
&
nv
50
_ram_oclass
,
.
base
.
ram
=
&
nv
aa
_ram_oclass
,
.
trap
=
0x089d1fff
,
}.
base
.
base
;
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/core/subdev/fb/priv.h
浏览文件 @
75faef78
...
...
@@ -12,6 +12,8 @@
#define nouveau_ram_fini(p,s) \
nouveau_object_fini(&(p)->base, (s))
#define nouveau_ram_create_(p,e,o,s,d) \
nouveau_object_create_((p), (e), (o), 0, (s), (void **)d)
#define _nouveau_ram_dtor nouveau_object_destroy
#define _nouveau_ram_init nouveau_object_init
#define _nouveau_ram_fini nouveau_object_fini
...
...
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/core/subdev/fb/ramnv50.c
浏览文件 @
75faef78
...
...
@@ -27,6 +27,10 @@
#include "nv50.h"
struct
nv50_ram
{
struct
nouveau_ram
base
;
};
void
__nv50_ram_put
(
struct
nouveau_fb
*
pfb
,
struct
nouveau_mem
*
mem
)
{
...
...
@@ -58,7 +62,7 @@ nv50_ram_put(struct nouveau_fb *pfb, struct nouveau_mem **pmem)
kfree
(
mem
);
}
static
int
int
nv50_ram_get
(
struct
nouveau_fb
*
pfb
,
u64
size
,
u32
align
,
u32
ncmin
,
u32
memtype
,
struct
nouveau_mem
**
pmem
)
{
...
...
@@ -161,77 +165,73 @@ nv50_fb_vram_rblock(struct nouveau_fb *pfb, struct nouveau_ram *ram)
return
rblock_size
;
}
static
int
nv50_ram_create
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
datasize
,
struct
nouveau_object
**
pobject
)
int
nv50_ram_create_
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
int
length
,
void
**
pobject
)
{
struct
nouveau_fb
*
pfb
=
nouveau_fb
(
parent
);
struct
nouveau_device
*
device
=
nv_device
(
pfb
);
struct
nouveau_bios
*
bios
=
nouveau_bios
(
device
);
struct
nouveau_ram
*
ram
;
const
u32
rsvd_head
=
(
256
*
1024
)
>>
12
;
/* vga memory */
const
u32
rsvd_tail
=
(
1024
*
1024
)
>>
12
;
/* vbios etc */
u32
size
;
struct
nouveau_bios
*
bios
=
nouveau_bios
(
parent
);
struct
nouveau_fb
*
pfb
=
nouveau_fb
(
parent
);
struct
nouveau_ram
*
ram
;
int
ret
;
ret
=
nouveau_ram_create
(
parent
,
engine
,
oclass
,
&
ram
);
*
pobject
=
nv_object
(
ram
)
;
ret
=
nouveau_ram_create
_
(
parent
,
engine
,
oclass
,
length
,
pobject
);
ram
=
*
pobject
;
if
(
ret
)
return
ret
;
ram
->
size
=
nv_rd32
(
pfb
,
0x10020c
);
ram
->
size
=
(
ram
->
size
&
0xffffff00
)
|
((
ram
->
size
&
0x000000ff
)
<<
32
);
size
=
(
ram
->
size
>>
12
)
-
rsvd_head
-
rsvd_tail
;
switch
(
device
->
chipset
)
{
case
0xaa
:
case
0xac
:
case
0xaf
:
/* IGPs, no reordering, no real VRAM */
ret
=
nouveau_mm_init
(
&
pfb
->
vram
,
rsvd_head
,
size
,
1
);
if
(
ret
)
return
ret
;
ram
->
size
=
(
ram
->
size
&
0xffffff00
)
|
((
ram
->
size
&
0x000000ff
)
<<
32
);
ram
->
type
=
NV_MEM_TYPE_STOLEN
;
ram
->
stolen
=
(
u64
)
nv_rd32
(
pfb
,
0x100e10
)
<<
12
;
switch
(
nv_rd32
(
pfb
,
0x100714
)
&
0x00000007
)
{
case
0
:
ram
->
type
=
NV_MEM_TYPE_DDR1
;
break
;
case
1
:
if
(
nouveau_fb_bios_memtype
(
bios
)
==
NV_MEM_TYPE_DDR3
)
ram
->
type
=
NV_MEM_TYPE_DDR3
;
else
ram
->
type
=
NV_MEM_TYPE_DDR2
;
break
;
case
2
:
ram
->
type
=
NV_MEM_TYPE_GDDR3
;
break
;
case
3
:
ram
->
type
=
NV_MEM_TYPE_GDDR4
;
break
;
case
4
:
ram
->
type
=
NV_MEM_TYPE_GDDR5
;
break
;
default:
switch
(
nv_rd32
(
pfb
,
0x100714
)
&
0x00000007
)
{
case
0
:
ram
->
type
=
NV_MEM_TYPE_DDR1
;
break
;
case
1
:
if
(
nouveau_fb_bios_memtype
(
bios
)
==
NV_MEM_TYPE_DDR3
)
ram
->
type
=
NV_MEM_TYPE_DDR3
;
else
ram
->
type
=
NV_MEM_TYPE_DDR2
;
break
;
case
2
:
ram
->
type
=
NV_MEM_TYPE_GDDR3
;
break
;
case
3
:
ram
->
type
=
NV_MEM_TYPE_GDDR4
;
break
;
case
4
:
ram
->
type
=
NV_MEM_TYPE_GDDR5
;
break
;
default:
break
;
}
ret
=
nouveau_mm_init
(
&
pfb
->
vram
,
rsvd_head
,
size
,
nv50_fb_vram_rblock
(
pfb
,
ram
)
>>
12
);
if
(
ret
)
return
ret
;
ram
->
ranks
=
(
nv_rd32
(
pfb
,
0x100200
)
&
0x4
)
?
2
:
1
;
ram
->
tags
=
nv_rd32
(
pfb
,
0x100320
);
break
;
}
ret
=
nouveau_mm_init
(
&
pfb
->
vram
,
rsvd_head
,
(
ram
->
size
>>
12
)
-
(
rsvd_head
+
rsvd_tail
),
nv50_fb_vram_rblock
(
pfb
,
ram
)
>>
12
);
if
(
ret
)
return
ret
;
ram
->
ranks
=
(
nv_rd32
(
pfb
,
0x100200
)
&
0x4
)
?
2
:
1
;
ram
->
tags
=
nv_rd32
(
pfb
,
0x100320
);
ram
->
get
=
nv50_ram_get
;
ram
->
put
=
nv50_ram_put
;
return
0
;
}
static
int
nv50_ram_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
datasize
,
struct
nouveau_object
**
pobject
)
{
struct
nv50_ram
*
ram
;
int
ret
;
ret
=
nv50_ram_create
(
parent
,
engine
,
oclass
,
&
ram
);
*
pobject
=
nv_object
(
ram
);
if
(
ret
)
return
ret
;
return
0
;
}
struct
nouveau_oclass
nv50_ram_oclass
=
{
.
handle
=
0
,
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nv50_ram_c
reate
,
.
ctor
=
nv50_ram_c
tor
,
.
dtor
=
_nouveau_ram_dtor
,
.
init
=
_nouveau_ram_init
,
.
fini
=
_nouveau_ram_fini
,
...
...
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/core/subdev/fb/ramnva3.c
0 → 100644
浏览文件 @
75faef78
/*
* Copyright 2013 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "nv50.h"
struct
nva3_ram
{
struct
nouveau_ram
base
;
};
static
int
nva3_ram_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
datasize
,
struct
nouveau_object
**
pobject
)
{
struct
nva3_ram
*
ram
;
int
ret
;
ret
=
nv50_ram_create
(
parent
,
engine
,
oclass
,
&
ram
);
*
pobject
=
nv_object
(
ram
);
if
(
ret
)
return
ret
;
return
0
;
}
struct
nouveau_oclass
nva3_ram_oclass
=
{
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nva3_ram_ctor
,
.
dtor
=
_nouveau_ram_dtor
,
.
init
=
_nouveau_ram_init
,
.
fini
=
_nouveau_ram_fini
,
},
};
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvaa.c
0 → 100644
浏览文件 @
75faef78
/*
* Copyright 2013 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "nv50.h"
static
int
nvaa_ram_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
datasize
,
struct
nouveau_object
**
pobject
)
{
const
u32
rsvd_head
=
(
256
*
1024
)
>>
12
;
/* vga memory */
const
u32
rsvd_tail
=
(
1024
*
1024
)
>>
12
;
/* vbios etc */
struct
nouveau_fb
*
pfb
=
nouveau_fb
(
parent
);
struct
nouveau_ram
*
ram
;
int
ret
;
ret
=
nouveau_ram_create
(
parent
,
engine
,
oclass
,
&
ram
);
*
pobject
=
nv_object
(
ram
);
if
(
ret
)
return
ret
;
ram
->
size
=
nv_rd32
(
pfb
,
0x10020c
);
ram
->
size
=
(
ram
->
size
&
0xffffff00
)
|
((
ram
->
size
&
0x000000ff
)
<<
32
);
ret
=
nouveau_mm_init
(
&
pfb
->
vram
,
rsvd_head
,
(
ram
->
size
>>
12
)
-
(
rsvd_head
+
rsvd_tail
),
1
);
if
(
ret
)
return
ret
;
ram
->
type
=
NV_MEM_TYPE_STOLEN
;
ram
->
stolen
=
(
u64
)
nv_rd32
(
pfb
,
0x100e10
)
<<
12
;
ram
->
get
=
nv50_ram_get
;
ram
->
put
=
nv50_ram_put
;
return
0
;
}
struct
nouveau_oclass
nvaa_ram_oclass
=
{
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nvaa_ram_ctor
,
.
dtor
=
_nouveau_ram_dtor
,
.
init
=
_nouveau_ram_init
,
.
fini
=
_nouveau_ram_fini
,
},
};
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部