From patchwork Tue Feb 25 12:25:49 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: 183825 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1703883ile; Tue, 25 Feb 2020 04:44:38 -0800 (PST) X-Google-Smtp-Source: APXvYqyOD+sxf4/Q8rPAdnT+lNWgmNYhhfFYOrVEDeQr1GnnIYDUDMkEYakamnXL1IFFbEkUSjFg X-Received: by 2002:a05:620a:14ad:: with SMTP id x13mr7800570qkj.448.1582634678420; Tue, 25 Feb 2020 04:44:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582634678; cv=none; d=google.com; s=arc-20160816; b=0VzweV+WLZaz1zPuMX0aUZeYwg+AZlFR6quabtNPkspbfqWl47UE9iXgWhz5gB9f1x 5n4ZGjEMmcKch7BPJeWpu/7/oYIGKavGCuZtqCjl9XWHUQ8P8J73hRjRk2fDSjxxoWQi DvyQNj03ZGnWw9hZhmi2mrU6eVQ7t8YIPlByTNE+eP0KYe2K2MpFSkZ9VnB3jliUCkTA XwK9cFhpu8dAboEejy0iu2uO+Ifm8IMg2PvwLZFlLAVDBEyUb5qJt/E0fjb+Lx11sw5Z oACMIQFDdZ5ImOMlBVaqQuip2vgfthQ8NfYkWVxyYH+RAmb6UUGl8CZJ6csUAG70bnZq s4hg== 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=Bu+Q3TH9X/OXlfD1moA4Q3kT0FPh85ALVyL3suFgMNg=; b=p2NUh3PvwkgAMzvYHEcoh2OA2fRbX+4u7sX0i6O4xSMTGhqxAG35Ct4jVtFU3gpiU7 sUpJi3oicM9HcbC22FEGEjLeK/c6kQKzXk96Er1sYnYN8mhLunav75rLmDINuZWwBy0F M0r0oK/1a7qgmpHkVMYGIjDTFs18rXvpXgkL9jX7iHybIyUKcDQJx5T50d7LEHHY9SpA Q61PN0wluPpE3KMFuXR5Bt11CshasjmJbEvMY30/F1i1j6dJxN9Drm/ZcBNh0kdQyEV1 S90rYxtuqwgDVBv0IIyU7RteYmgYDzLgZL38L8uDeF6lj2Wl4uG7Z2wa+wCKY2vOMLBO gLPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@redhat.com header.s=mimecast20190719 header.b="HC2X/B8j"; 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 x15si7100747qtj.91.2020.02.25.04.44.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Feb 2020 04:44:38 -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="HC2X/B8j"; 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]:54512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ZZl-0008QS-T9 for patch@linaro.org; Tue, 25 Feb 2020 07:44:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55668) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ZI2-00045Z-Ln for grub-devel@gnu.org; Tue, 25 Feb 2020 07:26:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6ZI1-0006h4-9d for grub-devel@gnu.org; Tue, 25 Feb 2020 07:26:18 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56942 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 1j6ZI1-0006eh-45 for grub-devel@gnu.org; Tue, 25 Feb 2020 07:26:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582633576; 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=6IhV3k/3C79yEK3ISkpF/VtbqB0UEbpF8QalGNkfNaQ=; b=HC2X/B8jOiZWERhgqqaKREbJ1xpXqaN+L7QojS8XxHAJfOalkCXvzMHGVdO57fEjzpJzM8 +PX4ZlAnFBy0/TNxlp0qmh+veQCu6VpcayDJcmhwSo3P07Gedcwv+C+TH8djKwEdKbywP2 Uw/vY90uEfU1PFqfZavubCc9pPSvv5g= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-334-FZdZeufgOpCQjKddQa6AaQ-1; Tue, 25 Feb 2020 07:26:11 -0500 X-MC-Unique: FZdZeufgOpCQjKddQa6AaQ-1 Received: by mail-wr1-f72.google.com with SMTP id m15so7177777wrs.22 for ; Tue, 25 Feb 2020 04:26:11 -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=cbeCWkVldEVLAylo2aAwP4SCCXuqxp7HQkekRzI/1NI=; b=Fq9r1kO/P5tyUFA49JDddOftSga6qZWaFZmTYk56gS2FSiCy5CN1xYFuCxp4DVPxa7 rtTWQVceCnieB3250gXagz78jk3GpW6m8uZjXBMNqJTNqjwOjFOth+/2rgxFBepXk4vD TfpE1VuL3ppOcFVo15ORzyhCeRSewx2LPLX0+RjW3JG8YWdaqU5fYA/10o7m3Hn4TT4c 7z+eQ8AZRnQy/WOY5IxlEenF8ifNn9wGSaBni9SjPowDht4pyNPLQPnwx4i4PfTZQrBP uxgLwfLzHIRh4w2hvMDwqr0kpJ/ZNN1hJ/4Ei/3i+9FmX0yoWzMlJF83fPrCQHi6l4ew c5+g== X-Gm-Message-State: APjAAAX/HOwLkOn8LBnhbgmz5+TQ05HwkVRW4YfQP4cC/VWngUNBF9pY zaqjrGM5bho7ivDq808lROTx9tHKGLwLx162DPiohmPc7uZRGVxPVdBFp3edhD8IDBSA/zn4aR2 2PJmzR8LmoTg= X-Received: by 2002:a1c:2645:: with SMTP id m66mr4974998wmm.98.1582633570519; Tue, 25 Feb 2020 04:26:10 -0800 (PST) X-Received: by 2002:a1c:2645:: with SMTP id m66mr4974984wmm.98.1582633570277; Tue, 25 Feb 2020 04:26:10 -0800 (PST) Received: from minerva.redhat.com ([2a01:c50f:ab80:6700:527f:85b3:5615:ff0b]) by smtp.gmail.com with ESMTPSA id q6sm17251653wrf.67.2020.02.25.04.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 04:26:09 -0800 (PST) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Daniel Kiper , Alexander Graf , Javier Martinez Canillas Subject: [PATCH 06/10] efi/gop: Add support for BLT_ONLY adapters Date: Tue, 25 Feb 2020 13:25:49 +0100 Message-Id: <20200225122553.1120216-7-javierm@redhat.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200225122553.1120216-1-javierm@redhat.com> References: <20200225122553.1120216-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 --- 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;