mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 04:00:10 +01:00
Remove winsys->wait_idle(), subsumed by pipe->flush().
Connect intel_i915_batch_finish() into i915_winsys, just like intel_i915_batch_flush(). Call i915_winsys->batch_finish() in response to pipe->flush(PIPE_FLUSH_WAIT). Now all the batchbuffer/fence code is in one place and a little cleaner.
This commit is contained in:
parent
ae44a81d1b
commit
3fe055ec92
6 changed files with 10 additions and 25 deletions
|
|
@ -120,6 +120,13 @@ static void intel_i915_batch_flush( struct i915_winsys *sws )
|
|||
}
|
||||
|
||||
|
||||
static void intel_i915_batch_finish( struct i915_winsys *sws )
|
||||
{
|
||||
struct intel_context *intel = intel_i915_winsys(sws)->intel;
|
||||
intel_batchbuffer_finish( intel->batch );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create i915 hardware rendering context.
|
||||
*/
|
||||
|
|
@ -136,6 +143,7 @@ intel_create_i915simple( struct intel_context *intel,
|
|||
iws->winsys.batch_dword = intel_i915_batch_dword;
|
||||
iws->winsys.batch_reloc = intel_i915_batch_reloc;
|
||||
iws->winsys.batch_flush = intel_i915_batch_flush;
|
||||
iws->winsys.batch_finish = intel_i915_batch_finish;
|
||||
iws->intel = intel;
|
||||
|
||||
/* Create the i915simple context:
|
||||
|
|
|
|||
|
|
@ -157,20 +157,6 @@ intel_user_buffer_create(struct pipe_winsys *winsys, void *ptr, unsigned bytes)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
intel_wait_idle( struct pipe_winsys *winsys, void *context_private )
|
||||
{
|
||||
struct intel_context *intel = (struct intel_context *) context_private;
|
||||
|
||||
if (intel->batch->last_fence) {
|
||||
driFenceFinish(intel->batch->last_fence,
|
||||
DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE);
|
||||
driFenceUnReference(intel->batch->last_fence);
|
||||
intel->batch->last_fence = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* The state tracker (should!) keep track of whether the fake
|
||||
* frontbuffer has been touched by any rendering since the last time
|
||||
* we copied its contents to the real frontbuffer. Our task is easy:
|
||||
|
|
@ -311,7 +297,6 @@ intel_create_pipe_winsys( int fd )
|
|||
iws->winsys.buffer_subdata = intel_buffer_subdata;
|
||||
iws->winsys.buffer_get_subdata = intel_buffer_get_subdata;
|
||||
iws->winsys.flush_frontbuffer = intel_flush_frontbuffer;
|
||||
iws->winsys.wait_idle = intel_wait_idle;
|
||||
iws->winsys.printf = intel_printf;
|
||||
iws->winsys.get_name = intel_get_name;
|
||||
iws->winsys.region_alloc = intel_i915_region_alloc;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ static void i915_flush( struct pipe_context *pipe,
|
|||
FLUSH_BATCH();
|
||||
|
||||
if (flags & PIPE_FLUSH_WAIT) {
|
||||
i915->pipe.winsys->wait_idle(i915->pipe.winsys, i915->pipe.private);
|
||||
i915->winsys->batch_finish(i915->winsys);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ struct i915_winsys {
|
|||
unsigned delta );
|
||||
|
||||
void (*batch_flush)( struct i915_winsys *sws );
|
||||
void (*batch_finish)( struct i915_winsys *sws );
|
||||
};
|
||||
|
||||
#define I915_BUFFER_ACCESS_WRITE 0x1
|
||||
|
|
|
|||
|
|
@ -63,9 +63,6 @@ struct pipe_winsys
|
|||
/** Returns name of this winsys interface */
|
||||
const char *(*get_name)( struct pipe_winsys *sws );
|
||||
|
||||
/** Wait for any buffered rendering to finish */
|
||||
void (*wait_idle)( struct pipe_winsys *sws, void *context_private );
|
||||
|
||||
/**
|
||||
* Do any special operations to ensure frontbuffer contents are
|
||||
* displayed, eg copy fake frontbuffer.
|
||||
|
|
|
|||
|
|
@ -167,11 +167,6 @@ xm_flush_frontbuffer(struct pipe_winsys *pws,
|
|||
*/
|
||||
}
|
||||
|
||||
static void
|
||||
xm_wait_idle(struct pipe_winsys *pws, void *context_private)
|
||||
{
|
||||
/* no-op */
|
||||
}
|
||||
|
||||
static void
|
||||
xm_printf(struct pipe_winsys *pws, const char *fmtString, ...)
|
||||
|
|
@ -343,7 +338,6 @@ xmesa_get_pipe_winsys(void)
|
|||
ws->surface_release = xm_surface_release;
|
||||
|
||||
ws->flush_frontbuffer = xm_flush_frontbuffer;
|
||||
ws->wait_idle = xm_wait_idle;
|
||||
ws->printf = xm_printf;
|
||||
ws->get_name = xm_get_name;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue