Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / gallium / state_trackers / dri / common / dri_screen.c
index 9d13d0d52e13a46db516e382f59e503e95af17aa..252ad1768d80d89fc0b5140758711794764611fd 100644 (file)
@@ -33,7 +33,6 @@
 #include "xmlpool.h"
 
 #include "dri_screen.h"
-#include "dri_context.h"
 
 #include "util/u_inlines.h"
 #include "pipe/p_screen.h"
@@ -228,7 +227,7 @@ dri_fill_in_modes(struct dri_screen *screen,
  */
 void
 dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
-                   const __GLcontextModes *mode)
+                   const struct gl_config *mode)
 {
    memset(stvis, 0, sizeof(*stvis));
 
@@ -287,16 +286,14 @@ dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
 
 static boolean
 dri_get_egl_image(struct st_manager *smapi,
-                  struct st_context_iface *stctxi,
                   void *egl_image,
                   struct st_egl_image *stimg)
 {
-   struct dri_context *ctx =
-      (struct dri_context *)stctxi->st_manager_private;
+   struct dri_screen *screen = (struct dri_screen *)smapi;
    __DRIimage *img = NULL;
 
-   if (ctx->lookup_egl_image) {
-      img = ctx->lookup_egl_image(ctx, egl_image);
+   if (screen->lookup_egl_image) {
+      img = screen->lookup_egl_image(screen, egl_image);
    }
 
    if (!img)
@@ -344,12 +341,8 @@ dri_destroy_option_cache(struct dri_screen * screen)
 void
 dri_destroy_screen_helper(struct dri_screen * screen)
 {
-   int i;
-
-   for (i = 0; i < ST_API_COUNT; i++) {
-      if (screen->st_api[i] && screen->st_api[i]->destroy)
-         screen->st_api[i]->destroy(screen->st_api[i]);
-   }
+   if (screen->st_api && screen->st_api->destroy)
+      screen->st_api->destroy(screen->st_api);
 
    if (screen->base.screen)
       screen->base.screen->destroy(screen->base.screen);
@@ -383,14 +376,8 @@ dri_init_screen_helper(struct dri_screen *screen,
    screen->base.get_egl_image = dri_get_egl_image;
    screen->base.get_param = dri_get_param;
 
-   screen->st_api[ST_API_OPENGL] = st_gl_api_create();
-   screen->st_api[ST_API_OPENGL_ES1] = st_gl_api_create_es1();
-   screen->st_api[ST_API_OPENGL_ES2] = st_gl_api_create_es2();
-   /* no ST_API_OPENVG */
-
-   if (!screen->st_api[ST_API_OPENGL] &&
-       !screen->st_api[ST_API_OPENGL_ES1] &&
-       !screen->st_api[ST_API_OPENGL_ES2])
+   screen->st_api = st_gl_api_create();
+   if (!screen->st_api)
       return NULL;
 
    if(pscreen->get_param(pscreen, PIPE_CAP_NPOT_TEXTURES))