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

Alon Levy alevy at redhat.com
Thu Apr 7 09:10:39 PDT 2011


---
 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 +1074,12 @@ FIX FlotaToFixed(FLOATL val, FLOATL scale)
 static BOOL GetCosmeticAttr(PDev *pdev, QXLDrawable *drawable, QXLLineAttr *q_line_attr,
                             LINEATTRS *line_attr)
 {
+    // TODO - broken, undeclared identifier LINE_CAP_ROUND and the rest
+#if 0
     ASSERT(pdev, LINE_CAP_ROUND == ENDCAP_ROUND && LINE_CAP_SQUARE == ENDCAP_SQUARE &&
            LINE_CAP_BUTT == ENDCAP_BUTT && LINE_JOIN_ROUND == JOIN_ROUND &&
            LINE_JOIN_BEVEL == JOIN_BEVEL && LINE_JOIN_MITER == JOIN_MITER);
+#endif
 
     q_line_attr->join_style = JOIN_MITER;
     q_line_attr->end_style = ENDCAP_BUTT;
@@ -1089,8 +1092,10 @@ static BOOL GetCosmeticAttr(PDev *pdev, QXLDrawable *drawable, QXLLineAttr *q_li
         FIX *end;
         UINT32 nseg;
 
+#if 0
         ASSERT(pdev, LA_STYLED == LINE_STYLED);
         ASSERT(pdev, LA_STARTGAP == LINE_START_WITH_GAP);
+#endif
         q_line_attr->flags = (UINT8)(line_attr->fl & (LA_STYLED | LA_STARTGAP));
         nseg = (line_attr->fl & LA_ALTERNATE) ? 2 : line_attr->cstyle;
         if ( nseg > 100) {
diff --git a/display/quic.c b/display/quic.c
index 2c23d9a..5dc66d4 100644
--- a/display/quic.c
+++ b/display/quic.c
@@ -63,6 +63,10 @@
 
 #define ABS(a) ((a) >= 0 ? (a) : -(a))
 
+#ifdef ASSERT
+#undef ASSERT
+#endif
+
 #ifdef DEBUG
 
 #define ASSERT(usr, x) \
diff --git a/display/res.c b/display/res.c
index 21047c0..5dc6e10 100644
--- a/display/res.c
+++ b/display/res.c
@@ -174,13 +174,13 @@ static void WaitForCursorRing(PDev* pdev)
         {
             LARGE_INTEGER timeout; // 1 => 100 nanoseconds
             timeout.QuadPart = -1 * (1000 * 1000 * 10); //negative  => relative // 1s
-            WAIT_FOR_EVENT(pdev->cursor_event, &timeout);
+            WAIT_FOR_EVENT(pdev, pdev->cursor_event, &timeout);
             if (SPICE_RING_IS_FULL(pdev->cursor_ring)) {
                 DEBUG_PRINT((pdev, 0, "%s: 0x%lx: timeout\n", __FUNCTION__, pdev));
             }
         }
 #else
-        WAIT_FOR_EVENT(pdev->cursor_event, NULL);
+        WAIT_FOR_EVENT(pdev, pdev->cursor_event, NULL);
 #endif //DBG
     }
 }
@@ -202,13 +202,13 @@ static void WaitForCmdRing(PDev* pdev)
         {
             LARGE_INTEGER timeout; // 1 => 100 nanoseconds
             timeout.QuadPart = -1 * (1000 * 1000 * 10); //negative  => relative // 1s
-            WAIT_FOR_EVENT(pdev->display_event, &timeout);
+            WAIT_FOR_EVENT(pdev, pdev->display_event, &timeout);
             if (SPICE_RING_IS_FULL(pdev->cmd_ring)) {
                 DEBUG_PRINT((pdev, 0, "%s: 0x%lx: timeout\n", __FUNCTION__, pdev));
             }
         }
 #else
-        WAIT_FOR_EVENT(pdev->display_event, NULL);
+        WAIT_FOR_EVENT(pdev, pdev->display_event, NULL);
 #endif //DBG
     }
 }
@@ -627,7 +627,7 @@ QXLSurfaceCmd *SurfaceCmd(PDev *pdev, UINT8 type, UINT32 surface_id)
 {
     QXLSurfaceCmd *surface_cmd;
 
-    ASSERT(pdev, pdev && area);
+    ASSERT(pdev, pdev);
 
     surface_cmd = GetSurfaceCmd(pdev);
     surface_cmd->surface_id = surface_id;
@@ -2141,7 +2141,7 @@ BOOL QXLGetBitmap(PDev *pdev, QXLDrawable *drawable, QXLPHYSICAL *image_phys, SU
         alloc_size = sizeof(Resource) + sizeof(InternalImage);
         image_res = AllocMem(pdev, MSPACE_TYPE_DEVRAM, alloc_size);
 
-        ONDBG(pdev->num_bits_pages++);
+        ONDBG(pdev->Res->num_bits_pages++);
         image_res->refs = 1;
         image_res->free = FreeSurfaceImage;
 
@@ -2307,7 +2307,7 @@ BOOL QXLGetAlphaBitmap(PDev *pdev, QXLDrawable *drawable, QXLPHYSICAL *image_phy
         alloc_size = sizeof(Resource) + sizeof(InternalImage);
         image_res = AllocMem(pdev, MSPACE_TYPE_DEVRAM, alloc_size);
 
-        ONDBG(pdev->num_bits_pages++);
+        ONDBG(pdev->Res->num_bits_pages++);
         image_res->refs = 1;
         image_res->free = FreeSurfaceImage;
 
@@ -2512,13 +2512,13 @@ void UpdateArea(PDev *pdev, RECTL *area, UINT32 surface_id)
         {
             LARGE_INTEGER timeout; // 1 => 100 nanoseconds
             timeout.QuadPart = -1 * (1000 * 1000 * 10); //negative  => relative // 1s
-            WAIT_FOR_EVENT(pdev->display_event, &timeout);
+            WAIT_FOR_EVENT(pdev, pdev->display_event, &timeout);
             if (*pdev->dev_update_id != pdev->Res->update_id) {
                 DEBUG_PRINT((pdev, 0, "%s: 0x%lx: timeout\n", __FUNCTION__, pdev));
             }
         }
 #else
-        WAIT_FOR_EVENT(pdev->display_event, NULL);
+        WAIT_FOR_EVENT(pdev, pdev->display_event, NULL);
 #endif // DEBUG
         mb();
     } while (*pdev->dev_update_id != pdev->Res->update_id);
-- 
1.7.4.2



More information about the Spice-devel mailing list