Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
0701d155
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,发现更多精彩内容 >>
提交
0701d155
编写于
11月 04, 2021
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcMainLib: Implement automatic scaling factor detection
closes acidanthera/bugtracker#1717
上级
a41d4806
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
126 addition
and
37 deletion
+126
-37
Changelog.md
Changelog.md
+1
-0
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+15
-0
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+20
-2
Docs/Errata/Errata.pdf
Docs/Errata/Errata.pdf
+0
-0
Docs/Sample.plist
Docs/Sample.plist
+2
-3
Docs/SampleCustom.plist
Docs/SampleCustom.plist
+2
-3
Include/Acidanthera/Library/OcConfigurationLib.h
Include/Acidanthera/Library/OcConfigurationLib.h
+1
-0
Include/Acidanthera/Library/OcVariableLib.h
Include/Acidanthera/Library/OcVariableLib.h
+6
-4
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+1
-0
Library/OcMainLib/OpenCoreMisc.c
Library/OcMainLib/OpenCoreMisc.c
+6
-3
Library/OcMainLib/OpenCoreNvram.c
Library/OcMainLib/OpenCoreNvram.c
+4
-2
Library/OcMainLib/OpenCoreUefi.c
Library/OcMainLib/OpenCoreUefi.c
+2
-1
Library/OcMainLib/OpenCoreUefiInOut.c
Library/OcMainLib/OpenCoreUefiInOut.c
+46
-8
Library/OcSmbiosLib/SmbiosPatch.c
Library/OcSmbiosLib/SmbiosPatch.c
+6
-3
Library/OcSmcLib/OcSmcLib.c
Library/OcSmcLib/OcSmcLib.c
+2
-1
Library/OcVariableLib/OcVariableLib.c
Library/OcVariableLib/OcVariableLib.c
+12
-7
未找到文件。
Changelog.md
浏览文件 @
0701d155
...
...
@@ -2,6 +2,7 @@ OpenCore Changelog
==================
#### v0.7.6
-
Fixed stack canary support when compiling with GCC
-
Added automatic scaling factor detection
#### v0.7.5
-
Revised OpenLinuxBoot documentation
...
...
Docs/Configuration.pdf
浏览文件 @
0701d155
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
0701d155
...
...
@@ -7366,6 +7366,21 @@ with the boot menu.
On all known affected systems,
\texttt
{
ConsoleMode
}
must be set to
an empty string for this option to work.
\item
\texttt
{
UIScale
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
,
8
bit
\\
\textbf
{
Failsafe
}
:
\texttt
{
-
1
}
\\
\textbf
{
Description
}
: User interface scaling factor.
Corresponds to
\texttt
{
4
D
1
EDE
05
-
38
C
7
-
4
A
6
A
-
9
CC
6
-
4
BCCA
8
B
38
C
14
:UIScale
}
variable.
\begin
{
itemize
}
\tightlist
\item
\texttt
{
1
}
---
1
x scaling, corresponds to normal displays.
\item
\texttt
{
2
}
---
2
x scaling, corresponds to HiDPI displays.
\item
\texttt
{
-
1
}
---
leaves the current variable unchanged.
\item
\texttt
{
0
}
---
automatically chooses scaling based on the current resolution.
\end
{
itemize
}
\item
\texttt
{
UgaPassThrough
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
...
...
Docs/Differences/Differences.pdf
浏览文件 @
0701d155
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
0701d155
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex
Tue Nov 2 10:35:43
2021
%DIF ADD ../Configuration.tex T
ue Nov 2 10:37:48
2021
%DIF DEL PreviousConfiguration.tex
Wed Nov 3 14:16:04
2021
%DIF ADD ../Configuration.tex T
hu Nov 4 18:02:19
2021
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
...
...
@@ -7425,6 +7425,24 @@ with the boot menu.
\emph
{
Note
}
: This option only applies to the
\texttt
{
System
}
renderer.
On all known affected systems,
\texttt
{
ConsoleMode
}
must be set to
an empty string for this option to work.
\DIFaddbegin
\item
\texttt
{
\DIFadd
{
UIScale
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
integer
}}
\DIFadd
{
,
8
bit
}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
-
1
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: User interface scaling factor.
}
\DIFadd
{
Corresponds to
}
\texttt
{
\DIFadd
{
4
D
1
EDE
05
-
38
C
7
-
4
A
6
A
-
9
CC
6
-
4
BCCA
8
B
38
C
14
:UIScale
}}
\DIFadd
{
variable.
}
\begin
{
itemize
}
\tightlist
\item
\texttt
{
\DIFadd
{
1
}}
\DIFadd
{
---
1
x scaling, corresponds to normal displays.
}
\item
\texttt
{
\DIFadd
{
2
}}
\DIFadd
{
---
2
x scaling, corresponds to HiDPI displays.
}
\item
\texttt
{
\DIFadd
{
-
1
}}
\DIFadd
{
---
leaves the current variable unchanged.
}
\item
\texttt
{
\DIFadd
{
0
}}
\DIFadd
{
---
automatically chooses scaling based on the current resolution.
}
\end
{
itemize
}
\DIFaddend
\item
\texttt
{
UgaPassThrough
}
\\
...
...
Docs/Errata/Errata.pdf
浏览文件 @
0701d155
无法预览此类型文件
Docs/Sample.plist
浏览文件 @
0701d155
...
...
@@ -1132,8 +1132,6 @@
<dict>
<key>
DefaultBackgroundColor
</key>
<data>
AAAAAA==
</data>
<key>
UIScale
</key>
<data>
AQ==
</data>
</dict>
<key>
4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102
</key>
<dict>
...
...
@@ -1160,7 +1158,6 @@
<dict>
<key>
4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14
</key>
<array>
<string>
UIScale
</string>
<string>
DefaultBackgroundColor
</string>
</array>
<key>
4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102
</key>
...
...
@@ -1513,6 +1510,8 @@
<false/>
<key>
TextRenderer
</key>
<string>
BuiltinGraphics
</string>
<key>
UIScale
</key>
<integer>
0
</integer>
<key>
UgaPassThrough
</key>
<false/>
</dict>
...
...
Docs/SampleCustom.plist
浏览文件 @
0701d155
...
...
@@ -1132,8 +1132,6 @@
<dict>
<key>
DefaultBackgroundColor
</key>
<data>
AAAAAA==
</data>
<key>
UIScale
</key>
<data>
AQ==
</data>
</dict>
<key>
4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102
</key>
<dict>
...
...
@@ -1158,7 +1156,6 @@
<dict>
<key>
4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14
</key>
<array>
<string>
UIScale
</string>
<string>
DefaultBackgroundColor
</string>
</array>
<key>
4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102
</key>
...
...
@@ -1851,6 +1848,8 @@
<false/>
<key>
TextRenderer
</key>
<string>
BuiltinGraphics
</string>
<key>
UIScale
</key>
<integer>
0
</integer>
<key>
UgaPassThrough
</key>
<false/>
</dict>
...
...
Include/Acidanthera/Library/OcConfigurationLib.h
浏览文件 @
0701d155
...
...
@@ -651,6 +651,7 @@ typedef enum {
_(BOOLEAN , ReplaceTabWithSpace , , FALSE , ()) \
_(BOOLEAN , ReconnectOnResChange , , FALSE , ()) \
_(BOOLEAN , SanitiseClearScreen , , FALSE , ()) \
_(INT8 , UIScale , , -1 , ()) \
_(BOOLEAN , UgaPassThrough , , FALSE , ()) \
_(BOOLEAN , DirectGopRendering , , FALSE , ()) \
_(BOOLEAN , ForceResolution , , FALSE , ())
...
...
Include/Acidanthera/Library/OcVariableLib.h
浏览文件 @
0701d155
...
...
@@ -40,6 +40,7 @@ OcVariableInit (
EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not
be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).
@param[in] Data The contents for the variable.
@param[in] VendorGuid Variable GUID, defaults to gOcVendorVariableGuid if NULL.
@retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
defined by the Attributes.
...
...
@@ -57,10 +58,11 @@ OcVariableInit (
**/
EFI_STATUS
OcSetSystemVariable
(
IN
CHAR16
*
VariableName
,
IN
UINT32
Attributes
,
IN
UINTN
DataSize
,
IN
VOID
*
Data
IN
CHAR16
*
VariableName
,
IN
UINT32
Attributes
,
IN
UINTN
DataSize
,
IN
VOID
*
Data
,
IN
EFI_GUID
*
VendorGuid
OPTIONAL
);
#endif // OC_VARIABLE_LIB_H
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
0701d155
...
...
@@ -786,6 +786,7 @@ mUefiOutputSchema[] = {
OC_SCHEMA_STRING_IN
(
"Resolution"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Output
.
Resolution
),
OC_SCHEMA_BOOLEAN_IN
(
"SanitiseClearScreen"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Output
.
SanitiseClearScreen
),
OC_SCHEMA_STRING_IN
(
"TextRenderer"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Output
.
TextRenderer
),
OC_SCHEMA_INTEGER_IN
(
"UIScale"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Output
.
UIScale
),
OC_SCHEMA_BOOLEAN_IN
(
"UgaPassThrough"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Output
.
UgaPassThrough
),
};
...
...
Library/OcMainLib/OpenCoreMisc.c
浏览文件 @
0701d155
...
...
@@ -69,7 +69,8 @@ OcStoreLoadPath (
OC_LOG_VARIABLE_PATH
,
OPEN_CORE_NVRAM_ATTR
,
AsciiStrSize
(
OutPath
),
OutPath
OutPath
,
NULL
);
DEBUG
((
...
...
@@ -659,7 +660,8 @@ OcMiscMiddleInit (
OC_BOOT_PROTECT_VARIABLE_NAME
,
OPEN_CORE_INT_NVRAM_ATTR
,
sizeof
(
BootProtectFlag
),
&
BootProtectFlag
&
BootProtectFlag
,
NULL
);
}
...
...
@@ -981,6 +983,7 @@ OcMiscUefiQuirksLoaded (
OC_SCAN_POLICY_VARIABLE_NAME
,
OPEN_CORE_INT_NVRAM_ATTR
,
sizeof
(
Config
->
Misc
.
Security
.
ScanPolicy
),
&
Config
->
Misc
.
Security
.
ScanPolicy
&
Config
->
Misc
.
Security
.
ScanPolicy
,
NULL
);
}
Library/OcMainLib/OpenCoreNvram.c
浏览文件 @
0701d155
...
...
@@ -91,14 +91,16 @@ OcReportVersion (
OC_VERSION_VARIABLE_NAME
,
OPEN_CORE_NVRAM_ATTR
,
AsciiStrLen
(
Version
),
(
VOID
*
)
Version
(
VOID
*
)
Version
,
NULL
);
}
else
{
OcSetSystemVariable
(
OC_VERSION_VARIABLE_NAME
,
OPEN_CORE_NVRAM_ATTR
,
L_STR_LEN
(
"UNK-000-0000-00-00"
),
"UNK-000-0000-00-00"
"UNK-000-0000-00-00"
,
NULL
);
}
}
...
...
Library/OcMainLib/OpenCoreUefi.c
浏览文件 @
0701d155
...
...
@@ -858,7 +858,8 @@ OcLoadUefiSupport (
OC_BOOT_REDIRECT_VARIABLE_NAME
,
OPEN_CORE_INT_NVRAM_ATTR
,
sizeof
(
Config
->
Uefi
.
Quirks
.
RequestBootVarRouting
),
&
Config
->
Uefi
.
Quirks
.
RequestBootVarRouting
&
Config
->
Uefi
.
Quirks
.
RequestBootVarRouting
,
NULL
);
if
(
Config
->
Uefi
.
Quirks
.
UnblockFsConnect
)
{
...
...
Library/OcMainLib/OpenCoreUefiInOut.c
浏览文件 @
0701d155
...
...
@@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/OcVariable.h>
#include <Guid/GlobalVariable.h>
#include <Guid/AppleVariable.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
...
...
@@ -40,6 +41,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/OcMiscLib.h>
#include <Library/OcSmcLib.h>
#include <Library/OcOSInfoLib.h>
#include <Library/OcVariableLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
...
...
@@ -182,14 +184,16 @@ OcLoadUefiOutputSupport (
IN
OC_GLOBAL_CONFIG
*
Config
)
{
EFI_STATUS
Status
;
CONST
CHAR8
*
AsciiRenderer
;
CONST
CHAR8
*
GopPassThrough
;
OC_CONSOLE_RENDERER
Renderer
;
UINT32
Width
;
UINT32
Height
;
UINT32
Bpp
;
BOOLEAN
SetMax
;
EFI_STATUS
Status
;
CONST
CHAR8
*
AsciiRenderer
;
CONST
CHAR8
*
GopPassThrough
;
EFI_GRAPHICS_OUTPUT_PROTOCOL
*
Gop
;
OC_CONSOLE_RENDERER
Renderer
;
UINT32
Width
;
UINT32
Height
;
UINT32
Bpp
;
BOOLEAN
SetMax
;
UINT8
UIScale
;
GopPassThrough
=
OC_BLOB_GET
(
&
Config
->
Uefi
.
Output
.
GopPassThrough
);
if
(
AsciiStrCmp
(
GopPassThrough
,
"Enabled"
)
==
0
)
{
...
...
@@ -273,6 +277,40 @@ OcLoadUefiOutputSupport (
}
}
if
(
Config
->
Uefi
.
Output
.
UIScale
>=
0
&&
Config
->
Uefi
.
Output
.
UIScale
<=
2
)
{
if
(
Config
->
Uefi
.
Output
.
UIScale
==
0
)
{
Status
=
gBS
->
HandleProtocol
(
gST
->
ConsoleOutHandle
,
&
gEfiGraphicsOutputProtocolGuid
,
(
VOID
**
)
&
Gop
);
if
(
!
EFI_ERROR
(
Status
))
{
UIScale
=
(
UINT64
)
Gop
->
Mode
->
Info
->
HorizontalResolution
*
Gop
->
Mode
->
Info
->
VerticalResolution
>=
4000000
?
2
:
1
;
DEBUG
((
DEBUG_INFO
,
"OC: Selected UIScale %d based on %ux%u resolution
\n
"
,
UIScale
,
Gop
->
Mode
->
Info
->
HorizontalResolution
,
Gop
->
Mode
->
Info
->
VerticalResolution
));
}
else
{
UIScale
=
1
;
}
}
else
{
UIScale
=
(
UINT8
)
Config
->
Uefi
.
Output
.
UIScale
;
}
Status
=
OcSetSystemVariable
(
APPLE_UI_SCALE_VARIABLE_NAME
,
EFI_VARIABLE_BOOTSERVICE_ACCESS
|
EFI_VARIABLE_RUNTIME_ACCESS
,
sizeof
(
UIScale
),
&
UIScale
,
&
gAppleVendorVariableGuid
);
DEBUG
((
DEBUG_INFO
,
"OC: Setting UIScale to %d - %r
\n
"
,
UIScale
,
Status
));
}
AsciiRenderer
=
OC_BLOB_GET
(
&
Config
->
Uefi
.
Output
.
TextRenderer
);
if
(
AsciiRenderer
[
0
]
==
'\0'
||
AsciiStrCmp
(
AsciiRenderer
,
"BuiltinGraphics"
)
==
0
)
{
...
...
Library/OcSmbiosLib/SmbiosPatch.c
浏览文件 @
0701d155
...
...
@@ -2348,7 +2348,8 @@ OcSmbiosExtractOemInfo (
OC_OEM_PRODUCT_VARIABLE_NAME
,
EFI_VARIABLE_BOOTSERVICE_ACCESS
|
EFI_VARIABLE_RUNTIME_ACCESS
,
AsciiStrLen
(
SmProductName
),
(
VOID
*
)
SmProductName
(
VOID
*
)
SmProductName
,
NULL
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OCSMB: Cannot write OEM product
\n
"
));
...
...
@@ -2360,7 +2361,8 @@ OcSmbiosExtractOemInfo (
OC_OEM_VENDOR_VARIABLE_NAME
,
EFI_VARIABLE_BOOTSERVICE_ACCESS
|
EFI_VARIABLE_RUNTIME_ACCESS
,
AsciiStrLen
(
SmManufacturer
),
(
VOID
*
)
SmManufacturer
(
VOID
*
)
SmManufacturer
,
NULL
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OCSMB: Cannot write OEM board manufacturer - %r
\n
"
,
Status
));
...
...
@@ -2370,7 +2372,8 @@ OcSmbiosExtractOemInfo (
OC_OEM_BOARD_VARIABLE_NAME
,
EFI_VARIABLE_BOOTSERVICE_ACCESS
|
EFI_VARIABLE_RUNTIME_ACCESS
,
AsciiStrLen
(
SmBoard
),
(
VOID
*
)
SmBoard
(
VOID
*
)
SmBoard
,
NULL
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OCSMB: Cannot write OEM board - %r
\n
"
,
Status
));
...
...
Library/OcSmcLib/OcSmcLib.c
浏览文件 @
0701d155
...
...
@@ -575,7 +575,8 @@ ExportStatusKey (
VIRTUALSMC_STATUS_KEY
,
EFI_VARIABLE_BOOTSERVICE_ACCESS
|
EFI_VARIABLE_RUNTIME_ACCESS
,
sizeof
(
StatusBuffer
),
StatusBuffer
StatusBuffer
,
NULL
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OCSMC: Failed to create status - %r
\n
"
,
Status
));
...
...
Library/OcVariableLib/OcVariableLib.c
浏览文件 @
0701d155
...
...
@@ -33,10 +33,11 @@ OcVariableInit (
EFI_STATUS
OcSetSystemVariable
(
IN
CHAR16
*
VariableName
,
IN
UINT32
Attributes
,
IN
UINTN
DataSize
,
IN
VOID
*
Data
IN
CHAR16
*
VariableName
,
IN
UINT32
Attributes
,
IN
UINTN
DataSize
,
IN
VOID
*
Data
,
IN
EFI_GUID
*
VendorGuid
OPTIONAL
)
{
EFI_STATUS
Status
;
...
...
@@ -47,6 +48,10 @@ OcSetSystemVariable (
UINT8
StackBuffer
[
256
];
if
(
VendorGuid
==
NULL
)
{
VendorGuid
=
&
gOcVendorVariableGuid
;
}
DEBUG_CODE_BEGIN
();
ASSERT
(
mDebugInitialized
);
DEBUG_CODE_END
();
...
...
@@ -68,7 +73,7 @@ OcSetSystemVariable (
Status
=
gRT
->
GetVariable
(
VariableName
,
&
gOcVendorVariable
Guid
,
Vendor
Guid
,
NULL
,
&
OldDataSize
,
OldData
...
...
@@ -81,7 +86,7 @@ OcSetSystemVariable (
if
(
OldData
!=
NULL
)
{
Status
=
gRT
->
GetVariable
(
VariableName
,
&
gOcVendorVariable
Guid
,
Vendor
Guid
,
NULL
,
&
OldDataSize
,
OldData
...
...
@@ -123,7 +128,7 @@ OcSetSystemVariable (
return
gRT
->
SetVariable
(
VariableName
,
&
gOcVendorVariable
Guid
,
Vendor
Guid
,
Attributes
,
DataSize
,
Data
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录