wsi_x11: add xcb_window_t to xglWsiX11GetMSC()
authorChia-I Wu <olv@lunarg.com>
Fri, 7 Nov 2014 05:33:45 +0000 (13:33 +0800)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Fri, 21 Nov 2014 23:49:39 +0000 (16:49 -0700)
To match XGL_WSI_X11_PRESENT_INFO and allow xcb_crtc_id to be XCB_NONE.

include/xglLayer.h
include/xglWsiX11Ext.h
layers/api_dump.c
layers/draw_state.c
layers/object_track.c
xgl.py

index 3295c8d..72fcb15 100644 (file)
@@ -132,7 +132,7 @@ typedef XGL_RESULT (XGLAPI *DbgSetDeviceOptionType)(XGL_DEVICE device, XGL_DBG_D
 typedef XGL_VOID (XGLAPI *CmdDbgMarkerBeginType)(XGL_CMD_BUFFER cmdBuffer, const XGL_CHAR* pMarker);
 typedef XGL_VOID (XGLAPI *CmdDbgMarkerEndType)(XGL_CMD_BUFFER cmdBuffer);
 typedef XGL_RESULT (XGLAPI *WsiX11AssociateConnectionType)(XGL_PHYSICAL_GPU gpu, const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo);
-typedef XGL_RESULT (XGLAPI *WsiX11GetMSCType)(XGL_DEVICE device, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc);
+typedef XGL_RESULT (XGLAPI *WsiX11GetMSCType)(XGL_DEVICE device, xcb_window_t window, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc);
 typedef XGL_RESULT (XGLAPI *WsiX11CreatePresentableImageType)(XGL_DEVICE device, const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem);
 typedef XGL_RESULT (XGLAPI *WsiX11QueuePresentType)(XGL_QUEUE queue, const XGL_WSI_X11_PRESENT_INFO* pPresentInfo, XGL_FENCE fence);
 
index 9f32553..365a765 100644 (file)
@@ -52,6 +52,9 @@ typedef struct _XGL_WSI_X11_PRESENT_INFO
      * xglWsiX11GetMSC(), potentially a round-trip to the server, to get the
      * current MSC first), or set \p target_msc to zero and set a "swap
      * interval".
+     *
+     * \p crtc can be XCB_NONE.  In that case, a suitable CRTC is picked based
+     * on \p destWindow.
      */
     xcb_randr_crtc_t crtc;
     XGL_UINT64 target_msc;
@@ -95,10 +98,12 @@ XGL_RESULT XGLAPI xglWsiX11AssociateConnection(
 
 /**
  * Return the current MSC (Media Stream Counter, incremented for each vblank)
- * of the CRTC.
+ * of \p crtc.  If crtc is \p XCB_NONE, a suitable CRTC is picked based on \p
+ * win.
  */
 XGL_RESULT XGLAPI xglWsiX11GetMSC(
     XGL_DEVICE                                  device,
+    xcb_window_t                                window,
     xcb_randr_crtc_t                            crtc,
     XGL_UINT64*                                 pMsc);
 
index b1783f3..ef6ea30 100644 (file)
@@ -1326,10 +1326,10 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11AssociateConnection(XGL_PHYSICAL_GPU
     return result;
 }
 
-XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11GetMSC(XGL_DEVICE device, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc)
+XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11GetMSC(XGL_DEVICE device, xcb_window_t window, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc)
 {
-    XGL_RESULT result = nextTable.WsiX11GetMSC(device, crtc, pMsc);
-    printf("xglWsiX11GetMSC(device = %p, crtc = %i, pMsc = %lu) = %s\n", (void*)device, crtc, *pMsc, string_XGL_RESULT(result));
+    XGL_RESULT result = nextTable.WsiX11GetMSC(device, window, crtc, pMsc);
+    printf("xglWsiX11GetMSC(device = %p, window = %i, crtc = %i, pMsc = %lu) = %s\n", (void*)device, window, crtc, *pMsc, string_XGL_RESULT(result));
     return result;
 }
 
index 773d5d5..89f0f04 100644 (file)
@@ -1472,9 +1472,9 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11AssociateConnection(XGL_PHYSICAL_GPU
     return result;
 }
 
-XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11GetMSC(XGL_DEVICE device, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc)
+XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11GetMSC(XGL_DEVICE device, xcb_window_t window, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc)
 {
-    XGL_RESULT result = nextTable.WsiX11GetMSC(device, crtc, pMsc);
+    XGL_RESULT result = nextTable.WsiX11GetMSC(device, window, crtc, pMsc);
     return result;
 }
 
index 3593f9b..07b617d 100644 (file)
@@ -1286,11 +1286,11 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11AssociateConnection(XGL_PHYSICAL_GPU
     return result;
 }
 
-XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11GetMSC(XGL_DEVICE device, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc)
+XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglWsiX11GetMSC(XGL_DEVICE device, xcb_window_t window, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc)
 {
     ll_increment_use_count((XGL_VOID*)device);
     printf("OBJ[%llu] : USING device object %p (%lu total uses)\n", object_track_index++, (void*)device, ll_get_obj_uses((XGL_VOID*)device));
-    XGL_RESULT result = nextTable.WsiX11GetMSC(device, crtc, pMsc);
+    XGL_RESULT result = nextTable.WsiX11GetMSC(device, window, crtc, pMsc);
     return result;
 }
 
diff --git a/xgl.py b/xgl.py
index 857eea7..3f4f90f 100644 (file)
--- a/xgl.py
+++ b/xgl.py
@@ -716,6 +716,7 @@ ext_wsi_x11 = (
 
     Proto("XGL_RESULT", "WsiX11GetMSC",
         (Param("XGL_DEVICE", "device"),
+         Param("xcb_window_t", "window"),
          Param("xcb_randr_crtc_t", "crtc"),
          Param("XGL_UINT64*", "pMsc"))),