From patchwork Wed Mar 4 11:58:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 184169 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4806086ile; Wed, 4 Mar 2020 04:00:51 -0800 (PST) X-Google-Smtp-Source: ADFU+vspAPQpUL+XghauhtUxQ88yH0PnWo0c6qmLPL7EH7Ang/Ad5TEsfEE3kpT4dMWlFlvoRN7/ X-Received: by 2002:a37:90a:: with SMTP id 10mr2527870qkj.106.1583323251677; Wed, 04 Mar 2020 04:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583323251; cv=none; d=google.com; s=arc-20160816; b=XC5RY1YNKnGE2xD7hhnwiBeIXz93+tPcxKarBFhyu/zahlwRV5B3syFmhlIf5B13X4 RMwmfPF6YSQBL1C9B0u526j9paP5VVcbaGQDhxXjWXQFyvZqJ+Sy1FND1s/gA38q8Zoe spvQtfissqkK1n+IrNqIq4moktXWzCxtxpzVVBt5/KAY706kCUBX1rzQPW+rv2qOQ1p5 gOu84fuHVL4o0DzE0u2rih7QCqYXGE15do7PMfiWeMkPFPIYqOUKuZVAVWD59JRt8JE+ w8YVmqXruF6JvyPLLPf0RINFxaJkRfGdPb2qF4nkQvKBSomUFUtNShGzBA5+ZWW05NdN K0/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=QVopz1CAoz//T1EBDEkfGG9dps8Q8j2V/W7iedxSD2Y=; b=kBwh3CWG+jqa2j4RRvTRexGpvxnbRR0opusV4c4PyuW38ZzLii8TF6VBF+GvCx0AcK 3FQp23BNE60puYRWiPrWtNfVA+mMCX4hWmYi0JWYwYkjUiDXkiNO6AqQdCVs0WrpwYKW hbt6nQ+7i1pIZbbdTn30vEr8l8lFWqQ6RYnXtYdN5iRHU1kKQWFl4mcSKUPai3U5MVdL FJ82gHxI9QFMvg2o83IpERgyfM/v2Sp9EuE5mAVyBb8V9NWghMi62aJO9razY6f/Cp8x RU+irJwKzrDy1EJPz2LdKmNb3UPAg8yLN075hrd3s5sm+2aHFF9sUU+9fi/uoVEiZcS2 mh7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@redhat.com header.s=mimecast20190719 header.b=EeyppRzp; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h8si827091qtr.32.2020.03.04.04.00.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Mar 2020 04:00:51 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@redhat.com header.s=mimecast20190719 header.b=EeyppRzp; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:33300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9Shn-0005Uw-6e for patch@linaro.org; Wed, 04 Mar 2020 07:00:51 -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-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 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: , Reply-To: The development of GNU GRUB Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" 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; 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 = 8; out->red_field_pos = 0; out->green_mask_size = 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;