<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/media/v4l2-rect.h, branch linux-7.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-07-04T10:29:38+00:00</updated>
<entry>
<title>media: v4l2-rect.h: add enclosed rectangle helper</title>
<updated>2020-07-04T10:29:38+00:00</updated>
<author>
<name>Benoit Parrot</name>
<email>bparrot@ti.com</email>
</author>
<published>2020-05-28T13:26:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d3246337d00fcb635e4ade45f748f155e4056b28'/>
<id>urn:sha1:d3246337d00fcb635e4ade45f748f155e4056b28</id>
<content type='text'>
Add a helper function to check if one rectangle is enclosed inside
another.

Signed-off-by: Benoit Parrot &lt;bparrot@ti.com&gt;
Acked-by: Andrzej Pietrasiewicz &lt;andrzejtp2010@gmail.com&gt;
Reviewed-by: Lad Prabhakar &lt;prabhakar.csengg@gmail.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2-rect.h: fix v4l2_rect_map_inside() top/left adjustments</title>
<updated>2020-01-08T13:34:14+00:00</updated>
<author>
<name>Helen Koike</name>
<email>helen.koike@collabora.com</email>
</author>
<published>2019-12-17T20:00:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f51e50db4c20d46930b33be3f208851265694f3e'/>
<id>urn:sha1:f51e50db4c20d46930b33be3f208851265694f3e</id>
<content type='text'>
boundary-&gt;width and boundary-&gt;height are sizes relative to
boundary-&gt;left and boundary-&gt;top coordinates, but they were not being
taken into consideration to adjust r-&gt;left and r-&gt;top, leading to the
following error:

Consider the follow as initial values for boundary and r:

struct v4l2_rect boundary = {
	.left = 100,
	.top = 100,
	.width = 800,
	.height = 600,
}

struct v4l2_rect r = {
	.left = 0,
	.top = 0,
	.width = 1920,
	.height = 960,
}

calling v4l2_rect_map_inside(&amp;r, &amp;boundary) was modifying r to:

r = {
	.left = 0,
	.top = 0,
	.width = 800,
	.height = 600,
}

Which is wrongly outside the boundary rectangle, because:

	v4l2_rect_set_max_size(r, boundary); // r-&gt;width = 800, r-&gt;height = 600
	...
	if (r-&gt;left + r-&gt;width &gt; boundary-&gt;width) // true
		r-&gt;left = boundary-&gt;width - r-&gt;width; // r-&gt;left = 800 - 800
	if (r-&gt;top + r-&gt;height &gt; boundary-&gt;height) // true
		r-&gt;top = boundary-&gt;height - r-&gt;height; // r-&gt;height = 600 - 600

Fix this by considering top/left coordinates from boundary.

Fixes: ac49de8c49d7 ("[media] v4l2-rect.h: new header with struct v4l2_rect helper functions")
Signed-off-by: Helen Koike &lt;helen.koike@collabora.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;      # for v4.7 and up
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2-rect.h: add position and equal helpers</title>
<updated>2018-09-17T17:25:41+00:00</updated>
<author>
<name>Marco Felsch</name>
<email>m.felsch@pengutronix.de</email>
</author>
<published>2018-06-28T16:20:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e62fdbb24c342f78e431e05925097165cc0e05e9'/>
<id>urn:sha1:e62fdbb24c342f78e431e05925097165cc0e05e9</id>
<content type='text'>
Add two helper functions to check if two rectangles have the same
position (top/left) and if two rectangles equals (same size and
same position).

Signed-off-by: Marco Felsch &lt;m.felsch@pengutronix.de&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: include/(uapi/)media: add SPDX license info</title>
<updated>2018-02-14T18:23:51+00:00</updated>
<author>
<name>Hans Verkuil</name>
<email>hansverk@cisco.com</email>
</author>
<published>2018-02-07T14:05:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ab15d248cc96d12c928a69d3485a98d223c607ae'/>
<id>urn:sha1:ab15d248cc96d12c928a69d3485a98d223c607ae</id>
<content type='text'>
Replace the old license information with the corresponding SPDX
license for those headers that I authored.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2-rect.h: new header with struct v4l2_rect helper functions</title>
<updated>2016-04-20T19:11:33+00:00</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2016-04-03T19:42:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ac49de8c49d770b5ded5c717c1eaf339d7649da1'/>
<id>urn:sha1:ac49de8c49d770b5ded5c717c1eaf339d7649da1</id>
<content type='text'>
This makes it easier to share this code with any driver that needs to
manipulate the v4l2_rect datastructure.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
</entry>
</feed>
