Skip to contentSkip to conversation

libfslvpuwrap_1.0.46: fix IOGetVirtMem calls

PATCH Superseded Eric Nelson 2 participants 7 messages Jun 28, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libfslvpuwrap_1.0.46: fix IOGetVirtMem calls

---
 ...-fix-tests-of-return-value-from-IOGetVirt.patch | 39 ++++++++++++++++++++++
 .../libfslvpuwrap/libfslvpuwrap_1.0.46.bb          |  2 ++
 2 files changed, 41 insertions(+)
 create mode 100644 recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch
recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +39 -0
new file mode 100644
index 0000000..e12db3f
@@ -0,0 +1,39 @@
+From 08270a6fefaefee69f2d3d324be06d631a911c80 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <[email protected]>
+Date: Sat, 28 Jun 2014 09:45:09 -0700
+Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
+
+IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
+in the case of failure.
+
+Signed-off-by: Laci Tele <[email protected]>
+Signed-off-by: Eric Nelson <[email protected]>
+---
+ vpu_wrapper.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vpu_wrapper.c b/vpu_wrapper.c
+index 9249174..148c5df 100755
+--- a/vpu_wrapper.c
++++ b/vpu_wrapper.c
+@@ -6653,7 +6653,7 @@ VpuDecRetCode VPU_DecGetMem(VpuMemDesc* pInOutMem)
+ 		return VPU_DEC_RET_FAILURE;
+ 	}
+ 	ret=IOGetVirtMem(&buff);
+-	if(ret==0) //if(ret!=RETCODE_SUCCESS)
++	if(ret == -1) //if(ret==MAP_FAILED)
+ 	{
+ 		VPU_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,ret);
+ 		return VPU_DEC_RET_FAILURE;
+@@ -8277,7 +8277,7 @@ VpuEncRetCode VPU_EncGetMem(VpuMemDesc* pInOutMem)
+ 		return VPU_ENC_RET_FAILURE;
+ 	}
+ 	ret=IOGetVirtMem(&buff);
+-	if(ret==0) //if(ret!=RETCODE_SUCCESS)
++	if(ret == -1) //if(ret==MAP_FAILED)
+ 	{
+ 		VPU_ENC_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,(UINT32)ret);
+ 		return VPU_ENC_RET_FAILURE;
+-- 
+1.9.1
+
recipes-multimedia/libfslvpuwrap/libfslvpuwrap_1.0.46.bb +2 -0
index e4970e2..8cc1523 100644
@@ -10,6 +10,8 @@ SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
 SRC_URI[md5sum] = "1f50110cb6de8ebf767fb9c5f8baf20d"
 SRC_URI[sha256sum] = "7fc1258de338339d19a1a35167393fdc4d773682dfd9b951b197403a075f85fd"
 
+SRC_URI_append = " file://0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch"
+
 inherit fsl-eula-unpack autotools pkgconfig
 
 do_install_append() {
Signature · 1 line
1.9.1
#1 lore raw
Quoted 1 line · Eric Nelson

Missing upstream-status.

Hang tight for V2.

Quoted 6 lines
---
 ...-fix-tests-of-return-value-from-IOGetVirt.patch | 39 ++++++++++++++++++++++
 .../libfslvpuwrap/libfslvpuwrap_1.0.46.bb          |  2 ++
 2 files changed, 41 insertions(+)
 create mode 100644 recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch

Note that we have some similar patches for imx-test and libfslcodec.

#2 lore raw
Quoted 6 lines · Eric Nelson
Quoted 1 line · Eric Nelson

Missing upstream-status.

Hang tight for V2.

:-)

Quoted 9 lines
Quoted 6 lines
---
 ...-fix-tests-of-return-value-from-IOGetVirt.patch | 39 ++++++++++++++++++++++
 .../libfslvpuwrap/libfslvpuwrap_1.0.46.bb          |  2 ++
 2 files changed, 41 insertions(+)
 create mode 100644 recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch

Note that we have some similar patches for imx-test and libfslcodec.

Do you mind to send them all in a patchset? So we can get Lauren to review them in one shot and we can also merge them in one shot.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#3 lore raw

PATCH v2 1/1 libfslvpuwrap_1.0.46: fix IOGetVirtMem calls

In reply to Eric Nelson

---
V2 adds Upstream-Status

 ...-fix-tests-of-return-value-from-IOGetVirt.patch | 41 ++++++++++++++++++++++
 .../libfslvpuwrap/libfslvpuwrap_1.0.46.bb          |  2 ++
 2 files changed, 43 insertions(+)
 create mode 100644 recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch
recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +41 -0
new file mode 100644
index 0000000..ccd2d9e
@@ -0,0 +1,41 @@
+From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <[email protected]>
+Date: Sat, 28 Jun 2014 09:45:09 -0700
+Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
+
+IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
+in the case of failure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Laci Tele <[email protected]>
+Signed-off-by: Eric Nelson <[email protected]>
+---
+ vpu_wrapper.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vpu_wrapper.c b/vpu_wrapper.c
+index 9249174..148c5df 100755
+--- a/vpu_wrapper.c
++++ b/vpu_wrapper.c
+@@ -6653,7 +6653,7 @@ VpuDecRetCode VPU_DecGetMem(VpuMemDesc* pInOutMem)
+ 		return VPU_DEC_RET_FAILURE;
+ 	}
+ 	ret=IOGetVirtMem(&buff);
+-	if(ret==0) //if(ret!=RETCODE_SUCCESS)
++	if(ret == -1) //if(ret==MAP_FAILED)
+ 	{
+ 		VPU_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,ret);
+ 		return VPU_DEC_RET_FAILURE;
+@@ -8277,7 +8277,7 @@ VpuEncRetCode VPU_EncGetMem(VpuMemDesc* pInOutMem)
+ 		return VPU_ENC_RET_FAILURE;
+ 	}
+ 	ret=IOGetVirtMem(&buff);
+-	if(ret==0) //if(ret!=RETCODE_SUCCESS)
++	if(ret == -1) //if(ret==MAP_FAILED)
+ 	{
+ 		VPU_ENC_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,(UINT32)ret);
+ 		return VPU_ENC_RET_FAILURE;
+-- 
+1.9.1
+
recipes-multimedia/libfslvpuwrap/libfslvpuwrap_1.0.46.bb +2 -0
index e4970e2..8cc1523 100644
@@ -10,6 +10,8 @@ SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
 SRC_URI[md5sum] = "1f50110cb6de8ebf767fb9c5f8baf20d"
 SRC_URI[sha256sum] = "7fc1258de338339d19a1a35167393fdc4d773682dfd9b951b197403a075f85fd"
 
+SRC_URI_append = " file://0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch"
+
 inherit fsl-eula-unpack autotools pkgconfig
 
 do_install_append() {
Signature · 1 line
1.9.1
#4 lore raw

Hello Eric,

Quoted 1 line · Eric Nelson

...

recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch line 7

Quoted 4 lines
recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +4 -0
+Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
+
+IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
+in the case of failure.

Please extend the commit log with this info. This is much better to have it in commit log instead of forcing people to find out what 'fix calls' means ;)

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#5 lore raw
Quoted 6 lines · Otavio Salvador

Hello Eric,

Quoted 1 line · Eric Nelson

...

Quoted 9 lines

recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch line 7

Quoted 4 lines
recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +4 -0
+Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
+
+IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
+in the case of failure.

Please extend the commit log with this info. This is much better to have it in commit log instead of forcing people to find out what 'fix calls' means ;)

Okay.

I started to do that, but it felt redundant-redundant...

#6 lore raw

PATCH v3 1/1 libfslvpuwrap_1.0.46: fix IOGetVirtMem calls

In reply to Otavio Salvador

IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED) in the case of failure, and a couple of calls were improperly testing for zero.

---
V2 adds Upstream-Status
V3 expands comment for the recipe update

 ...-fix-tests-of-return-value-from-IOGetVirt.patch | 41 ++++++++++++++++++++++
 .../libfslvpuwrap/libfslvpuwrap_1.0.46.bb          |  2 ++
 2 files changed, 43 insertions(+)
 create mode 100644 recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch
recipes-multimedia/libfslvpuwrap/libfslvpuwrap/0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +41 -0
new file mode 100644
index 0000000..ccd2d9e
@@ -0,0 +1,41 @@
+From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <[email protected]>
+Date: Sat, 28 Jun 2014 09:45:09 -0700
+Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
+
+IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
+in the case of failure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Laci Tele <[email protected]>
+Signed-off-by: Eric Nelson <[email protected]>
+---
+ vpu_wrapper.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vpu_wrapper.c b/vpu_wrapper.c
+index 9249174..148c5df 100755
+--- a/vpu_wrapper.c
++++ b/vpu_wrapper.c
+@@ -6653,7 +6653,7 @@ VpuDecRetCode VPU_DecGetMem(VpuMemDesc* pInOutMem)
+ 		return VPU_DEC_RET_FAILURE;
+ 	}
+ 	ret=IOGetVirtMem(&buff);
+-	if(ret==0) //if(ret!=RETCODE_SUCCESS)
++	if(ret == -1) //if(ret==MAP_FAILED)
+ 	{
+ 		VPU_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,ret);
+ 		return VPU_DEC_RET_FAILURE;
+@@ -8277,7 +8277,7 @@ VpuEncRetCode VPU_EncGetMem(VpuMemDesc* pInOutMem)
+ 		return VPU_ENC_RET_FAILURE;
+ 	}
+ 	ret=IOGetVirtMem(&buff);
+-	if(ret==0) //if(ret!=RETCODE_SUCCESS)
++	if(ret == -1) //if(ret==MAP_FAILED)
+ 	{
+ 		VPU_ENC_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,(UINT32)ret);
+ 		return VPU_ENC_RET_FAILURE;
+-- 
+1.9.1
+
recipes-multimedia/libfslvpuwrap/libfslvpuwrap_1.0.46.bb +2 -0
index e4970e2..8cc1523 100644
@@ -10,6 +10,8 @@ SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"
 SRC_URI[md5sum] = "1f50110cb6de8ebf767fb9c5f8baf20d"
 SRC_URI[sha256sum] = "7fc1258de338339d19a1a35167393fdc4d773682dfd9b951b197403a075f85fd"
 
+SRC_URI_append = " file://0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch"
+
 inherit fsl-eula-unpack autotools pkgconfig
 
 do_install_append() {
Signature · 1 line
1.9.1