i965g: hook up brw_screen.c
authorKeith Whitwell <keithw@vmware.com>
Wed, 4 Nov 2009 13:54:44 +0000 (13:54 +0000)
committerKeith Whitwell <keithw@vmware.com>
Wed, 4 Nov 2009 13:54:44 +0000 (13:54 +0000)
src/gallium/drivers/i965/Makefile
src/gallium/drivers/i965/brw_reg.h
src/gallium/drivers/i965/brw_screen.c

index 48950544c9adddfcf2751f9b343302bfa057e515..94b52bf0ec419e26dd85d8dad6f2349efcaa558b 100644 (file)
@@ -57,6 +57,7 @@ C_SOURCES = \
        brw_wm_sampler_state.c \
        brw_wm_state.c \
        brw_wm_surface_state.c \
+       brw_screen.c \
        brw_screen_tex_layout.c \
        brw_screen_texture.c \
        brw_screen_surface.c \
index f428ec92696ad1fd55c3b47d4f9ef8711895f38c..a63403b6afd6540c7fef6ba6182d70d0da0a11df 100644 (file)
 #define PCI_CHIP_ILM_G                  0x0046
 
 struct brw_chipset {
-   int pci_id:16;
-   int is_965:1;
-   int is_igdng:1;
-   int is_g4x:1;
-   int pad:13;
+   unsigned pci_id:16;
+   unsigned is_965:1;
+   unsigned is_igdng:1;
+   unsigned is_g4x:1;
+   unsigned pad:13;
 };
 
 
index 671467989deb7cb776566470aeb51ba71ec402fe..a02e6acc3905f8773bc7f1edde913efe51f54f5a 100644 (file)
@@ -33,9 +33,8 @@
 #include "brw_reg.h"
 #include "brw_context.h"
 #include "brw_screen.h"
-#include "brw_buffer.h"
-#include "brw_texture.h"
 #include "brw_winsys.h"
+#include "brw_debug.h"
 
 #ifdef DEBUG
 static const struct debug_named_value debug_names[] = {
@@ -49,18 +48,13 @@ static const struct debug_named_value debug_names[] = {
    { "bat",   DEBUG_BATCH},
    { "pix",   DEBUG_PIXEL},
    { "buf",   DEBUG_BUFMGR},
-   { "reg",   DEBUG_REGION},
-   { "fbo",   DEBUG_FBO},
-   { "lock",  DEBUG_LOCK},
    { "sync",  DEBUG_SYNC},
    { "prim",  DEBUG_PRIMS },
    { "vert",  DEBUG_VERTS },
-   { "dri",   DEBUG_DRI },
    { "dma",   DEBUG_DMA },
    { "san",   DEBUG_SANITY },
    { "sleep", DEBUG_SLEEP },
    { "stats", DEBUG_STATS },
-   { "tile",  DEBUG_TILE },
    { "sing",  DEBUG_SINGLE_THREAD },
    { "thre",  DEBUG_SINGLE_THREAD },
    { "wm",    DEBUG_WM },
@@ -90,7 +84,7 @@ brw_get_name(struct pipe_screen *screen)
    static char buffer[128];
    const char *chipset;
 
-   switch (brw_screen(screen)->pci_id) {
+   switch (brw_screen(screen)->chipset.pci_id) {
    case PCI_CHIP_I965_G:
       chipset = "I965_G";
       break;
@@ -250,9 +244,6 @@ brw_fence_reference(struct pipe_screen *screen,
                      struct pipe_fence_handle **ptr,
                      struct pipe_fence_handle *fence)
 {
-   struct brw_screen *is = brw_screen(screen);
-
-   is->iws->fence_reference(is->iws, ptr, fence);
 }
 
 static int
@@ -260,19 +251,15 @@ brw_fence_signalled(struct pipe_screen *screen,
                      struct pipe_fence_handle *fence,
                      unsigned flags)
 {
-   struct brw_screen *is = brw_screen(screen);
-
-   return is->iws->fence_signalled(is->iws, fence);
+   return 0;                    /* XXX shouldn't this be a boolean? */
 }
 
 static int
 brw_fence_finish(struct pipe_screen *screen,
-                  struct pipe_fence_handle *fence,
-                  unsigned flags)
+                 struct pipe_fence_handle *fence,
+                 unsigned flags)
 {
-   struct brw_screen *is = brw_screen(screen);
-
-   return is->iws->fence_finish(is->iws, fence);
+   return 0;
 }
 
 
@@ -284,21 +271,21 @@ brw_fence_finish(struct pipe_screen *screen,
 static void
 brw_destroy_screen(struct pipe_screen *screen)
 {
-   struct brw_screen *is = brw_screen(screen);
+   struct brw_screen *bscreen = brw_screen(screen);
 
-   if (is->iws)
-      is->iws->destroy(is->iws);
+   if (bscreen->sws)
+      bscreen->sws->destroy(bscreen->sws);
 
-   FREE(is);
+   FREE(bscreen);
 }
 
 /**
  * Create a new brw_screen object
  */
 struct pipe_screen *
-brw_create_screen(struct intel_winsys *iws, uint pci_id)
+brw_create_screen(struct brw_winsys_screen *sws, uint pci_id)
 {
-   struct brw_screen *is;
+   struct brw_screen *bscreen;
    struct brw_chipset chipset;
 
 #ifdef DEBUG
@@ -341,25 +328,26 @@ brw_create_screen(struct intel_winsys *iws, uint pci_id)
    }
 
 
-   is = CALLOC_STRUCT(brw_screen);
-   if (!is)
+   bscreen = CALLOC_STRUCT(brw_screen);
+   if (!bscreen)
       return NULL;
 
-   is->chipset = chipset;
-   is->iws = iws;
-   is->base.winsys = NULL;
-   is->base.destroy = brw_destroy_screen;
-   is->base.get_name = brw_get_name;
-   is->base.get_vendor = brw_get_vendor;
-   is->base.get_param = brw_get_param;
-   is->base.get_paramf = brw_get_paramf;
-   is->base.is_format_supported = brw_is_format_supported;
-   is->base.fence_reference = brw_fence_reference;
-   is->base.fence_signalled = brw_fence_signalled;
-   is->base.fence_finish = brw_fence_finish;
-
-   brw_screen_init_texture_functions(is);
-   brw_screen_init_buffer_functions(is);
-
-   return &is->base;
+   bscreen->chipset = chipset;
+   bscreen->sws = sws;
+   bscreen->base.winsys = NULL;
+   bscreen->base.destroy = brw_destroy_screen;
+   bscreen->base.get_name = brw_get_name;
+   bscreen->base.get_vendor = brw_get_vendor;
+   bscreen->base.get_param = brw_get_param;
+   bscreen->base.get_paramf = brw_get_paramf;
+   bscreen->base.is_format_supported = brw_is_format_supported;
+   bscreen->base.fence_reference = brw_fence_reference;
+   bscreen->base.fence_signalled = brw_fence_signalled;
+   bscreen->base.fence_finish = brw_fence_finish;
+
+   brw_screen_tex_init(bscreen);
+   brw_screen_tex_surface_init(bscreen);
+   brw_screen_init_buffer_functions(bscreen);
+
+   return &bscreen->base;
 }