Move chipset specific stuff to struct intel_chipset
cover Move chipset specific stuff to struct intel_chipset
Hi,
Here's a handful of patches that try to replace most of our chipset feature checking with data in a new struct intel_chipset. It uses the new PCI ID list infrastructure and eliminates all IS_FOO macros in favor of a per-family chipset info struct. Actually, I was surprised how much in the driver is really just a gen check, but there are a few cases where we have to check a certain feature, as well as all the gen4+ urb and thread limits (includes the recent fix for swapped VS entry counts).
The series compiles and passes casual testing for me, but I've not run piglit on it yet.
Kristian
Kristian Høgsberg (16):
intel: Use gen number instead of PCI ID in decoder
intel: Use the PCI ID map for determining chipset gen
intel: IS_9XX is just gen >= 3
intel: Remove unused IS_915 macro
intel: Replace intel_screen::gen with the chipset struct
intel: Add a is_945 bit to chipinfo and use that instead of IS_945
intel: Remove unused IS_MOBILE and IS_IGD* macros
intel: Replace single use of IS_965 with gen check
intel: Drop unused IS_GEN4 macro
intel: Drop unused IS_GEN5-7 macros
intel: Put urb and thread limits into the chipset struct
intel: Drop unused IS_SNB/IVB_GT1/2 macros
intel: Replace IS_G4X macro with an is_g4x bit in the chipset struct
intel: Add is_855ish for handling 855 and 865 specific lod clamping
intel: Get chipset name from PCI ID list
intel: Remove intel_chipsets.h
include/pci_ids/i915_pci_ids.h | 30 ++-- include/pci_ids/i965_pci_ids.h | 54 ++++---- include/pci_ids/pci_id_driver_map.h | 4 +- src/mesa/drivers/dri/i915/Makefile | 2 +- src/mesa/drivers/dri/i915/i830_texstate.c | 4 +- src/mesa/drivers/dri/i965/Makefile | 2 +- src/mesa/drivers/dri/i965/brw_context.c | 53 +------- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 2 +- src/mesa/drivers/dri/intel/intel_chipset.h | 164 ------------------------ src/mesa/drivers/dri/intel/intel_context.c | 138 ++------------------ src/mesa/drivers/dri/intel/intel_decode.c | 43 +++--- src/mesa/drivers/dri/intel/intel_decode.h | 2 +- src/mesa/drivers/dri/intel/intel_extensions.c | 1 - src/mesa/drivers/dri/intel/intel_screen.c | 142 +++++++++++++++++---- src/mesa/drivers/dri/intel/intel_screen.h | 14 ++- 15 files changed, 221 insertions(+), 434 deletions(-) delete mode 100644 src/mesa/drivers/dri/intel/intel_chipset.h
Signature · 6 lines
1.7.4.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/16 intel: Use gen number instead of PCI ID in decoder
--- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 2 +- src/mesa/drivers/dri/intel/intel_chipset.h | 3 -- src/mesa/drivers/dri/intel/intel_decode.c | 42 ++++++++++++------------ src/mesa/drivers/dri/intel/intel_decode.h | 2 +- 4 files changed, 23 insertions(+), 26 deletions(-)
src/mesa/drivers/dri/intel/intel_batchbuffer.c +1 -1
@@ -109,7 +109,7 @@ do_flush_locked(struct intel_context *intel)if (unlikely (INTEL_DEBUG &DEBUG_BATCH )) {intel_decode (batch->map, batch->used, batch->bo->offset, - intel->intelScreen->deviceID,GL_TRUE ); + intel->gen,GL_TRUE );if (intel->vtbl.debug_batch !=NULL ) intel->vtbl.debug_batch (intel);
src/mesa/drivers/dri/intel/intel_chipset.h +0 -3
@@ -128,9 +128,6 @@ devid == PCI_CHIP_I946_GZ || \ IS_G4X(devid)) -/* Compat macro for intel_decode.c */ -#define IS_IRONLAKE (devid) IS_GEN5(devid) -#define IS_SNB_GT1 (devid) (devid == PCI_CHIP_SANDYBRIDGE_GT1 || \ devid == PCI_CHIP_SANDYBRIDGE_M_GT1 || \ devid == PCI_CHIP_SANDYBRIDGE_S)
src/mesa/drivers/dri/intel/intel_decode.c +21 -21
135 lines not on this page · raw message
src/mesa/drivers/dri/intel/intel_decode.h +1 -1
@@ -25,7 +25,7 @@* */ -int intel_decode (uint32_t *data,int count,uint32_t hw_offset,uint32_t devid, +int intel_decode (uint32_t *data,int count,uint32_t hw_offset,uint32_t gen,uint32_t ignore_end_of_batchbuffer);void intel_decode_context_set_head_tail (uint32_t head,uint32_t tail);void intel_decode_context_reset (void );
Signature · 1 line
1.7.4.4
Re: [PATCH 01/16] intel: Use gen number instead of PCI ID in decoder
Quoted 6 lines · Kristian Høgsberg
--- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 2 +- src/mesa/drivers/dri/intel/intel_chipset.h | 3 -- src/mesa/drivers/dri/intel/intel_decode.c | 42 ++++++++++++------------ src/mesa/drivers/dri/intel/intel_decode.h | 2 +- 4 files changed, 23 insertions(+), 26 deletions(-)
intel_decode.c is just copied from intel_gpu_tools. Please make the change there first (but I like the change).
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/16 intel: Use the PCI ID map for determining chipset gen
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/i915/Makefile | 2 +- src/mesa/drivers/dri/i965/Makefile | 2 +- src/mesa/drivers/dri/intel/intel_screen.c | 96 +++++++++++++++++++++++------ 3 files changed, 80 insertions(+), 20 deletions(-)
src/mesa/drivers/dri/i915/Makefile +1 -1
@@ -58,7 +58,7 @@ C_SOURCES = \ ASM_SOURCES = -DRIVER_DEFINES = -I../intel -DI915 \ +DRIVER_DEFINES = -I../intel -I$(TOP)/include -DI915 \ $(shell pkg-config libdrm --atleast-version=2.3.1 \ && echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
src/mesa/drivers/dri/i965/Makefile +1 -1
@@ -128,7 +128,7 @@ CXX_SOURCES = \ ASM_SOURCES = -DRIVER_DEFINES = -I../intel +DRIVER_DEFINES = -I../intel -I$(TOP)/include INCLUDES += $(INTEL_CFLAGS) DRI_LIB_DEPS += $(INTEL_LIBS)
src/mesa/drivers/dri/intel/intel_screen.c +78 -18
141 lines not on this page · raw message
Signature · 1 line
1.7.4.4
PATCH 3/16 intel: IS_9XX is just gen >= 3
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/intel/intel_chipset.h | 4 ---- src/mesa/drivers/dri/intel/intel_context.c | 2 +- src/mesa/drivers/dri/intel/intel_screen.c | 10 ++++------ 3 files changed, 5 insertions(+), 11 deletions(-)
src/mesa/drivers/dri/intel/intel_chipset.h +0 -4
@@ -155,7 +155,3 @@IS_GEN5 (devid) || \IS_GEN6 (devid) || \ IS_GEN7(devid)) - -#define IS_9XX (devid) (IS_915(devid) || \ - IS_945(devid) || \ - IS_965(devid))
src/mesa/drivers/dri/intel/intel_context.c +1 -1
@@ -730,7 +730,7 @@ intelInitContext(struct intel_context *intel, intel->has_luminance_srgb =GL_TRUE ; intel->is_g4x =GL_TRUE ; } - }else if (IS_9XX (intel->intelScreen->deviceID)) { + }else if (intel->gen >=3 ) {if (IS_945 (intel->intelScreen->deviceID)) { intel->is_945 =GL_TRUE ; }
src/mesa/drivers/dri/intel/intel_screen.c +4 -6
@@ -523,11 +523,9 @@ intelCreateContext(gl_api api,__DRIscreen *sPriv = driContextPriv->driScreenPriv;struct intel_screen *intelScreen = sPriv->private; -if (IS_9XX (intelScreen->deviceID)) { -if (!IS_965 (intelScreen->deviceID)) { -return i915CreateContext (api, mesaVis, driContextPriv, - sharedContextPrivate); - } +if (intelScreen->gen ==3 ) { +return i915CreateContext (api, mesaVis, driContextPriv, + sharedContextPrivate); }else { intelScreen->no_vbo =GL_TRUE ;return i830CreateContext (mesaVis, driContextPriv, sharedContextPrivate);
@@ -638,7 +636,7 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) api_mask |= (1 << __DRI_API_GLES2);#endif -if (IS_9XX (intelScreen->deviceID) ||IS_965 (intelScreen->deviceID)) +if (intelScreen->gen >=3 ) psp->api_mask = api_mask;if (!intel_init_bufmgr (intelScreen))
Signature · 1 line
1.7.4.4
PATCH 4/16 intel: Remove unused IS_915 macro
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/intel/intel_chipset.h | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
src/mesa/drivers/dri/intel/intel_chipset.h +0 -4
@@ -109,10 +109,6 @@#define IS_ILM (devid) (devid == PCI_CHIP_ILM_G)#define IS_GEN5 (devid) (IS_ILD(devid) || IS_ILM(devid)) -#define IS_915 (devid) (devid == PCI_CHIP_I915_G || \ - devid == PCI_CHIP_E7221_G || \ - devid == PCI_CHIP_I915_GM) -#define IS_945 (devid) (devid == PCI_CHIP_I945_G || \ devid == PCI_CHIP_I945_GM || \ devid == PCI_CHIP_I945_GME || \
Signature · 1 line
1.7.4.4
PATCH 5/16 intel: Replace intel_screen::gen with the chipset struct
In reply to Kristian Høgsberg--- 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(-)
src/mesa/drivers/dri/intel/intel_context.c +1 -1
@@ -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 ;
src/mesa/drivers/dri/intel/intel_screen.c +5 -9
@@ -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 ;
src/mesa/drivers/dri/intel/intel_screen.h +5 -1
@@ -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;
Signature · 1 line
1.7.4.4
PATCH 6/16 intel: Add a is_945 bit to chipinfo and use that instead of IS_945
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/intel/intel_chipset.h | 7 ------- src/mesa/drivers/dri/intel/intel_context.c | 8 +++----- src/mesa/drivers/dri/intel/intel_screen.c | 2 +- src/mesa/drivers/dri/intel/intel_screen.h | 1 + 4 files changed, 5 insertions(+), 13 deletions(-)
src/mesa/drivers/dri/intel/intel_chipset.h +0 -7
@@ -109,13 +109,6 @@#define IS_ILM (devid) (devid == PCI_CHIP_ILM_G)#define IS_GEN5 (devid) (IS_ILD(devid) || IS_ILM(devid)) -#define IS_945 (devid) (devid == PCI_CHIP_I945_G || \ - devid == PCI_CHIP_I945_GM || \ - devid == PCI_CHIP_I945_GME || \ - devid == PCI_CHIP_G33_G || \ - devid == PCI_CHIP_Q33_G || \ - devid == PCI_CHIP_Q35_G || IS_IGD(devid)) -#define IS_GEN4 (devid) (devid == PCI_CHIP_I965_G || \ devid == PCI_CHIP_I965_Q || \ devid == PCI_CHIP_I965_G_1 || \
src/mesa/drivers/dri/intel/intel_context.c +3 -5
@@ -730,17 +730,15 @@ intelInitContext(struct intel_context *intel, intel->has_luminance_srgb =GL_TRUE ; intel->is_g4x =GL_TRUE ; } - }else if (intel->gen >=3 ) { -if (IS_945 (intel->intelScreen->deviceID)) { - intel->is_945 =GL_TRUE ; - } - }else { + }else if (intel->gen ==2 ) {if (intel->intelScreen->deviceID ==PCI_CHIP_I830_M || intel->intelScreen->deviceID ==PCI_CHIP_845_G ) { intel->has_xrgb_textures =GL_FALSE ; } } + intel->is_945 = intelScreen->chipset.is_945; +intel_override_hiz (intel);intel_override_separate_stencil (intel);
src/mesa/drivers/dri/intel/intel_screen.c +1 -1
@@ -452,7 +452,7 @@ static const struct intel_chipset intel_chipset_i915 = { };static const struct intel_chipset intel_chipset_i945 = { - .gen =3 + .gen =3 , .is_945 =1 };static const struct intel_chipset_map chipset_map[] = {
src/mesa/drivers/dri/intel/intel_screen.h +1 -0
@@ -36,6 +36,7 @@struct intel_chipset {int gen; +GLboolean is_945; };struct intel_screen
Signature · 1 line
1.7.4.4
PATCH 7/16 intel: Remove unused IS_MOBILE and IS_IGD* macros
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/intel/intel_chipset.h | 14 -------------- 1 files changed, 0 insertions(+), 14 deletions(-)
src/mesa/drivers/dri/intel/intel_chipset.h +0 -14
@@ -49,10 +49,6 @@#define PCI_CHIP_IGD_GM 0xA011#define PCI_CHIP_IGD_G 0xA001 -#define IS_IGDGM (devid) (devid == PCI_CHIP_IGD_GM) -#define IS_IGDG (devid) (devid == PCI_CHIP_IGD_G) -#define IS_IGD (devid) (IS_IGDG(devid) || IS_IGDGM(devid)) -#define PCI_CHIP_I965_G 0x29A2#define PCI_CHIP_I965_Q 0x2992#define PCI_CHIP_I965_G_1 0x2982
@@ -86,16 +82,6 @@#define PCI_CHIP_IVYBRIDGE_M_GT2 0x0166#define PCI_CHIP_IVYBRIDGE_S_GT1 0x015a/* Server */ -#define IS_MOBILE (devid) (devid == PCI_CHIP_I855_GM || \ - devid == PCI_CHIP_I915_GM || \ - devid == PCI_CHIP_I945_GM || \ - devid == PCI_CHIP_I945_GME || \ - devid == PCI_CHIP_I965_GM || \ - devid == PCI_CHIP_I965_GME || \ - devid == PCI_CHIP_GM45_GM || \ - IS_IGD(devid) || \ - devid == PCI_CHIP_ILM_G) -#define IS_G45 (devid) (devid == PCI_CHIP_IGD_E_G || \ devid == PCI_CHIP_Q45_G || \ devid == PCI_CHIP_G45_G || \
Signature · 1 line
1.7.4.4
PATCH 8/16 intel: Replace single use of IS_965 with gen check
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/intel/intel_chipset.h | 6 ------ src/mesa/drivers/dri/intel/intel_context.c | 2 +- 2 files changed, 1 insertions(+), 7 deletions(-)
src/mesa/drivers/dri/intel/intel_chipset.h +0 -6
@@ -124,9 +124,3 @@#define IS_IVYBRIDGE (devid) (IS_IVB_GT1(devid) || IS_IVB_GT2(devid))#define IS_GEN7 (devid) IS_IVYBRIDGE(devid) - -#define IS_965 (devid) (IS_GEN4(devid) || \ - IS_G4X(devid) || \ - IS_GEN5(devid) || \ - IS_GEN6(devid) || \ - IS_GEN7(devid))
src/mesa/drivers/dri/intel/intel_context.c +1 -1
@@ -725,7 +725,7 @@ intelInitContext(struct intel_context *intel, }else if (IS_GEN5 (intel->intelScreen->deviceID)) { intel->needs_ff_sync =GL_TRUE ; intel->has_luminance_srgb =GL_TRUE ; - }else if (IS_965 (intel->intelScreen->deviceID)) { + }else if (intel->intelScreen->chipset.gen ==4 ) {if (IS_G4X (intel->intelScreen->deviceID)) { intel->has_luminance_srgb =GL_TRUE ; intel->is_g4x =GL_TRUE ;
Signature · 1 line
1.7.4.4
PATCH 9/16 intel: Drop unused IS_GEN4 macro
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/intel/intel_chipset.h | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-)
src/mesa/drivers/dri/intel/intel_chipset.h +0 -8
@@ -95,14 +95,6 @@#define IS_ILM (devid) (devid == PCI_CHIP_ILM_G)#define IS_GEN5 (devid) (IS_ILD(devid) || IS_ILM(devid)) -#define IS_GEN4 (devid) (devid == PCI_CHIP_I965_G || \ - devid == PCI_CHIP_I965_Q || \ - devid == PCI_CHIP_I965_G_1 || \ - devid == PCI_CHIP_I965_GM || \ - devid == PCI_CHIP_I965_GME || \ - devid == PCI_CHIP_I946_GZ || \ - IS_G4X(devid)) -#define IS_SNB_GT1 (devid) (devid == PCI_CHIP_SANDYBRIDGE_GT1 || \ devid == PCI_CHIP_SANDYBRIDGE_M_GT1 || \ devid == PCI_CHIP_SANDYBRIDGE_S)
Signature · 1 line
1.7.4.4
PATCH 10/16 intel: Drop unused IS_GEN5-7 macros
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/intel/intel_chipset.h | 10 ---------- src/mesa/drivers/dri/intel/intel_context.c | 6 +++--- 2 files changed, 3 insertions(+), 13 deletions(-)
src/mesa/drivers/dri/intel/intel_chipset.h +0 -10
@@ -91,10 +91,6 @@#define IS_GM45 (devid) (devid == PCI_CHIP_GM45_GM)#define IS_G4X (devid) (IS_G45(devid) || IS_GM45(devid)) -#define IS_ILD (devid) (devid == PCI_CHIP_ILD_G) -#define IS_ILM (devid) (devid == PCI_CHIP_ILM_G) -#define IS_GEN5 (devid) (IS_ILD(devid) || IS_ILM(devid)) -#define IS_SNB_GT1 (devid) (devid == PCI_CHIP_SANDYBRIDGE_GT1 || \ devid == PCI_CHIP_SANDYBRIDGE_M_GT1 || \ devid == PCI_CHIP_SANDYBRIDGE_S)
@@ -104,15 +100,9 @@ devid == PCI_CHIP_SANDYBRIDGE_M_GT2 || \ devid == PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS) -#define IS_GEN6 (devid) (IS_SNB_GT1(devid) || IS_SNB_GT2(devid)) -#define IS_IVB_GT1 (devid) (devid == PCI_CHIP_IVYBRIDGE_GT1 || \ devid == PCI_CHIP_IVYBRIDGE_M_GT1 || \ devid == PCI_CHIP_IVYBRIDGE_S_GT1)#define IS_IVB_GT2 (devid) (devid == PCI_CHIP_IVYBRIDGE_GT2 || \ devid == PCI_CHIP_IVYBRIDGE_M_GT2) - -#define IS_IVYBRIDGE (devid) (IS_IVB_GT1(devid) || IS_IVB_GT2(devid)) - -#define IS_GEN7 (devid) IS_IVYBRIDGE(devid)
src/mesa/drivers/dri/intel/intel_context.c +3 -3
@@ -711,18 +711,18 @@ intelInitContext(struct intel_context *intel, intel->has_xrgb_textures =GL_TRUE ; intel->gen = intelScreen->chipset.gen; -if (IS_GEN7 (intel->intelScreen->deviceID)) { +if (intel->intelScreen->chipset.gen ==7 ) { intel->needs_ff_sync =GL_TRUE ; intel->has_luminance_srgb =GL_TRUE ;/* FINISHME: Enable intel->has_separate_stencil on Gen7. */ /* FINISHME: Enable intel->must_use_separate_stencil on Gen7. */ /* FINISHME: Enable intel->has_hiz on Gen7. */ - }else if (IS_GEN6 (intel->intelScreen->deviceID)) { + }else if (intel->intelScreen->chipset.gen ==6 ) { intel->needs_ff_sync =GL_TRUE ; intel->has_luminance_srgb =GL_TRUE ;/* FINISHME: Enable intel->has_separate_stencil on Gen6. */ /* FINISHME: Enable intel->has_hiz on Gen6. */ - }else if (IS_GEN5 (intel->intelScreen->deviceID)) { + }else if (intel->intelScreen->chipset.gen ==5 ) { intel->needs_ff_sync =GL_TRUE ; intel->has_luminance_srgb =GL_TRUE ; }else if (intel->intelScreen->chipset.gen ==4 ) {
Signature · 1 line
1.7.4.4
PATCH 11/16 intel: Put urb and thread limits into the chipset struct
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/i965/brw_context.c | 53 ++++------------------------- src/mesa/drivers/dri/intel/intel_screen.c | 46 +++++++++++++++++++++---- src/mesa/drivers/dri/intel/intel_screen.h | 7 ++++ 3 files changed, 53 insertions(+), 53 deletions(-)
src/mesa/drivers/dri/i965/brw_context.c +7 -46
@@ -177,53 +177,14 @@ GLboolean brwCreateContext( int api, brw->CMD_PIPELINE_SELECT =CMD_PIPELINE_SELECT_965 ; } -/* WM maximum threads is number of EUs times number of threads per EU. */ -if (intel->gen >=7 ) { -if (IS_IVB_GT1 (intel->intelScreen->deviceID)) { - brw->wm_max_threads =86 ; - brw->vs_max_threads =36 ; - brw->urb.size =128 ; - brw->urb.max_vs_entries =512 ; - brw->urb.max_gs_entries =192 ; - }else if (IS_IVB_GT2 (intel->intelScreen->deviceID)) { - brw->wm_max_threads =86 ; - brw->vs_max_threads =128 ; - brw->urb.size =256 ; - brw->urb.max_vs_entries =704 ; - brw->urb.max_gs_entries =320 ; - }else { -assert (!"Unknown gen7 device." ); - } - }else if (intel->gen ==6 ) { -if (IS_SNB_GT2 (intel->intelScreen->deviceID)) { -/* This could possibly be 80, but is supposed to require -* disabling of WIZ hashing (bit 6 of GT_MODE, 0x20d0) and a -* GPU reset to change. -*/ - brw->wm_max_threads =40 ; - brw->vs_max_threads =60 ; - brw->urb.size =64 ;/* volume 5c.5 section 5.1 */ - brw->urb.max_vs_entries =256 ;/* volume 2a (see 3DSTATE_URB) */ - }else { - brw->wm_max_threads =40 ; - brw->vs_max_threads =24 ; - brw->urb.size =32 ;/* volume 5c.5 section 5.1 */ - brw->urb.max_vs_entries =128 ;/* volume 2a (see 3DSTATE_URB) */ - } - }else if (intel->gen ==5 ) { - brw->urb.size =1024 ; - brw->vs_max_threads =72 ; - brw->wm_max_threads =12 *6 ; - }else if (intel->is_g4x) { - brw->urb.size =384 ; - brw->vs_max_threads =32 ; - brw->wm_max_threads =10 *5 ; - }else if (intel->gen <6 ) { - brw->urb.size =256 ; - brw->vs_max_threads =16 ; - brw->wm_max_threads =8 *4 ; + brw->wm_max_threads = intel->intelScreen->chipset.wm_max_threads; + brw->vs_max_threads = intel->intelScreen->chipset.vs_max_threads; + brw->urb.size = intel->intelScreen->chipset.urb_size; + brw->urb.max_vs_entries = intel->intelScreen->chipset.urb_max_vs_entries; + brw->urb.max_gs_entries = intel->intelScreen->chipset.urb_max_gs_entries; + +if (intel->gen ==4 ) brw->has_negative_rhw_bug =GL_TRUE ; - }if (INTEL_DEBUG &DEBUG_SINGLE_THREAD ) { brw->vs_max_threads =1 ;
src/mesa/drivers/dri/intel/intel_screen.c +39 -7
70 lines not on this page · raw message
src/mesa/drivers/dri/intel/intel_screen.h +7 -0
@@ -37,6 +37,13 @@struct intel_chipset {int gen;GLboolean is_945; + +/* WM maximum threads is number of EUs times number of threads per EU. */ +int wm_max_threads; +int vs_max_threads; +int urb_size; +int urb_max_vs_entries; +int urb_max_gs_entries; };struct intel_screen
Signature · 1 line
1.7.4.4
PATCH 12/16 intel: Drop unused IS_SNB/IVB_GT1/2 macros
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/intel/intel_chipset.h | 16 ---------------- 1 files changed, 0 insertions(+), 16 deletions(-)
src/mesa/drivers/dri/intel/intel_chipset.h +0 -16
@@ -90,19 +90,3 @@ devid == PCI_CHIP_B43_G1)#define IS_GM45 (devid) (devid == PCI_CHIP_GM45_GM)#define IS_G4X (devid) (IS_G45(devid) || IS_GM45(devid)) - -#define IS_SNB_GT1 (devid) (devid == PCI_CHIP_SANDYBRIDGE_GT1 || \ - devid == PCI_CHIP_SANDYBRIDGE_M_GT1 || \ - devid == PCI_CHIP_SANDYBRIDGE_S) - -#define IS_SNB_GT2 (devid) (devid == PCI_CHIP_SANDYBRIDGE_GT2 || \ - devid == PCI_CHIP_SANDYBRIDGE_GT2_PLUS || \ - devid == PCI_CHIP_SANDYBRIDGE_M_GT2 || \ - devid == PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS) - -#define IS_IVB_GT1 (devid) (devid == PCI_CHIP_IVYBRIDGE_GT1 || \ - devid == PCI_CHIP_IVYBRIDGE_M_GT1 || \ - devid == PCI_CHIP_IVYBRIDGE_S_GT1) - -#define IS_IVB_GT2 (devid) (devid == PCI_CHIP_IVYBRIDGE_GT2 || \ - devid == PCI_CHIP_IVYBRIDGE_M_GT2)
Signature · 1 line
1.7.4.4
PATCH 13/16 intel: Replace IS_G4X macro with an is_g4x bit in the chipset struct
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/intel/intel_chipset.h | 9 --------- src/mesa/drivers/dri/intel/intel_context.c | 2 +- src/mesa/drivers/dri/intel/intel_screen.c | 1 + src/mesa/drivers/dri/intel/intel_screen.h | 2 +- 4 files changed, 3 insertions(+), 11 deletions(-)
src/mesa/drivers/dri/intel/intel_chipset.h +0 -9
@@ -81,12 +81,3 @@#define PCI_CHIP_IVYBRIDGE_M_GT1 0x0156/* Mobile */ #define PCI_CHIP_IVYBRIDGE_M_GT2 0x0166#define PCI_CHIP_IVYBRIDGE_S_GT1 0x015a/* Server */ - -#define IS_G45 (devid) (devid == PCI_CHIP_IGD_E_G || \ - devid == PCI_CHIP_Q45_G || \ - devid == PCI_CHIP_G45_G || \ - devid == PCI_CHIP_G41_G || \ - devid == PCI_CHIP_B43_G || \ - devid == PCI_CHIP_B43_G1) -#define IS_GM45 (devid) (devid == PCI_CHIP_GM45_GM) -#define IS_G4X (devid) (IS_G45(devid) || IS_GM45(devid))
src/mesa/drivers/dri/intel/intel_context.c +1 -1
@@ -726,7 +726,7 @@ intelInitContext(struct intel_context *intel, intel->needs_ff_sync =GL_TRUE ; intel->has_luminance_srgb =GL_TRUE ; }else if (intel->intelScreen->chipset.gen ==4 ) { -if (IS_G4X (intel->intelScreen->deviceID)) { +if (intel->intelScreen->chipset.is_g4x) { intel->has_luminance_srgb =GL_TRUE ; intel->is_g4x =GL_TRUE ; }
src/mesa/drivers/dri/intel/intel_screen.c +1 -0
@@ -479,6 +479,7 @@ static const struct intel_chipset intel_chipset_i965 = {static const struct intel_chipset intel_chipset_g4x = { .gen =4 , + .is_g4x =GL_TRUE , .urb_size =384 , .vs_max_threads =32 , .wm_max_threads =10 *5
src/mesa/drivers/dri/intel/intel_screen.h +1 -1
@@ -36,7 +36,7 @@struct intel_chipset {int gen; -GLboolean is_945; +GLboolean is_945, is_g4x;/* WM maximum threads is number of EUs times number of threads per EU. */ int wm_max_threads;
Signature · 1 line
1.7.4.4
PATCH 14/16 intel: Add is_855ish for handling 855 and 865 specific lod clamping
In reply to Kristian Høgsberg--- include/pci_ids/i915_pci_ids.h | 4 ++-- src/mesa/drivers/dri/i915/i830_texstate.c | 3 +-- src/mesa/drivers/dri/intel/intel_screen.c | 4 ++++ src/mesa/drivers/dri/intel/intel_screen.h | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-)
include/pci_ids/i915_pci_ids.h +2 -2
@@ -1,7 +1,7 @@ CHIPSET(0x3577, I830_M, i8xx) CHIPSET(0x2562, 845_G, i8xx) -CHIPSET(0x3582, I855_GM, i8xx) -CHIPSET(0x2572, I865_G, i8xx) +CHIPSET(0x3582, I855_GM, i855) +CHIPSET(0x2572, I865_G, i855) CHIPSET(0x2582, I915_G, i915) CHIPSET(0x258A, E7221_G, i915)CHIPSET (0x2592 ,I915_GM , i915)
src/mesa/drivers/dri/i915/i830_texstate.c +1 -2
@@ -263,8 +263,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)*/ minlod_fixed =U_FIXED (CLAMP (sampler->MinLod,0.0 ,11 ),4 ); maxlod =MIN2 (sampler->MaxLod, tObj->_MaxLevel - tObj->BaseLevel); -if (intel->intelScreen->deviceID ==PCI_CHIP_I855_GM || - intel->intelScreen->deviceID ==PCI_CHIP_I865_G ) { +if (intel->intelScreen->chipset.is_855ish) { maxlod_fixed =U_FIXED (CLAMP (maxlod,0.0 ,11.75 ),2 ); maxlod_fixed =MAX2 (maxlod_fixed, (minlod_fixed +3 ) >>2 ); state[I830_TEXREG_TM0S3 ] |= maxlod_fixed <<TM0S3_MIN_MIP_SHIFT ;
src/mesa/drivers/dri/intel/intel_screen.c +4 -0
@@ -447,6 +447,10 @@ static const struct intel_chipset intel_chipset_i8xx = { .gen = 2 }; +static const struct intel_chipset intel_chipset_i855 = { + .gen =2 , .is_855ish =GL_TRUE +}; +static const struct intel_chipset intel_chipset_i915 = { .gen =3 };
src/mesa/drivers/dri/intel/intel_screen.h +1 -1
@@ -36,7 +36,7 @@struct intel_chipset {int gen; -GLboolean is_945, is_g4x; +GLboolean is_855ish, is_945, is_g4x;/* WM maximum threads is number of EUs times number of threads per EU. */ int wm_max_threads;
Signature · 1 line
1.7.4.4
Re: [PATCH 14/16] intel: Add is_855ish for handling 855 and 865 specific lod clamping
src/mesa/drivers/dri/intel/intel_screen.h line 42
Quoted 7 lines · Kristian Høgsberg
struct intel_chipset { int gen;src/mesa/drivers/dri/intel/intel_screen.h +1
-1-GLboolean is_945, is_g4x; +GLboolean is_855ish, is_945, is_g4x;/* WM maximum threads is number of EUs times number of threads per EU. */ int wm_max_threads;
This can be handled by adding a few more bits per-gen. I found using
20 830/845
21 855/865
30 915
31 945
33 g33 + pnv
40 965
45 g4x
50 ilk
60 snb
...to infinity and beyond...
works quite well for specifying render capabilities for gen2/3/4.
Can these structs and pci-id tables be reused by projects external to mesa?
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 14/16] intel: Add is_855ish for handling 855 and 865 specific lod clamping
Quoted 9 lines · Chris Wilson
src/mesa/drivers/dri/intel/intel_screen.h line 42
Quoted 7 lines · Kristian Høgsberg
struct intel_chipset { int gen;src/mesa/drivers/dri/intel/intel_screen.h +1
-1-GLboolean is_945, is_g4x; +GLboolean is_855ish, is_945, is_g4x;/* WM maximum threads is number of EUs times number of threads per EU. */ int wm_max_threads;
Quoted 12 lines
This can be handled by adding a few more bits per-gen. I found using
20 830/845
21 855/865
30 915
31 945
33 g33 + pnv
40 965
45 g4x
50 ilk
60 snb
...to infinity and beyond...
works quite well for specifying render capabilities for gen2/3/4.
I never liked this. I much prefer the extra knobs for the few weird cases (there's *so* little that's g33 as opposed to 945-specific, for example).
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 15/16 intel: Get chipset name from PCI ID list
In reply to Kristian Høgsberg--- include/pci_ids/i915_pci_ids.h | 30 ++++---- include/pci_ids/i965_pci_ids.h | 54 +++++++------- include/pci_ids/pci_id_driver_map.h | 4 +- src/mesa/drivers/dri/intel/intel_context.c | 117 ++-------------------------- src/mesa/drivers/dri/intel/intel_screen.c | 2 +- 5 files changed, 51 insertions(+), 156 deletions(-)
include/pci_ids/i915_pci_ids.h +15 -15
@@ -1,15 +1,15 @@ -CHIPSET(0x3577, I830_M, i8xx) -CHIPSET(0x2562, 845_G, i8xx) -CHIPSET(0x3582, I855_GM, i855) -CHIPSET(0x2572, I865_G, i855) -CHIPSET(0x2582, I915_G, i915) -CHIPSET(0x258A, E7221_G, i915) -CHIPSET(0x2592, I915_GM, i915) -CHIPSET(0x2772, I945_G, i945) -CHIPSET(0x27A2, I945_GM, i945) -CHIPSET(0x27AE, I945_GME, i945) -CHIPSET(0x29B2, Q35_G, i945) -CHIPSET(0x29C2, G33_G, i945) -CHIPSET(0x29D2, Q33_G, i945) -CHIPSET(0xA011, IGD_GM, i945) -CHIPSET (0xA001 ,IGD_G , i945) +CHIPSET(0x3577, I830_M, i8xx, "Intel(R) 845G") +CHIPSET(0x2562, 845_G, i8xx, "Intel(R) 830M") +CHIPSET(0x3582, I855_GM, i855, "Intel(R) 852GM/855GM") +CHIPSET(0x2572, I865_G, i855, "Intel(R) 865G") +CHIPSET(0x2582, I915_G, i915, "Intel(R) 915G") +CHIPSET(0x258A, E7221_G, i915, "Intel (R) E7221G (i915)") +CHIPSET(0x2592, I915_GM, i915, "Intel(R) 915GM") +CHIPSET(0x2772, I945_G, i945, "Intel(R) 945G") +CHIPSET(0x27A2, I945_GM, i945, "Intel(R) 945GM") +CHIPSET(0x27AE, I945_GME, i945, "Intel(R) 945GME") +CHIPSET(0x29B2, Q35_G, i945, "Intel(R) Q35") +CHIPSET(0x29C2, G33_G, i945, "Intel(R) G33") +CHIPSET(0x29D2, Q33_G, i945, "Intel(R) Q33") +CHIPSET(0xA011, IGD_GM, i945, "Intel(R) IGD") +CHIPSET (0xA001 ,IGD_G , i945,"Intel(R) IGD" )
include/pci_ids/i965_pci_ids.h +27 -27
54 lines not on this page · raw message
include/pci_ids/pci_id_driver_map.h +2 -2
@@ -16,13 +16,13 @@ static const int i810_chip_ids[] = {#endif static const int i915_chip_ids[] = { -#define CHIPSET(chip, desc, misc) chip, +#define CHIPSET(chip, desc, misc, str) chip, #include "pci_ids/i915_pci_ids.h" #undef CHIPSET };static const int i965_chip_ids[] = { -#define CHIPSET(chip, desc, misc) chip, +#define CHIPSET(chip, desc, misc, str) chip, #include "pci_ids/i965_pci_ids.h" #undef CHIPSET };
src/mesa/drivers/dri/intel/intel_context.c +6 -111
123 lines not on this page · raw message
src/mesa/drivers/dri/intel/intel_screen.c +1 -1
@@ -433,7 +433,7 @@ intelDestroyBuffer(__DRIdrawable * driDrawPriv)* functions. */ -#define CHIPSET (id, name, info) { id, &intel_chipset_##info }, +#define CHIPSET (id, name, info, str) { id, &intel_chipset_##info },struct intel_chipset_map {
Signature · 6 lines
1.7.4.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 16/16 intel: Remove intel_chipsets.h
In reply to Kristian Høgsberg--- src/mesa/drivers/dri/i915/i830_texstate.c | 1 - src/mesa/drivers/dri/i965/brw_defines.h | 2 - src/mesa/drivers/dri/intel/intel_chipset.h | 83 ------------------------- src/mesa/drivers/dri/intel/intel_context.c | 1 - src/mesa/drivers/dri/intel/intel_decode.c | 1 - src/mesa/drivers/dri/intel/intel_extensions.c | 1 - src/mesa/drivers/dri/intel/intel_screen.c | 1 - 7 files changed, 0 insertions(+), 90 deletions(-) delete mode 100644 src/mesa/drivers/dri/intel/intel_chipset.h
src/mesa/drivers/dri/i915/i830_texstate.c +0 -1
@@ -36,7 +36,6 @@#include "i830_context.h" #include "i830_reg.h" -#include "intel_chipset.h" static GLuint
src/mesa/drivers/dri/i965/brw_defines.h +0 -2
@@ -1335,6 +1335,4 @@#define R02_PRIM_END 0x1#define R02_PRIM_START 0x2 -#include "intel_chipset.h" -#endif
src/mesa/drivers/dri/intel/intel_chipset.h deleted +0 -83
83 lines not on this page · raw message
src/mesa/drivers/dri/intel/intel_context.c +0 -1
@@ -40,7 +40,6 @@#include "drivers/common/driverfuncs.h" #include "drivers/common/meta.h" -#include "intel_chipset.h" #include "intel_buffers.h" #include "intel_tex.h" #include "intel_batchbuffer.h"
src/mesa/drivers/dri/intel/intel_decode.c +0 -1
@@ -4,7 +4,6 @@#include <string.h> #include "intel_decode.h" -#include "intel_chipset.h" static FILE *out;static uint32_t saved_s2 =0 , saved_s4 =0 ;
src/mesa/drivers/dri/intel/intel_extensions.c +0 -1
@@ -27,7 +27,6 @@#include "main/mfeatures.h" -#include "intel_chipset.h" #include "intel_context.h" #include "intel_extensions.h" #include "utils.h"
src/mesa/drivers/dri/intel/intel_screen.c +0 -1
@@ -84,7 +84,6 @@ const GLuint __driNConfigOptions = 11;#include "intel_batchbuffer.h" #include "intel_buffers.h" #include "intel_bufmgr.h" -#include "intel_chipset.h" #include "intel_fbo.h" #include "intel_screen.h" #include "intel_tex.h"
Signature · 6 lines
1.7.4.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 11 lines · Kristian Høgsberg
Hi,
Here's a handful of patches that try to replace most of our chipset feature checking with data in a new struct
intel_chipset. It uses the new PCI ID list infrastructure and eliminates allIS_FOOmacros in favor of a per-family chipset info struct. Actually, I was surprised how much in the driver is really just a gen check, but there are a few cases where we have to check a certain feature, as well as all the gen4+ urb and thread limits (includes the recent fix for swapped VS entry counts).
Quoted 4 lines
The series compiles and passes casual testing for me, but I've not run piglit on it yet.
Kristian
This patchset is fantastic. Way better than what I'd been doing. I'm tidying it up a bit and working on a bunch of follow-on cleanups...I'll send out a proposed replacement series tomorrow.
The only concern I have is with the intel_decode changes to use gen. I like the idea, but I'm afraid it may get us into trouble: What if we need G45 specific decoding? We'll -certainly- need Gen 7.5 specific dumping (over and above Gen7), eventually.
ickle's idea to use gen 70 and 75 would solve that...though, in general I agree with Eric in preferring chipset->gen >= 7 and chipset->is_name.
--Kenneth
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
2011/6/8 Kenneth Graunke <[email protected]>:
Quoted 13 lines · Kristian Høgsberg
Quoted 12 lines
Hi,
Here's a handful of patches that try to replace most of our chipset feature checking with data in a new struct
intel_chipset. It uses the new PCI ID list infrastructure and eliminates allIS_FOOmacros in favor of a per-family chipset info struct. Actually, I was surprised how much in the driver is really just a gen check, but there are a few cases where we have to check a certain feature, as well as all the gen4+ urb and thread limits (includes the recent fix for swapped VS entry counts).
Quoted 8 lines
Quoted 4 lines
The series compiles and passes casual testing for me, but I've not run piglit on it yet.
Kristian
This patchset is fantastic. Way better than what I'd been doing. I'm tidying it up a bit and working on a bunch of follow-on cleanups...I'll send out a proposed replacement series tomorrow.
It was a Tuesday morning distraction for me, and now I'm in Denmark for a few days vacation. If you want to take over the patch set, I'd be very happy :) One thing I was thinking about changing was to just pull the chipset inteo the chipset_map array and set that in intelScreen in intel_screen.c, instead including the chipsets again in the big pci id switch.
Quoted 7 lines
The only concern I have is with the
intel_decodechanges to use gen. I like the idea, but I'm afraid it may get us into trouble: What if we need G45 specific decoding? We'll -certainly- need Gen 7.5 specific dumping (over and above Gen7), eventually.ickle's idea to use gen 70 and 75 would solve that...though, in general I agree with Eric in preferring
chipset->gen>= 7 andchipset->is_name.
Chris also suggested sharing the chipset structs so maybe we could just move it all to intel-gpu-tools (and make decode use the chipset struct perhaps) as the canonical location for these chipset definitions. We also have a similar setup in the kernel, but I'm not sure it's practical to consolidate all that. I'd rather get this first step done and then maybe think about further improvements.
Kristian
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx