identify context switches between members of a share group -
ie. multiple contexts in a single application, possibly on different
threads. In this case the contexts share a bufmgr instance and there
is no need to evict textures - so don't.
2) Use a new flag 'need_flush' to ensure hardware rendering is flushed
prior to starting a software fallback.
brw_emit_prim(brw, &prim[i]);
}
brw_emit_prim(brw, &prim[i]);
}
+ intel->need_flush = GL_TRUE;
int bmValidateBuffers( struct intel_context * );
void bmReleaseBuffers( struct intel_context * );
int bmValidateBuffers( struct intel_context * );
void bmReleaseBuffers( struct intel_context * );
+GLuint bmCtxId( struct intel_context *intel );
+
GLboolean bmError( struct intel_context * );
void bmEvictAll( struct intel_context * );
GLboolean bmError( struct intel_context * );
void bmEvictAll( struct intel_context * );
struct block fenced; /* after bmFenceBuffers (mi_flush, emit irq, write dword) */
/* then to pool->lru or free() */
struct block fenced; /* after bmFenceBuffers (mi_flush, emit irq, write dword) */
/* then to pool->lru or free() */
unsigned last_fence;
unsigned free_on_hardware;
unsigned last_fence;
unsigned free_on_hardware;
make_empty_list(&bm.referenced);
make_empty_list(&bm.fenced);
make_empty_list(&bm.on_hardware);
make_empty_list(&bm.referenced);
make_empty_list(&bm.fenced);
make_empty_list(&bm.on_hardware);
+
+ /* The context id of any of the share group. This won't be used
+ * in communication with the kernel, so it doesn't matter if
+ * this context is eventually deleted.
+ */
+ bm.ctxId = intel->hHWContext;
LOCK(bm);
{
struct block *block, *tmp;
LOCK(bm);
{
struct block *block, *tmp;
foreach_s (block, tmp, &bm->referenced) {
foreach_s (block, tmp, &bm->referenced) {
+
+
+GLuint bmCtxId( struct intel_context *intel )
+{
+ return intel->bm->ctxId;
+}
-static void lost_hardware( struct intel_context *intel )
-{
- bm_fake_NotifyContendedLockTake( intel );
- intel->vtbl.lost_hardware( intel );
-}
-
static void intelContendedLock( struct intel_context *intel, GLuint flags )
{
__DRIdrawablePrivate *dPriv = intel->driDrawable;
__DRIscreenPrivate *sPriv = intel->driScreen;
volatile drmI830Sarea * sarea = intel->sarea;
int me = intel->hHWContext;
static void intelContendedLock( struct intel_context *intel, GLuint flags )
{
__DRIdrawablePrivate *dPriv = intel->driDrawable;
__DRIscreenPrivate *sPriv = intel->driScreen;
volatile drmI830Sarea * sarea = intel->sarea;
int me = intel->hHWContext;
+ int my_bufmgr = bmCtxId(intel);
drmGetLock(intel->driFd, intel->hHWContext, flags);
drmGetLock(intel->driFd, intel->hHWContext, flags);
/* Lost context?
*/
if (sarea->ctxOwner != me) {
/* Lost context?
*/
if (sarea->ctxOwner != me) {
+ DBG("Lost Context: sarea->ctxOwner %x me %x\n", sarea->ctxOwner, me);
+ intel->vtbl.lost_hardware( intel );
+ }
+
+ /* As above, but don't evict the texture data on transitions
+ * between contexts which all share a local buffer manager.
+ */
+ if (sarea->texAge != my_bufmgr) {
+ DBG("Lost Textures: sarea->texAge %x my_bufmgr %x\n", sarea->ctxOwner, my_bufmgr);
+ sarea->texAge = my_bufmgr;
+ bm_fake_NotifyContendedLockTake( intel );
{
struct intel_context *intel = intel_context(ctx);
{
struct intel_context *intel = intel_context(ctx);
+ if (intel->need_flush) {
+ LOCK_HARDWARE(intel);
+ intel->vtbl.emit_flush(intel, 0);
+ intel_batchbuffer_flush(intel->batch);
+ intel->need_flush = 0;
+ UNLOCK_HARDWARE(intel);
+ intelFinish(intel);
+ }
+
+
LOCK_HARDWARE(intel);
/* Just map the framebuffer and all textures. Bufmgr code will
LOCK_HARDWARE(intel);
/* Just map the framebuffer and all textures. Bufmgr code will