public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix widescreen resolution issues
@ 2008-02-20 21:16 Andreas Winkelbauer
  2008-02-21  8:56 ` Avi Kivity
  2008-02-21 10:29 ` Arne Brutschy
  0 siblings, 2 replies; 8+ messages in thread
From: Andreas Winkelbauer @ 2008-02-20 21:16 UTC (permalink / raw)
  To: kvm-devel; +Cc: arne.brutschy

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

hi,

the attached patch fixes the issues with widescreen resolutions for me 
when using -std-vga.

in vgabios/vbetables-gen.c I changed the video memory from 8MB to 16MB 
which is sufficient for resolutions up to 2560x1600. I've also added 
some more video modes (up to 2560x1600) with 16, 24, 32bit color depth 
each and I've removed the duplicate for the 1280x960 mode.

in qemu/hw/vga_int.h I've adapted the maximum resolution accordingly.

you can download the updated vgabios from http://www.wina.at/vgabios.bin

I would appreciate any suggestions, comments and of course testing.

@Arne Brutschy: could you please test the 1920x1200 resolution with your 
setup?

cheers,
Andi

[-- Attachment #2: vbetables-gen.patch --]
[-- Type: text/x-patch, Size: 2091 bytes --]

--- kvm-61.orig/vgabios/vbetables-gen.c	2008-02-19 15:58:28.000000000 +0100
+++ kvm-61/vgabios/vbetables-gen.c	2008-02-20 19:22:48.000000000 +0100
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#define VBE_DISPI_TOTAL_VIDEO_MEMORY_MB 8
+#define VBE_DISPI_TOTAL_VIDEO_MEMORY_MB 16
 
 typedef struct {
     int width;
@@ -55,18 +55,27 @@
 { 1152, 864, 16                      , 0x14a},
 { 1152, 864, 24                      , 0x14b},
 { 1152, 864, 32                      , 0x14c},
-{ 1280, 800, 24                      , 0x178},
-{ 1280, 800, 32                      , 0x179},
-{ 1280, 960, 24                      , 0x180},
-{ 1280, 960, 32                      , 0x181},
-{ 1280, 960, 24                      , 0x182},
-{ 1280, 960, 32                      , 0x183},
-{ 1440, 900, 24                      , 0x184},
-{ 1440, 900, 32                      , 0x185},
-{ 1400, 1050, 24                     , 0x186},
-{ 1400, 1050, 32                     , 0x187},
-{ 1680, 1050, 24                     , 0x188},
-{ 1680, 1050, 32                     , 0x189},
+{ 1280, 800, 16                      , 0x178},
+{ 1280, 800, 24                      , 0x179},
+{ 1280, 800, 32                      , 0x17a},
+{ 1280, 960, 16                      , 0x17b},
+{ 1280, 960, 24                      , 0x17c},
+{ 1280, 960, 32                      , 0x17d},
+{ 1440, 900, 16                      , 0x17e},
+{ 1440, 900, 24                      , 0x17f},
+{ 1440, 900, 32                      , 0x180},
+{ 1400, 1050, 16                     , 0x181},
+{ 1400, 1050, 24                     , 0x182},
+{ 1400, 1050, 32                     , 0x183},
+{ 1680, 1050, 16                     , 0x184},
+{ 1680, 1050, 24                     , 0x185},
+{ 1680, 1050, 32                     , 0x186},
+{ 1920, 1200, 16                     , 0x187},
+{ 1920, 1200, 24                     , 0x188},
+{ 1920, 1200, 32                     , 0x189},
+{ 2560, 1600, 16                     , 0x18a},
+{ 2560, 1600, 24                     , 0x18b},
+{ 2560, 1600, 32                     , 0x18c},
 { 0, },
 };


[-- Attachment #3: vga_int.patch --]
[-- Type: text/x-patch, Size: 482 bytes --]

--- kvm-61.orig/qemu/hw/vga_int.h	2008-02-19 15:58:28.000000000 +0100
+++ kvm-61/qemu/hw/vga_int.h	2008-02-20 19:25:35.000000000 +0100
@@ -30,8 +30,8 @@
 /* bochs VBE support */
 #define CONFIG_BOCHS_VBE
 
-#define VBE_DISPI_MAX_XRES              1600
-#define VBE_DISPI_MAX_YRES              1200
+#define VBE_DISPI_MAX_XRES              2560
+#define VBE_DISPI_MAX_YRES              1600
 #define VBE_DISPI_MAX_BPP               32
 
 #define VBE_DISPI_INDEX_ID              0x0


[-- Attachment #4: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #5: Type: text/plain, Size: 158 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix widescreen resolution issues
  2008-02-20 21:16 [PATCH] fix widescreen resolution issues Andreas Winkelbauer
@ 2008-02-21  8:56 ` Avi Kivity
  2008-02-21 11:27   ` Arne Brutschy
  2008-02-21 12:52   ` Andreas Winkelbauer
  2008-02-21 10:29 ` Arne Brutschy
  1 sibling, 2 replies; 8+ messages in thread
From: Avi Kivity @ 2008-02-21  8:56 UTC (permalink / raw)
  To: Andreas Winkelbauer; +Cc: kvm-devel, arne.brutschy

Andreas Winkelbauer wrote:
> hi,
>
> the attached patch fixes the issues with widescreen resolutions for me 
> when using -std-vga.
>
> in vgabios/vbetables-gen.c I changed the video memory from 8MB to 16MB 
> which is sufficient for resolutions up to 2560x1600. I've also added 
> some more video modes (up to 2560x1600) with 16, 24, 32bit color depth 
> each and I've removed the duplicate for the 1280x960 mode.
>
> in qemu/hw/vga_int.h I've adapted the maximum resolution accordingly.
>
> you can download the updated vgabios from http://www.wina.at/vgabios.bin
>
> I would appreciate any suggestions, comments and of course testing.
>
> @Arne Brutschy: could you please test the 1920x1200 resolution with 
> your setup?

What about VGA_RAM_SIZE in qemu/hw/pc.h?

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix widescreen resolution issues
  2008-02-20 21:16 [PATCH] fix widescreen resolution issues Andreas Winkelbauer
  2008-02-21  8:56 ` Avi Kivity
@ 2008-02-21 10:29 ` Arne Brutschy
  2008-02-21 10:40   ` Izik Eidus
  1 sibling, 1 reply; 8+ messages in thread
From: Arne Brutschy @ 2008-02-21 10:29 UTC (permalink / raw)
  To: Andreas Winkelbauer; +Cc: kvm-devel

Hi,

On Mi, 2008-02-20 at 22:16 +0100, Andreas Winkelbauer wrote:
> the attached patch fixes the issues with widescreen resolutions for me 
> when using -std-vga.
> I would appreciate any suggestions, comments and of course testing.
Thanks for the patch, Andreas! You found the "magic limitation" to
1600x1200...

> @Arne Brutschy: could you please test the 1920x1200 resolution with your 
> setup?
I did, it does not work. :( I can select the video mode, but upon
activation qemu crashes. I think the video memory overwrites system
memory because qemu does not allocate the increased vmem properly. So
every mode under 8MB of video ram does work, all others do not.

  1680x1050x32 => works   (7056000 bytes)
  1920x1200x24 => works   (6912000 bytes)
  1920x1200x32 => crashes (9216000 bytes)

I haven't found the piece of code that's responsible for vmem allocation
yet. Does somebody know where this is done? Is there somebody from qemu
reading this?

Arne


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix widescreen resolution issues
  2008-02-21 10:29 ` Arne Brutschy
@ 2008-02-21 10:40   ` Izik Eidus
  0 siblings, 0 replies; 8+ messages in thread
From: Izik Eidus @ 2008-02-21 10:40 UTC (permalink / raw)
  To: arne.brutschy; +Cc: kvm-devel, Andreas Winkelbauer


On Thu, 2008-02-21 at 11:29 +0100, Arne Brutschy wrote:
> Hi,
> 
> On Mi, 2008-02-20 at 22:16 +0100, Andreas Winkelbauer wrote:
> > the attached patch fixes the issues with widescreen resolutions for me 
> > when using -std-vga.
> > I would appreciate any suggestions, comments and of course testing.
> Thanks for the patch, Andreas! You found the "magic limitation" to
> 1600x1200...
> 
> > @Arne Brutschy: could you please test the 1920x1200 resolution with your 
> > setup?
> I did, it does not work. :( I can select the video mode, but upon
> activation qemu crashes. I think the video memory overwrites system
> memory because qemu does not allocate the increased vmem properly. So
> every mode under 8MB of video ram does work, all others do not.
> 
>   1680x1050x32 => works   (7056000 bytes)
>   1920x1200x24 => works   (6912000 bytes)
>   1920x1200x32 => crashes (9216000 bytes)
> 
> I haven't found the piece of code that's responsible for vmem allocation
> yet. Does somebody know where this is done? Is there somebody from qemu
> reading this?

there is a DEFINE name VGA_RAM_SIZE or something like that

> 
> Arne
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix widescreen resolution issues
  2008-02-21  8:56 ` Avi Kivity
@ 2008-02-21 11:27   ` Arne Brutschy
  2008-02-21 13:53     ` Andreas Winkelbauer
  2008-02-21 12:52   ` Andreas Winkelbauer
  1 sibling, 1 reply; 8+ messages in thread
From: Arne Brutschy @ 2008-02-21 11:27 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel, Andreas Winkelbauer


On Do, 2008-02-21 at 10:56 +0200, Avi Kivity wrote:
> What about VGA_RAM_SIZE in qemu/hw/pc.h?
On Do, 2008-02-21 at 12:40 +0200, Izik Eidus wrote:
> there is a DEFINE name VGA_RAM_SIZE or something like that

D'oh. Must have missed it. :\ Thanks! Unfortunately, it still does not work.
Qemu crashes now as windows switches to graphics mode. Safe mode does not
work either.. 

Arne

-- 
Arne Brutschy
Ph.D. Student                    Email    arne.brutschy(AT)ulb.ac.be
IRIDIA CP 194/6                  Web      iridia.ulb.ac.be/~abrutschy
Universite' Libre de Bruxelles   Tel      +32 2 650 2729
Avenue Franklin Roosevelt 50     Fax      +32 2 650 2715
1050 Bruxelles, Belgium          (Tel and Fax both IRIDIA secretary)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix widescreen resolution issues
  2008-02-21  8:56 ` Avi Kivity
  2008-02-21 11:27   ` Arne Brutschy
@ 2008-02-21 12:52   ` Andreas Winkelbauer
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Winkelbauer @ 2008-02-21 12:52 UTC (permalink / raw)
  To: Avi Kivity, kvm-devel

hi,

> What about VGA_RAM_SIZE in qemu/hw/pc.h?

I already tried changing the VGA_RAM_SIZE value in pc.h to 16 * 1024 * 
1024 (16MB), but then kvm crashes when the guest os switches to graphics 
mode.

Changing VGA_RAM_SIZE in pc.h to 16MB works when I use the latest cvs 
snapshot of qemu (didn't test it with qemu-0.9.1 release version).

Unfortunately I am not experienced in debugging kvm or qemu, so I hope 
someone can find out what's going on in this case.

cheers,
Andi

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix widescreen resolution issues
  2008-02-21 11:27   ` Arne Brutschy
@ 2008-02-21 13:53     ` Andreas Winkelbauer
  2008-02-21 15:35       ` Andreas Winkelbauer
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Winkelbauer @ 2008-02-21 13:53 UTC (permalink / raw)
  To: arne.brutschy; +Cc: kvm-devel

hi,

> D'oh. Must have missed it. :\ Thanks! Unfortunately, it still does not work.
> Qemu crashes now as windows switches to graphics mode. Safe mode does not
> work either.. 

For now I'd suggest trying the following:

* download the latest qemu cvs snapshot
 > cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/qemu co 
qemu
 > cd qemu

* apply the patch for hw/vga_int.h and change VGA_RAM_SIZE in hw/pc.h to 
16 * 1024 * 1024 (16MB)

* configure, make and install qemu
 > ./configure --prefix=/usr/local/qemu-cvs && make (use whatever prefix 
you like)
# make install (as root)

* download, configure, make and install kqemu (optional, but highly 
suggested)
 > wget http://fabrice.bellard.free.fr/qemu/kqemu-1.3.0pre11.tar.gz
 > tar -xzf kqemu-1.3.0pre11.tar.gz
 > cd kqemu-1.3.0pre11
 > ./configure && make
# make install (as root)

* copy the modified vgabios.bin to the qemu dir
 > wget http://www.wina.at/vgabios.bin
# cp vgabios.bin /usr/local/qemu-cvs/share/qemu (as root; change to 
target path according to the prefix you used above)

* start your vm image as usual, but use /usr/local/qemu-cvs/bin/qemu 
instead of qemu/kvm.

if kqemu does not work, reading the documentation
http://fabrice.bellard.free.fr/qemu/kqemu-doc.html
might help.

Please test it that way. If it works, it should be possible to make it 
working with kvm as well.

cheers,
Andi

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] fix widescreen resolution issues
  2008-02-21 13:53     ` Andreas Winkelbauer
@ 2008-02-21 15:35       ` Andreas Winkelbauer
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Winkelbauer @ 2008-02-21 15:35 UTC (permalink / raw)
  To: kvm-devel

hi,

> * copy the modified vgabios.bin to the qemu dir
>  > wget http://www.wina.at/vgabios.bin
> # cp vgabios.bin /usr/local/qemu-cvs/share/qemu (as root; change to 
> target path according to the prefix you used above)

I'm guess I've uploaded to wrong vgabios.bin, so if you don't want to compile it
yourself and don't have those high resolution modes available, then you can get
the vgabios.bin file from

http://www.wina.at/vgabios.bin

resolutions up to 2560x1600 should be available (although they do not
neccessarily work).

cheers,
Andi


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-02-21 15:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20 21:16 [PATCH] fix widescreen resolution issues Andreas Winkelbauer
2008-02-21  8:56 ` Avi Kivity
2008-02-21 11:27   ` Arne Brutschy
2008-02-21 13:53     ` Andreas Winkelbauer
2008-02-21 15:35       ` Andreas Winkelbauer
2008-02-21 12:52   ` Andreas Winkelbauer
2008-02-21 10:29 ` Arne Brutschy
2008-02-21 10:40   ` Izik Eidus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox