[SeaBIOS] [PATCH] vgasrc/svgamodes: added 4k resolution

vitaly@cyberhaven.com posted 1 patch 6 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/20210314124807.3225508-1-vitaly@cyberhaven.com
vgasrc/bochsvga.h  | 4 ++--
vgasrc/svgamodes.c | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)

[SeaBIOS] [PATCH] vgasrc/svgamodes: added 4k resolution

Posted by vitaly@cyberhaven.com 6 months, 1 week ago
From: Vitaly Chipounov <vitaly@cyberhaven.com>

This requires at least 32MB of video memory.

Tested with Windows 10's default display driver and virtio-vga.

Signed-off-by: Vitaly Chipounov <vitaly@cyberhaven.com>
---
 vgasrc/bochsvga.h  | 4 ++--
 vgasrc/svgamodes.c | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/vgasrc/bochsvga.h b/vgasrc/bochsvga.h
index ae5f75d..f08219f 100644
--- a/vgasrc/bochsvga.h
+++ b/vgasrc/bochsvga.h
@@ -6,8 +6,8 @@
 #define VBE_DISPI_BANK_ADDRESS           0xA0000
 #define VBE_DISPI_BANK_SIZE_KB           64
 
-#define VBE_DISPI_MAX_XRES               2560
-#define VBE_DISPI_MAX_YRES               1600
+#define VBE_DISPI_MAX_XRES               3840
+#define VBE_DISPI_MAX_YRES               2160
 
 #define VBE_DISPI_IOPORT_INDEX           0x01CE
 #define VBE_DISPI_IOPORT_DATA            0x01CF
diff --git a/vgasrc/svgamodes.c b/vgasrc/svgamodes.c
index 6e494c7..63ef040 100644
--- a/vgasrc/svgamodes.c
+++ b/vgasrc/svgamodes.c
@@ -92,5 +92,6 @@ struct generic_svga_mode svga_modes[] VAR16 = {
     { 0x196, { MM_DIRECT, 2560, 1440, 16, 8, 16, SEG_GRAPH } },
     { 0x197, { MM_DIRECT, 2560, 1440, 24, 8, 16, SEG_GRAPH } },
     { 0x198, { MM_DIRECT, 2560, 1440, 32, 8, 16, SEG_GRAPH } },
+    { 0x199, { MM_DIRECT, 3840, 2160, 32, 8, 16, SEG_GRAPH } },
 };
 unsigned int svga_mcount VAR16 = ARRAY_SIZE(svga_modes);
-- 
2.25.1

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org

[SeaBIOS] Re: [PATCH] vgasrc/svgamodes: added 4k resolution

Posted by Kevin O'Connor 5 months, 2 weeks ago
On Sun, Mar 14, 2021 at 01:48:07PM +0100, vitaly@cyberhaven.com wrote:
> From: Vitaly Chipounov <vitaly@cyberhaven.com>
> 
> This requires at least 32MB of video memory.
> 
> Tested with Windows 10's default display driver and virtio-vga.
> 
> Signed-off-by: Vitaly Chipounov <vitaly@cyberhaven.com>
> ---
>  vgasrc/bochsvga.h  | 4 ++--
>  vgasrc/svgamodes.c | 1 +
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/vgasrc/bochsvga.h b/vgasrc/bochsvga.h
> index ae5f75d..f08219f 100644
> --- a/vgasrc/bochsvga.h
> +++ b/vgasrc/bochsvga.h
> @@ -6,8 +6,8 @@
>  #define VBE_DISPI_BANK_ADDRESS           0xA0000
>  #define VBE_DISPI_BANK_SIZE_KB           64
>  
> -#define VBE_DISPI_MAX_XRES               2560
> -#define VBE_DISPI_MAX_YRES               1600
> +#define VBE_DISPI_MAX_XRES               3840
> +#define VBE_DISPI_MAX_YRES               2160
>  
>  #define VBE_DISPI_IOPORT_INDEX           0x01CE
>  #define VBE_DISPI_IOPORT_DATA            0x01CF
> diff --git a/vgasrc/svgamodes.c b/vgasrc/svgamodes.c
> index 6e494c7..63ef040 100644
> --- a/vgasrc/svgamodes.c
> +++ b/vgasrc/svgamodes.c
> @@ -92,5 +92,6 @@ struct generic_svga_mode svga_modes[] VAR16 = {
>      { 0x196, { MM_DIRECT, 2560, 1440, 16, 8, 16, SEG_GRAPH } },
>      { 0x197, { MM_DIRECT, 2560, 1440, 24, 8, 16, SEG_GRAPH } },
>      { 0x198, { MM_DIRECT, 2560, 1440, 32, 8, 16, SEG_GRAPH } },
> +    { 0x199, { MM_DIRECT, 3840, 2160, 32, 8, 16, SEG_GRAPH } },
>  };
>  unsigned int svga_mcount VAR16 = ARRAY_SIZE(svga_modes);

I'm not sure about this change.  Is 3840x2160 a standard of some kind?

Gerd - do you have any comments on this?

-Kevin
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org

[SeaBIOS] Re: [PATCH] vgasrc/svgamodes: added 4k resolution

Posted by Gerd Hoffmann 5 months, 1 week ago
  Hi,

> > -#define VBE_DISPI_MAX_XRES               2560
> > -#define VBE_DISPI_MAX_YRES               1600
> > +#define VBE_DISPI_MAX_XRES               3840
> > +#define VBE_DISPI_MAX_YRES               2160

> > +    { 0x199, { MM_DIRECT, 3840, 2160, 32, 8, 16, SEG_GRAPH } },

> I'm not sure about this change.  Is 3840x2160 a standard of some kind?

It is standard 4k (a comment saying that would be nice).

> Gerd - do you have any comments on this?

The edid spec also has 4096x2160 and 5120x2160, should we add those too
while being at it?  Not sure which ones are actually used in practice
by monitors ...

Also: What about depths other than 32?  I think we can safely ignore 24,
nothing modern uses that since at least a decade, so it should not be
relevant at all for 4k.  16bpp might be useful though.

take care,
  Gerd

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org

[SeaBIOS] Re: [PATCH] vgasrc/svgamodes: added 4k resolution

Posted by Vitaly Chipounov 5 months, 1 week ago
Hi,

On Thu, Apr 8, 2021 at 12:28 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
>   Hi,
>
> > > -#define VBE_DISPI_MAX_XRES               2560
> > > -#define VBE_DISPI_MAX_YRES               1600
> > > +#define VBE_DISPI_MAX_XRES               3840
> > > +#define VBE_DISPI_MAX_YRES               2160
>
> > > +    { 0x199, { MM_DIRECT, 3840, 2160, 32, 8, 16, SEG_GRAPH } },
>
> > I'm not sure about this change.  Is 3840x2160 a standard of some kind?
>
> It is standard 4k (a comment saying that would be nice).

I'll update the commit.

>
> > Gerd - do you have any comments on this?
>
> The edid spec also has 4096x2160 and 5120x2160, should we add those too
> while being at it?  Not sure which ones are actually used in practice
> by monitors ...

These resolutions are used by ultra wide monitors.
I don't mind adding them, although I don't have a monitor that
supports these resolutions natively for testing.

>
> Also: What about depths other than 32?  I think we can safely ignore 24,
> nothing modern uses that since at least a decade, so it should not be
> relevant at all for 4k.  16bpp might be useful though.

I think we can add 24 for consistency. Every other resolution in the
table has all three modes.

Vitaly
_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org