Skip to contentSkip to conversation

Add tw9910 driver

PATCH Superseded Kuninori Morimoto 3 participants 12 messages Dec 11, 2008 – Dec 15, 2008 Media (V4L/DVB)

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add tw9910 driver

This patch adds tw9910 driver that use soc_camera framework. It was tested on SH Migo-r board.

---
 drivers/media/video/Kconfig     |    6 +
 drivers/media/video/Makefile    |    1 +
 drivers/media/video/tw9910.c    |  910 +++++++++++++++++++++++++++++++++++++++
 include/media/tw9910.h          |   39 ++
 include/media/v4l2-chip-ident.h |    3 +
 5 files changed, 959 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/tw9910.c
 create mode 100644 include/media/tw9910.h
drivers/media/video/Kconfig +6 -0
index af951bd..8eb3869 100644
@@ -744,6 +744,12 @@ config MT9V022_PCA9536_SWITCH
 	  Select this if your MT9V022 camera uses a PCA9536 I2C GPIO
 	  extender to switch between 8 and 10 bit datawidth modes
 
+config SOC_CAMERA_TW9910
+	tristate "tw9910 support"
+	depends on SOC_CAMERA && I2C
+	help
+	  This is a tw9910 video driver
+
 config SOC_CAMERA_PLATFORM
 	tristate "platform camera support"
 	depends on SOC_CAMERA
drivers/media/video/Makefile +1 -0
index cc6698e..f1e004d 100644
@@ -135,6 +135,7 @@ obj-$(CONFIG_SOC_CAMERA_MT9M111)	+= mt9m111.o
 obj-$(CONFIG_SOC_CAMERA_MT9V022)	+= mt9v022.o
 obj-$(CONFIG_SOC_CAMERA_OV772X)		+= ov772x.o
 obj-$(CONFIG_SOC_CAMERA_PLATFORM)	+= soc_camera_platform.o
+obj-$(CONFIG_SOC_CAMERA_TW9910)		+= tw9910.o
 
 obj-$(CONFIG_VIDEO_AU0828) += au0828/
 
drivers/media/video/tw9910.c new file +910 -0

910 lines not on this page · raw message

include/media/tw9910.h new file +39 -0
new file mode 100644
index 0000000..af825e8
@@ -0,0 +1,39 @@
+/*
+ * tw9910 Driver header
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ * Kuninori Morimoto <[email protected]>
+ *
+ * Based on ov772x.h
+ *
+ * Copyright (C) Kuninori Morimoto <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __TW9910_H__
+#define __TW9910_H__
+
+#include <media/soc_camera.h>
+
+enum MPOUT_pin {
+	MPO_VLOSS,
+	MPO_HLOCK,
+	MPO_SLOCK,
+	MPO_VLOCK,
+	MPO_MONO,
+	MPO_DET50,
+	MPO_FIELD,
+	MPO_RTCO,
+};
+
+struct tw9910_video_info {
+	unsigned long          buswidth;
+	enum MPOUT_pin         mpout;
+	struct soc_camera_link link;
+};
+
+
+#endif /* __TW9910_H__ */
include/media/v4l2-chip-ident.h +3 -0
index 14a205f..0895eb2 100644
@@ -84,6 +84,9 @@ enum {
 	/* module wm8775: just ident 8775 */
 	V4L2_IDENT_WM8775 = 8775,
 
+	/* module tw9910: just ident 9910 */
+	V4L2_IDENT_TW9910 = 9910,
+
 	/* module cs53132a: just ident 53132 */
 	V4L2_IDENT_CS53l32A = 53132,
 
Signature · 6 lines
1.5.6.3

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
#1 lore raw

Hi Kuninori-san,

Quoted 2 lines · Kuninori Morimoto

This patch adds tw9910 driver that use soc_camera framework. It was tested on SH Migo-r board.

interesting, that'd be the first non-sensor video client driver under soc-camera then:-) Looks good in general, but we can improve it a bit:

Quoted 34 lines
drivers/media/video/tw9910.c new file +34 -0
+static const struct tw9910_scale_ctrl tw9910_pal_scales[] = {
+	{
+		.name   = "PAL SQ",
+		.width  = 768,
+		.height = 576,
+		.hscale = 0x0100,
+		.vscale = 0x0100,
+	},
+	{
+		.name   = "PAL CCIR601",
+		.width  = 720,
+		.height = 576,
+		.hscale = 0x0100,
+		.vscale = 0x0100,
+	},
+	{
+		.name   = "PAL SQ (CIF)",
+		.width  = 384,
+		.height = 288,
+		.hscale = 0x0200,
+		.vscale = 0x0200,
+	},
+	{
+		.name   = "PAL CCIR601 (CIF)",
+		.width  = 360,
+		.height = 288,
+		.hscale = 0x0200,
+		.vscale = 0x0200,
+	},
+	{
+		.name   = "PAL SQ (QCIF)",
+		.width  = 192,
+		.height = 144,
+		.hscale = 0x0400,

drivers/media/video/tw9910.c line 342

Quoted 10 lines
drivers/media/video/tw9910.c new file +10 -0
+		.vscale = 0x0400,
+	},
+	{
+		.name   = "PAL CCIR601 (QCIF)",
+		.width  = 180,
+		.height = 144,
+		.hscale = 0x0400,
+		.vscale = 0x0400,
+	},
+};

At the moment there's no way to switch to any of these PAL norms, as soc-camera doesn't support s_std yet. I suspect, we shall expect a patch for that soon?:-)

drivers/media/video/tw9910.c line 377

Quoted 7 lines
drivers/media/video/tw9910.c new file +7 -0
+	ret = i2c_smbus_write_byte_data(client, HSCALE_LO,
+					(scale->hscale & 0x00FF));
+	if (ret < 0)
+		return ret;
+
+	ret = i2c_smbus_write_byte_data(client, VSCALE_LO,
+					(scale->vscale & 0x00FF));

No need for parenthesis in these two.

drivers/media/video/tw9910.c line 381

Quoted 3 lines
drivers/media/video/tw9910.c new file +3 -0
+	return ret;
+
+}

Please, remove this empty line, as well as in tw9910_set_hsync.

drivers/media/video/tw9910.c line 549

Quoted 12 lines
drivers/media/video/tw9910.c new file +12 -0
+static int tw9910_start_capture(struct soc_camera_device *icd)
+{
+	struct tw9910_priv *priv = container_of(icd, struct tw9910_priv, icd);
+	int                 ret;
+	u8                  val;
+
+	/*
+	 * select current norm
+	 */
+	priv->scale = tw9910_select_norm(icd);
+	if (!priv->scale)
+		priv->scale = &tw9910_ntsc_scales[0];

Now, this is the actual reason why I'd like an improved version of this driver. Your try_fmt() method only limits frame width and height to lie within a supported range. Your set_fmt() and set_bus_param() just return
0. But here what you do in your tw9910_select_norm(), you check the currently set width and height against a fixed set of your scales matching various tv-norms, and if no exact match found you take default. This means, it can happen, that a user requests a format, which you don't support, you return no error on try_fmt and on s_fmt, but on streamon you silently change it to your default... I think it would be better to check requested format in your try_fmt() and select the nearest if no exact match is found, perform your select_norm not in start_capture(), but in set_fmt().

Quoted 58 lines
drivers/media/video/tw9910.c new file +58 -0
+
+	/*
+	 * reset hardware
+	 */
+	tw9910_reset(priv->client);
+	ret = tw9910_write_array(priv->client, tw9910_default_regs);
+	if (ret < 0)
+		goto start_capture_end;
+
+	/*
+	 * set bus width
+	 */
+	val = 0x00;
+	if (SOCAM_DATAWIDTH_16 == priv->info->buswidth)
+		val = LEN;
+
+	ret = tw9910_mask_set(priv->client, OPFORM, LEN, val);
+	if (ret < 0)
+		goto start_capture_end;
+
+	/*
+	 * select MPOUT behavior
+	 */
+	switch (priv->info->mpout) {
+	case MPO_VLOSS:
+		val = RTSEL_VLOSS; break;
+	case MPO_HLOCK:
+		val = RTSEL_HLOCK; break;
+	case MPO_SLOCK:
+		val = RTSEL_SLOCK; break;
+	case MPO_VLOCK:
+		val = RTSEL_VLOCK; break;
+	case MPO_MONO:
+		val = RTSEL_MONO;  break;
+	case MPO_DET50:
+		val = RTSEL_DET50; break;
+	case MPO_FIELD:
+		val = RTSEL_FIELD; break;
+	case MPO_RTCO:
+		val = RTSEL_RTCO;  break;
+	default:
+		val = 0;
+	}
+
+	ret = tw9910_mask_set(priv->client, VBICNTL, RTSEL_MASK, val);
+	if (ret < 0)
+		goto start_capture_end;
+
+	/*
+	 * set scale
+	 */
+	ret = tw9910_set_scale(priv->client, priv->scale);
+	if (ret < 0)
+		goto start_capture_end;
+
+	/*
+	 * set cropping
+	 */

drivers/media/video/tw9910.c line 617

Quoted 10 lines
drivers/media/video/tw9910.c new file +10 -0
+	ret = tw9910_set_cropping(priv->client, &tw9910_cropping_ctrl);
+	if (ret < 0)
+		goto start_capture_end;
+
+	/*
+	 * set hsync
+	 */
+	ret = tw9910_set_hsync(priv->client, &tw9910_hsync_ctrl);
+	if (ret < 0)
+		goto start_capture_end;

I think, it would also be better to move all this configuration into set_fmt().

drivers/media/video/tw9910.c line 619

Quoted 2 lines
drivers/media/video/tw9910.c new file +2 -0
+
+	dev_info(&icd->dev, "scale : %s\n", priv->scale->name);

Wouldn't dev_dbg be enough?

drivers/media/video/tw9910.c line 623

Quoted 4 lines
drivers/media/video/tw9910.c new file +4 -0
+
+start_capture_end:
+	priv->scale = NULL;
+	icd->vdev->current_norm = V4L2_STD_NTSC;

You probably do not want to do this in ok-case, although, it doesn't hurt ATM - priv->scale is not used outside of this function, and current_norm is anyway constant ATM, but you'll want to remove them as you move configuration into set_fmt().

drivers/media/video/tw9910.c line 631

Quoted 4 lines
drivers/media/video/tw9910.c new file +4 -0
+static int tw9910_stop_capture(struct soc_camera_device *icd)
+{
+	return 0;
+}

Is there really no way to stop the engine?

drivers/media/video/tw9910.c line 746

Quoted 2 lines
drivers/media/video/tw9910.c new file +2 -0
+	icd->formats     = &tw9910_color_fmt;
+	icd->num_formats = 1;

...still better to use ARRAY_SIZE - costs nothing at runtime anyway.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#2 lore raw

Dear Guennadi

Thank you for checking my patch

Quoted 8 lines
Quoted 8 lines
drivers/media/video/tw9910.c new file +8 -0
+static const struct tw9910_scale_ctrl tw9910_pal_scales[] = {
+	{
+		.name   = "PAL SQ",
+		.width  = 768,
+		.height = 576,
+		.hscale = 0x0100,
+		.vscale = 0x0100,
+	},

(snip)

Quoted 3 lines

At the moment there's no way to switch to any of these PAL norms, as soc-camera doesn't support s_std yet. I suspect, we shall expect a patch for that soon?:-)

? really ?
I can select PAL by mplayer.
icd->vdev->current_norm == V4L2_STD_PAL is works well on tw9910_select_norm.

Quoted 4 lines

Now, this is the actual reason why I'd like an improved version of this driver. Your try_fmt() method only limits frame width and height to lie within a supported range. Your set_fmt() and set_bus_param() just return
0. But here what you do in your tw9910_select_norm(), you check the

Quoted 8 lines

currently set width and height against a fixed set of your scales matching various tv-norms, and if no exact match found you take default. This means, it can happen, that a user requests a format, which you don't support, you return no error on try_fmt and on s_fmt, but on streamon you silently change it to your default... I think it would be better to check requested format in your try_fmt() and select the nearest if no exact match is found, perform your select_norm not in start_capture(), but in set_fmt().

Yes. I can understand !!
I will fix try_fmt and start_capture function.

Quoted 8 lines

drivers/media/video/tw9910.c line 623

Quoted 3 lines
drivers/media/video/tw9910.c new file +3 -0
+start_capture_end:
+	priv->scale = NULL;
+	icd->vdev->current_norm = V4L2_STD_NTSC;

You probably do not want to do this in ok-case, although, it doesn't hurt ATM - priv->scale is not used outside of this function, and current_norm is anyway constant ATM, but you'll want to remove them as you move configuration into set_fmt().

I think current_norm is able to changed to PAL or NTSC by v4l2-ioctl :: VIDIOC_S_STD.
I can select it to PAL (and NTSC).

Quoted 4 lines

drivers/media/video/tw9910.c line 746

Quoted 2 lines
drivers/media/video/tw9910.c new file +2 -0
+	icd->formats     = &tw9910_color_fmt;
+	icd->num_formats = 1;

...still better to use ARRAY_SIZE - costs nothing at runtime anyway.

OK thanks

Best regards
--
Kuninori Morimoto

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#3 lore raw
Quoted 9 lines · On Mon, 15 Dec 2008, [email protected] wrote:
Quoted 8 lines
Quoted 8 lines
drivers/media/video/tw9910.c new file +8 -0
+static const struct tw9910_scale_ctrl tw9910_pal_scales[] = {
+	{
+		.name   = "PAL SQ",
+		.width  = 768,
+		.height = 576,
+		.hscale = 0x0100,
+		.vscale = 0x0100,
+	},

(snip)

Quoted 7 lines
Quoted 3 lines

At the moment there's no way to switch to any of these PAL norms, as soc-camera doesn't support s_std yet. I suspect, we shall expect a patch for that soon?:-)

? really ?
I can select PAL by mplayer.
icd->vdev->current_norm == V4L2_STD_PAL is works well on tw9910_select_norm.

Indeed, you are right, sorry for confusion. But then it is even worse:-) What happens is that v4l2-ioctl.c::check_fmt() calls soc_camera_s_std(), verifies that it returns 0, and then sets current_norm, which you then use in your driver in tw9910_select_norm(). This way again we have no way to reject an unsupported tv-norm. Like, try selecting a SECAM norm:-) So, we need two patches here: first to add a set_std method to struct soc_camera_ops and call it from soc_camera_s_std():

static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)

{
	struct soc_camera_file *icf = file->private_data;
	struct soc_camera_device *icd = icf->icd;
	return icd->ops->set_std(icd, a);
}

and second - your driver implementing this method. Or do we have to pass set_std first to the host driver? Looks like neither i.MX31 nor PXA270 have anything to do with it, SuperH neither?

In fact, I think, this your device is rather different from what we've been doing up to now - only CMOS sensors. soc_camera_enum_input() seems to be doing the wrong thing for you now too. Shouldn't it return V4L2_INPUT_TYPE_TUNER and your current norm? Maybe more changes are needed to soc_camera.c, that I don't see ATM.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#4 lore raw
Quoted 14 lines · Guennadi Liakhovetski

What happens is that v4l2-ioctl.c::check_fmt() calls soc_camera_s_std(), verifies that it returns 0, and then sets current_norm, which you then use in your driver in tw9910_select_norm(). This way again we have no way to reject an unsupported tv-norm. Like, try selecting a SECAM norm:-) So, we need two patches here: first to add a set_std method to struct soc_camera_ops and call it from soc_camera_s_std():

static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)

{
       struct soc_camera_file *icf = file->private_data;
       struct soc_camera_device *icd = icf->icd;
       return icd->ops->set_std(icd, a);
}
Quoted 3 lines

and second - your driver implementing this method. Or do we have to pass set_std first to the host driver? Looks like neither i.MX31 nor PXA270 have anything to do with it, SuperH neither?

The CEU has nothing to do with it. For our hardware this is handled by the TW9910 video decoder. The CEU driver has to be switched to interlace mode, but that's about it. =)

Thanks,

/ magnus

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#5 lore raw
Quoted 16 lines · Magnus Damm
Quoted 14 lines · Guennadi Liakhovetski

What happens is that v4l2-ioctl.c::check_fmt() calls soc_camera_s_std(), verifies that it returns 0, and then sets current_norm, which you then use in your driver in tw9910_select_norm(). This way again we have no way to reject an unsupported tv-norm. Like, try selecting a SECAM norm:-) So, we need two patches here: first to add a set_std method to struct soc_camera_ops and call it from soc_camera_s_std():

static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)

{
       struct soc_camera_file *icf = file->private_data;
       struct soc_camera_device *icd = icf->icd;
       return icd->ops->set_std(icd, a);
}
Quoted 7 lines
Quoted 3 lines

and second - your driver implementing this method. Or do we have to pass set_std first to the host driver? Looks like neither i.MX31 nor PXA270 have anything to do with it, SuperH neither?

The CEU has nothing to do with it. For our hardware this is handled by the TW9910 video decoder. The CEU driver has to be switched to interlace mode, but that's about it. =)

Good, then passing it directly to the camera driver should be enough for now.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#6 lore raw
Quoted 21 lines · Guennadi Liakhovetski
Quoted 20 lines · Magnus Damm
Quoted 17 lines · Guennadi Liakhovetski

What happens is that v4l2-ioctl.c::check_fmt() calls soc_camera_s_std(), verifies that it returns 0, and then sets current_norm, which you then use in your driver in tw9910_select_norm(). This way again we have no way to reject an unsupported tv-norm. Like, try selecting a SECAM norm:-) So, we need two patches here: first to add a set_std method to struct soc_camera_ops and call it from soc_camera_s_std():

static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)

{
       struct soc_camera_file *icf = file->private_data;
       struct soc_camera_device *icd = icf->icd;
       return icd->ops->set_std(icd, a);
}

and second - your driver implementing this method. Or do we have to pass set_std first to the host driver? Looks like neither i.MX31 nor PXA270 have anything to do with it, SuperH neither?

Quoted 6 lines
Quoted 3 lines

The CEU has nothing to do with it. For our hardware this is handled by the TW9910 video decoder. The CEU driver has to be switched to interlace mode, but that's about it. =)

Good, then passing it directly to the camera driver should be enough for now.

Yeah. I guess this all means that we have to rework things a bit. So the interlace patch needs to be updated. Which affects my cleanup patch. Do you have any preference on how to proceed? I'd go with just keep on adding things - this means my cleanup patch that i'm about to send will still apply - but I'm fine rewriting and reposting as well.

Cheers,

/ magnus

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#7 lore raw
Quoted 27 lines · Magnus Damm
Quoted 25 lines · Guennadi Liakhovetski
Quoted 23 lines · Magnus Damm
Quoted 14 lines · Guennadi Liakhovetski

What happens is that v4l2-ioctl.c::check_fmt() calls soc_camera_s_std(), verifies that it returns 0, and then sets current_norm, which you then use in your driver in tw9910_select_norm(). This way again we have no way to reject an unsupported tv-norm. Like, try selecting a SECAM norm:-) So, we need two patches here: first to add a set_std method to struct soc_camera_ops and call it from soc_camera_s_std():

static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)

{
       struct soc_camera_file *icf = file->private_data;
       struct soc_camera_device *icd = icf->icd;
       return icd->ops->set_std(icd, a);
}
Quoted 3 lines

and second - your driver implementing this method. Or do we have to pass set_std first to the host driver? Looks like neither i.MX31 nor PXA270 have anything to do with it, SuperH neither?

The CEU has nothing to do with it. For our hardware this is handled by the TW9910 video decoder. The CEU driver has to be switched to interlace mode, but that's about it. =)

Quoted 8 lines
Quoted 2 lines

Good, then passing it directly to the camera driver should be enough for now.

Yeah. I guess this all means that we have to rework things a bit. So the interlace patch needs to be updated. Which affects my cleanup patch. Do you have any preference on how to proceed? I'd go with just keep on adding things - this means my cleanup patch that i'm about to send will still apply - but I'm fine rewriting and reposting as well.

As you see, patches

[PATCH 02/03] sh_mobile_ceu: add NV12 and NV21 support [PATCH] Add interlace support to sh_mobile_ceu_camera.c [PATCH] Add tw9910 driver

need modifications, so, I would prefer to have them re-done instead of incrementally fixing them. This doesn't include of course parenthesis and ceu_write / ceu_read typing fixes to existing code - this should be a separate patch.

BTW, you realise, that I'm not handling this your patch:

[PATCH] videobuf-dma-contig: fix USERPTR free handling

Have you got an ack for it yet?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#8 lore raw
Quoted 14 lines · Guennadi Liakhovetski
Quoted 10 lines · Magnus Damm
Quoted 2 lines · Guennadi Liakhovetski

Good, then passing it directly to the camera driver should be enough for now.

Yeah. I guess this all means that we have to rework things a bit. So the interlace patch needs to be updated. Which affects my cleanup patch. Do you have any preference on how to proceed? I'd go with just keep on adding things - this means my cleanup patch that i'm about to send will still apply - but I'm fine rewriting and reposting as well.

As you see, patches

Quoted 8 lines

[PATCH 02/03] sh_mobile_ceu: add NV12 and NV21 support [PATCH] Add interlace support to sh_mobile_ceu_camera.c [PATCH] Add tw9910 driver

need modifications, so, I would prefer to have them re-done instead of incrementally fixing them. This doesn't include of course parenthesis and ceu_write / ceu_read typing fixes to existing code - this should be a separate patch.

Hm, I thought you only needed a NV12 patch consisting of more or less cosmetic changes? I guess the dma_addr_t change may be in a gray zone though. I'd prefer not to touch the NV12 and NV16 patches except for a cleanup patch if possible, but I will of course update and resend the NV12 patch if you prefer that.

Quoted 5 lines

BTW, you realise, that I'm not handling this your patch:

[PATCH] videobuf-dma-contig: fix USERPTR free handling

Have you got an ack for it yet?

No, I haven't. Not so strange though since that the CEU driver is the only user. =) And most programs simply do mmap() so I don't think Morimoto-san is running into this issue. But getting it included would be great. Also the NV16 fourcc definitions would be nice to have included.

Thanks.

/ magnus

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#9 lore raw
Quoted 21 lines · Magnus Damm
Quoted 10 lines · Guennadi Liakhovetski
Quoted 6 lines · Magnus Damm

Yeah. I guess this all means that we have to rework things a bit. So the interlace patch needs to be updated. Which affects my cleanup patch. Do you have any preference on how to proceed? I'd go with just keep on adding things - this means my cleanup patch that i'm about to send will still apply - but I'm fine rewriting and reposting as well.

As you see, patches

Quoted 8 lines

[PATCH 02/03] sh_mobile_ceu: add NV12 and NV21 support [PATCH] Add interlace support to sh_mobile_ceu_camera.c [PATCH] Add tw9910 driver

need modifications, so, I would prefer to have them re-done instead of incrementally fixing them. This doesn't include of course parenthesis and ceu_write / ceu_read typing fixes to existing code - this should be a separate patch.

Quoted 5 lines

Hm, I thought you only needed a NV12 patch consisting of more or less cosmetic changes? I guess the dma_addr_t change may be in a gray zone though. I'd prefer not to touch the NV12 and NV16 patches except for a cleanup patch if possible, but I will of course update and resend the NV12 patch if you prefer that.

You asked about my preferences, so I replied:-) But yes, NV12 can be left as it is if you promise me to send a follow-up clean-up:-)

Quoted 10 lines
Quoted 5 lines

BTW, you realise, that I'm not handling this your patch:

[PATCH] videobuf-dma-contig: fix USERPTR free handling

Have you got an ack for it yet?

No, I haven't. Not so strange though since that the CEU driver is the only user. =) And most programs simply do mmap() so I don't think Morimoto-san is running into this issue. But getting it included would be great.

i.MX31 is also goint to be using it, but yes, I also only use mmap in my tests.

Quoted 2 lines

Also the NV16 fourcc definitions would be nice to have included.

I'll pull NV16/NV61 as suggested by Mauro.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#10 lore raw

Re: [PATCH re-send v2] Add interlace support to sh_mobile_ceu_camera.c

In reply to Guennadi Liakhovetski
Quoted 19 lines · On Mon, 15 Dec 2008, [email protected] wrote:

Thank you for checking my patch and some advice.

Quoted 4 lines

Thei in sh_ceu_mobile you re-implement the test above from soc_camera.c, extending it with INTERLACED after calling icd->ops->try_fmt(icd, f), something like

Quoted 12 lines
	switch (field) {
	case V4L2_FIELD_INTERLACED:
		pcdev->is_interlace = 1;
		break;
	case V4L2_FIELD_ANY:
		f->fmt.pix.field = V4L2_FIELD_NONE;
	case V4L2_FIELD_NONE:
		pcdev->is_interlace = 0;
		break;
	default:
		return -EINVAL;
	}
Quoted 4 lines

Now I understand that we need some patch like this. Is it correct ? or not ?

o add set_std to soc_camera -> for check norm

Not add, it is already there, just modify as I described in another reply to you (slightly extended):

Quoted 8 lines

static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)

{
	struct soc_camera_file *icf = file->private_data;
	struct soc_camera_device *icd = icf->icd;
	if (!icd->ops->set_std)
		return 0;
	return icd->ops->set_std(icd, a);
}

of course, also adding the respective field to struct soc_camera_ops

Quoted 1 line

o fix soc_camera_enum_input -> for use V4L2_INPUT_TYPE_TUNER or CAMERA

Yes, I am not quite sure how best to do this though. I think, we also want to continue supporting the default behaviour, so, we should add a enum_input method to struct soc_camera_ops, if defined - call it, if not, fallback to default current behaviour.

Quoted 1 line

o fix field test on soc_camera -> remove field test (or add allow INTERLACED)

Remove. But this patch I can do myself, because I will also have to patch pxa_camera.c, you just assume this test is not there, for your tests just remove it.

Quoted 2 lines

o interlace mode patch to sh_mobile_ceu
o tw9910 driver

Yep.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#11 lore raw

Re: [PATCH re-send v2] Add interlace support to sh_mobile_ceu_camera.c

Dear Guennadi

Quoted 4 lines
Quoted 1 line

o add set_std to soc_camera -> for check norm

Not add, it is already there, just modify as I described in another reply to you (slightly extended):

Sorry. My English is stupid...

Quoted 10 lines
Quoted 8 lines

static int soc_camera_s_std(struct file *file, void *priv, v4l2_std_id *a)

{
	struct soc_camera_file *icf = file->private_data;
	struct soc_camera_device *icd = icf->icd;
	if (!icd->ops->set_std)
		return 0;
	return icd->ops->set_std(icd, a);
}

of course, also adding the respective field to struct soc_camera_ops

OK I will send it.

Quoted 6 lines
Quoted 1 line

o fix soc_camera_enum_input -> for use V4L2_INPUT_TYPE_TUNER or CAMERA

Yes, I am not quite sure how best to do this though. I think, we also want to continue supporting the default behaviour, so, we should add a enum_input method to struct soc_camera_ops, if defined - call it, if not, fallback to default current behaviour.

OK.

Quoted 5 lines
Quoted 1 line

o fix field test on soc_camera -> remove field test (or add allow INTERLACED)

Remove. But this patch I can do myself, because I will also have to patch pxa_camera.c, you just assume this test is not there, for your tests just remove it.

OK.

Best regards
--
Kuninori Morimoto

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list