[Intel-gfx] [PATCH 05/16] intel: Replace intel_screen::gen with the chipset struct

Kristian Høgsberg krh at bitplanet.net
Tue Jun 7 21:34:10 CEST 2011


---
 src/mesa/drivers/dri/intel/intel_context.c |    2 +-
 src/mesa/drivers/dri/intel/intel_screen.c  |   14 +++++---------
 src/mesa/drivers/dri/intel/intel_screen.h  |    6 +++++-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 01231ee..9765086 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -710,7 +710,7 @@ intelInitContext(struct intel_context *intel,
    intel->driFd = sPriv->fd;
 
    intel->has_xrgb_textures = GL_TRUE;
-   intel->gen = intelScreen->gen;
+   intel->gen = intelScreen->chipset.gen;
    if (IS_GEN7(intel->intelScreen->deviceID)) {
       intel->needs_ff_sync = GL_TRUE;
       intel->has_luminance_srgb = GL_TRUE;
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index ee842a5..bce5a17 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -433,10 +433,6 @@ intelDestroyBuffer(__DRIdrawable * driDrawPriv)
  * functions.
  */
 
-struct intel_chipset {
-   int gen;
-};
-
 #define CHIPSET(id, name, info) { id, &intel_chipset_##info },
 
 
@@ -523,7 +519,7 @@ intelCreateContext(gl_api api,
    __DRIscreen *sPriv = driContextPriv->driScreenPriv;
    struct intel_screen *intelScreen = sPriv->private;
 
-   if (intelScreen->gen == 3) {
+   if (intelScreen->chipset.gen == 3) {
       return i915CreateContext(api, mesaVis, driContextPriv,
 			       sharedContextPrivate);
    } else {
@@ -621,8 +617,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
 
    for (i = 0; i < Elements(chipset_map); i++)
       if (chipset_map[i].device_id == intelScreen->deviceID)
-	 intelScreen->gen = chipset_map[i].chipset->gen; 
-   if (intelScreen->gen == 0) {
+	 intelScreen->chipset = *chipset_map[i].chipset; 
+   if (intelScreen->chipset.gen == 0) {
       fprintf(stderr, "\nERROR!  Unrecognized chipset:: 0x%04x\n",
 	      intelScreen->deviceID);
       return GL_FALSE;
@@ -636,7 +632,7 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
    api_mask |= (1 << __DRI_API_GLES2);
 #endif
 
-   if (intelScreen->gen >= 3)
+   if (intelScreen->chipset.gen >= 3)
       psp->api_mask = api_mask;
 
    if (!intel_init_bufmgr(intelScreen))
@@ -749,7 +745,7 @@ intelAllocateBuffer(__DRIscreen *screen,
    if ((attachment == __DRI_BUFFER_DEPTH ||
 	attachment == __DRI_BUFFER_STENCIL ||
 	attachment == __DRI_BUFFER_DEPTH_STENCIL) &&
-       intelScreen->gen >= 4)
+       intelScreen->chipset.gen >= 4)
       tiling = I915_TILING_Y;
    else
       tiling = I915_TILING_X;
diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h
index 4613c98..3d001aa 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.h
+++ b/src/mesa/drivers/dri/intel/intel_screen.h
@@ -34,10 +34,14 @@
 #include "i915_drm.h"
 #include "xmlconfig.h"
 
+struct intel_chipset {
+   int gen;
+};
+
 struct intel_screen
 {
    int deviceID;
-   int gen;
+   struct intel_chipset chipset;
 
    int logTextureGranularity;
 
-- 
1.7.4.4




More information about the Intel-gfx mailing list