Re: [Spice-devel] [PATCH] server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces.

2010-08-31 Thread Gerd Hoffmann

+static inline int is_drawable_independent_from_surfaces(Drawable *drawable)
+{
+int x;
+
+for (x = 0; x  3; ++x) {
+if (drawable-surfaces_dest[x] != -1) {
+return FALSE;
+}
+}
+return TRUE;
+}


What happens if this meets qemu without the surfaces init fix?
Will it break or just work less efficient?

cheers,
  Gerd

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


Re: [Spice-devel] [PATCH] server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces.

2010-08-31 Thread Yonit Halperin

On 08/31/2010 11:05 AM, Gerd Hoffmann wrote:

+static inline int is_drawable_independent_from_surfaces(Drawable
*drawable)
+{
+ int x;
+
+ for (x = 0; x 3; ++x) {
+ if (drawable-surfaces_dest[x] != -1) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}


What happens if this meets qemu without the surfaces init fix?
Will it break or just work less efficient?

cheers,
Gerd



I think that if the server will decide to video stream an area, it can 
cause a delay in between frames if the pipe is busy.


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


Re: [Spice-devel] [PATCH] server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces.

2010-08-31 Thread Gerd Hoffmann

On 08/31/10 10:11, Yonit Halperin wrote:

On 08/31/2010 11:05 AM, Gerd Hoffmann wrote:

+static inline int is_drawable_independent_from_surfaces(Drawable
*drawable)
+{
+ int x;
+
+ for (x = 0; x 3; ++x) {
+ if (drawable-surfaces_dest[x] != -1) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}


What happens if this meets qemu without the surfaces init fix?
Will it break or just work less efficient?

cheers,
Gerd



I think that if the server will decide to video stream an area, it can
cause a delay in between frames if the pipe is busy.


Ok, no breakage, good.

While we are at it:  How should surfaces_dest (and surfaces_rect) be 
filled for spice 0.4 commands?  Right now they are just zero-initialized 
(see red_get_compat_drawable() in red_parse_qxl.c).


Oh, and I've just seen self bitmaps are not handled yet.

spice 0.4 has:

uint16_t bitmap_offset;
QXLRect bitmap_area;

spice 0.6 has:

uint8_t self_bitmap;
QXLRect self_bitmap_area;

I suspect the area can just be used as-is.  What about bitmap_offset / 
self_bitmap?


cheers,
  Gerd

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


Re: [Spice-devel] [PATCH] server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces.

2010-08-31 Thread Yonit Halperin

On 08/31/2010 11:24 AM, Gerd Hoffmann wrote:

On 08/31/10 10:11, Yonit Halperin wrote:

On 08/31/2010 11:05 AM, Gerd Hoffmann wrote:

+static inline int is_drawable_independent_from_surfaces(Drawable
*drawable)
+{
+ int x;
+
+ for (x = 0; x 3; ++x) {
+ if (drawable-surfaces_dest[x] != -1) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}


What happens if this meets qemu without the surfaces init fix?
Will it break or just work less efficient?

cheers,
Gerd



I think that if the server will decide to video stream an area, it can
cause a delay in between frames if the pipe is busy.


Ok, no breakage, good.




While we are at it: How should surfaces_dest (and surfaces_rect) be
filled for spice 0.4 commands? Right now they are just zero-initialized
(see red_get_compat_drawable() in red_parse_qxl.c).

Best to fill surfaces_dest with -1. For consistency (though not 
necessary right now), in QXL_COPY_BITS scenario, fill surfaces_dest[0] 
with the drawable surface id, and surfaces_rect[0] with the rect of the 
drawabele transformed to src_pos (i.e.,  starts at src_pos and its width 
and hight are equal to the drawable destination).



Oh, and I've just seen self bitmaps are not handled yet.

spice 0.4 has:

uint16_t bitmap_offset;
QXLRect bitmap_area;

spice 0.6 has:

uint8_t self_bitmap;
QXLRect self_bitmap_area;

I suspect the area can just be used as-is. What about bitmap_offset /
self_bitmap?


if bitmap_offset != 0, it means self_bitmap = TRUE


cheers,
Gerd



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


Re: [Spice-devel] [PATCH] server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces.

2010-08-31 Thread Yonit Halperin

On 08/31/2010 12:46 PM, Gerd Hoffmann wrote:

While we are at it: How should surfaces_dest (and surfaces_rect) be
filled for spice 0.4 commands? Right now they are just zero-initialized
(see red_get_compat_drawable() in red_parse_qxl.c).


Best to fill surfaces_dest with -1. For consistency (though not
necessary right now), in QXL_COPY_BITS scenario, fill surfaces_dest[0]
with the drawable surface id, and surfaces_rect[0] with the rect of the
drawabele transformed to src_pos (i.e., starts at src_pos and its width
and hight are equal to the drawable destination).


Oh, and I've just seen self bitmaps are not handled yet.

spice 0.4 has:

uint16_t bitmap_offset;
QXLRect bitmap_area;

spice 0.6 has:

uint8_t self_bitmap;
QXLRect self_bitmap_area;

I suspect the area can just be used as-is. What about bitmap_offset /
self_bitmap?


if bitmap_offset != 0, it means self_bitmap = TRUE


Ok. How does the attached patch look? Fine or missed I something?


Looks good.

cheers,
Gerd



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


Re: [Spice-devel] [PATCH] server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces.

2010-08-31 Thread Alexander Larsson
On Tue, 2010-08-31 at 10:29 +0300, Yonit Halperin wrote:
 This will prevent: 1) rendering problems (commands sent to the client in the 
 wrong order)
 2) sending commands for surfaces that haven't been created yet on the client 
 side.
 ---

Ack.


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander LarssonRed Hat, Inc 
   al...@redhat.comalexander.lars...@gmail.com 
He's a Nobel prize-winning coffee-fuelled cat burglar haunted by memories of 
'Nam. She's a mentally unstable mute detective with a birthmark shaped like 
Liberty's torch. They fight crime! 

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