From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=68.232.154.123 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796195782; b=N0qaHsYKATnbgc488VvdpV7lwBq8L1QYgaeRW6Lqua98pirouw8R467VSmIZvEoHRyFL /IF+2c225O2775YSLr9Mt1ysYGdlnJEOvsX7IId1h7vUIKC7+8o1qsmxosdaDsy50A6Ms QfEcWMzYC1uZC8ealXgqI1G7c/ACzioC+7qlbCJPxpiVrNNWx3SVvAJQp9luwZCH9Xk65 +JX0SWbTygg753hUDrIhK58z34pFUrftJ0Nazqa576zFcuB8Z4SQ9on6lnRFhpdMsap// NWyA3qSlxd+oTyiycC7V1HGYSPEtGqDtg4ktU34fpaaT3x9aQInmAcVNYDCmMR6+/Ag== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796195782; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-Amp-Result:Received:Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To:To:CC:X-Mailer; bh=wJXWFhGpZrd4QS/aGTyElv+1HwUKePfVRfA/Wz6Qn7I=; b=WpBQ08MX6rBv0ngJqzLHfzSwYuxjMfbBiW46j/A3x8cQ7VLltlW3ZuNzg65NJk7cVCwy w8HhpJLxWxfX7gFJ0x0sbSOWyBsHj/aJkAtt3obkad+KUHmgs1Hv2MyY1wylASleqIK60 v+aimav8V7+qyUcRDP5r2KdM/s/pvgH5FvLTDYTsBCkKQcW08HtrzOgx+i6wwucfZXqXG rgsusryfGLqePtmqJ6/sDDiqfqtgulT8ZJXIVxi36U2IBjcGhq8Tzmd8q7eL81lWCp+JN MZdAPv5Ff6WA+GTC032ZEn1REPa1PQ2+4QdoAdJq7EVWx557qTKV6VJV9cSDPKb9VWQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=Dp+70Sfh; arc=none smtp.remote-ip=68.232.154.123 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3ABB9606A692 for ; Wed, 2 Dec 2026 07:16:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3ABB9606A692 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=Dp+70Sfh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1796195782; x=1827731782; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=J9mBWhSMkY/6KCg+P6oNxQe9JrmcqimVvKK+7wNX58Q=; b=Dp+70Sfh8sS3410ccrTUdOMCxWOC+tQHFad2twqZRCY5RyMSkf7Of2RJ xp2DNPeVoI16CCR5M5OpFxIdiwUdzpRYE+JYzzEsdRB5dp7yPpnRrrLJP NAnU0Ph5mqfPp1yAuj6A+BHh6yIQ8uOum3M3ESNsR4bLBYRMb/l95y49a IZkZNMJogoKag7RINBl65CSb5uFf3EFxPLzd41KRfJFgCnJs60cNbcVGH wCQAoSt/r3zqiuRXmNF2ZrFyKDBl+S40hBpg/ZR/MhgrwRWvk/0WX3R8q J+hcMoUM4BqfVGZmdBbeS8Kr1ltGuaD76TK7KylynyO+B9vCl2vc+rPfM w==; X-CSE-ConnectionGUID: nsG+PkafQsmCIKBM2R81HQ== X-CSE-MsgGUID: TfOimSNKRSeMW8Q4RZ+JcA== X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="234357122" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 00:16:20 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.87.71) by chn-vm-ex3.mchp-main.com (10.10.87.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.57; Wed, 2 Dec 2026 00:16:20 -0700 Received: from [127.0.0.1] (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Wed, 2 Dec 2026 00:16:18 -0700 From: Balakrishnan Sambath Date: Wed, 2 Dec 2026 12:46:11 +0530 Subject: [PATCH 05/15] media: microchip-isc: bypass SAMA7G5 pipeline for Bayer output X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20261202-isc-series-v1-v1-5-4e2f17c0271c@microchip.com> References: <20261202-isc-series-v1-v1-0-4e2f17c0271c@microchip.com> In-Reply-To: <20261202-isc-series-v1-v1-0-4e2f17c0271c@microchip.com> To: CC: , Balamanikandan Gunasundar , Balakrishnan Sambath X-Mailer: b4 0.14.3 The default case of isc_try_configure_pipeline() selects WB_ENABLE and DPC_BLCENABLE for raw Bayer input, so a Bayer output no longer carries the sensor data a software ISP expects. Clear bits_pipeline in isc_sama7g5_adapt_pipeline() for the outputs flagged raw, the 8, 10 and 12 bit SBGGR, SGBRG, SGRBG and SRGGB formats. The default case is shared with SAMA5D2 and SAM9X60, so it stays as is. Y10 is not flagged raw and keeps WB and black level correction like GREY and Y16. The histogram and awb_work are armed from ctrls.awb and the sensor mbus code only. Also test WB_ENABLE in bits_pipeline, else the HISDONE interrupt keeps firing per frame with the WB stage bypassed. Keep the one-shot do_white_balance button inactive in that case as well. Co-developed-by: Balamanikandan Gunasundar Signed-off-by: Balamanikandan Gunasundar Signed-off-by: Balakrishnan Sambath --- drivers/media/platform/microchip/microchip-isc-base.c | 7 +++++-- drivers/media/platform/microchip/microchip-sama7g5-isc.c | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c index 963d5fd53b58..4cbdc43da715 100644 --- a/drivers/media/platform/microchip/microchip-isc-base.c +++ b/drivers/media/platform/microchip/microchip-isc-base.c @@ -316,8 +316,9 @@ static int isc_configure(struct isc_device *isc) /* * The current implemented histogram is available for RAW R, B, GB, GR * channels. We need to check if sensor is outputting RAW BAYER + * and that the pipeline still has the WB stage. */ - if (isc->ctrls.awb && + if (isc->ctrls.awb && (pipeline & WB_ENABLE) && ISC_IS_FORMAT_RAW(isc->config.sd_format->mbus_code)) isc_set_histogram(isc, true); else @@ -387,7 +388,8 @@ static int isc_start_streaming(struct vb2_queue *vq, unsigned int count) spin_unlock_irqrestore(&isc->dma_queue_lock, flags); /* if we streaming from RAW, we can do one-shot white balance adj */ - if (ISC_IS_FORMAT_RAW(isc->config.sd_format->mbus_code)) + if (ISC_IS_FORMAT_RAW(isc->config.sd_format->mbus_code) && + (isc->config.bits_pipeline & WB_ENABLE)) v4l2_ctrl_activate(isc->do_wb_ctrl, true); return 0; @@ -1539,6 +1541,7 @@ static int isc_s_awb_ctrl(struct v4l2_ctrl *ctrl) /* if we have autowhitebalance on, start histogram procedure */ if (ctrls->awb == ISC_WB_AUTO && + (isc->config.bits_pipeline & WB_ENABLE) && vb2_is_streaming(&isc->vb2_vidq) && ISC_IS_FORMAT_RAW(isc->config.sd_format->mbus_code)) isc_set_histogram(isc, true); diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c index 6950509372a5..80bd0fd3716d 100644 --- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c +++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c @@ -335,6 +335,18 @@ static void isc_sama7g5_config_rlp(struct isc_device *isc) static void isc_sama7g5_adapt_pipeline(struct isc_device *isc) { + const struct isc_format *fmt; + u32 i; + + for (i = 0; i < isc->controller_formats_size; i++) { + fmt = &isc->controller_formats[i]; + if (fmt->fourcc == isc->try_config.fourcc && fmt->raw) { + /* Bayer out reaches the software ISP unmodified */ + isc->try_config.bits_pipeline = 0x0; + return; + } + } + isc->try_config.bits_pipeline &= ISC_SAMA7G5_PIPELINE; } -- 2.34.1