From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by mx.groups.io with SMTP id smtpd.web10.3706.1675843442388484991 for ; Wed, 08 Feb 2023 00:04:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aefwd/KQ; spf=pass (domain: gmail.com, ip: 209.85.208.179, mailfrom: alibanejad1376@gmail.com) Received: by mail-lj1-f179.google.com with SMTP id d8so18367221ljq.9 for ; Wed, 08 Feb 2023 00:04:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/Tftyc0567p1RX6RhmHc+CiwYPqTePX3SchV/Ekfjm8=; b=aefwd/KQ+Sdc9iBkOgsETXqK0AJLyAozdQLCUJaEHhCi9oRx8KqLgdntoul7vnuBG/ MQ9HoD1d0cfiU/qsQfrk/0SzSZVJcAN1OKQa2ziZp05/zkftDbAhVZ+VEZwuFpsbVXkG 76wBhDYRWTrG89x/AJmAiJDkBW/XPHNFX9u0YlvYtNNQS21baFhovIJdtK8ge5lZ+NCh zphGrik9QNUHqRzFUh+kdwxOXmfSMl0TlXjXEt0XBFSgUHYu3Cr8uQQ7DXtH/N4VMdrf y4QIrIuNnY1fAkIIHrlivFA63MGKFJ69bRNo8IcurEcEYnMCPzlYRduvh4UiWFJLuwQb /EZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/Tftyc0567p1RX6RhmHc+CiwYPqTePX3SchV/Ekfjm8=; b=j8T2Zw1nQQB3+VYv92KDJU2bm6UfjhWJnZ11pWOonhBOX2C/xMreMwtFNyxXBiTSsb lVyAO6PO6qWCO2o4WtSUsS1N556M8ML5+wRhzBTg4WaW6Uxg2tO0LR2DX7r7dY5RFHiN cL8cxhPZLKg6fafvuGIkUm54ql5lUXk1X2BqxitryjyvrmmKJHsMwAgt33ouIUYcDhfN Gp7d5xz/H6HD8pdf0kYdzT6zV6QE5LGbP1J2Vb/urkeHJyjafuo7fbeUI0ptvwxWWhpM Uxpp3b7m+BsE7wCLQKbq+NaXxiNGTTXZ7R7kEQsAcybriuFUK3y312jVdSb/2vBjxb8f fViQ== X-Gm-Message-State: AO0yUKWxMrVi+ODm92rurBFSF88rlggdV0EMgmyCiClqf8tM6CugE5GL Bn1XMWNI/GIz2DVRwdsA1KYTOkqsjSpYgGdHiMtYrpXDBBJsTZwg X-Google-Smtp-Source: AK7set+YNijn8ZciTNYQ9hxO7Nqbu1n189mCRkMIWS94wyvewzP8Z3OYVYDp48ZeEzsokvzrwaxca7eQs6bq3cK5E8Q= X-Received: by 2002:a05:651c:3db:b0:290:5b65:ab86 with SMTP id f27-20020a05651c03db00b002905b65ab86mr824560ljp.200.1675843440075; Wed, 08 Feb 2023 00:04:00 -0800 (PST) MIME-Version: 1.0 References: <6558368.1D856uYhSO@core> In-Reply-To: <6558368.1D856uYhSO@core> From: "Alireza Banejad" Date: Wed, 8 Feb 2023 11:33:54 +0330 Message-ID: Subject: Re: [edk2-devel] Graphic Output on qemu To: "Paul, Bill" Cc: "devel@edk2.groups.io" Content-Type: multipart/alternative; boundary="000000000000f1e68705f42bb4d1" --000000000000f1e68705f42bb4d1 Content-Type: text/plain; charset="UTF-8" Hi Bill, Yes, I have the graphics window with the logo showing and I see the setup menu. In fact, I have designed a HII form with my specific applications. The problem is that it just uses the SimpleTextOutput. It doesn't use the GOP or UgaDraw libraries. Plus, I am able to locate the protocol and it returns the status code of 0. the actual issue happens with the HandleProtocol Function. After I compile my code with the debug macros enabled, the status code for HandleProtocol() function is RETURN_UNSUPPORTED (Both for UgaDraw and GOP) and if I were to use the GOP or UgaDraw methods, my application would simply crash. Below is how I use the HandleProtocol function: Status = gBS->HandleProtocol ( gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput ); Last but not least, whether using the virtio-gpu I get the same result. Based on what I mentioned above, since I find the protocol but I'm not able to open it, I concluded there might be something wrong with my qemu settings. On Tue, Feb 7, 2023, 23:25 Paul, Bill wrote: > Of all the gin joints in all the towns in all the world, Alireza Banejad > had > to walk into mine at 02:22:32 on Tuesday, 7 February 2023 and say: > > > Do not click links or open attachments unless you recognize the sender > and > > know the content is safe. Hello everyone, > > I am trying to use the GOP library for my uefi development. But no matter > > what code whenever i want to open the GOP handle RETURN_UNSUPPORTED is > > returned. I think this may be a qemu problem as if it doesn't support the > > GOP at all. This is how I run my qemu > > > > qemu-system-x86_64 -bios $FIRMWARE -hda fat:rw:$DRIVE -global > > isa-debugcon.iobase=0x402 -net none -debugcon file:debug2.log -machine > > pc-q35-6.2 -device virtio-gpu > > > > Should I add any specific options for the qemu command or should I just > use > > another lib for GOP on qemu? > > One question: when you launch QEMU, do you actually see a graphics window > pop > up with the Tianocore logo? If you press F2 as it launches, are you able > to > enter the setup menu? > > I'm trying to understand if QEMU/OVMF's graphics display is working all > all. > If it is, then in theory the GOP support should work. > > If I may suggest, omit the -device virtio-gpu option. In my experience, > the > OVMF firmware for Intel works with the QEMU built-in emulated VGA display > device. With the code I've written in the past, calling > BS->LocateProtocol() > with the GOP GUID returns a valid handle. Once you have that, you should > be > able to use the GOP methods, e.g. GOP->Blt(). > > -Bill > > -- > > ============================================================================= > -Bill Paul (510) 749-2329 | VxWorks Software Architect, > wpaul@windriver.com | Master of Unix-Fu - Wind River > Systems > > ============================================================================= > "I put a dollar in a change machine. Nothing changed." - George Carlin > > ============================================================================= > > > --000000000000f1e68705f42bb4d1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Bill,
Yes, I have the graphics window with the logo show= ing and I see the setup menu.
In fact, I have design= ed a HII form with my specific applications. The problem is that it just us= es the SimpleTextOutput. It doesn't use the GOP or UgaDraw libraries.
Plus, I am able to locate the protocol and it returns the status c= ode of 0.
the actual issue happens with the HandleProtocol Functi= on.=C2=A0
After I compile my code with the debug macros enabled, = the status code for HandleProtocol() function is RETURN_UNSUPPORTED (Both f= or UgaDraw and GOP) and if I were to use the GOP or UgaDraw methods, my app= lication would simply crash.
Below is how I use the HandleProtoco= l=C2=A0function:

=C2=A0 Status =3D gBS->HandleP= rotocol (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= gST->ConsoleOutHandle,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 &gEfiGraphicsOutputProtocolGuid,
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (VOID **)&GraphicsOutput<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 );

Last but not least, whether using the virtio-gpu I g= et the same result.
Based on what I mentioned=C2=A0a= bove, since I find the protocol but I'm not able to open it, I conclude= d there might be something wrong with my qemu settings.

On Tue, Feb 7, 2023, 23:25 Paul, Bill <Bill.Paul@windriver.com> wrot= e:
Of all the gin joints in all the= towns in all the world, Alireza Banejad had
to walk into mine at 02:22:32 on Tuesday, 7 February 2023 and say:

> Do not click links or open attachments unless you recognize the sender= and
> know the content is safe. Hello everyone,
> I am trying to use the GOP library for my uefi development. But no mat= ter
> what code whenever i want to open the GOP handle RETURN_UNSUPPORTED is=
> returned. I think this may be a qemu problem as if it doesn't supp= ort the
> GOP at all. This is how I run my qemu
>
> qemu-system-x86_64 -bios $FIRMWARE -hda fat:rw:$DRIVE -global
> isa-debugcon.iobase=3D0x402=C2=A0 -net none -debugcon file:debug2.log= =C2=A0 -machine
> pc-q35-6.2 -device virtio-gpu
>
> Should I add any specific options for the qemu command or should I jus= t use
> another lib for GOP on qemu?

One question: when you launch QEMU, do you actually see a graphics window p= op
up with the Tianocore logo? If you press F2 as it launches, are you able to=
enter the setup menu?

I'm trying to understand if QEMU/OVMF's graphics display is working= all all.
If it is, then in theory the GOP support should work.

If I may suggest, omit the -device virtio-gpu option. In my experience, the=
OVMF firmware for Intel works with the QEMU built-in emulated VGA display <= br> device. With the code I've written in the past, calling BS->LocatePr= otocol()
with the GOP GUID returns a valid handle. Once you have that, you should be=
able to use the GOP methods, e.g. GOP->Blt().

-Bill

--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
-Bill Paul=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (510) 749-2329 | VxWork= s Software Architect,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0wpaul@windri= ver.com | Master of Unix-Fu - Wind River Systems
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
=C2=A0 =C2=A0"I put a dollar in a change machine. Nothing changed.&quo= t; - George Carlin
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D


--000000000000f1e68705f42bb4d1--