summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-04-14 17:05:22 +0300
committerAlon Levy <alevy@redhat.com>2011-04-14 17:05:22 +0300
commit7d04c010a13159de38e25a07802e113c19ff8505 (patch)
tree40e9caa1a133f11d829c6e2a22c44722ee319197
parent9f8931e5c34f27138c815ce1b7ce69c8f6d7c324 (diff)
DrvAssertMode: change for S3
-rw-r--r--display/driver.c21
-rw-r--r--display/qxldd.h2
-rw-r--r--display/res.c1
3 files changed, 21 insertions, 3 deletions
diff --git a/display/driver.c b/display/driver.c
index ae38e95..969a9b9 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -912,18 +912,33 @@ VOID DrvDisableSurface(DHPDEV in_pdev)
BOOL DrvAssertMode(DHPDEV in_pdev, BOOL enable)
{
+ ULONG n;
PDev* pdev = (PDev*)in_pdev;
- DEBUG_PRINT((NULL, 1, "%s: 0x%lx\n", __FUNCTION__, pdev));
+ DEBUG_PRINT((pdev, 1, "%s: 0x%lx %d (old assert_mode = %d)\n",
+ __FUNCTION__, pdev, enable, pdev->assert_mode));
+ if (pdev->assert_mode == enable) {
+ return TRUE;
+ }
+ pdev->assert_mode = enable;
if (enable) {
InitResources(pdev);
- EnableQXLPrimarySurface(pdev);
+ if (EngDeviceIoControl(pdev->driver, IOCTL_QXL_CREATE_MAIN_MEMSLOT, NULL, 0, NULL, 0, &n)) {
+ DEBUG_PRINT((pdev, 0, "%s: create main slot failed\n", __FUNCTION__));
+ return FALSE;
+ }
CreateVRamSlot(pdev);
+ EnableQXLPrimarySurface(pdev);
+ ResendSurfaceCreateCommands(pdev);
} else {
+ DrvSynchronize((DHPDEV)pdev, NULL);
+ FlushCmdRing(pdev);
+ // WaitForCmdRing? but DrvSynchronize->UpdateArea->WaitForCmdRing just before (which should
+ // be good enough to make sure no commands are waiting. Or what does WaitForCmdRing do anyway?
DisableQXLPrimarySurface(pdev);
RemoveVRamSlot(pdev);
}
- DEBUG_PRINT((NULL, 1, "%s: 0x%lx exit TRUE\n", __FUNCTION__, pdev));
+ DEBUG_PRINT((pdev, 1, "%s: 0x%lx exit %d\n", __FUNCTION__, pdev, enable));
return TRUE;
}
diff --git a/display/qxldd.h b/display/qxldd.h
index 7130b47..6b74ae6 100644
--- a/display/qxldd.h
+++ b/display/qxldd.h
@@ -332,6 +332,8 @@ typedef struct PDev {
UINT32 n_surfaces;
SurfaceInfo surface0_info;
+
+ BOOL assert_mode; /* set by DrvAssertMode */
} PDev;
diff --git a/display/res.c b/display/res.c
index 429a518..a2e475f 100644
--- a/display/res.c
+++ b/display/res.c
@@ -542,6 +542,7 @@ void InitResources(PDev *pdev)
EngAcquireSemaphore(res_sem);
+ pdev->assert_mode = TRUE;
id = pdev->dev_id;
if (id >= num_global_res) {
new_global_res = EngAllocMem(FL_ZERO_MEMORY, (id + 1) * sizeof(DevRes *), ALLOC_TAG);