public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Alexander Graf <agraf@suse.de>, edk2-devel-01 <edk2-devel@ml01.01.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Shannon Zhao <zhaoshenglong@huawei.com>,
	Christoffer Dall <christoffer.dall@linaro.org>,
	Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [PATCH 00/11] OvmfPkg, ArmVirtPkg: GOP driver for the VirtIo GPU (virtio-gpu-pci)
Date: Mon, 5 Sep 2016 15:17:33 +0200	[thread overview]
Message-ID: <51d27b02-85dc-44cf-db27-a97727224486@redhat.com> (raw)
In-Reply-To: <57CD6C25.7000406@suse.de>

On 09/05/16 14:59, Alexander Graf wrote:
> On 09/05/2016 02:56 PM, Laszlo Ersek wrote:
>> On 09/05/16 14:26, Alexander Graf wrote:
>>> On 09/02/2016 12:02 AM, Laszlo Ersek wrote:
>>>> On 08/19/16 14:49, Laszlo Ersek wrote:
>>>>
>>>>> - Also tested loading and launching Linux from GRUB. Here the results
>>>>>     differ of course: x86_64 Fedora 24 drives virtio-gpu-pci with its
>>>>>     native driver without problems, whereas AARCH64 Fedora 23 doesn't
>>>>> even
>>>>>     look for virtio-gpu-pci, apparently.
>>>> Update:
>>>>
>>>> Once booted from GRUB -- on top of OVMF / ArmVirtQemu respectively --,
>>>> both x86_64 and aarch64 Fedora *24* guests work well with
>>>> virtio-gpu-pci, as far as the character console (tty1,
>>>> "virtiodrmfb") is
>>>> concerned.
>>> Hooray :).
>>>
>>> Unfortunately grub2 has no idea what PixelBltOnly is, it only knows the
>>> traditional ones.
>> For me grub2 seems to work without any issues -- it only uses the Simple
>> Text Out protocol for displaying text (not graphics). The text gets
>> turned into graphics by edk2's GraphicsConsoleDxe, and that one knows
>> how to handle PixelBltOnly.
>>
>>> So to make it work with graphics, I had to explicitly
>>> set it to the correct mode - see the patch below.
>> That is not the correct mode at all;
>> PixelBlueGreenRedReserved8BitPerColor means that the framebuffer is
>> accessible directly, and the pixels are represented in the framebuffer
>> as BGRX8 UINT32 elements.
>>
>> Whereas, virtio-gpu-pci has no framebuffer at all. PixelBltOnly means
>> that the client can only display graphics on the device by explicitly
>> calling the EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt() method.
>>
>>> Is PixelBltOnly properly defined?
>> Yes, it is.
>>
>>> If so, someone should probably write
>>> up a patch for grub2 to teach it about it ;).
>> Actually, I'm surprised the patch you pasted below works at all. If it
>> does (i.e., you get pictures displayed by grub2) after applying the
>> patch, that means grub2 already uses Blt() only, and no direct
>> framebuffer access -- which is great (*). In that case, it should only
>> be modified not to croak on PixelBltOnly.
> 
> Yes, that's what it does :).
> 
>> (*) Hmmm, from a 5-second grep, I found "grub-core/video/efi_gop.c", and
>> it does call Blt() in the grub_video_gop_swap_buffers() function. I have
>> no idea what the "grub_video_adapter.swap_buffers" member function is
>> for -- double buffering perhaps?
>>
>> If grub2 draws only into its own memory buffers, and then sends them to
>> the display with Blt(), that should be okay. As long as the array format
>> matches the Blt() specification, that is.
> 
> Exactly. grub2 only uses blt operations. The thing I wasn't sure about
> was whether PixelBltOnly is defined as "Please blt me in BGRx888
> format". If that's what it's defined as, we can simply add it to the
> existing BGR888 handing case in grub2 and get fancy graphical output for
> free.

I think that's the case. Please see the discussion in "11.9.1 Blt
Buffer" in the UEFI 2.6 spec, and also

typedef struct {
  UINT8 Blue;
  UINT8 Green;
  UINT8 Red;
  UINT8 Reserved;
} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;

under the EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt() description (= same section
of the spec).

The spec can be downloaded from

http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf

(If the direct link doesn't work, the landing page (?) is
<http://www.uefi.org/specifications>.)

Thanks
Laszlo


      parent reply	other threads:[~2016-09-05 13:17 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19 12:49 [PATCH 00/11] OvmfPkg, ArmVirtPkg: GOP driver for the VirtIo GPU (virtio-gpu-pci) Laszlo Ersek
2016-08-19 12:49 ` [PATCH 01/11] OvmfPkg/QemuVideoDxe: don't incorrectly bind virtio-gpu-pci Laszlo Ersek
2016-08-19 12:49 ` [PATCH 02/11] OvmfPkg/Virtio10Dxe: don't bind virtio-vga Laszlo Ersek
2016-08-19 12:49 ` [PATCH 03/11] OvmfPkg/PlatformBootManagerLib: relax device class requirement for ConOut Laszlo Ersek
2016-08-19 12:49 ` [PATCH 04/11] OvmfPkg/IndustryStandard: add type definitions for the virtio GPU device Laszlo Ersek
2016-08-19 12:49 ` [PATCH 05/11] OvmfPkg/VirtioGpuDxe: introduce with Component Name 2 and Driver Binding Laszlo Ersek
2016-08-19 12:49 ` [PATCH 06/11] OvmfPkg: include VirtioGpuDxe in the platform DSC/FDF files Laszlo Ersek
2016-08-19 12:49 ` [PATCH 07/11] ArmVirtPkg/ArmVirtQemu: " Laszlo Ersek
2016-08-19 13:14   ` Ard Biesheuvel
2016-08-19 12:49 ` [PATCH 08/11] OvmfPkg/VirtioGpuDxe: initialize and tear down VirtIo GPU device Laszlo Ersek
2016-08-19 12:49 ` [PATCH 09/11] OvmfPkg/VirtioGpuDxe: provide functions for sending VirtIo GPU commands Laszlo Ersek
2016-08-19 12:49 ` [PATCH 10/11] OvmfPkg/VirtioGpuDxe: implement EFI_GRAPHICS_OUTPUT_PROTOCOL Laszlo Ersek
2016-08-19 12:49 ` [PATCH 11/11] ArmVirtPkg: remove PcdKludgeMapPciMmioAsCached Laszlo Ersek
2016-08-19 13:16   ` Ard Biesheuvel
2016-08-19 13:06 ` [PATCH 00/11] OvmfPkg, ArmVirtPkg: GOP driver for the VirtIo GPU (virtio-gpu-pci) Ard Biesheuvel
2016-08-19 14:25   ` Laszlo Ersek
2016-08-31 20:43     ` Jordan Justen
2016-09-01  7:44       ` Ard Biesheuvel
2016-09-01 16:48         ` Laszlo Ersek
2016-09-01 16:29       ` Laszlo Ersek
2016-09-01 18:03         ` Jordan Justen
2016-09-01 18:46           ` Laszlo Ersek
2016-09-01 19:52             ` Jordan Justen
2016-09-01 20:23               ` Ard Biesheuvel
2016-09-01 20:26                 ` Ard Biesheuvel
2016-09-01 20:52                 ` Jordan Justen
2016-09-01 20:44               ` Laszlo Ersek
2016-09-05 14:17               ` Gerd Hoffmann
2016-08-30 15:07 ` Laszlo Ersek
2016-09-01 20:32 ` Jordan Justen
2016-09-01 21:07   ` Laszlo Ersek
2016-09-01 22:02 ` Laszlo Ersek
     [not found]   ` <57CD6463.90903@suse.de>
2016-09-05 12:56     ` Laszlo Ersek
     [not found]       ` <57CD6C25.7000406@suse.de>
2016-09-05 13:17         ` Laszlo Ersek [this message]

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=51d27b02-85dc-44cf-db27-a97727224486@redhat.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