39274306a6900897f971787709404c06e142e88e
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / libfslvpuwrap / 0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch
1 From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
2 From: Eric Nelson <eric.nelson@boundarydevices.com>
3 Date: Sat, 28 Jun 2014 09:45:09 -0700
4 Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
5
6 IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
7 in the case of failure.
8
9 This problem is being discussed upstream at
10 https://lists.yoctoproject.org/pipermail/meta-freescale/2014-June/008993.html.
11
12 Upstream-Status: Pending
13
14 Signed-off-by: Laci Tele <laci@boundarydevices.com>
15 Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
16 ---
17  vpu_wrapper.c | 4 ++--
18  1 file changed, 2 insertions(+), 2 deletions(-)
19
20 diff --git a/vpu_wrapper.c b/vpu_wrapper.c
21 index 9249174..148c5df 100755
22 --- a/vpu_wrapper.c
23 +++ b/vpu_wrapper.c
24 @@ -6653,7 +6653,7 @@ VpuDecRetCode VPU_DecGetMem(VpuMemDesc* pInOutMem)
25                 return VPU_DEC_RET_FAILURE;
26         }
27         ret=IOGetVirtMem(&buff);
28 -       if(ret==0) //if(ret!=RETCODE_SUCCESS)
29 +       if(ret == -1) //if(ret==MAP_FAILED)
30         {
31                 VPU_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,ret);
32                 return VPU_DEC_RET_FAILURE;
33 @@ -8277,7 +8277,7 @@ VpuEncRetCode VPU_EncGetMem(VpuMemDesc* pInOutMem)
34                 return VPU_ENC_RET_FAILURE;
35         }
36         ret=IOGetVirtMem(&buff);
37 -       if(ret==0) //if(ret!=RETCODE_SUCCESS)
38 +       if(ret == -1) //if(ret==MAP_FAILED)
39         {
40                 VPU_ENC_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,(UINT32)ret);
41                 return VPU_ENC_RET_FAILURE;
42 -- 
43 1.9.1
44