* [PATCH v4] media: soc_camera: rcar_vin: Add BT.709 24-bit RGB888 input support
@ 2014-10-31 15:06 Yoshihiro Kaneko
2014-11-13 6:33 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Yoshihiro Kaneko @ 2014-10-31 15:06 UTC (permalink / raw)
To: linux-media; +Cc: Guennadi Liakhovetski, Simon Horman, Magnus Damm, linux-sh
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---
This patch is against master branch of linuxtv.org/media_tree.git.
v4 [Yoshihiro Kaneko]
* indent with a tab, not with spaces
v3 [Yoshihiro Kaneko]
* fixes the detection of RGB input
v2 [Yoshihiro Kaneko]
* remove unused definition as suggested by Sergei Shtylyov
* use VNMC_INF_RGB888 directly instead of VNMC_INF_RGB_MASK as a bit-field
mask
drivers/media/platform/soc_camera/rcar_vin.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
index 20defcb..7becec0 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -74,6 +74,7 @@
#define VNMC_INF_YUV10_BT656 (2 << 16)
#define VNMC_INF_YUV10_BT601 (3 << 16)
#define VNMC_INF_YUV16 (5 << 16)
+#define VNMC_INF_RGB888 (6 << 16)
#define VNMC_VUP (1 << 10)
#define VNMC_IM_ODD (0 << 3)
#define VNMC_IM_ODD_EVEN (1 << 3)
@@ -272,6 +273,10 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
/* input interface */
switch (icd->current_fmt->code) {
+ case V4L2_MBUS_FMT_RGB888_1X24:
+ /* BT.601/BT.709 24-bit RGB-888 */
+ vnmc |= VNMC_INF_RGB888;
+ break;
case V4L2_MBUS_FMT_YUYV8_1X16:
/* BT.601/BT.1358 16bit YCbCr422 */
vnmc |= VNMC_INF_YUV16;
@@ -331,6 +336,15 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
if (output_is_yuv)
vnmc |= VNMC_BPS;
+ /*
+ * The above assumes YUV input, toggle BPS for RGB input.
+ * RGB inputs can be detected by checking that the most-significant
+ * two bits of INF are set. This corresponds to the bits
+ * set in VNMC_INF_RGB888.
+ */
+ if ((vnmc & VNMC_INF_RGB888) = VNMC_INF_RGB888)
+ vnmc ^= VNMC_BPS;
+
/* progressive or interlaced mode */
interrupts = progressive ? VNIE_FIE | VNIE_EFE : VNIE_EFE;
@@ -1013,6 +1027,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
case V4L2_MBUS_FMT_YUYV8_1X16:
case V4L2_MBUS_FMT_YUYV8_2X8:
case V4L2_MBUS_FMT_YUYV10_2X10:
+ case V4L2_MBUS_FMT_RGB888_1X24:
if (cam->extra_fmt)
break;
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v4] media: soc_camera: rcar_vin: Add BT.709 24-bit RGB888 input support
2014-10-31 15:06 [PATCH v4] media: soc_camera: rcar_vin: Add BT.709 24-bit RGB888 input support Yoshihiro Kaneko
@ 2014-11-13 6:33 ` Simon Horman
2016-01-14 12:18 ` [PATCH v4] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support Yoshihiro Kaneko
2016-01-24 3:55 ` kbuild test robot
2 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2014-11-13 6:33 UTC (permalink / raw)
To: Yoshihiro Kaneko
Cc: linux-media, Guennadi Liakhovetski, Magnus Damm, linux-sh
On Sat, Nov 01, 2014 at 12:06:38AM +0900, Yoshihiro Kaneko wrote:
> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>
> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Hi Guennadi,
this patch has been through a few revisions but this one seems
to make the reviewers happy. Could you take a look at it when you have
a chance?
> ---
>
> This patch is against master branch of linuxtv.org/media_tree.git.
>
> v4 [Yoshihiro Kaneko]
> * indent with a tab, not with spaces
>
> v3 [Yoshihiro Kaneko]
> * fixes the detection of RGB input
>
> v2 [Yoshihiro Kaneko]
> * remove unused definition as suggested by Sergei Shtylyov
> * use VNMC_INF_RGB888 directly instead of VNMC_INF_RGB_MASK as a bit-field
> mask
>
> drivers/media/platform/soc_camera/rcar_vin.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
> index 20defcb..7becec0 100644
> --- a/drivers/media/platform/soc_camera/rcar_vin.c
> +++ b/drivers/media/platform/soc_camera/rcar_vin.c
> @@ -74,6 +74,7 @@
> #define VNMC_INF_YUV10_BT656 (2 << 16)
> #define VNMC_INF_YUV10_BT601 (3 << 16)
> #define VNMC_INF_YUV16 (5 << 16)
> +#define VNMC_INF_RGB888 (6 << 16)
> #define VNMC_VUP (1 << 10)
> #define VNMC_IM_ODD (0 << 3)
> #define VNMC_IM_ODD_EVEN (1 << 3)
> @@ -272,6 +273,10 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
>
> /* input interface */
> switch (icd->current_fmt->code) {
> + case V4L2_MBUS_FMT_RGB888_1X24:
> + /* BT.601/BT.709 24-bit RGB-888 */
> + vnmc |= VNMC_INF_RGB888;
> + break;
> case V4L2_MBUS_FMT_YUYV8_1X16:
> /* BT.601/BT.1358 16bit YCbCr422 */
> vnmc |= VNMC_INF_YUV16;
> @@ -331,6 +336,15 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
> if (output_is_yuv)
> vnmc |= VNMC_BPS;
>
> + /*
> + * The above assumes YUV input, toggle BPS for RGB input.
> + * RGB inputs can be detected by checking that the most-significant
> + * two bits of INF are set. This corresponds to the bits
> + * set in VNMC_INF_RGB888.
> + */
> + if ((vnmc & VNMC_INF_RGB888) = VNMC_INF_RGB888)
> + vnmc ^= VNMC_BPS;
> +
> /* progressive or interlaced mode */
> interrupts = progressive ? VNIE_FIE | VNIE_EFE : VNIE_EFE;
>
> @@ -1013,6 +1027,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
> case V4L2_MBUS_FMT_YUYV8_1X16:
> case V4L2_MBUS_FMT_YUYV8_2X8:
> case V4L2_MBUS_FMT_YUYV10_2X10:
> + case V4L2_MBUS_FMT_RGB888_1X24:
> if (cam->extra_fmt)
> break;
>
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support
2014-10-31 15:06 [PATCH v4] media: soc_camera: rcar_vin: Add BT.709 24-bit RGB888 input support Yoshihiro Kaneko
2014-11-13 6:33 ` Simon Horman
@ 2016-01-14 12:18 ` Yoshihiro Kaneko
2016-01-23 18:38 ` Guennadi Liakhovetski
2016-01-24 3:55 ` kbuild test robot
2 siblings, 1 reply; 6+ messages in thread
From: Yoshihiro Kaneko @ 2016-01-14 12:18 UTC (permalink / raw)
To: linux-media; +Cc: Guennadi Liakhovetski, Simon Horman, Magnus Damm, linux-sh
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
This patch adds ARGB8888 capture format support for R-Car Gen3.
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---
This patch is based on the for-4.6-1 branch of Guennadi's v4l-dvb tree.
v4 [Yoshihiro Kaneko]
* As suggested by Sergei Shtylyov
- revised an error message.
v3 [Yoshihiro Kaneko]
* rebased to for-4.6-1 branch of Guennadi's tree.
v2 [Yoshihiro Kaneko]
* As suggested by Sergei Shtylyov
- fix the coding style of the braces.
drivers/media/platform/soc_camera/rcar_vin.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
index dc75a80..07c67f6 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -124,7 +124,7 @@
#define VNDMR_EXRGB (1 << 8)
#define VNDMR_BPSM (1 << 4)
#define VNDMR_DTMD_YCSEP (1 << 1)
-#define VNDMR_DTMD_ARGB1555 (1 << 0)
+#define VNDMR_DTMD_ARGB (1 << 0)
/* Video n Data Mode Register 2 bits */
#define VNDMR2_VPS (1 << 30)
@@ -643,7 +643,7 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
output_is_yuv = true;
break;
case V4L2_PIX_FMT_RGB555X:
- dmr = VNDMR_DTMD_ARGB1555;
+ dmr = VNDMR_DTMD_ARGB;
break;
case V4L2_PIX_FMT_RGB565:
dmr = 0;
@@ -654,6 +654,14 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
dmr = VNDMR_EXRGB;
break;
}
+ case V4L2_PIX_FMT_ARGB32:
+ if (priv->chip = RCAR_GEN3) {
+ dmr = VNDMR_EXRGB | VNDMR_DTMD_ARGB;
+ } else {
+ dev_err(icd->parent, "Unsupported format\n");
+ return -EINVAL;
+ }
+ break;
default:
dev_warn(icd->parent, "Invalid fourcc format (0x%x)\n",
icd->current_fmt->host_fmt->fourcc);
@@ -1304,6 +1312,14 @@ static const struct soc_mbus_pixelfmt rcar_vin_formats[] = {
.order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
},
+ {
+ .fourcc = V4L2_PIX_FMT_ARGB32,
+ .name = "ARGB8888",
+ .bits_per_sample = 32,
+ .packing = SOC_MBUS_PACKING_NONE,
+ .order = SOC_MBUS_ORDER_LE,
+ .layout = SOC_MBUS_LAYOUT_PACKED,
+ },
};
static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
@@ -1611,6 +1627,7 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd,
case V4L2_PIX_FMT_RGB32:
can_scale = priv->chip != RCAR_E1;
break;
+ case V4L2_PIX_FMT_ARGB32:
case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_YUYV:
case V4L2_PIX_FMT_RGB565:
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v4] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support
2016-01-14 12:18 ` [PATCH v4] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support Yoshihiro Kaneko
@ 2016-01-23 18:38 ` Guennadi Liakhovetski
2016-01-24 11:27 ` Yoshihiro Kaneko
0 siblings, 1 reply; 6+ messages in thread
From: Guennadi Liakhovetski @ 2016-01-23 18:38 UTC (permalink / raw)
To: Yoshihiro Kaneko; +Cc: linux-media, Simon Horman, Magnus Damm, linux-sh
Hello Kaneko-san,
I've got a question to this patch:
On Thu, 14 Jan 2016, Yoshihiro Kaneko wrote:
> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>
> This patch adds ARGB8888 capture format support for R-Car Gen3.
>
> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>
> This patch is based on the for-4.6-1 branch of Guennadi's v4l-dvb tree.
>
> v4 [Yoshihiro Kaneko]
> * As suggested by Sergei Shtylyov
> - revised an error message.
>
> v3 [Yoshihiro Kaneko]
> * rebased to for-4.6-1 branch of Guennadi's tree.
>
> v2 [Yoshihiro Kaneko]
> * As suggested by Sergei Shtylyov
> - fix the coding style of the braces.
>
> drivers/media/platform/soc_camera/rcar_vin.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
> index dc75a80..07c67f6 100644
> --- a/drivers/media/platform/soc_camera/rcar_vin.c
> +++ b/drivers/media/platform/soc_camera/rcar_vin.c
> @@ -124,7 +124,7 @@
> #define VNDMR_EXRGB (1 << 8)
> #define VNDMR_BPSM (1 << 4)
> #define VNDMR_DTMD_YCSEP (1 << 1)
> -#define VNDMR_DTMD_ARGB1555 (1 << 0)
> +#define VNDMR_DTMD_ARGB (1 << 0)
>
> /* Video n Data Mode Register 2 bits */
> #define VNDMR2_VPS (1 << 30)
> @@ -643,7 +643,7 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
> output_is_yuv = true;
> break;
> case V4L2_PIX_FMT_RGB555X:
> - dmr = VNDMR_DTMD_ARGB1555;
> + dmr = VNDMR_DTMD_ARGB;
> break;
> case V4L2_PIX_FMT_RGB565:
> dmr = 0;
> @@ -654,6 +654,14 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
Let me give a bit more context here for clarity:
if (priv->chip = RCAR_GEN2 || priv->chip = RCAR_H1 ||
priv->chip = RCAR_E1) {
> dmr = VNDMR_EXRGB;
> break;
> }
As you can see, there's no common "break" in the "case" clause above, i.e.
it is relying on falling through if the "if" condition isn't satisfied.
Now you insert your new "case" here, so, the failing "if" above will fall
through into your new case. Is this intended? This fall through was
handling the "invalid for this SoC pixel format" case, same as your "else"
case below. How about replacing all these cases with a "goto e_format"
statement and put "e_format:" below "return 0;" at the end of this
function? So, the above would become
if (priv->chip != RCAR_GEN2 && priv->chip != RCAR_H1 &&
priv->chip != RCAR_E1)
goto e_format;
dmr = VNDMR_EXRGB;
break;
And your addition would be
if (priv->chip != RCAR_GEN3)
goto e_format;
dmr = VNDMR_EXRGB | VNDMR_DTMD_ARGB;
break;
And then
default:
goto e_format;
Thanks
Guennadi
> + case V4L2_PIX_FMT_ARGB32:
> + if (priv->chip = RCAR_GEN3) {
> + dmr = VNDMR_EXRGB | VNDMR_DTMD_ARGB;
> + } else {
> + dev_err(icd->parent, "Unsupported format\n");
> + return -EINVAL;
> + }
> + break;
> default:
> dev_warn(icd->parent, "Invalid fourcc format (0x%x)\n",
> icd->current_fmt->host_fmt->fourcc);
> @@ -1304,6 +1312,14 @@ static const struct soc_mbus_pixelfmt rcar_vin_formats[] = {
> .order = SOC_MBUS_ORDER_LE,
> .layout = SOC_MBUS_LAYOUT_PACKED,
> },
> + {
> + .fourcc = V4L2_PIX_FMT_ARGB32,
> + .name = "ARGB8888",
> + .bits_per_sample = 32,
> + .packing = SOC_MBUS_PACKING_NONE,
> + .order = SOC_MBUS_ORDER_LE,
> + .layout = SOC_MBUS_LAYOUT_PACKED,
> + },
> };
>
> static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
> @@ -1611,6 +1627,7 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd,
> case V4L2_PIX_FMT_RGB32:
> can_scale = priv->chip != RCAR_E1;
> break;
> + case V4L2_PIX_FMT_ARGB32:
> case V4L2_PIX_FMT_UYVY:
> case V4L2_PIX_FMT_YUYV:
> case V4L2_PIX_FMT_RGB565:
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support
2014-10-31 15:06 [PATCH v4] media: soc_camera: rcar_vin: Add BT.709 24-bit RGB888 input support Yoshihiro Kaneko
2014-11-13 6:33 ` Simon Horman
2016-01-14 12:18 ` [PATCH v4] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support Yoshihiro Kaneko
@ 2016-01-24 3:55 ` kbuild test robot
2 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2016-01-24 3:55 UTC (permalink / raw)
To: linux-sh
[-- Attachment #1: Type: text/plain, Size: 1723 bytes --]
Hi Koji,
[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.4 next-20160122]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Yoshihiro-Kaneko/media-soc_camera-rcar_vin-Add-ARGB8888-caputre-format-support/20160114-202215
base: git://linuxtv.org/media_tree.git master
config: parisc-allyesconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=parisc
All errors (new ones prefixed by >>):
drivers/media/platform/soc_camera/rcar_vin.c: In function 'rcar_vin_setup':
>> drivers/media/platform/soc_camera/rcar_vin.c:657:21: error: 'RCAR_GEN3' undeclared (first use in this function)
if (priv->chip == RCAR_GEN3) {
^
drivers/media/platform/soc_camera/rcar_vin.c:657:21: note: each undeclared identifier is reported only once for each function it appears in
vim +/RCAR_GEN3 +657 drivers/media/platform/soc_camera/rcar_vin.c
651 if (priv->chip == RCAR_GEN2 || priv->chip == RCAR_H1 ||
652 priv->chip == RCAR_E1) {
653 dmr = VNDMR_EXRGB;
654 break;
655 }
656 case V4L2_PIX_FMT_ARGB32:
> 657 if (priv->chip == RCAR_GEN3) {
658 dmr = VNDMR_EXRGB | VNDMR_DTMD_ARGB;
659 } else {
660 dev_err(icd->parent, "Unsupported format\n");
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 43062 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support
2016-01-23 18:38 ` Guennadi Liakhovetski
@ 2016-01-24 11:27 ` Yoshihiro Kaneko
0 siblings, 0 replies; 6+ messages in thread
From: Yoshihiro Kaneko @ 2016-01-24 11:27 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: Linux Media Mailing List, Simon Horman, Magnus Damm,
Linux-sh list
Hi Guennadi-san,
Thanks for your review.
2016-01-24 3:38 GMT+09:00 Guennadi Liakhovetski <g.liakhovetski@gmx.de>:
> Hello Kaneko-san,
>
> I've got a question to this patch:
>
> On Thu, 14 Jan 2016, Yoshihiro Kaneko wrote:
>
>> From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>>
>> This patch adds ARGB8888 capture format support for R-Car Gen3.
>>
>> Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>> ---
>>
>> This patch is based on the for-4.6-1 branch of Guennadi's v4l-dvb tree.
>>
>> v4 [Yoshihiro Kaneko]
>> * As suggested by Sergei Shtylyov
>> - revised an error message.
>>
>> v3 [Yoshihiro Kaneko]
>> * rebased to for-4.6-1 branch of Guennadi's tree.
>>
>> v2 [Yoshihiro Kaneko]
>> * As suggested by Sergei Shtylyov
>> - fix the coding style of the braces.
>>
>> drivers/media/platform/soc_camera/rcar_vin.c | 21 +++++++++++++++++++--
>> 1 file changed, 19 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
>> index dc75a80..07c67f6 100644
>> --- a/drivers/media/platform/soc_camera/rcar_vin.c
>> +++ b/drivers/media/platform/soc_camera/rcar_vin.c
>> @@ -124,7 +124,7 @@
>> #define VNDMR_EXRGB (1 << 8)
>> #define VNDMR_BPSM (1 << 4)
>> #define VNDMR_DTMD_YCSEP (1 << 1)
>> -#define VNDMR_DTMD_ARGB1555 (1 << 0)
>> +#define VNDMR_DTMD_ARGB (1 << 0)
>>
>> /* Video n Data Mode Register 2 bits */
>> #define VNDMR2_VPS (1 << 30)
>> @@ -643,7 +643,7 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
>> output_is_yuv = true;
>> break;
>> case V4L2_PIX_FMT_RGB555X:
>> - dmr = VNDMR_DTMD_ARGB1555;
>> + dmr = VNDMR_DTMD_ARGB;
>> break;
>> case V4L2_PIX_FMT_RGB565:
>> dmr = 0;
>> @@ -654,6 +654,14 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
>
> Let me give a bit more context here for clarity:
>
> if (priv->chip = RCAR_GEN2 || priv->chip = RCAR_H1 ||
> priv->chip = RCAR_E1) {
>> dmr = VNDMR_EXRGB;
>> break;
>> }
>
> As you can see, there's no common "break" in the "case" clause above, i.e.
> it is relying on falling through if the "if" condition isn't satisfied.
> Now you insert your new "case" here, so, the failing "if" above will fall
> through into your new case. Is this intended? This fall through was
> handling the "invalid for this SoC pixel format" case, same as your "else"
> case below. How about replacing all these cases with a "goto e_format"
> statement and put "e_format:" below "return 0;" at the end of this
> function? So, the above would become
>
> if (priv->chip != RCAR_GEN2 && priv->chip != RCAR_H1 &&
> priv->chip != RCAR_E1)
> goto e_format;
>
> dmr = VNDMR_EXRGB;
> break;
>
> And your addition would be
>
> if (priv->chip != RCAR_GEN3)
> goto e_format;
>
> dmr = VNDMR_EXRGB | VNDMR_DTMD_ARGB;
> break;
>
> And then
>
> default:
> goto e_format;
Sounds good.
I will fix it according to your suggestion.
Thanks,
kaneko
>
> Thanks
> Guennadi
>
>> + case V4L2_PIX_FMT_ARGB32:
>> + if (priv->chip = RCAR_GEN3) {
>> + dmr = VNDMR_EXRGB | VNDMR_DTMD_ARGB;
>> + } else {
>> + dev_err(icd->parent, "Unsupported format\n");
>> + return -EINVAL;
>> + }
>> + break;
>> default:
>> dev_warn(icd->parent, "Invalid fourcc format (0x%x)\n",
>> icd->current_fmt->host_fmt->fourcc);
>> @@ -1304,6 +1312,14 @@ static const struct soc_mbus_pixelfmt rcar_vin_formats[] = {
>> .order = SOC_MBUS_ORDER_LE,
>> .layout = SOC_MBUS_LAYOUT_PACKED,
>> },
>> + {
>> + .fourcc = V4L2_PIX_FMT_ARGB32,
>> + .name = "ARGB8888",
>> + .bits_per_sample = 32,
>> + .packing = SOC_MBUS_PACKING_NONE,
>> + .order = SOC_MBUS_ORDER_LE,
>> + .layout = SOC_MBUS_LAYOUT_PACKED,
>> + },
>> };
>>
>> static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
>> @@ -1611,6 +1627,7 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd,
>> case V4L2_PIX_FMT_RGB32:
>> can_scale = priv->chip != RCAR_E1;
>> break;
>> + case V4L2_PIX_FMT_ARGB32:
>> case V4L2_PIX_FMT_UYVY:
>> case V4L2_PIX_FMT_YUYV:
>> case V4L2_PIX_FMT_RGB565:
>> --
>> 1.9.1
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-01-24 11:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-31 15:06 [PATCH v4] media: soc_camera: rcar_vin: Add BT.709 24-bit RGB888 input support Yoshihiro Kaneko
2014-11-13 6:33 ` Simon Horman
2016-01-14 12:18 ` [PATCH v4] media: soc_camera: rcar_vin: Add ARGB8888 caputre format support Yoshihiro Kaneko
2016-01-23 18:38 ` Guennadi Liakhovetski
2016-01-24 11:27 ` Yoshihiro Kaneko
2016-01-24 3:55 ` kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).