media: mx2_camera: Add YUYV output format.

Message ID 1338905173-5968-1-git-send-email-javier.martin@vista-silicon.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Javier Martin June 5, 2012, 2:06 p.m. UTC
  While YUYV format can be handled using generic pass-through mode,
in order to allow resizing the eMMa-PrP has to know exactly
what format it is dealing with to process data accordingly.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
---
 drivers/media/video/mx2_camera.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
  

Comments

Javier Martin June 5, 2012, 2:14 p.m. UTC | #1
Hi,

On 5 June 2012 16:09, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Javier,
>
> Just curious: have you managed to get VPU driver working in mainline
> running on mx27?

No, I'm still working on it in my spare time. Progress is rather slow.

Regards.
  
Fabio Estevam June 5, 2012, 2:17 p.m. UTC | #2
On Tue, Jun 5, 2012 at 11:14 AM, javier Martin
<javier.martin@vista-silicon.com> wrote:

> No, I'm still working on it in my spare time. Progress is rather slow.

Ok, great. If you want to collaborate on this task, I will be glad to help.

Let me know if you have a git tree with your work in progress.

Saludos,

Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Javier Martin June 7, 2012, 8:30 a.m. UTC | #3
Hi Fabio,

On 5 June 2012 16:17, Fabio Estevam <festevam@gmail.com> wrote:
> On Tue, Jun 5, 2012 at 11:14 AM, javier Martin
> <javier.martin@vista-silicon.com> wrote:
>
>> No, I'm still working on it in my spare time. Progress is rather slow.
>
> Ok, great. If you want to collaborate on this task, I will be glad to help.
>
> Let me know if you have a git tree with your work in progress.

As i stated, the driver is still in an early development stage, it
doesn't do anything useful yet. But this is the public git repository
if you want to take a look:

git repo: https://github.com/jmartinc/video_visstrim.git
branch:  mx27-codadx6

FYI we are only interested on adding support for the encoding path of
the VPU, but we are trying our best to make it modular (as it is done
in Samsung's [1]), so that anyone can add decoding support later.

By the way, you work for Freescale, don't you?

We have a couple of issues with the i.MX27 VPU:

1- Firmware for the VPU is provided as a table of binary values inside
a source file which is licensed as GPL, however software is packaged
in a .tar.gz file that is marked as NDA. Do we have the right to
distribute this firmware with our products?
2- There is a BUG in the firmware that marks P frames as IDR when it
should only be done to I frames. Would it be possible to have access
to the source code of the firmware in order to fix that problem?

Regards.

[1] http://lxr.linux.no/#linux+v3.4.1/drivers/media/video/s5p-mfc/
  
Fabio Estevam June 7, 2012, 5:35 p.m. UTC | #4
Hi Javier,

On Thu, Jun 7, 2012 at 5:30 AM, javier Martin
<javier.martin@vista-silicon.com> wrote:

> As i stated, the driver is still in an early development stage, it
> doesn't do anything useful yet. But this is the public git repository
> if you want to take a look:
>
> git repo: https://github.com/jmartinc/video_visstrim.git
> branch:  mx27-codadx6

Thanks, I will take a look at your tree when I am back to the office next week.

I also see that Linaro's tree has support for VPU for mx5/mx6:
http://git.linaro.org/gitweb?p=landing-teams/working/freescale/kernel.git;a=summary

,so we should probably think in unifying it with mx27 support there too.

>
> FYI we are only interested on adding support for the encoding path of
> the VPU, but we are trying our best to make it modular (as it is done
> in Samsung's [1]), so that anyone can add decoding support later.

Ok, sounds good.

> By the way, you work for Freescale, don't you?

Yes, correct.

> We have a couple of issues with the i.MX27 VPU:
>
> 1- Firmware for the VPU is provided as a table of binary values inside
> a source file which is licensed as GPL, however software is packaged
> in a .tar.gz file that is marked as NDA. Do we have the right to
> distribute this firmware with our products?
> 2- There is a BUG in the firmware that marks P frames as IDR when it
> should only be done to I frames. Would it be possible to have access
> to the source code of the firmware in order to fix that problem?

I will need to check this next week when I am back to the office.

Thanks,

Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Javier Martin June 8, 2012, 6:51 a.m. UTC | #5
Hi Fabio,

On 7 June 2012 19:35, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Javier,
>
> On Thu, Jun 7, 2012 at 5:30 AM, javier Martin
> <javier.martin@vista-silicon.com> wrote:
>
>> As i stated, the driver is still in an early development stage, it
>> doesn't do anything useful yet. But this is the public git repository
>> if you want to take a look:
>>
>> git repo: https://github.com/jmartinc/video_visstrim.git
>> branch:  mx27-codadx6
>
> Thanks, I will take a look at your tree when I am back to the office next week.
>
> I also see that Linaro's tree has support for VPU for mx5/mx6:
> http://git.linaro.org/gitweb?p=landing-teams/working/freescale/kernel.git;a=summary
>
> ,so we should probably think in unifying it with mx27 support there too.
>
>>
>> FYI we are only interested on adding support for the encoding path of
>> the VPU, but we are trying our best to make it modular (as it is done
>> in Samsung's [1]), so that anyone can add decoding support later.
>
> Ok, sounds good.
>
>> By the way, you work for Freescale, don't you?
>
> Yes, correct.
>
>> We have a couple of issues with the i.MX27 VPU:
>>
>> 1- Firmware for the VPU is provided as a table of binary values inside
>> a source file which is licensed as GPL, however software is packaged
>> in a .tar.gz file that is marked as NDA. Do we have the right to
>> distribute this firmware with our products?

To address this issue it would be great if you, as a Freescale
employee, could send VPU firmware binary file to linux-firmware with a
LICENSE.xxxx file as well:

http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=tree

>> 2- There is a BUG in the firmware that marks P frames as IDR when it
>> should only be done to I frames. Would it be possible to have access
>> to the source code of the firmware in order to fix that problem?
>
> I will need to check this next week when I am back to the office.


Regards.
  

Patch

diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index b30ebe5..c8fa457 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -332,6 +332,32 @@  static struct mx2_fmt_cfg mx27_emma_prp_table[] = {
 		}
 	},
 	{
+		.in_fmt		= V4L2_MBUS_FMT_UYVY8_2X8,
+		.out_fmt	= V4L2_PIX_FMT_YUYV,
+		.cfg		= {
+			.channel	= 1,
+			.in_fmt		= PRP_CNTL_DATA_IN_YUV422,
+			.out_fmt	= PRP_CNTL_CH1_OUT_YUV422,
+			.src_pixel	= 0x22000888, /* YUV422 (YUYV) */
+			.ch1_pixel	= 0x62000888, /* YUV422 (YUYV) */
+			.irq_flags	= PRP_INTR_RDERR | PRP_INTR_CH1WERR |
+						PRP_INTR_CH1FC | PRP_INTR_LBOVF,
+		}
+	},
+	{
+		.in_fmt		= V4L2_MBUS_FMT_YUYV8_2X8,
+		.out_fmt	= V4L2_PIX_FMT_YUYV,
+		.cfg		= {
+			.channel	= 1,
+			.in_fmt		= PRP_CNTL_DATA_IN_YUV422,
+			.out_fmt	= PRP_CNTL_CH1_OUT_YUV422,
+			.src_pixel	= 0x22000888, /* YUV422 (YUYV) */
+			.ch1_pixel	= 0x62000888, /* YUV422 (YUYV) */
+			.irq_flags	= PRP_INTR_RDERR | PRP_INTR_CH1WERR |
+						PRP_INTR_CH1FC | PRP_INTR_LBOVF,
+		}
+	},
+	{
 		.in_fmt		= V4L2_MBUS_FMT_YUYV8_2X8,
 		.out_fmt	= V4L2_PIX_FMT_YUV420,
 		.cfg		= {