* [PATCH yavta 0/3] Fixes for compound control support
@ 2019-02-20 15:19 Laurent Pinchart
2019-02-20 15:19 ` [PATCH yavta 1/3] Fix emulation of old API for string controls Laurent Pinchart
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Laurent Pinchart @ 2019-02-20 15:19 UTC (permalink / raw)
To: linux-media; +Cc: Kieran Bingham, Sakari Ailus
Hello,
This small series fixes issues in yavta reported during the review of
the compound control support patches.
Laurent Pinchart (3):
Fix emulation of old API for string controls
Print numerical control type for unsupported types
Fix control array parsing
yavta.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH yavta 1/3] Fix emulation of old API for string controls
2019-02-20 15:19 [PATCH yavta 0/3] Fixes for compound control support Laurent Pinchart
@ 2019-02-20 15:19 ` Laurent Pinchart
2019-02-20 15:19 ` [PATCH yavta 2/3] Print numerical control type for unsupported types Laurent Pinchart
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2019-02-20 15:19 UTC (permalink / raw)
To: linux-media; +Cc: Kieran Bingham, Sakari Ailus
For kernel versions that didn't define the V4L2_CTRL_FLAG_HAS_PAYLOAD
flag, commits 2f146567186f ("Implement compound control get support")
and 4480b561404f ("Implement compound control set support") broke string
control support. Fix this by emulating the V4L2_CTRL_FLAG_HAS_PAYLOAD
and compound control API for the older API.
Fixes: 2f146567186f ("Implement compound control get support")
Fixes: 4480b561404f ("Implement compound control set support")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
yavta.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/yavta.c b/yavta.c
index 0efa7d73e432..7d9c40c9f9be 100644
--- a/yavta.c
+++ b/yavta.c
@@ -637,6 +637,12 @@ static int query_control(struct device *dev, unsigned int id,
query->default_value = q.default_value;
query->flags = q.flags;
+ if (q.type == V4L2_CTRL_TYPE_STRING &&
+ !(q.flags & V4L2_CTRL_FLAG_HAS_PAYLOAD)) {
+ query->elem_size = q.maximum + 1;
+ query->elems = 1;
+ }
+
return 0;
}
--
Regards,
Laurent Pinchart
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH yavta 2/3] Print numerical control type for unsupported types
2019-02-20 15:19 [PATCH yavta 0/3] Fixes for compound control support Laurent Pinchart
2019-02-20 15:19 ` [PATCH yavta 1/3] Fix emulation of old API for string controls Laurent Pinchart
@ 2019-02-20 15:19 ` Laurent Pinchart
2019-02-20 15:19 ` [PATCH yavta 3/3] Fix control array parsing Laurent Pinchart
2019-02-20 21:34 ` [PATCH yavta 0/3] Fixes for compound control support Sakari Ailus
3 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2019-02-20 15:19 UTC (permalink / raw)
To: linux-media; +Cc: Kieran Bingham, Sakari Ailus
Help diagnosing problems by reporting the type of unsupported control
types instead of just printing "unsupported".
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
yavta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/yavta.c b/yavta.c
index 7d9c40c9f9be..86447f3f057d 100644
--- a/yavta.c
+++ b/yavta.c
@@ -1368,7 +1368,7 @@ static void video_print_control_value(const struct v4l2_query_ext_ctrl *query,
video_print_control_array(query, ctrl);
break;
default:
- printf("unsupported");
+ printf("unsupported type %u", query->type);
break;
}
}
--
Regards,
Laurent Pinchart
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH yavta 3/3] Fix control array parsing
2019-02-20 15:19 [PATCH yavta 0/3] Fixes for compound control support Laurent Pinchart
2019-02-20 15:19 ` [PATCH yavta 1/3] Fix emulation of old API for string controls Laurent Pinchart
2019-02-20 15:19 ` [PATCH yavta 2/3] Print numerical control type for unsupported types Laurent Pinchart
@ 2019-02-20 15:19 ` Laurent Pinchart
2019-02-20 21:34 ` [PATCH yavta 0/3] Fixes for compound control support Sakari Ailus
3 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2019-02-20 15:19 UTC (permalink / raw)
To: linux-media; +Cc: Kieran Bingham, Sakari Ailus
Commit 4480b561404f ("Implement compound control set support") didn't
properly parse control array values. Fix it.
Fixes: 4480b561404f ("Implement compound control set support")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
yavta.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/yavta.c b/yavta.c
index 86447f3f057d..bcdcddb1a8c5 100644
--- a/yavta.c
+++ b/yavta.c
@@ -1505,9 +1505,10 @@ static int video_parse_control_array(const struct v4l2_query_ext_ctrl *query,
val = endptr;
for ( ; isspace(*val); ++val) { };
- if (*val++ != ',')
+ if (*val != ',')
break;
- }
+ val++;
+ }
if (i < query->elems - 1)
return -EINVAL;
--
Regards,
Laurent Pinchart
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH yavta 0/3] Fixes for compound control support
2019-02-20 15:19 [PATCH yavta 0/3] Fixes for compound control support Laurent Pinchart
` (2 preceding siblings ...)
2019-02-20 15:19 ` [PATCH yavta 3/3] Fix control array parsing Laurent Pinchart
@ 2019-02-20 21:34 ` Sakari Ailus
2019-02-22 10:03 ` Laurent Pinchart
3 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2019-02-20 21:34 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-media, Kieran Bingham
On Wed, Feb 20, 2019 at 05:19:49PM +0200, Laurent Pinchart wrote:
> Hello,
>
> This small series fixes issues in yavta reported during the review of
> the compound control support patches.
>
> Laurent Pinchart (3):
> Fix emulation of old API for string controls
> Print numerical control type for unsupported types
> Fix control array parsing
>
> yavta.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
Oh my. Aren't you planning to send v2 that would address the comments?
That said, the changes seem fine to me.
--
Sakari Ailus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH yavta 0/3] Fixes for compound control support
2019-02-20 21:34 ` [PATCH yavta 0/3] Fixes for compound control support Sakari Ailus
@ 2019-02-22 10:03 ` Laurent Pinchart
0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2019-02-22 10:03 UTC (permalink / raw)
To: Sakari Ailus; +Cc: linux-media, Kieran Bingham
On Wed, Feb 20, 2019 at 11:34:28PM +0200, Sakari Ailus wrote:
> On Wed, Feb 20, 2019 at 05:19:49PM +0200, Laurent Pinchart wrote:
> > Hello,
> >
> > This small series fixes issues in yavta reported during the review of
> > the compound control support patches.
> >
> > Laurent Pinchart (3):
> > Fix emulation of old API for string controls
> > Print numerical control type for unsupported types
> > Fix control array parsing
> >
> > yavta.c | 13 ++++++++++---
> > 1 file changed, 10 insertions(+), 3 deletions(-)
> >
>
> Oh my. Aren't you planning to send v2 that would address the comments?
I would have if v1 hadn't been merged yet.
> That said, the changes seem fine to me.
Thank you. I've pushed these fixes.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-02-22 10:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20 15:19 [PATCH yavta 0/3] Fixes for compound control support Laurent Pinchart
2019-02-20 15:19 ` [PATCH yavta 1/3] Fix emulation of old API for string controls Laurent Pinchart
2019-02-20 15:19 ` [PATCH yavta 2/3] Print numerical control type for unsupported types Laurent Pinchart
2019-02-20 15:19 ` [PATCH yavta 3/3] Fix control array parsing Laurent Pinchart
2019-02-20 21:34 ` [PATCH yavta 0/3] Fixes for compound control support Sakari Ailus
2019-02-22 10:03 ` Laurent Pinchart
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).