Runtime: fix a cl_gpgpu_bind_image_for_vme NULL SIGSEGV.

Submitted by Yang, Rong R on July 21, 2017, 4:11 a.m.

Details

Message ID 1500610265-17663-1-git-send-email-rong.r.yang@intel.com
State New
Headers show
Series "Runtime: fix a cl_gpgpu_bind_image_for_vme NULL SIGSEGV." ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

Yang, Rong R July 21, 2017, 4:11 a.m.
Signed-off-by: Yang Rong <rong.r.yang@intel.com>
---
 src/cl_command_queue.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/cl_command_queue.c b/src/cl_command_queue.c
index 43ff8fe..93902c8 100644
--- a/src/cl_command_queue.c
+++ b/src/cl_command_queue.c
@@ -155,7 +155,8 @@  cl_command_queue_bind_image(cl_command_queue queue, cl_kernel k, cl_gpgpu gpgpu,
                           image->w, image->h, image->depth,
                           image->row_pitch, image->slice_pitch, (cl_gpgpu_tiling)image->tiling);
     //We always setup media surface state, so this surface can be used for vme
-    else if( (image->fmt.image_channel_order == CL_R) && (image->fmt.image_channel_data_type == CL_UNORM_INT8) )
+    else if ((image->fmt.image_channel_order == CL_R) && (image->fmt.image_channel_data_type == CL_UNORM_INT8) &&
+             cl_gpgpu_bind_image_for_vme)
       cl_gpgpu_bind_image_for_vme(gpgpu, k->images[i].idx + BTI_WORKAROUND_IMAGE_OFFSET, image->base.bo,
                           image->offset + k->args[id].mem->offset,
                           image->intel_fmt, image->image_type, image->bpp,

Comments

LGTM! the function pointer may be null for some platform.

Thanks!
Ruiling

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> Yang Rong

> Sent: Friday, July 21, 2017 12:11 PM

> To: beignet@lists.freedesktop.org

> Cc: Yang, Rong R <rong.r.yang@intel.com>

> Subject: [Beignet] [PATCH] Runtime: fix a cl_gpgpu_bind_image_for_vme NULL

> SIGSEGV.

> 

> Signed-off-by: Yang Rong <rong.r.yang@intel.com>

> ---

>  src/cl_command_queue.c | 3 ++-

>  1 file changed, 2 insertions(+), 1 deletion(-)

> 

> diff --git a/src/cl_command_queue.c b/src/cl_command_queue.c

> index 43ff8fe..93902c8 100644

> --- a/src/cl_command_queue.c

> +++ b/src/cl_command_queue.c

> @@ -155,7 +155,8 @@ cl_command_queue_bind_image(cl_command_queue

> queue, cl_kernel k, cl_gpgpu gpgpu,

>                            image->w, image->h, image->depth,

>                            image->row_pitch, image->slice_pitch, (cl_gpgpu_tiling)image-

> >tiling);

>      //We always setup media surface state, so this surface can be used for vme

> -    else if( (image->fmt.image_channel_order == CL_R) && (image-

> >fmt.image_channel_data_type == CL_UNORM_INT8) )

> +    else if ((image->fmt.image_channel_order == CL_R) && (image-

> >fmt.image_channel_data_type == CL_UNORM_INT8) &&

> +             cl_gpgpu_bind_image_for_vme)

>        cl_gpgpu_bind_image_for_vme(gpgpu, k->images[i].idx +

> BTI_WORKAROUND_IMAGE_OFFSET, image->base.bo,

>                            image->offset + k->args[id].mem->offset,

>                            image->intel_fmt, image->image_type, image->bpp,

> --

> 2.1.4

> 

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/beignet