/* brw_performance_query.c */
void brw_init_performance_queries(struct brw_context *brw);
-/* intel_buffer_objects.c */
-int brw_bo_map(struct brw_context *brw, drm_bacon_bo *bo, int write_enable,
- const char *bo_name);
-int brw_bo_map_gtt(struct brw_context *brw, drm_bacon_bo *bo,
- const char *bo_name);
-
/* intel_extensions.c */
extern void intelInitExtensions(struct gl_context *ctx);
#include "intel_buffer_objects.h"
#include "intel_batchbuffer.h"
-/**
- * Map a buffer object; issue performance warnings if mapping causes stalls.
- *
- * This matches the drm_bacon_bo_map API, but takes an additional human-readable
- * name for the buffer object to use in the performance debug message.
- */
-int
-brw_bo_map(struct brw_context *brw,
- drm_bacon_bo *bo, int write_enable,
- const char *bo_name)
-{
- if (likely(!brw->perf_debug) || !drm_bacon_bo_busy(bo))
- return drm_bacon_bo_map(bo, write_enable);
-
- double start_time = get_time();
-
- int ret = drm_bacon_bo_map(bo, write_enable);
-
- perf_debug("CPU mapping a busy %s BO stalled and took %.03f ms.\n",
- bo_name, (get_time() - start_time) * 1000);
-
- return ret;
-}
-
-int
-brw_bo_map_gtt(struct brw_context *brw, drm_bacon_bo *bo, const char *bo_name)
-{
- if (likely(!brw->perf_debug) || !drm_bacon_bo_busy(bo))
- return drm_bacon_gem_bo_map_gtt(bo);
-
- double start_time = get_time();
-
- int ret = drm_bacon_gem_bo_map_gtt(bo);
-
- perf_debug("GTT mapping a busy %s BO stalled and took %.03f ms.\n",
- bo_name, (get_time() - start_time) * 1000);
-
- return ret;
-}
-
static void
mark_buffer_gpu_usage(struct intel_buffer_object *intel_obj,
uint32_t offset, uint32_t size)
intel_obj->map_extra[index],
alignment);
if (brw->has_llc) {
- brw_bo_map(brw, intel_obj->range_map_bo[index],
- (access & GL_MAP_WRITE_BIT) != 0, "range-map");
+ drm_bacon_bo_map(intel_obj->range_map_bo[index],
+ (access & GL_MAP_WRITE_BIT) != 0);
} else {
drm_bacon_gem_bo_map_gtt(intel_obj->range_map_bo[index]);
}
drm_bacon_gem_bo_map_gtt(intel_obj->buffer);
mark_buffer_inactive(intel_obj);
} else {
- brw_bo_map(brw, intel_obj->buffer, (access & GL_MAP_WRITE_BIT) != 0,
- "MapBufferRange");
+ drm_bacon_bo_map(intel_obj->buffer, (access & GL_MAP_WRITE_BIT) != 0);
mark_buffer_inactive(intel_obj);
}
*
* Note: the clear value for MCS buffers is all 1's, so we memset to 0xff.
*/
- const int ret = brw_bo_map_gtt(brw, mt->mcs_buf->bo, "miptree");
+ const int ret = drm_bacon_gem_bo_map_gtt(mt->mcs_buf->bo);
if (unlikely(ret)) {
fprintf(stderr, "Failed to map mcs buffer into GTT\n");
drm_bacon_bo_unreference(mt->mcs_buf->bo);
* long as cache consistency is maintained).
*/
if (mt->tiling != I915_TILING_NONE || mt->is_scanout)
- brw_bo_map_gtt(brw, bo, "miptree");
+ drm_bacon_gem_bo_map_gtt(bo);
else
- brw_bo_map(brw, bo, true, "miptree");
+ drm_bacon_bo_map(bo, true);
return bo->virtual;
}