Once a buffer has been named, drm_intel_bo_flink() is just a getter.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
else
last_mt = rb->singlesample_mt;
- if (last_mt && last_mt->region->name == buffer->name)
+ /* Get the name for our previous RB mt. We know it had a name already (and
+ * thus the DRM call is just a getter), because it could only have been
+ * allocated by a previous intel_process_dri2_buffer(), so
+ * drm_intel_bo_flink() is just a getter.
+ */
+ uint32_t old_name = 0;
+ if (last_mt)
+ drm_intel_bo_flink(last_mt->region->bo, &old_name);
+
+ if (old_name == buffer->name)
return;
if (unlikely(INTEL_DEBUG & DEBUG_DRI)) {
if (!singlesample_mt)
goto fail;
- singlesample_mt->region->name = region->name;
-
/* If this miptree is capable of supporting fast color clears, set
* mcs_state appropriately to ensure that fast clears will occur.
* Allocation of the MCS miptree will be deferred until the first fast
return region;
}
-bool
-intel_region_flink(struct intel_region *region, uint32_t *name)
-{
- if (region->name == 0) {
- if (drm_intel_bo_flink(region->bo, ®ion->name))
- return false;
- }
-
- *name = region->name;
-
- return true;
-}
-
struct intel_region *
intel_region_alloc_for_handle(struct intel_screen *screen,
GLuint cpp,
return NULL;
}
- region->name = handle;
-
return region;
}
GLuint pitch; /**< in bytes */
uint32_t tiling; /**< Which tiling mode the region is in */
-
- uint32_t name; /**< Global name for the bo */
};
GLuint size,
int fd, const char *name);
-bool
-intel_region_flink(struct intel_region *region, uint32_t *name);
-
void intel_region_reference(struct intel_region **dst,
struct intel_region *src);
*value = image->region->bo->handle;
return true;
case __DRI_IMAGE_ATTRIB_NAME:
- return intel_region_flink(image->region, (uint32_t *) value);
+ return !drm_intel_bo_flink(image->region->bo, (uint32_t *) value);
case __DRI_IMAGE_ATTRIB_FORMAT:
*value = image->dri_format;
return true;
return NULL;
}
- intel_region_flink(intelBuffer->region, &intelBuffer->base.name);
+ drm_intel_bo_flink(intelBuffer->region->bo, &intelBuffer->base.name);
intelBuffer->base.attachment = attachment;
intelBuffer->base.cpp = intelBuffer->region->cpp;