From patchwork Tue Jun 7 19:34:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristian Hogsberg X-Patchwork-Id: 859252 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p57JcuaM002666 for ; Tue, 7 Jun 2011 19:39:16 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DE759F5B5 for ; Tue, 7 Jun 2011 12:38:56 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E08B9F626 for ; Tue, 7 Jun 2011 12:36:03 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 07 Jun 2011 12:36:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,333,1304319600"; d="scan'208";a="15138664" Received: from unknown (HELO intel.com) ([10.255.12.225]) by fmsmga001.fm.intel.com with ESMTP; 07 Jun 2011 12:36:02 -0700 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= To: intel-gfx@lists.freedesktop.org Date: Tue, 7 Jun 2011 15:34:10 -0400 Message-Id: <1307475261-32695-6-git-send-email-krh@bitplanet.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1307475261-32695-1-git-send-email-krh@bitplanet.net> References: <1307475261-32695-1-git-send-email-krh@bitplanet.net> Subject: [Intel-gfx] [PATCH 05/16] intel: Replace intel_screen::gen with the chipset struct X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 07 Jun 2011 19:39:16 +0000 (UTC) --- 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;