summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-06-05 14:36:19 +0300
committerAlon Levy <alevy@redhat.com>2011-07-27 15:38:51 +0300
commit6b1774ec7a870527b8d36c7d6cf8a3c022972b75 (patch)
tree27a7b212947ef198905e1317751f43a15781596d
parent40adf8930c92c4389c46136130a84d89a1da7bce (diff)
display/*: add PDev->enabled
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.
-rw-r--r--display/driver.c5
-rw-r--r--display/qxldd.h10
-rw-r--r--display/rop.c12
3 files changed, 27 insertions, 0 deletions
diff --git a/display/driver.c b/display/driver.c
index 6b12540..54913b8 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -516,6 +516,7 @@ DHPDEV DrvEnablePDEV(DEVMODEW *dev_mode, PWSTR ignore1, ULONG ignore2, HSURF *ig
RtlCopyMemory(dev_caps, &gdi_info, dev_caps_size);
RtlCopyMemory(in_dev_info, &dev_info, dev_inf_size);
+ pdev->enabled = TRUE; /* assume no operations before a DrvEnablePDEV. */
DEBUG_PRINT((NULL, 1, "%s: 0x%lx\n", __FUNCTION__, pdev));
return(DHPDEV)pdev;
@@ -1173,6 +1174,8 @@ BOOL APIENTRY DrvStrokePath(SURFOBJ *surf, PATHOBJ *path, CLIPOBJ *clip, XFORMOB
return TRUE;
}
+ PUNT_IF_DISABLED(pdev);
+
CountCall(pdev, CALL_COUNTER_STROKE_PATH);
DEBUG_PRINT((pdev, 3, "%s\n", __FUNCTION__));
@@ -1265,6 +1268,8 @@ HBITMAP APIENTRY DrvCreateDeviceBitmap(DHPDEV dhpdev, SIZEL size, ULONG format)
return 0;
}
+ PUNT_IF_DISABLED(pdev);
+
surface_id = GetFreeSurface(pdev);
if (!surface_id) {
goto out_error;
diff --git a/display/qxldd.h b/display/qxldd.h
index c9c2300..9b613c1 100644
--- a/display/qxldd.h
+++ b/display/qxldd.h
@@ -61,6 +61,14 @@
EngDebugBreak(); \
}
+#define PUNT_IF_DISABLED(pdev) \
+ do { \
+ if (!pdev->enabled) { \
+ DEBUG_PRINT((pdev, 0, "%s: punting\n", __FUNCTION__)); \
+ return FALSE; \
+ } \
+ } while (0)
+
typedef enum {
QXL_SUCCESS,
QXL_FAILED,
@@ -345,6 +353,8 @@ typedef struct PDev {
UINT32 n_surfaces;
SurfaceInfo surface0_info;
+ UINT32 enabled; /* 1 between DrvAssertMode(TRUE) and DrvAssertMode(FALSE) */
+
UCHAR pci_revision;
} PDev;
diff --git a/display/rop.c b/display/rop.c
index dce6e44..9fb3527 100644
--- a/display/rop.c
+++ b/display/rop.c
@@ -1265,6 +1265,8 @@ BOOL APIENTRY DrvBitBlt(SURFOBJ *dest, SURFOBJ *src, SURFOBJ *mask, CLIPOBJ *cli
pdev = (PDev *)dest->dhpdev;
}
+ PUNT_IF_DISABLED(pdev);
+
CountCall(pdev, CALL_COUNTER_BIT_BLT);
DEBUG_PRINT((pdev, 3, "%s\n", __FUNCTION__));
@@ -1294,6 +1296,8 @@ BOOL APIENTRY DrvCopyBits(SURFOBJ *dest, SURFOBJ *src, CLIPOBJ *clip,
pdev = (PDev *)dest->dhpdev;
}
+ PUNT_IF_DISABLED(pdev);
+
CountCall(pdev, CALL_COUNTER_BIT_BLT);
DEBUG_PRINT((pdev, 3, "%s\n", __FUNCTION__));
@@ -1461,6 +1465,8 @@ BOOL APIENTRY DrvStretchBltROP(SURFOBJ *dest, SURFOBJ *src, SURFOBJ *mask, CLIPO
DEBUG_PRINT((pdev, 3, "%s\n", __FUNCTION__));
CountCall(pdev, CALL_COUNTER_STRETCH_BLT_ROP);
+ PUNT_IF_DISABLED(pdev);
+
if ((res = _StretchBlt(pdev, dest, src, mask, clip, color_trans,
mode == HALFTONE ? color_adjust: NULL, brush_pos,
dest_rect, src_rect, mask_pos, mode, brush,rop4))) {
@@ -1494,6 +1500,8 @@ BOOL APIENTRY DrvStretchBlt(SURFOBJ *dest, SURFOBJ *src, SURFOBJ *mask, CLIPOBJ
DEBUG_PRINT((pdev, 3, "%s\n", __FUNCTION__));
CountCall(pdev, CALL_COUNTER_STRETCH_BLT);
+ PUNT_IF_DISABLED(pdev);
+
if ((res = _StretchBlt(pdev, dest, src, mask, clip, color_trans,
mode == HALFTONE ? color_adjust: NULL, NULL, dest_rect,
src_rect, mask_pos, mode, NULL, (mask) ? 0xccaa: 0xcccc))) {
@@ -1590,6 +1598,8 @@ BOOL APIENTRY DrvAlphaBlend(SURFOBJ *dest, SURFOBJ *src, CLIPOBJ *clip, XLATEOBJ
pdev = (PDev *)dest->dhpdev;
DEBUG_PRINT((pdev, 3, "%s\n", __FUNCTION__));
+ PUNT_IF_DISABLED(pdev);
+
ASSERT(pdev, src_rect && src_rect->left < src_rect->right &&
src_rect->top < src_rect->bottom);
ASSERT(pdev, dest_rect && dest_rect->left < dest_rect->right &&
@@ -1688,6 +1698,8 @@ BOOL APIENTRY DrvTransparentBlt(SURFOBJ *dest, SURFOBJ *src, CLIPOBJ *clip, XLAT
DEBUG_PRINT((pdev, 3, "%s\n", __FUNCTION__));
+ PUNT_IF_DISABLED(pdev);
+
ASSERT(pdev, src_rect && src_rect->left < src_rect->right &&
src_rect->top < src_rect->bottom);
ASSERT(pdev, dest_rect && dest_rect->left < dest_rect->right &&