Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
c64f7ba5
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
c64f7ba5
编写于
11月 23, 2010
作者:
C
Chris Wilson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
agp/intel: Remove confusion of stolen entries not stolen memory
Signed-off-by:
N
Chris Wilson
<
chris@chris-wilson.co.uk
>
上级
1b6064d7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
42 deletion
+15
-42
drivers/char/agp/intel-gtt.c
drivers/char/agp/intel-gtt.c
+7
-33
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_dma.c
+2
-2
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_drv.h
+1
-1
include/drm/intel-gtt.h
include/drm/intel-gtt.h
+5
-6
未找到文件。
drivers/char/agp/intel-gtt.c
浏览文件 @
c64f7ba5
...
...
@@ -477,26 +477,17 @@ static const struct aper_size_info_fixed const intel_fake_agp_sizes[] = {
{
512
,
131072
,
7
},
};
static
unsigned
int
intel_gtt_stolen_
entries
(
void
)
static
unsigned
int
intel_gtt_stolen_
size
(
void
)
{
u16
gmch_ctrl
;
u8
rdct
;
int
local
=
0
;
static
const
int
ddt
[
4
]
=
{
0
,
16
,
32
,
64
};
unsigned
int
overhead_entries
;
unsigned
int
stolen_size
=
0
;
pci_read_config_word
(
intel_private
.
bridge_dev
,
I830_GMCH_CTRL
,
&
gmch_ctrl
);
if
(
INTEL_GTT_GEN
>
4
||
IS_PINEVIEW
)
overhead_entries
=
0
;
else
overhead_entries
=
intel_private
.
base
.
gtt_mappable_entries
/
1024
;
overhead_entries
+=
1
;
/* BIOS popup */
if
(
intel_private
.
bridge_dev
->
device
==
PCI_DEVICE_ID_INTEL_82830_HB
||
intel_private
.
bridge_dev
->
device
==
PCI_DEVICE_ID_INTEL_82845G_HB
)
{
switch
(
gmch_ctrl
&
I830_GMCH_GMS_MASK
)
{
...
...
@@ -631,7 +622,7 @@ static unsigned int intel_gtt_stolen_entries(void)
stolen_size
=
0
;
}
return
stolen_size
/
KB
(
4
)
-
overhead_entries
;
return
stolen_size
;
}
static
void
i965_adjust_pgetbl_size
(
unsigned
int
size_flag
)
...
...
@@ -817,8 +808,8 @@ static int intel_gtt_init(void)
global_cache_flush
();
/* FIXME: ? */
/* we have to call this as early as possible after the MMIO base address is known */
intel_private
.
base
.
gtt_stolen_entries
=
intel_gtt_stolen_entries
();
if
(
intel_private
.
base
.
gtt_stolen_entries
==
0
)
{
intel_private
.
base
.
stolen_size
=
intel_gtt_stolen_size
();
if
(
intel_private
.
base
.
stolen_size
==
0
)
{
intel_private
.
driver
->
cleanup
();
iounmap
(
intel_private
.
registers
);
iounmap
(
intel_private
.
gtt
);
...
...
@@ -1006,8 +997,7 @@ static int intel_fake_agp_configure(void)
agp_bridge
->
gart_bus_addr
=
intel_private
.
gma_bus_addr
;
for
(
i
=
intel_private
.
base
.
gtt_stolen_entries
;
i
<
intel_private
.
base
.
gtt_total_entries
;
i
++
)
{
for
(
i
=
0
;
i
<
intel_private
.
base
.
gtt_total_entries
;
i
++
)
{
intel_private
.
driver
->
write_entry
(
intel_private
.
scratch_page_dma
,
i
,
0
);
}
...
...
@@ -1065,17 +1055,7 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem,
if
(
mem
->
page_count
==
0
)
goto
out
;
if
(
pg_start
<
intel_private
.
base
.
gtt_stolen_entries
)
{
dev_printk
(
KERN_DEBUG
,
&
intel_private
.
pcidev
->
dev
,
"pg_start == 0x%.8lx, gtt_stolen_entries == 0x%.8x
\n
"
,
pg_start
,
intel_private
.
base
.
gtt_stolen_entries
);
dev_info
(
&
intel_private
.
pcidev
->
dev
,
"trying to insert into local/stolen memory
\n
"
);
goto
out_err
;
}
if
((
pg_start
+
mem
->
page_count
)
>
intel_private
.
base
.
gtt_total_entries
)
if
(
pg_start
+
mem
->
page_count
>
intel_private
.
base
.
gtt_total_entries
)
goto
out_err
;
if
(
type
!=
mem
->
type
)
...
...
@@ -1118,12 +1098,6 @@ static int intel_fake_agp_remove_entries(struct agp_memory *mem,
if
(
mem
->
page_count
==
0
)
return
0
;
if
(
pg_start
<
intel_private
.
base
.
gtt_stolen_entries
)
{
dev_info
(
&
intel_private
.
pcidev
->
dev
,
"trying to disable local/stolen memory
\n
"
);
return
-
EINVAL
;
}
if
(
USE_PCI_DMA_API
&&
INTEL_GTT_GEN
>
2
)
intel_agp_unmap_memory
(
mem
);
...
...
@@ -1629,7 +1603,7 @@ int intel_gmch_probe(struct pci_dev *pdev,
}
EXPORT_SYMBOL
(
intel_gmch_probe
);
struct
intel_gtt
*
intel_gtt_get
(
void
)
const
struct
intel_gtt
*
intel_gtt_get
(
void
)
{
return
&
intel_private
.
base
;
}
...
...
drivers/gpu/drm/i915/i915_dma.c
浏览文件 @
c64f7ba5
...
...
@@ -1044,7 +1044,7 @@ static unsigned long i915_stolen_to_phys(struct drm_device *dev, u32 offset)
pci_read_config_byte
(
pdev
,
0x9c
,
&
val
);
base
=
val
>>
3
<<
27
;
}
base
-=
dev_priv
->
mm
.
gtt
->
gtt_stolen_entries
<<
PAGE_SHIFT
;
base
-=
dev_priv
->
mm
.
gtt
->
stolen_size
;
#endif
return
base
+
offset
;
...
...
@@ -1168,7 +1168,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
unsigned
long
prealloc_size
,
gtt_size
,
mappable_size
;
int
ret
=
0
;
prealloc_size
=
dev_priv
->
mm
.
gtt
->
gtt_stolen_entries
<<
PAGE_SHIFT
;
prealloc_size
=
dev_priv
->
mm
.
gtt
->
stolen_size
;
gtt_size
=
dev_priv
->
mm
.
gtt
->
gtt_total_entries
<<
PAGE_SHIFT
;
mappable_size
=
dev_priv
->
mm
.
gtt
->
gtt_mappable_entries
<<
PAGE_SHIFT
;
...
...
drivers/gpu/drm/i915/i915_drv.h
浏览文件 @
c64f7ba5
...
...
@@ -542,7 +542,7 @@ typedef struct drm_i915_private {
struct
{
/** Bridge to intel-gtt-ko */
struct
intel_gtt
*
gtt
;
const
struct
intel_gtt
*
gtt
;
/** Memory allocator for GTT stolen memory */
struct
drm_mm
stolen
;
/** Memory allocator for GTT */
...
...
include/drm/intel-gtt.h
浏览文件 @
c64f7ba5
...
...
@@ -2,17 +2,16 @@
#ifndef _DRM_INTEL_GTT_H
#define _DRM_INTEL_GTT_H
struct
intel_gtt
{
/* Number of stolen gtt entries at the beginning. */
unsigned
int
gtt_stolen_entries
;
const
struct
intel_gtt
{
/* Size of memory reserved for graphics by the BIOS */
unsigned
int
stolen_size
;
/* Total number of gtt entries. */
unsigned
int
gtt_total_entries
;
/* Part of the gtt that is mappable by the cpu, for those chips where
* this is not the full gtt. */
unsigned
int
gtt_mappable_entries
;
};
struct
intel_gtt
*
intel_gtt_get
(
void
);
}
*
intel_gtt_get
(
void
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录