Re: [Spice-devel] [PATCH qxl-wddm-dod v5 4/7] Fixing framebuffer usage logic

2016-09-26 Thread Frediano Ziglio
> > > > > This patch fixes 2 issues: > > > > 1. Framebuffer should only be used in vga mode, > > therefore when QxlDevice is active > > FrameBufferIsActive flag shouldn't be checked; > > 2. FrameBufferIsActive flag should be set true > > on successfull frame buffer allocation

Re: [Spice-devel] [PATCH qxl-wddm-dod v5 2/7] Code Analysis fix

2016-09-26 Thread Frediano Ziglio
> > The PAGED_CODE macro ensures that the calling thread is running at an > IRQL that is low enough to permit paging. A call to this macro should > be made at the beginning of every driver routine that either contains > pageable code or accesses pageable code. > > Based on a patch by Sandy Stutsm

Re: [Spice-devel] [PATCH qxl-wddm-dod v5 4/7] Fixing framebuffer usage logic

2016-09-26 Thread Frediano Ziglio
> > This patch fixes 2 issues: > > 1. Framebuffer should only be used in vga mode, > therefore when QxlDevice is active > FrameBufferIsActive flag shouldn't be checked; > 2. FrameBufferIsActive flag should be set true > on successfull frame buffer allocation only. > > Signed-o

Re: [Spice-devel] [PATCH qxl-wddm-dod v5 3/7] Use frame buffer in VGA mode only

2016-09-26 Thread Frediano Ziglio
> > Framebuffer should only be used in VGA mode, as WDDM DOD > driver doesn't use the frame buffer (bar0), so no > reason to map in into memory. However the mode is only known > at runtime therefore framebuffer logic should be active when the > driver is operating in vga mode only. > > There were

Re: [Spice-devel] [PATCH qxl-wddm-dod v5 5/7] Fix source buffer mapping in PresentDisplayOnly

2016-09-26 Thread Frediano Ziglio
> > Part of source image mapped by PresentDisplayOnly > should be big enough to cover all rectangles being > transferred. > > Signed-off-by: Sameeh Jubran > Signed-off-by: Dmitry Fleytman > --- > qxldod/QxlDod.cpp | 28 +++- > qxldod/QxlDod.h | 2 ++ > 2 files change

Re: [Spice-devel] [PATCH qxl-wddm-dod v5 7/7] Fixing possible BSOD

2016-09-26 Thread Sameeh Jubran
On Mon, Sep 26, 2016 at 4:33 PM, Frediano Ziglio wrote: > > > > Interrupts seem to arrive to the driver before the initialization phase > > is over (m_pHWDevice = NULL), in that case we can't handle interrupts > yet. > > I would remove the "seem" > > > Even > > when m_pHWDevice isn't NULL, other

Re: [Spice-devel] [PATCH qxl-wddm-dod v5 1/7] Use MmMapIoSpaceEx instead of MmMapIoSpace

2016-09-26 Thread Frediano Ziglio
> > Disable execution bit on mapping improving security. > > MmMapIoSpaceEx is available only in Windows 10 thus > the macros are used. > > Based on a patch by Sandy Stutsman > > Signed-off-by: Sameeh Jubran Acked-by: Frediano Ziglio I'll wait couple if days, there were different comments

Re: [Spice-devel] [PATCH qxl-wddm-dod v5 7/7] Fixing possible BSOD

2016-09-26 Thread Frediano Ziglio
> > Interrupts seem to arrive to the driver before the initialization phase > is over (m_pHWDevice = NULL), in that case we can't handle interrupts yet. I would remove the "seem" > Even > when m_pHWDevice isn't NULL, other fields aren't necessarly fully intialized > till > the StartDevice functi

[Spice-devel] [PATCH qxl-wddm-dod v5 2/7] Code Analysis fix

2016-09-26 Thread Sameeh Jubran
The PAGED_CODE macro ensures that the calling thread is running at an IRQL that is low enough to permit paging. A call to this macro should be made at the beginning of every driver routine that either contains pageable code or accesses pageable code. Based on a patch by Sandy Stutsman Signed-off

[Spice-devel] [PATCH qxl-wddm-dod v5 3/7] Use frame buffer in VGA mode only

2016-09-26 Thread Sameeh Jubran
Framebuffer should only be used in VGA mode, as WDDM DOD driver doesn't use the frame buffer (bar0), so no reason to map in into memory. However the mode is only known at runtime therefore framebuffer logic should be active when the driver is operating in vga mode only. There were rare BSOD failur

[Spice-devel] [PATCH qxl-wddm-dod v5 4/7] Fixing framebuffer usage logic

2016-09-26 Thread Sameeh Jubran
This patch fixes 2 issues: 1. Framebuffer should only be used in vga mode, therefore when QxlDevice is active FrameBufferIsActive flag shouldn't be checked; 2. FrameBufferIsActive flag should be set true on successfull frame buffer allocation only. Signed-off-by: Dmitry Fleytma

[Spice-devel] [PATCH qxl-wddm-dod v5 1/7] Use MmMapIoSpaceEx instead of MmMapIoSpace

2016-09-26 Thread Sameeh Jubran
Disable execution bit on mapping improving security. MmMapIoSpaceEx is available only in Windows 10 thus the macros are used. Based on a patch by Sandy Stutsman Signed-off-by: Sameeh Jubran --- qxldod/QxlDod.cpp | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a

[Spice-devel] [PATCH qxl-wddm-dod v5 6/7] Removing unnecessary call to BlackOutScreen

2016-09-26 Thread Sameeh Jubran
This call to BlackOutScreen is not needed since the actual display surface is destroyed and created (redrawn) again. Acked-by: Frediano Ziglio Signed-off-by: Sameeh Jubran --- qxldod/QxlDod.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp index b6c

[Spice-devel] [PATCH qxl-wddm-dod v5 7/7] Fixing possible BSOD

2016-09-26 Thread Sameeh Jubran
Interrupts seem to arrive to the driver before the initialization phase is over (m_pHWDevice = NULL), in that case we can't handle interrupts yet. Even when m_pHWDevice isn't NULL, other fields aren't necessarly fully intialized till the StartDevice function has finished initialization, thus the f

[Spice-devel] [PATCH qxl-wddm-dod v5 5/7] Fix source buffer mapping in PresentDisplayOnly

2016-09-26 Thread Sameeh Jubran
Part of source image mapped by PresentDisplayOnly should be big enough to cover all rectangles being transferred. Signed-off-by: Sameeh Jubran Signed-off-by: Dmitry Fleytman --- qxldod/QxlDod.cpp | 28 +++- qxldod/QxlDod.h | 2 ++ 2 files changed, 25 insertions(+), 5

[Spice-devel] [PATCH qxl-wddm-dod v5 0/7] Win10 support patches

2016-09-26 Thread Sameeh Jubran
This series contains the latest patches to support Windows 10. The patches were applied on the up-to-date master branch of https://gitlab.com/spice/qxl-wddm-dod Diffrences from v4: * Edited the patch "Use MmMapIoSpaceEx instead of MmMapIoSpace" to support Windows 8 as discussed in here: https://p

Re: [Spice-devel] [PATCH] SPICE port basic implementation

2016-09-26 Thread Frediano Ziglio
> > --- > enums.js| 11 +++- > main.js | 5 +++- > port.js | 85 > + > spice.html | 50 +++-- > spice_auto.html | 12 +++- > spicemsg.js | 24 ++-- > utils.js

Re: [Spice-devel] [PATCH v2] Reuse VD_AGENT_HAS_CAPABILITY macro for bit array

2016-09-26 Thread Pavel Grunt
On Mon, 2016-09-26 at 12:27 +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio Acked-by: Pavel Grunt > --- >  server/red-channel.c | 10 -- >  server/red-channel.h |  5 - >  2 files changed, 4 insertions(+), 11 deletions(-) > > Changes since v1: > - make test_capability fu

[Spice-devel] [PATCH v2] Reuse VD_AGENT_HAS_CAPABILITY macro for bit array

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red-channel.c | 10 -- server/red-channel.h | 5 - 2 files changed, 4 insertions(+), 11 deletions(-) Changes since v1: - make test_capability function inline diff --git a/server/red-channel.c b/server/red-channel.c index 927e6e9..af49824 10

Re: [Spice-devel] [PATCH] SPICE port basic implementation

2016-09-26 Thread Oliver Gutierrez
I finally put all in the same patch with the Textdecoder part removed. Just added an utility function to do that in utils.js On Mon, Sep 26, 2016 at 1:02 PM, Oliver Gutierrez wrote: > --- > enums.js| 11 +++- > main.js | 5 +++- > port.js | 85 +

[Spice-devel] [PATCH] SPICE port basic implementation

2016-09-26 Thread Oliver Gutierrez
--- enums.js| 11 +++- main.js | 5 +++- port.js | 85 + spice.html | 50 +++-- spice_auto.html | 12 +++- spicemsg.js | 24 ++-- utils.js| 7 + 7

Re: [Spice-devel] [PATCH 10/18] worker: RedCompressBuf optimization

2016-09-26 Thread Pavel Grunt
On Mon, 2016-09-26 at 09:12 +0100, Frediano Ziglio wrote: > Move large buffer field at the end of structure. > Due to the way machine address memory this usually can reduce code > size > and make program sligthly faster. > Actually reduce size by 100 bytes. > > Signed-off-by: Frediano Ziglio Acke

Re: [Spice-devel] [PATCH 04/18] Reuse VD_AGENT_HAS_CAPABILITY macro for bit array

2016-09-26 Thread Pavel Grunt
On Mon, 2016-09-26 at 05:18 -0400, Frediano Ziglio wrote: > > > > Hi, > > > > does it make a sense to keep the function (or is it to avoid the > > header inclusion)? What about using the macro directly ? > > > > Pavel > > > > > The macro could be misleading as it refers to the agent. > Also m

Re: [Spice-devel] [PATCH 04/18] Reuse VD_AGENT_HAS_CAPABILITY macro for bit array

2016-09-26 Thread Frediano Ziglio
> > Hi, > > does it make a sense to keep the function (or is it to avoid the > header inclusion)? What about using the macro directly ? > > Pavel > The macro could be misleading as it refers to the agent. Also macro could have side effects and usually are less type safe.. But a simple inline

Re: [Spice-devel] [PATCH 14/18] Make error simpler in reds_stat

2016-09-26 Thread Pavel Grunt
On Mon, 2016-09-26 at 09:12 +0100, Frediano Ziglio wrote: > There's no reason for so hard optimisations so avoid > having to maintain multiple labels. > > Signed-off-by: Frediano Ziglio Acked-by: Pavel Grunt > --- >  tools/reds_stat.c | 20 ++-- >  1 file changed, 10 insertions(+)

Re: [Spice-devel] [PATCH 2/3] SPICE port implementation

2016-09-26 Thread Oliver Gutierrez
Yes. Of course. Will take a look at this and change it. I will resend the patch as soon as I fix that. Thanks On Thu, Sep 22, 2016 at 7:28 PM, Jeremy White wrote: > Hey Oliver, > > Thanks for this patch; it broadly looks good to me, with one question: > > On 09/20/2016 09:30 AM, Oliver Gutierre

Re: [Spice-devel] [PATCH 05/18] Avoid useless check

2016-09-26 Thread Pavel Grunt
On Mon, 2016-09-26 at 09:12 +0100, Frediano Ziglio wrote: > If channel is not connected red_channel_pipes_new_add_push will > do nothing. red_channel_pipes_new_add_push() does it through "foreach" over its clients. I would prefer to keep the explicit check, imho it is more readable. Pavel > > Si

Re: [Spice-devel] [PATCH 04/18] Reuse VD_AGENT_HAS_CAPABILITY macro for bit array

2016-09-26 Thread Pavel Grunt
Hi, does it make a sense to keep the function (or is it to avoid the header inclusion)? What about using the macro directly ? Pavel On Mon, 2016-09-26 at 09:12 +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- >  server/red-channel.c | 7 +-- >  1 file changed, 1 insertion

Re: [Spice-devel] [PATCH 02/18] Prevent setting invalid image compression values

2016-09-26 Thread Pavel Grunt
Hi, Maybe it is clear from the commit message, but I would prefer an explicit comment saying that in case of invalid value the original compression is unchanged. On Mon, 2016-09-26 at 09:12 +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio Acked-by: Pavel Grunt Thanks, Pavel > ---

[Spice-devel] [PATCH 12/18] Remove warnings from reds_stat utility

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- tools/reds_stat.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/reds_stat.c b/tools/reds_stat.c index 5e9705c..07fd732 100644 --- a/tools/reds_stat.c +++ b/tools/reds_stat.c @@ -24,6 +24,7 @@ #include #include #incl

[Spice-devel] [PATCH 03/18] Add small comment for detach_stream

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/stream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/stream.c b/server/stream.c index 9d878c8..95ff015 100644 --- a/server/stream.c +++ b/server/stream.c @@ -320,6 +320,9 @@ static void attach_stream(DisplayChannel *display, Drawable *d

[Spice-devel] [PATCH 02/18] Prevent setting invalid image compression values

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red-worker.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/red-worker.c b/server/red-worker.c index e55a939..7c7eafe 100644 --- a/server/red-worker.c +++ b/server/red-worker.c @@ -956,9 +956,9 @@ static void handle_dev_s

[Spice-devel] [PATCH 15/18] Avoid to call munmap with invalid size

2016-09-26 Thread Frediano Ziglio
This could have happened if mremap failed. Signed-off-by: Frediano Ziglio --- tools/reds_stat.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/reds_stat.c b/tools/reds_stat.c index 945659e..d7d82ec 100644 --- a/tools/reds_stat.c +++ b/tools/reds_stat.c @@ -66,7

[Spice-devel] [PATCH 09/18] Be consistent with opaque type

2016-09-26 Thread Frediano Ziglio
vdi_port_read_buf_release is registered passing data as RedVDIReadBuf*, not RedPipeItem*. Cast opaque to proper pointer type to avoid the assumption that first field of RedVDIReadBuf is a RedPipeItem. Signed-off-by: Frediano Ziglio --- server/reds.c | 3 ++- 1 file changed, 2 insertions(+), 1 de

[Spice-devel] [PATCH 18/18] Make QXLMessage handling safe

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/memslot.c | 14 ++ server/memslot.h | 3 +++ server/red-parse-qxl.c | 11 +++ server/red-parse-qxl.h | 1 + server/red-worker.c| 3 +-- 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/server/memslot.c

[Spice-devel] [PATCH 05/18] Avoid useless check

2016-09-26 Thread Frediano Ziglio
If channel is not connected red_channel_pipes_new_add_push will do nothing. Signed-off-by: Frediano Ziglio --- server/inputs-channel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/inputs-channel.c b/server/inputs-channel.c index 840d5e9..e3a940c 100644 --- a/serve

[Spice-devel] [PATCH 04/18] Reuse VD_AGENT_HAS_CAPABILITY macro for bit array

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red-channel.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/server/red-channel.c b/server/red-channel.c index 927e6e9..27c8632 100644 --- a/server/red-channel.c +++ b/server/red-channel.c @@ -331,12 +331,7 @@ void red_channel_r

[Spice-devel] [PATCH 16/18] Removed unused stat field

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/cursor-channel.c | 4 1 file changed, 4 deletions(-) diff --git a/server/cursor-channel.c b/server/cursor-channel.c index 05b8942..3e1e9f2 100644 --- a/server/cursor-channel.c +++ b/server/cursor-channel.c @@ -55,10 +55,6 @@ struct CursorChannelPriv

[Spice-devel] [PATCH 10/18] worker: RedCompressBuf optimization

2016-09-26 Thread Frediano Ziglio
Move large buffer field at the end of structure. Due to the way machine address memory this usually can reduce code size and make program sligthly faster. Actually reduce size by 100 bytes. Signed-off-by: Frediano Ziglio --- server/image-encoders.h | 3 ++- 1 file changed, 2 insertions(+), 1 del

[Spice-devel] [PATCH 07/18] Rename red_surface to surface

2016-09-26 Thread Frediano Ziglio
Attempt to use consistent naming. Usually we use surface name for RedSurface. Signed-off-by: Frediano Ziglio --- server/display-channel.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/display-channel.c b/server/display-channel.c index ad9dde6..217f5eb 10

[Spice-devel] [PATCH 17/18] Removed only written roundtrip_stat field

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/main-channel-client.c | 3 --- server/reds-private.h| 1 - server/reds.c| 13 - server/stat.h| 1 - 4 files changed, 18 deletions(-) Not to mention that the computation was wrong! diff --git a/serve

[Spice-devel] [PATCH 13/18] Add reds_stat to compiled software

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- Makefile.am | 2 +- configure.ac | 1 + tools/Makefile.am | 19 +++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tools/Makefile.am diff --git a/Makefile.am b/Makefile.am index 7eb0f28..5272d5a 100644 --- a/Ma

[Spice-devel] [PATCH 01/18] Remove red_pipe_add_verb family function

2016-09-26 Thread Frediano Ziglio
These functions were implementing the same stuff as empty messages functions provided by RedChannel so reuse them. The implementation seems a bit different but the result is the same. Specifically: - RedEmptyMsgPipeItem::msg is int while RedVerbItem::verb was uint16_t however this data goes into

[Spice-devel] [PATCH 06/18] Rename surface argument to surface_cmd

2016-09-26 Thread Frediano Ziglio
Attempt to use consistent naming. Usually we use surface name for RedSurface so make sure code reader do not get confused using a different name for RedSurfaceCmd. Signed-off-by: Frediano Ziglio --- server/display-channel.c | 23 --- server/display-channel.h | 6 +++--- 2 fi

[Spice-devel] [PATCH 00/18] Miscellaneous patches

2016-09-26 Thread Frediano Ziglio
Trying to collect different stuff not much related. The most related ones are the compilation and updates of reds_stat utility. Frediano Ziglio (18): Remove red_pipe_add_verb family function Prevent setting invalid image compression values Add small comment for detach_stream Reuse VD_AGENT

[Spice-devel] [PATCH 14/18] Make error simpler in reds_stat

2016-09-26 Thread Frediano Ziglio
There's no reason for so hard optimisations so avoid having to maintain multiple labels. Signed-off-by: Frediano Ziglio --- tools/reds_stat.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/reds_stat.c b/tools/reds_stat.c index 07fd732..945659e 10

[Spice-devel] [PATCH 11/18] Use mnemonic returning invalid value

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/spice-bitmap-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/spice-bitmap-utils.c b/server/spice-bitmap-utils.c index a423ad9..72a9285 100644 --- a/server/spice-bitmap-utils.c +++ b/server/spice-bitmap-utils.c @@ -132,7

[Spice-devel] [PATCH 08/18] Add a comment for marshaller field

2016-09-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red-channel-client-private.h | 1 + 1 file changed, 1 insertion(+) diff --git a/server/red-channel-client-private.h b/server/red-channel-client-private.h index 46d4fca..804b39a 100644 --- a/server/red-channel-client-private.h +++ b/server/red-channel-cl