linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] v4l2-compliance: Improve test readability when fail
@ 2016-05-09 15:44 Helen Koike
  2016-06-27  9:07 ` Hans Verkuil
  0 siblings, 1 reply; 2+ messages in thread
From: Helen Koike @ 2016-05-09 15:44 UTC (permalink / raw)
  To: linux-media, hans.verkuil; +Cc: Helen Koike

In case of failure, print "q.create_bufs(node, 1, &fmt) != EINVAL" instead
of "ret != EINVAL"

Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
---

Hello,

I was wondering, why the q.create_bufs is expected to should return EINVAL in this test? The height and size are set to half of the original values, and the type and memory doesn't seems to change.

Thank you

 utils/v4l2-compliance/v4l2-test-buffers.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index 6c5ed55..fb14170 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -955,8 +955,7 @@ int testMmap(struct node *node, unsigned frame_count)
 				fmt.s_height(fmt.g_height() / 2);
 				for (unsigned p = 0; p < fmt.g_num_planes(); p++)
 					fmt.s_sizeimage(fmt.g_sizeimage(p) / 2, p);
-				ret = q.create_bufs(node, 1, &fmt);
-				fail_on_test(ret != EINVAL);
+				fail_on_test(q.create_bufs(node, 1, &fmt) != EINVAL);
 				fail_on_test(testQueryBuf(node, cur_fmt.type, q.g_buffers()));
 				fmt = cur_fmt;
 				for (unsigned p = 0; p < fmt.g_num_planes(); p++)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] v4l2-compliance: Improve test readability when fail
  2016-05-09 15:44 [PATCH] v4l2-compliance: Improve test readability when fail Helen Koike
@ 2016-06-27  9:07 ` Hans Verkuil
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2016-06-27  9:07 UTC (permalink / raw)
  To: Helen Koike, linux-media

On 05/09/2016 05:44 PM, Helen Koike wrote:
> In case of failure, print "q.create_bufs(node, 1, &fmt) != EINVAL" instead
> of "ret != EINVAL"
> 
> Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
> ---
> 
> Hello,
> 
> I was wondering, why the q.create_bufs is expected to should return EINVAL in this test? The height and size are set to half of the original values, and the type and memory doesn't seems to change.

For all drivers currently in the kernel the buffer size that create_bufs wants should be >= the size
of the current format.

This checks if the drivers perform that test correctly.

In theory it should be possible to allocate smaller buffers as well and drivers that
allow on-the-fly format changes, but such drivers do not exist today.

If such drivers arrive, then this test should probably be modified.

Regards,

	Hans

> 
> Thank you
> 
>  utils/v4l2-compliance/v4l2-test-buffers.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
> index 6c5ed55..fb14170 100644
> --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
> @@ -955,8 +955,7 @@ int testMmap(struct node *node, unsigned frame_count)
>  				fmt.s_height(fmt.g_height() / 2);
>  				for (unsigned p = 0; p < fmt.g_num_planes(); p++)
>  					fmt.s_sizeimage(fmt.g_sizeimage(p) / 2, p);
> -				ret = q.create_bufs(node, 1, &fmt);
> -				fail_on_test(ret != EINVAL);
> +				fail_on_test(q.create_bufs(node, 1, &fmt) != EINVAL);
>  				fail_on_test(testQueryBuf(node, cur_fmt.type, q.g_buffers()));
>  				fmt = cur_fmt;
>  				for (unsigned p = 0; p < fmt.g_num_planes(); p++)
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-27  9:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-09 15:44 [PATCH] v4l2-compliance: Improve test readability when fail Helen Koike
2016-06-27  9:07 ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).