diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-10 09:10:16 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-15 12:43:11 +0000 |
commit | bd8fafe0c48df7f138459f590a0e9e8d0c3267b7 (patch) | |
tree | 586b5ddf2c736d146a108d3d692f6814a39425e9 | |
parent | 64ccc6698def517fc37e9ba3c41715626df0e3ca (diff) |
uxa: Kill the complicated in-flight tracking
Reference leak hunting.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/intel.h | 3 | ||||
-rw-r--r-- | src/intel_batchbuffer.c | 24 | ||||
-rw-r--r-- | src/intel_driver.c | 1 | ||||
-rw-r--r-- | src/intel_uxa.c | 52 |
4 files changed, 4 insertions, 76 deletions
diff --git a/src/intel.h b/src/intel.h index 69f7c724..e1c2bb59 100644 --- a/src/intel.h +++ b/src/intel.h @@ -82,7 +82,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. struct intel_pixmap { dri_bo *bo; - struct list flush, batch, in_flight; + struct list flush, batch; uint16_t stride; uint8_t tiling; @@ -189,7 +189,6 @@ typedef struct intel_screen_private { int batch_atomic_limit; struct list batch_pixmaps; struct list flush_pixmaps; - struct list in_flight; drm_intel_bo *wa_scratch_bo; OsTimerPtr cache_expire; diff --git a/src/intel_batchbuffer.c b/src/intel_batchbuffer.c index 2b8fbb6e..8e54d3ad 100644 --- a/src/intel_batchbuffer.c +++ b/src/intel_batchbuffer.c @@ -117,18 +117,6 @@ void intel_batch_teardown(ScrnInfoPtr scrn) while (!list_is_empty(&intel->flush_pixmaps)) list_del(intel->flush_pixmaps.next); - - while (!list_is_empty(&intel->in_flight)) { - struct intel_pixmap *entry; - - entry = list_first_entry(&intel->in_flight, - struct intel_pixmap, - in_flight); - - dri_bo_unreference(entry->bo); - list_del(&entry->in_flight); - free(entry); - } } void intel_batch_do_flush(ScrnInfoPtr scrn) @@ -287,18 +275,6 @@ void intel_batch_submit(ScrnInfoPtr scrn) while (!list_is_empty(&intel->flush_pixmaps)) list_del(intel->flush_pixmaps.next); - while (!list_is_empty(&intel->in_flight)) { - struct intel_pixmap *entry; - - entry = list_first_entry(&intel->in_flight, - struct intel_pixmap, - in_flight); - - dri_bo_unreference(entry->bo); - list_del(&entry->in_flight); - free(entry); - } - if (intel->debug_flush & DEBUG_FLUSH_WAIT) drm_intel_bo_wait_rendering(intel->batch_bo); diff --git a/src/intel_driver.c b/src/intel_driver.c index e2e43faa..606496b8 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -403,7 +403,6 @@ static int intel_init_bufmgr(intel_screen_private *intel) list_init(&intel->batch_pixmaps); list_init(&intel->flush_pixmaps); - list_init(&intel->in_flight); if ((INTEL_INFO(intel)->gen == 60)) { intel->wa_scratch_bo = diff --git a/src/intel_uxa.c b/src/intel_uxa.c index ed4f3753..7fb5a965 100644 --- a/src/intel_uxa.c +++ b/src/intel_uxa.c @@ -641,16 +641,9 @@ void intel_set_pixmap_bo(PixmapPtr pixmap, dri_bo * bo) if (priv->bo == bo) return; - if (list_is_empty(&priv->batch)) { - dri_bo_unreference(priv->bo); - } else if (!drm_intel_bo_is_reusable(priv->bo)) { - dri_bo_unreference(priv->bo); - list_del(&priv->batch); - list_del(&priv->flush); - } else { - list_add(&priv->in_flight, &intel->in_flight); - priv = NULL; - } + dri_bo_unreference(priv->bo); + list_del(&priv->batch); + list_del(&priv->flush); if (intel->render_current_dest == pixmap) intel->render_current_dest = NULL; @@ -1088,45 +1081,6 @@ intel_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth, if (size > intel->max_bo_size || stride >= KB(32)) goto fallback_pixmap; - /* Perform a preliminary search for an in-flight bo */ - if (usage != UXA_CREATE_PIXMAP_FOR_MAP) { - int aligned_h; - - if (tiling == I915_TILING_X) - aligned_h = ALIGN(h, 8); - else if (tiling == I915_TILING_Y) - aligned_h = ALIGN(h, 32); - else - aligned_h = ALIGN(h, 2); - - list_for_each_entry(priv, &intel->in_flight, in_flight) { - if (priv->tiling != tiling) - continue; - - if (tiling == I915_TILING_NONE) { - if (priv->bo->size < size) - continue; - - priv->stride = stride; - } else { - if (priv->stride < stride || - priv->bo->size < priv->stride * aligned_h) - continue; - - stride = priv->stride; - } - - list_del(&priv->in_flight); - intel_set_pixmap_private(pixmap, priv); - - screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, stride, NULL); - - if (!intel_glamor_create_textured_pixmap(pixmap)) - goto fallback_glamor; - return pixmap; - } - } - priv = calloc(1, sizeof (struct intel_pixmap)); if (priv == NULL) goto fallback_pixmap; |