Re: [Spice-devel] [PATCH 10/12] move WARN and WARN_ONCE to spice_common.h

2011-04-27 Thread Christophe Fergeau
This breaks opengl compilation, I'll send a fixed patch

On Fri, Apr 22, 2011 at 06:43:08PM +0200, Christophe Fergeau wrote:
 ---
  common/glc.c  |8 
  common/rop3.c |8 ++--
  common/spice_common.h |2 ++
  3 files changed, 4 insertions(+), 14 deletions(-)
 
 diff --git a/common/glc.c b/common/glc.c
 index 0396fc9..f85d9f6 100644
 --- a/common/glc.c
 +++ b/common/glc.c
 @@ -40,14 +40,6 @@
  #include glc.h
  #include gl_utils.h
  
 -#define WARN_ONCE(x) {  \
 -static int warn = TRUE; \
 -if (warn) { \
 -printf x;   \
 -warn = FALSE;   \
 -}   \
 -}
 -
  #define TESS_VERTEX_ALLOC_BUNCH 20
  
  typedef struct InternaCtx InternaCtx;
 diff --git a/common/rop3.c b/common/rop3.c
 index 1ce2cd2..af872c1 100644
 --- a/common/rop3.c
 +++ b/common/rop3.c
 @@ -24,10 +24,6 @@
  #include rop3.h
  #include spice_common.h
  
 -#ifndef WARN
 -#define WARN(x) printf(warning: %s\n, x)
 -#endif
 -
  typedef void (*rop3_with_pattern_handler_t)(pixman_image_t *d, 
 pixman_image_t *s,
  SpicePoint *src_pos, 
 pixman_image_t *p,
  SpicePoint *pat_pos);
 @@ -51,13 +47,13 @@ static void 
 default_rop3_with_pattern_handler(pixman_image_t *d, pixman_image_t
SpicePoint *src_pos, 
 pixman_image_t *p,
SpicePoint *pat_pos)
  {
 -WARN(not implemented 0x%x);
 +WARN(not implemented);
  }
  
  static void default_rop3_withe_color_handler(pixman_image_t *d, 
 pixman_image_t *s, SpicePoint *src_pos,
   uint32_t rgb)
  {
 -WARN(not implemented 0x%x);
 +WARN(not implemented);
  }
  
  static void default_rop3_test_handler()
 diff --git a/common/spice_common.h b/common/spice_common.h
 index 430c8af..ed28689 100644
 --- a/common/spice_common.h
 +++ b/common/spice_common.h
 @@ -53,6 +53,8 @@
  printf(%s:  format \n, __FUNCTION__, ## __VA_ARGS__ );  \
  }   \
  }
 +#define WARN(format, ...) red_printf(warning: format\n, ##__VA_ARGS__ );
 +#define WARN_ONCE red_printf_once
  
  #define red_printf_some(every, format, ...) {   \
  static int count = 0;   \
 -- 
 1.7.4.4
 


pgpGlCBEY2A2t.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Alon Levy
On Tue, Apr 26, 2011 at 08:39:13PM +0200, Attila Sukosd wrote:
 Also I've attached the patch which fixes a few things here and there... With
 this it builds fine.
 

Can you clean up the commenting out part of the patch (Makefile.am you comment
out a single line, you can probably ifdef it based on some arch variable, 
introduce
one if there isn't already), and send it inlined, not as attachment?

 
 Best Regards,
 
 Attila Sukosd
 
 -
 DTU Computing Center - www.cc.dtu.dk
 att...@cc.dtu.dk, gba...@student.dtu.dk, s070...@student.dtu.dk
 
 
 
 
 On Tue, Apr 26, 2011 at 8:36 PM, Attila Sukosd attila.suk...@gmail.comwrote:
 
  Hi,
 
 
  You can specify it to use gstreamer instead of pulseaudio, and install
  gstreamer from macports and it builds fine.
 
  Best Regards,
 
  Attila Sukosd
 
  -
  DTU Computing Center - www.cc.dtu.dk
  att...@cc.dtu.dk, gba...@student.dtu.dk, s070...@student.dtu.dk
 
 
 
 
  On Tue, Apr 26, 2011 at 8:23 PM, Cliff Sharp csh...@vbridges.com wrote:
 
  I am getting much further with the Third Phase than the rest.
  spice-gtk does require pulseaudio
  It is not in MacPorts (celt051)
 
  When doing a sudo make install with pulseaudio I get the following:
 
  make  install-recursive
  Making install in src
  make  install-am
CC libpulsecommon_0.9.22_la-client-conf.lo
CC libpulsecommon_0.9.22_la-i18n.lo
CC libpulsecommon_0.9.22_la-fork-detect.lo
CC libpulsecommon_0.9.22_la-authkey.lo
CC libpulsecommon_0.9.22_la-conf-parser.lo
CC libpulsecommon_0.9.22_la-core-error.lo
CC libpulsecommon_0.9.22_la-core-rtclock.lo
CC libpulsecommon_0.9.22_la-core-util.lo
  pulsecore/core-util.c: In function 'pa_hexstr':
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
  pulsecore/core-util.c:1818: warning: cannot optimize loop, the loop
  counter may overflow [-Wunsafe-loop-optimizations]
CC libpulsecommon_0.9.22_la-dynarray.lo
CC libpulsecommon_0.9.22_la-flist.lo
CC libpulsecommon_0.9.22_la-hashmap.lo
CC libpulsecommon_0.9.22_la-idxset.lo
CC libpulsecommon_0.9.22_la-inet_ntop.lo
CC libpulsecommon_0.9.22_la-inet_pton.lo
CC libpulsecommon_0.9.22_la-iochannel.lo
CC libpulsecommon_0.9.22_la-ioline.lo
CC libpulsecommon_0.9.22_la-ipacl.lo
  pulsecore/ipacl.c: In function 'pa_ip_acl_check':
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop counter may
  overflow [-Wunsafe-loop-optimizations]
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop counter may
  overflow [-Wunsafe-loop-optimizations]
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop counter may
  overflow [-Wunsafe-loop-optimizations]
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop counter may
  overflow [-Wunsafe-loop-optimizations]
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop counter may
  overflow [-Wunsafe-loop-optimizations]
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop counter may
  overflow [-Wunsafe-loop-optimizations]
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop counter may
  overflow [-Wunsafe-loop-optimizations]
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop counter may
  overflow [-Wunsafe-loop-optimizations]
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop counter may
  overflow [-Wunsafe-loop-optimizations]
  pulsecore/ipacl.c:229: warning: cannot optimize loop, the loop 

[Spice-devel] spice-gtk 0.6 : Ctrl+W closes the client

2011-04-27 Thread Frédéric Grelot
Hi all, 

I finally decided to give a try to the gtk version of spice client. First, I 
have to say that I'm quite impressed (and I understand why it tends to become 
the baseline client).
Still, there is one bug that I would consider blocking (as far as I'm 
concerned) : I'm pretty used to the Ctrl+W combination to close windows, 
firefox or eclipse tabs, etc... However, is it expected that it is grabbed by 
the client itself (i.e. not the guest) and that pressing Ctrl+W closes the 
whole client window?
I would expect the following : if focus is on toolbar, menu, etc, Ctrl+W closes 
the client, while if focus is on the guest (i.e. mouse over the canvas), the 
Ctrl+W is sent along to the guest, and spicy client doesn't close.

Thanks for taking that into account if possible!

Frederic.
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] windows bsod with spice 0.8.1

2011-04-27 Thread Emre Erenoglu
On Wed, Apr 27, 2011 at 12:07 PM, Alon Levy al...@redhat.com wrote:

 On Wed, Apr 27, 2011 at 01:16:01AM +0400, Emre Erenoglu wrote:
  Hi,
 
  I started to see frequent crashes with my guests running windows xp and
  windows server 2003 x86.  The bsod appears on qxldd.dll. I can give
 further
  info if needed.

 please. what qxldd.dll are you using? can you run with -global
 qxl.guestdebug=20 -global qxl.debug=3


It's version 1.4.1.0 from the 0.6.1 package downloaded from spice-space.org.
I will run with the above parameters and give you the result. Those
parameters are passed to qemu I assume?


 this will give you stupendous amounts of output (I hope), hopefully with
 something wrong. (you can lower the 20
 to 10 to get something medium. 3 is a good number for basics).

 actually, looking at the git log the main (only relevant I think) changes
 are agent related - so are you
 running an updated agent in the guest? can you try without it and see if
 the crashes persist?


OK, by the way, I downgraded to spice 0.8.0 and still seeing the crashes.
Therefore, I will conclude that it's not related to changes in spice 0.8.1.
I will update back to spice 0.8.1 and send the logs. We may also look into
the windbg when I have some time tonight.



 try the debug parameters to qemu second, I don't think they are relevant.

 Alon

 
  The host is Linux x86_64, qemu 0.14, spice 0.8.1. Guest has qxl 0.6.1
  drivers loaded. I may revert back to 0.8.0 since it was not crashing.
  Nothing changed in the guests when I upgraded spice from 0.8.0 to 0.8.1.
 
  --
  Emre


-- 
Emre
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Christophe Fergeau
On Tue, Apr 26, 2011 at 08:39:13PM +0200, Attila Sukosd wrote:
 Also I've attached the patch which fixes a few things here and there... With
 this it builds fine.

Ah, so you've already built spice-gtk on macosx? How well did it work?

I had some questions about your patch, it would be really helpful if you
remembered why you had to change these things :)

Thanks for the patch,

Christophe

diff --git a/common/lines.c b/common/lines.c
index 1a14c18..59d0689 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -2985,7 +2985,7 @@ miWideDashSegment (GCPtr pGC,
 double L, l;
 double k;
 PolyVertexRec vertices[4];
-PolyVertexRec saveRight = { 0 }, saveBottom;
+PolyVertexRec saveRight = { 0 }, saveBottom = { 0 };
 PolySlopeRec slopes[4];
 PolyEdgeRec left[2], right[2];
 LineFaceRec lcapFace, rcapFace;

I assume this bit is to avoid a saveBottom can be used without being
initialized gcc warning?



diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 7ce8a65..e5f3c1c 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -27,6 +27,7 @@ if HAVE_LD_VERSION_SCRIPT
 VERSION_LDFLAGS = -Wl,--version-script=${srcdir}/map-file
 else
 VERSION_LDFLAGS = -export-symbols ${srcdir}/sym-file
+#VERSION_LDFLAGS =
 endif
 
 KEYMAP_GEN = $(srcdir)/keymap-gen.pl


macosx ld indeed doesn't have any of --version-script nor -export-symbols,
but it does have --exported_symbols_list which seems to be equivalent to
what we are trying to do here. This means m4/ld-version.m4 could be
improved to deal with this.


@@ -420,7 +421,6 @@ INTROSPECTION_GIRS =
 INTROSPECTION_SCANNER_ARGS = --add-include-path=$(builddir) $(PREFIX_ARGS)
 INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir)
 
-if HAVE_INTROSPECTION
 glib_introspection_files = $(libspice_client_glibinclude_HEADERS)
 gtk_introspection_files = $(libspice_client_gtkinclude_HEADERS)
 
@@ -453,7 +453,6 @@ typelibsdir = $(libdir)/girepository-1.0
 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
-endif

I'm not sure why you needed this change.
My first guess was that this change is needed to prevent autoconf from
complaining that HAVE_INTROSPECTION is not present in an AM_CONDITIONAL
when gobject-introspection (and introspection.m4) are not installed.
However, this would mean that unconditionally building the introspection
stuff would fail, and moreover, when I tested just this change without
introspection, configure didn't succeed. Can you tell more about why this
change was needed?


diff --git a/gtk/continuation.c b/gtk/continuation.c
index 4f5b027..3aefa54 100644
--- a/gtk/continuation.c
+++ b/gtk/continuation.c
@@ -21,7 +21,10 @@
 #include config.h
 
 #include continuation.h
-
+#ifdef __MACH__
+#define _XOPEN_SOURCE 
+#include ucontext.h
+#endif

continuation.h already has the #include ucontext.h, including it again
shouldn't do much. Does something like
--- a/gtk/continuation.c
+++ b/gtk/continuation.c
@@ -21,7 +21,10 @@
 #include config.h
 
+#define _XOPEN_SOURCE 
 #include continuation.h

help with the issue you were having?


diff --git a/gtk/continuation.h b/gtk/continuation.h
index 585788e..6822757 100644
--- a/gtk/continuation.h
+++ b/gtk/continuation.h
@@ -21,7 +21,8 @@
 #ifndef _CONTINUATION_H_
 #define _CONTINUATION_H_
 
-#include ucontext.h
+#include string.h
+#include sys/ucontext.h

Ah, this explains the #include ucontext.h you added in the previous hunk.
I suspect dropping both hunks and only adding the #define _XOPEN_SOURCE
here would fix your issues. Though nothing in ucontext.h nor in
sys/ucontext.h on a macosx box depends on _XOPEN_SOURCE, so I'm not sure
what issues you were seeing here?


diff --git a/gtk/coroutine_ucontext.c b/gtk/coroutine_ucontext.c
index 91059ad..ee48249 100644
--- a/gtk/coroutine_ucontext.c
+++ b/gtk/coroutine_ucontext.c
@@ -25,6 +25,9 @@
 #include stdio.h
 #include stdlib.h
 #include coroutine.h
+#ifndef MAP_ANONYMOUS
+# define MAP_ANONYMOUS MAP_ANON
+#endif

Yep, macosx has MAP_ANON but no MAP_ANONYMOUS


diff --git a/gtk/spice-client-gtk.override b/gtk/spice-client-gtk.override
index 7b3543a..e634f78 100644
--- a/gtk/spice-client-gtk.override
+++ b/gtk/spice-client-gtk.override
@@ -1,6 +1,7 @@
 %%
 headers
 #include Python.h
+#define NO_IMPORT_PYGOBJECT

This one seems to be here for the same kind of issues as what led to
https://gitorious.org/rb-lastfm/rb-lastfm/commit/ab102ef5a954eb87354c3467d1a35c8fa596242b
but I must say I don't understand very well the issue/what's going on. Do
you happen to have the compile error handy (just for my knowledge). I'm
happy to take this one as is whatsoever.

Thanks again for the patch,

Christophe


pgptixDweZpHE.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] androidSpice-0.1.4 released

2011-04-27 Thread Shuxiang Lim
Yep,it's really nasty.
   But if I want to leverage FULL spice image ability,I have to:
1.Fix the bugs of sigbus in quic.c on Android by rewriting the
pointer-type-cast into memcpy.etc..
2.Then,then,I got the processed image buffer in memory,BUT,HOW can I output
it??? AFAIK,android offer no image output API for C(at least 2.3), and Java
cannot access memory directly(am I right?). How can I do it besides sending
the image data as soon and little as possible to Java via Unix-sock?
 So, no matter how fast or colorful Spice is, it's choked by Android
framework and Java.

Thus,if Java has the ability to maitain something like image buffer in
memory like C(can it??), this may be the most-efficeint way I can imagine:
implementing spice protocol and rewriting UI in Java,and leaving only(or
not) the image computing work to lib**.so via JNI.
  But that's beyond my current scope.

 Any ideas to access the memory block of image buffer allocated by
C(libspicec.so) directly in Java,instantly and swiftly?

...One more time I want to curse Android and disdain Java...
Best regards.

On Wed, Apr 27, 2011 at 4:20 PM, Alon Levy al...@redhat.com wrote:

 On Wed, Apr 27, 2011 at 10:30:18AM +0800, Shuxiang Lim wrote:
  Hi,all!
 Thanks for the trying/feedbacking and sorry for the nascent itches of
 the
  project.
 As I've mentioned in the wiki page of this proj.,to use the
 androidSpice,
  the server should be modified to force the use of JPEG compression,and
 qemu
  should not use -vga qxl and should use -usbdevice tablet(check for
 the
  reason in wikipage,maybe you can fix this),have you checked this?

 so you need to use a standard vga device and not the qxl right now? well,
 it's
 certainly a good start. But you do realize without the qxl device this is
 no more
 then a different vnc? i.e. it sends bitmaps only, using jpeg maybe, I
 wasn't aware
 we did that in this case, but no other operation (no copy / text / any
 other rop).

 If not forced to use JPEG,the quic algorithm in client will cause
 SIGBUS
  and quit,if qxl is not disabled ,the Java UI will crash for it can handle
  only SPICE_IMAGE_TYPE_JPEG=105 till now.
 And also,the app will cause over memory limit of Java in some
 machine
  of android-2.2 and AVDs.
 I'm working to fix this,welcome to improve it!
 I'v uploaded the androidSpice.apk and androidSpice-debug.apk with the
  latter's debug msg switched on(you can check the ANDROID LOG msg by #adb
  logcat). I've also uploaded the red_worker.c for server modifying(If
  needed,you can get the libspicec.so from the installed android program
 file
  directory as /data/data/com.keqi*/lib/libspicec.so to use directly in the
  Android proj.).
 Best Regards.
  ---Lim---Lin林--
 
  On Wed, Apr 27, 2011 at 6:14 AM, Gianluca Cecchi
  gianluca.cec...@gmail.comwrote:
 
   Hello,
   device is HTC Wildfire with android 2.2.1 and my guest is windows 7 on
   F14+virt-preview repo.
   In /var/log/libvirt/qemu/guest.log after pressing connect button I get:
  
   reds_handle_main_link:
   reds_show_new_channel: channel 1:0, connected successfully, over Non
 Secure
   link
   reds_main_handle_message: net test: latency 22.151000 ms, bitrate
   10769821 bps (10.270902 Mbps)
   reds_show_new_channel: channel 2:0, connected successfully, over Non
 Secure
   link
   red_dispatcher_set_peer:
   handle_dev_input: connect
   handle_new_display_channel: jpeg disabled
   handle_new_display_channel: zlib-over-glz disabled
   reds_show_new_channel: channel 3:0, connected successfully, over Non
 Secure
   link
   inputs_link:
  
   Then error message on android device (see jpeg)
   I select force close and I get in log file:
  
   red_receive: Connection reset by peer
   reds_disconnect:
   red_dispatcher_shutdown_cursor_peer:
   red_dispatcher_shutdown_peer:
   handle_dev_input: cursor disconnect
   handle_dev_input: disconnect
  
   Connection works from another f14 pc with spicy.
   Any information that I can give from the android device?
  
   Gianluca
  
   2011/4/26 Mosebach  Kai kai.moseb...@bsse.ethz.ch:
Hey Lin,
   
Just gave it a quick shot :
   
- DNS resolving not working?
- access to server w/o password not supported?
- access w/ password produces a force kill after a vibration
- some traffic is seen on the spice-server side though
   
(couldn’t connect therefore)
   
Any logfiles I can provide?
   
HW/SW : Android V2.2 on Samsung Galaxy Tab
   
Cheers Kai
   
On 4/26/11 9:43 AM, Shuxiang Lim shohyang...@gmail.com wrote:
   
   Released with src  .apk files with button-double-click fixed.
   --Lin--
   
   On 4/26/11, Shuxiang Lim shohyang...@gmail.com wrote:
Hi,all!
  After I workaround the bug input will choke output,I'm glad to
release the USABLE androidSpice-0.1.4 on google code:
   
http://code.google.com/p/spice-client-android/
   
You shall check the wiki page of it for the build/install/use of
 it.
Any use or 

Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Mosebach Kai
I finally build it on OSX 10.6.6 successfully :-)

From the patches below I only used :

common/lines.c
gtk/Makefile.am


Then a 

./configure --with-audio=gstreamer --without-python
--with-coroutine=gthread

did the trick, I think --with-coroutine=gthread avoid the _XOPEN_SOURCE
patches.

Best Kai


On 4/27/11 10:47 AM, Christophe Fergeau cferg...@redhat.com wrote:

On Tue, Apr 26, 2011 at 08:39:13PM +0200, Attila Sukosd wrote:
 Also I've attached the patch which fixes a few things here and there...
With
 this it builds fine.

Ah, so you've already built spice-gtk on macosx? How well did it work?

I had some questions about your patch, it would be really helpful if you
remembered why you had to change these things :)

Thanks for the patch,

Christophe

diff --git a/common/lines.c b/common/lines.c
index 1a14c18..59d0689 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -2985,7 +2985,7 @@ miWideDashSegment (GCPtr pGC,
 double L, l;
 double k;
 PolyVertexRec vertices[4];
-PolyVertexRec saveRight = { 0 }, saveBottom;
+PolyVertexRec saveRight = { 0 }, saveBottom = { 0 };
 PolySlopeRec slopes[4];
 PolyEdgeRec left[2], right[2];
 LineFaceRec lcapFace, rcapFace;

I assume this bit is to avoid a saveBottom can be used without being
initialized gcc warning?



diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 7ce8a65..e5f3c1c 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -27,6 +27,7 @@ if HAVE_LD_VERSION_SCRIPT
 VERSION_LDFLAGS = -Wl,--version-script=${srcdir}/map-file
 else
 VERSION_LDFLAGS = -export-symbols ${srcdir}/sym-file
+#VERSION_LDFLAGS =
 endif
 
 KEYMAP_GEN = $(srcdir)/keymap-gen.pl


macosx ld indeed doesn't have any of --version-script nor -export-symbols,
but it does have --exported_symbols_list which seems to be equivalent to
what we are trying to do here. This means m4/ld-version.m4 could be
improved to deal with this.


@@ -420,7 +421,6 @@ INTROSPECTION_GIRS =
 INTROSPECTION_SCANNER_ARGS = --add-include-path=$(builddir)
$(PREFIX_ARGS)
 INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir)
 
-if HAVE_INTROSPECTION
 glib_introspection_files = $(libspice_client_glibinclude_HEADERS)
 gtk_introspection_files = $(libspice_client_gtkinclude_HEADERS)
 
@@ -453,7 +453,6 @@ typelibsdir = $(libdir)/girepository-1.0
 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
-endif

I'm not sure why you needed this change.
My first guess was that this change is needed to prevent autoconf from
complaining that HAVE_INTROSPECTION is not present in an AM_CONDITIONAL
when gobject-introspection (and introspection.m4) are not installed.
However, this would mean that unconditionally building the introspection
stuff would fail, and moreover, when I tested just this change without
introspection, configure didn't succeed. Can you tell more about why this
change was needed?


diff --git a/gtk/continuation.c b/gtk/continuation.c
index 4f5b027..3aefa54 100644
--- a/gtk/continuation.c
+++ b/gtk/continuation.c
@@ -21,7 +21,10 @@
 #include config.h
 
 #include continuation.h
-
+#ifdef __MACH__
+#define _XOPEN_SOURCE
+#include ucontext.h
+#endif

continuation.h already has the #include ucontext.h, including it again
shouldn't do much. Does something like
--- a/gtk/continuation.c
+++ b/gtk/continuation.c
@@ -21,7 +21,10 @@
 #include config.h
 
+#define _XOPEN_SOURCE
 #include continuation.h

help with the issue you were having?


diff --git a/gtk/continuation.h b/gtk/continuation.h
index 585788e..6822757 100644
--- a/gtk/continuation.h
+++ b/gtk/continuation.h
@@ -21,7 +21,8 @@
 #ifndef _CONTINUATION_H_
 #define _CONTINUATION_H_
 
-#include ucontext.h
+#include string.h
+#include sys/ucontext.h

Ah, this explains the #include ucontext.h you added in the previous
hunk.
I suspect dropping both hunks and only adding the #define _XOPEN_SOURCE
here would fix your issues. Though nothing in ucontext.h nor in
sys/ucontext.h on a macosx box depends on _XOPEN_SOURCE, so I'm not sure
what issues you were seeing here?


diff --git a/gtk/coroutine_ucontext.c b/gtk/coroutine_ucontext.c
index 91059ad..ee48249 100644
--- a/gtk/coroutine_ucontext.c
+++ b/gtk/coroutine_ucontext.c
@@ -25,6 +25,9 @@
 #include stdio.h
 #include stdlib.h
 #include coroutine.h
+#ifndef MAP_ANONYMOUS
+# define MAP_ANONYMOUS MAP_ANON
+#endif

Yep, macosx has MAP_ANON but no MAP_ANONYMOUS


diff --git a/gtk/spice-client-gtk.override b/gtk/spice-client-gtk.override
index 7b3543a..e634f78 100644
--- a/gtk/spice-client-gtk.override
+++ b/gtk/spice-client-gtk.override
@@ -1,6 +1,7 @@
 %%
 headers
 #include Python.h
+#define NO_IMPORT_PYGOBJECT

This one seems to be here for the same kind of issues as what led to
https://gitorious.org/rb-lastfm/rb-lastfm/commit/ab102ef5a954eb87354c3467d
1a35c8fa596242b
but I must say I don't understand very well the issue/what's going on. Do
you happen to have the compile error handy (just for my knowledge). I'm
happy to take this one as is whatsoever.


Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Christophe Fergeau
On Tue, Apr 26, 2011 at 05:10:43PM +0200, Kai Mosebach wrote:
 I just triesbuild the OSX gtk client, my findings :
 
 1.) Installed gtk2 and gstreamer via ports

Do you get a gtk2 version using x11 or the native osx port when you get
it from (mac?)ports ?

Christophe


pgp3ZllVEhXHR.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Kai Mosebach
Regarding the native gtk2 build I think its not possible with macports.
You would need to use this I guess : http://gtk-osx.sourceforge.net/

Cheers Kai

On 4/27/11 11:18 AM, Christophe Fergeau cferg...@redhat.com wrote:

On Tue, Apr 26, 2011 at 05:10:43PM +0200, Kai Mosebach wrote:
 I just triesbuild the OSX gtk client, my findings :
 
 1.) Installed gtk2 and gstreamer via ports

Do you get a gtk2 version using x11 or the native osx port when you get
it from (mac?)ports ?

Christophe


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] androidSpice-0.1.4 released

2011-04-27 Thread Alon Levy
On Wed, Apr 27, 2011 at 04:54:55PM +0800, Shuxiang Lim wrote:
 Yep,it's really nasty.
But if I want to leverage FULL spice image ability,I have to:
 1.Fix the bugs of sigbus in quic.c on Android by rewriting the
 pointer-type-cast into memcpy.etc..
No idea what the problem is, is it a compile error? can you point to the 
lines/functions?
I assume we are talking about common/quic.c?

 2.Then,then,I got the processed image buffer in memory,BUT,HOW can I output
 it??? AFAIK,android offer no image output API for C(at least 2.3), and Java
 cannot access memory directly(am I right?). How can I do it besides sending
 the image data as soon and little as possible to Java via Unix-sock?
  So, no matter how fast or colorful Spice is, it's choked by Android
 framework and Java.

what prevents you from rendering to a buffer and then giving that to java like
you already do with the jpeg images? I confess not looking at the androidSpice 
code,
so I'm not sure how exactly you do it, but the two options that come to mind are
passing the jpeg buffer as is and letting java uncompress and display, or 
uncompressing
and then passing the uncompressed buffer to java. If the later, then just let 
the
existing rendering code do it's work on a memory buffer and then pass the 
results.

 
 Thus,if Java has the ability to maitain something like image buffer in
 memory like C(can it??), this may be the most-efficeint way I can imagine:
 implementing spice protocol and rewriting UI in Java,and leaving only(or
 not) the image computing work to lib**.so via JNI.

ok, so exactly what I outline above? but I'm not familiar with JNI or the 
android
SDK.

   But that's beyond my current scope.
 
  Any ideas to access the memory block of image buffer allocated by
 C(libspicec.so) directly in Java,instantly and swiftly?
 

sorry, no idea.

 ...One more time I want to curse Android and disdain Java...
 Best regards.
 
 On Wed, Apr 27, 2011 at 4:20 PM, Alon Levy al...@redhat.com wrote:
 
  On Wed, Apr 27, 2011 at 10:30:18AM +0800, Shuxiang Lim wrote:
   Hi,all!
  Thanks for the trying/feedbacking and sorry for the nascent itches of
  the
   project.
  As I've mentioned in the wiki page of this proj.,to use the
  androidSpice,
   the server should be modified to force the use of JPEG compression,and
  qemu
   should not use -vga qxl and should use -usbdevice tablet(check for
  the
   reason in wikipage,maybe you can fix this),have you checked this?
 
  so you need to use a standard vga device and not the qxl right now? well,
  it's
  certainly a good start. But you do realize without the qxl device this is
  no more
  then a different vnc? i.e. it sends bitmaps only, using jpeg maybe, I
  wasn't aware
  we did that in this case, but no other operation (no copy / text / any
  other rop).
 
  If not forced to use JPEG,the quic algorithm in client will cause
  SIGBUS
   and quit,if qxl is not disabled ,the Java UI will crash for it can handle
   only SPICE_IMAGE_TYPE_JPEG=105 till now.
  And also,the app will cause over memory limit of Java in some
  machine
   of android-2.2 and AVDs.
  I'm working to fix this,welcome to improve it!
  I'v uploaded the androidSpice.apk and androidSpice-debug.apk with the
   latter's debug msg switched on(you can check the ANDROID LOG msg by #adb
   logcat). I've also uploaded the red_worker.c for server modifying(If
   needed,you can get the libspicec.so from the installed android program
  file
   directory as /data/data/com.keqi*/lib/libspicec.so to use directly in the
   Android proj.).
  Best Regards.
   ---Lim---Lin林--
  
   On Wed, Apr 27, 2011 at 6:14 AM, Gianluca Cecchi
   gianluca.cec...@gmail.comwrote:
  
Hello,
device is HTC Wildfire with android 2.2.1 and my guest is windows 7 on
F14+virt-preview repo.
In /var/log/libvirt/qemu/guest.log after pressing connect button I get:
   
reds_handle_main_link:
reds_show_new_channel: channel 1:0, connected successfully, over Non
  Secure
link
reds_main_handle_message: net test: latency 22.151000 ms, bitrate
10769821 bps (10.270902 Mbps)
reds_show_new_channel: channel 2:0, connected successfully, over Non
  Secure
link
red_dispatcher_set_peer:
handle_dev_input: connect
handle_new_display_channel: jpeg disabled
handle_new_display_channel: zlib-over-glz disabled
reds_show_new_channel: channel 3:0, connected successfully, over Non
  Secure
link
inputs_link:
   
Then error message on android device (see jpeg)
I select force close and I get in log file:
   
red_receive: Connection reset by peer
reds_disconnect:
red_dispatcher_shutdown_cursor_peer:
red_dispatcher_shutdown_peer:
handle_dev_input: cursor disconnect
handle_dev_input: disconnect
   
Connection works from another f14 pc with spicy.
Any information that I can give from the android device?
   
Gianluca
   
2011/4/26 Mosebach  Kai 

Re: [Spice-devel] windows bsod with spice 0.8.1

2011-04-27 Thread Alon Levy
On Wed, Apr 27, 2011 at 12:38:04PM +0400, Emre Erenoglu wrote:
 On Wed, Apr 27, 2011 at 12:07 PM, Alon Levy al...@redhat.com wrote:
 
  On Wed, Apr 27, 2011 at 01:16:01AM +0400, Emre Erenoglu wrote:
   Hi,
  
   I started to see frequent crashes with my guests running windows xp and
   windows server 2003 x86.  The bsod appears on qxldd.dll. I can give
  further
   info if needed.
 
  please. what qxldd.dll are you using? can you run with -global
  qxl.guestdebug=20 -global qxl.debug=3
 
 
 It's version 1.4.1.0 from the 0.6.1 package downloaded from spice-space.org.
 I will run with the above parameters and give you the result. Those
 parameters are passed to qemu I assume?

yes. Also, possibly you need -global qxl-vga.guestdebug=20 -global 
qxl-vga.debug=3
too (or only).

 
 
  this will give you stupendous amounts of output (I hope), hopefully with
  something wrong. (you can lower the 20
  to 10 to get something medium. 3 is a good number for basics).
 
  actually, looking at the git log the main (only relevant I think) changes
  are agent related - so are you
  running an updated agent in the guest? can you try without it and see if
  the crashes persist?
 
 
 OK, by the way, I downgraded to spice 0.8.0 and still seeing the crashes.
 Therefore, I will conclude that it's not related to changes in spice 0.8.1.
 I will update back to spice 0.8.1 and send the logs. We may also look into
 the windbg when I have some time tonight.
 
 
 
  try the debug parameters to qemu second, I don't think they are relevant.
 
  Alon
 
  
   The host is Linux x86_64, qemu 0.14, spice 0.8.1. Guest has qxl 0.6.1
   drivers loaded. I may revert back to 0.8.0 since it was not crashing.
   Nothing changed in the guests when I upgraded spice from 0.8.0 to 0.8.1.
  
   --
   Emre
 
 
 -- 
 Emre

 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Christophe Fergeau
On Wed, Apr 27, 2011 at 11:27:53AM +0200, Kai Mosebach wrote:
 Regarding the native gtk2 build I think its not possible with macports.
 You would need to use this I guess : http://gtk-osx.sourceforge.net/

yes, trying out http://sourceforge.net/apps/trac/gtk-osx/wiki/Build is part
of my medium term plans :)

Christophe


pgputl7ndOP2U.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Spice-devel Digest, Vol 15, Issue 78

2011-04-27 Thread Federico Alves
 with the issue you were having?


diff --git a/gtk/continuation.h b/gtk/continuation.h
index 585788e..6822757 100644
--- a/gtk/continuation.h
+++ b/gtk/continuation.h
@@ -21,7 +21,8 @@
 #ifndef _CONTINUATION_H_
 #define _CONTINUATION_H_
 
-#include ucontext.h
+#include string.h
+#include sys/ucontext.h

Ah, this explains the #include ucontext.h you added in the previous
hunk.
I suspect dropping both hunks and only adding the #define _XOPEN_SOURCE
here would fix your issues. Though nothing in ucontext.h nor in
sys/ucontext.h on a macosx box depends on _XOPEN_SOURCE, so I'm not sure
what issues you were seeing here?


diff --git a/gtk/coroutine_ucontext.c b/gtk/coroutine_ucontext.c
index 91059ad..ee48249 100644
--- a/gtk/coroutine_ucontext.c
+++ b/gtk/coroutine_ucontext.c
@@ -25,6 +25,9 @@
 #include stdio.h
 #include stdlib.h
 #include coroutine.h
+#ifndef MAP_ANONYMOUS
+# define MAP_ANONYMOUS MAP_ANON
+#endif

Yep, macosx has MAP_ANON but no MAP_ANONYMOUS


diff --git a/gtk/spice-client-gtk.override
b/gtk/spice-client-gtk.override
index 7b3543a..e634f78 100644
--- a/gtk/spice-client-gtk.override
+++ b/gtk/spice-client-gtk.override
@@ -1,6 +1,7 @@
 %%
 headers
 #include Python.h
+#define NO_IMPORT_PYGOBJECT

This one seems to be here for the same kind of issues as what led to
https://gitorious.org/rb-lastfm/rb-lastfm/commit/ab102ef5a954eb87354c3467
d
1a35c8fa596242b
but I must say I don't understand very well the issue/what's going on. Do
you happen to have the compile error handy (just for my knowledge). I'm
happy to take this one as is whatsoever.

Thanks again for the patch,

Christophe



--

Message: 2
Date: Wed, 27 Apr 2011 11:18:22 +0200
From: Christophe Fergeau cferg...@redhat.com
Subject: Re: [Spice-devel] Spice on OS/X
To: Kai Mosebach sp...@komadev.de
Cc: spice-devel@lists.freedesktop.org
Message-ID: 20110427091822.gf10...@teriyaki.redhat.com
Content-Type: text/plain; charset=us-ascii

On Tue, Apr 26, 2011 at 05:10:43PM +0200, Kai Mosebach wrote:
 I just triesbuild the OSX gtk client, my findings :
 
 1.) Installed gtk2 and gstreamer via ports

Do you get a gtk2 version using x11 or the native osx port when you get
it from (mac?)ports ?

Christophe
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: 
http://lists.freedesktop.org/archives/spice-devel/attachments/20110427/3b
fdde35/attachment-0001.pgp

--

Message: 3
Date: Wed, 27 Apr 2011 11:19:59 +0200
From: Christophe Fergeau cferg...@redhat.com
Subject: Re: [Spice-devel] spice-gtk 0.6 : Ctrl+W closes the client
To: spice-devel@lists.freedesktop.org
Message-ID: 20110427091959.gg10...@teriyaki.redhat.com
Content-Type: text/plain; charset=iso-8859-1

Hi Fr?d?ric,

On Wed, Apr 27, 2011 at 10:28:04AM +0200, Fr?d?ric Grelot wrote:
 I finally decided to give a try to the gtk version of spice client.
 First, I have to say that I'm quite impressed (and I understand why it
 tends to become the baseline client).  Still, there is one bug that I
 would consider blocking (as far as I'm concerned) : I'm pretty used to
 the Ctrl+W combination to close windows, firefox or eclipse tabs,
 etc... However, is it expected that it is grabbed by the client itself
 (i.e. not the guest) and that pressing Ctrl+W closes the whole client
 window?
 I would expect the following : if focus is on toolbar, menu, etc, Ctrl+W
 closes the client, while if focus is on the guest (i.e. mouse over the
 canvas), the Ctrl+W is sent along to the guest, and spicy client doesn't
 close.
 
 Thanks for taking that into account if possible!

Actually, I've already fixed this in
https://gitorious.org/~teuf/spice-gtk/teuf-spice-gtk/commit/bae0ee66e4bb95
00b2dafa0fa459d40b63abbe7d

I've sent a merge request, so hopefully it will get upstream soon :)

Thanks for the feedback,

Christophe
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: 
http://lists.freedesktop.org/archives/spice-devel/attachments/20110427/47
b96df5/attachment-0001.pgp

--

Message: 4
Date: Wed, 27 Apr 2011 11:23:55 +0200
From: Kai Mosebach sp...@komadev.de
Subject: Re: [Spice-devel] Spice on OS/X
To: Christophe Fergeau cferg...@redhat.com, Kai Mosebach
   sp...@komadev.de
Cc: spice-devel@lists.freedesktop.org
Message-ID: c9ddac37.24413%kai.moseb...@bsse.ethz.ch
Content-Type: text/plain;  charset=US-ASCII


- Its the x11 version
- sound is not working atm :/

- throughput of a video takes approx. +70% of the bandwidth of the old
spicec.exe + wine (incl. sound)
The wine+spicec.exe takes 9 MBit/sec for a random news video with a res.
of 1280 x 864, the new one is at 14MBit ...

Any thoughts?

Best Kai

On 4/27/11 11:18 AM, Christophe Fergeau cferg...@redhat.com wrote:

On Tue, Apr 26, 2011 at 05:10:43PM +0200, Kai

[Spice-devel] [CIFEX] A file available for download from Kai Mosebach

2011-04-27 Thread Kai Mosebach
Hello spice-devel@lists.freedesktop.org,

Kai Mosebach kai.moseb...@bsse.ethz.ch has stored a file on our server for 
you to download. File information appears below.



From: Kai Mosebach
Email:kai.moseb...@bsse.ethz.ch

The file is (follow link to download):

spice-gtk-0.5-darwin.tgz  
https://cifex.ethz.ch:443/?fileId=11135user=spice-devel%40lists.freedesktop.org


Expiration: The file will be removed on 2011-05-04 at 23:59:59

For downloading you have to enter the following password: F%78Gt9OoL#}l^qy6R2A

Link to login to the system: 
https://cifex.ethz.ch:443/?user=spice-devel%40lists.freedesktop.org



We recommend that you keep your antivirus software up-to-date when downloading 
any files from the internet.


CIFEX - CISD File EXchanger
Center for Information Sciences and Databases
ETH Zurich
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [CIFEX] A file available for download from Kai Mosebach

2011-04-27 Thread Kai Mosebach
Please note that these are the libs + the client only and they rely on
working versions of the depending libs (such as gstreamer etc)
To find out where it expects what you can run

$ otool -L libspice-client-glib-2.0.2.dylib

(ldd equivalent in osx)

Cheers Kai

On 4/27/11 11:51 AM, Kai Mosebach kai.moseb...@bsse.ethz.ch wrote:

Hello spice-devel@lists.freedesktop.org,

Kai Mosebach kai.moseb...@bsse.ethz.ch has stored a file on our server
for you to download. File information appears below.



From: Kai Mosebach
Email:kai.moseb...@bsse.ethz.ch

The file is (follow link to download):

spice-gtk-0.5-darwin.tgz
https://cifex.ethz.ch:443/?fileId=11135user=spice-devel%40lists.freedeskt
op.org


Expiration: The file will be removed on 2011-05-04 at 23:59:59

For downloading you have to enter the following password:
F%78Gt9OoL#}l^qy6R2A

Link to login to the system:
https://cifex.ethz.ch:443/?user=spice-devel%40lists.freedesktop.org



We recommend that you keep your antivirus software up-to-date when
downloading any files from the internet.


CIFEX - CISD File EXchanger
Center for Information Sciences and Databases
ETH Zurich
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] windows bsod with spice 0.8.1

2011-04-27 Thread Gianluca Cecchi
On Wed, Apr 27, 2011 at 10:38 AM, Emre Erenoglu ereno...@gmail.com wrote:
 On Wed, Apr 27, 2011 at 12:07 PM, Alon Levy al...@redhat.com wrote:

 On Wed, Apr 27, 2011 at 01:16:01AM +0400, Emre Erenoglu wrote:
  Hi,
 
  I started to see frequent crashes with my guests running windows xp and
  windows server 2003 x86.  The bsod appears on qxldd.dll. I can give
  further
  info if needed.

 please. what qxldd.dll are you using? can you run with -global
 qxl.guestdebug=20 -global qxl.debug=3

 It's version 1.4.1.0 from the 0.6.1 package downloaded from spice-space.org.
 I will run with the above parameters and give you the result. Those
 parameters are passed to qemu I assume?

hello,
I could send my self compiled qxldd.dll and qxl.sys as described in
thread for w2k3 32bit:
http://lists.freedesktop.org/archives/spice-devel/2011-April/003168.html

but I don't know if there are copyright restrictions or other
limitations in doing so...

Gianluca
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [CIFEX] A file available for download from Kai Mosebach

2011-04-27 Thread Mosebach Kai
For this you should have a working build process and then write some
after processing script which packs things together automatically (such
as the binaries below) + all needed libs and the throw it into a pkg or
dmg automatically. It'd be a nice to have but surely takes more than some
minutes ...

On 4/27/11 11:57 AM, Federico Alves sa...@minixel.com wrote:

I get this error
Last login: Sat Apr 23 00:23:34 on ttys003
/Users/federico/Downloads/spice-gtk-0.5-darwin/bin/spicy ; exit;
192:~ federico$ /Users/federico/Downloads/spice-gtk-0.5-darwin/bin/spicy ;
exit;dyld: Library not loaded:
/usr/local/lib/libspice-client-gtk-2.0.1.dylib
  Referenced from:
/Users/federico/Downloads/spice-gtk-0.5-darwin/bin/spicy
  Reason: image not found
Trace/BPT trap
Logout

I was referring not exactly to a binary version, but to an installer. Just
like a real software product. In fact, I want to put such a thing in the
Apple store, free. It would be great.

Is that possible?

Federico




On 4/27/11 5:51 AM, Kai Mosebach kai.moseb...@bsse.ethz.ch wrote:

Hello sa...@minixel.com,

Kai Mosebach kai.moseb...@bsse.ethz.ch has stored a file on our server
for you to download. File information appears below.



From: Kai Mosebach
Email:kai.moseb...@bsse.ethz.ch

The file is (follow link to download):

spice-gtk-0.5-darwin.tgz
https://cifex.ethz.ch:443/?fileId=11135user=sales%40minixel.com


Expiration: The file will be removed on 2011-05-04 at 23:59:59

For downloading you have to enter the following password:
DDIFfmQlBic~R@3l@z

Link to login to the system:
https://cifex.ethz.ch:443/?user=sales%40minixel.com



We recommend that you keep your antivirus software up-to-date when
downloading any files from the internet.


CIFEX - CISD File EXchanger
Center for Information Sciences and Databases
ETH Zurich




___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] windows bsod with spice 0.8.1

2011-04-27 Thread Emre Erenoglu
On Wed, Apr 27, 2011 at 2:00 PM, Gianluca Cecchi
gianluca.cec...@gmail.comwrote:

 On Wed, Apr 27, 2011 at 10:38 AM, Emre Erenoglu ereno...@gmail.com
 wrote:
  On Wed, Apr 27, 2011 at 12:07 PM, Alon Levy al...@redhat.com wrote:
 
  On Wed, Apr 27, 2011 at 01:16:01AM +0400, Emre Erenoglu wrote:
   Hi,
  
   I started to see frequent crashes with my guests running windows xp
 and
   windows server 2003 x86.  The bsod appears on qxldd.dll. I can give
   further
   info if needed.
 
  please. what qxldd.dll are you using? can you run with -global
  qxl.guestdebug=20 -global qxl.debug=3
 
  It's version 1.4.1.0 from the 0.6.1 package downloaded from
 spice-space.org.
  I will run with the above parameters and give you the result. Those
  parameters are passed to qemu I assume?

 hello,
 I could send my self compiled qxldd.dll and qxl.sys as described in
 thread for w2k3 32bit:
 http://lists.freedesktop.org/archives/spice-devel/2011-April/003168.html

 but I don't know if there are copyright restrictions or other
 limitations in doing so...


Hi Gianluca,  I really appreciate if you can send it to my personal address.
I may need the debug symbols etc. as well, and I could not find that
anywhere. (if we want to windbg the crash).

Emre
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] windows bsod with spice 0.8.1

2011-04-27 Thread Alon Levy
On Wed, Apr 27, 2011 at 12:00:34PM +0200, Gianluca Cecchi wrote:
 On Wed, Apr 27, 2011 at 10:38 AM, Emre Erenoglu ereno...@gmail.com wrote:
  On Wed, Apr 27, 2011 at 12:07 PM, Alon Levy al...@redhat.com wrote:
 
  On Wed, Apr 27, 2011 at 01:16:01AM +0400, Emre Erenoglu wrote:
   Hi,
  
   I started to see frequent crashes with my guests running windows xp and
   windows server 2003 x86.  The bsod appears on qxldd.dll. I can give
   further
   info if needed.
 
  please. what qxldd.dll are you using? can you run with -global
  qxl.guestdebug=20 -global qxl.debug=3
 
  It's version 1.4.1.0 from the 0.6.1 package downloaded from spice-space.org.
  I will run with the above parameters and give you the result. Those
  parameters are passed to qemu I assume?
 
 hello,
 I could send my self compiled qxldd.dll and qxl.sys as described in
 thread for w2k3 32bit:
 http://lists.freedesktop.org/archives/spice-devel/2011-April/003168.html
 
 but I don't know if there are copyright restrictions or other
 limitations in doing so...

Seems to depend on the Microsoft Software License Terms for the WDK according
to http://cgit.freedesktop.org/spice/win32/qxl/tree/display/brush.c

Better go read that at some point..

 
 Gianluca
 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 1/9] build: make it silent

2011-04-27 Thread Christophe Fergeau
On Tue, Jan 25, 2011 at 07:17:20PM +0100, Marc-André Lureau wrote:
 This patch make it easier to spot warnings in compilation.  It should
 work with older versions of automake that don't support silent rules.

This one was already applied in 0e64e2d0 in November

Christophe


pgpJjjGKTG7sS.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 2/9] build: require c99

2011-04-27 Thread Christophe Fergeau
Why do you want to require c99? Do the compilers we use on windows have
good enough c99 support?

Christophe

On Tue, Jan 25, 2011 at 07:17:21PM +0100, Marc-André Lureau wrote:
 ---
  configure.ac |4 
  1 files changed, 4 insertions(+), 0 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
 index 02ec331..2af3647 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -18,6 +18,10 @@ SPICE_COMMON_SRCDIR='$(top_srcdir)'/common
  
  AS_IF([test $CFLAGS = ], [], [_cflags_is_set=yes])
  AC_PROG_CC
 +AC_PROG_CC_C99
 +if test x$ac_cv_prog_cc_c99 = xno; then
 +AC_MSG_ERROR([C99 compiler is required.])
 +fi
  AS_IF([test $CXXFLAGS = ], [], [_cxxflags_is_set=yes])
  AC_PROG_CXX
  AC_PROG_INSTALL
 -- 
 1.7.3.4
 
 


pgpvFO8pV7Ar7.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 3/9] common: RFC: add windows.h where required, make gdi_handlers static

2011-04-27 Thread Christophe Fergeau
On Tue, Jan 25, 2011 at 07:17:22PM +0100, Marc-André Lureau wrote:
 This patch has not been verified. Somebody with VS should check if it
 still compiles and run fine before applying it.

Making gdi_handlers makes a lot of sense to me. I couldn't find on google
or with git grep anything that would indicate that gdi_handlers is magic in
anyway, so this part of the patch looks good to me. I'm not sure why you
needed to add some #include windows.h in a few headers?

Christophe

 ---
  client/windows/platform.cpp |1 -
  common/canvas_base.h|3 +++
  common/canvas_utils.c   |2 +-
  common/canvas_utils.h   |4 
  4 files changed, 8 insertions(+), 2 deletions(-)
 
 diff --git a/client/windows/platform.cpp b/client/windows/platform.cpp
 index c41c39a..ac6fd91 100644
 --- a/client/windows/platform.cpp
 +++ b/client/windows/platform.cpp
 @@ -42,7 +42,6 @@
  #endif
  #include spice/vd_agent.h
  
 -int gdi_handlers = 0;
  extern HINSTANCE instance;
  
  class DefaultEventListener: public Platform::EventListener {
 diff --git a/common/canvas_base.h b/common/canvas_base.h
 index 2166dcf..bea041f 100644
 --- a/common/canvas_base.h
 +++ b/common/canvas_base.h
 @@ -24,6 +24,9 @@
  #include lz.h
  #include region.h
  #include draw.h
 +#ifdef WIN32
 +#include windows.h
 +#endif
  
  typedef void (*spice_destroy_fn_t)(void *data);
  
 diff --git a/common/canvas_utils.c b/common/canvas_utils.c
 index 020b23c..743c86c 100644
 --- a/common/canvas_utils.c
 +++ b/common/canvas_utils.c
 @@ -27,7 +27,7 @@
  #include mem.h
  
  #ifdef WIN32
 -extern int gdi_handlers;
 +static int gdi_handlers = 0;
  #endif
  
  #ifndef ASSERT
 diff --git a/common/canvas_utils.h b/common/canvas_utils.h
 index b87b816..fe66f85 100644
 --- a/common/canvas_utils.h
 +++ b/common/canvas_utils.h
 @@ -19,6 +19,10 @@
  #ifndef _H_CANVAS_UTILS
  #define _H_CANVAS_UTILS
  
 +#ifdef WIN32
 +#include windows.h
 +#endif
 +
  #include spice/types.h
  
  #include pixman_utils.h
 -- 
 1.7.3.4
 
 


pgp9yEm6441Lw.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 6/9] common: spice_memdup could accept NULL

2011-04-27 Thread Christophe Fergeau
On Tue, Jan 25, 2011 at 07:17:25PM +0100, Marc-André Lureau wrote:
 diff --git a/common/mem.c b/common/mem.c
 index b0a7eb1..4db8a2c 100644
 --- a/common/mem.c
 +++ b/common/mem.c
 @@ -71,6 +71,10 @@ void *spice_memdup(const void *mem, size_t n_bytes)
  {
  void *copy;
  
 +if (mem == NULL) {
 +return NULL;
 +}
 +

I'd rather have an ASSERT(n_bytes == 0) if we do this change so that we
don't allow memdup'ing pointers that are not expected to be NULL.
Do you remember why you needed this? Wasn't it possible to fix the caller
to not pass NULL?

Christophe


pgp0o6fU01MyI.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 2/9] build: require c99

2011-04-27 Thread Marc-André Lureau

- Original Message -
 Why do you want to require c99? Do the compilers we use on windows
 have
 good enough c99 support?

Because we use c99: stdbool.h, inttypes.h, bool, variadic macros, // comments, 
...

Actually, I wonder if 43c5b4f97334f0f4ca61bdd679b68d079575deac is redundant if 
we use that patch.

regards

-- 
Marc-André Lureau
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 6/9] common: spice_memdup could accept NULL

2011-04-27 Thread Marc-André Lureau

- Original Message -
 On Tue, Jan 25, 2011 at 07:17:25PM +0100, Marc-André Lureau wrote:
  diff --git a/common/mem.c b/common/mem.c
  index b0a7eb1..4db8a2c 100644
  --- a/common/mem.c
  +++ b/common/mem.c
  @@ -71,6 +71,10 @@ void *spice_memdup(const void *mem, size_t
  n_bytes)
   {
   void *copy;
 
  + if (mem == NULL) {
  + return NULL;
  + }
  +
 
 I'd rather have an ASSERT(n_bytes == 0) if we do this change so that
 we
 don't allow memdup'ing pointers that are not expected to be NULL.

Sigh.. i would prefer to avoid ASSERT, and instead use return_val_if_fail() or 
so.

That's probably why I didn't add it in the first place.

 Do you remember why you needed this? Wasn't it possible to fix the
 caller
 to not pass NULL?

I can't remember, it probably made some code easier to read, and it follows 
glib way.
http://developer.gnome.org/glib/unstable/glib-Memory-Allocation.html#g-memdup

-- 
Marc-André Lureau
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 2/9] build: require c99

2011-04-27 Thread Christophe Fergeau
On Wed, Apr 27, 2011 at 07:22:34AM -0400, Marc-André Lureau wrote:
 
 - Original Message -
  Why do you want to require c99? Do the compilers we use on windows
  have
  good enough c99 support?
 
 Because we use c99: stdbool.h, inttypes.h, bool, variadic macros, // 
 comments, ...
 
 Actually, I wonder if 43c5b4f97334f0f4ca61bdd679b68d079575deac is redundant 
 if we use that patch.

Your patch looks better though if autoconf has dedicated macros to switch
to c99

Christophe


pgpxwgd8RBRCE.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 6/9] common: spice_memdup could accept NULL

2011-04-27 Thread Christophe Fergeau
On Wed, Apr 27, 2011 at 02:06:48PM +0200, Christophe Fergeau wrote:
 On Wed, Apr 27, 2011 at 07:27:18AM -0400, Marc-André Lureau wrote:
  Sigh.. i would prefer to avoid ASSERT, and instead use return_val_if_fail() 
  or so.
  
  That's probably why I didn't add it in the first place.
 
 The old code would crash anyway when being passed NULL, that's why I
 suggested a hard ASSERT here, to crash at the same place instead of getting
 different failures that might be harder to diagnose later on. A
 g_return_val_if_fail might work, but there is no such thing in spice/ :)

Thinking some more about it, if the patch wasn't written as a fix for a
crash when spice_memdup was passed NULL, I'm ok with ack'ing the 1st
version too.

Christophe


pgp6QE2YWrkyI.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] spice-gtk 0.6 : Ctrl+W closes the client

2011-04-27 Thread Marc-André Lureau
Hi

On Wed, Apr 27, 2011 at 11:19 AM, Christophe Fergeau
cferg...@redhat.com wrote:

 I've sent a merge request, so hopefully it will get upstream soon :)


Merged a few hours ago.

thanks

-- 
Marc-André Lureau
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 7/9] common: add ring_get_length() for debugging purposes

2011-04-27 Thread Christophe Fergeau
On Tue, Jan 25, 2011 at 02:33:34PM -0500, Marc-André Lureau wrote:
 Hi
 
   +static inline unsigned int ring_get_length(Ring *ring)
  
  This won't compile if no one uses it - so you probably want to make
  it non static (or do a hack by doing (void)ring_get_length somewhere).
 
 Correct, if you intend to do (gdb) call ring_get_length(ring). But I was 
 using it in some temporary SPICE_DEBUG code.

Do you mean it should be #ifdef'ed? or that it's better to add the
equivalent of G_GNUC_UNUSED to the function definition to avoid the compiler
warning?

Thanks,

Christophe


pgpbIFhTXKrAd.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 7/9] common: add ring_get_length() for debugging purposes

2011-04-27 Thread Marc-André Lureau


- Original Message -
 On Tue, Jan 25, 2011 at 02:33:34PM -0500, Marc-André Lureau wrote:
  Hi
 
+static inline unsigned int ring_get_length(Ring *ring)
  
   This won't compile if no one uses it - so you probably want to
   make
   it non static (or do a hack by doing (void)ring_get_length
   somewhere).
 
  Correct, if you intend to do (gdb) call ring_get_length(ring). But I
  was using it in some temporary SPICE_DEBUG code.
 
 Do you mean it should be #ifdef'ed? or that it's better to add the
 equivalent of G_GNUC_UNUSED to the function definition to avoid the
 compiler
 warning?

Is there such warning? I was expecting unused inline functions not to produce 
warning.
The ifdef shouldn't be necessary. It's just one more functions, similar to the 
other provided in ring.h

regards 

-- 
Marc-André Lureau
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 0/8] Rework autotools build system

2011-04-27 Thread Marc-André Lureau
Hi

On Thu, Apr 21, 2011 at 2:00 PM, Christophe Fergeau cferg...@redhat.com wrote:
 Hi,

 The autotools build system looked a bit convoluted when I looked at it,
 and after toying a bit with it when preparing the earlier patchset, it
 seemed more fragile than autotools build systems generally are. This
 patchseries rework the Makefile.am to get something more standard.

 make distcheck still passes, but I couldn't test what happens on windows,
 let me know if you can test it and want help fixing it ;)

 This patch series applies on top of the cleanup series I just sent.

I am all for the autotools refactoring, which looks great.

ACK'ing the series, even if the canvas define mess isn't sadly as
pretty. It would be nice to find a simpler way, something left for the
long TODO list.

It would be great to get an ACK first from someone building with
Windows before merging.

regards

-- 
Marc-André Lureau
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 7/9] common: add ring_get_length() for debugging purposes

2011-04-27 Thread Christophe Fergeau
On Wed, Apr 27, 2011 at 10:24:01AM -0400, Marc-André Lureau wrote:
  Do you mean it should be #ifdef'ed? or that it's better to add the
  equivalent of G_GNUC_UNUSED to the function definition to avoid the
  compiler
  warning?
 
 Is there such warning? I was expecting unused inline functions not to produce 
 warning.
 The ifdef shouldn't be necessary. It's just one more functions, similar to 
 the other provided in ring.h

Not sure we get such a warning with the default spice cflags, but it's easy
to get gcc to warn about such dead code (unused static functions)

Christophe


pgpB63nNGCcxi.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 01/33] qxl.h: double include protection

2011-04-27 Thread Alon Levy
---
 src/qxl.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/qxl.h b/src/qxl.h
index 60a1046..9451d05 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -20,6 +20,9 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#ifndef QXL_H
+#define QXL_H
+
 #include config.h
 
 #include stdint.h
@@ -331,3 +334,5 @@ void  qxl_mem_free_all (struct qxl_mem  
   *mem);
 void *qxl_allocnf  (qxl_screen_t   *qxl,
unsigned long   size);
 int   qxl_garbage_collect (qxl_screen_t *qxl);
+
+#endif // QXL_H
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 02/33] qxl_mem.c: fix pointer arithmatic warning (-Wpointer-arith)

2011-04-27 Thread Alon Levy
---
 src/qxl_mem.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/qxl_mem.c b/src/qxl_mem.c
index bce80ad..705eb83 100644
--- a/src/qxl_mem.c
+++ b/src/qxl_mem.c
@@ -18,7 +18,7 @@ qxl_mem_create   (void   *base,
 if (!mem)
goto out;
 
-ErrorF (memory space from %p to %p\n, base, base + n_bytes);
+ErrorF (memory space from %p to %p\n, base, (char *)base + n_bytes);
 
 mem-space = create_mspace_with_base (base, n_bytes, 0, NULL);
 
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 05/33] qxl_ring: keep qxl pointer

2011-04-27 Thread Alon Levy
Add a qxl_screen_t* member to qxl_ring to make generelizing outb to
ioport_write easier in the next patch. This means we do an extra deref
and addition for every outb, but it means the code becomes simpler for
doing outb in qxl_drv.so and a function call for spiceqxl_drv.so
---
 src/qxl.h|3 ++-
 src/qxl_driver.c |6 +++---
 src/qxl_ring.c   |   12 +++-
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/qxl.h b/src/qxl.h
index d086ac7..99dfecf 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -207,7 +207,8 @@ void  qxl_cursor_init(ScreenPtr 
  pScreen);
 struct qxl_ring * qxl_ring_create  (struct qxl_ring_header *header,
int element_size,
int n_elements,
-   int prod_notify);
+   int prod_notify,
+   qxl_screen_t*qxl);
 void  qxl_ring_push(struct qxl_ring*ring,
const void *element);
 Bool  qxl_ring_pop (struct qxl_ring*ring,
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index b8f2812..a712ca0 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -908,13 +908,13 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int 
argc, char **argv)
 
 qxl-command_ring = qxl_ring_create ((ram_header-cmd_ring),
 sizeof (struct QXLCommand),
-32, qxl-io_base + QXL_IO_NOTIFY_CMD);
+32, QXL_IO_NOTIFY_CMD, qxl);
 qxl-cursor_ring = qxl_ring_create ((ram_header-cursor_ring),
sizeof (struct QXLCommand),
-   32, qxl-io_base + 
QXL_IO_NOTIFY_CURSOR);
+   32, QXL_IO_NOTIFY_CURSOR, qxl);
 qxl-release_ring = qxl_ring_create ((ram_header-release_ring),
 sizeof (uint64_t),
-8, 0);
+8, 0, qxl);
 
 qxl-surface_cache = qxl_surface_cache_create (qxl);
 
diff --git a/src/qxl_ring.c b/src/qxl_ring.c
index b9a82e6..22d98ea 100644
--- a/src/qxl_ring.c
+++ b/src/qxl_ring.c
@@ -39,14 +39,16 @@ struct qxl_ring
 volatile struct ring *ring;
 intelement_size;
 intn_elements;
-intprod_notify;
+intio_port_prod_notify;
+qxl_screen_t*qxl;
 };
 
 struct qxl_ring *
 qxl_ring_create (struct qxl_ring_header *header,
 int element_size,
 int n_elements,
-int prod_notify)
+int io_port_prod_notify,
+qxl_screen_t   *qxl)
 {
 struct qxl_ring *ring;
 
@@ -57,8 +59,8 @@ qxl_ring_create (struct qxl_ring_header *header,
 ring-ring = (volatile struct ring *)header;
 ring-element_size = element_size;
 ring-n_elements = n_elements;
-ring-prod_notify = prod_notify;
-
+ring-io_port_prod_notify = io_port_prod_notify;
+ring-qxl = qxl;
 return ring;
 }
 
@@ -87,7 +89,7 @@ qxl_ring_push (struct qxl_ring *ring,
 mem_barrier();
 
 if (header-prod == header-notify_on_prod)
-   outb (ring-prod_notify, 0);
+   outb (ring-qxl-io_base + ring-io_port_prod_notify, 0);
 }
 
 Bool
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 06/33] partially replace outb with ioport_write

2011-04-27 Thread Alon Levy
replace everywhere it is needed for xspice - places left out are ifdefed
out later based on the same define mentioned in qxl.h, XSPICE.

note: leave spaces between function name and open paren?

note2: ioport_write is added at the end of the file because the xspice 
implementation
will need access to the qxl_screen_t typedef, defined earlier in qxl.h .
---
 src/qxl.h |4 
 src/qxl_driver.c  |   10 +-
 src/qxl_ring.c|5 +++--
 src/qxl_surface.c |4 ++--
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/qxl.h b/src/qxl.h
index 99dfecf..9683966 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -335,4 +335,8 @@ void *qxl_allocnf  (qxl_screen_t
   *qxl,
unsigned long   size);
 int   qxl_garbage_collect (qxl_screen_t *qxl);
 
+#ifndef XSPICE
+#define ioport_write(qxl, port, val) outb(qxl-io_base + port, val)
+#endif
+
 #endif // QXL_H
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index a712ca0..a0aea25 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -130,7 +130,7 @@ qxl_usleep (int useconds)
 int
 qxl_handle_oom (qxl_screen_t *qxl)
 {
-outb (qxl-io_base + QXL_IO_NOTIFY_OOM, 0);
+ioport_write(qxl, QXL_IO_NOTIFY_OOM, 0);
 
 #if 0
 ErrorF (.);
@@ -168,7 +168,7 @@ qxl_allocnf (qxl_screen_t *qxl, unsigned long size)
ram_header-update_area.right = qxl-virtual_x;
ram_header-update_surface = 0; /* Only primary for now */

-   outb (qxl-io_base + QXL_IO_UPDATE_AREA, 0);
+   ioport_write(qxl, QXL_IO_UPDATE_AREA, 0);

 #if 0
ErrorF (eliminated memory (%d)\n, nth_oom++);
@@ -342,7 +342,7 @@ qxl_reset (qxl_screen_t *qxl)
 uint64_t high_bits;
 struct QXLRam *ram_header;
 
-outb(qxl-io_base + QXL_IO_RESET, 0);
+ioport_write(qxl, QXL_IO_RESET, 0);
 
 ram_header = (void *)((unsigned long)qxl-ram + (unsigned 
long)qxl-rom-ram_header_offset);
 
@@ -370,7 +370,7 @@ qxl_reset (qxl_screen_t *qxl)
 ram_header-mem_slot.mem_start = slot-start_phys_addr;
 ram_header-mem_slot.mem_end = slot-end_phys_addr;
 
-outb (qxl-io_base + QXL_IO_MEMSLOT_ADD, qxl-main_mem_slot);
+ioport_write(qxl, QXL_IO_MEMSLOT_ADD, qxl-main_mem_slot);
 
 slot-generation = qxl-rom-slot_generation;
 
@@ -390,7 +390,7 @@ qxl_reset (qxl_screen_t *qxl)
 ram_header-mem_slot.mem_start = slot-start_phys_addr;
 ram_header-mem_slot.mem_end = slot-end_phys_addr;
 
-outb (qxl-io_base + QXL_IO_MEMSLOT_ADD, qxl-vram_mem_slot);
+ioport_write(qxl, QXL_IO_MEMSLOT_ADD, qxl-vram_mem_slot);
 
 slot-generation = qxl-rom-slot_generation;
 
diff --git a/src/qxl_ring.c b/src/qxl_ring.c
index 22d98ea..0870ef1 100644
--- a/src/qxl_ring.c
+++ b/src/qxl_ring.c
@@ -88,8 +88,9 @@ qxl_ring_push (struct qxl_ring *ring,
 
 mem_barrier();
 
-if (header-prod == header-notify_on_prod)
-   outb (ring-qxl-io_base + ring-io_port_prod_notify, 0);
+if (header-prod == header-notify_on_prod) {
+ioport_write (ring-qxl, ring-io_port_prod_notify, 0);
+}
 }
 
 Bool
diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index bf91483..6056555 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -378,7 +378,7 @@ qxl_surface_cache_create_primary (surface_cache_t   *cache,
 create-type = QXL_SURF_TYPE_PRIMARY;
 create-mem = physical_address (cache-qxl, cache-qxl-ram, 
cache-qxl-main_mem_slot);
 
-outb (qxl-io_base + QXL_IO_CREATE_PRIMARY, 0);
+ioport_write(qxl, QXL_IO_CREATE_PRIMARY, 0);
 
 dev_addr = (uint8_t *)qxl-ram + mode-stride * (mode-y_res - 1);
 
@@ -920,7 +920,7 @@ download_box (qxl_surface_t *surface, int x1, int y1, int 
x2, int y2)
 ErrorF (Issuing update command for %d\n, surface-id);
 #endif
 
-outb (surface-cache-qxl-io_base + QXL_IO_UPDATE_AREA, 0);
+ioport_write(surface-cache-qxl, QXL_IO_UPDATE_AREA, 0);
 
 pixman_image_composite (PIXMAN_OP_SRC,
surface-dev_image,
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 07/33] use spice-protocol defines for ring sizes

2011-04-27 Thread Alon Levy
---
 src/qxl_driver.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index a0aea25..ee6b892 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -908,13 +908,13 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int 
argc, char **argv)
 
 qxl-command_ring = qxl_ring_create ((ram_header-cmd_ring),
 sizeof (struct QXLCommand),
-32, QXL_IO_NOTIFY_CMD, qxl);
+QXL_COMMAND_RING_SIZE, 
QXL_IO_NOTIFY_CMD, qxl);
 qxl-cursor_ring = qxl_ring_create ((ram_header-cursor_ring),
sizeof (struct QXLCommand),
-   32, QXL_IO_NOTIFY_CURSOR, qxl);
+   QXL_CURSOR_RING_SIZE, 
QXL_IO_NOTIFY_CURSOR, qxl);
 qxl-release_ring = qxl_ring_create ((ram_header-release_ring),
 sizeof (uint64_t),
-8, 0, qxl);
+QXL_RELEASE_RING_SIZE, 0, qxl);
 
 qxl-surface_cache = qxl_surface_cache_create (qxl);
 
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 08/33] qxl_driver: add setup_slot helper

2011-04-27 Thread Alon Levy
used in qxl_reset. Later ifdefed with XSPICE, which only uses a single
slot covering all memory (really it should just avoid calling the translation
mechanism, but for now this is simple enough).
---
 src/qxl_driver.c |   87 ++
 1 files changed, 42 insertions(+), 45 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index ee6b892..3514360 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -335,17 +335,42 @@ qxl_close_screen(int scrnIndex, ScreenPtr pScreen)
 return result;
 }
 
-static void
-qxl_reset (qxl_screen_t *qxl)
+static uint8_t
+setup_slot(qxl_screen_t *qxl, uint8_t slot_index_offset,
+unsigned long start_phys_addr, unsigned long end_phys_addr,
+uint64_t start_virt_addr, uint64_t end_virt_addr)
 {
-qxl_memslot_t *slot;
 uint64_t high_bits;
+qxl_memslot_t *slot;
+uint8_t slot_index;
 struct QXLRam *ram_header;
+ram_header = (void *)((unsigned long)qxl-ram + (unsigned 
long)qxl-rom-ram_header_offset);
 
-ioport_write(qxl, QXL_IO_RESET, 0);
+slot_index = qxl-rom-slots_start + slot_index_offset;
+slot = qxl-mem_slots[slot_index];
+slot-start_phys_addr = start_phys_addr;
+slot-end_phys_addr = end_phys_addr;
+slot-start_virt_addr = start_virt_addr;
+slot-end_virt_addr = end_virt_addr;
 
-ram_header = (void *)((unsigned long)qxl-ram + (unsigned 
long)qxl-rom-ram_header_offset);
+ram_header-mem_slot.mem_start = slot-start_phys_addr;
+ram_header-mem_slot.mem_end = slot-end_phys_addr;
+
+ioport_write(qxl, QXL_IO_MEMSLOT_ADD, slot_index);
+
+slot-generation = qxl-rom-slot_generation;
 
+high_bits = slot_index  qxl-slot_gen_bits;
+high_bits |= slot-generation;
+high_bits = (64 - (qxl-slot_gen_bits + qxl-slot_id_bits));
+slot-high_bits = high_bits;
+return slot_index;
+}
+
+static void
+qxl_reset (qxl_screen_t *qxl)
+{
+ioport_write(qxl, QXL_IO_RESET, 0);
 /* Mem slots */
 ErrorF (slots start: %d, slots end: %d\n,
qxl-rom-slots_start,
@@ -356,48 +381,20 @@ qxl_reset (qxl_screen_t *qxl)
 qxl-slot_gen_bits = qxl-rom-slot_gen_bits;
 qxl-slot_id_bits = qxl-rom-slot_id_bits;
 qxl-va_slot_mask = (~(uint64_t)0)  (qxl-slot_id_bits + 
qxl-slot_gen_bits);
-
-qxl-mem_slots = xnfalloc (qxl-n_mem_slots * sizeof (qxl_memslot_t));
-
-qxl-main_mem_slot = qxl-rom-slots_start;
-slot = qxl-mem_slots[qxl-main_mem_slot];
-slot-start_phys_addr = (unsigned long)qxl-ram_physical;
-slot-end_phys_addr =
-   (unsigned long)slot-start_phys_addr + (unsigned 
long)qxl-rom-num_pages * getpagesize();
-slot-start_virt_addr = (uint64_t)(uintptr_t)qxl-ram;
-slot-end_virt_addr = slot-start_virt_addr + (unsigned 
long)qxl-rom-num_pages * getpagesize();
-
-ram_header-mem_slot.mem_start = slot-start_phys_addr;
-ram_header-mem_slot.mem_end = slot-end_phys_addr;
-
-ioport_write(qxl, QXL_IO_MEMSLOT_ADD, qxl-main_mem_slot);
-
-slot-generation = qxl-rom-slot_generation;
-
-high_bits = qxl-main_mem_slot  qxl-slot_gen_bits;
-high_bits |= slot-generation;
-high_bits = (64 - (qxl-slot_gen_bits + qxl-slot_id_bits));
-slot-high_bits = high_bits;
-
-/* Vram slot */
-qxl-vram_mem_slot = qxl-rom-slots_start + 1;
-slot = qxl-mem_slots[qxl-vram_mem_slot];
-slot-start_phys_addr = (unsigned long)qxl-vram_physical;
-slot-end_phys_addr = (unsigned long)qxl-vram_physical + (unsigned 
long)qxl-vram_size;
-slot-start_virt_addr = (uint64_t)(uintptr_t)qxl-vram;
-slot-end_virt_addr = (uint64_t)(uintptr_t)qxl-vram + 
(uint64_t)qxl-vram_size;
-
-ram_header-mem_slot.mem_start = slot-start_phys_addr;
-ram_header-mem_slot.mem_end = slot-end_phys_addr;
 
-ioport_write(qxl, QXL_IO_MEMSLOT_ADD, qxl-vram_mem_slot);
+qxl-mem_slots = xnfalloc (qxl-n_mem_slots * sizeof (qxl_memslot_t));
 
-slot-generation = qxl-rom-slot_generation;
-
-high_bits = qxl-vram_mem_slot  qxl-slot_gen_bits;
-high_bits |= slot-generation;
-high_bits = (64 - (qxl-slot_gen_bits + qxl-slot_id_bits));
-slot-high_bits = high_bits;
+qxl-main_mem_slot = setup_slot(qxl, 0,
+(unsigned long)qxl-ram_physical,
+(unsigned long)qxl-ram_physical + (unsigned long)qxl-rom-num_pages 
* getpagesize(),
+(uint64_t)(uintptr_t)qxl-ram,
+(uint64_t)(uintptr_t)qxl-ram + (unsigned long)qxl-rom-num_pages * 
getpagesize()
+);
+qxl-vram_mem_slot = setup_slot(qxl, 1,
+(unsigned long)qxl-vram_physical,
+(unsigned long)qxl-vram_physical + (unsigned long)qxl-vram_size,
+(uint64_t)(uintptr_t)qxl-vram,
+(uint64_t)(uintptr_t)qxl-vram + (uint64_t)qxl-vram_size);
 }
 
 static void
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 09/33] qxl_driver: fix initialization from wrong pointer warning

2011-04-27 Thread Alon Levy
---
 src/qxl_driver.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 3514360..dced9fb 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -60,7 +60,7 @@ qxl_garbage_collect (qxl_screen_t *qxl)

union QXLReleaseInfo *info = u64_to_pointer (id  ~POINTER_MASK);
struct QXLCursorCmd *cmd = (struct QXLCursorCmd *)info;
-   struct QXLDrawable *drawable = (struct qxl_drawable *)info;
+   struct QXLDrawable *drawable = (struct QXLDrawable *)info;
struct QXLSurfaceCmd *surface_cmd = (struct QXLSurfaceCmd *)info;
int is_cursor = FALSE;
int is_surface = FALSE;
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 10/33] add config options (empty for now)

2011-04-27 Thread Alon Levy
---
 src/qxl.h|   10 ++
 src/qxl_driver.c |6 ++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/qxl.h b/src/qxl.h
index 9683966..7c889d3 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -82,6 +82,14 @@ typedef struct
 
 typedef struct qxl_surface_t qxl_surface_t;
 
+/*
+ * Config Options
+ */
+
+enum {
+OPTION_COUNT,
+};
+
 struct _qxl_screen_t
 {
 /* These are the names QXL uses */
@@ -158,6 +166,8 @@ struct _qxl_screen_t
 
 /* Evacuated surfaces are stored here during VT switches */
 void * vt_surfaces;
+
+OptionInfoRec  options[OPTION_COUNT + 1];
 };
 
 static inline uint64_t
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index dced9fb..ff6fe97 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -42,6 +42,10 @@
 #endif
 #define CHECK_POINT()
 
+const OptionInfoRec DefaultOptions[] = {
+{ -1, NULL,   OPTV_NONE,{0},FALSE }
+};
+
 int
 qxl_garbage_collect (qxl_screen_t *qxl)
 {
@@ -1212,6 +1216,8 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
 
 /* option parsing and card differentiation */
 xf86CollectOptions(pScrn, NULL);
+memcpy(qxl-options, DefaultOptions, sizeof(DefaultOptions));
+xf86ProcessOptions(scrnIndex, pScrn-options, qxl-options);
 
 if (!qxl_map_memory(qxl, scrnIndex))
goto out;
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 12/33] qxl_driver: introduce helpers for memory map and unmap

2011-04-27 Thread Alon Levy
qxl_map_memory_helper and qxl_unmap_memory_helper introduced, here as
a simple split, later different implementation if XSPICE defined will
be added. Nicer then putting an ifdef inside the map/unmap functions.
---
 src/qxl_driver.c |   52 
 1 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 18050fb..ac377ea 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -205,7 +205,7 @@ qxl_blank_screen(ScreenPtr pScreen, int mode)
 }
 
 static void
-qxl_unmap_memory(qxl_screen_t *qxl, int scrnIndex)
+unmap_memory_helper(qxl_screen_t *qxl, int scrnIndex)
 {
 #ifdef XSERVER_LIBPCIACCESS
 if (qxl-ram)
@@ -222,59 +222,71 @@ qxl_unmap_memory(qxl_screen_t *qxl, int scrnIndex)
 if (qxl-rom)
xf86UnMapVidMem(scrnIndex, qxl-rom, (1  qxl-pci-size[2]));
 #endif
-
-qxl-ram = qxl-ram_physical = qxl-vram = qxl-rom = NULL;
-
-qxl-num_modes = 0;
-qxl-modes = NULL;
 }
 
-static Bool
-qxl_map_memory(qxl_screen_t *qxl, int scrnIndex)
+static void
+map_memory_helper(qxl_screen_t *qxl, int scrnIndex)
 {
 #ifdef XSERVER_LIBPCIACCESS
-pci_device_map_range(qxl-pci, qxl-pci-regions[0].base_addr, 
+pci_device_map_range(qxl-pci, qxl-pci-regions[0].base_addr,
 qxl-pci-regions[0].size,
 PCI_DEV_MAP_FLAG_WRITABLE | 
PCI_DEV_MAP_FLAG_WRITE_COMBINE,
 qxl-ram);
 qxl-ram_physical = u64_to_pointer (qxl-pci-regions[0].base_addr);
-
-pci_device_map_range(qxl-pci, qxl-pci-regions[1].base_addr, 
+
+pci_device_map_range(qxl-pci, qxl-pci-regions[1].base_addr,
 qxl-pci-regions[1].size,
 PCI_DEV_MAP_FLAG_WRITABLE,
 qxl-vram);
 qxl-vram_physical = u64_to_pointer (qxl-pci-regions[1].base_addr);
 qxl-vram_size = qxl-pci-regions[1].size;
-
-pci_device_map_range(qxl-pci, qxl-pci-regions[2].base_addr, 
+
+pci_device_map_range(qxl-pci, qxl-pci-regions[2].base_addr,
 qxl-pci-regions[2].size, 0,
 (void **)qxl-rom);
-
+
 qxl-io_base = qxl-pci-regions[3].base_addr;
 #else
 qxl-ram = xf86MapPciMem(scrnIndex, VIDMEM_FRAMEBUFFER,
 qxl-pci_tag, qxl-pci-memBase[0],
 (1  qxl-pci-size[0]));
 qxl-ram_physical = (void *)qxl-pci-memBase[0];
-
+
 qxl-vram = xf86MapPciMem(scrnIndex, VIDMEM_MMIO | VIDMEM_MMIO_32BIT,
  qxl-pci_tag, qxl-pci-memBase[1],
  (1  qxl-pci-size[1]));
 qxl-vram_physical = (void *)qxl-pci-memBase[1];
 qxl-vram_size = (1  qxl-pci-size[1]);
-
+
 qxl-rom = xf86MapPciMem(scrnIndex, VIDMEM_MMIO | VIDMEM_MMIO_32BIT,
 qxl-pci_tag, qxl-pci-memBase[2],
 (1  qxl-pci-size[2]));
-
+
 qxl-io_base = qxl-pci-ioBase[3];
 #endif
+}
+
+static void
+qxl_unmap_memory(qxl_screen_t *qxl, int scrnIndex)
+{
+unmap_memory_helper(qxl, scrnIndex);
+qxl-ram = qxl-ram_physical = qxl-vram = qxl-rom = NULL;
+
+qxl-num_modes = 0;
+qxl-modes = NULL;
+}
+
+static Bool
+qxl_map_memory(qxl_screen_t *qxl, int scrnIndex)
+{
+map_memory_helper(qxl, scrnIndex);
+
 if (!qxl-ram || !qxl-vram || !qxl-rom)
return FALSE;
-
+
 xf86DrvMsg(scrnIndex, X_INFO, framebuffer at %p (%d KB)\n,
   qxl-ram, qxl-rom-surface0_area_size / 1024);
-
+
 xf86DrvMsg(scrnIndex, X_INFO, command ram at %p (%d KB)\n,
   (void *)((unsigned long)qxl-ram + qxl-rom-surface0_area_size),
   (qxl-rom-num_pages * getpagesize() - 
qxl-rom-surface0_area_size)/1024);
@@ -283,7 +295,7 @@ qxl_map_memory(qxl_screen_t *qxl, int scrnIndex)
   qxl-vram, qxl-vram_size / 1024);
 
 xf86DrvMsg(scrnIndex, X_INFO, rom at %p\n, qxl-rom);
-
+
 qxl-num_modes = *(uint32_t *)((uint8_t *)qxl-rom + 
qxl-rom-modes_offset);
 qxl-modes = (struct QXLMode *)(((uint8_t *)qxl-rom) + 
qxl-rom-modes_offset + 4);
 qxl-surface0_area = qxl-ram;
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 13/33] qxl_driver: whitespace fixes

2011-04-27 Thread Alon Levy
removing whitespace in lines consisting only of it.
most of those areas are touched later, but not all.
---
 src/qxl_driver.c |   50 +-
 1 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index ac377ea..bab7eba 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -844,14 +844,14 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int 
argc, char **argv)
 qxl_screen_t *qxl = pScrn-driverPrivate;
 struct QXLRam *ram_header;
 VisualPtr visual;
-
+
 CHECK_POINT();
-
+
 qxl-pScrn = pScrn;
-
+
 if (!qxl_map_memory(qxl, scrnIndex))
return FALSE;
-
+
 ram_header = (void *)((unsigned long)qxl-ram + (unsigned 
long)qxl-rom-ram_header_offset);
 
 printf (ram_header at %d\n, qxl-rom-ram_header_offset);
@@ -915,7 +915,7 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, 
char **argv)
 /* Set up resources */
 qxl_reset (qxl);
 ErrorF (done reset\n);
-
+
 qxl-io_pages = (void *)((unsigned long)qxl-ram);
 qxl-io_pages_physical = (void *)((unsigned long)qxl-ram_physical);
 
@@ -957,7 +957,7 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, 
char **argv)
 pScreen-CloseScreen = qxl_close_screen;
 
 qxl_cursor_init (pScreen);
-
+
 CHECK_POINT();
 
 pScreen-width = pScrn-currentMode-HDisplay;
@@ -966,7 +966,7 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, 
char **argv)
 qxl_switch_mode(scrnIndex, pScrn-currentMode, 0);
 
 CHECK_POINT();
-
+
 return TRUE;
 
 out:
@@ -1080,14 +1080,14 @@ qxl_check_device(ScrnInfoPtr pScrn, qxl_screen_t *qxl)
   rom-num_pages, (unsigned long)qxl-ram);
 
 xf86DrvMsg(scrnIndex, X_INFO, RAM header offset: 0x%x\n, 
rom-ram_header_offset);
-
+
 if (ram_header-magic != 0x41525851) { /* QXRA little-endian */
xf86DrvMsg(scrnIndex, X_ERROR, Bad RAM signature %x at %p\n,
   ram_header-magic,
   ram_header-magic);
return FALSE;
 }
-
+
 xf86DrvMsg(scrnIndex, X_INFO, Correct RAM signature %x\n, 
   ram_header-magic);
 
@@ -1214,7 +1214,7 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
 if (!pScrn-driverPrivate)
pScrn-driverPrivate = xnfcalloc(sizeof(qxl_screen_t), 1);
 qxl = pScrn-driverPrivate;
-
+
 qxl-entity = xf86GetEntityInfo(pScrn-entityList[0]);
 qxl-pci = xf86GetPciInfoForEntity(qxl-entity-index);
 #ifndef XSERVER_LIBPCIACCESS
@@ -1236,7 +1236,7 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
 
 if (!qxl_check_device(pScrn, qxl))
goto out;
-
+
 /* ddc stuff here */
 
 clockRanges = xnfcalloc(sizeof(ClockRange), 1);
@@ -1316,7 +1316,7 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
 }
 
 print_modes (qxl, scrnIndex);
-
+
 /* VGA hardware initialisation */
 if (!vgaHWGetHWRec(pScrn))
 return FALSE;
@@ -1353,7 +1353,7 @@ static const struct pci_id_match qxl_device_match[] = {
PCI_VENDOR_RED_HAT, PCI_CHIP_QXL_01FF, PCI_MATCH_ANY, PCI_MATCH_ANY,
0x0003, 0x00ff, CHIP_QXL_1
 },
-
+
 { 0 },
 };
 #endif
@@ -1399,37 +1399,37 @@ qxl_probe(DriverPtr drv, int flags)
 int numDevSections;
 int *usedChips;
 GDevPtr *devSections;
-
+
 if ((numDevSections = xf86MatchDevice(QXL_NAME, devSections)) = 0)
return FALSE;
-
+
 if (!xf86GetPciVideoInfo())
return FALSE;
-
+
 numUsed = xf86MatchPciInstances(QXL_NAME, PCI_VENDOR_RED_HAT,
qxlChips, qxlPciChips,
devSections, numDevSections,
drv, usedChips);
-
+
 xfree(devSections);
-
+
 if (numUsed  0) {
xfree(usedChips);
return FALSE;
 }
-
+
 if (flags  PROBE_DETECT) {
xfree(usedChips);
return TRUE;
 }
-
+
 for (i = 0; i  numUsed; i++) {
ScrnInfoPtr pScrn = NULL;
if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], qxlPciChips,
 0, 0, 0, 0, 0)))
qxl_init_scrn(pScrn);
 }
-
+
 xfree(usedChips);
 return TRUE;
 }
@@ -1442,17 +1442,17 @@ qxl_pci_probe(DriverPtr drv, int entity, struct 
pci_device *dev, intptr_t match)
 qxl_screen_t *qxl;
 ScrnInfoPtr pScrn = xf86ConfigPciEntity(NULL, 0, entity, NULL, NULL,
NULL, NULL, NULL, NULL);
-
+
 if (!pScrn)
return FALSE;
-
+
 if (!pScrn-driverPrivate)
pScrn-driverPrivate = xnfcalloc(sizeof(qxl_screen_t), 1);
 qxl = pScrn-driverPrivate;
 qxl-pci = dev;
-
+
 qxl_init_scrn(pScrn);
-
+
 return TRUE;
 }
 
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org

[Spice-devel] [RFC 15/33] configure.ac/Makefile.am: add SUPPORT_XSPICE

2011-04-27 Thread Alon Levy
---
 configure.ac|2 ++
 src/Makefile.am |   23 +++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 99bc517..6a183df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,6 +86,8 @@ PKG_CHECK_MODULES([SPICE], [spice-server = 0.6.3],
 )
 PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol = 0.7.0])
 
+AM_CONDITIONAL(SUPPORT_XSPICE, test x$SPICE_LIBS != x)
+
 DRIVER_NAME=qxl
 AC_SUBST([DRIVER_NAME])
 
diff --git a/src/Makefile.am b/src/Makefile.am
index ff4fa14..2624039 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,3 +47,26 @@ qxl_drv_la_SOURCES = \
lookup3.c   \
lookup3.h   \
qxl_cursor.c
+
+if SUPPORT_XSPICE
+spiceqxl_drv_la_LTLIBRARIES = spiceqxl_drv.la
+spiceqxl_drv_la_LDFLAGS = -module -avoid-version $(SPICE_LIBS)
+spiceqxl_drv_ladir = @moduledir@/drivers
+
+spiceqxl_drv_la_CFLAGS = -DXSPICE $(AM_CFLAGS)
+
+spiceqxl_drv_la_LIBADD = uxa/libuxa.la
+
+spiceqxl_drv_la_SOURCES =  \
+   qxl.h   \
+   qxl_driver.c\
+   qxl_image.c \
+   qxl_surface.c   \
+   qxl_ring.c  \
+   qxl_mem.c   \
+   mspace.c\
+   mspace.h\
+   lookup3.c   \
+   lookup3.h   \
+   qxl_cursor.c
+endif
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 16/33] xspice: use spiceqxl as name of xspice driver

2011-04-27 Thread Alon Levy
Fixes a few places that have hardcoded qxl to use the already defined
QXL_DRIVER_NAME.
---
 src/qxl.h|5 +
 src/qxl_driver.c |6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/qxl.h b/src/qxl.h
index 7c889d3..ba2b0eb 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -48,8 +48,13 @@
 
 #define hidden _X_HIDDEN
 
+#ifdef XSPICE
+#define QXL_NAME   spiceqxl
+#define QXL_DRIVER_NAMEspiceqxl
+#else
 #define QXL_NAME   qxl
 #define QXL_DRIVER_NAMEqxl
+#endif
 #define PCI_VENDOR_RED_HAT 0x1b36
 
 #define PCI_CHIP_QXL_0100  0x0100
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index bab7eba..61556dc 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1382,7 +1382,7 @@ static void
 qxl_init_scrn(ScrnInfoPtr pScrn)
 {
 pScrn-driverVersion= 0;
-pScrn-driverName  = pScrn-name = qxl;
+pScrn-driverName  = pScrn-name = QXL_DRIVER_NAME;
 pScrn-PreInit = qxl_pre_init;
 pScrn-ScreenInit  = qxl_screen_init;
 pScrn-SwitchMode  = qxl_switch_mode;
@@ -1462,7 +1462,7 @@ qxl_pci_probe(DriverPtr drv, int entity, struct 
pci_device *dev, intptr_t match)
 
 static DriverRec qxl_driver = {
 0,
-qxl,
+QXL_DRIVER_NAME,
 qxl_identify,
 qxl_probe,
 NULL,
@@ -1492,7 +1492,7 @@ qxl_setup(pointer module, pointer opts, int *errmaj, int 
*errmin)
 }
 
 static XF86ModuleVersionInfo qxl_module_info = {
-qxl,
+QXL_DRIVER_NAME,
 MODULEVENDORSTRING,
 MODINFOSTRING1,
 MODINFOSTRING2,
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 18/33] xspice: use SPICE_CFLAGS

2011-04-27 Thread Alon Levy
---
 src/Makefile.am |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 8f048c8..6f2cb56 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -53,7 +53,7 @@ spiceqxl_drv_la_LTLIBRARIES = spiceqxl_drv.la
 spiceqxl_drv_la_LDFLAGS = -module -avoid-version $(SPICE_LIBS)
 spiceqxl_drv_ladir = @moduledir@/drivers
 
-spiceqxl_drv_la_CFLAGS = -DXSPICE $(AM_CFLAGS)
+spiceqxl_drv_la_CFLAGS = -DXSPICE $(AM_CFLAGS) $(SPICE_CFLAGS)
 
 spiceqxl_drv_la_LIBADD = uxa/libuxa.la
 
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 19/33] cleanup (add eol between system and non system includes)

2011-04-27 Thread Alon Levy
---
 src/qxl.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/qxl.h b/src/qxl.h
index e45066c..3fddef3 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -28,6 +28,7 @@
 #include stdint.h
 
 #include spice/qxl_dev.h
+
 #include compiler.h
 #include xf86.h
 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION)  6
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 21/33] qxl_driver.c: whitespace fix

2011-04-27 Thread Alon Levy
---
 src/qxl_driver.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index ba3170e..198af00 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1115,7 +1115,7 @@ qxl_check_device(ScrnInfoPtr pScrn, qxl_screen_t *qxl)
return FALSE;
 }
 
-xf86DrvMsg(scrnIndex, X_INFO, Correct RAM signature %x\n, 
+xf86DrvMsg(scrnIndex, X_INFO, Correct RAM signature %x\n,
   ram_header-magic);
 return TRUE;
 }
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 22/33] xspice: allocate a single slot

2011-04-27 Thread Alon Levy
---
 src/qxl_driver.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 198af00..548bc15 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -424,6 +424,9 @@ qxl_reset (qxl_screen_t *qxl)
 
 qxl-mem_slots = xnfalloc (qxl-n_mem_slots * sizeof (qxl_memslot_t));
 
+#ifdef XSPICE
+qxl-main_mem_slot = qxl-vram_mem_slot = setup_slot(qxl, 0, 0, ~0, 0, ~0);
+#else /* QXL */
 qxl-main_mem_slot = setup_slot(qxl, 0,
 (unsigned long)qxl-ram_physical,
 (unsigned long)qxl-ram_physical + (unsigned long)qxl-rom-num_pages 
* getpagesize(),
@@ -435,6 +438,7 @@ qxl_reset (qxl_screen_t *qxl)
 (unsigned long)qxl-vram_physical + (unsigned long)qxl-vram_size,
 (uint64_t)(uintptr_t)qxl-vram,
 (uint64_t)(uintptr_t)qxl-vram + (uint64_t)qxl-vram_size);
+#endif
 }
 
 static void
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 23/33] xspice: don't load ramdac and vgahw sub modules

2011-04-27 Thread Alon Levy
---
 src/qxl_driver.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 548bc15..3834d3a 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1341,9 +1341,12 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
 xf86PrintModes(pScrn);
 xf86SetDpi(pScrn, 0, 0);
 
-if (!xf86LoadSubModule(pScrn, fb) ||
-   !xf86LoadSubModule(pScrn, ramdac) ||
-   !xf86LoadSubModule(pScrn, vgahw))
+if (!xf86LoadSubModule(pScrn, fb)
+#ifndef XSPICE
+   || !xf86LoadSubModule(pScrn, ramdac)
+   || !xf86LoadSubModule(pScrn, vgahw)
+#endif
+)
 {
goto out;
 }
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 25/33] xspice: implement map_helper, unmap_helper, add init_qxl_rom

2011-04-27 Thread Alon Levy
Memory is taken from malloc instead of from the pci bar.

Adds shadow_rom to qxl_screen_t.

Introduces init_qxl_rom, which is directly taken from the qxl device
in qemu. Plenty of TODO's added in this commit about various constants
and about factoring out the code to not do this copy paste from qemu.
---
 src/Makefile.am   |1 +
 src/qxl.h |   22 
 src/qxl_driver.c  |   15 ++
 src/spiceqxl_driver.c |  132 +
 src/spiceqxl_driver.h |   11 
 5 files changed, 181 insertions(+), 0 deletions(-)
 create mode 100644 src/spiceqxl_driver.c
 create mode 100644 src/spiceqxl_driver.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 6f2cb56..6ecb17d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -60,6 +60,7 @@ spiceqxl_drv_la_LIBADD = uxa/libuxa.la
 spiceqxl_drv_la_SOURCES =  \
qxl.h   \
spiceqxl_io_port.c  \
+   spiceqxl_driver.c   \
qxl_driver.c\
qxl_image.c \
qxl_surface.c   \
diff --git a/src/qxl.h b/src/qxl.h
index 1375607..4b78076 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -179,6 +179,11 @@ struct _qxl_screen_t
 void * vt_surfaces;
 
 OptionInfoRec  options[OPTION_COUNT + 1];
+
+#ifdef XSPICE
+/* XSpice specific */
+struct QXLRom  shadow_rom;/* Parameter RAM */
+#endif /* XSPICE */
 };
 
 static inline uint64_t
@@ -362,4 +367,21 @@ int   qxl_garbage_collect (qxl_screen_t 
*qxl);
 #define ioport_write(qxl, port, val) outb(qxl-io_base + port, val)
 #endif
 
+#ifdef XSPICE
+
+// Taken from qemu's qxl.c, not sure the values make sense? we
+// only have a single slot, and it is never changed after being added,
+// so not a problem?
+#define MEMSLOT_GENERATION_BITS 8
+#define MEMSLOT_SLOT_BITS 1
+
+// qemu/cpu-all.h
+#define TARGET_PAGE_SIZE (1  TARGET_PAGE_BITS)
+// qemu/target-i386/cpu.h
+#define TARGET_PAGE_BITS 12
+
+#define NUM_SURFACES 1024
+
+#endif /* XSPICE */
+
 #endif // QXL_H
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index c77a5f1..eeff535 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -37,6 +37,10 @@
 #include qxl.h
 #include assert.h
 
+#ifdef XSPICE
+#include spiceqxl_driver.h
+#endif /* XSPICE */
+
 #if 0
 #define CHECK_POINT() ErrorF (%s: %d  (%s)\n, __FILE__, __LINE__, 
__FUNCTION__);
 #endif
@@ -208,11 +212,22 @@ qxl_blank_screen(ScreenPtr pScreen, int mode)
 static void
 unmap_memory_helper(qxl_screen_t *qxl, int scrnIndex)
 {
+free(qxl-ram);
+free(qxl-vram);
+free(qxl-rom);
 }
 
 static void
 map_memory_helper(qxl_screen_t *qxl, int scrnIndex)
 {
+qxl-ram = malloc(RAM_SIZE);
+qxl-ram_physical = qxl-ram;
+qxl-vram = malloc(VRAM_SIZE);
+qxl-vram_size = VRAM_SIZE;
+qxl-vram_physical = qxl-vram;
+qxl-rom = malloc(ROM_SIZE);
+
+init_qxl_rom(qxl, ROM_SIZE);
 }
 #else /* Default */
 static void
diff --git a/src/spiceqxl_driver.c b/src/spiceqxl_driver.c
new file mode 100644
index 000..07cbeef
--- /dev/null
+++ b/src/spiceqxl_driver.c
@@ -0,0 +1,132 @@
+/* most of the code is still in qxl_driver.c, but for clarity parts are moved
+ * here, and only used / compiled if XSPICE is defined */
+
+#include qxl.h
+#include spiceqxl_driver.h
+
+// From qxl.c, TODO - factor out
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+#define QXL_MODE_EX(x_res, y_res) \
+QXL_MODE_16_32(x_res, y_res, 0),  \
+QXL_MODE_16_32(y_res, x_res, 1),  \
+QXL_MODE_16_32(x_res, y_res, 2),  \
+QXL_MODE_16_32(y_res, x_res, 3)
+
+#define QXL_MODE_16_32(x_res, y_res, orientation) \
+QXL_MODE(x_res, y_res, 16, orientation),  \
+QXL_MODE(x_res, y_res, 32, orientation)
+
+#define QXL_MODE(_x, _y, _b, _o)  \
+{   .x_res = _x,  \
+.y_res = _y,  \
+.bits  = _b,  \
+.stride = (_x) * (_b) / 8,\
+.x_mili = PIXEL_SIZE * (_x),  \
+.y_mili = PIXEL_SIZE * (_y),  \
+.orientation = _o,\
+}
+
+#define PIXEL_SIZE 0.2936875 //1280x1024 is 14.8 x 11.9
+
+#define ALIGN(x, y) (((x)+(y)-1)  ~((y)-1))
+
+static QXLMode qxl_modes[] = {
+QXL_MODE_EX(640, 480),
+QXL_MODE_EX(800, 480),
+QXL_MODE_EX(800, 600),
+QXL_MODE_EX(832, 624),
+QXL_MODE_EX(960, 640),
+QXL_MODE_EX(1024, 600),
+QXL_MODE_EX(1024, 768),
+QXL_MODE_EX(1152, 864),
+QXL_MODE_EX(1152, 870),
+QXL_MODE_EX(1280, 720),
+QXL_MODE_EX(1280, 760),
+QXL_MODE_EX(1280, 768),
+QXL_MODE_EX(1280, 800),
+QXL_MODE_EX(1280, 960),
+QXL_MODE_EX(1280, 1024),
+QXL_MODE_EX(1360, 768),
+QXL_MODE_EX(1366, 768),
+   

[Spice-devel] [RFC 26/33] xspice: add SpicePort config option

2011-04-27 Thread Alon Levy
---
 src/qxl.h|3 +++
 src/qxl_driver.c |3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/qxl.h b/src/qxl.h
index 4b78076..2dc4cf9 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -96,6 +96,9 @@ typedef struct qxl_surface_t qxl_surface_t;
  */
 
 enum {
+#ifdef XSPICE
+OPTION_SPICE_PORT = 0,
+#endif
 OPTION_COUNT,
 };
 
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index eeff535..e6fbb93 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -47,6 +47,9 @@
 #define CHECK_POINT()
 
 const OptionInfoRec DefaultOptions[] = {
+#ifdef XSPICE
+{ OPTION_SPICE_PORT,  SpicePort,OPTV_INTEGER, {5912}, FALSE },
+#endif
 { -1, NULL,   OPTV_NONE,{0},FALSE }
 };
 
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 27/33] xspice: init spice server, add main loop

2011-04-27 Thread Alon Levy
Initialize a SpiceServer instance, and implement SpiceCoreInterface,
that is fd read, write notification and watchs (timers).

The fd implementation is off because Xserver doesn't allow us to be
notified on write unblock, only read. Workaround is to poll.
---
 src/Makefile.am  |1 +
 src/qxl.h|4 +
 src/qxl_driver.c |   26 
 src/spiceqxl_main_loop.c |  317 ++
 src/spiceqxl_main_loop.h |   10 ++
 5 files changed, 358 insertions(+), 0 deletions(-)
 create mode 100644 src/spiceqxl_main_loop.c
 create mode 100644 src/spiceqxl_main_loop.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 6ecb17d..eaa0746 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,6 +61,7 @@ spiceqxl_drv_la_SOURCES = \
qxl.h   \
spiceqxl_io_port.c  \
spiceqxl_driver.c   \
+   spiceqxl_main_loop.c\
qxl_driver.c\
qxl_image.c \
qxl_surface.c   \
diff --git a/src/qxl.h b/src/qxl.h
index 2dc4cf9..0b291c9 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -28,6 +28,9 @@
 #include stdint.h
 
 #include spice/qxl_dev.h
+#ifdef XSPICE
+#include spice.h
+#endif
 
 #include compiler.h
 #include xf86.h
@@ -186,6 +189,7 @@ struct _qxl_screen_t
 #ifdef XSPICE
 /* XSpice specific */
 struct QXLRom  shadow_rom;/* Parameter RAM */
+SpiceServer *   spice_server;
 #endif /* XSPICE */
 };
 
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index e6fbb93..938727e 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -39,6 +39,7 @@
 
 #ifdef XSPICE
 #include spiceqxl_driver.h
+#include spiceqxl_main_loop.h
 #endif /* XSPICE */
 
 #if 0
@@ -883,6 +884,28 @@ setup_uxa (qxl_screen_t *qxl, ScreenPtr screen)
 return TRUE;
 }
 
+#ifdef XSPICE
+
+static void
+spiceqxl_screen_init(int scrnIndex, ScrnInfoPtr pScrn, qxl_screen_t *qxl)
+{
+SpiceCoreInterface *core;
+
+// Init spice
+if (!qxl-spice_server) {
+qxl-spice_server = spice_server_new();
+// some common initialization for all display tests
+spice_server_set_port(qxl-spice_server, 
qxl-options[OPTION_SPICE_PORT].value.num);
+spice_server_set_noauth(qxl-spice_server); // TODO - take this from 
config
+// TODO - parse rest of parameters (streaming, compression, jpeg, 
etc.) from config
+core = basic_event_loop_init();
+spice_server_init(qxl-spice_server, core);
+}
+qxl-spice_server = qxl-spice_server;
+}
+
+#endif
+
 static Bool
 qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 {
@@ -898,6 +921,9 @@ qxl_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, 
char **argv)
 if (!qxl_map_memory(qxl, scrnIndex))
return FALSE;
 
+#ifdef XSPICE
+spiceqxl_screen_init(scrnIndex, pScrn, qxl);
+#endif
 ram_header = (void *)((unsigned long)qxl-ram + (unsigned 
long)qxl-rom-ram_header_offset);
 
 printf (ram_header at %d\n, qxl-rom-ram_header_offset);
diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c
new file mode 100644
index 000..7f56622
--- /dev/null
+++ b/src/spiceqxl_main_loop.c
@@ -0,0 +1,317 @@
+#include sys/time.h
+
+#include spice.h
+#include spiceqxl_main_loop.h
+
+static int spiceqxl_main_loop_debug = 0;
+
+#define DPRINTF(x, format, ...) { \
+if (x = spiceqxl_main_loop_debug) { \
+printf(%s:  format \n , __FUNCTION__, ## __VA_ARGS__); \
+} \
+}
+
+/* From ring.h */
+typedef struct Ring RingItem;
+typedef struct Ring {
+RingItem *prev;
+RingItem *next;
+} Ring;
+
+static inline void ring_init(Ring *ring)
+{
+ring-next = ring-prev = ring;
+}
+
+static inline void ring_item_init(RingItem *item)
+{
+item-next = item-prev = NULL;
+}
+
+static inline int ring_item_is_linked(RingItem *item)
+{
+return !!item-next;
+}
+
+static inline int ring_is_empty(Ring *ring)
+{
+assert(ring-next != NULL  ring-prev != NULL);
+return ring == ring-next;
+}
+
+static inline void ring_add(Ring *ring, RingItem *item)
+{
+assert(ring-next != NULL  ring-prev != NULL);
+assert(item-next == NULL  item-prev == NULL);
+
+item-next = ring-next;
+item-prev = ring;
+ring-next = item-next-prev = item;
+}
+
+static inline void __ring_remove(RingItem *item)
+{
+item-next-prev = item-prev;
+item-prev-next = item-next;
+item-prev = item-next = 0;
+}
+
+static inline void ring_remove(RingItem *item)
+{
+assert(item-next != NULL  item-prev != NULL);
+assert(item-next != item);
+
+__ring_remove(item);
+}
+
+static inline RingItem *ring_get_head(Ring *ring)
+{
+RingItem *ret;
+
+assert(ring-next != NULL  ring-prev != NULL);
+
+if (ring_is_empty(ring)) {
+return NULL;
+}
+ret = ring-next;
+return ret;
+}
+
+static inline 

[Spice-devel] [RFC 28/33] xspice: add display interface

2011-04-27 Thread Alon Levy
---
 src/Makefile.am|1 +
 src/qxl.h  |   24 
 src/qxl_driver.c   |3 +
 src/spiceqxl_display.c |  319 
 src/spiceqxl_display.h |   11 ++
 5 files changed, 358 insertions(+), 0 deletions(-)
 create mode 100644 src/spiceqxl_display.c
 create mode 100644 src/spiceqxl_display.h

diff --git a/src/Makefile.am b/src/Makefile.am
index eaa0746..5eedc93 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -62,6 +62,7 @@ spiceqxl_drv_la_SOURCES = \
spiceqxl_io_port.c  \
spiceqxl_driver.c   \
spiceqxl_main_loop.c\
+   spiceqxl_display.c  \
qxl_driver.c\
qxl_image.c \
qxl_surface.c   \
diff --git a/src/qxl.h b/src/qxl.h
index 0b291c9..bb67f9b 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -190,6 +190,26 @@ struct _qxl_screen_t
 /* XSpice specific */
 struct QXLRom  shadow_rom;/* Parameter RAM */
 SpiceServer *   spice_server;
+QXLWorker * worker;
+QXLInstance display_sin;
+/* XSpice specific, dragged from the Device */
+QXLReleaseInfo *last_release;
+
+uint32_t   cmdflags;
+uint32_t   oom_running;
+uint32_t   num_free_res; /* is having a release ring effective
+for Xspice? */
+/* This is only touched from red worker thread - do not access
+ * from Xorg threads. */
+struct guest_primary {
+QXLSurfaceCreate surface;
+uint32_t   commands;
+uint32_t   resized;
+int32_tstride;
+uint32_t   bits_pp;
+uint32_t   bytes_pp;
+uint8_t*data, *flipped;
+} guest_primary;
 #endif /* XSPICE */
 };
 
@@ -376,9 +396,13 @@ int   qxl_garbage_collect (qxl_screen_t 
*qxl);
 
 #ifdef XSPICE
 
+#define MEMSLOT_GROUP 0
+#define NUM_MEMSLOTS_GROUPS 1
+
 // Taken from qemu's qxl.c, not sure the values make sense? we
 // only have a single slot, and it is never changed after being added,
 // so not a problem?
+#define NUM_MEMSLOTS 8
 #define MEMSLOT_GENERATION_BITS 8
 #define MEMSLOT_SLOT_BITS 1
 
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 938727e..fe2f532 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -40,6 +40,7 @@
 #ifdef XSPICE
 #include spiceqxl_driver.h
 #include spiceqxl_main_loop.h
+#include spiceqxl_display.h
 #endif /* XSPICE */
 
 #if 0
@@ -900,6 +901,8 @@ spiceqxl_screen_init(int scrnIndex, ScrnInfoPtr pScrn, 
qxl_screen_t *qxl)
 // TODO - parse rest of parameters (streaming, compression, jpeg, 
etc.) from config
 core = basic_event_loop_init();
 spice_server_init(qxl-spice_server, core);
+qxl_add_spice_display_interface(qxl);
+qxl-worker-start(qxl-worker);
 }
 qxl-spice_server = qxl-spice_server;
 }
diff --git a/src/spiceqxl_display.c b/src/spiceqxl_display.c
new file mode 100644
index 000..b26bbfb
--- /dev/null
+++ b/src/spiceqxl_display.c
@@ -0,0 +1,319 @@
+#include spice.h
+
+#include qxl.h
+#include spiceqxl_display.h
+
+#ifndef container_of
+#define container_of(ptr, type, member) ({  \
+const typeof(((type *) 0)-member) *__mptr = (ptr); \
+(type *) ((char *) __mptr - offsetof(type, member));})
+#endif
+
+/* TODO: these is copied from qemu/hw/qxl.c . It shouldn't be there
+ * either, these ugly undef just remove the definitions from 
spice-protocol/spice/ipc_ring.h
+ * What should happen is using one definition, or a rename, and both in 
spice-protocol (because
+ * all the others are there).
+ * Practically speaking the only difference between the two is extra checking 
in this version,
+ * and usage (this one takes an extra parameter, the previous is meant to be 
used by assignment) */
+#undef SPICE_RING_PROD_ITEM
+#define SPICE_RING_PROD_ITEM(r, ret) {  \
+typeof(r) start = r;\
+typeof(r) end = r + 1;  \
+uint32_t prod = (r)-prod  SPICE_RING_INDEX_MASK(r);   \
+typeof((r)-items[prod]) m_item = (r)-items[prod];   \
+if (!((uint8_t*)m_item = (uint8_t*)(start)  (uint8_t*)(m_item + 1) 
= (uint8_t*)(end))) { \
+abort();\
+}   \
+ret = m_item-el;  \
+}
+
+#undef SPICE_RING_CONS_ITEM
+#define SPICE_RING_CONS_ITEM(r, ret) {  \
+typeof(r) start = r;\
+typeof(r) end = r + 1;  

[Spice-devel] [RFC 29/33] xspice: add init_qxl_ram

2011-04-27 Thread Alon Levy
---
 src/qxl_driver.c   |2 +
 src/spiceqxl_io_port.c |   49 
 src/spiceqxl_io_port.h |4 +++
 3 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index fe2f532..ef3139b 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1312,6 +1312,8 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags)
 #ifndef XSPICE
 if (!qxl_check_device(pScrn, qxl))
goto out;
+#else
+init_qxl_ram(qxl); /* initialize the rings */
 #endif
 pScrn-videoRam = (qxl-rom-num_pages * 4096) / 1024;
 xf86DrvMsg(scrnIndex, X_INFO, %d KB of video RAM\n, pScrn-videoRam);
diff --git a/src/spiceqxl_io_port.c b/src/spiceqxl_io_port.c
index 8a2ea03..ba6ac4a 100644
--- a/src/spiceqxl_io_port.c
+++ b/src/spiceqxl_io_port.c
@@ -5,6 +5,55 @@
 #include qxl.h
 #include spiceqxl_io_port.h
 
+/* TODO: taken from qemu qxl.c, try to remove dupplication */
+#undef SPICE_RING_PROD_ITEM
+#define SPICE_RING_PROD_ITEM(r, ret) {  \
+typeof(r) start = r;\
+typeof(r) end = r + 1;  \
+uint32_t prod = (r)-prod  SPICE_RING_INDEX_MASK(r);   \
+typeof((r)-items[prod]) m_item = (r)-items[prod];   \
+if (!((uint8_t*)m_item = (uint8_t*)(start)  (uint8_t*)(m_item + 1) 
= (uint8_t*)(end))) { \
+abort();\
+}   \
+ret = m_item-el;  \
+}
+
+#undef SPICE_RING_CONS_ITEM
+#define SPICE_RING_CONS_ITEM(r, ret) {  \
+typeof(r) start = r;\
+typeof(r) end = r + 1;  \
+uint32_t cons = (r)-cons  SPICE_RING_INDEX_MASK(r);   \
+typeof((r)-items[cons]) m_item = (r)-items[cons];   \
+if (!((uint8_t*)m_item = (uint8_t*)(start)  (uint8_t*)(m_item + 1) 
= (uint8_t*)(end))) { \
+abort();\
+}   \
+ret = m_item-el;  \
+}
+
+static int spiceqxl_io_port_debug_level = 5;
+
+#define dprint(_level, _fmt, ...) \
+do {\
+if (spiceqxl_io_port_debug_level = _level) {  
  \
+fprintf(stderr, _fmt, ## __VA_ARGS__);  \
+}   \
+} while (0)
+
+void init_qxl_ram(qxl_screen_t *qxl)
+{
+QXLRam *ram = get_ram_header(qxl);
+uint64_t *item;
+
+ram-magic   = QXL_RAM_MAGIC;
+ram-int_pending = 0;
+ram-int_mask= 0;
+SPICE_RING_INIT(ram-cmd_ring);
+SPICE_RING_INIT(ram-cursor_ring);
+SPICE_RING_INIT(ram-release_ring);
+SPICE_RING_PROD_ITEM(ram-release_ring, item);
+*item = 0;
+}
+
 /* called from Xorg thread - not worker thread! */
 void ioport_write(qxl_screen_t *qxl, uint32_t io_port, uint32_t val)
 {
diff --git a/src/spiceqxl_io_port.h b/src/spiceqxl_io_port.h
index fc461b4..9ea8399 100644
--- a/src/spiceqxl_io_port.h
+++ b/src/spiceqxl_io_port.h
@@ -6,4 +6,8 @@
 /* device to spice-server, now xspice to spice-server */
 void ioport_write(qxl_screen_t *qxl, uint32_t io_port, uint32_t val);
 
+/* used to initialize the rings before the first reset, avoid a valgrind
+ * warning */
+void init_qxl_ram(qxl_screen_t *qxl);
+
 #endif // SPICEQXL_IO_PORT_H
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC 31/33] xspice: add inputs (mouse and keyboard)

2011-04-27 Thread Alon Levy
---
 src/Makefile.am   |1 +
 src/qxl_driver.c  |2 +
 src/spiceqxl_inputs.c |  353 +
 src/spiceqxl_inputs.h |9 ++
 4 files changed, 365 insertions(+), 0 deletions(-)
 create mode 100644 src/spiceqxl_inputs.c
 create mode 100644 src/spiceqxl_inputs.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 5eedc93..3521696 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -63,6 +63,7 @@ spiceqxl_drv_la_SOURCES = \
spiceqxl_driver.c   \
spiceqxl_main_loop.c\
spiceqxl_display.c  \
+   spiceqxl_inputs.c   \
qxl_driver.c\
qxl_image.c \
qxl_surface.c   \
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index ef3139b..688aa81 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -41,6 +41,7 @@
 #include spiceqxl_driver.h
 #include spiceqxl_main_loop.h
 #include spiceqxl_display.h
+#include spiceqxl_inputs.h
 #endif /* XSPICE */
 
 #if 0
@@ -903,6 +904,7 @@ spiceqxl_screen_init(int scrnIndex, ScrnInfoPtr pScrn, 
qxl_screen_t *qxl)
 spice_server_init(qxl-spice_server, core);
 qxl_add_spice_display_interface(qxl);
 qxl-worker-start(qxl-worker);
+delayed_xspice_input_init(qxl);
 }
 qxl-spice_server = qxl-spice_server;
 }
diff --git a/src/spiceqxl_inputs.c b/src/spiceqxl_inputs.c
new file mode 100644
index 000..272dc81
--- /dev/null
+++ b/src/spiceqxl_inputs.c
@@ -0,0 +1,353 @@
+/* Handle inputs channel for spice, and register the X parts,
+ * a mouse and a keyboard device pair.
+ */
+
+#include xorg/xf86Xinput.h
+#include xorg/exevents.h
+#include xorg/xserver-properties.h
+#include xorg/list.h
+#include xorg/input.h
+#include xorg/xkbsrv.h
+#include linux/input.h
+#include spice.h
+#include qxl.h
+#include spiceqxl_inputs.h
+
+static DeviceIntPtr xspice_pointer_device;
+static DeviceIntPtr xspice_keyboard_device;
+
+#define BUTTONS 5
+
+typedef struct XSpiceKbd {
+SpiceKbdInstance sin;
+qxl_screen_t*qxl;
+uint8_t  ledstate;
+} XSpiceKbd;
+
+static int xspice_pointer_proc(DeviceIntPtr pDevice, int onoff)
+{
+DevicePtr pDev = (DevicePtr)pDevice;
+   BYTE map[BUTTONS + 1];
+Atom btn_labels[BUTTONS];
+Atom axes_labels[2];
+int i;
+
+switch (onoff) {
+case DEVICE_INIT:
+for (i = 0; i  BUTTONS + 1; i++) {
+map[i] = i;
+}
+btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
+btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
+btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
+btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
+axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
+axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
+InitPointerDeviceStruct(pDev, map, 
BUTTONS,btn_labels,(PtrCtrlProcPtr)NoopDDA,
+GetMotionHistorySize(), 2, axes_labels);
+break;
+case DEVICE_ON:
+pDev-on = TRUE;
+break;
+case DEVICE_OFF:
+pDev-on = FALSE;
+break;
+}
+return Success;
+}
+
+static void xspice_keyboard_bell(int percent, DeviceIntPtr device, pointer 
ctrl, int class_)
+{
+}
+
+#define CAPSFLAG   1
+#define NUMFLAG2
+#define SCROLLFLAG 4
+/* MODEFLAG and COMPOSEFLAG currently unused (reminder for future) */
+#define MODEFLAG   8
+#define COMPOSEFLAG16
+
+#define ArrayLength(a) (sizeof(a) / (sizeof((a)[0])))
+
+static void xspice_keyboard_control(DeviceIntPtr device, KeybdCtrl *ctrl)
+{
+static struct { int xbit, code; } bits[] = {
+{ CAPSFLAG,SPICE_KEYBOARD_MODIFIER_FLAGS_CAPS_LOCK },
+{ NUMFLAG, SPICE_KEYBOARD_MODIFIER_FLAGS_NUM_LOCK },
+{ SCROLLFLAG,  SPICE_KEYBOARD_MODIFIER_FLAGS_SCROLL_LOCK },
+/* TODO: there is no MODEFLAG nor COMPOSEFLAG in SPICE. */
+};
+
+XSpiceKbd *kbd;
+int i;
+
+kbd = device-public.devicePrivate;
+kbd-ledstate = 0;
+for (i = 0; i  ArrayLength(bits); i++) {
+if (ctrl-leds  bits[i].xbit) {
+kbd-ledstate |= bits[i].code;
+} else {
+kbd-ledstate = ~bits[i].code;
+}
+}
+}
+
+static int xspice_keyboard_proc(DeviceIntPtr pDevice, int onoff)
+{
+DevicePtr pDev = (DevicePtr)pDevice;
+
+switch (onoff) {
+case DEVICE_INIT:
+InitKeyboardDeviceStruct(
+pDevice, NULL, xspice_keyboard_bell, xspice_keyboard_control
+);
+break;
+case DEVICE_ON:
+pDev-on = TRUE;
+break;
+case DEVICE_OFF:
+

[Spice-devel] [RFC 32/33] xspice: README, config, launcher script

2011-04-27 Thread Alon Levy
---
 README.xspice  |  109 
 TODO.xspice|   27 +
 spiceqxl.xorg.conf |   15 +++
 xspice |   21 ++
 4 files changed, 172 insertions(+), 0 deletions(-)
 create mode 100644 README.xspice
 create mode 100644 TODO.xspice
 create mode 100644 spiceqxl.xorg.conf
 create mode 100755 xspice

diff --git a/README.xspice b/README.xspice
new file mode 100644
index 000..398bc53
--- /dev/null
+++ b/README.xspice
@@ -0,0 +1,109 @@
+1. Introduction
+2. Building
+2.1 Building from source on fedora
+2.2 (don't) Building from source with your own Xserver
+3. Running
+
+= 1. Introduction =
+Xspice is an implementation of the SPICE protocol for a standalone X server.
+
+The implementation is based on the existing xf86-video-qxl driver, so much so
+that it made sense to continue development in the same repository.
+
+Xspice is similar to Xvnc / Xrdp in that it allows regular X connections, while
+the spice client provides the actual keyboard and mouse and video output.
+
+Technically we are reusing's Xserver's select loop (like tiger-vnc
+does) and reusing the qxl driver, which has been changed in the following
+ways:
+ * it creates only one memslot, covering the whole of memory (much like
+  spice does in simple display mode, i.e. vga, and the tester does)
+ * it invokes the whole of the qxl device from qemu, patching in both
+  directions.
+  * io becomes a function call instead of iob
+  * irq becomes a function call instead of setting a flag
+  * it runs spice server directly
+ * so it is linked with spice-server as a result.
+
+Protocol wise there is no change.
+
+= 2. Building =
+== 2.1 Building from source on fedora ==
+
+The changes for ubuntu/debian should be minimal:
+ * location of drivers for Xorg (just where you put any qxl_drv.so etc.)
+ * location of Xorg config files
+
+In fedora they are:
+DRV_DIR=/usr/lib64/xorg/modules/drivers
+XORG_CONF_DIR=/etc/X11
+
+git clone git://anongit.freedesktop.org/~alon/xspice
+sudo yum install spice-server-devel spice-protocol
+
+cd xspice
+./autogen  make
+sudo cp src/.libs/spiceqxl_drv.so $DRV_DIR
+
+sudo cp spiceqxl.xorg $XORG_CONF_DIR
+
+Note: this is needed because Xorg only looks in a very particular
+config file path, and . is not there (nor are absolute file names tolerated).
+
+== 2.2 (don't) Building from source with your own Xserver ==
+
+Note: there is no real reason to do this, but since the instructions
+are already written I'm keeping them. (Well, the only reason is if
+you try to fix some stuff in xserver).
+
+This assumes you already have spice-protocol and spice-server
+installed into $TEST prefix below.
+
+TEST=/store/test
+grab xserver, xspice, xextproto and xkbcomp
+
+for src in git://anongit.freedesktop.org/xorg/proto/xextproto \
+git://anongit.freedesktop.org/xorg/app/xkbcomp \
+git://anongit.freedesktop.org/xorg/xserver \
+git://anongit.freedesktop.org/xorg/lib/libxkbfile \
+git://git.freedesktop.org/git/spice/spice-protocol
+git://anongit.freedesktop.org/~alon/xspice; do git clone $src; done
+
+build and install into some non common prefix (not to overwrite
+your existing server) - note that this is just for testing. This
+should all work with the default server as well, but that server
+requires root generally and this is undesireable for testing (and
+running actually).
+
+export PKG_CONFIG_PATH=${TEST}/lib/pkgconfig
+(cd xextproto; ./autogen.sh --prefix=$TEST --without-xmlto  make -j5 install)
+(cd xserver; ./autogen.sh --prefix=$TEST  make -j5 install)
+(cd xkbcomp; ./autogen.sh --prefix=$TEST  make -j5 install)
+(cd libxkbfile; ./autogen.sh --prefix=$TEST  make -j5 install)
+(cd spice-protocol; ./autogen.sh --prefix=$TEST  --datadir=$TEST/lib  make 
-j5 install)
+(cd xspice; ./autogen.sh --prefix=$TEST  make -j5 install)
+
+mkdir -p $TEST/etc/X11
+
+place the tested config below in $TEST/etc/X11/spiceqxl.xorg.conf.
+
+last bit is a little ugly (FIXME), copy over the xkb bits from the existing X11
+installation:
+mkdir -p $TEST/share/X11
+cp -R /usr/share/X11/xkb $TEST/share/X11
+
+= 3. Running =
+$XORG is either your own built $TEST/bin/Xorg or just the default Xorg
+
+Run server with:
+$XORG -noreset -config spiceqxl.xorg.conf :3.0
+
+Or equivalently:
+./xspice :3.0
+(xspice is in the current directory, you can copy it to $PATH)
+
+Run X clients as usual by setting DISPLAY=:3.0
+Run spice client with port 5912 (hardcoded currently):
+
+spicec -h localhost -p 5912
+
diff --git a/TODO.xspice b/TODO.xspice
new file mode 100644
index 000..82ea5b5
--- /dev/null
+++ b/TODO.xspice
@@ -0,0 +1,27 @@
+TODO:
+
+ OOM. Not releasing?
+  Out of memory allocating 3145748 bytes
+  Out of mem - stats
+
+ Configuration
+  set sport, cert, etc. Via xorg.conf at least. Maybe also command line? follow
+  Xserver standard.
+
+ Cursor channel missing.
+ No copy paste.
+ No agent at all.
+  agent should probably be thought to run with Xspice too. That way
+   mouse 

[Spice-devel] [RFC 33/33] xspice/qxl_ring: yield when ring is full

2011-04-27 Thread Alon Levy
---
 src/qxl_ring.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/qxl_ring.c b/src/qxl_ring.c
index 0870ef1..02c4c35 100644
--- a/src/qxl_ring.c
+++ b/src/qxl_ring.c
@@ -75,7 +75,11 @@ qxl_ring_push (struct qxl_ring *ring,
 while (header-prod - header-cons == header-num_items)
 {
header-notify_on_cons = header-cons + 1;
-
+#ifdef XSPICE
+   /* in gtkperf, circles, this is a major bottleneck. Can't be that good 
in a vm either
+* Adding the yield reduces cpu usage, but doesn't improve throughput. 
*/
+   pthread_yield();
+#endif
mem_barrier();
 }
 
-- 
1.7.4.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 7/9] common: add ring_get_length() for debugging purposes

2011-04-27 Thread Alon Levy
On Wed, Apr 27, 2011 at 05:53:34PM +0200, Christophe Fergeau wrote:
 On Wed, Apr 27, 2011 at 10:24:01AM -0400, Marc-André Lureau wrote:
   Do you mean it should be #ifdef'ed? or that it's better to add the
   equivalent of G_GNUC_UNUSED to the function definition to avoid the
   compiler
   warning?
  
  Is there such warning? I was expecting unused inline functions not to 
  produce warning.
  The ifdef shouldn't be necessary. It's just one more functions, similar to 
  the other provided in ring.h
 
 Not sure we get such a warning with the default spice cflags, but it's easy
 to get gcc to warn about such dead code (unused static functions)

gcc 4.6.0 by default warns about it, and if we have -Werror it should fail.

 
 Christophe



 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH 7/9] common: add ring_get_length() for debugging purposes

2011-04-27 Thread Alon Levy
On Wed, Apr 27, 2011 at 06:00:25PM +0200, Marc-André Lureau wrote:
 -Wunused-function
 Warn whenever a static function is declared but not defined or a
 non-inline static function is unused. This warning is enabled by
 -Wall.
 
 I don't know if there is a flag to warn about unused static inline function.
 
sorry, missed the inline bit.

  ring.h contains many inline functions that are not necessarily used
 in all compilation units, so it's just one more function here.
 
 On Wed, Apr 27, 2011 at 5:53 PM, Christophe Fergeau cferg...@redhat.com 
 wrote:
  On Wed, Apr 27, 2011 at 10:24:01AM -0400, Marc-André Lureau wrote:
   Do you mean it should be #ifdef'ed? or that it's better to add the
   equivalent of G_GNUC_UNUSED to the function definition to avoid the
   compiler
   warning?
 
  Is there such warning? I was expecting unused inline functions not to 
  produce warning.
  The ifdef shouldn't be necessary. It's just one more functions, similar to 
  the other provided in ring.h
 
  Not sure we get such a warning with the default spice cflags, but it's easy
  to get gcc to warn about such dead code (unused static functions)
 
  Christophe
 
  ___
  Spice-devel mailing list
  Spice-devel@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/spice-devel
 
 
 
 
 
 -- 
 Marc-André Lureau
 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] OSX spice-gtk and pyparsing

2011-04-27 Thread Cliff Sharp
When building spice-gtk after loading tons of MacPorts dependencies -- I was 
getting the following error.

make  all-recursive
Making all in common
Making all in win
Making all in my_getopt-1.5
make[4]: Nothing to be done for `all'.
make[4]: Nothing to be done for `all-am'.
make[3]: Nothing to be done for `all-am'.
Making all in gtk
  GENspice-marshal.c
  GENspice-marshal.h
  GENgenerated_demarshallers.c
Traceback (most recent call last):
  File ../spice_codegen.py, line 7, in module
from python_modules import spice_parser
  File 
/Users/csharp/src/spice-gtk/spice-gtk-0.5/python_modules/spice_parser.py, 
line 1, in module
from pyparsing import Literal, CaselessLiteral, Word, OneOrMore, 
ZeroOrMore, \
ImportError: No module named pyparsing
make[2]: *** [generated_demarshallers.c] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I could not find pyparsing in MacPorts via the port list command. I did find 
and load 
py-parsing @1.5.1  python/py-parsing
py25-parsing   @1.5.1  python/py25-parsing
py26-parsing   @1.5.2  python/py26-parsing
py27-parsing   @1.5.5  python/py27-parsing

But none of these resolved the issue.

So I downloaded pyparsing-1.5.5.tar.gz from 
http://distfiles.macports.org/python/
and installed it via python setup.py install which resolved the issue.




Cliff Sharp | csh...@vbridges.com







___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] OSX spice-gtk and pyparsing

2011-04-27 Thread Alon Levy
On Wed, Apr 27, 2011 at 11:07:55AM -0500, Cliff Sharp wrote:
 When building spice-gtk after loading tons of MacPorts dependencies -- I was 
 getting the following error.

To build from git (not from source tar balls) you need pyparsing. I think it's 
pure python, so should pose
absolutely no problem to install even if no MacPort exists. I don't have a mac 
so I can't check.

http://pyparsing.wikispaces.com/

 
 make  all-recursive
 Making all in common
 Making all in win
 Making all in my_getopt-1.5
 make[4]: Nothing to be done for `all'.
 make[4]: Nothing to be done for `all-am'.
 make[3]: Nothing to be done for `all-am'.
 Making all in gtk
   GENspice-marshal.c
   GENspice-marshal.h
   GENgenerated_demarshallers.c
 Traceback (most recent call last):
   File ../spice_codegen.py, line 7, in module
 from python_modules import spice_parser
   File 
 /Users/csharp/src/spice-gtk/spice-gtk-0.5/python_modules/spice_parser.py, 
 line 1, in module
 from pyparsing import Literal, CaselessLiteral, Word, OneOrMore, 
 ZeroOrMore, \
 ImportError: No module named pyparsing
 make[2]: *** [generated_demarshallers.c] Error 1
 make[1]: *** [all-recursive] Error 1
 make: *** [all] Error 2
 
 I could not find pyparsing in MacPorts via the port list command. I did find 
 and load 
 py-parsing @1.5.1  python/py-parsing
 py25-parsing   @1.5.1  python/py25-parsing
 py26-parsing   @1.5.2  python/py26-parsing
 py27-parsing   @1.5.5  python/py27-parsing
 
 But none of these resolved the issue.
 
 So I downloaded pyparsing-1.5.5.tar.gz from 
 http://distfiles.macports.org/python/
 and installed it via python setup.py install which resolved the issue.
 
 
 
 
 Cliff Sharp | csh...@vbridges.com
 
 
 
 
 
 
 

 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] OSX spice-gtk and pyparsing

2011-04-27 Thread Attila Sukosd
Yea, you can even just take the pyparsing.py from the .tgz and put it in the
source base dir. (where you run make from)

Best Regards,

Attila Sukosd

-
DTU Computing Center - www.cc.dtu.dk
att...@cc.dtu.dk, gba...@student.dtu.dk, s070...@student.dtu.dk




On Wed, Apr 27, 2011 at 6:28 PM, Alon Levy al...@redhat.com wrote:

 On Wed, Apr 27, 2011 at 11:07:55AM -0500, Cliff Sharp wrote:
  When building spice-gtk after loading tons of MacPorts dependencies -- I
 was getting the following error.

 To build from git (not from source tar balls) you need pyparsing. I think
 it's pure python, so should pose
 absolutely no problem to install even if no MacPort exists. I don't have a
 mac so I can't check.

 http://pyparsing.wikispaces.com/

 
  make  all-recursive
  Making all in common
  Making all in win
  Making all in my_getopt-1.5
  make[4]: Nothing to be done for `all'.
  make[4]: Nothing to be done for `all-am'.
  make[3]: Nothing to be done for `all-am'.
  Making all in gtk
GENspice-marshal.c
GENspice-marshal.h
GENgenerated_demarshallers.c
  Traceback (most recent call last):
File ../spice_codegen.py, line 7, in module
  from python_modules import spice_parser
File
 /Users/csharp/src/spice-gtk/spice-gtk-0.5/python_modules/spice_parser.py,
 line 1, in module
  from pyparsing import Literal, CaselessLiteral, Word, OneOrMore,
 ZeroOrMore, \
  ImportError: No module named pyparsing
  make[2]: *** [generated_demarshallers.c] Error 1
  make[1]: *** [all-recursive] Error 1
  make: *** [all] Error 2
 
  I could not find pyparsing in MacPorts via the port list command. I did
 find and load
  py-parsing @1.5.1  python/py-parsing
  py25-parsing   @1.5.1  python/py25-parsing
  py26-parsing   @1.5.2  python/py26-parsing
  py27-parsing   @1.5.5  python/py27-parsing
 
  But none of these resolved the issue.
 
  So I downloaded pyparsing-1.5.5.tar.gz from
 http://distfiles.macports.org/python/
  and installed it via python setup.py install which resolved the issue.
 
 
  
 
  Cliff Sharp | csh...@vbridges.com
 
 
 
 
 
 
 

  ___
  Spice-devel mailing list
  Spice-devel@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/spice-devel

 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] OSX spice-gtk and pyparsing

2011-04-27 Thread Mosebach Kai
As Cliff stated on the very end of the mail, taking pyparsing from the original 
website and manually installing it resolved the problem…

Cheers Kai

From: Attila Sukosd attila.suk...@gmail.commailto:attila.suk...@gmail.com
Date: Wed, 27 Apr 2011 18:30:58 +0200
To: Cliff Sharp csh...@vbridges.commailto:csh...@vbridges.com, 
spice-de...@freedesktop.orgmailto:spice-de...@freedesktop.org, Kai Mosebach 
k...@freshx.demailto:k...@freshx.de
Subject: Re: [Spice-devel] OSX spice-gtk and pyparsing

Yea, you can even just take the pyparsing.py from the .tgz and put it in the 
source base dir. (where you run make from)

Best Regards,

Attila Sukosd

-
DTU Computing Center - www.cc.dtu.dkhttp://www.cc.dtu.dk
att...@cc.dtu.dkmailto:att...@cc.dtu.dk, 
gba...@student.dtu.dkmailto:gba...@student.dtu.dk, 
s070...@student.dtu.dkmailto:s070...@student.dtu.dk




On Wed, Apr 27, 2011 at 6:28 PM, Alon Levy 
al...@redhat.commailto:al...@redhat.com wrote:
On Wed, Apr 27, 2011 at 11:07:55AM -0500, Cliff Sharp wrote:
 When building spice-gtk after loading tons of MacPorts dependencies -- I was 
 getting the following error.

To build from git (not from source tar balls) you need pyparsing. I think it's 
pure python, so should pose
absolutely no problem to install even if no MacPort exists. I don't have a mac 
so I can't check.

http://pyparsing.wikispaces.com/


 make  all-recursive
 Making all in common
 Making all in win
 Making all in my_getopt-1.5
 make[4]: Nothing to be done for `all'.
 make[4]: Nothing to be done for `all-am'.
 make[3]: Nothing to be done for `all-am'.
 Making all in gtk
   GENspice-marshal.c
   GENspice-marshal.h
   GENgenerated_demarshallers.c
 Traceback (most recent call last):
   File ../spice_codegen.py, line 7, in module
 from python_modules import spice_parser
   File 
 /Users/csharp/src/spice-gtk/spice-gtk-0.5/python_modules/spice_parser.py, 
 line 1, in module
 from pyparsing import Literal, CaselessLiteral, Word, OneOrMore, 
 ZeroOrMore, \
 ImportError: No module named pyparsing
 make[2]: *** [generated_demarshallers.c] Error 1
 make[1]: *** [all-recursive] Error 1
 make: *** [all] Error 2

 I could not find pyparsing in MacPorts via the port list command. I did find 
 and load
 py-parsing @1.5.1  python/py-parsing
 py25-parsing   @1.5.1  python/py25-parsing
 py26-parsing   @1.5.2  python/py26-parsing
 py27-parsing   @1.5.5  python/py27-parsing

 But none of these resolved the issue.

 So I downloaded pyparsing-1.5.5.tar.gz from 
 http://distfiles.macports.org/python/
 and installed it via python setup.py install which resolved the issue.


 

 Cliff Sharp | csh...@vbridges.commailto:csh...@vbridges.com








 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.orgmailto:Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.orgmailto:Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] OSX spice-gtk and pyparsing

2011-04-27 Thread Kai Mosebach
Do you guys have an idea why sound may not be working (it works with the
windows client)
and why the bandwidth increases by ~70% compared to the spicec.exe from
windows?

Cheers Kai

On 4/27/11 6:34 PM, Mosebach  Kai kai.moseb...@bsse.ethz.ch wrote:

As Cliff stated on the very end of the mail, taking pyparsing from the
original website and manually installing it resolved the problemŠ

Cheers Kai

From: Attila Sukosd
attila.suk...@gmail.commailto:attila.suk...@gmail.com
Date: Wed, 27 Apr 2011 18:30:58 +0200
To: Cliff Sharp csh...@vbridges.commailto:csh...@vbridges.com,
spice-de...@freedesktop.orgmailto:spice-de...@freedesktop.org, Kai
Mosebach k...@freshx.demailto:k...@freshx.de
Subject: Re: [Spice-devel] OSX spice-gtk and pyparsing

Yea, you can even just take the pyparsing.py from the .tgz and put it in
the source base dir. (where you run make from)

Best Regards,

Attila Sukosd

-
DTU Computing Center - www.cc.dtu.dkhttp://www.cc.dtu.dk
att...@cc.dtu.dkmailto:att...@cc.dtu.dk,
gba...@student.dtu.dkmailto:gba...@student.dtu.dk,
s070...@student.dtu.dkmailto:s070...@student.dtu.dk




On Wed, Apr 27, 2011 at 6:28 PM, Alon Levy
al...@redhat.commailto:al...@redhat.com wrote:
On Wed, Apr 27, 2011 at 11:07:55AM -0500, Cliff Sharp wrote:
 When building spice-gtk after loading tons of MacPorts dependencies --
I was getting the following error.

To build from git (not from source tar balls) you need pyparsing. I think
it's pure python, so should pose
absolutely no problem to install even if no MacPort exists. I don't have
a mac so I can't check.

http://pyparsing.wikispaces.com/


 make  all-recursive
 Making all in common
 Making all in win
 Making all in my_getopt-1.5
 make[4]: Nothing to be done for `all'.
 make[4]: Nothing to be done for `all-am'.
 make[3]: Nothing to be done for `all-am'.
 Making all in gtk
   GENspice-marshal.c
   GENspice-marshal.h
   GENgenerated_demarshallers.c
 Traceback (most recent call last):
   File ../spice_codegen.py, line 7, in module
 from python_modules import spice_parser
   File 
/Users/csharp/src/spice-gtk/spice-gtk-0.5/python_modules/spice_parser.py
, line 1, in module
 from pyparsing import Literal, CaselessLiteral, Word, OneOrMore,
ZeroOrMore, \
 ImportError: No module named pyparsing
 make[2]: *** [generated_demarshallers.c] Error 1
 make[1]: *** [all-recursive] Error 1
 make: *** [all] Error 2

 I could not find pyparsing in MacPorts via the port list command. I did
find and load
 py-parsing @1.5.1  python/py-parsing
 py25-parsing   @1.5.1  python/py25-parsing
 py26-parsing   @1.5.2  python/py26-parsing
 py27-parsing   @1.5.5  python/py27-parsing

 But none of these resolved the issue.

 So I downloaded pyparsing-1.5.5.tar.gz from
http://distfiles.macports.org/python/
 and installed it via python setup.py install which resolved the issue.


 

 Cliff Sharp | csh...@vbridges.commailto:csh...@vbridges.com








 ___
 Spice-devel mailing list
 
Spice-devel@lists.freedesktop.orgmailto:spice-de...@lists.freedesktop.or
g
 http://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.orgmailto:Spice-devel@lists.freedesktop.org

http://lists.freedesktop.org/mailman/listinfo/spice-devel



___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] OSX spice-gtk and pyparsing

2011-04-27 Thread Alon Levy
On Wed, Apr 27, 2011 at 06:36:24PM +0200, Kai Mosebach wrote:
 Do you guys have an idea why sound may not be working (it works with the
 windows client)
 and why the bandwidth increases by ~70% compared to the spicec.exe from
 windows?

The bandwidth thing is just a result of using a different client? that is
very bizzarre, since it's all server-client and there is no negotiation
that could affect the compression scheme.

Sound wise - is gstreamer working standalone (gst-launch audiotestsrc ! 
autoaudiosink,
should hear a pure tone)? that's what spice-gtk should be using I think.

 
 Cheers Kai
 
 On 4/27/11 6:34 PM, Mosebach  Kai kai.moseb...@bsse.ethz.ch wrote:
 
 As Cliff stated on the very end of the mail, taking pyparsing from the
 original website and manually installing it resolved the problemŠ
 
 Cheers Kai
 
 From: Attila Sukosd
 attila.suk...@gmail.commailto:attila.suk...@gmail.com
 Date: Wed, 27 Apr 2011 18:30:58 +0200
 To: Cliff Sharp csh...@vbridges.commailto:csh...@vbridges.com,
 spice-de...@freedesktop.orgmailto:spice-de...@freedesktop.org, Kai
 Mosebach k...@freshx.demailto:k...@freshx.de
 Subject: Re: [Spice-devel] OSX spice-gtk and pyparsing
 
 Yea, you can even just take the pyparsing.py from the .tgz and put it in
 the source base dir. (where you run make from)
 
 Best Regards,
 
 Attila Sukosd
 
 -
 DTU Computing Center - www.cc.dtu.dkhttp://www.cc.dtu.dk
 att...@cc.dtu.dkmailto:att...@cc.dtu.dk,
 gba...@student.dtu.dkmailto:gba...@student.dtu.dk,
 s070...@student.dtu.dkmailto:s070...@student.dtu.dk
 
 
 
 
 On Wed, Apr 27, 2011 at 6:28 PM, Alon Levy
 al...@redhat.commailto:al...@redhat.com wrote:
 On Wed, Apr 27, 2011 at 11:07:55AM -0500, Cliff Sharp wrote:
  When building spice-gtk after loading tons of MacPorts dependencies --
 I was getting the following error.
 
 To build from git (not from source tar balls) you need pyparsing. I think
 it's pure python, so should pose
 absolutely no problem to install even if no MacPort exists. I don't have
 a mac so I can't check.
 
 http://pyparsing.wikispaces.com/
 
 
  make  all-recursive
  Making all in common
  Making all in win
  Making all in my_getopt-1.5
  make[4]: Nothing to be done for `all'.
  make[4]: Nothing to be done for `all-am'.
  make[3]: Nothing to be done for `all-am'.
  Making all in gtk
GENspice-marshal.c
GENspice-marshal.h
GENgenerated_demarshallers.c
  Traceback (most recent call last):
File ../spice_codegen.py, line 7, in module
  from python_modules import spice_parser
File 
 /Users/csharp/src/spice-gtk/spice-gtk-0.5/python_modules/spice_parser.py
 , line 1, in module
  from pyparsing import Literal, CaselessLiteral, Word, OneOrMore,
 ZeroOrMore, \
  ImportError: No module named pyparsing
  make[2]: *** [generated_demarshallers.c] Error 1
  make[1]: *** [all-recursive] Error 1
  make: *** [all] Error 2
 
  I could not find pyparsing in MacPorts via the port list command. I did
 find and load
  py-parsing @1.5.1  python/py-parsing
  py25-parsing   @1.5.1  python/py25-parsing
  py26-parsing   @1.5.2  python/py26-parsing
  py27-parsing   @1.5.5  python/py27-parsing
 
  But none of these resolved the issue.
 
  So I downloaded pyparsing-1.5.5.tar.gz from
 http://distfiles.macports.org/python/
  and installed it via python setup.py install which resolved the issue.
 
 
  
 
  Cliff Sharp | csh...@vbridges.commailto:csh...@vbridges.com
 
 
 
 
 
 
 
 
  ___
  Spice-devel mailing list
  
 Spice-devel@lists.freedesktop.orgmailto:spice-de...@lists.freedesktop.or
 g
  http://lists.freedesktop.org/mailman/listinfo/spice-devel
 
 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.orgmailto:Spice-devel@lists.freedesktop.org
 
 http://lists.freedesktop.org/mailman/listinfo/spice-devel
 
 
 
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] windows bsod with spice 0.8.1

2011-04-27 Thread Emre Erenoglu
On Wed, Apr 27, 2011 at 4:34 PM, Gianluca Cecchi
gianluca.cec...@gmail.comwrote:

 On Wed, Apr 27, 2011 at 12:41 PM, Alon Levy al...@redhat.com wrote:
 
  hello,
  I could send my self compiled qxldd.dll and qxl.sys as described in
  thread for w2k3 32bit:
 
 http://lists.freedesktop.org/archives/spice-devel/2011-April/003168.html
 
  but I don't know if there are copyright restrictions or other
  limitations in doing so...
 
  Seems to depend on the Microsoft Software License Terms for the WDK
 according
  to http://cgit.freedesktop.org/spice/win32/qxl/tree/display/brush.c
 
  Better go read that at some point..
 
 
  Gianluca

 Inside the winddk I've used I can find the files attached in the attached
 zip:
 license.rtf
 relnote.htm

 But reading them I'm not able to understand which sort of
 distributable condition applies for the generated files qxldd.dll and
 qxl.sys


I don't understand how we can get stuck in the license issue, since these
drivers are already posted in the internet on the spice-space.org. What's
the difference?

I think I will need to build it myself.

Emre
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Kai Mosebach
Yeah, I also gave it a shot and that x11 parts stopped my quite quickly :-/

Another note, on building the OSX client the symbol _g_get_monotonic_clock
is missing.
I think this comes from gtk/spice-session.c but does not seem to resolve
the glib version correctly.

I had to uncomment this pretty ugly:

//#if !GLIB_CHECK_VERSION(2,28,0)
static guint64 g_get_monotonic_clock(void)
{
GTimeVal tv;

/* TODO: support real monotonic clock? */
g_get_current_time (tv);

return (((gint64) tv.tv_sec) * 100) + tv.tv_usec;
}
//#endif



On 4/27/11 7:23 PM, Christophe Fergeau cferg...@redhat.com wrote:

On Wed, Apr 27, 2011 at 11:29:37AM +0200, Christophe Fergeau wrote:
 On Wed, Apr 27, 2011 at 11:27:53AM +0200, Kai Mosebach wrote:
  Regarding the native gtk2 build I think its not possible with
macports.
  You would need to use this I guess : http://gtk-osx.sourceforge.net/
 
 yes, trying out http://sourceforge.net/apps/trac/gtk-osx/wiki/Build is
part
 of my medium term plans :)

Actually I tested this today, I think starting from that work, it should
be
possible to make building a spice client on osx much easier. Basically, by
using these instructions, then by building gstreamer using what is
provided
by the gtk-osx project, and finally plugging and tweaking the jhbuild
spice
module from http://cgit.freedesktop.org/~teuf/spice-gtk/ I wasn't too far
from getting spice-gtk to build using a native gtk build. There are still
a
part of spice-gtk that expects either x11 or windows, so that doesn't work
yet :)
I'll try to get all the small tweaks I had to make integrated in whatever
git they belong to.

Christophe


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Christophe Fergeau
On Wed, Apr 27, 2011 at 07:27:58PM +0200, Kai Mosebach wrote:
 Yeah, I also gave it a shot and that x11 parts stopped my quite quickly :-/
 
 Another note, on building the OSX client the symbol _g_get_monotonic_clock
 is missing.
 I think this comes from gtk/spice-session.c but does not seem to resolve
 the glib version correctly.

I suspect you have 2 sets of glib headers, one from a newer one and one
from an older version, and the file is compiled with the newer headers and
linked with the older library, or something like that. I didn't have such
issues at least.

Christophe


pgpQ2gExN7N9A.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Christophe Fergeau
On Wed, Apr 27, 2011 at 10:47:10AM +0200, Christophe Fergeau wrote:
 diff --git a/gtk/continuation.h b/gtk/continuation.h
 index 585788e..6822757 100644
 --- a/gtk/continuation.h
 +++ b/gtk/continuation.h
 @@ -21,7 +21,8 @@
  #ifndef _CONTINUATION_H_
  #define _CONTINUATION_H_
  
 -#include ucontext.h
 +#include string.h
 +#include sys/ucontext.h
 
 Ah, this explains the #include ucontext.h you added in the previous hunk.
 I suspect dropping both hunks and only adding the #define _XOPEN_SOURCE
 here would fix your issues. Though nothing in ucontext.h nor in
 sys/ucontext.h on a macosx box depends on _XOPEN_SOURCE, so I'm not sure
 what issues you were seeing here?

For the record, on the osx build I tried, I only had to add #include
stddef.h to continuation.h, and didn't need to define _XOPEN_SOURCE in
continuation.[ch].
string.h wasn't needed here, but I had to add it to ssl_verify.c. On my
leopard system, openssl was too old and EVP_PKEY_cmp didn't exist (it was
introduced in openssl 0.9.8). Copying the openssl 0.9.8 implementation in
the file was enough to workaround the problem, so we can probably test for
its presence in configure.ac and conditionally compile such code if the
function wasn't available.

Christophe


pgplwso06OLm1.pgp
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Spice on OS/X

2011-04-27 Thread Kai Mosebach
If I run configure --with-coroutine=gthread I don¹t need those patches
below. 
Are there any disadvantages out of the gthreads?

On 4/27/11 7:28 PM, Christophe Fergeau cferg...@redhat.com wrote:

On Wed, Apr 27, 2011 at 10:47:10AM +0200, Christophe Fergeau wrote:
 diff --git a/gtk/continuation.h b/gtk/continuation.h
 index 585788e..6822757 100644
 --- a/gtk/continuation.h
 +++ b/gtk/continuation.h
 @@ -21,7 +21,8 @@
  #ifndef _CONTINUATION_H_
  #define _CONTINUATION_H_
  
 -#include ucontext.h
 +#include string.h
 +#include sys/ucontext.h
 
 Ah, this explains the #include ucontext.h you added in the previous
hunk.
 I suspect dropping both hunks and only adding the #define _XOPEN_SOURCE
 here would fix your issues. Though nothing in ucontext.h nor in
 sys/ucontext.h on a macosx box depends on _XOPEN_SOURCE, so I'm not sure
 what issues you were seeing here?

For the record, on the osx build I tried, I only had to add #include
stddef.h to continuation.h, and didn't need to define _XOPEN_SOURCE in
continuation.[ch].
string.h wasn't needed here, but I had to add it to ssl_verify.c. On my
leopard system, openssl was too old and EVP_PKEY_cmp didn't exist (it was
introduced in openssl 0.9.8). Copying the openssl 0.9.8 implementation in
the file was enough to workaround the problem, so we can probably test for
its presence in configure.ac and conditionally compile such code if the
function wasn't available.

Christophe
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] OSX spice-gtk and pyparsing

2011-04-27 Thread Kai Mosebach


On Wed, Apr 27, 2011 at 06:36:24PM +0200, Kai Mosebach wrote:
and why the bandwidth increases by ~70% compared to the spicec.exe from
 windows?

The bandwidth thing is just a result of using a different client? that is
very bizzarre, since it's all server-client and there is no negotiation
that could affect the compression scheme.

Its a different client (spicec.exe 0.8.0 (windows) vs. spice-gtk-0.5 (OSX)

Sound wise - is gstreamer working standalone (gst-launch audiotestsrc !
autoaudiosink,
should hear a pure tone)? that's what spice-gtk should be using I think.

To get a valid audiosink for OSX one has to install the macport
gst-plugins-good

Now it segfaults though :-( im looking into it.


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] OSX spice-gtk and pyparsing

2011-04-27 Thread Cliff Sharp
The wonderful news is that spice-gtk is built and running OSX.

AND

I have a spice server running on a server and waiting on a connection. A 
connection is actually made:

SERVER ---
Apr-27 16:48:11 1-I   added listener socket 3
Apr-27 16:48:21 1-I  Accepted a SPICE connection
Apr-27 16:48:21 1-I  Will add a pair 4 (wrapper) -- 5 (verdempcd) with 8 bytes
Apr-27 16:48:21 1-I   socket 5 disconnected

The bad news is the connection is dropped almost immediately...

CLIENT ---
Xlib:  extension RANDR missing on display /tmp/launch-f4Kdn5/org.x:0.   
(this is at startup time)
(spicy:90230): GSpice-CRITICAL **: incomplete link header (0/16)
GSpice-Message: main channel: failed to connect


We are making progress...

On Apr 27, 2011, at 1:05 PM, Mosebach Kai wrote:

 With a valid OSX audio sink in gstreamer, as soon as I play sound I run
 into :
 
 GSpice-Message: main channel: opened
 GSpice-Message: create window (#0)
 
 (spicy:24949): GSpice-WARNING **: (channel-main.c:889):_channel_new:
 runtime check failed: (channel != NULL)
 Segmentation fault
 
 
 How can I enable debugging? Gdb's backtrace is pretty useless... Are there
 any other logging sources / flags?
 
 
 On 4/27/11 7:47 PM, Kai Mosebach sp...@komadev.de wrote:
 
 
 
 On Wed, Apr 27, 2011 at 06:36:24PM +0200, Kai Mosebach wrote:
 and why the bandwidth increases by ~70% compared to the spicec.exe from
 windows?
 
 The bandwidth thing is just a result of using a different client? that is
 very bizzarre, since it's all server-client and there is no negotiation
 that could affect the compression scheme.
 
 Its a different client (spicec.exe 0.8.0 (windows) vs. spice-gtk-0.5 (OSX)
 
 Sound wise - is gstreamer working standalone (gst-launch audiotestsrc !
 autoaudiosink,
 should hear a pure tone)? that's what spice-gtk should be using I think.
 
 To get a valid audiosink for OSX one has to install the macport
 gst-plugins-good
 
 Now it segfaults though :-( im looking into it.
 
 
 
 ___
 Spice-devel mailing list
 Spice-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/spice-devel




Cliff Sharp | csh...@vbridges.com







___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] androidSpice-0.1.4 released

2011-04-27 Thread Shuxiang Lim
On Wed, Apr 27, 2011 at 5:28 PM, Alon Levy al...@redhat.com wrote:

 On Wed, Apr 27, 2011 at 04:54:55PM +0800, Shuxiang Lim wrote:
  Yep,it's really nasty.
 But if I want to leverage FULL spice image ability,I have to:
  1.Fix the bugs of sigbus in quic.c on Android by rewriting the
  pointer-type-cast into memcpy.etc..
 No idea what the problem is, is it a compile error? can you point to the
 lines/functions?
 I assume we are talking about common/quic.c?

 No,it will get SIGBUSes in runtime on android and cause process
killed,yes,I mean common/qui.c. It's not new to me for I have fixed the
SIGBUSes in generated-demarshaller.c,,etc. before. All of them are from the
pointer-typecast in C,them will be OK in x86,but not for ARM. So the quick
way to fix is to rewrite them by memcpy();

  2.Then,then,I got the processed image buffer in memory,BUT,HOW can I
 output
  it??? AFAIK,android offer no image output API for C(at least 2.3), and
 Java
  cannot access memory directly(am I right?). How can I do it besides
 sending
  the image data as soon and little as possible to Java via Unix-sock?
   So, no matter how fast or colorful Spice is, it's choked by Android
  framework and Java.

 what prevents you from rendering to a buffer and then giving that to java
 like
 you already do with the jpeg images? I confess not looking at the
 androidSpice code,
 so I'm not sure how exactly you do it, but the two options that come to
 mind are
 passing the jpeg buffer as is and letting java uncompress and display, or
 uncompressing
 and then passing the uncompressed buffer to java. If the later, then just
 let the
 existing rendering code do it's work on a memory buffer and then pass the
 results.

 
  Thus,if Java has the ability to maitain something like image buffer in
  memory like C(can it??), this may be the most-efficeint way I can
 imagine:
  implementing spice protocol and rewriting UI in Java,and leaving only(or
  not) the image computing work to lib**.so via JNI.

 ok, so exactly what I outline above? but I'm not familiar with JNI or the
 android
 SDK.

But that's beyond my current scope.
 
   Any ideas to access the memory block of image buffer allocated by
  C(libspicec.so) directly in Java,instantly and swiftly?
 

 sorry, no idea.

 Anyway, I HAVE to utilize full power of SPICE rather than use only
JPEG,otherwise my porting is useless.I'm searching for the way for Java to
use the image buffer maintained by C.

Besides,the Over mem limit error in Java on AVDs is caused by the little
mem size of them,I will not try to do the optmstn at present.
Rgrds.

  ...One more time I want to curse Android and disdain Java...
  Best regards.
 
  On Wed, Apr 27, 2011 at 4:20 PM, Alon Levy al...@redhat.com wrote:
 
   On Wed, Apr 27, 2011 at 10:30:18AM +0800, Shuxiang Lim wrote:
Hi,all!
   Thanks for the trying/feedbacking and sorry for the nascent itches
 of
   the
project.
   As I've mentioned in the wiki page of this proj.,to use the
   androidSpice,
the server should be modified to force the use of JPEG
 compression,and
   qemu
should not use -vga qxl and should use -usbdevice tablet(check
 for
   the
reason in wikipage,maybe you can fix this),have you checked this?
  
   so you need to use a standard vga device and not the qxl right now?
 well,
   it's
   certainly a good start. But you do realize without the qxl device this
 is
   no more
   then a different vnc? i.e. it sends bitmaps only, using jpeg maybe, I
   wasn't aware
   we did that in this case, but no other operation (no copy / text / any
   other rop).
  
   If not forced to use JPEG,the quic algorithm in client will cause
   SIGBUS
and quit,if qxl is not disabled ,the Java UI will crash for it can
 handle
only SPICE_IMAGE_TYPE_JPEG=105 till now.
   And also,the app will cause over memory limit of Java in some
   machine
of android-2.2 and AVDs.
   I'm working to fix this,welcome to improve it!
   I'v uploaded the androidSpice.apk and androidSpice-debug.apk with
 the
latter's debug msg switched on(you can check the ANDROID LOG msg by
 #adb
logcat). I've also uploaded the red_worker.c for server modifying(If
needed,you can get the libspicec.so from the installed android
 program
   file
directory as /data/data/com.keqi*/lib/libspicec.so to use directly in
 the
Android proj.).
   Best Regards.
---Lim---Lin林--
   
On Wed, Apr 27, 2011 at 6:14 AM, Gianluca Cecchi
gianluca.cec...@gmail.comwrote:
   
 Hello,
 device is HTC Wildfire with android 2.2.1 and my guest is windows 7
 on
 F14+virt-preview repo.
 In /var/log/libvirt/qemu/guest.log after pressing connect button I
 get:

 reds_handle_main_link:
 reds_show_new_channel: channel 1:0, connected successfully, over
 Non
   Secure
 link
 reds_main_handle_message: net test: latency 22.151000 ms, bitrate
 10769821 bps (10.270902 Mbps)
 reds_show_new_channel: channel