Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / gallium / state_trackers / dri / common / dri_screen.c
index a2bccefd6c593a6e97263e5b69d057c0cb41e8a8..252ad1768d80d89fc0b5140758711794764611fd 100644 (file)
@@ -33,9 +33,6 @@
 #include "xmlpool.h"
 
 #include "dri_screen.h"
-#include "dri_context.h"
-#include "dri_drawable.h"
-#include "dri1_helper.h"
 
 #include "util/u_inlines.h"
 #include "pipe/p_screen.h"
@@ -230,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));
 
@@ -289,17 +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 = dri_screen(ctx->sPriv);
+   struct dri_screen *screen = (struct dri_screen *)smapi;
    __DRIimage *img = NULL;
 
    if (screen->lookup_egl_image) {
-      img = screen->lookup_egl_image(ctx, egl_image);
+      img = screen->lookup_egl_image(screen, egl_image);
    }
 
    if (!img)
@@ -347,8 +341,6 @@ dri_destroy_option_cache(struct dri_screen * screen)
 void
 dri_destroy_screen_helper(struct dri_screen * screen)
 {
-   dri1_destroy_pipe_context(screen);
-
    if (screen->st_api && screen->st_api->destroy)
       screen->st_api->destroy(screen->st_api);
 
@@ -383,11 +375,16 @@ 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_gl_api_create();
 
+   screen->st_api = st_gl_api_create();
    if (!screen->st_api)
       return NULL;
 
+   if(pscreen->get_param(pscreen, PIPE_CAP_NPOT_TEXTURES))
+      screen->target = PIPE_TEXTURE_2D;
+   else
+      screen->target = PIPE_TEXTURE_RECT;
+
    driParseOptionInfo(&screen->optionCache,
                       __driConfigOptions, __driNConfigOptions);