From nobody Sat Feb 7 20:34:49 2026 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91DBA2FE055 for ; Wed, 15 Oct 2025 16:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544505; cv=none; b=jCCkzVpPJ84cqSm4kSl7F6g/l2zM9m+j6fN+aVEgqwtSyfvT0nnMBha6JR5cYP7HmKaLQw8flZFzDo5ohHelRZv3mHmeNBIAjdSnpDC1NImJpQw1dYSvnZQRhMI/nbjsJk17cPR5mwP7r4bN+wsxN59dDisaq6AtTFTBqKmzwrA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544505; c=relaxed/simple; bh=cyTs8NmGKw2C0HrHEVYxrosP3aG8KyV74Z2pTfrlQs8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bVhHztH1J+2Y3iaxbvZRqsj11X0Q6TOGX8VRS9rL04VizUi4H34Oav8/4ABYBJ36X84xT/ejm+/vUJnvx/7reBIR7i724EN0qYi5N/QZGRajt4hUYKbLOULyN+4GPIe62llsoILUBlxKuELIW5A5XDX6a6lqNXkdDdrrWMDcfAE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=rviJWD5m; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=IGcxhY2T; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=rviJWD5m; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=IGcxhY2T; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="rviJWD5m"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="IGcxhY2T"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="rviJWD5m"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="IGcxhY2T" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DCC16210BC; Wed, 15 Oct 2025 16:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760544501; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I6HC34ynM7vkAu7jEV4VW5DKYsiWRFE7jXY5VSzf7m0=; b=rviJWD5mjmjwJOaz/8D5xuvSt/85uAin+kAd0KZk8xdmrBqcu4klm1Xuixj2x21d2Qjfdj BbY47t8Fu2HjH/VnYq5V3zx4qAoO+SGUfydob4rgMA01M3t301PS4VBqHGnZzw6hAvUKbj Dd9jH7Q1v3Vug9OnKcoV6t/KQokhZvc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760544501; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I6HC34ynM7vkAu7jEV4VW5DKYsiWRFE7jXY5VSzf7m0=; b=IGcxhY2T6nh7g7ZF8TTnHtyvhg18E42Dr/MjuAiDMe5brUQpgwYfInnkUO8SjwO/YSHnUl lFBcZ2K/gatHbMAg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=rviJWD5m; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=IGcxhY2T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760544501; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I6HC34ynM7vkAu7jEV4VW5DKYsiWRFE7jXY5VSzf7m0=; b=rviJWD5mjmjwJOaz/8D5xuvSt/85uAin+kAd0KZk8xdmrBqcu4klm1Xuixj2x21d2Qjfdj BbY47t8Fu2HjH/VnYq5V3zx4qAoO+SGUfydob4rgMA01M3t301PS4VBqHGnZzw6hAvUKbj Dd9jH7Q1v3Vug9OnKcoV6t/KQokhZvc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760544501; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I6HC34ynM7vkAu7jEV4VW5DKYsiWRFE7jXY5VSzf7m0=; b=IGcxhY2T6nh7g7ZF8TTnHtyvhg18E42Dr/MjuAiDMe5brUQpgwYfInnkUO8SjwO/YSHnUl lFBcZ2K/gatHbMAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A511D13AE4; Wed, 15 Oct 2025 16:08:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id KDHkJvXG72inaQAAD6G6ig (envelope-from ); Wed, 15 Oct 2025 16:08:21 +0000 From: Thomas Zimmermann To: ardb@kernel.org, jonathan@marek.ca, javierm@redhat.com Cc: linux-efi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 1/5] efi: Fix trailing whitespace in header file Date: Wed, 15 Oct 2025 17:56:30 +0200 Message-ID: <20251015160816.525825-2-tzimmermann@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015160816.525825-1-tzimmermann@suse.de> References: <20251015160816.525825-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: DCC16210BC X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,suse.de:mid,suse.de:dkim]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:mid,suse.de:dkim] X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -3.01 X-Spam-Level: Content-Type: text/plain; charset="utf-8" Resolve an issue with the coding style. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- include/linux/efi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/efi.h b/include/linux/efi.h index a98cc39e7aaa..544498c89ced 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -290,7 +290,7 @@ typedef efi_status_t efi_get_variable_t (efi_char16_t *= name, efi_guid_t *vendor, unsigned long *data_size, void *data); typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, ef= i_char16_t *name, efi_guid_t *vendor); -typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *v= endor,=20 +typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *v= endor, u32 attr, unsigned long data_size, void *data); typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count); --=20 2.51.0 From nobody Sat Feb 7 20:34:49 2026 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A29002FD7DE for ; Wed, 15 Oct 2025 16:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544511; cv=none; b=tCgErHBGTbwHuyItijKaXNrbA+g/b8Ba/j7OsgB6VWS8tqwZYu/2dx5AxJ9niEAIyfs8lk5OJACBeUU1eTCz6qitfniIhjr322R9KYyeNGxRia5c5iyJLXu3viB/BZ35Nze+w21llhats1tzFgS7c7NbNOHs8arq0ckl4orzEVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544511; c=relaxed/simple; bh=vuRKO/cugdJISeHatmOkDyu6JqwV6pkCpQczWDEm6P0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=liwrlbLbAn4JpKzi/w17FoUg9VPcdSyaxUD+2X3+OPhFixW/IuTWvEaBnDON/1OML+NjmzsdMyU3S9/glDACnbDwXvowlHBW+Vvy67xOK137d6/KnKC7WjM4yIeqTGZXkJ6tVfalUMipyBOnH/J6V0NR/627TRIO6hPYMV0DlXM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Hqo147/p; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=2F3VxCDC; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Hqo147/p; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=2F3VxCDC; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Hqo147/p"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="2F3VxCDC"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Hqo147/p"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="2F3VxCDC" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 24928210BD; Wed, 15 Oct 2025 16:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y9o6wbaGBzG+1WYts7/O+R79Vl4+tBO2OwLz1IXi4EM=; b=Hqo147/pGWeC14HMFrWF5ewq9M+xmzKxspSuUhzL0YJDkLSnmDmzbdclBEF5FDkBkr4CnS VqfRXwCU061wkZARWza8PcOFazfXB8Ru1Es7mKWwLOwYb1iwb/vccbuG0YGYYpx9PzdRAl RBck3VUzhIXFEEYi1lt/B/KpEBK6/kM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y9o6wbaGBzG+1WYts7/O+R79Vl4+tBO2OwLz1IXi4EM=; b=2F3VxCDCzbCzVlCNIT9W1z5Kkquhptt/Qw4Sztiy45ccUSycFlKC5haHM9gH4upP2aoyg8 zWPZIfY0rELOpaBQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="Hqo147/p"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=2F3VxCDC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y9o6wbaGBzG+1WYts7/O+R79Vl4+tBO2OwLz1IXi4EM=; b=Hqo147/pGWeC14HMFrWF5ewq9M+xmzKxspSuUhzL0YJDkLSnmDmzbdclBEF5FDkBkr4CnS VqfRXwCU061wkZARWza8PcOFazfXB8Ru1Es7mKWwLOwYb1iwb/vccbuG0YGYYpx9PzdRAl RBck3VUzhIXFEEYi1lt/B/KpEBK6/kM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y9o6wbaGBzG+1WYts7/O+R79Vl4+tBO2OwLz1IXi4EM=; b=2F3VxCDCzbCzVlCNIT9W1z5Kkquhptt/Qw4Sztiy45ccUSycFlKC5haHM9gH4upP2aoyg8 zWPZIfY0rELOpaBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E38DB13A42; Wed, 15 Oct 2025 16:08:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id kGlcNvXG72inaQAAD6G6ig (envelope-from ); Wed, 15 Oct 2025 16:08:21 +0000 From: Thomas Zimmermann To: ardb@kernel.org, jonathan@marek.ca, javierm@redhat.com Cc: linux-efi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 2/5] efi/libstub: gop: Find GOP handle instead of GOP data Date: Wed, 15 Oct 2025 17:56:31 +0200 Message-ID: <20251015160816.525825-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015160816.525825-1-tzimmermann@suse.de> References: <20251015160816.525825-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Level: X-Spam-Flag: NO X-Rspamd-Queue-Id: 24928210BD X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_SEVEN(0.00)[7]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Score: -3.01 Content-Type: text/plain; charset="utf-8" The device handle of the GOP device is required to retrieve the correct EDID data. Find the handle instead of the GOP data. Still return the GOP data in the function arguments, as we already looked it up. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/firmware/efi/libstub/gop.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libs= tub/gop.c index 3785fb4986b4..fd32be8dd146 100644 --- a/drivers/firmware/efi/libstub/gop.c +++ b/drivers/firmware/efi/libstub/gop.c @@ -402,12 +402,13 @@ setup_pixel_info(struct screen_info *si, u32 pixels_p= er_scan_line, } } =20 -static efi_graphics_output_protocol_t *find_gop(unsigned long num, - const efi_handle_t handles[]) +static efi_handle_t find_handle_with_primary_gop(unsigned long num, const = efi_handle_t handles[], + efi_graphics_output_protocol_t **found_gop) { efi_graphics_output_protocol_t *first_gop; - efi_handle_t h; + efi_handle_t h, first_gop_handle; =20 + first_gop_handle =3D NULL; first_gop =3D NULL; =20 for_each_efi_handle(h, handles, num) { @@ -442,19 +443,25 @@ static efi_graphics_output_protocol_t *find_gop(unsig= ned long num, */ status =3D efi_bs_call(handle_protocol, h, &EFI_CONSOLE_OUT_DEVICE_GUID, &dummy); - if (status =3D=3D EFI_SUCCESS) - return gop; - - if (!first_gop) + if (status =3D=3D EFI_SUCCESS) { + if (found_gop) + *found_gop =3D gop; + return h; + } else if (!first_gop_handle) { + first_gop_handle =3D h; first_gop =3D gop; + } } =20 - return first_gop; + if (found_gop) + *found_gop =3D first_gop; + return first_gop_handle; } =20 efi_status_t efi_setup_gop(struct screen_info *si) { efi_handle_t *handles __free(efi_pool) =3D NULL; + efi_handle_t handle; efi_graphics_output_protocol_mode_t *mode; efi_graphics_output_mode_info_t *info; efi_graphics_output_protocol_t *gop; @@ -467,8 +474,8 @@ efi_status_t efi_setup_gop(struct screen_info *si) if (status !=3D EFI_SUCCESS) return status; =20 - gop =3D find_gop(num, handles); - if (!gop) + handle =3D find_handle_with_primary_gop(num, handles, &gop); + if (!handle) return EFI_NOT_FOUND; =20 /* Change mode if requested */ --=20 2.51.0 From nobody Sat Feb 7 20:34:49 2026 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AB983375AB for ; Wed, 15 Oct 2025 16:08:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544515; cv=none; b=PVrjO2awAaLoJ74O96jV+9dIKhi49TLpjgO4cMQMW681dz3v1gR5Er7qJCbAV2Rt/heINYxZ2dK9kxA0hexYGr/rVf/x7nRdH2kxfjgWSUCtvOIo54/CaNb1HpWlcVDh1Pe39isTdAeLxNGlJkFpNSbrss1WV5S1htFJv31N2AE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544515; c=relaxed/simple; bh=Z5C8e0XiSxAjnpxu2bSEtV+3exrcivSCS10a+Exawng=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BbdKz9BTvwlH+SBDY2KM0hfAjetlOv0wSD3ftvc3tXkBafCvZrNb/THbBPZ6Av5qTks1vJn5pdldaX0Q/CXxW60uPtKlsXIAgL43yR7DOhGbfdMqzzadkabsutwQON0P41Z0GZ7PiN3/k4miHVV77ramcxVxtOhXhvrvBcInxIM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=bgvFNA9a; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=52fjVt4M; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=bgvFNA9a; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=52fjVt4M; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="bgvFNA9a"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="52fjVt4M"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="bgvFNA9a"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="52fjVt4M" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 65FEC2119A; Wed, 15 Oct 2025 16:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JI/tzd589AP9VmmQUX88anLh/JqoSsRu/o/hT6jUtjc=; b=bgvFNA9aWqxSOLSEOdrPvQcVQ75uf7tfm7EZkBfjiue9x7g9nZYUeTe8hR+smvHDJNLOOP rHdoX6KBBMXWuVCnvKdESpD3QqVKpurjRNMlCBvnTya+Y9XXcJPUtPvSl8GeBfc/cW/HYK QMsbbVXE105TzT28EoMZeYaTybrBVBE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JI/tzd589AP9VmmQUX88anLh/JqoSsRu/o/hT6jUtjc=; b=52fjVt4MZnWZuBLcgc8uqp4y+jw0rLka0xR5IB1aT9/1pQP6NAcU8KVzZlg4tWRR8AZSD1 DtxrHMfrnxmer0CA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=bgvFNA9a; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=52fjVt4M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JI/tzd589AP9VmmQUX88anLh/JqoSsRu/o/hT6jUtjc=; b=bgvFNA9aWqxSOLSEOdrPvQcVQ75uf7tfm7EZkBfjiue9x7g9nZYUeTe8hR+smvHDJNLOOP rHdoX6KBBMXWuVCnvKdESpD3QqVKpurjRNMlCBvnTya+Y9XXcJPUtPvSl8GeBfc/cW/HYK QMsbbVXE105TzT28EoMZeYaTybrBVBE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JI/tzd589AP9VmmQUX88anLh/JqoSsRu/o/hT6jUtjc=; b=52fjVt4MZnWZuBLcgc8uqp4y+jw0rLka0xR5IB1aT9/1pQP6NAcU8KVzZlg4tWRR8AZSD1 DtxrHMfrnxmer0CA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2AF2B13AE4; Wed, 15 Oct 2025 16:08:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id sEJFCfbG72inaQAAD6G6ig (envelope-from ); Wed, 15 Oct 2025 16:08:22 +0000 From: Thomas Zimmermann To: ardb@kernel.org, jonathan@marek.ca, javierm@redhat.com Cc: linux-efi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 3/5] efi/libstub: gop: Initialize screen_info in helper function Date: Wed, 15 Oct 2025 17:56:32 +0200 Message-ID: <20251015160816.525825-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015160816.525825-1-tzimmermann@suse.de> References: <20251015160816.525825-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Level: X-Spam-Flag: NO X-Rspamd-Queue-Id: 65FEC2119A X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_SEVEN(0.00)[7]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLxjygmbcnsta4qeme9o4pgs8z)]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Score: -3.01 Content-Type: text/plain; charset="utf-8" Move initialization of screen_info into a single helper function. Frees up space in the main setup helper for adding EDID support. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/firmware/efi/libstub/gop.c | 76 +++++++++++++----------------- 1 file changed, 33 insertions(+), 43 deletions(-) diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libs= tub/gop.c index fd32be8dd146..02459ef0f18c 100644 --- a/drivers/firmware/efi/libstub/gop.c +++ b/drivers/firmware/efi/libstub/gop.c @@ -367,24 +367,31 @@ static void find_bits(u32 mask, u8 *pos, u8 *size) *size =3D __fls(mask) - *pos + 1; } =20 -static void -setup_pixel_info(struct screen_info *si, u32 pixels_per_scan_line, - efi_pixel_bitmask_t pixel_info, int pixel_format) +static void setup_screen_info(struct screen_info *si, const efi_graphics_o= utput_protocol_t *gop) { - if (pixel_format =3D=3D PIXEL_BIT_MASK) { - find_bits(pixel_info.red_mask, - &si->red_pos, &si->red_size); - find_bits(pixel_info.green_mask, - &si->green_pos, &si->green_size); - find_bits(pixel_info.blue_mask, - &si->blue_pos, &si->blue_size); - find_bits(pixel_info.reserved_mask, - &si->rsvd_pos, &si->rsvd_size); - si->lfb_depth =3D si->red_size + si->green_size + - si->blue_size + si->rsvd_size; - si->lfb_linelength =3D (pixels_per_scan_line * si->lfb_depth) / 8; + const efi_graphics_output_protocol_mode_t *mode =3D efi_table_attr(gop, m= ode); + const efi_graphics_output_mode_info_t *info =3D efi_table_attr(mode, info= ); + + si->orig_video_isVGA =3D VIDEO_TYPE_EFI; + + si->lfb_width =3D info->horizontal_resolution; + si->lfb_height =3D info->vertical_resolution; + + efi_set_u64_split(efi_table_attr(mode, frame_buffer_base), + &si->lfb_base, &si->ext_lfb_base); + if (si->ext_lfb_base) + si->capabilities |=3D VIDEO_CAPABILITY_64BIT_BASE; + si->pages =3D 1; + + if (info->pixel_format =3D=3D PIXEL_BIT_MASK) { + find_bits(info->pixel_information.red_mask, &si->red_pos, &si->red_size); + find_bits(info->pixel_information.green_mask, &si->green_pos, &si->green= _size); + find_bits(info->pixel_information.blue_mask, &si->blue_pos, &si->blue_si= ze); + find_bits(info->pixel_information.reserved_mask, &si->rsvd_pos, &si->rsv= d_size); + si->lfb_depth =3D si->red_size + si->green_size + si->blue_size + si->rs= vd_size; + si->lfb_linelength =3D (info->pixels_per_scan_line * si->lfb_depth) / 8; } else { - if (pixel_format =3D=3D PIXEL_RGB_RESERVED_8BIT_PER_COLOR) { + if (info->pixel_format =3D=3D PIXEL_RGB_RESERVED_8BIT_PER_COLOR) { si->red_pos =3D 0; si->blue_pos =3D 16; } else /* PIXEL_BGR_RESERVED_8BIT_PER_COLOR */ { @@ -394,12 +401,16 @@ setup_pixel_info(struct screen_info *si, u32 pixels_p= er_scan_line, =20 si->green_pos =3D 8; si->rsvd_pos =3D 24; - si->red_size =3D si->green_size =3D - si->blue_size =3D si->rsvd_size =3D 8; - + si->red_size =3D 8; + si->green_size =3D 8; + si->blue_size =3D 8; + si->rsvd_size =3D 8; si->lfb_depth =3D 32; - si->lfb_linelength =3D pixels_per_scan_line * 4; + si->lfb_linelength =3D info->pixels_per_scan_line * 4; } + + si->lfb_size =3D si->lfb_linelength * si->lfb_height; + si->capabilities |=3D VIDEO_CAPABILITY_SKIP_QUIRKS; } =20 static efi_handle_t find_handle_with_primary_gop(unsigned long num, const = efi_handle_t handles[], @@ -462,8 +473,6 @@ efi_status_t efi_setup_gop(struct screen_info *si) { efi_handle_t *handles __free(efi_pool) =3D NULL; efi_handle_t handle; - efi_graphics_output_protocol_mode_t *mode; - efi_graphics_output_mode_info_t *info; efi_graphics_output_protocol_t *gop; efi_status_t status; unsigned long num; @@ -482,27 +491,8 @@ efi_status_t efi_setup_gop(struct screen_info *si) set_mode(gop); =20 /* EFI framebuffer */ - mode =3D efi_table_attr(gop, mode); - info =3D efi_table_attr(mode, info); - - si->orig_video_isVGA =3D VIDEO_TYPE_EFI; - - si->lfb_width =3D info->horizontal_resolution; - si->lfb_height =3D info->vertical_resolution; - - efi_set_u64_split(efi_table_attr(mode, frame_buffer_base), - &si->lfb_base, &si->ext_lfb_base); - if (si->ext_lfb_base) - si->capabilities |=3D VIDEO_CAPABILITY_64BIT_BASE; - - si->pages =3D 1; - - setup_pixel_info(si, info->pixels_per_scan_line, - info->pixel_information, info->pixel_format); - - si->lfb_size =3D si->lfb_linelength * si->lfb_height; - - si->capabilities |=3D VIDEO_CAPABILITY_SKIP_QUIRKS; + if (si) + setup_screen_info(si, gop); =20 return EFI_SUCCESS; } --=20 2.51.0 From nobody Sat Feb 7 20:34:49 2026 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 087492BDC13 for ; Wed, 15 Oct 2025 16:08:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544521; cv=none; b=cEiYRP/o1ui9Yfp1BVE65LHjQziC3sADOODnLVdKUGwvSHuXQPdj5FpFuypyeUjSnjy3G7OdoV8CHvkKVlYA452fMwCsYv3sPpHYuZaNhJu3JLvcqYmr6rXXeMsiZia0gtIjg2ID5I0ypov+Oi1GIYbCQxA3kOjlEyemhGUUCEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760544521; c=relaxed/simple; bh=JhsOuA5z61Kk9JQnRK9gVbQ01jDd6GE0mrVP+WTwPOI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eLO898L8Dcyzh/h+QAQaSGnVugUTs2rTG9I9cyAlklxIVMTGpfpogBCs0/vhdKPJHJ1QGSHJx6vIPeiDz2PIXgDKydTHXcZUwrXBCd6Ivgw9dhwqV24O7mwW580VPVB7t+Q7OYbEMtqcF0Moz94/njVfelPQs7uFWqFjxYHUu2o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=o2yJ/xT/; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Y3TlpXBX; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=o2yJ/xT/; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Y3TlpXBX; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="o2yJ/xT/"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Y3TlpXBX"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="o2yJ/xT/"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Y3TlpXBX" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A434121A23; Wed, 15 Oct 2025 16:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NDsHzloWPnOJ16Vkpd5HNgcU6cVhWGnjIUW2zqEs0zU=; b=o2yJ/xT/8Fh/6LpH9PhWQCV5QOPfesPtceucm5PDxV4jo3Kpw+f+DXjubbX6VbP4aqfeEs q991aXjflqqhfFuP2jODTBIaYt8YUK32vYonHMjyL0gGfH0VgWo2W1CIzI+5fSTk/Rs8Xr iOiYYOmPRXHp3A54SuYwWO4hxhdIoP8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NDsHzloWPnOJ16Vkpd5HNgcU6cVhWGnjIUW2zqEs0zU=; b=Y3TlpXBXu6eMn/nil79+Bf05JyvtWJZDC0foP3d2OjBlNFRzibx3rmaL8vwpxQw7hHQ/9C qQgt/Buwty4FdCBg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NDsHzloWPnOJ16Vkpd5HNgcU6cVhWGnjIUW2zqEs0zU=; b=o2yJ/xT/8Fh/6LpH9PhWQCV5QOPfesPtceucm5PDxV4jo3Kpw+f+DXjubbX6VbP4aqfeEs q991aXjflqqhfFuP2jODTBIaYt8YUK32vYonHMjyL0gGfH0VgWo2W1CIzI+5fSTk/Rs8Xr iOiYYOmPRXHp3A54SuYwWO4hxhdIoP8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1760544502; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NDsHzloWPnOJ16Vkpd5HNgcU6cVhWGnjIUW2zqEs0zU=; b=Y3TlpXBXu6eMn/nil79+Bf05JyvtWJZDC0foP3d2OjBlNFRzibx3rmaL8vwpxQw7hHQ/9C qQgt/Buwty4FdCBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6D68C13A42; Wed, 15 Oct 2025 16:08:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id eEZVGfbG72inaQAAD6G6ig (envelope-from ); Wed, 15 Oct 2025 16:08:22 +0000 From: Thomas Zimmermann To: ardb@kernel.org, jonathan@marek.ca, javierm@redhat.com Cc: linux-efi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH 4/5] efi/libstub: gop: Add support for reading EDID Date: Wed, 15 Oct 2025 17:56:33 +0200 Message-ID: <20251015160816.525825-5-tzimmermann@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015160816.525825-1-tzimmermann@suse.de> References: <20251015160816.525825-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email] X-Spam-Flag: NO X-Spam-Score: -2.80 X-Spam-Level: Content-Type: text/plain; charset="utf-8" Add support for EFI_EDID_DISCOVERED_PROTOCOL and EFI_EDID_ACTIVE_PROTOCOL as defined in UEFI 2.8, sec 12.9. Define GUIDs and data structures in the rsp header files. In the GOP setup function, read the EDID of the primary GOP device. First try EFI_EDID_ACTIVE_PROTOCOL, which supports user-specified EDID data. Or else try EFI_EDID_DISCOVERED_PROTOCOL, which returns the display device's native EDID. If no EDID could be retrieved, clear the storage. Rename efi_setup_gop() to efi_setup_graphics() to reflect the changes Let callers pass an optional instance of struct edid_data, if they are interested. While screen_info and edid_info come from the same device handle, they should be considered indendent data. The former refers to the graphics mode, the latter refers to the display device. GOP devices might not provide both. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/firmware/efi/libstub/efi-stub.c | 2 +- drivers/firmware/efi/libstub/efistub.h | 31 ++++++++++++++++++++- drivers/firmware/efi/libstub/gop.c | 36 ++++++++++++++++++++++++- drivers/firmware/efi/libstub/x86-stub.c | 2 +- include/linux/efi.h | 2 ++ 5 files changed, 69 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi= /libstub/efi-stub.c index 874f63b4a383..9cb814c5ba1b 100644 --- a/drivers/firmware/efi/libstub/efi-stub.c +++ b/drivers/firmware/efi/libstub/efi-stub.c @@ -56,7 +56,7 @@ static struct screen_info *setup_graphics(void) { struct screen_info *si, tmp =3D {}; =20 - if (efi_setup_gop(&tmp) !=3D EFI_SUCCESS) + if (efi_setup_graphics(&tmp, NULL) !=3D EFI_SUCCESS) return NULL; =20 si =3D alloc_screen_info(); diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/= libstub/efistub.h index f5ba032863a9..b2fb0c3fa721 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -34,6 +34,9 @@ #define EFI_ALLOC_LIMIT ULONG_MAX #endif =20 +struct edid_info; +struct screen_info; + extern bool efi_no5lvl; extern bool efi_nochunk; extern bool efi_nokaslr; @@ -578,6 +581,32 @@ union efi_graphics_output_protocol { } mixed_mode; }; =20 +typedef union efi_edid_discovered_protocol efi_edid_discovered_protocol_t; + +union efi_edid_discovered_protocol { + struct { + u32 size_of_edid; + u8 *edid; + }; + struct { + u32 size_of_edid; + u32 edid; + } mixed_mode; +}; + +typedef union efi_edid_active_protocol efi_edid_active_protocol_t; + +union efi_edid_active_protocol { + struct { + u32 size_of_edid; + u8 *edid; + }; + struct { + u32 size_of_edid; + u32 edid; + } mixed_mode; +}; + typedef union { struct { u32 revision; @@ -1085,7 +1114,7 @@ efi_status_t efi_parse_options(char const *cmdline); =20 void efi_parse_option_graphics(char *option); =20 -efi_status_t efi_setup_gop(struct screen_info *si); +efi_status_t efi_setup_graphics(struct screen_info *si, struct edid_info *= edid); =20 efi_status_t handle_cmdline_files(efi_loaded_image_t *image, const efi_char16_t *optstr, diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libs= tub/gop.c index 02459ef0f18c..72d74436a7a4 100644 --- a/drivers/firmware/efi/libstub/gop.c +++ b/drivers/firmware/efi/libstub/gop.c @@ -12,6 +12,7 @@ #include #include #include +#include