Re: [PATCHv2] v4l2-common: add s_selection helper function

2016-08-09 Thread Tiffany Lin
Hi Hans, On Fri, 2016-08-05 at 15:57 +0200, Hans Verkuil wrote: > Hi Tiffany, > > We just had a long discussion about whether or not -ERANGE should be returned > if the constraint flags could not be satisfied, and the end result was that > the driver should not return an error in that case, but j

Re: [PATCHv2] v4l2-common: add s_selection helper function

2016-08-05 Thread Hans Verkuil
Hi Tiffany, We just had a long discussion about whether or not -ERANGE should be returned if the constraint flags could not be satisfied, and the end result was that the driver should not return an error in that case, but just select a rectangle that works with the hardware and is closest to the r

Re: [PATCHv2] v4l2-common: add s_selection helper function

2016-08-04 Thread Sakari Ailus
On Thu, Aug 04, 2016 at 04:47:46PM +0200, Hans Verkuil wrote: > > > On 08/04/2016 04:38 PM, Sakari Ailus wrote: > > Hi Hans, > > > > On Thu, Aug 04, 2016 at 04:27:27PM +0200, Hans Verkuil wrote: > >> > >> > >> On 08/04/2016 04:17 PM, Sakari Ailus wrote: > >>> On Thu, Aug 04, 2016 at 04:11:55PM +

Re: [PATCHv2] v4l2-common: add s_selection helper function

2016-08-04 Thread Hans Verkuil
On 08/04/2016 04:38 PM, Sakari Ailus wrote: > Hi Hans, > > On Thu, Aug 04, 2016 at 04:27:27PM +0200, Hans Verkuil wrote: >> >> >> On 08/04/2016 04:17 PM, Sakari Ailus wrote: >>> On Thu, Aug 04, 2016 at 04:11:55PM +0200, Hans Verkuil wrote: On 08/04/2016 04:03 PM, Sakari Ailus wrot

Re: [PATCHv2] v4l2-common: add s_selection helper function

2016-08-04 Thread Sakari Ailus
Hi Hans, On Thu, Aug 04, 2016 at 04:27:27PM +0200, Hans Verkuil wrote: > > > On 08/04/2016 04:17 PM, Sakari Ailus wrote: > > On Thu, Aug 04, 2016 at 04:11:55PM +0200, Hans Verkuil wrote: > >> > >> > >> On 08/04/2016 04:03 PM, Sakari Ailus wrote: > >>> Hi Hans, > >>> > >>> On Mon, Aug 01, 2016 at

Re: [PATCHv2] v4l2-common: add s_selection helper function

2016-08-04 Thread Hans Verkuil
On 08/04/2016 04:17 PM, Sakari Ailus wrote: > On Thu, Aug 04, 2016 at 04:11:55PM +0200, Hans Verkuil wrote: >> >> >> On 08/04/2016 04:03 PM, Sakari Ailus wrote: >>> Hi Hans, >>> >>> On Mon, Aug 01, 2016 at 12:33:39PM +0200, Hans Verkuil wrote: Checking the selection constraint flags is often

Re: [PATCHv2] v4l2-common: add s_selection helper function

2016-08-04 Thread Sakari Ailus
On Thu, Aug 04, 2016 at 04:11:55PM +0200, Hans Verkuil wrote: > > > On 08/04/2016 04:03 PM, Sakari Ailus wrote: > > Hi Hans, > > > > On Mon, Aug 01, 2016 at 12:33:39PM +0200, Hans Verkuil wrote: > >> Checking the selection constraint flags is often forgotten by drivers, > >> especially > >> if

Re: [PATCHv2] v4l2-common: add s_selection helper function

2016-08-04 Thread Hans Verkuil
On 08/04/2016 04:03 PM, Sakari Ailus wrote: > Hi Hans, > > On Mon, Aug 01, 2016 at 12:33:39PM +0200, Hans Verkuil wrote: >> Checking the selection constraint flags is often forgotten by drivers, >> especially >> if the selection code just clamps the rectangle to the minimum and maximum >> allo

Re: [PATCHv2] v4l2-common: add s_selection helper function

2016-08-04 Thread Sakari Ailus
Hi Hans, On Mon, Aug 01, 2016 at 12:33:39PM +0200, Hans Verkuil wrote: > Checking the selection constraint flags is often forgotten by drivers, > especially > if the selection code just clamps the rectangle to the minimum and maximum > allowed > rectangles. > > This patch adds a simple helper f

[PATCHv2] v4l2-common: add s_selection helper function

2016-08-01 Thread Hans Verkuil
Checking the selection constraint flags is often forgotten by drivers, especially if the selection code just clamps the rectangle to the minimum and maximum allowed rectangles. This patch adds a simple helper function that checks the adjusted rectangle against the constraint flags and either re