mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Foss <robert.foss@linaro.org>
To: dongchun.zhu@mediatek.com, mchehab@kernel.org,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tomasz Figa <tfiga@google.com>,
	Dongchun Zhu <Dongchun.Zhu@mediatek.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bingbu Cao <bingbu.cao@linux.intel.com>
Cc: Robert Foss <robert.foss@linaro.org>
Subject: [PATCH v1] media: ov8856: Fix Bayer format dependance on mode
Date: Tue, 24 Nov 2020 16:03:32 +0100	[thread overview]
Message-ID: <20201124150332.3026752-1-robert.foss@linaro.org> (raw)

The Bayer GRBG10 mode used for earlier modes 3280x2460 and
1640x1232 isn't the mode output by the sensor for the
3264x2448 and 1632x1224 modes.

Switch from MEDIA_BUS_FMT_SGRBG10_1X10 to MEDIA_BUS_FMT_SBGGR10_1X10
for 3264x2448 & 1632x1224 modes.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
---

This patch is sent out after Dongchun Zhu clarified the Bayer
modes used by different sensor configuration in the below thread.

https://lkml.org/lkml/2020/11/24/335

 drivers/media/i2c/ov8856.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c
index 2f4ceaa80593..a2dcbece558c 100644
--- a/drivers/media/i2c/ov8856.c
+++ b/drivers/media/i2c/ov8856.c
@@ -1281,8 +1281,13 @@ static void ov8856_update_pad_format(const struct ov8856_mode *mode,
 {
 	fmt->width = mode->width;
 	fmt->height = mode->height;
-	fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
 	fmt->field = V4L2_FIELD_NONE;
+
+	if (mode->reg_list.regs == mode_3264x2448_regs ||
+	    mode->reg_list.regs == mode_1632x1224_regs)
+		fmt->code = MEDIA_BUS_FMT_SBGGR10_1X10;
+	else
+		fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
 }
 
 static int ov8856_start_streaming(struct ov8856 *ov8856)
-- 
2.27.0


             reply	other threads:[~2020-11-24 15:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 15:03 Robert Foss [this message]
2020-11-24 17:13 ` Sakari Ailus

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=20201124150332.3026752-1-robert.foss@linaro.org \
    --to=robert.foss@linaro.org \
    --cc=bingbu.cao@linux.intel.com \
    --cc=dongchun.zhu@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@google.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®