From: Brian Date: Wed, 7 Nov 2007 18:44:48 +0000 (-0700) Subject: Pass winsys as a parameter to intel_create_i915simple(), intel_create_softpipe() X-Git-Tag: 062012170305~17580^2~390^2~3370 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2611703b363ced1ad267d120ed89677299a36d9c;p=profile%2Fivi%2Fmesa.git Pass winsys as a parameter to intel_create_i915simple(), intel_create_softpipe() --- diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c index f565e2c..31de96d 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c @@ -144,6 +144,7 @@ intelCreateContext(const __GLcontextModes * visual, int fthrottle_mode; GLboolean havePools; struct pipe_context *pipe; + struct pipe_winsys *winsys; struct st_context *st_share = NULL; if (sharedContextPrivate) { @@ -186,12 +187,13 @@ intelCreateContext(const __GLcontextModes * visual, __intel_debug = driParseDebugString(getenv("INTEL_DEBUG"), debug_control); #endif + winsys = intel_create_pipe_winsys( intel ); /* * Pipe-related setup */ if (!getenv("INTEL_HW")) { - pipe = intel_create_softpipe( intel ); + pipe = intel_create_softpipe( intel, winsys ); } else { switch (intel->intelScreen->deviceID) { @@ -203,13 +205,13 @@ intelCreateContext(const __GLcontextModes * visual, case PCI_CHIP_Q35_G: case PCI_CHIP_I915_G: case PCI_CHIP_I915_GM: - pipe = intel_create_i915simple( intel ); + pipe = intel_create_i915simple( intel, winsys ); break; default: fprintf(stderr, "Unknown PCIID %x in %s, using software driver\n", intel->intelScreen->deviceID, __FUNCTION__); - pipe = intel_create_softpipe( intel ); + pipe = intel_create_softpipe( intel, winsys ); break; } } diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys.h b/src/mesa/drivers/dri/intel_winsys/intel_winsys.h index 78f5cb6..d7de572 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_winsys.h +++ b/src/mesa/drivers/dri/intel_winsys/intel_winsys.h @@ -38,10 +38,12 @@ struct pipe_winsys * intel_create_pipe_winsys( struct intel_context *intel ); struct pipe_context * -intel_create_softpipe( struct intel_context *intel ); +intel_create_softpipe( struct intel_context *intel, + struct pipe_winsys *winsys ); struct pipe_context * -intel_create_i915simple( struct intel_context *intel ); +intel_create_i915simple( struct intel_context *intel, + struct pipe_winsys *winsys ); diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_i915.c b/src/mesa/drivers/dri/intel_winsys/intel_winsys_i915.c index 4fb8f02..d6ba602 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_i915.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_winsys_i915.c @@ -120,9 +120,12 @@ static void intel_i915_batch_flush( struct i915_winsys *sws ) } - +/** + * Create i915 hardware rendering context. + */ struct pipe_context * -intel_create_i915simple( struct intel_context *intel ) +intel_create_i915simple( struct intel_context *intel, + struct pipe_winsys *winsys ) { struct intel_i915_winsys *iws = CALLOC_STRUCT( intel_i915_winsys ); @@ -137,7 +140,7 @@ intel_create_i915simple( struct intel_context *intel ) /* Create the i915simple context: */ - return i915_create( intel_create_pipe_winsys(intel), - &iws->winsys, + return i915_create( winsys, + &iws->winsys, intel->intelScreen->deviceID ); } diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c b/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c index 5407973..7a93546 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_winsys_softpipe.c @@ -58,8 +58,12 @@ intel_is_format_supported(struct softpipe_winsys *sws, uint format) } +/** + * Create rendering context which uses software rendering. + */ struct pipe_context * -intel_create_softpipe( struct intel_context *intel ) +intel_create_softpipe( struct intel_context *intel, + struct pipe_winsys *winsys ) { struct intel_softpipe_winsys *isws = CALLOC_STRUCT( intel_softpipe_winsys ); @@ -71,6 +75,5 @@ intel_create_softpipe( struct intel_context *intel ) /* Create the softpipe context: */ - return softpipe_create( intel_create_pipe_winsys( intel ), - &isws->sws ); + return softpipe_create( winsys, &isws->sws ); }