st/dri: add drisw
[mesa.git] / src / gallium / state_trackers / dri / dri_screen.h
index 75a0ee4250e89a7f6df1768272b8df4fb07d42f9..4f59db37cfa35655d59ddc7ef748e7b55f4d1a37 100644 (file)
 #ifndef DRI_SCREEN_H
 #define DRI_SCREEN_H
 
-#include "dri_util.h"
+#include "dri_wrapper.h"
 #include "xmlconfig.h"
 
 #include "pipe/p_compiler.h"
-
-#include "state_tracker/dri1_api.h"
+#include "pipe/p_context.h"
+#include "pipe/p_state.h"
+#include "state_tracker/st_api.h"
 
 struct dri_screen
 {
@@ -60,6 +61,11 @@ struct dri_screen
    boolean d_depth_bits_last;
    boolean sd_depth_bits_last;
    boolean auto_fake_front;
+
+   struct st_manager *smapi;
+
+   /* used only by DRI1 */
+   struct pipe_context *dri1_pipe;
 };
 
 /** cast wrapper */
@@ -69,11 +75,39 @@ dri_screen(__DRIscreen * sPriv)
    return (struct dri_screen *)sPriv->private;
 }
 
-/***********************************************************************
- * dri_screen.c
- */
+#ifndef __NOT_HAVE_DRM_H
+
+static INLINE boolean
+dri_with_format(__DRIscreen * sPriv)
+{
+   const __DRIdri2LoaderExtension *loader = sPriv->dri2.loader;
+
+   return loader
+       && (loader->base.version >= 3)
+       && (loader->getBuffersWithFormat != NULL);
+}
+
+#else
+
+static INLINE boolean
+dri_with_format(__DRIscreen * sPriv)
+{
+   return TRUE;
+}
+
+#endif
+
+extern const uint __driNConfigOptions;
+
+const __DRIconfig **
+dri_fill_in_modes(struct dri_screen *screen, unsigned pixel_bits);
+
+void
+dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
+                   const __GLcontextModes *mode);
 
-extern struct dri1_api *__dri1_api_hooks;
+void
+dri_destroy_screen(__DRIscreen * sPriv);
 
 #endif