[FFmpeg-devel] [PATCH 1/2] OpenCL: Fix ABI incompatibility issues

Michael Niedermayer michaelni at gmx.at
Mon Apr 27 13:26:57 CEST 2015


On Mon, Apr 27, 2015 at 07:51:33AM +0000, Gupta, Maneesh wrote:
> Hi,
> 
> This patch attempts to fix the ABI incompatibility issues in the OpenCL code. Please review it and let me know if there is anything that I missed addressing in this patch.
> 
> Regards,
> Maneesh

>  opencl.c |   42 ++++++++++++++++++++++++++++++++++++++----
>  opencl.h |   10 ++--------
>  2 files changed, 40 insertions(+), 12 deletions(-)
> 091096c9ceb25f09140cbf6e4551c879a84696b4  0001-OpenCL-Fix-ABI-incompatibility-issues.patch
> From 29a69771bd95e230525b67f24694a68ac8ebbade Mon Sep 17 00:00:00 2001
> From: Maneesh Gupta <maneesh.gupta at amd.com>
> Date: Sat, 25 Apr 2015 11:16:35 +0530

> Subject: [PATCH 1/2] OpenCL: Fix ABI incompatibility issues

this commit message is unacceptable

its too terse
please explain, what is changed, why it is changed, and how this is
achived in the commit message


> 
> Signed-off-by: Maneesh Gupta <maneesh.gupta at amd.com>
> ---
>  libavutil/opencl.c | 42 ++++++++++++++++++++++++++++++++++++++----
>  libavutil/opencl.h | 10 ++--------
>  2 files changed, 40 insertions(+), 12 deletions(-)
> 
> diff --git a/libavutil/opencl.c b/libavutil/opencl.c
> index 2df5653..38a4d6f 100644
> --- a/libavutil/opencl.c
> +++ b/libavutil/opencl.c
> @@ -181,9 +181,11 @@ static void free_device_list(AVOpenCLDeviceList *device_list)
>          if (!device_list->platform_node[i])
>              continue;
>          for (j = 0; j < device_list->platform_node[i]->device_num; j++) {
> +            av_freep(&(device_list->platform_node[i]->device_node[j]->device_name));
>              av_freep(&(device_list->platform_node[i]->device_node[j]));
>          }
>          av_freep(&device_list->platform_node[i]->device_node);
> +        av_freep(&(device_list->platform_node[i]->platform_name));
>          av_freep(&device_list->platform_node[i]);
>      }
>      av_freep(&device_list->platform_node);
> @@ -198,6 +200,8 @@ static int get_device_list(AVOpenCLDeviceList *device_list)
>      cl_platform_id *platform_ids = NULL;
>      cl_device_id *device_ids = NULL;
>      AVOpenCLDeviceNode *device_node = NULL;
> +    size_t platform_name_size = 0;
> +    size_t device_name_size = 0;
>      status = clGetPlatformIDs(0, NULL, &device_list->platform_num);
>      if (status != CL_SUCCESS) {
>          av_log(&opencl_ctx, AV_LOG_ERROR,
> @@ -232,8 +236,25 @@ static int get_device_list(AVOpenCLDeviceList *device_list)
>          }
>          device_list->platform_node[i]->platform_id = platform_ids[i];
>          status = clGetPlatformInfo(platform_ids[i], CL_PLATFORM_VENDOR,
> -                                   sizeof(device_list->platform_node[i]->platform_name),
> -                                   device_list->platform_node[i]->platform_name, NULL);
> +                                   0, NULL, &platform_name_size);
> +        if (status != CL_SUCCESS) {
> +            av_log(&opencl_ctx, AV_LOG_WARNING,
> +                    "Could not get size of platform name: %s\n", av_opencl_errstr(status));
> +        } else {

> +            device_list->platform_node[i]->platform_name = (char*)av_malloc(platform_name_size * sizeof(char));

useless cast


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150427/9aa17dd4/attachment.asc>


More information about the ffmpeg-devel mailing list