linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andrey.konovalov@linaro.org>
To: Jonathan Marek <jonathan@marek.ca>, linux-arm-msm@vger.kernel.org
Cc: robert.foss@linaro.org, Todor Tomov <todor.too@gmail.com>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	"open list:QUALCOMM CAMERA SUBSYSTEM DRIVER" 
	<linux-media@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 04/17] media: camss: csid-170: fix non-10bit formats
Date: Wed, 26 May 2021 16:59:55 +0300	[thread overview]
Message-ID: <8e8b4ae8-d4af-2b8d-9ed0-6a4b82d575e6@linaro.org> (raw)
In-Reply-To: <99f482de-78f8-82da-e52b-7f76da67ff39@marek.ca>

Hi Jonathan,

On 25.05.2021 21:38, Jonathan Marek wrote:
> On 5/25/21 2:15 PM, Andrey Konovalov wrote:
>> Hi Jonathan,
>>
>> Thank you for your patch!
>>
>> On 11.05.2021 21:07, Jonathan Marek wrote:
>>> Use the decode_format/data_type from the "format" struct instead of a
>>> hardcoded 10-bit format.
>>>
>>> Fixes: eebe6d00e9bf ("media: camss: Add support for CSID hardware version Titan 170")
>>> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
>>> ---
>>>   drivers/media/platform/qcom/camss/camss-csid-170.c | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/media/platform/qcom/camss/camss-csid-170.c b/drivers/media/platform/qcom/camss/camss-csid-170.c
>>> index ac22ff29d2a9..a81cc94c075f 100644
>>> --- a/drivers/media/platform/qcom/camss/camss-csid-170.c
>>> +++ b/drivers/media/platform/qcom/camss/camss-csid-170.c
>>> @@ -366,7 +366,7 @@ static void csid_configure_stream(struct csid_device *csid, u8 enable)
>>>               val |= input_format->width & 0x1fff << TPG_DT_n_CFG_0_FRAME_WIDTH;
>>>               writel_relaxed(val, csid->base + CSID_TPG_DT_n_CFG_0(0));
>>> -            val = DATA_TYPE_RAW_10BIT << TPG_DT_n_CFG_1_DATA_TYPE;
>>> +            val = format->data_type << TPG_DT_n_CFG_1_DATA_TYPE;
>>>               writel_relaxed(val, csid->base + CSID_TPG_DT_n_CFG_1(0));
>>>               val = tg->mode << TPG_DT_n_CFG_2_PAYLOAD_MODE;
>>> @@ -382,8 +382,8 @@ static void csid_configure_stream(struct csid_device *csid, u8 enable)
>>>           val = 1 << RDI_CFG0_BYTE_CNTR_EN;
>>>           val |= 1 << RDI_CFG0_FORMAT_MEASURE_EN;
>>>           val |= 1 << RDI_CFG0_TIMESTAMP_EN;
>>> -        val |= DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT;
>>> -        val |= DATA_TYPE_RAW_10BIT << RDI_CFG0_DATA_TYPE;
>>> +        val |= format->decode_format << RDI_CFG0_DECODE_FORMAT;
>>> +        val |= format->data_type << RDI_CFG0_DATA_TYPE;
>>
>> I've given it a try on RB3 board (aka db845c plus the navigation mezzanine), which uses ov8856 camera
>> sensor (its output format is SGRBG10_1X10).
>>
>> The above change doesn't work for me because format->decode_format has the value of 0x02 (which is
>> DECODE_FORMAT_UNCOMPRESSED_10_BIT). format->data_type has the expected value of 0x2b (DATA_TYPE_RAW_10BIT).
>>
> 
> I will change it back to using DECODE_FORMAT_PAYLOAD_ONLY for the v2, since it does seem like this is the correct value for the 
> RDI path.

Sounds good. Just in case, I've tried

--- a/drivers/media/platform/qcom/camss/camss-csid-170.c
+++ b/drivers/media/platform/qcom/camss/camss-csid-170.c
@@ -390,7 +390,7 @@ static void csid_configure_stream(struct csid_device *csid, u8 enable)
                 val = 1 << RDI_CFG0_BYTE_CNTR_EN;
                 val |= 1 << RDI_CFG0_FORMAT_MEASURE_EN;
                 val |= 1 << RDI_CFG0_TIMESTAMP_EN;
-               val |= format->decode_format << RDI_CFG0_DECODE_FORMAT;
+               val |= DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT;
                 val |= format->data_type << RDI_CFG0_DATA_TYPE;
                 val |= vc << RDI_CFG0_VIRTUAL_CHANNEL;
                 val |= dt_id << RDI_CFG0_DT_ID;

on top of v1 patchset, and it worked OK on RB3 with the ov8856 camera.

I planned to check the other RB3's camera too - the "tracking" ov7251 one, but it turned out that I don't
have the information on which particular SOC's MIPI lanes are connected to this camera. I've tried a few
clock-lanes/data-lanes combinations, but none worked (ov7251 is controlled OK via the i2c bus, but no
data are captured).

> (but IIRC, using DECODE_FORMAT_UNCOMPRESSED_10_BIT worked on RB3 with the ov8856 camera last year when I brought it up. maybe 
> the VFE or another register is configured differently)

OK. I only used the current upstream camss driver, so have nothing to compare it against.

I also noticed that with ov8856 camera, only 3264x2448 and 1632x1224 modes work correctly on RB3
(used the current media_tree). But with the below change all the other modes (3280x2464 and 1640x1232)
start working OK too:

--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -1575,7 +1575,7 @@ int msm_vfe_register_entities(struct vfe_device *vfe,
                 }

                 video_out->ops = &vfe->video_ops;
-               video_out->bpl_alignment = 8;
+               video_out->bpl_alignment = 16;
                 video_out->line_based = 0;
                 if (i == VFE_LINE_PIX) {
                         video_out->bpl_alignment = 16;

And (with the increased size of the capture buffer) I did see that the data captured from camss were padded
to the next 16-byte boundary with the data from the previous 16-byte chunk. E.g. in the 3280x2464 case 12
padding bytes were added.
Personally I don't have access to the datasheet, but I've been told that as per the docs, 16-byte alignment
should not be needed in this case (RAW10P camera connected through rdi).
Does it ring any bell for you?

Thanks,
Andrey

>> Thanks,
>> Andrey
>>
>>>           val |= vc << RDI_CFG0_VIRTUAL_CHANNEL;
>>>           val |= dt_id << RDI_CFG0_DT_ID;
>>>           writel_relaxed(val, csid->base + CSID_RDI_CFG0(0));
>>>

  reply	other threads:[~2021-05-26 14:00 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 18:07 [PATCH 00/17] CAMSS: SM8250 support (and some fixes) Jonathan Marek
2021-05-11 18:07 ` [PATCH 01/17] media: camss: csiphy-3ph: don't print HW version as an error Jonathan Marek
2021-05-19 10:16   ` Robert Foss
2021-05-11 18:07 ` [PATCH 02/17] media: camss: csiphy-3ph: disable interrupts Jonathan Marek
2021-05-19 15:52   ` Robert Foss
2021-05-11 18:07 ` [PATCH 03/17] media: camss: csiphy-3ph: add support for SM8250 CSI DPHY Jonathan Marek
2021-05-19 16:26   ` Robert Foss
2021-05-25 17:19   ` Andrey Konovalov
2021-05-25 17:35     ` Andrey Konovalov
2021-05-11 18:07 ` [PATCH 04/17] media: camss: csid-170: fix non-10bit formats Jonathan Marek
2021-05-20 10:31   ` Robert Foss
2021-05-25 18:15   ` Andrey Konovalov
2021-05-25 18:38     ` Jonathan Marek
2021-05-26 13:59       ` Andrey Konovalov [this message]
2021-05-11 18:07 ` [PATCH 05/17] media: camss: csid-170: don't enable unused irqs Jonathan Marek
2021-05-20 10:39   ` Robert Foss
2021-05-11 18:07 ` [PATCH 06/17] media: camss: csid-170: remove stray comment Jonathan Marek
2021-05-20 10:57   ` Robert Foss
2021-05-11 18:07 ` [PATCH 07/17] media: camss: csid-170: support more than one lite vfe Jonathan Marek
2021-05-20 11:54   ` Robert Foss
2021-05-11 18:07 ` [PATCH 08/17] media: camss: csid-170: set the right HALF_CMD when disabled Jonathan Marek
2021-05-20 11:10   ` Robert Foss
2021-05-11 18:07 ` [PATCH 09/17] media: camss: csid: allow csid to work without a regulator Jonathan Marek
2021-05-20 12:14   ` Robert Foss
2021-05-11 18:07 ` [PATCH 10/17] media: camss: remove vdda-csiN from sdm845 resources Jonathan Marek
2021-05-31 11:02   ` Robert Foss
2021-05-11 18:07 ` [PATCH 11/17] media: camss: fix VFE irq name Jonathan Marek
2021-05-31 11:03   ` Robert Foss
2021-05-11 18:07 ` [PATCH 12/17] media: camss: vfe-170: clean up some dead code Jonathan Marek
2021-05-31 11:11   ` Robert Foss
2021-05-11 18:07 ` [PATCH 13/17] media: camss: vfe-170: fix "VFE halt timeout" error Jonathan Marek
2021-05-31 11:13   ` Robert Foss
2021-05-11 18:07 ` [PATCH 14/17] media: camss: Add initial support for VFE hardware version Titan 480 Jonathan Marek
2021-05-31 12:13   ` Robert Foss
2021-06-08 23:08     ` Jonathan Marek
2021-06-09 15:06       ` Robert Foss
2021-05-11 18:07 ` [PATCH 15/17] media: camss: add support for V4L2_PIX_FMT_GREY for sdm845 HW Jonathan Marek
2021-05-31 12:14   ` Robert Foss
2021-05-11 18:07 ` [PATCH 16/17] media: camss: add support for SM8250 camss Jonathan Marek
2021-05-31 16:07   ` Robert Foss
2021-05-11 18:07 ` [PATCH 17/17] media: dt-bindings: media: camss: Add qcom,sm8250-camss binding Jonathan Marek
2021-05-12 18:35   ` Rob Herring
2021-06-08 22:34 [PATCH 00/17] CAMSS: SM8250 support (and some fixes) Jonathan Marek
2021-06-08 22:34 ` [PATCH 04/17] media: camss: csid-170: fix non-10bit formats Jonathan Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e8b4ae8-d4af-2b8d-9ed0-6a4b82d575e6@linaro.org \
    --to=andrey.konovalov@linaro.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jonathan@marek.ca \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robert.foss@linaro.org \
    --cc=todor.too@gmail.com \
    --subject='Re: [PATCH 04/17] media: camss: csid-170: fix non-10bit formats' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox