summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-06-20display/driver: reimplement DrvAssertMode for Suspend+Hibernate (S3+S4) supports3.v1Alon Levy2-7/+61
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 involves two pdevs, so actually the enable call is not called, only: DrvAssertMode(PDEV#1, FALSE) DrvEnableSurface(PDEV#2) EnableSurface creates a primary surface, so the call to AssertMode must destroy it. This fails on suspend for many reasons, one of them being that we don't disable operations to any driver managed off screen surfaces, and the other is that after the qxl reset done via acpi S3 request by windows, we don't reinitialize the primary memslot (this is fixed by a previous commit). The correct (per example drivers from WinDDK, and per msdn) thing to do in DrvAssertMode is to not do any further interaction with the device. The simplest way to achieve that is to fail any operation. The GDI is designed such that it can work completely without any driver, so for any operation there is a fallback in case the driver returns a failure error code. A simplification is to use EngModifySurface to move a surface to GDI control and so not to get any further callback on it (except for the deletion callback when it is deleted). This is also done in the 3dlabs example driver. There is zero synchronization between the miniport, which knows about the power state, and the displayport, which knows about the pci device structure, command rings, resources. As a result the easiest and also consistent with the above requirements implementation for suspend to ram and to disk is to reset any server side state during DrvAssertMode(FALSE), copying all volatile (surface contents only atm) memory to guest ram (from there windows will copy it to disk for us if we are hibernating). So the new flow for DriveAssertMode is then: AssertModeDisable: 1. set pdev->enable to False (all further operations will be punted) 2. tell server to prepare for sleep, via new QXL_IO_UPDATE_MEM(QXL_UPDATE_MEM_RENDER_ALL): server updates all surfaces server destroys all surfaces. Since we never sent it a destroy command this doesn't trigger any guest side surface destruction, only a release of the creation command resources. 3. release anything in the release ring. 4. tell server to write it's current releasable items list (qxl->last_release) to the release_ring (we just made sure the release_ring is empty, and since we are not sending anything new to the worker and we already had it render anything outstanding it will not fill it) release the last resources (at this point there is nothing allocated on devram and vram - we verify that in debug mode with DUMP_MSPACE_VRAM and DUMP_MSPACE_DEVRAM). 5. Destroy primary surface 6. Delete vram memslot AssertModeEnable: 1. Create primary surface 2. create vram memslot 3. copy surfaces from ram to vram, sending create commands which cause both create and surface image commands to be sent to the client. In suspend there is a single PDEV involved which does exactly those two calls, disable before sleep and enable after. For resolution change this work is excessive but correct. Since miniport:SetPowerState is called after DrvAssertMode during suspend (actually there is no defined order in the documentation), there is no way to distinguish between the two anyway. Cc: Yonit Halperin <yhalperi@redhat.com>
2011-06-20miniport+display: export UPDATE_MEM port for use by AssertModeEnableAlon Levy4-0/+4
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.
2011-06-20display/*: add PDev->enabledAlon Levy3-0/+27
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 PDev->enabled to FALSE on DrvAssertMode.
2011-06-20display/surface: add surfaces from/to ramAlon Levy4-18/+208
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 surfaces completely managed by gdi and not us. MoveAllSurfacesToRam recreates surfaces on vram and calls EngModifySurface with QXL_SURFACE_HOOKS, and finally sends a QXL_SURFACE_CMD_CREATE with the valid data flag to make the server send a surface image message after the surface create message. Cc: Yonit Halperin <yhalperi@redhat.com>
2011-06-20display/surface: add DEVICE_BITMAP_ALLOCATION_TYPE_RAM, cleanup surface ↵Alon Levy4-21/+43
alloc/free code paths 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 just punt the allocation to the gdi, but the code is still left in GetSurfaceMemory. Cc: Yonit Halperin <yhalperi@redhat.com>
2011-06-20display/surface: FreeSurfaceInfo: ignore double freesAlon Levy1-1/+7
Cc: Yonit Halperin <yhalperi@redhat.com>
2011-06-20display/surface: GetSurfaceId: return -1 if \!surf->dhsurfAlon Levy1-0/+3
Cc: Yonit Halperin <yhalperi@redhat.com>
2011-06-20display/surface: add QXL_SURFACE_HOOKS defineAlon Levy2-8/+16
Cc: Yonit Halperin <yhalperi@redhat.com>
2011-06-20display/res: add a debug print level 9Alon Levy1-0/+2
2011-06-20display/res: __AllocMem: verbose debugging (log_level 12)Alon Levy1-2/+9
Cc: Yonit Halperin <yhalperi@redhat.com>
2011-06-20display/res: add helpers for clearing device memoryAlon Levy2-22/+86
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 anything on the device memory (devram and vram pci bars). ReleaseCacheDeviceMemoryResources - helper for clearing the cache (which points to devram QXLImage's) Cc: Yonit Halperin <yhalperi@redhat.com>
2011-06-20display/res: make (Cursor|Palette)CacheRemove always release the objectYonit Halperin1-15/+30
even if it is not found in the cache (which is an error)
2011-06-20display/res: substitute CursorCacheRemove false "break" with "return"Yonit Halperin1-1/+1
2011-06-20display/*: s/FreeSurface/FreeSurfaceInfo/Alon Levy3-3/+3
2011-06-20display: add a few debug prints (level=3)Alon Levy2-0/+4
2011-06-20display/res: fix typo in debug printAlon Levy1-1/+1
2011-06-20(mp+dd) whitespace cleanupAlon Levy3-5/+5
2011-06-20driver/res: add debugging prints of released resources typesAlon Levy1-0/+87
2011-06-20display/driver: DisableQXLPrimarySurface: add hide_mouse parameter (reused ↵Alon Levy1-7/+8
in DrvAssertModeDisable later) Cc: Yonit Halperin <yhalperi@redhat.com>
2011-06-20display/*: add debug helpers DUMP_VRAM_MSPACE and DUMP_DEVRAM_MSPACEAlon Levy3-6/+34
changes the passed user pointer to mspace from NULL to a proper pdev, so it will be able to print using QXL_IO_LOG.
2011-06-20display/driver: add DebugCountAliveSurfacesAlon Levy1-0/+31
Disabled if no DBG, and uses loglevel == 1
2011-06-20display/{driver,surface}: use pdev in some DEBUG_PRINTsAlon Levy2-19/+20
2011-06-20display/mspace: fix mspace_max_footprint and mspace_footprintAlon Levy1-2/+4
2011-06-20miniport/qxl: raise loglevel for mode printsAlon Levy1-2/+2
2011-06-20miniport/qxl: SetVideoModeInfo: pass QXLExtension for debug printsAlon Levy1-3/+3
2011-06-20miniport/qxl: disable DBG zap of video ram on mapAlon Levy1-0/+2
2011-06-20miniport: pass dev as first parameter of DEBUG_PRINT instead of 0Alon Levy1-90/+92
2011-06-20miniport/qxl: add DebugZeroDeviceMemory and use in DBG for hibernate andAlon Levy1-4/+32
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.
2011-06-20miniport/qxl: implement SetPowerState:VideoPowerOnAlon Levy1-2/+11
2011-06-20miniport/qxl: store vram_start on video memory map for later debug usageAlon Levy1-0/+3
2011-06-20miniport/*: use QXL_IO_LOG with internal snprintfAlon Levy5-7/+762
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 guestdebug parameter to the qxl device). Allows for easier debugging of the miniport. Compiled out for release (free) builds where DBG is not defined.
2011-06-20display/driver: DebugPrintV: check for pdev->Res before dereferencing itAlon Levy1-1/+1
2011-06-20display/surface: CreateDeviceBitmap: remove redundant FreeSurfaceAlon Levy1-1/+0
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 the same error path).
2011-06-20treewide: staticfy some functions, small indentation fixesAlon Levy5-16/+12
2011-06-17display/res: better error message for FreeMem assertAlon Levy1-2/+7
2011-04-19display/driver: DebugPrint: check for log_level being set (allow using ↵Alon Levy1-1/+1
DebugPrint with pdev early)
2011-04-19display/res: turn two asserts in CursorCacheRemove to debug printsAlon Levy1-2/+5
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
2011-04-19display: fix broken debug in checkedAlon Levy3-9/+18
2011-04-19display: use WAIT_FOR_EVENT everywhereAlon Levy2-33/+6
2011-04-07display/res: fix ie9 renderingAlon Levy1-6/+2
Internet Explorer 9 renders cursors and other things by reusing the same SURFOBJ (i.e. surfobj->iUniq is constant) but changing the pallete. We were wrongly ignoring the pallette's iUniq because the XO_TABLE flag was not set. That flag should not be checked when calculating the key for our cache. When that flag is ignored we correctly calculate a key that uses both the surf->iUniq and the colortrans->iUniq together (64 bit from two 32 bit values).
2011-03-24sync miniport and driver versionsAlon Levy2-4/+4
The version of the miniport was 1.3.0.0 while the driver had 1.4.1.1 Different versions between them lead to confusion, better to sync them.
2011-03-24driver: allowed modes: remove limit of 480 <= {X,Y} <= 2000Alon Levy2-5/+3
Later todo is to check that there is available video memory for this, but that requires either access to PDev or probably dynamically checking anyway to make sure we actually fit. Another option is to leave that check in the host (when we do a IO_SETMODE) Bumping version to 1.4.1.1 Tested with winxp 32 bit only.
2011-02-02spice: windows qxl drivers: support x64 buildHEADmasterArnon Gilboa13-73/+101
-fix types & casts for correctness in x64 -add #ifndef _WIN64 for all the SSE2/FPU/fast_memcpy stuff -miniport/makefile: remove IFNDEF AMD64 to enable x64 build -miniport/qxl.inf: add x64 support
2010-09-29Bump version to 1.4.1.0 for 0.6.1 release0.6.1Alexander Larsson2-3/+3
2010-09-20Protect palette cache agains concurrent accessAlexander Larsson2-0/+15
2010-09-20Protect cursor cache against concurrent accessAlexander Larsson2-1/+18
2010-09-20Protect image cache from concurrent accessAlexander Larsson2-10/+45
2010-09-20Fix typos Chach -> CacheAlexander Larsson1-6/+6
2010-09-20Prepend QXL to public function CheckIfCacheImageAlexander Larsson3-3/+3
2010-09-20Make internal functions staticAlexander Larsson1-2/+2