diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2014-11-11 10:12:14 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-11-11 10:14:06 +0800 |
commit | af55b5adc0e5c55d1431a0238e245807d87ac372 (patch) | |
tree | 1897d42099f9cf476ea5cb6cbfa60d6e7e98919c /src | |
parent | 0e96052eb9126ced1c7f844f1e1ac855665ac9d9 (diff) |
Revert "fix issue to create cl image from libva with non-zero offset"
We found this patch cause some serious regressions. Considering it is not
part of the OCL standard API, we choose to revert it for 1.0 release.
This reverts commit b6660fa343e4e80231123695834cc24e3fc5487b.
Diffstat (limited to 'src')
-rw-r--r-- | src/cl_driver.h | 2 | ||||
-rw-r--r-- | src/cl_mem.c | 2 | ||||
-rw-r--r-- | src/intel/intel_driver.c | 4 | ||||
-rw-r--r-- | src/intel/intel_gpgpu.c | 8 |
4 files changed, 9 insertions, 7 deletions
diff --git a/src/cl_driver.h b/src/cl_driver.h index 58bf4893..8697ff2c 100644 --- a/src/cl_driver.h +++ b/src/cl_driver.h @@ -305,7 +305,7 @@ extern cl_buffer_release_from_texture_cb *cl_buffer_release_from_texture; typedef cl_buffer (cl_buffer_get_buffer_from_libva_cb)(cl_context ctx, unsigned int bo_name, size_t *sz); extern cl_buffer_get_buffer_from_libva_cb *cl_buffer_get_buffer_from_libva; -typedef cl_buffer (cl_buffer_get_image_from_libva_cb)(cl_context ctx, unsigned int bo_name, struct _cl_mem_image *image); +typedef cl_buffer (cl_buffer_get_image_from_libva_cb)(cl_context ctx, unsigned int bo_name, struct _cl_mem_image *image, unsigned int offset); extern cl_buffer_get_image_from_libva_cb *cl_buffer_get_image_from_libva; /* Unref a buffer and destroy it if no more ref */ diff --git a/src/cl_mem.c b/src/cl_mem.c index 93918f7d..84e39282 100644 --- a/src/cl_mem.c +++ b/src/cl_mem.c @@ -1914,7 +1914,7 @@ LOCAL cl_mem cl_mem_new_libva_image(cl_context ctx, image = cl_mem_image(mem); - mem->bo = cl_buffer_get_image_from_libva(ctx, bo_name, image); + mem->bo = cl_buffer_get_image_from_libva(ctx, bo_name, image, offset); image->w = width; image->h = height; diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c index f627f98e..fc037cc8 100644 --- a/src/intel/intel_driver.c +++ b/src/intel/intel_driver.c @@ -675,13 +675,15 @@ cl_buffer intel_share_buffer_from_libva(cl_context ctx, cl_buffer intel_share_image_from_libva(cl_context ctx, unsigned int bo_name, - struct _cl_mem_image *image) + struct _cl_mem_image *image, + unsigned int offset) { drm_intel_bo *intel_bo; uint32_t intel_tiling, intel_swizzle_mode; intel_bo = intel_driver_share_buffer((intel_driver_t *)ctx->drv, "shared from libva", bo_name); + intel_bo->offset += offset; drm_intel_bo_get_tiling(intel_bo, &intel_tiling, &intel_swizzle_mode); image->tiling = get_cl_tiling(intel_tiling); diff --git a/src/intel/intel_gpgpu.c b/src/intel/intel_gpgpu.c index f901330c..5898906b 100644 --- a/src/intel/intel_gpgpu.c +++ b/src/intel/intel_gpgpu.c @@ -1061,7 +1061,7 @@ intel_gpgpu_bind_image_gen7(intel_gpgpu_t *gpgpu, ss->ss0.surface_array_spacing = 1; } ss->ss0.surface_format = format; - ss->ss1.base_addr = obj_bo->offset + obj_bo_offset; + ss->ss1.base_addr = obj_bo->offset; ss->ss2.width = w - 1; ss->ss2.height = h - 1; @@ -1078,7 +1078,7 @@ intel_gpgpu_bind_image_gen7(intel_gpgpu_t *gpgpu, ss->ss0.tile_walk = I965_TILEWALK_YMAJOR; } ss->ss0.render_cache_rw_mode = 1; /* XXX do we need to set it? */ - intel_gpgpu_set_buf_reloc_gen7(gpgpu, index, obj_bo, obj_bo->offset + obj_bo_offset); + intel_gpgpu_set_buf_reloc_gen7(gpgpu, index, obj_bo, obj_bo_offset); assert(index < GEN_MAX_SURFACES); } @@ -1106,7 +1106,7 @@ intel_gpgpu_bind_image_gen75(intel_gpgpu_t *gpgpu, ss->ss0.surface_array_spacing = 1; } ss->ss0.surface_format = format; - ss->ss1.base_addr = obj_bo->offset + obj_bo_offset; + ss->ss1.base_addr = obj_bo->offset; ss->ss2.width = w - 1; ss->ss2.height = h - 1; ss->ss3.depth = depth - 1; @@ -1126,7 +1126,7 @@ intel_gpgpu_bind_image_gen75(intel_gpgpu_t *gpgpu, ss->ss0.tile_walk = I965_TILEWALK_YMAJOR; } ss->ss0.render_cache_rw_mode = 1; /* XXX do we need to set it? */ - intel_gpgpu_set_buf_reloc_gen7(gpgpu, index, obj_bo, obj_bo->offset + obj_bo_offset); + intel_gpgpu_set_buf_reloc_gen7(gpgpu, index, obj_bo, obj_bo_offset); assert(index < GEN_MAX_SURFACES); } |