From patchwork Mon Jan 18 19:01:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 365557 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp85823jam; Mon, 18 Jan 2021 11:04:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxij6cb5yFgMx68phjxelAprDjEjFhgX5RZE/GQzDtb0EfUZ8cuADeV88pEpGjA+X+bE7we X-Received: by 2002:a50:fe0e:: with SMTP id f14mr679721edt.159.1610996697753; Mon, 18 Jan 2021 11:04:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610996697; cv=none; d=google.com; s=arc-20160816; b=JiEwrA+g/NcUgY6Yl0HUJTE1qxMvrBqVh1NAX5eLJ4Ncr9XzqeIn7U8agoA9P+kNWb qpbjEbYFizwlWsxoQwAhee33t1qobN/2gp7NzINp4emMc/YItzvJ/EKiTX1A+pEjsLan yu/URi4Iwo37OWgvsF+neJrA7M46FTBJDTDCVo94Q34DG/+rDK12/5xTqy/ptbL+oKes L5LWbEtDgnIZ8u8Htu/WRdwkZUu9HT00gLmUaWZqEZXvrLKGRDIWPdHy6UB4Sp+Mc58u ZbxWcOw2+HkYdtfowJx7uwCcvshMh3fZT1Xd4J4AURnZm/BdzHmjzDZguauFrRPaYsoX xTnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8Kty1SsDZGYmfUaFdIQI7Zq2VlU05k1IiFmWYlmVzbE=; b=Kc9ycuFWwa2EyqXjJ26VpbdSuUmozxmvMUwaa8eKSBbaHQ6StDq6pieMu49X++MVZl Ef7VXrgUQiU2n8txRBZ7OqNUPiA4YR2kirre/kdNYtD307AreooM6C7wG8AFy5PQjEq9 JZDtlsSIOY3JNXiLwyPtgizxEJplKa069VJS2F6TdeBYYtcaQRdvkLfk1rf/RB/EmexS cmFqXF1bz2/h9bIQlKWTpNjXY2hj2izppNNcpZOTTCmju1CieyC7UQKezh7RWb46IwT8 KIDlCnmqdkCTMCjhmVu85drBQdkmH+VeyF3V79ZbTOWd6rhSOPJeB3NyJrK/Xr1xbyYn cHww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pyMAcrMR; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zk17si7201061ejb.268.2021.01.18.11.04.57; Mon, 18 Jan 2021 11:04:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pyMAcrMR; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407615AbhARTDP (ORCPT + 3 others); Mon, 18 Jan 2021 14:03:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436954AbhARTC6 (ORCPT ); Mon, 18 Jan 2021 14:02:58 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6026C061574 for ; Mon, 18 Jan 2021 11:02:07 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id 190so14531849wmz.0 for ; Mon, 18 Jan 2021 11:02:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8Kty1SsDZGYmfUaFdIQI7Zq2VlU05k1IiFmWYlmVzbE=; b=pyMAcrMRbEe6TGaFQnMhvLyPC81ZH5fVLbGbHmSJ8iJT/EvtGysU0MlhGwYCaM6Go3 AwLNWS2HzdTR2aIebufDjsAplNBGkKRK4JuZ7OOruuQiwEOZ0di3yoTEbjA70eYrYBFQ iqc1L43A4SgXovb4nwEem3jVmwSbHm0Nu7arZQjfb7jtH5pSqi/JRRw2C7y+WXeLOU8n g8GYlReg8EuRnt0NyADBdx02d7o4kR9xFntpWHIaWC9N+jYoa6NDSycS5WVZky453IcP fhBHtlw1tc6f2sx6ub6xw1B78uNMXIHfgzbVmUCjblR5ZFSYMofPgEzFxT12cpA2sLTQ pzbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8Kty1SsDZGYmfUaFdIQI7Zq2VlU05k1IiFmWYlmVzbE=; b=t2f/+qSPeRgsm5UnWDDlnjqFWb1EsfUvYs627vse2EO0RftmFRq7AEi7c5ebAFpGk7 lCasEL0e7KlGIDFLXxhCYld+2JT7Zr3gIFfxkLEatxDyTWLWu9hKz2ymSfMqmt0muT5h hnpXf0qaED6toIRPNaCkLokkQsWTs2iDpM8p5aN1sDT5K4AAFvemh9mzrRApVAvSitlk v1xb40OgriFALhDzbQciJKyn2Rfm2c02C0YO3fH3MXtzak0tij/X60+6fJOLvC3xQFR4 1+JYho8+Fy4mYsmWogIaKdYxJCfWpiahkBS3PLh05/WoSUwYQBEu4FOst++e1zL2iaoy +0Aw== X-Gm-Message-State: AOAM532jui7RSFv24Of1q16uKqwhoJa54WhaiLg6aodF5dL+UZGvbsRx rtIacnv1os2QxmmAOBCTNX4vCA== X-Received: by 2002:a1c:a145:: with SMTP id k66mr700875wme.11.1610996526322; Mon, 18 Jan 2021 11:02:06 -0800 (PST) Received: from localhost.localdomain ([2a02:2450:102f:d6a:399d:974c:1ebc:7134]) by smtp.gmail.com with ESMTPSA id z63sm519244wme.8.2021.01.18.11.02.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 11:02:05 -0800 (PST) From: Robert Foss To: dongchun.zhu@mediatek.com, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Dongchun Zhu , Sakari Ailus , Bingbu Cao , Andrey Konovalov Cc: Tomasz Figa , Robert Foss Subject: [PATCH v4] media: ov8856: Configure sensor for GRBG Bayer for all modes Date: Mon, 18 Jan 2021 20:01:32 +0100 Message-Id: <20210118190132.1045913-1-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The previously added modes 3264x2448 & 1632x1224 are actually configuring the sensor for BGGR mode, this is an issue since the mode that is exposed through V4L incorrectly is set as GRBG. This patch fixes the issue by moving the output crop window of internal sensor ISP uses by one row, which means that the Bayer pattern of the output is changed. From: row 1: B G B G B G ... row 2: G R G R G R ... raw 3: B G B G B G ... ... To: raw 2: G R G R G R ... raw 3: B G B G B G ... ... Signed-off-by: Robert Foss Suggested-by: Andrey Konovalov --- Changes since v1: - Sakari: Added mode information to ov8856_mode struct - Sakari: enum_mbus_code updated Changes since v2: - Andrey: Switched approach to changing the sensor configuration to yield identical Bayer modes for all modes Changes since v3: - Andrey: Improve commit msg to explain Bayer shift better drivers/media/i2c/ov8856.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.27.0 Reviewed-by: Andrey Konovalov diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c index 2f4ceaa80593..8a355135c7db 100644 --- a/drivers/media/i2c/ov8856.c +++ b/drivers/media/i2c/ov8856.c @@ -428,7 +428,7 @@ static const struct ov8856_reg mode_3264x2448_regs[] = { {0x3810, 0x00}, {0x3811, 0x04}, {0x3812, 0x00}, - {0x3813, 0x02}, + {0x3813, 0x01}, {0x3814, 0x01}, {0x3815, 0x01}, {0x3816, 0x00}, @@ -821,7 +821,7 @@ static const struct ov8856_reg mode_1632x1224_regs[] = { {0x3810, 0x00}, {0x3811, 0x02}, {0x3812, 0x00}, - {0x3813, 0x02}, + {0x3813, 0x01}, {0x3814, 0x03}, {0x3815, 0x01}, {0x3816, 0x00},