Message ID | 20240430103956.60190-20-jacopo.mondi@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Series | [01/19] media: adv748x: Add support for active state | expand |
Hi Jacopo, Same for this patch, can't we fix this issue independent from the streams work? On 2024-04-30 12:39:55 +0200, Jacopo Mondi wrote: > The YUYV8_1X16 and UYVY8_1X16 formats are treated as 'ITU-R > BT.601/BT.1358 16-bit YCbCr-422 input' (YUV16 - 0x5) in the R-Car VIN > driver and are thus disallowed when capturing frames from the R-Car > CSI-2 interface according to the hardware manual. > > As the 1X16 format variants are meant to be used with serial busses they > have to be treated as 'YCbCr-422 8-bit data input' (0x1) when capturing > from CSI-2, which is a valid setting for CSI-2. > > Commit 78b3f9d75a62 ("media: rcar-vin: Add check that input interface > and format are valid") disallowed capturing YUV16 when using the CSI-2 > interface. Fix this by using YUV8_BT601 for YCbCr422 when CSI-2 is in > use. > > Fixes: 78b3f9d75a62 ("media: rcar-vin: Add check that input interface and format are valid") > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > .../media/platform/renesas/rcar-vin/rcar-dma.c | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c > index e2c40abc6d3d..21d5b2815e86 100644 > --- a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c > +++ b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c > @@ -742,12 +742,22 @@ static int rvin_setup(struct rvin_dev *vin) > */ > switch (vin->mbus_code) { > case MEDIA_BUS_FMT_YUYV8_1X16: > - /* BT.601/BT.1358 16bit YCbCr422 */ > - vnmc |= VNMC_INF_YUV16; > + if (vin->is_csi) > + /* YCbCr422 8-bit */ > + vnmc |= VNMC_INF_YUV8_BT601; > + else > + /* BT.601/BT.1358 16bit YCbCr422 */ > + vnmc |= VNMC_INF_YUV16; > input_is_yuv = true; > break; > case MEDIA_BUS_FMT_UYVY8_1X16: > - vnmc |= VNMC_INF_YUV16 | VNMC_YCAL; > + if (vin->is_csi) > + /* YCbCr422 8-bit */ > + vnmc |= VNMC_INF_YUV8_BT601; > + else > + /* BT.601/BT.1358 16bit YCbCr422 */ > + vnmc |= VNMC_INF_YUV16; > + vnmc |= VNMC_YCAL; > input_is_yuv = true; > break; > case MEDIA_BUS_FMT_UYVY8_2X8: > -- > 2.44.0 >
On Thu, May 02, 2024 at 04:33:26PM +0200, Niklas Söderlund wrote: > Hi Jacopo, > > Same for this patch, can't we fix this issue independent from the > streams work? +1 > On 2024-04-30 12:39:55 +0200, Jacopo Mondi wrote: > > The YUYV8_1X16 and UYVY8_1X16 formats are treated as 'ITU-R > > BT.601/BT.1358 16-bit YCbCr-422 input' (YUV16 - 0x5) in the R-Car VIN > > driver and are thus disallowed when capturing frames from the R-Car > > CSI-2 interface according to the hardware manual. > > > > As the 1X16 format variants are meant to be used with serial busses they > > have to be treated as 'YCbCr-422 8-bit data input' (0x1) when capturing > > from CSI-2, which is a valid setting for CSI-2. > > > > Commit 78b3f9d75a62 ("media: rcar-vin: Add check that input interface > > and format are valid") disallowed capturing YUV16 when using the CSI-2 > > interface. Fix this by using YUV8_BT601 for YCbCr422 when CSI-2 is in > > use. > > > > Fixes: 78b3f9d75a62 ("media: rcar-vin: Add check that input interface and format are valid") > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > --- > > .../media/platform/renesas/rcar-vin/rcar-dma.c | 16 +++++++++++++--- > > 1 file changed, 13 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c > > index e2c40abc6d3d..21d5b2815e86 100644 > > --- a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c > > +++ b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c > > @@ -742,12 +742,22 @@ static int rvin_setup(struct rvin_dev *vin) > > */ > > switch (vin->mbus_code) { > > case MEDIA_BUS_FMT_YUYV8_1X16: > > - /* BT.601/BT.1358 16bit YCbCr422 */ > > - vnmc |= VNMC_INF_YUV16; > > + if (vin->is_csi) > > + /* YCbCr422 8-bit */ > > + vnmc |= VNMC_INF_YUV8_BT601; > > + else > > + /* BT.601/BT.1358 16bit YCbCr422 */ > > + vnmc |= VNMC_INF_YUV16; > > input_is_yuv = true; > > break; > > case MEDIA_BUS_FMT_UYVY8_1X16: > > - vnmc |= VNMC_INF_YUV16 | VNMC_YCAL; > > + if (vin->is_csi) > > + /* YCbCr422 8-bit */ > > + vnmc |= VNMC_INF_YUV8_BT601; > > + else > > + /* BT.601/BT.1358 16bit YCbCr422 */ > > + vnmc |= VNMC_INF_YUV16; > > + vnmc |= VNMC_YCAL; > > input_is_yuv = true; > > break; > > case MEDIA_BUS_FMT_UYVY8_2X8:
diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c index e2c40abc6d3d..21d5b2815e86 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c @@ -742,12 +742,22 @@ static int rvin_setup(struct rvin_dev *vin) */ switch (vin->mbus_code) { case MEDIA_BUS_FMT_YUYV8_1X16: - /* BT.601/BT.1358 16bit YCbCr422 */ - vnmc |= VNMC_INF_YUV16; + if (vin->is_csi) + /* YCbCr422 8-bit */ + vnmc |= VNMC_INF_YUV8_BT601; + else + /* BT.601/BT.1358 16bit YCbCr422 */ + vnmc |= VNMC_INF_YUV16; input_is_yuv = true; break; case MEDIA_BUS_FMT_UYVY8_1X16: - vnmc |= VNMC_INF_YUV16 | VNMC_YCAL; + if (vin->is_csi) + /* YCbCr422 8-bit */ + vnmc |= VNMC_INF_YUV8_BT601; + else + /* BT.601/BT.1358 16bit YCbCr422 */ + vnmc |= VNMC_INF_YUV16; + vnmc |= VNMC_YCAL; input_is_yuv = true; break; case MEDIA_BUS_FMT_UYVY8_2X8:
The YUYV8_1X16 and UYVY8_1X16 formats are treated as 'ITU-R BT.601/BT.1358 16-bit YCbCr-422 input' (YUV16 - 0x5) in the R-Car VIN driver and are thus disallowed when capturing frames from the R-Car CSI-2 interface according to the hardware manual. As the 1X16 format variants are meant to be used with serial busses they have to be treated as 'YCbCr-422 8-bit data input' (0x1) when capturing from CSI-2, which is a valid setting for CSI-2. Commit 78b3f9d75a62 ("media: rcar-vin: Add check that input interface and format are valid") disallowed capturing YUV16 when using the CSI-2 interface. Fix this by using YUV8_BT601 for YCbCr422 when CSI-2 is in use. Fixes: 78b3f9d75a62 ("media: rcar-vin: Add check that input interface and format are valid") Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> --- .../media/platform/renesas/rcar-vin/rcar-dma.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)