st/dri2: We are strictly a dri2 driver
authorJakob Bornecrantz <wallbraker@gmail.com>
Tue, 3 Mar 2009 23:31:35 +0000 (00:31 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Tue, 3 Mar 2009 23:31:35 +0000 (00:31 +0100)
src/gallium/state_trackers/dri2/dri_drawable.c
src/gallium/state_trackers/dri2/dri_screen.c

index 97778473b19ea5da1225c411ec5e3cf4afd07049..5c8f3ba86627485b692187d02d2be60521196560 100644 (file)
@@ -187,48 +187,16 @@ dri_get_buffers(__DRIdrawablePrivate *dPriv)
 void
 dri_swap_buffers(__DRIdrawablePrivate * dPriv)
 {
-   struct dri_drawable *drawable = dri_drawable(dPriv);
-   struct pipe_surface *back_surf;
-
-   assert(drawable);
-   assert(drawable->stfb);
-
-   st_get_framebuffer_surface(drawable->stfb,
-                              ST_SURFACE_BACK_LEFT,
-                              &back_surf);
-   if (back_surf) {
-      st_notify_swapbuffers(drawable->stfb);
-      /* TODO do stuff here */
-      st_notify_swapbuffers_complete(drawable->stfb);
-   }
+   /* not needed for dri2 */
+   assert(0);
 }
 
 
-/**
- * Called via glXCopySubBufferMESA() to copy a subrect of the back
- * buffer to the front buffer/screen.
- */
 void
 dri_copy_sub_buffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
 {
-   struct dri_drawable *drawable = dri_drawable(dPriv);
-   struct pipe_surface *back_surf;
-
-   assert(drawable);
-   assert(drawable->stfb);
-
-   st_get_framebuffer_surface(drawable->stfb,
-                              ST_SURFACE_BACK_LEFT,
-                              &back_surf);
-   if (back_surf) {
-      drm_clip_rect_t rect;
-      rect.x1 = x;
-      rect.y1 = y;
-      rect.x2 = w;
-      rect.y2 = h;
-
-      /* do stuff here */
-   }
+   /* not needed for dri2 */
+   assert(0);
 }
 
 
index ac3aee5015278d8573004f7bc2d7d1bf0281548f..57249a51118dc56b75f81d15e4f60e41a5da7df0 100644 (file)
@@ -183,6 +183,16 @@ dri_get_swap_info(__DRIdrawablePrivate * dPriv,
 }
 
 
+/**
+ * NULL stub for old dri loaders
+ */
+const __DRIconfig **
+dri_init_screen(__DRIscreenPrivate *sPriv)
+{
+   return NULL;
+}
+
+
 /**
  * This is the driver specific part of the createNewScreen entry point.
  *
@@ -240,19 +250,19 @@ dri_destroy_screen(__DRIscreenPrivate * sPriv)
 
 
 PUBLIC const struct __DriverAPIRec driDriverAPI = {
-   .InitScreen          = NULL,
+   .InitScreen          = dri_init_screen, /* not supported but exported */
    .DestroyScreen       = dri_destroy_screen,
    .CreateContext       = dri_create_context,
    .DestroyContext      = dri_destroy_context,
    .CreateBuffer        = dri_create_buffer,
    .DestroyBuffer       = dri_destroy_buffer,
-   .SwapBuffers         = dri_swap_buffers,
+   .SwapBuffers         = dri_swap_buffers, /* not supported but exported */
    .MakeCurrent         = dri_make_current,
    .UnbindContext       = dri_unbind_context,
    .GetSwapInfo         = dri_get_swap_info,
    .GetDrawableMSC      = driDrawableGetMSC32,
    .WaitForMSC          = driWaitForMSC32,
-   .CopySubBuffer       = dri_copy_sub_buffer,
+   .CopySubBuffer       = dri_copy_sub_buffer, /* not supported but exported */
    .InitScreen2         = dri_init_screen2,
 };