mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javierm@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
	ardb@kernel.org, jonathan@marek.ca
Cc: linux-efi@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: Re: [PATCH 3/5] efi/libstub: gop: Initialize screen_info in helper function
Date: Fri, 24 Oct 2025 11:53:33 +0200	[thread overview]
Message-ID: <87tszo8w2q.fsf@ocarina.mail-host-address-is-not-set> (raw)
In-Reply-To: <20251015160816.525825-4-tzimmermann@suse.de>

Thomas Zimmermann <tzimmermann@suse.de> writes:

> 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 <tzimmermann@suse.de>
> ---
>  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/libstub/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 = __fls(mask) - *pos + 1;
>  }
>  
> -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_output_protocol_t *gop)
>  {
> -	if (pixel_format == 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 = si->red_size + si->green_size +
> -			si->blue_size + si->rsvd_size;
> -		si->lfb_linelength = (pixels_per_scan_line * si->lfb_depth) / 8;
> +	const efi_graphics_output_protocol_mode_t *mode = efi_table_attr(gop, mode);
> +	const efi_graphics_output_mode_info_t *info = efi_table_attr(mode, info);
> +
> +	si->orig_video_isVGA = VIDEO_TYPE_EFI;
> +

Not related with your patch but I dislike so much the name of this field,
since it started as a "is VGA?" bool and ended being an enum afterwards.

But I beleve we discussed this already and decided that it would be too
much churn to change it at this point.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


  reply	other threads:[~2025-10-24  9:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 15:56 [PATCH 0/5] efi: x86: Provide EDID from GOP device Thomas Zimmermann
2025-10-15 15:56 ` [PATCH 1/5] efi: Fix trailing whitespace in header file Thomas Zimmermann
2025-10-24  9:19   ` Javier Martinez Canillas
2025-10-15 15:56 ` [PATCH 2/5] efi/libstub: gop: Find GOP handle instead of GOP data Thomas Zimmermann
2025-10-24  9:47   ` Javier Martinez Canillas
2025-10-24 12:06     ` Thomas Zimmermann
2025-10-15 15:56 ` [PATCH 3/5] efi/libstub: gop: Initialize screen_info in helper function Thomas Zimmermann
2025-10-24  9:53   ` Javier Martinez Canillas [this message]
2025-11-17  7:37     ` Thomas Zimmermann
2025-10-15 15:56 ` [PATCH 4/5] efi/libstub: gop: Add support for reading EDID Thomas Zimmermann
2025-10-24  9:56   ` Javier Martinez Canillas
2025-11-17  7:40     ` Thomas Zimmermann
2025-10-15 15:56 ` [PATCH 5/5] efi/libstub: x86: Store EDID in boot_params Thomas Zimmermann
2025-10-24  9:57   ` Javier Martinez Canillas
2025-11-14  8:31 ` [PATCH 0/5] efi: x86: Provide EDID from GOP device Ard Biesheuvel
2025-11-17  8:01   ` Thomas Zimmermann
2025-11-18 16:52     ` Ard Biesheuvel
2025-11-18 19:41       ` Ard Biesheuvel

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-all 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=87tszo8w2q.fsf@ocarina.mail-host-address-is-not-set \
    --to=javierm@redhat.com \
    --cc=ardb@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jonathan@marek.ca \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®