diff options
Diffstat (limited to 'src/mesa/drivers/dri')
4 files changed, 22 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c index f565e2ccf8..31de96dc84 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 78f5cb6519..d7de57227b 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 4fb8f02daa..d6ba6024b2 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 5407973fba..7a93546bc2 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 ); } |