[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/3] multiboot2: parse vga= option when setting GOP mode


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 7 Jun 2023 12:10:28 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TRbe3Kmu+Sx6WUUptByxwKbGx12xnGMNkv8suN/TSWE=; b=EV0VJ0I1Nm2HUA54wpwji6hSy/glMR5kwr3wsnfmRLycObbytwpAD2htFf0OCR+OhU6M51LzXVS2cK3SKoskum1RMh1yQqCwCgUoaqXgdBiLJt4fDDeG+NwKg+aj01NlvW7BpJutxPY3/pQvYgKBQOtRAeYnXIXoGf6k0kibTGVPwFV8jGsrMO5tQiYi/jPmKUbBVm3Kt/aHJWnhgDyq1amv7rSsQTAFGFGPejBbpaNIOrxfHMeEnDvYt6ZwAMwFG6TmPsShkpl1PGGsJ2FPASVhlXuBJLeIJEvy/W0zNryn2z+1I/QfYCkqCYwwdOSFW/PSiHmapA4tSnr4G9a6RQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bz8UMz/cHOLiWErazJMJ9g0Peklsk085iknONArTUNAjBv9rAAWykxp6K8dHw2HDWA0Nd3Y2rMalti46e9lcp4jYJRgUvOoKsUtpyaJq+L8l16PTkcokzrj8EtyGsBpa/uao2YcmCX0Z2/7CWdEWouVnOaK6I2bcL3Lk47yHcNMaTlrv69yC6MUUR5j2YER7NE9WPrScabaXZaAiZiA7seAhlHtpfLhlemyFAjEXLhdEEYVm5Cf5kS3P4Ubrp91OMz70XLXFBfHLhr6apiAgL/09m/ofPKeZ+RBi1xae+nzs5hB6kAHaiPPtAx46VTlaqcjb3hpmY4+8w+LN28hDMQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 07 Jun 2023 10:11:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01.06.2023 15:05, Roger Pau Monne wrote:
> @@ -807,7 +830,41 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, 
> EFI_SYSTEM_TABLE *SystemTable
>  
>      if ( gop )
>      {
> -        gop_mode = efi_find_gop_mode(gop, 0, 0, 0);
> +        const char *last = cmdline;
> +        unsigned int width = 0, height = 0, depth = 0;
> +        bool keep_current = false;
> +
> +        while ( (last = get_option(last, "vga=")) != NULL )
> +        {
> +            if ( !strncmp(last, "gfx-", 4) )
> +            {
> +                width = simple_strtoul(last + 4, &last, 10);
> +                if ( *last == 'x' )
> +                    height = simple_strtoul(last + 1, &last, 10);
> +                if ( *last == 'x' )
> +                    depth = simple_strtoul(last + 1, &last, 10);
> +                if ( *last != ' ' && *last != '\t' && *last != '\0' &&
> +                     *last != ',' )

You check for an appropriate terminator here.

> +                    width = height = depth = 0;
> +                keep_current = false;
> +            }
> +            else if ( !strncmp(last, "current", 7) )

Don't you also need to do so here, and maybe even ...

> +                keep_current = true;
> +            else if ( !strncmp(last, "keep", 4) )
> +            {
> +                /* Ignore. */

... here?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.