Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1j9SgV-0003XF-6e for mharc-grub-devel@gnu.org; Wed, 04 Mar 2020 06:59:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50803) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9SgR-0003Ob-41 for grub-devel@gnu.org; Wed, 04 Mar 2020 06:59:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9SgQ-0003FH-1S for grub-devel@gnu.org; Wed, 04 Mar 2020 06:59:27 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:57162 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9SgP-0003EO-TY for grub-devel@gnu.org; Wed, 04 Mar 2020 06:59:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583323165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bv6lZAp4rK+ahUR5JOArjcBMIIKJml/nVo2XpoyKsjo=; b=EeyppRzpewVJIvERrIUi87H9tlKJNCbhqjaFyUAMdQLHraHPKAqit9XNsapUhgPZMfEyRX 9E1NQd2fL902mGw81VRlFl1DhdvK+E9G6HuUGrSK6WMKLcXGhBIsVI2Xy9dNwEUxNE6Hg4 FXXNpOQ9PsB3DWSnOy+e1MljRTzJjTw= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-314-oNKY5kiGNVOD-xFpD9OWbQ-1; Wed, 04 Mar 2020 06:59:24 -0500 X-MC-Unique: oNKY5kiGNVOD-xFpD9OWbQ-1 Received: by mail-wr1-f70.google.com with SMTP id m13so758790wrw.3 for ; Wed, 04 Mar 2020 03:59:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ztzZdZ6ake1QUdS3MNCWiBfikZYUftnxK1S9bMsGzJk=; b=s5Na93RTwqOuqjUQ/8ZxXScpyj2Kuel09agiYV7py6shflTBq7XHN0gVK4PP+fWolK t9nkrMka1u/t2yJxW7NcsMKd5Yil5qWBBfjRRIyzg8aQ8PuGOVtgR/SvsYWslhSKdoex UL3cwa2sRvkfb8CrQe1aR2828MigqHXaKGOHl10vb7S9o0eOpjI8GuTkB8HL4fLqHGOz rX7OpV5OrTAxJA/ChpKK1BVC4b0XlaQwRieUd6q033ilqt386An0btNWSkCz7oRzNMJD UulespdjOzeqcJZNt5Y1+Vy4ZzK6uN4d0lI7l0IG33I9txaVQVlMtPqynLdKyY+yXzuo H1QQ== X-Gm-Message-State: ANhLgQ3Qjf1PFBpED9bjpgt2TZ2AdGEpXKpiF5MHNSbEEkVDJhQ136A7 aB9iwxHhYlvEBtxmFT3dne6H/KlJHQhm1NqXXvmwIatYUaLV+iL0ZYJ2o1evvINxUuEDC+56FCF POy2VH6UY7z8= X-Received: by 2002:adf:f4c9:: with SMTP id h9mr3864790wrp.168.1583323162523; Wed, 04 Mar 2020 03:59:22 -0800 (PST) X-Google-Smtp-Source: ADFU+vsC5rPP6EhdnQJG5wKpslQW5NaTwiF3cAWNd7Q9stMqqYvy7gzqQ7hwox+GcJgzl44JK4b9Dg== X-Received: by 2002:adf:f4c9:: with SMTP id h9mr3864771wrp.168.1583323162206; Wed, 04 Mar 2020 03:59:22 -0800 (PST) Received: from minerva.redhat.com ([2a01:c50f:ab80:6700:527f:85b3:5615:ff0b]) by smtp.gmail.com with ESMTPSA id t14sm5911207wrp.63.2020.03.04.03.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 03:59:21 -0800 (PST) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Daniel Kiper , Alexander Graf , Javier Martinez Canillas Subject: [PATCH v2 06/12] efi/gop: Add support for BLT_ONLY adapters Date: Wed, 4 Mar 2020 12:58:45 +0100 Message-Id: <20200304115851.3474263-7-javierm@redhat.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200304115851.3474263-1-javierm@redhat.com> References: <20200304115851.3474263-1-javierm@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2020 11:59:28 -0000 From: Alexander Graf EFI GOP has support for multiple different bitness types of frame buffers and for a special "BLT only" type which is always defined to be RGBx. Because grub2 doesn't ever directly access the frame buffer but instead only renders graphics via the BLT interface anyway, we can easily support these adapters. The reason this has come up now is the emerging support for virtio-gpu in OVMF. That adapter does not have the notion of a memory mapped frame buffer and thus is BLT only. Signed-off-by: Alexander Graf Signed-off-by: Javier Martinez Canillas Reviewed-by: Daniel Kiper --- grub-core/video/efi_gop.c | 2 ++ include/grub/efi/graphics_output.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c index 7f9d1c2dfa1..c9e40e8d4e9 100644 --- a/grub-core/video/efi_gop.c +++ b/grub-core/video/efi_gop.c @@ -121,6 +121,7 @@ grub_video_gop_get_bpp (struct grub_efi_gop_mode_info *= in) { case GRUB_EFI_GOT_BGRA8: case GRUB_EFI_GOT_RGBA8: + case GRUB_EFI_GOT_BLT_ONLY: return 32; =20 case GRUB_EFI_GOT_BITMASK: @@ -187,6 +188,7 @@ grub_video_gop_fill_real_mode_info (unsigned mode, switch (in->pixel_format) { case GRUB_EFI_GOT_RGBA8: + case GRUB_EFI_GOT_BLT_ONLY: out->red_mask_size =3D 8; out->red_field_pos =3D 0; out->green_mask_size =3D 8; diff --git a/include/grub/efi/graphics_output.h b/include/grub/efi/graphics= _output.h index 12977741192..e4388127c66 100644 --- a/include/grub/efi/graphics_output.h +++ b/include/grub/efi/graphics_output.h @@ -28,7 +28,8 @@ typedef enum { GRUB_EFI_GOT_RGBA8, GRUB_EFI_GOT_BGRA8, - GRUB_EFI_GOT_BITMASK + GRUB_EFI_GOT_BITMASK, + GRUB_EFI_GOT_BLT_ONLY, } grub_efi_gop_pixel_format_t; =20 --=20 2.24.1