public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Alireza Banejad" <alibanejad1376@gmail.com>
To: Michael Brown <mcb30@ipxe.org>
Cc: devel@edk2.groups.io, "Paul, Bill" <Bill.Paul@windriver.com>
Subject: Re: [edk2-devel] Graphic Output on qemu
Date: Wed, 8 Feb 2023 13:25:46 +0330	[thread overview]
Message-ID: <CADH3hnKd9+xD36B3+iOsZX+jP+wE0WS14SjvJsrJCae-+9ifvA@mail.gmail.com> (raw)
In-Reply-To: <0102018630466504-2ff97024-e158-48ea-9ea5-cc1e11d20bcc-000000@eu-west-1.amazonses.com>

[-- Attachment #1: Type: text/plain, Size: 2255 bytes --]

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@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
>
>

[-- Attachment #2: Type: text/html, Size: 3009 bytes --]

  reply	other threads:[~2023-02-08  9:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 10:22 Graphic Output on qemu Alireza Banejad
2023-02-07 19:55 ` [edk2-devel] " Paul, Bill
2023-02-08  8:03   ` Alireza Banejad
2023-02-08  9:06     ` Michael Brown
2023-02-08  9:55       ` Alireza Banejad [this message]
2023-02-08 10:00         ` Michael Brown

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=CADH3hnKd9+xD36B3+iOsZX+jP+wE0WS14SjvJsrJCae-+9ifvA@mail.gmail.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