<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/media/platform/amphion, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/media/platform/amphion?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/media/platform/amphion?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-09-24T06:48:27Z</updated>
<entry>
<title>media: amphion: release m2m ctx when releasing vpu instance</title>
<updated>2022-09-24T06:48:27Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-08-29T05:33:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d91d7bc85062309aae6d8064563ddf17947cb6bc'/>
<id>urn:sha1:d91d7bc85062309aae6d8064563ddf17947cb6bc</id>
<content type='text'>
release m2m ctx in the callback function that
release the vpu instance, then there is no need
to add lock around releasing m2m ctx.

Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support")
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Reviewed-by: Tommaso Merciai &lt;tommaso.merciai@amarulasolutions.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: amphion: fix a bug that vpu core may not resume after suspend</title>
<updated>2022-08-30T13:27:51Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-08-18T03:18:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0202a665bf17fbe98fed954944aabbcb4f14a4cc'/>
<id>urn:sha1:0202a665bf17fbe98fed954944aabbcb4f14a4cc</id>
<content type='text'>
driver will enable the vpu core when request the first instance
on the core.
one vpu core can only support 8 streaming instances in the same
time, the instance won't be added to core's list before streamon.

so the actual instance count may be greater then the number in
the core's list.

in pm resume callback, driver will resume the core immediately if
core's list is not empty.
but this check is not accurate,
if suspend during one instance is requested, but not streamon,
then after suspend, the core won't be resume, and led to instance failure.

use the request_count instead of the core's list to check
whether is the core needed to resume immediately after suspend.

And it can make the pm suspend and resume callback more clear.

Fixes: 9f599f351e86 ("media: amphion: add vpu core driver")
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: amphion: don't change the colorspace reported by decoder.</title>
<updated>2022-08-30T13:16:49Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-07-26T03:02:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=61c2698ee60630c6a7d2e99850fa81ff6450270a'/>
<id>urn:sha1:61c2698ee60630c6a7d2e99850fa81ff6450270a</id>
<content type='text'>
decoder will report the colorspace information
which is parsed from the sequence header,
if they are unspecified, just let application to determine it,
don't change it in driver.

Fixes: 6de8d628df6ef ("media: amphion: add v4l2 m2m vpu decoder stateful driver")
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: amphion: adjust the encoder's value range of gop size</title>
<updated>2022-08-30T13:01:06Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-07-15T07:38:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=996f4e89fabe44ab9ac0aabb0697aeecbe717eca'/>
<id>urn:sha1:996f4e89fabe44ab9ac0aabb0697aeecbe717eca</id>
<content type='text'>
adjust the value range of gop size from [0, 65535] to [1, 8000].
when the gop size is set to a too large value,
it may affect the encoded picture quality.
so constrain it to a reasonable range.

Fixes: 0401e659c1f92 ("media: amphion: add v4l2 m2m vpu encoder stateful driver")
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: amphion: insert picture startcode after seek for vc1g format</title>
<updated>2022-08-30T12:49:47Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-07-15T07:15:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f7fd6c318c8a5d06bf3fe611f30763d62eaaf7f0'/>
<id>urn:sha1:f7fd6c318c8a5d06bf3fe611f30763d62eaaf7f0</id>
<content type='text'>
For format vc1, the amphion vpu requires driver to
help insert some custom startcode before sequence and frame.
the startcode is different for vc1l and vc1g format.

But the sequence startcode is only needed at the beginning,
and it's not expected after seek.
driver need to treat the codec header and the first frame after seek
as a normal frame, and insert picture startcode for it.

In previous patch, I just fix it for vc1l format,
and should fix the similar issue for vc1g too.

Fixes: e670f5d672ef (media: amphion: only insert the first sequence startcode for vc1l format)
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: amphion: only insert the first sequence startcode for vc1l format</title>
<updated>2022-07-08T17:18:49Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-07-08T08:56:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e670f5d672ef3d00b0b8c69eff09a019e6dd4ef9'/>
<id>urn:sha1:e670f5d672ef3d00b0b8c69eff09a019e6dd4ef9</id>
<content type='text'>
For format V4L2_PIX_FMT_VC1_ANNEX_L,
the amphion vpu requires driver to help insert some custom startcode
before sequence and frame.
but only the first sequence startcode is needed,
the extra startcode will cause decoding error.
So after seek, we don't need to insert the sequence startcode.

In other words, for V4L2_PIX_FMT_VC1_ANNEX_L,
the vpu doesn't support dynamic resolution change.

Fixes: 145e936380edb ("media: amphion: implement malone decoder rpc interface")
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: amphion: sync buffer status with firmware during abort</title>
<updated>2022-07-08T17:17:06Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-07-01T05:50:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d8f1eb105eab7aab36323c6b488dda479d5bd2da'/>
<id>urn:sha1:d8f1eb105eab7aab36323c6b488dda479d5bd2da</id>
<content type='text'>
1. prevent to allocate buffer to firmware during abort
2. release buffer when clear the slots

Fixes: 6de8d628df6ef ("media: amphion: add v4l2 m2m vpu decoder stateful driver")
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: amphion: defer setting last_buffer_dequeued until resolution changes are processed</title>
<updated>2022-07-08T17:13:03Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-06-28T05:21:12Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=afba6e20801ad9a2f863c52c21e609e021269d83'/>
<id>urn:sha1:afba6e20801ad9a2f863c52c21e609e021269d83</id>
<content type='text'>
Don't set last_buffer_dequeued during dynamic resolution change,
otherwise it may be cleared in handling resolution change,
as streamoff may be called in dynamic resolution change.

Normally, this does not happen.
But we encounter a special testcase,
User issue V4L2_DEC_CMD_STOP after enqueue one buffer
that only contains codec config header, but not any frame data.
So VPU report the parsed resolution, then report the eos event.

So driver should notify user to handle resolution change first,
after it's handled, set the last_buffer_dequeued.
then the user can exit decoding normally.

Otherwise the user may be stalled.

Fixes: 6de8d628df6ef ("media: amphion: add v4l2 m2m vpu decoder stateful driver")
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: amphion: release core lock before reset vpu core</title>
<updated>2022-07-08T13:53:35Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-06-28T05:19:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a621cc4bed97e49f5a8019f5215dec7e208a7c4d'/>
<id>urn:sha1:a621cc4bed97e49f5a8019f5215dec7e208a7c4d</id>
<content type='text'>
In reset vpu core, driver will wait for a response event,
but if there are still some events unhandled,
they will be handled first, driver may acquire core lock for that.
So if we do reset in core lock, it may led to reset timeout.

Fixes: 9f599f351e86a ("media: amphion: add vpu core driver")
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: amphion: output firmware error message</title>
<updated>2022-06-27T07:53:56Z</updated>
<author>
<name>Ming Qian</name>
<email>ming.qian@nxp.com</email>
</author>
<published>2022-06-10T06:26:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=89e3f3fb3d9014efa59ed6bb526d5f1a00168452'/>
<id>urn:sha1:89e3f3fb3d9014efa59ed6bb526d5f1a00168452</id>
<content type='text'>
Firmware may send the error event with some error message,
and it help locate the firmware error,
so output the error message if it exists

Fixes: 61cbf1c1fa6d7 ("media: amphion: implement vpu core communication based on mailbox")
Signed-off-by: Ming Qian &lt;ming.qian@nxp.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
</feed>
