From b0e57f789c2ae266fc51874c480d033309075468 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 8 Aug 2007 16:42:29 +0100 Subject: Hook up pipe flush functionality --- .../drivers/dri/intel_winsys/intel_batchbuffer.c | 1 + src/mesa/drivers/dri/intel_winsys/intel_context.c | 115 ++++++++++----------- 2 files changed, 56 insertions(+), 60 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c b/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c index a85dc0b613..80a3163d55 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_batchbuffer.c @@ -324,6 +324,7 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, r->buf = buffer; r->offset = batch->ptr - batch->map; r->delta = delta; + *(GLuint *) batch->ptr = 0x12345678; } batch->ptr += 4; diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c index 66be3af72b..c1d541199f 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c @@ -250,13 +250,7 @@ intelFlush(GLcontext * ctx) { struct intel_context *intel = intel_context(ctx); - INTEL_FIREVERTICES(intel); - - if (intel->batch->map != intel->batch->ptr) - intel_batchbuffer_flush(intel->batch); - - /* XXX: Need to do an MI_FLUSH here. - */ + intel->pipe->flush( intel->pipe, 0 ); } @@ -317,9 +311,6 @@ intelInitDriverFunctions(struct dd_function_table *functions) functions->GetString = intelGetString; functions->UpdateState = intelInvalidateState; - /* - intelInitTextureFuncs(functions); - */ intelInitBufferFuncs(functions); st_init_driver_functions(functions); @@ -369,56 +360,6 @@ intelCreateContext(const __GLcontextModes * mesaVis, _vbo_CreateContext(ctx); _tnl_CreateContext(ctx); - /* - * Pipe-related setup - */ - if (!getenv("INTEL_HW")) { - intel->pipe = intel_create_softpipe( intel ); - } - else { - switch (intel->intelScreen->deviceID) { - case PCI_CHIP_I945_G: - case PCI_CHIP_I945_GM: - case PCI_CHIP_I945_GME: - case PCI_CHIP_G33_G: - case PCI_CHIP_Q33_G: - case PCI_CHIP_Q35_G: - case PCI_CHIP_I915_G: - case PCI_CHIP_I915_GM: - intel->pipe = intel_create_i915simple( intel ); - break; - default: - _mesa_printf("Unknown PCIID %x in %s, using software driver\n", - intel->intelScreen->deviceID, __FUNCTION__); - - intel->pipe = intel_create_softpipe( intel ); - break; - } - } - - st_create_context( &intel->ctx, intel->pipe ); - - - /* TODO: Push this down into the pipe driver: - */ - switch (intel->intelScreen->deviceID) { - case PCI_CHIP_I945_G: - case PCI_CHIP_I945_GM: - case PCI_CHIP_I945_GME: - case PCI_CHIP_G33_G: - case PCI_CHIP_Q33_G: - case PCI_CHIP_Q35_G: - intel->pipe->mipmap_tree_layout = i945_miptree_layout; - break; - case PCI_CHIP_I915_G: - case PCI_CHIP_I915_GM: - case PCI_CHIP_I830_M: - case PCI_CHIP_I855_GM: - case PCI_CHIP_I865_G: - intel->pipe->mipmap_tree_layout = i915_miptree_layout; - default: - assert(0); /*FIX*/ - } /* @@ -471,6 +412,60 @@ intelCreateContext(const __GLcontextModes * mesaVis, #endif + + + /* + * Pipe-related setup + */ + if (!getenv("INTEL_HW")) { + intel->pipe = intel_create_softpipe( intel ); + } + else { + switch (intel->intelScreen->deviceID) { + case PCI_CHIP_I945_G: + case PCI_CHIP_I945_GM: + case PCI_CHIP_I945_GME: + case PCI_CHIP_G33_G: + case PCI_CHIP_Q33_G: + case PCI_CHIP_Q35_G: + case PCI_CHIP_I915_G: + case PCI_CHIP_I915_GM: + intel->pipe = intel_create_i915simple( intel ); + break; + default: + _mesa_printf("Unknown PCIID %x in %s, using software driver\n", + intel->intelScreen->deviceID, __FUNCTION__); + + intel->pipe = intel_create_softpipe( intel ); + break; + } + } + + st_create_context( &intel->ctx, intel->pipe ); + + + /* TODO: Push this down into the pipe driver: + */ + switch (intel->intelScreen->deviceID) { + case PCI_CHIP_I945_G: + case PCI_CHIP_I945_GM: + case PCI_CHIP_I945_GME: + case PCI_CHIP_G33_G: + case PCI_CHIP_Q33_G: + case PCI_CHIP_Q35_G: + intel->pipe->mipmap_tree_layout = i945_miptree_layout; + break; + case PCI_CHIP_I915_G: + case PCI_CHIP_I915_GM: + case PCI_CHIP_I830_M: + case PCI_CHIP_I855_GM: + case PCI_CHIP_I865_G: + intel->pipe->mipmap_tree_layout = i915_miptree_layout; + default: + assert(0); /*FIX*/ + } + + return GL_TRUE; } -- cgit v1.2.3