All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add lost logic for VGA initialization
@ 2006-07-26  4:46 Zhang, Xiantao
  2006-07-26  7:15 ` Keir Fraser
  2006-07-26 14:22 ` Christian Limpach
  0 siblings, 2 replies; 7+ messages in thread
From: Zhang, Xiantao @ 2006-07-26  4:46 UTC (permalink / raw)
  To: xen-devel; +Cc: xen-ia64-devel

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

This patch adds lost logic for vga initialization. It was lost after
changing to new Qemu.
Signed-off-by : Kevin Tian <kevin.tian@intel.com>
Signed-off-by : Zhang Xiantao <xiantao.zhang@intel.com>

Thanks & Best Regards
-Xiantao

OTC,Intel Corporation


[-- Attachment #2: qemu_vga_fix.patch --]
[-- Type: application/octet-stream, Size: 4396 bytes --]

This patch adds lost logic for vga init. it was lost after
changing to new Qemu.

Signed-off-by : Kevin Tian <kevin.tian@intel.com>
Signed-off-by : Zhang Xiantao <xiantao.zhang@intel.com>

diff -r bbabdebc54ad tools/ioemu/hw/vga.c
--- a/tools/ioemu/hw/vga.c	Wed Jul 19 21:13:36 2006 +0100
+++ b/tools/ioemu/hw/vga.c	Wed Jul 26 09:28:52 2006 +0800
@@ -1772,6 +1772,125 @@ static void vga_map(PCIDevice *pci_dev, 
     }
 }
 
+/* do the same job as vgabios before vgabios get ready */
+void vga_bios_init(VGAState *s)
+{
+    uint8_t palette_model[192] = {
+        0,   0,   0,   0,   0, 170,   0, 170,   0,   0, 170, 170, 170,   0,   0, 170,
+        0, 170, 170,  85,   0, 170, 170, 170,  85,  85,  85,  85,  85, 255,  85, 255,
+        85, 85, 255, 255, 255,  85,  85, 255,  85, 255, 255, 255,  85, 255, 255, 255,
+        0,  21,   0,   0,  21,  42,   0,  63,   0,   0,  63,  42,  42,  21,   0,  42,
+        21, 42,  42,  63,   0,  42,  63,  42,   0,  21,  21,   0,  21,  63,   0,  63, 
+        21,  0,  63,  63,  42,  21,  21,  42,  21,  63,  42,  63,  21,  42,  63,  63,
+        21,  0,   0,  21,   0,  42,  21,  42,   0,  21,  42,  42,  63,   0,   0,  63,
+        0,  42,  63,  42,   0,  63,  42,  42,  21,   0,  21,  21,   0,  63,  21,  42,
+        21, 21,  42,  63,  63,   0,  21,  63,   0,  63,  63,  42,  21,  63,  42,  63,
+        21, 21,   0,  21,  21,  42,  21,  63,   0,  21,  63,  42,  63,  21,   0,  63,
+        21, 42,  63,  63,   0,  63,  63,  42,  21,  21,  21,  21,  21,  63,  21,  63,
+        21, 21,  63,  63,  63,  21,  21,  63,  21,  63,  63,  63,  21,  63,  63,  63
+    };
+
+    s->latch =          0; 
+
+    s->sr_index =       3; 
+    s->sr[0] =          3;
+    s->sr[1] =          0;
+    s->sr[2] =          3;
+    s->sr[3] =          0;
+    s->sr[4] =          2;
+    s->sr[5] =          0;
+    s->sr[6] =          0;
+    s->sr[7] =          0;
+
+    s->gr_index =       5; 
+    s->gr[0] =          0;
+    s->gr[1] =          0;
+    s->gr[2] =          0;
+    s->gr[3] =          0;
+    s->gr[4] =          0;
+    s->gr[5] =          16;
+    s->gr[6] =          14;
+    s->gr[7] =          15;
+    s->gr[8] =          255;
+
+    /*changed by out 0x03c0*/
+    s->ar_index =       32;
+    s->ar[0] =          0;
+    s->ar[1] =          1;
+    s->ar[2] =          2;
+    s->ar[3] =          3;
+    s->ar[4] =          4;
+    s->ar[5] =          5;
+    s->ar[6] =          6;
+    s->ar[7] =          7;
+    s->ar[8] =          8;
+    s->ar[9] =          9;
+    s->ar[10] =         10;
+    s->ar[11] =         11;
+    s->ar[12] =         12;
+    s->ar[13] =         13;
+    s->ar[14] =         14;
+    s->ar[15] =         15;
+    s->ar[16] =         12;
+    s->ar[17] =         0;
+    s->ar[18] =         15;
+    s->ar[19] =         8;
+    s->ar[20] =         0;
+
+    s->ar_flip_flop =   1; 
+
+    s->cr_index =       15; 
+    s->cr[0] = 95;
+    s->cr[1] = 79;
+    s->cr[2] = 80;
+    s->cr[3] = 130;
+    s->cr[4] = 85;
+    s->cr[5] = 129;
+    s->cr[6] = 191;
+    s->cr[7] = 31;
+    s->cr[8] = 0;
+    s->cr[9] = 79;
+    s->cr[10] = 14;
+    s->cr[11] = 15;
+    s->cr[12] = 0;
+    s->cr[13] = 0;
+    s->cr[14] = 5;
+    s->cr[15] = 160;
+    s->cr[16] = 156;
+    s->cr[17] = 142;
+    s->cr[18] = 143;
+    s->cr[19] = 40;
+    s->cr[20] = 31;
+    s->cr[21] = 150;
+    s->cr[22] = 185;
+    s->cr[23] = 163;
+    s->cr[24] = 255;
+
+    s->msr = 103; 
+    s->fcr =   0; 
+    s->st00 =   0; 
+    s->st01 =   0; 
+
+    /*dac_* & platte will be initialized by os through out 0x03c8 & out 0c03c9(1:3) */
+    s->dac_state =   0; 
+    s->dac_sub_index =   0; 
+    s->dac_read_index =   0; 
+    s->dac_write_index =   16; 
+    s->dac_cache[0] =   255;
+    s->dac_cache[1] =   255;
+    s->dac_cache[2] =   255;
+
+    /*platte*/
+    memcpy(s->palette, palette_model, 192);
+
+    s->bank_offset=   0;
+    s->graphic_mode = -1;
+
+    /* TODO:add vbe support if enable it */
+
+}
+
+
 /* when used on xen environment, the vga_ram_base is not used */
 void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base, 
                      unsigned long vga_ram_offset, int vga_ram_size)
@@ -1822,6 +1941,7 @@ void vga_common_init(VGAState *s, Displa
                          vga_screen_dump, s);
     /* XXX: currently needed for display */
     vga_state = s;
+    vga_bios_init(s);
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* RE: [Xen-devel] [PATCH] Add lost logic for VGA initialization
@ 2006-07-26  5:38 Zhang, Xiantao
  2006-07-26 19:19 ` Alex Williamson
  0 siblings, 1 reply; 7+ messages in thread
From: Zhang, Xiantao @ 2006-07-26  5:38 UTC (permalink / raw)
  To: Alex Williamson; +Cc: xen-devel, xen-ia64-devel

Hi Alex,
	With this fix and previous patches, we can boot VTi successfully with new Qemu on xen-ia64-unstable.hg 's tip(10784). Should we make xen-unstable.hg sync with xen-ia64-unstable.hg happen next step?  
Thanks & Best Regards
-Xiantao

OTC,Intel Corporation

> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Zhang, Xiantao
> Sent: 2006年7月26日 12:47
> To: xen-devel@lists.xensource.com
> Cc: xen-ia64-devel@lists.xensource.com
> Subject: [Xen-devel] [PATCH] Add lost logic for VGA initialization
> 
> This patch adds lost logic for vga initialization. It was lost after
> changing to new Qemu.
> Signed-off-by : Kevin Tian <kevin.tian@intel.com>
> Signed-off-by : Zhang Xiantao <xiantao.zhang@intel.com>
> 
> Thanks & Best Regards
> -Xiantao
> 
> OTC,Intel Corporation

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

* Re: [PATCH] Add lost logic for VGA initialization
  2006-07-26  4:46 Zhang, Xiantao
@ 2006-07-26  7:15 ` Keir Fraser
  2006-07-26 14:22 ` Christian Limpach
  1 sibling, 0 replies; 7+ messages in thread
From: Keir Fraser @ 2006-07-26  7:15 UTC (permalink / raw)
  To: Zhang, Xiantao; +Cc: xen-devel, xen-ia64-devel


On 26 Jul 2006, at 05:46, Zhang, Xiantao wrote:

> This patch adds lost logic for vga initialization. It was lost after
> changing to new Qemu.
> Signed-off-by : Kevin Tian <kevin.tian@intel.com>
> Signed-off-by : Zhang Xiantao <xiantao.zhang@intel.com>

How come the new qemu code seems to have perfectly working VGA without 
this patch?

  -- Keir

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

* Re: [PATCH] Add lost logic for VGA initialization
  2006-07-26  4:46 Zhang, Xiantao
  2006-07-26  7:15 ` Keir Fraser
@ 2006-07-26 14:22 ` Christian Limpach
  1 sibling, 0 replies; 7+ messages in thread
From: Christian Limpach @ 2006-07-26 14:22 UTC (permalink / raw)
  To: Zhang, Xiantao; +Cc: xen-devel, xen-ia64-devel

On 7/26/06, Zhang, Xiantao <xiantao.zhang@intel.com> wrote:
> This patch adds lost logic for vga initialization. It was lost after
> changing to new Qemu.
> Signed-off-by : Kevin Tian <kevin.tian@intel.com>
> Signed-off-by : Zhang Xiantao <xiantao.zhang@intel.com>

I've applied this -- it would be nice if you could cleanup the code
some more to use arrays to initialize s->sr[], s->gr[], s->ar[] and
s->cr[].  Thanks!

    christian

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

* RE: [PATCH] Add lost logic for VGA initialization
  2006-07-26  5:38 [Xen-devel] [PATCH] Add lost logic for VGA initialization Zhang, Xiantao
@ 2006-07-26 19:19 ` Alex Williamson
  0 siblings, 0 replies; 7+ messages in thread
From: Alex Williamson @ 2006-07-26 19:19 UTC (permalink / raw)
  To: Zhang, Xiantao; +Cc: xen-devel, xen-ia64-devel

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

On Wed, 2006-07-26 at 13:38 +0800, Zhang, Xiantao wrote:
> Hi Alex,
> 	With this fix and previous patches, we can boot VTi successfully with
> new Qemu on xen-ia64-unstable.hg 's tip(10784). Should we make
> xen-unstable.hg sync with xen-ia64-unstable.hg happen next step?  

   Yes, I sync'd with xen-unstable.hg.  There's still a build issue with
the qemu files, and I've sent a patch to Christian that fixes it:

http://lists.xensource.com/archives/html/xen-devel/2006-07/msg00861.html

There's still some debugging left to do on xen-ia64 though.  When
starting a VTI domain on the xen-ia64-unstable.hg tip (cset 10809) the
domain sits in the blocked state and doesn't accumulate cpu time.  If I
apply the attached patch (reinstating changes from xen-ia64 cset 10570),
I get a little farther and can connect to the VNC session for the
domain, but we never get to EFI.  Thanks,

	Alex

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---

[-- Attachment #2: xen_ia64_cset_10570_readd.patch --]
[-- Type: text/x-patch, Size: 5147 bytes --]

diff -r 21918b22746e tools/ioemu/patches/ioemu-ia64
--- a/tools/ioemu/patches/ioemu-ia64	Wed Jul 26 10:49:32 2006 -0600
+++ b/tools/ioemu/patches/ioemu-ia64	Wed Jul 26 13:12:43 2006 -0600
@@ -1,7 +1,7 @@ Index: ioemu/hw/iommu.c
 Index: ioemu/hw/iommu.c
 ===================================================================
---- ioemu.orig/hw/iommu.c	2006-07-14 13:43:45.000000000 +0100
-+++ ioemu/hw/iommu.c	2006-07-26 13:34:50.039997837 +0100
+--- ioemu.orig/hw/iommu.c	2006-07-26 12:17:13.000000000 -0600
++++ ioemu/hw/iommu.c	2006-07-26 12:17:53.000000000 -0600
 @@ -82,7 +82,11 @@
  #define IOPTE_VALID         0x00000002 /* IOPTE is valid */
  #define IOPTE_WAZ           0x00000001 /* Write as zeros */
@@ -16,8 +16,8 @@ Index: ioemu/hw/iommu.c
  
 Index: ioemu/cpu-all.h
 ===================================================================
---- ioemu.orig/cpu-all.h	2006-07-26 13:33:45.946834283 +0100
-+++ ioemu/cpu-all.h	2006-07-26 13:34:50.038997944 +0100
+--- ioemu.orig/cpu-all.h	2006-07-26 12:17:53.000000000 -0600
++++ ioemu/cpu-all.h	2006-07-26 12:17:53.000000000 -0600
 @@ -835,6 +835,31 @@
                  :"=m" (*(volatile long *)addr)
                  :"dIr" (nr));
@@ -52,8 +52,8 @@ Index: ioemu/cpu-all.h
  /* memory API */
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c	2006-07-26 13:33:45.996828953 +0100
-+++ ioemu/vl.c	2006-07-26 13:34:50.044997304 +0100
+--- ioemu.orig/vl.c	2006-07-26 12:17:53.000000000 -0600
++++ ioemu/vl.c	2006-07-26 13:02:31.000000000 -0600
 @@ -5577,6 +5577,7 @@
          exit(-1);
      }
@@ -82,7 +82,7 @@ Index: ioemu/vl.c
 +    }
 +
 +    if (xc_ia64_get_pfn_list(xc_handle, domid, page_array,
-+                             nr_pages + (GFW_SIZE >> PAGE_SHIFT), 1)!= 1){
++                             IO_PAGE_START >> PAGE_SHIFT, 1) != 1) {
 +        fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
 +        exit(-1);
 +    }
@@ -91,7 +91,7 @@ Index: ioemu/vl.c
 +                                       PROT_READ|PROT_WRITE,
 +                                       page_array[0]);
 +
-+    fprintf(logfile, "shared page at pfn:%lx, mfn: %l016x\n",
++    fprintf(logfile, "shared page at pfn:%lx, mfn: %016lx\n",
 +            IO_PAGE_START >> PAGE_SHIFT, page_array[0]);
 +#endif
  #else  /* !CONFIG_DM */
@@ -99,8 +99,8 @@ Index: ioemu/vl.c
  #ifdef CONFIG_SOFTMMU
 Index: ioemu/target-i386-dm/exec-dm.c
 ===================================================================
---- ioemu.orig/target-i386-dm/exec-dm.c	2006-07-26 13:33:45.882841107 +0100
-+++ ioemu/target-i386-dm/exec-dm.c	2006-07-26 13:34:50.040997731 +0100
+--- ioemu.orig/target-i386-dm/exec-dm.c	2006-07-26 12:17:53.000000000 -0600
++++ ioemu/target-i386-dm/exec-dm.c	2006-07-26 12:17:53.000000000 -0600
 @@ -340,6 +340,23 @@
      return io_mem_read[io_index >> IO_MEM_SHIFT];
  }
@@ -137,8 +137,8 @@ Index: ioemu/target-i386-dm/exec-dm.c
          len -= l;
 Index: ioemu/exec-all.h
 ===================================================================
---- ioemu.orig/exec-all.h	2006-07-26 13:33:45.861843346 +0100
-+++ ioemu/exec-all.h	2006-07-26 13:38:30.096491388 +0100
+--- ioemu.orig/exec-all.h	2006-07-26 12:17:53.000000000 -0600
++++ ioemu/exec-all.h	2006-07-26 12:48:37.000000000 -0600
 @@ -391,6 +391,15 @@
  }
  #endif
@@ -174,8 +174,8 @@ Index: ioemu/exec-all.h
  
 Index: ioemu/target-i386-dm/cpu.h
 ===================================================================
---- ioemu.orig/target-i386-dm/cpu.h	2006-07-26 13:33:45.882841107 +0100
-+++ ioemu/target-i386-dm/cpu.h	2006-07-26 13:34:50.040997731 +0100
+--- ioemu.orig/target-i386-dm/cpu.h	2006-07-26 12:17:53.000000000 -0600
++++ ioemu/target-i386-dm/cpu.h	2006-07-26 12:17:53.000000000 -0600
 @@ -80,7 +80,11 @@
  /* helper2.c */
  int main_loop(void);
@@ -191,7 +191,7 @@ Index: ioemu/ia64_intrinsic.h
 Index: ioemu/ia64_intrinsic.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/ia64_intrinsic.h	2006-07-26 13:34:50.038997944 +0100
++++ ioemu/ia64_intrinsic.h	2006-07-26 12:17:53.000000000 -0600
 @@ -0,0 +1,276 @@
 +#ifndef IA64_INTRINSIC_H
 +#define IA64_INTRINSIC_H
diff -r 21918b22746e tools/ioemu/vl.c
--- a/tools/ioemu/vl.c	Wed Jul 26 10:49:32 2006 -0600
+++ b/tools/ioemu/vl.c	Wed Jul 26 13:12:43 2006 -0600
@@ -5791,7 +5791,7 @@ int main(int argc, char **argv)
     }
 
     if (xc_ia64_get_pfn_list(xc_handle, domid, page_array,
-                             nr_pages + (GFW_SIZE >> PAGE_SHIFT), 1)!= 1){
+                             IO_PAGE_START >> PAGE_SHIFT, 1) != 1) {
         fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
         exit(-1);
     }
@@ -5800,7 +5800,7 @@ int main(int argc, char **argv)
                                        PROT_READ|PROT_WRITE,
                                        page_array[0]);
 
-    fprintf(logfile, "shared page at pfn:%lx, mfn: %l016x\n",
+    fprintf(logfile, "shared page at pfn:%lx, mfn: %016lx\n",
             IO_PAGE_START >> PAGE_SHIFT, page_array[0]);
 #endif
 #else  /* !CONFIG_DM */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* RE: [PATCH] Add lost logic for VGA initialization
@ 2006-07-27  1:47 Zhang, Xiantao
  2006-07-27 10:12 ` Christian Limpach
  0 siblings, 1 reply; 7+ messages in thread
From: Zhang, Xiantao @ 2006-07-27  1:47 UTC (permalink / raw)
  To: Christian.Limpach; +Cc: xen-devel, xen-ia64-devel

Hi, Christian
	Thank you for your comments. But I check the patch on tip. Seems the following line not in upstream. I don't know why this part was lost when check-in.
diff -r 254c090854de tools/ioemu/hw/vga.c
--- a/tools/ioemu/hw/vga.c      Wed Jul 26 15:59:36 2006 -0600
+++ b/tools/ioemu/hw/vga.c      Thu Jul 27 09:27:03 2006 +0800
@@ -1953,6 +1953,7 @@ void vga_common_init(VGAState *s, Displa
                          vga_screen_dump, s);
     /* XXX: currently needed for display */
     vga_state = s;
+    vga_bios_init(s);
 }
Thanks & Best Regards
-Xiantao

OTC,Intel Corporation

> -----Original Message-----
> From: Christian Limpach [mailto:christian.limpach@gmail.com]
> Sent: 2006年7月26日 22:23
> To: Zhang, Xiantao
> Cc: xen-devel@lists.xensource.com; xen-ia64-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH] Add lost logic for VGA initialization
> 
> On 7/26/06, Zhang, Xiantao <xiantao.zhang@intel.com> wrote:
> > This patch adds lost logic for vga initialization. It was lost after
> > changing to new Qemu.
> > Signed-off-by : Kevin Tian <kevin.tian@intel.com>
> > Signed-off-by : Zhang Xiantao <xiantao.zhang@intel.com>
> 
> I've applied this -- it would be nice if you could cleanup the code
> some more to use arrays to initialize s->sr[], s->gr[], s->ar[] and
> s->cr[].  Thanks!
> 
>     christian

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

* Re: [PATCH] Add lost logic for VGA initialization
  2006-07-27  1:47 Zhang, Xiantao
@ 2006-07-27 10:12 ` Christian Limpach
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Limpach @ 2006-07-27 10:12 UTC (permalink / raw)
  To: Zhang, Xiantao; +Cc: xen-devel, xen-ia64-devel

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

On 7/27/06, Zhang, Xiantao <xiantao.zhang@intel.com> wrote:
> Hi, Christian
>         Thank you for your comments. But I check the patch on tip. Seems the following line not in upstream. I don't know why this part was lost when check-in.
> diff -r 254c090854de tools/ioemu/hw/vga.c
> --- a/tools/ioemu/hw/vga.c      Wed Jul 26 15:59:36 2006 -0600
> +++ b/tools/ioemu/hw/vga.c      Thu Jul 27 09:27:03 2006 +0800
> @@ -1953,6 +1953,7 @@ void vga_common_init(VGAState *s, Displa
>                           vga_screen_dump, s);
>      /* XXX: currently needed for display */
>      vga_state = s;
> +    vga_bios_init(s);
>  }

Applied, I hope we've got it all now :-)

    christian

> Thanks & Best Regards
> -Xiantao
>
> OTC,Intel Corporation
>
> > -----Original Message-----
> > From: Christian Limpach [mailto:christian.limpach@gmail.com]
> > Sent: 2006年7月26日 22:23
> > To: Zhang, Xiantao
> > Cc: xen-devel@lists.xensource.com; xen-ia64-devel@lists.xensource.com
> > Subject: Re: [Xen-devel] [PATCH] Add lost logic for VGA initialization
> >
> > On 7/26/06, Zhang, Xiantao <xiantao.zhang@intel.com> wrote:
> > > This patch adds lost logic for vga initialization. It was lost after
> > > changing to new Qemu.
> > > Signed-off-by : Kevin Tian <kevin.tian@intel.com>
> > > Signed-off-by : Zhang Xiantao <xiantao.zhang@intel.com>
> >
> > I've applied this -- it would be nice if you could cleanup the code
> > some more to use arrays to initialize s->sr[], s->gr[], s->ar[] and
> > s->cr[].  Thanks!
> >
> >     christian
>

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

end of thread, other threads:[~2006-07-27 10:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-26  5:38 [Xen-devel] [PATCH] Add lost logic for VGA initialization Zhang, Xiantao
2006-07-26 19:19 ` Alex Williamson
  -- strict thread matches above, loose matches on Subject: below --
2006-07-27  1:47 Zhang, Xiantao
2006-07-27 10:12 ` Christian Limpach
2006-07-26  4:46 Zhang, Xiantao
2006-07-26  7:15 ` Keir Fraser
2006-07-26 14:22 ` Christian Limpach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.