public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
	dri-devel@lists.freedesktop.org
Cc: kernel-dev@igalia.com, Ard Biesheuvel <ardb@kernel.org>,
	Melissa Wen <mwen@igalia.com>,
	linux-efi@vger.kernel.org
Subject: Re: [PATCH v4 4/4] efi: sysfb_efi: Fix efidrmfb and simpledrmfb on Valve Steam Deck
Date: Mon, 8 Dec 2025 10:57:59 +0100	[thread overview]
Message-ID: <bccdbb15-6b91-4dc1-a9fd-7184da1c9f2d@suse.de> (raw)
In-Reply-To: <20251205153611.93297-5-tvrtko.ursulin@igalia.com>

Hi

Am 05.12.25 um 16:36 schrieb Tvrtko Ursulin:
> Valve Steam Deck has a 800x1280 portrait screen installed in a landscape
> orientation. The firmware offers a software rotated 1280x800 mode which

"software-rotated"

comma before 'which'

> GRUB can be made to switch to when displaying a boot menu. If this mode
> was selected frame buffer drivers will see this fake mode and fbcon
> rendering will be corrupted.
>
> Lets therefore add a selective quirk inside the current "swap with and

"Let us" or "Let's"

> height" handling, which will detect this exact mode and fix it up back to
> the native one.
>
> This will allow the DRM based frame buffer drivers to detect the correct

"DRM-based framebuffer"

> mode and, apply the existing panel orientation quirk, and render the

No 'and' after mode

> console in landscape mode with no corruption.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Melissa Wen <mwen@igalia.com>
> Cc: linux-efi@vger.kernel.org
> Tested-by: Melissa Wen <mwen@igalia.com> # v3

With typos fixed:

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

Thanks for fixing this.

Best regards
Thomas

> ---
>   drivers/firmware/efi/sysfb_efi.c | 47 ++++++++++++++++++++++++++++++++
>   1 file changed, 47 insertions(+)
>
> diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c
> index 5c54f42d5fef..db28e11d1eb7 100644
> --- a/drivers/firmware/efi/sysfb_efi.c
> +++ b/drivers/firmware/efi/sysfb_efi.c
> @@ -242,6 +242,33 @@ static int __init efifb_swap_width_height(const struct dmi_system_id *id)
>   	return 1;
>   }
>   
> +struct efifb_mode_fixup {
> +	unsigned int width;
> +	unsigned int height;
> +	unsigned int linelength;
> +};
> +
> +static int __init
> +efifb_check_and_swap_width_height(const struct dmi_system_id *id)
> +{
> +	const struct efifb_mode_fixup *data = id->driver_data;
> +
> +	if (data->width == screen_info.lfb_width &&
> +	    data->height == screen_info.lfb_height) {
> +		swap(screen_info.lfb_width, screen_info.lfb_height);
> +		screen_info.lfb_linelength = data->linelength;
> +		screen_info.lfb_size = data->linelength * data->width;
> +	}
> +
> +	return 1;
> +}
> +
> +static const struct efifb_mode_fixup efifb_steamdeck_mode_fixup __initconst = {
> +	.width = 1280,
> +	.height = 800,
> +	.linelength = 3328,
> +};
> +
>   /*
>    * Some devices have a portrait LCD but advertise a landscape resolution (and
>    * pitch). We simply swap width and height for these devices so that we can
> @@ -297,6 +324,26 @@ static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
>   		},
>   		.callback = efifb_swap_width_height,
>   	},
> +	{
> +		/* Valve Steam Deck (Jupiter) */
> +		.matches = {
> +			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Valve"),
> +			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Jupiter"),
> +			DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "1"),
> +		},
> +		.callback = efifb_check_and_swap_width_height,
> +		.driver_data = (void *)&efifb_steamdeck_mode_fixup,
> +	},
> +	{
> +		/* Valve Steam Deck (Galileo) */
> +		.matches = {
> +			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Valve"),
> +			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Galileo"),
> +			DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "1"),
> +		},
> +		.callback = efifb_check_and_swap_width_height,
> +		.driver_data = (void *)&efifb_steamdeck_mode_fixup,
> +	},
>   	{},
>   };
>   

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



      reply	other threads:[~2025-12-08  9:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05 15:36 [PATCH v4 0/4] EFI fbcon fixes etc Tvrtko Ursulin
2025-12-05 15:36 ` [PATCH v4 1/4] efi: sysfb_efi: Replace open coded swap with the macro Tvrtko Ursulin
2025-12-05 15:36 ` [PATCH v4 3/4] efi: sysfb_efi: Convert swap width and height quirk to a callback Tvrtko Ursulin
2025-12-05 15:36 ` [PATCH v4 4/4] efi: sysfb_efi: Fix efidrmfb and simpledrmfb on Valve Steam Deck Tvrtko Ursulin
2025-12-08  9:57   ` Thomas Zimmermann [this message]

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=bccdbb15-6b91-4dc1-a9fd-7184da1c9f2d@suse.de \
    --to=tzimmermann@suse.de \
    --cc=ardb@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-dev@igalia.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=mwen@igalia.com \
    --cc=tvrtko.ursulin@igalia.com \
    /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