From: "Sunny Wang" <Sunny.Wang@arm.com>
To: Dimitrije Pavlov <Dimitrije.Pavlov@arm.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>,
Jeff Booher-Kaeding <Jeff.Booher-Kaeding@arm.com>,
Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
Jeremy Linton <Jeremy.Linton@arm.com>,
Chandni Cherukuri <Chandni.Cherukuri@arm.com>,
Sunny Wang <Sunny.Wang@arm.com>
Subject: Re: [edk2-test][PATCH v1 1/1] uefi-sct/SctPkg: Don't always check PixelInformation
Date: Thu, 14 Jul 2022 14:18:04 +0000 [thread overview]
Message-ID: <AS8PR08MB7791ACB07E9BDD7316690B0085889@AS8PR08MB7791.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20220629155928.5703-1-Dimitrije.Pavlov@arm.com>
Looks good to me. Thanks for fixing the issue, Dimitrije.
Add Chandni. She has run into this issue as well.
Reviewed-by: Sunny Wang <sunny.wang@arm.com>
-----Original Message-----
From: Dimitrije Pavlov <Dimitrije.Pavlov@arm.com>
Sent: 29 June 2022 16:59
To: devel@edk2.groups.io
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Jeff Booher-Kaeding <Jeff.Booher-Kaeding@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Sunny Wang <Sunny.Wang@arm.com>; Jeremy Linton <Jeremy.Linton@arm.com>
Subject: [edk2-test][PATCH v1 1/1] uefi-sct/SctPkg: Don't always check PixelInformation
According to UEFI 2.9 Section 12.9, the PixelInformation field of the
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure is valid only if
PixelFormat is PixelBitMask. The current implementation always checks
the contents of PixelInformation field of the
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure returned by QueryMode,
regardless of PixelFormat. Check PixelInformation only if
PixelFormat is PixelBitMask.
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Jeff Booher-Kaeding <Jeff.Booher-Kaeding@arm.com>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Sunny Wang <Sunny.Wang@arm.com>
Cc: Jeremy Linton <Jeremy.Linton@arm.com>
Signed-off-by: Dimitrije Pavlov <Dimitrije.Pavlov@arm.com>
---
uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c | 30 ++++++++++++++------
uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c | 19 +++++++++----
2 files changed, 35 insertions(+), 14 deletions(-)
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c
index 13e7227f5845..b2bff9d756b1 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestConformance.c
@@ -493,16 +493,28 @@ Returns:
);
if (Status != EFI_SUCCESS) {
AssertionType = EFI_TEST_ASSERTION_FAILED;
- } else {
+ } else {
AssertionType = EFI_TEST_ASSERTION_PASSED;
- }
-
- if (SctCompareMem (
- (void *) info,
- (void *) GraphicsOutput->Mode->Info,
- sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)
- ) != 0) {
- AssertionType = EFI_TEST_ASSERTION_FAILED;
+ if (info != NULL) {
+ //
+ // PixelInformation is checked only if PixelFormat is PixelBitMask
+ //
+ if ( info->Version != GraphicsOutput->Mode->Info->Version
+ || info->HorizontalResolution != GraphicsOutput->Mode->Info->HorizontalResolution
+ || info->VerticalResolution != GraphicsOutput->Mode->Info->VerticalResolution
+ || info->PixelFormat != GraphicsOutput->Mode->Info->PixelFormat
+ || info->PixelsPerScanLine != GraphicsOutput->Mode->Info->PixelsPerScanLine
+ || ( info->PixelFormat == PixelBitMask
+ && ( info->PixelInformation.RedMask != GraphicsOutput->Mode->Info->PixelInformation.RedMask
+ || info->PixelInformation.GreenMask != GraphicsOutput->Mode->Info->PixelInformation.GreenMask
+ || info->PixelInformation.BlueMask != GraphicsOutput->Mode->Info->PixelInformation.BlueMask
+ || info->PixelInformation.ReservedMask != GraphicsOutput->Mode->Info->PixelInformation.ReservedMask)))
+ {
+ AssertionType = EFI_TEST_ASSERTION_FAILED;
+ }
+ } else {
+ AssertionType = EFI_TEST_ASSERTION_FAILED;
+ }
}
if (info != NULL) {
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c
index da51fbc44596..f31ea8175af8 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutputBBTestFunction.c
@@ -125,11 +125,20 @@ Returns:
} else {
AssertionType = EFI_TEST_ASSERTION_PASSED;
if (Info != NULL) {
- if (SctCompareMem (
- (void *) Info,
- (void *) GraphicsOutput->Mode->Info,
- sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION)
- ) != 0) {
+ //
+ // PixelInformation is checked only if PixelFormat is PixelBitMask
+ //
+ if ( Info->Version != GraphicsOutput->Mode->Info->Version
+ || Info->HorizontalResolution != GraphicsOutput->Mode->Info->HorizontalResolution
+ || Info->VerticalResolution != GraphicsOutput->Mode->Info->VerticalResolution
+ || Info->PixelFormat != GraphicsOutput->Mode->Info->PixelFormat
+ || Info->PixelsPerScanLine != GraphicsOutput->Mode->Info->PixelsPerScanLine
+ || ( Info->PixelFormat == PixelBitMask
+ && ( Info->PixelInformation.RedMask != GraphicsOutput->Mode->Info->PixelInformation.RedMask
+ || Info->PixelInformation.GreenMask != GraphicsOutput->Mode->Info->PixelInformation.GreenMask
+ || Info->PixelInformation.BlueMask != GraphicsOutput->Mode->Info->PixelInformation.BlueMask
+ || Info->PixelInformation.ReservedMask != GraphicsOutput->Mode->Info->PixelInformation.ReservedMask)))
+ {
AssertionType = EFI_TEST_ASSERTION_FAILED;
}
} else {
--
2.34.1
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
next prev parent reply other threads:[~2022-07-14 14:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 15:59 [edk2-test][PATCH v1 1/1] uefi-sct/SctPkg: Don't always check PixelInformation Dimitrije Pavlov
2022-07-14 14:18 ` Sunny Wang [this message]
2022-07-19 8:29 ` [edk2-devel] " G Edhaya Chandran
2022-07-19 8:44 ` G Edhaya Chandran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AS8PR08MB7791ACB07E9BDD7316690B0085889@AS8PR08MB7791.eurprd08.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox