Re: [Spice-devel] [PATCH v2] sndworker: add AudioVolume/AudioMute messages

2011-06-20 Thread Marc-André Lureau
hi On Mon, Jun 20, 2011 at 11:53 PM, Christophe Fergeau wrote: > Hi, > > On Mon, Jun 20, 2011 at 11:40:01PM +0200, Marc-André Lureau wrote: >> These messages allow the guest to send the audio device volume to the >> client. It uses an arbitrary scale of 16bits, which works good enough >> for now.

Re: [Spice-devel] [PATCH v2] sndworker: add AudioVolume/AudioMute messages

2011-06-20 Thread Christophe Fergeau
Hi, On Mon, Jun 20, 2011 at 11:40:01PM +0200, Marc-André Lureau wrote: > These messages allow the guest to send the audio device volume to the > client. It uses an arbitrary scale of 16bits, which works good enough > for now. This adds this arbitrary scale to the protocol, is this scale "good eno

Re: [Spice-devel] [PATCH] codegen: typedef the protocol enums

2011-06-20 Thread Christophe Fergeau
Hi, On Mon, Jun 20, 2011 at 11:19:43PM +0200, Marc-André Lureau wrote: > This is to satisfy a changed manually in > 9d5ef9beeca722b2ceff7d15aaa3f07ecfbf when one regenerate enums.h. The patch looks good to me, though I don't understand what the commit message means, can you improve it? :) >

[Spice-devel] [PATCH v2] sndworker: add AudioVolume/AudioMute messages

2011-06-20 Thread Marc-André Lureau
These messages allow the guest to send the audio device volume to the client. It uses an arbitrary scale of 16bits, which works good enough for now. Save VolumeState in {Playback,Record}State, so that we can send the current volume on channel connection. Note about future improvements: - add exac

[Spice-devel] [PATCH] sndworker: add AudioVolume/AudioMute messages

2011-06-20 Thread Marc-André Lureau
These messages allow the guest to send the audio device volume to the client. It uses an arbitrary scale of 16bits, which works good enough for now. Save VolumeState in {Playback,Record}State, so that we can send the current volume on channel connection. Note about future improvements: - add exac

[Spice-devel] [PATCH] codegen: typedef the protocol enums

2011-06-20 Thread Marc-André Lureau
This is to satisfy a changed manually in 9d5ef9beeca722b2ceff7d15aaa3f07ecfbf when one regenerate enums.h. --- python_modules/ptypes.py | 22 +++--- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py index 9c4b7

Re: [Spice-devel] nographic option

2011-06-20 Thread John A. Sullivan III
On Mon, 2011-06-20 at 15:06 -0400, Marian Krcmarik wrote: > > - Original Message - > > From: "John A. Sullivan III" > > To: spice-de...@freedesktop.org > > Sent: Saturday, June 18, 2011 10:14:19 PM > > Subject: [Spice-devel] nographic option > > Hello, all. I was a little surprised to see

Re: [Spice-devel] nographic option

2011-06-20 Thread Marian Krcmarik
- Original Message - > From: "John A. Sullivan III" > To: spice-de...@freedesktop.org > Sent: Saturday, June 18, 2011 10:14:19 PM > Subject: [Spice-devel] nographic option > Hello, all. I was a little surprised to see in > http://spice-space.org/page/Running Most likely it's not the bes

Re: [Spice-devel] Guest hanging after being left idle

2011-06-20 Thread Damien Churchill
On 20 June 2011 13:59, Alon Levy wrote: > On Mon, Jun 20, 2011 at 12:55:43PM +0100, Damien Churchill wrote: >> I've noticed after a while, not sure on the exact period of time, >> anywhere from overnight to a couple of hours, the guest will hang, at >> least as far as spice is concerned. Has anyon

Re: [Spice-devel] [PATCH qxl-win v3 0/8] cleanups and allow checked builds of qxl driver

2011-06-20 Thread Arnon Gilboa
ack series Alon Levy wrote: v1->v2: remove #if 0'd code and merge WAIT_FOR_EVENT fixes to first patch. v2->v3: added #if DBG around FreeMem verbose debug and EngDebugBreak. This is part 1 of 4 for the S3 support: 1. cleanup + checked build (this one) + FreeSurface bugfix (Yonit). 2. QXL_IO_LO

[Spice-devel] [PATCH qxl-win v3 8/8] display/driver: DebugPrintV: check for pdev->Res before dereferencing it

2011-06-20 Thread Alon Levy
--- display/driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/display/driver.c b/display/driver.c index b452a4f..f82c744 100644 --- a/display/driver.c +++ b/display/driver.c @@ -107,7 +107,7 @@ static CallCounterInfo counters_info[NUM_CALL_COUNTERS] = { void Deb

[Spice-devel] [PATCH qxl-win v3 7/8] display/surface: CreateDeviceBitmap: remove redundant FreeSurface

2011-06-20 Thread Alon Levy
on error2 path, if we failed QXLGetSurface, we free the surface info but then the caller (DrvCreateDeviceBitmap) frees it again. In addition, we cannot free the SurfaceInfo since it is the handle given to GDI and is accessed on callback from EngDestroySurface (which is called immediatelly after in

[Spice-devel] [PATCH qxl-win v3 6/8] treewide: staticfy some functions, small indentation fixes

2011-06-20 Thread Alon Levy
--- display/driver.c |6 +++--- display/res.c |8 display/surface.c |6 +++--- display/surface.h |4 miniport/qxl.c|4 ++-- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/display/driver.c b/display/driver.c index 6bc0830..b452a4f 100644

[Spice-devel] [PATCH qxl-win v3 5/8] display/res: better error message for FreeMem assert

2011-06-20 Thread Alon Levy
--- display/res.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/display/res.c b/display/res.c index 1b8cf84..c39e022 100644 --- a/display/res.c +++ b/display/res.c @@ -344,8 +344,15 @@ static void *__AllocMem(PDev* pdev, UINT32 mspace_type, size_t size, BOOL f

[Spice-devel] [PATCH qxl-win v3 4/8] display/driver: DebugPrint: check for log_level being set (allow using DebugPrint with pdev early)

2011-06-20 Thread Alon Levy
--- display/driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/display/driver.c b/display/driver.c index 871aecb..6bc0830 100644 --- a/display/driver.c +++ b/display/driver.c @@ -123,7 +123,7 @@ void DebugPrint(PDev *pdev, int level, const char *message, ...) {

[Spice-devel] [PATCH qxl-win v3 3/8] display/res: turn two asserts in CursorCacheRemove to debug prints

2011-06-20 Thread Alon Levy
In Free build this is defined out anyway, but in checked build this assert triggers, so change it to a debug print (pending investigation on why someone thought at some point it should never happen). The asserts were on: cursor->unique != 0 function end not reached --- display/res.c |7

[Spice-devel] [PATCH qxl-win v3 2/8] display: fix broken debug in checked

2011-06-20 Thread Alon Levy
The dropped ASSERTS in GetCosmeticAttr contain undefined allcaps defines, so dropping them. The rest are mostly moved structs that didn't update the ASSERT contents. --- display/driver.c |6 -- display/quic.c |4 display/res.c|6 +++--- 3 files changed, 7 insertions(+),

[Spice-devel] [PATCH qxl-win v3 1/8] display: use WAIT_FOR_EVENT everywhere

2011-06-20 Thread Alon Levy
--- display/driver.c |1 - display/res.c| 38 ++ 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/display/driver.c b/display/driver.c index b129f52..dbe6978 100644 --- a/display/driver.c +++ b/display/driver.c @@ -1377,4 +1377,3 @@ BOOL

[Spice-devel] [PATCH qxl-win v3 0/8] cleanups and allow checked builds of qxl driver

2011-06-20 Thread Alon Levy
v1->v2: remove #if 0'd code and merge WAIT_FOR_EVENT fixes to first patch. v2->v3: added #if DBG around FreeMem verbose debug and EngDebugBreak. This is part 1 of 4 for the S3 support: 1. cleanup + checked build (this one) + FreeSurface bugfix (Yonit). 2. QXL_IO_LOG for miniport (seperated becau

Re: [Spice-devel] [PATCH qxl-win v2 0/8] cleanups and allow checked builds of qxl driver

2011-06-20 Thread Alon Levy
On Mon, Jun 20, 2011 at 02:37:00PM +0200, Alon Levy wrote: > v1->v2: remove #if 0'd code and merge WAIT_FOR_EVENT fixes to first patch. > please ignore, forgot to add #ifdef DBG to FreeMem EngDebugBreak. > This is part 1 of 4 for the S3 support: > 1. cleanup + checked build (this one) + FreeSur

Re: [Spice-devel] Guest hanging after being left idle

2011-06-20 Thread Alon Levy
On Mon, Jun 20, 2011 at 12:55:43PM +0100, Damien Churchill wrote: > I've noticed after a while, not sure on the exact period of time, > anywhere from overnight to a couple of hours, the guest will hang, at > least as far as spice is concerned. Has anyone else noticed this > happening? This is with

[Spice-devel] [PATCH qxl-win v2 8/8] display/driver: DebugPrintV: check for pdev->Res before dereferencing it

2011-06-20 Thread Alon Levy
--- display/driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/display/driver.c b/display/driver.c index b452a4f..f82c744 100644 --- a/display/driver.c +++ b/display/driver.c @@ -107,7 +107,7 @@ static CallCounterInfo counters_info[NUM_CALL_COUNTERS] = { void Deb

[Spice-devel] [PATCH qxl-win v2 7/8] display/surface: CreateDeviceBitmap: remove redundant FreeSurface

2011-06-20 Thread Alon Levy
on error2 path, if we failed QXLGetSurface, we free the surface info but then the caller (DrvCreateDeviceBitmap) frees it again. In addition, we cannot free the SurfaceInfo since it is the handle given to GDI and is accessed on callback from EngDestroySurface (which is called immediatelly after in

[Spice-devel] [PATCH qxl-win v2 6/8] treewide: staticfy some functions, small indentation fixes

2011-06-20 Thread Alon Levy
--- display/driver.c |6 +++--- display/res.c |8 display/surface.c |6 +++--- display/surface.h |4 miniport/qxl.c|4 ++-- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/display/driver.c b/display/driver.c index 6bc0830..b452a4f 100644

[Spice-devel] [PATCH qxl-win v2 5/8] display/res: better error message for FreeMem assert

2011-06-20 Thread Alon Levy
--- display/res.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/display/res.c b/display/res.c index 1b8cf84..dd57491 100644 --- a/display/res.c +++ b/display/res.c @@ -344,8 +344,13 @@ static void *__AllocMem(PDev* pdev, UINT32 mspace_type, size_t size, BOOL for

[Spice-devel] [PATCH qxl-win v2 4/8] display/driver: DebugPrint: check for log_level being set (allow using DebugPrint with pdev early)

2011-06-20 Thread Alon Levy
--- display/driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/display/driver.c b/display/driver.c index 871aecb..6bc0830 100644 --- a/display/driver.c +++ b/display/driver.c @@ -123,7 +123,7 @@ void DebugPrint(PDev *pdev, int level, const char *message, ...) {

[Spice-devel] [PATCH qxl-win v2 3/8] display/res: turn two asserts in CursorCacheRemove to debug prints

2011-06-20 Thread Alon Levy
In Free build this is defined out anyway, but in checked build this assert triggers, so change it to a debug print (pending investigation on why someone thought at some point it should never happen). The asserts were on: cursor->unique != 0 function end not reached --- display/res.c |7

[Spice-devel] [PATCH qxl-win v2 2/8] display: fix broken debug in checked

2011-06-20 Thread Alon Levy
The dropped ASSERTS in GetCosmeticAttr contain undefined allcaps defines, so dropping them. The rest are mostly moved structs that didn't update the ASSERT contents. --- display/driver.c |6 -- display/quic.c |4 display/res.c|6 +++--- 3 files changed, 7 insertions(+),

[Spice-devel] [PATCH qxl-win v2 1/8] display: use WAIT_FOR_EVENT everywhere

2011-06-20 Thread Alon Levy
--- display/driver.c |1 - display/res.c| 38 ++ 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/display/driver.c b/display/driver.c index b129f52..dbe6978 100644 --- a/display/driver.c +++ b/display/driver.c @@ -1377,4 +1377,3 @@ BOOL

[Spice-devel] [PATCH qxl-win v2 0/8] cleanups and allow checked builds of qxl driver

2011-06-20 Thread Alon Levy
v1->v2: remove #if 0'd code and merge WAIT_FOR_EVENT fixes to first patch. This is part 1 of 4 for the S3 support: 1. cleanup + checked build (this one) + FreeSurface bugfix (Yonit). 2. QXL_IO_LOG for miniport (seperated because it includes an snprintf implementation and so is large) 3. cle

Re: [Spice-devel] [PATCH 0/8] cleanups and allow checked builds of qxl driver

2011-06-20 Thread Arnon Gilboa
ack for all, but in 5/8 pls ifdef EngDebugBreak(); Alon Levy wrote: This is part 1 of 4 for the S3 support: 1. cleanup + checked build (this one) + FreeSurface bugfix (Yonit). 2. QXL_IO_LOG for miniport (seperated because it includes an snprintf implementation and so is large) 3. cleanup

[Spice-devel] Guest hanging after being left idle

2011-06-20 Thread Damien Churchill
I've noticed after a while, not sure on the exact period of time, anywhere from overnight to a couple of hours, the guest will hang, at least as far as spice is concerned. Has anyone else noticed this happening? This is with Windows 7 as the guest, both 32 and 64bit. Thanks, Damien ___

[Spice-devel] [PATCH] add QXL_IO_UPDATE_MEM for sleep (S3) support

2011-06-20 Thread Alon Levy
Adds a new revision to notify of this new IO to the driver. This new revision (QXL_REVISION_STABLE_V10) will also include other IO updates for async IO. related RHBZ: 63 Sleep is supported by the following flow: (G stands for Guest, D is the device) G: (1#) QXL_IO_UPDATE_MEM(QXL_UPDATE_M

[Spice-devel] [PATCH] S3 support

2011-06-20 Thread Alon Levy
See cover letter of spice patchset for links to git repos for everything (<1308568689-6307-1-git-send-email-al...@redhat.com>) Alon Levy (1): add QXL_IO_UPDATE_MEM for sleep (S3) support spice/qxl_dev.h | 19 +-- 1 files changed, 17 insertions(+), 2 deletions(-) -- 1.7.5.2

[Spice-devel] [PATCH 6/6] server/red_worker: send surface images on demand (UPDATE_MEM)

2011-06-20 Thread Alon Levy
From: Yonit Halperin When surfaces are being reloaded to the worker (e.g., after UPDATE_MEM), we will send them to the client only if and when it needs them. --- server/red_worker.c | 33 +++-- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/server/

[Spice-devel] [PATCH 5/6] server/red_worker: (QXLInterface change) add update_mem for S3/S4 support

2011-06-20 Thread Alon Levy
Adds QXLWorker::update_mem to the public api (spice.h) functions, used by qxl (qemu) for ACPI S3 (suspend to ram) and S4 (hibernate, suspend to disk) support. This is a helper function, it provides functionality available otherwise but by adding it the amount of vmexits is reduced. Specifically: u

[Spice-devel] [PATCH 4/6] server: bump minor to 1 to signify QXLInterface addition in next patch

2011-06-20 Thread Alon Levy
--- server/spice.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/server/spice.h b/server/spice.h index 425d586..cbb75cc 100644 --- a/server/spice.h +++ b/server/spice.h @@ -89,7 +89,7 @@ struct SpiceCoreInterface { #define SPICE_INTERFACE_QXL "qxl" #define SPICE_INT

[Spice-devel] [PATCH 3/6] server/red_worker: add destroy_all_surfaces_starting_from (reused next patch)

2011-06-20 Thread Alon Levy
Cc: Yonit Halperin --- server/red_worker.c | 23 +-- 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index 3ffb52c..38ccb90 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -9546,15 +9546,14 @@ static inl

[Spice-devel] [PATCH 2/6] server/red_worker: validate_surface: print paniced surface_id

2011-06-20 Thread Alon Levy
--- server/red_worker.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index 12f7fa5..3ffb52c 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -1042,7 +1042,10 @@ static inline void __validate_surface(RedWorker *w

[Spice-devel] [PATCH 1/6] server/red_worker: add stream_count (for debug purposes)

2011-06-20 Thread Alon Levy
--- server/red_worker.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index bee86b9..12f7fa5 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -836,6 +836,7 @@ typedef struct RedWorker { uint32_t shadows_coun

[Spice-devel] [PATCH 0/6] S3 support

2011-06-20 Thread Alon Levy
To support suspend a new io port and corresponding spice api is added. The spice api is QXLWorker::update_mem and it is used to do multiple update_area's at once to all existing surfaces, followed by destroy to all the surfaces except the primary. This results in rendered memory on the pci vram bar

[Spice-devel] [PATCH qxl-win] display/driver: reimplement DrvAssertMode for Suspend+Hibernate (S3+S4) support

2011-06-20 Thread Alon Levy
our old code did a very minimal flow good for resolution change: DrvAssertMode False (disable) destroy primary surface delete vram memslot DrvAssertMode True (enable) create primary surface (destroyed on disable) create vram memslot Aside: Importantly the flow for resolution change invol

[Spice-devel] [PATCH qxl-win] miniport+display: export UPDATE_MEM port for use by AssertModeEnable

2011-06-20 Thread Alon Levy
This is called possibly before sleep, and otherwise during resolution change and logout. To support the sleep case we need to flush all memory on the device and render all surfaces, which is what the synchronous UPDATE_MEM does. --- display/driver.c |1 + display/qxldd.h |1 + inc

[Spice-devel] [PATCH qxl-win] display/*: add PDev->enabled

2011-06-20 Thread Alon Levy
GDI will continue using any callback we registered even after a DrvAssertMode(FALSE). We are expected to move any surface we own to GDI handled and ignore any new requests to create a surface. This is called punting and we use PDev->enabled to indicate if this is required. A later patch will set P

[Spice-devel] [PATCH qxl-win] display/surface: add surfaces from/to ram

2011-06-20 Thread Alon Levy
Adds fields to SurfaceInfo to cache data previously only available via SurfaceArea::draw_area. Adds two functions to save and restore surfaces from ram: MoveAllSurfacesToVideoRam allocates and copies surfaces from vram to ram, and calls EngModifySurface with an empty hook list to make those sur

[Spice-devel] [PATCH qxl-win] display/surface: add DEVICE_BITMAP_ALLOCATION_TYPE_RAM, cleanup surface alloc/free code paths

2011-06-20 Thread Alon Levy
This adds a third surface allocation type, allocation from guest memory using the windows ddk allocator. Not all code paths are used later - the creation is not done since copy-surfaces-to-ram allocates memory itself, and at the end we never allocate any surfaces when the device is disabled, we ju

[Spice-devel] [PATCH qxl-win] S3/S4 support

2011-06-20 Thread Alon Levy
Explanation is given in the last patch that does the actualy implmentation. Alon Levy (5): display/surface: add DEVICE_BITMAP_ALLOCATION_TYPE_RAM, cleanup surface alloc/free code paths display/surface: add surfaces from/to ram display/*: add PDev->enabled miniport+display: export UPDAT

[Spice-devel] [PATCH qxl-win] display/surface: FreeSurfaceInfo: ignore double frees

2011-06-20 Thread Alon Levy
Cc: Yonit Halperin --- display/surface.h |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/display/surface.h b/display/surface.h index e677610..0b7edb3 100644 --- a/display/surface.h +++ b/display/surface.h @@ -55,10 +55,16 @@ static _inline void FreeSurfaceInfo(PDev

[Spice-devel] [PATCH qxl-win] display/surface: GetSurfaceId: return -1 if \!surf->dhsurf

2011-06-20 Thread Alon Levy
Cc: Yonit Halperin --- display/surface.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/display/surface.h b/display/surface.h index 00fd93c..e677610 100644 --- a/display/surface.h +++ b/display/surface.h @@ -41,6 +41,9 @@ static _inline UINT32 GetSurfaceId(SURFOBJ *sur

[Spice-devel] [PATCH qxl-win] display/surface: add QXL_SURFACE_HOOKS define

2011-06-20 Thread Alon Levy
Cc: Yonit Halperin --- display/surface.c |9 + display/surface.h | 15 +++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/display/surface.c b/display/surface.c index 436e76e..d24e751 100644 --- a/display/surface.c +++ b/display/surface.c @@ -111,14 +111,

[Spice-devel] [PATCH qxl-win] display/res: add a debug print level 9

2011-06-20 Thread Alon Levy
--- display/res.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/display/res.c b/display/res.c index 5dc06a4..f9f18a9 100644 --- a/display/res.c +++ b/display/res.c @@ -269,6 +269,8 @@ static void WaitForCmdRing(PDev* pdev) if (!wait) { break;

[Spice-devel] [PATCH qxl-win] display/res: __AllocMem: verbose debugging (log_level 12)

2011-06-20 Thread Alon Levy
Cc: Yonit Halperin --- display/res.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/display/res.c b/display/res.c index b70c645..5dc06a4 100644 --- a/display/res.c +++ b/display/res.c @@ -390,8 +390,15 @@ static void *__AllocMem(PDev* pdev, UINT32 mspace_type,

[Spice-devel] [PATCH qxl-win] display/res: add helpers for clearing device memory

2011-06-20 Thread Alon Levy
Refactors InitResources code called upon DrvEnableSurface so it can later be called from AssertModeEnable. Introduces three helpers: EmptyReleaseRing - no vmexit, goes over release ring and empties it all (as opposed to OOM behavior that empties 50 resources). InitDeviceMemoryResources - resets

[Spice-devel] [PATCH qxl-win] display/res: make (Cursor|Palette)CacheRemove always release the object

2011-06-20 Thread Alon Levy
From: Yonit Halperin even if it is not found in the cache (which is an error) --- display/res.c | 45 ++--- 1 files changed, 30 insertions(+), 15 deletions(-) diff --git a/display/res.c b/display/res.c index ba69dee..9872d6e 100644 --- a/display/res.c +

[Spice-devel] [PATCH qxl-win] display/res: substitute CursorCacheRemove false "break" with "return"

2011-06-20 Thread Alon Levy
From: Yonit Halperin --- display/res.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/display/res.c b/display/res.c index e821709..ba69dee 100644 --- a/display/res.c +++ b/display/res.c @@ -2887,7 +2887,7 @@ static void CursorCacheRemove(PDev *pdev, InternalCursor *cu

[Spice-devel] [PATCH qxl-win] display/*: s/FreeSurface/FreeSurfaceInfo/

2011-06-20 Thread Alon Levy
--- display/driver.c |2 +- display/res.c |2 +- display/surface.h |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/display/driver.c b/display/driver.c index 1ab9d41..7fbb0d8 100644 --- a/display/driver.c +++ b/display/driver.c @@ -1280,7 +1280,7 @@ HBITMAP AP

[Spice-devel] [PATCH qxl-win] display: add a few debug prints (level=3)

2011-06-20 Thread Alon Levy
--- display/driver.c |1 + display/res.c|3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/display/driver.c b/display/driver.c index 4e4e510..1ab9d41 100644 --- a/display/driver.c +++ b/display/driver.c @@ -1268,6 +1268,7 @@ HBITMAP APIENTRY DrvCreateDeviceBitmap(DH

[Spice-devel] [PATCH qxl-win] display/res: fix typo in debug print

2011-06-20 Thread Alon Levy
--- display/res.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/display/res.c b/display/res.c index 71e2b98..048adbb 100644 --- a/display/res.c +++ b/display/res.c @@ -671,7 +671,7 @@ QXLDrawable *Drawable(PDev *pdev, UINT8 type, RECTL *area, CLIPOBJ *clip, UINT32

[Spice-devel] [PATCH qxl-win] (mp+dd) whitespace cleanup

2011-06-20 Thread Alon Levy
--- display/driver.c |1 - display/res.c|3 ++- miniport/qxl.c |6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/display/driver.c b/display/driver.c index fa82945..4e4e510 100644 --- a/display/driver.c +++ b/display/driver.c @@ -695,7 +695,6 @@ static BOOL

[Spice-devel] [PATCH qxl-win] driver/res: add debugging prints of released resources types

2011-06-20 Thread Alon Levy
--- display/res.c | 87 + 1 files changed, 87 insertions(+), 0 deletions(-) diff --git a/display/res.c b/display/res.c index db4a671..b0e6208 100644 --- a/display/res.c +++ b/display/res.c @@ -19,6 +19,9 @@ MERCHANTABILITY or FITNESS F

[Spice-devel] [PATCH qxl-win] display/driver: DisableQXLPrimarySurface: add hide_mouse parameter (reused in DrvAssertModeDisable later)

2011-06-20 Thread Alon Levy
Cc: Yonit Halperin --- display/driver.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/display/driver.c b/display/driver.c index 602054e..fa82945 100644 --- a/display/driver.c +++ b/display/driver.c @@ -606,9 +606,11 @@ static VOID CreatePrimarySurface(PDev

[Spice-devel] [PATCH qxl-win] display/*: add debug helpers DUMP_VRAM_MSPACE and DUMP_DEVRAM_MSPACE

2011-06-20 Thread Alon Levy
changes the passed user pointer to mspace from NULL to a proper pdev, so it will be able to print using QXL_IO_LOG. --- display/qxldd.h | 25 + display/res.c | 14 -- display/res.h |1 + 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a

[Spice-devel] [PATCH qxl-win] display/driver: add DebugCountAliveSurfaces

2011-06-20 Thread Alon Levy
Disabled if no DBG, and uses loglevel == 1 --- display/driver.c | 31 +++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/display/driver.c b/display/driver.c index 118b545..602054e 100644 --- a/display/driver.c +++ b/display/driver.c @@ -529,11 +529,42

[Spice-devel] [PATCH qxl-win] display/{driver, surface}: use pdev in some DEBUG_PRINTs

2011-06-20 Thread Alon Levy
--- display/driver.c | 35 ++- display/surface.c |4 ++-- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/display/driver.c b/display/driver.c index 20d3699..118b545 100644 --- a/display/driver.c +++ b/display/driver.c @@ -533,7 +533,7 @@ VOID

[Spice-devel] [PATCH qxl-win] display/mspace: fix mspace_max_footprint and mspace_footprint

2011-06-20 Thread Alon Levy
--- display/mspace.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/display/mspace.c b/display/mspace.c index ec29fc6..d0ba123 100644 --- a/display/mspace.c +++ b/display/mspace.c @@ -2402,8 +2402,9 @@ size_t mspace_footprint(mspace msp) { mstate ms = (mstate)msp;

[Spice-devel] [PATCH qxl-win] miniport/qxl: raise loglevel for mode prints

2011-06-20 Thread Alon Levy
--- miniport/qxl.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/miniport/qxl.c b/miniport/qxl.c index a44f72c..412c4e7 100644 --- a/miniport/qxl.c +++ b/miniport/qxl.c @@ -424,7 +424,7 @@ VP_STATUS SetVideoModeInfo(QXLExtension *dev, PVIDEO_MODE_INFORMATION video_mo

[Spice-devel] [PATCH qxl-win] miniport/qxl: SetVideoModeInfo: pass QXLExtension for debug prints

2011-06-20 Thread Alon Levy
--- miniport/qxl.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/miniport/qxl.c b/miniport/qxl.c index a94b60b..a44f72c 100644 --- a/miniport/qxl.c +++ b/miniport/qxl.c @@ -416,11 +416,11 @@ VP_STATUS Prob(QXLExtension *dev, VIDEO_PORT_CONFIG_INFO *conf_info, }

[Spice-devel] [PATCH qxl-win] miniport/qxl: disable DBG zap of video ram on map

2011-06-20 Thread Alon Levy
--- miniport/qxl.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/miniport/qxl.c b/miniport/qxl.c index e3f8e17..a94b60b 100644 --- a/miniport/qxl.c +++ b/miniport/qxl.c @@ -984,11 +984,13 @@ BOOLEAN StartIO(PVOID dev_extension, PVIDEO_REQUEST_PACKET packet)

[Spice-devel] [PATCH qxl-win] miniport: pass dev as first parameter of DEBUG_PRINT instead of 0

2011-06-20 Thread Alon Levy
--- miniport/qxl.c | 182 1 files changed, 92 insertions(+), 90 deletions(-) diff --git a/miniport/qxl.c b/miniport/qxl.c index 344f19e..e3f8e17 100644 --- a/miniport/qxl.c +++ b/miniport/qxl.c @@ -139,7 +139,7 @@ ULONG DriverEntry(PVOID c

[Spice-devel] [PATCH qxl-win] miniport/qxl: add DebugZeroDeviceMemory and use in DBG for hibernate and

2011-06-20 Thread Alon Levy
We zero the memory explicitly for debugging purposes when going to sleep to ensure the return path doesn't rely on any initialization done before. SetPowerState slightly refactored in the process. --- miniport/qxl.c | 36 1 files changed, 32 insertions(+), 4

[Spice-devel] [PATCH qxl-win] miniport/qxl: implement SetPowerState:VideoPowerOn

2011-06-20 Thread Alon Levy
--- miniport/qxl.c | 13 +++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/miniport/qxl.c b/miniport/qxl.c index 6e9bd8e..37def2d 100644 --- a/miniport/qxl.c +++ b/miniport/qxl.c @@ -699,13 +699,20 @@ void HWReset(QXLExtension *dev_ext); #pragma alloc_text(PAGE, HWRe

[Spice-devel] [PATCH qxl-win] miniport/qxl: store vram_start on video memory map for later debug usage

2011-06-20 Thread Alon Levy
--- miniport/qxl.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/miniport/qxl.c b/miniport/qxl.c index 19c0033..6e9bd8e 100644 --- a/miniport/qxl.c +++ b/miniport/qxl.c @@ -77,6 +77,7 @@ typedef struct QXLExtension { PHYSICAL_ADDRESS vram_physical; ULONG vr

[Spice-devel] [PATCH qxl-win] cleanup before S3

2011-06-20 Thread Alon Levy
Included changes: debug helpers to dump mspace contents (main and vram bars) implmenetation of SetPowerState:VideoPowerOn (small - just main memslot+int_mask reset) a lot of debug prints use pdev instead of NULL (to allow log to show up on the host side via QXL_IO_LOG) some refactoring that

[Spice-devel] [PATCH qxl-win] miniport/*: use QXL_IO_LOG with internal snprintf

2011-06-20 Thread Alon Levy
snprintf is Copyright Patrick Powell 1995 (with more changes, see miniport/minimal_snprintf.c starting comment). Implements a DebugPrint similar to the one in display, using QXL_IO_LOG with the buffer on the pci devram bar at ram->log_buf, and log_level taken from there as well (set by qemu via

[Spice-devel] [PATCH 8/8] display/driver: DebugPrintV: check for pdev->Res before dereferencing it

2011-06-20 Thread Alon Levy
--- display/driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/display/driver.c b/display/driver.c index 47336de..20d3699 100644 --- a/display/driver.c +++ b/display/driver.c @@ -107,7 +107,7 @@ static CallCounterInfo counters_info[NUM_CALL_COUNTERS] = { void Deb

[Spice-devel] [PATCH 7/8] display/surface: CreateDeviceBitmap: remove redundant FreeSurface

2011-06-20 Thread Alon Levy
on error2 path, if we failed QXLGetSurface, we free the surface info but then the caller (DrvCreateDeviceBitmap) frees it again. In addition, we cannot free the SurfaceInfo since it is the handle given to GDI and is accessed on callback from EngDestroySurface (which is called immediatelly after in

[Spice-devel] [PATCH 6/8] treewide: staticfy some functions, small indentation fixes

2011-06-20 Thread Alon Levy
--- display/driver.c |6 +++--- display/res.c |8 display/surface.c |6 +++--- display/surface.h |4 miniport/qxl.c|4 ++-- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/display/driver.c b/display/driver.c index 9a4ccd3..47336de 100644

[Spice-devel] [PATCH 5/8] display/res: better error message for FreeMem assert

2011-06-20 Thread Alon Levy
--- display/res.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/display/res.c b/display/res.c index 1b8cf84..dd57491 100644 --- a/display/res.c +++ b/display/res.c @@ -344,8 +344,13 @@ static void *__AllocMem(PDev* pdev, UINT32 mspace_type, size_t size, BOOL for

[Spice-devel] [PATCH 4/8] display/driver: DebugPrint: check for log_level being set (allow using DebugPrint with pdev early)

2011-06-20 Thread Alon Levy
--- display/driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/display/driver.c b/display/driver.c index 182343d..9a4ccd3 100644 --- a/display/driver.c +++ b/display/driver.c @@ -123,7 +123,7 @@ void DebugPrint(PDev *pdev, int level, const char *message, ...) {

[Spice-devel] [PATCH 3/8] display/res: turn two asserts in CursorCacheRemove to debug prints

2011-06-20 Thread Alon Levy
In Free build this is defined out anyway, but in checked build this assert triggers, so change it to a debug print (pending investigation on why someone thought at some point it should never happen). The asserts were on: cursor->unique != 0 function end not reached --- display/res.c |7

[Spice-devel] [PATCH 2/8] display: fix broken debug in checked

2011-06-20 Thread Alon Levy
--- display/driver.c |5 + display/quic.c |4 display/res.c| 18 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/display/driver.c b/display/driver.c index dbe6978..182343d 100644 --- a/display/driver.c +++ b/display/driver.c @@ -1074,9 +1

[Spice-devel] [PATCH 1/8] display: use WAIT_FOR_EVENT everywhere

2011-06-20 Thread Alon Levy
--- display/driver.c |1 - display/res.c| 38 ++ 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/display/driver.c b/display/driver.c index b129f52..dbe6978 100644 --- a/display/driver.c +++ b/display/driver.c @@ -1377,4 +1377,3 @@ BOOL

[Spice-devel] [PATCH 0/8] cleanups and allow checked builds of qxl driver

2011-06-20 Thread Alon Levy
This is part 1 of 4 for the S3 support: 1. cleanup + checked build (this one) + FreeSurface bugfix (Yonit). 2. QXL_IO_LOG for miniport (seperated because it includes an snprintf implementation and so is large) 3. cleanup after QXL_IO_LOG (including helper debug routines) 4. S3 implmenetatio

[Spice-devel] [PATCH] server: fix segfault if no migrate_info provided

2011-06-20 Thread Alon Levy
qemu calls spice_server_migrate_switch even if it didn't do a spice_server_migrate_info first. Fix the resulting error by not pushing a switch host tag to the pipe in this case, and add a check anyway in the marshalling code just in case. --- server/reds.c | 11 +++ 1 files changed, 11 i