[edk2-devel] Graphic Output on qemu

Alireza Banejad alibanejad1376 at gmail.com
Wed Feb 8 09:55:46 UTC 2023


As my previous email, I mentioned that I am able to find the protocol since
the LocateProtocol returns 0 (EFI_SUCCESS) (using the exact code you wrote)
. But when I want to open it either with OpenProtocol or HandleProtocol I
get a RETURN_UNSUPPORTED. Are you implying that by calling LocateProtocol()
the protocol would also be opened? or do I still need to open it? if I
still need to open then I am still getting the UNSUPPORTED Status.
But if I don't need to open it I still don't know why I am not able to use
the GOP methods.
one example of the many examples which I get this error is as below:


Status = gBS->HandleProtocol (SystemTable->ConsoleOutHandle,
&gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
  if (EFI_ERROR (Status)) {
    Status = gBS->LocateProtocol (&gEfiGraphicsOutputProtocolGuid, NULL,
(VOID **)&GraphicsOutput);
    if (EFI_ERROR (Status)) {
      Print (L"Error: Could not find a GOP instance!\n");
      Status = EFI_NOT_FOUND;
      goto Done;
    }
  }
Blt         = NULL;
  ImageWidth  = 0;
  ImageHeight = 0;
  Status      =  TranslateBmpToGopBlt (
                   BmpFileData,
                   BmpFileSize,
                   &Blt,
                   &BltSize,
                   &ImageHeight,
                   &ImageWidth
                   );
It is worth mentioning that the BmpFIleData and BmpFileSize are valid
variables with the proper data stored. Anyways, the status code for the
TranslateBmpToGopBlt returns a RETURN_UNSUPPORTED. This is the same with
other GOP methods

On Wed, Feb 8, 2023 at 12:36 PM Michael Brown <mcb30 at ipxe.org> wrote:

> On 08/02/2023 08:03, Alireza Banejad wrote:
> > Below is how I use the HandleProtocol function:
> >
> >    Status = gBS->HandleProtocol (
> >                    gST->ConsoleOutHandle,
> >                    &gEfiGraphicsOutputProtocolGuid,
> >                    (VOID **)&GraphicsOutput
> >                    );
>
> You are querying only the ConsoleOutHandle, which is not necessarily
> where the GOP will be installed.
>
> Use LocateProtocol() to find the protocol instance instead:
>
>
>    Status = gBS->LocateProtocol(&gEfiGraphicsOutputProtocolGuid, NULL,
>                                 (VOID **)&GraphicsOutput);
>
> HTH,
>
> Michael
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99791): https://edk2.groups.io/g/devel/message/99791
Mute This Topic: https://groups.io/mt/96810830/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20230208/a5235bac/attachment.htm>


More information about the edk2-devel-archive mailing list