Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
69563566
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
69563566
编写于
5月 10, 2021
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcBlitLib: Improve the locality for buffer blits at 90/270
上级
c8a0f310
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
180 addition
and
0 deletion
+180
-0
Library/OcBlitLib/BlitBufferToVideo.c
Library/OcBlitLib/BlitBufferToVideo.c
+180
-0
未找到文件。
Library/OcBlitLib/BlitBufferToVideo.c
浏览文件 @
69563566
...
...
@@ -105,6 +105,96 @@ BlitLibBufferToVideo90 (
+
SourceY
*
DeltaPixels
+
SourceX
;
if
(
Configure
->
PixelFormat
==
PixelBlueGreenRedReserved8BitPerColor
)
{
Uint32
=
((
UINT32
)
SourceX
|
(
UINT32
)
SourceY
|
(
UINT32
)
DestinationX
|
(
UINT32
)
DestinationY
|
(
UINT32
)
Width
|
(
UINT32
)
Height
|
(
UINT32
)
DeltaPixels
|
(
UINT32
)
PixelsPerScanLine
)
&
(
16
-
1
);
switch
(
Uint32
)
{
case
0
:
{
CONST
UINTN
BlockWidth
=
16
;
Destination
+=
DestinationX
*
PixelsPerScanLine
;
for
(
UINTN
Index
=
0
;
Index
<
Height
;
Index
+=
BlockWidth
)
{
for
(
UINTN
Index2
=
0
;
Index2
<
Width
;
Index2
+=
BlockWidth
)
{
UINT32
*
A
=
Source
+
Index
*
DeltaPixels
+
Index2
;
UINT32
*
B
=
Destination
+
Index2
*
PixelsPerScanLine
-
Index
;
//
// Unrolling this one is ineffecient due to loop size(?). Gets down from 160 to 90 FPS.
//
for
(
UINTN
BlockIndex
=
0
;
BlockIndex
<
BlockWidth
;
BlockIndex
++
)
{
for
(
UINTN
BlockIndex2
=
0
;
BlockIndex2
<
BlockWidth
;
BlockIndex2
++
)
{
B
[
BlockIndex2
*
PixelsPerScanLine
-
BlockIndex
]
=
A
[
BlockIndex
*
DeltaPixels
+
BlockIndex2
];
}
}
}
}
}
return
EFI_SUCCESS
;
case
8
:
{
CONST
UINTN
BlockWidth
=
8
;
Destination
+=
DestinationX
*
PixelsPerScanLine
;
for
(
UINTN
Index
=
0
;
Index
<
Height
;
Index
+=
BlockWidth
)
{
for
(
UINTN
Index2
=
0
;
Index2
<
Width
;
Index2
+=
BlockWidth
)
{
UINT32
*
A
=
Source
+
Index
*
DeltaPixels
+
Index2
;
UINT32
*
B
=
Destination
+
Index2
*
PixelsPerScanLine
-
Index
;
for
(
UINTN
BlockIndex
=
0
;
BlockIndex
<
BlockWidth
;
BlockIndex
++
)
{
#if 0 /* Old compilers cannot unroll, disable for now */
#pragma clang loop unroll(full)
#endif
for
(
UINTN
BlockIndex2
=
0
;
BlockIndex2
<
BlockWidth
;
BlockIndex2
++
)
{
B
[
BlockIndex2
*
PixelsPerScanLine
-
BlockIndex
]
=
A
[
BlockIndex
*
DeltaPixels
+
BlockIndex2
];
}
}
}
}
}
return
EFI_SUCCESS
;
case
4
:
{
CONST
UINTN
BlockWidth
=
4
;
Destination
+=
DestinationX
*
PixelsPerScanLine
;
for
(
UINTN
Index
=
0
;
Index
<
Height
;
Index
+=
BlockWidth
)
{
for
(
UINTN
Index2
=
0
;
Index2
<
Width
;
Index2
+=
BlockWidth
)
{
UINT32
*
A
=
Source
+
Index
*
DeltaPixels
+
Index2
;
UINT32
*
B
=
Destination
+
Index2
*
PixelsPerScanLine
-
Index
;
for
(
UINTN
BlockIndex
=
0
;
BlockIndex
<
BlockWidth
;
BlockIndex
++
)
{
#if 0 /* Old compilers cannot unroll, disable for now */
#pragma clang loop unroll(full)
#endif
for
(
UINTN
BlockIndex2
=
0
;
BlockIndex2
<
BlockWidth
;
BlockIndex2
++
)
{
B
[
BlockIndex2
*
PixelsPerScanLine
-
BlockIndex
]
=
A
[
BlockIndex
*
DeltaPixels
+
BlockIndex2
];
}
}
}
}
}
return
EFI_SUCCESS
;
case
2
:
{
CONST
UINTN
BlockWidth
=
2
;
Destination
+=
DestinationX
*
PixelsPerScanLine
;
for
(
UINTN
Index
=
0
;
Index
<
Height
;
Index
+=
BlockWidth
)
{
for
(
UINTN
Index2
=
0
;
Index2
<
Width
;
Index2
+=
BlockWidth
)
{
UINT32
*
A
=
Source
+
Index
*
DeltaPixels
+
Index2
;
UINT32
*
B
=
Destination
+
Index2
*
PixelsPerScanLine
-
Index
;
for
(
UINTN
BlockIndex
=
0
;
BlockIndex
<
BlockWidth
;
BlockIndex
++
)
{
#if 0 /* Old compilers cannot unroll, disable for now */
#pragma clang loop unroll(full)
#endif
for
(
UINTN
BlockIndex2
=
0
;
BlockIndex2
<
BlockWidth
;
BlockIndex2
++
)
{
B
[
BlockIndex2
*
PixelsPerScanLine
-
BlockIndex
]
=
A
[
BlockIndex
*
DeltaPixels
+
BlockIndex2
];
}
}
}
}
}
return
EFI_SUCCESS
;
default:
break
;
}
while
(
Height
>
0
)
{
DestinationWalker
=
Destination
;
SourceWalker
=
Source
;
...
...
@@ -237,6 +327,96 @@ BlitLibBufferToVideo270 (
+
SourceY
*
DeltaPixels
+
SourceX
;
if
(
Configure
->
PixelFormat
==
PixelBlueGreenRedReserved8BitPerColor
)
{
Uint32
=
((
UINT32
)
SourceX
|
(
UINT32
)
SourceY
|
(
UINT32
)
DestinationX
|
(
UINT32
)
DestinationY
|
(
UINT32
)
Width
|
(
UINT32
)
Height
|
(
UINT32
)
DeltaPixels
|
(
UINT32
)
PixelsPerScanLine
)
&
(
16
-
1
);
switch
(
Uint32
)
{
case
0
:
{
CONST
UINTN
BlockWidth
=
16
;
Destination
+=
(
Configure
->
Height
-
DestinationX
-
1
)
*
PixelsPerScanLine
;
for
(
UINTN
Index
=
0
;
Index
<
Height
;
Index
+=
BlockWidth
)
{
for
(
UINTN
Index2
=
0
;
Index2
<
Width
;
Index2
+=
BlockWidth
)
{
UINT32
*
A
=
Source
+
Index
*
DeltaPixels
+
Index2
;
UINT32
*
B
=
Destination
-
Index2
*
PixelsPerScanLine
+
Index
;
for
(
UINTN
BlockIndex
=
0
;
BlockIndex
<
BlockWidth
;
BlockIndex
++
)
{
#if 0 /* Old compilers cannot unroll, disable for now */
#pragma clang loop unroll(full)
#endif
for
(
UINTN
BlockIndex2
=
0
;
BlockIndex2
<
BlockWidth
;
BlockIndex2
++
)
{
B
[
BlockIndex
-
BlockIndex2
*
PixelsPerScanLine
]
=
A
[
BlockIndex
*
DeltaPixels
+
BlockIndex2
];
}
}
}
}
}
return
EFI_SUCCESS
;
case
8
:
{
CONST
UINTN
BlockWidth
=
8
;
Destination
+=
(
Configure
->
Height
-
DestinationX
-
1
)
*
PixelsPerScanLine
;
for
(
UINTN
Index
=
0
;
Index
<
Height
;
Index
+=
BlockWidth
)
{
for
(
UINTN
Index2
=
0
;
Index2
<
Width
;
Index2
+=
BlockWidth
)
{
UINT32
*
A
=
Source
+
Index
*
DeltaPixels
+
Index2
;
UINT32
*
B
=
Destination
-
Index2
*
PixelsPerScanLine
+
Index
;
for
(
UINTN
BlockIndex
=
0
;
BlockIndex
<
BlockWidth
;
BlockIndex
++
)
{
#if 0 /* Old compilers cannot unroll, disable for now */
#pragma clang loop unroll(full)
#endif
for
(
UINTN
BlockIndex2
=
0
;
BlockIndex2
<
BlockWidth
;
BlockIndex2
++
)
{
B
[
BlockIndex
-
BlockIndex2
*
PixelsPerScanLine
]
=
A
[
BlockIndex
*
DeltaPixels
+
BlockIndex2
];
}
}
}
}
}
return
EFI_SUCCESS
;
case
4
:
{
CONST
UINTN
BlockWidth
=
4
;
Destination
+=
(
Configure
->
Height
-
DestinationX
-
1
)
*
PixelsPerScanLine
;
for
(
UINTN
Index
=
0
;
Index
<
Height
;
Index
+=
BlockWidth
)
{
for
(
UINTN
Index2
=
0
;
Index2
<
Width
;
Index2
+=
BlockWidth
)
{
UINT32
*
A
=
Source
+
Index
*
DeltaPixels
+
Index2
;
UINT32
*
B
=
Destination
-
Index2
*
PixelsPerScanLine
+
Index
;
for
(
UINTN
BlockIndex
=
0
;
BlockIndex
<
BlockWidth
;
BlockIndex
++
)
{
#if 0 /* Old compilers cannot unroll, disable for now */
#pragma clang loop unroll(full)
#endif
for
(
UINTN
BlockIndex2
=
0
;
BlockIndex2
<
BlockWidth
;
BlockIndex2
++
)
{
B
[
BlockIndex
-
BlockIndex2
*
PixelsPerScanLine
]
=
A
[
BlockIndex
*
DeltaPixels
+
BlockIndex2
];
}
}
}
}
}
return
EFI_SUCCESS
;
case
2
:
{
CONST
UINTN
BlockWidth
=
2
;
Destination
+=
(
Configure
->
Height
-
DestinationX
-
1
)
*
PixelsPerScanLine
;
for
(
UINTN
Index
=
0
;
Index
<
Height
;
Index
+=
BlockWidth
)
{
for
(
UINTN
Index2
=
0
;
Index2
<
Width
;
Index2
+=
BlockWidth
)
{
UINT32
*
A
=
Source
+
Index
*
DeltaPixels
+
Index2
;
UINT32
*
B
=
Destination
-
Index2
*
PixelsPerScanLine
+
Index
;
for
(
UINTN
BlockIndex
=
0
;
BlockIndex
<
BlockWidth
;
BlockIndex
++
)
{
#if 0 /* Old compilers cannot unroll, disable for now */
#pragma clang loop unroll(full)
#endif
for
(
UINTN
BlockIndex2
=
0
;
BlockIndex2
<
BlockWidth
;
BlockIndex2
++
)
{
B
[
BlockIndex
-
BlockIndex2
*
PixelsPerScanLine
]
=
A
[
BlockIndex
*
DeltaPixels
+
BlockIndex2
];
}
}
}
}
}
return
EFI_SUCCESS
;
default:
break
;
}
while
(
Height
>
0
)
{
DestinationWalker
=
Destination
;
SourceWalker
=
Source
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录