[Mesa-dev] [PATCH 14/17] Modified i915 intel_bufferobj_data to use _mesa_align_malloc instead of malloc.

Siavash Eliasi siavashserver at gmail.com
Sun Nov 24 21:36:44 PST 2013


---
 src/mesa/drivers/dri/i915/intel_buffer_objects.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_buffer_objects.c b/src/mesa/drivers/dri/i915/intel_buffer_objects.c
index bc58c70..4fbf954 100644
--- a/src/mesa/drivers/dri/i915/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/i915/intel_buffer_objects.c
@@ -137,7 +137,7 @@ intel_bufferobj_data(struct gl_context * ctx,
        * contents anyway.
        */
       if (target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER) {
-	 intel_obj->sys_buffer = malloc(size);
+	 intel_obj->sys_buffer = _mesa_align_malloc(size, ctx->Const.MinMapBufferAlignment);
 	 if (intel_obj->sys_buffer != NULL) {
 	    if (data != NULL)
 	       memcpy(intel_obj->sys_buffer, data, size);
@@ -337,7 +337,7 @@ intel_bufferobj_map_range(struct gl_context * ctx,
    if ((access & GL_MAP_INVALIDATE_RANGE_BIT) &&
        drm_intel_bo_busy(intel_obj->buffer)) {
       if (access & GL_MAP_FLUSH_EXPLICIT_BIT) {
-	 intel_obj->range_map_buffer = malloc(length);
+	 intel_obj->range_map_buffer = _mesa_align_malloc(length, ctx->Const.MinMapBufferAlignment);
 	 obj->Pointer = intel_obj->range_map_buffer;
       } else {
 	 intel_obj->range_map_bo = drm_intel_bo_alloc(intel->bufmgr,
-- 
1.8.4.2



More information about the mesa-dev mailing list