From patchwork Mon Dec 18 09:56:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Massot X-Patchwork-Id: 755803 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7061F125A3 for ; Mon, 18 Dec 2023 09:56:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="aVIleK3A" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702893399; bh=aZxFvBCzVGWidU55REJGWf/K6aRmbdrMYFMczhY/jzM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aVIleK3ASDA5MRXCizrOeRBJTmmNfgDUB1qTO26mIJjrTMEGbouW3nbc9Y1L6ZJv9 KUoNdVZAl88+KQTpGRIXnai9VSIfEGZS3e4bOzwgYQztQg1UBh0wDdQ/LPXg1j1/9y BoogXa8cYbdUDQ/g9FugsONUaZ0FdBDEPcbi15A38BqoNgPyXnspWRxRayfkOCxfFe lK82ialIYrnwMbT+ybRGWLkqcvrbgzCTe9VQj4esgfFC/uOIRvYRH5PBIByIuHReCZ dDdBZDA0Y6obhI9eZesE7ACOMOB9lGzt3H+8ugLg0LpuNcHoFQ41n7J2eg662Flw1n jAuEpVsFeokXQ== Received: from stla-brain-8255-1.home (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmassot) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 13F74378143B; Mon, 18 Dec 2023 09:56:39 +0000 (UTC) From: Julien Massot To: j-luthra@ti.com, mchehab@kernel.org, mripard@kernel.org, sakari.ailus@linux.intel.com Cc: kernel@collabora.com, linux-media@vger.kernel.org, Julien Massot Subject: [PATCH v2 1/5] media: cadence: csi2rx: use match fwnode for media link Date: Mon, 18 Dec 2023 10:56:00 +0100 Message-ID: <20231218095604.1950737-2-julien.massot@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218095604.1950737-1-julien.massot@collabora.com> References: <20231218095604.1950737-1-julien.massot@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On some subdev the fwnode is the device node and not the endpoint node. Using the subdev fwnode doesn't allow to fetch the subdev pad we are connected to when the remote subdev has multiple output pads. Fixes: 1fc3b37f34f69 ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver") Signed-off-by: Julien Massot Reviewed-by: Jai Luthra --- drivers/media/platform/cadence/cdns-csi2rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index 91ef22e9109a..e83b877c48da 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -467,7 +467,7 @@ static int csi2rx_async_bound(struct v4l2_async_notifier *notifier, struct csi2rx_priv *csi2rx = v4l2_subdev_to_csi2rx(subdev); csi2rx->source_pad = media_entity_get_fwnode_pad(&s_subdev->entity, - s_subdev->fwnode, + asd->match.fwnode, MEDIA_PAD_FL_SOURCE); if (csi2rx->source_pad < 0) { dev_err(csi2rx->dev, "Couldn't find output pad for subdev %s\n", From patchwork Mon Dec 18 09:56:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Massot X-Patchwork-Id: 755804 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55456125A7 for ; Mon, 18 Dec 2023 09:56:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="G9nAnGHi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702893400; bh=ZaIHHVqn+yVqhJs8ksXxj/gl+AZmRMrIHZFrHq0tXn0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G9nAnGHiXk4ITYslYMhXjjODITQBLybjP2VDYuopc+6NcvwEYIoEr+wOvdSpHMybR k6T9ev3qFKmYUdxwCwl236pI+TxVPJowbpNKqVh+sUpLwUtWyomBHSR/SaueEQDsgb UTcc9ZABopsQ4Jv/1i53jYB8hi0cpY+eB6tgsjU7iQcvMg9pCcjsnnEafIn4cuXTja 5JV+kpwqfOZ7xtOaOTcSZYsGiIueLHozxqYRkBCGC3EeBz3S5GqvMtP6L+OqBrLftT Y6yoiA6pb/WyMVULBSXXVaXrN3NvC5iq9uZPjQlzWhszojtY8AnvEm6K0png3ciij2 tHPNXh2nsoHSg== Received: from stla-brain-8255-1.home (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmassot) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D77A73781493; Mon, 18 Dec 2023 09:56:39 +0000 (UTC) From: Julien Massot To: j-luthra@ti.com, mchehab@kernel.org, mripard@kernel.org, sakari.ailus@linux.intel.com Cc: kernel@collabora.com, linux-media@vger.kernel.org, Julien Massot Subject: [PATCH v2 2/5] media: cadence: csi2rx: add Y8_1X8 format Date: Mon, 18 Dec 2023 10:56:01 +0100 Message-ID: <20231218095604.1950737-3-julien.massot@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218095604.1950737-1-julien.massot@collabora.com> References: <20231218095604.1950737-1-julien.massot@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for MEDIA_BUS_FMT_Y8_1X8 format. Signed-off-by: Julien Massot Acked-by: Jai Luthra --- drivers/media/platform/cadence/cdns-csi2rx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index e83b877c48da..2ca4a8cde75e 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -114,6 +114,7 @@ static const struct csi2rx_fmt formats[] = { { .code = MEDIA_BUS_FMT_SGBRG8_1X8, .bpp = 8, }, { .code = MEDIA_BUS_FMT_SGRBG8_1X8, .bpp = 8, }, { .code = MEDIA_BUS_FMT_SRGGB8_1X8, .bpp = 8, }, + { .code = MEDIA_BUS_FMT_Y8_1X8, .bpp = 8, }, { .code = MEDIA_BUS_FMT_SBGGR10_1X10, .bpp = 10, }, { .code = MEDIA_BUS_FMT_SGBRG10_1X10, .bpp = 10, }, { .code = MEDIA_BUS_FMT_SGRBG10_1X10, .bpp = 10, }, From patchwork Mon Dec 18 09:56:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Massot X-Patchwork-Id: 755802 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B67512B6C for ; Mon, 18 Dec 2023 09:56:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Db1kw1mm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702893402; bh=MDExTYdJkWIk2zvfyiU5HH3RUQbAn6qsgeRa4iGvBrs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Db1kw1mmiqrLMw9bfiuNsSCgBxKIz+ROpArztmv9IALpR2eO3nttvjTAns73+BFsN 9yE+DVzmbZwB3yYjhp8ctqw1PwEqFn+nKUsokWWs1X7lEyUfaB29+j3kGJ+Qf7Dhhi bfKsYXVyc4MBfXKL0tWdiDBJkOU5C4eUKcgz1+8fr+gL56Tfs7SsibWJGLGxqdAXxd Fo4rWQ+vZW66qWMFBQdVlBMAWYqumNWfvy0ZaBd1AAdvwRWDIug6riQaXm3QW9sWeO da7PpK0XEuVusSTl9cQfuSijl4BWDrN0YDF/wrHiwTTWTQ44/nS9NOpTwsTRHV4DnI tnkO+CLwh2Oew== Received: from stla-brain-8255-1.home (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmassot) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 4C9A237814A8; Mon, 18 Dec 2023 09:56:42 +0000 (UTC) From: Julien Massot To: j-luthra@ti.com, mchehab@kernel.org, mripard@kernel.org, sakari.ailus@linux.intel.com Cc: kernel@collabora.com, linux-media@vger.kernel.org, Julien Massot Subject: [PATCH v2 5/5] media: ti: j721e-csi2rx: add support for RGB formats Date: Mon, 18 Dec 2023 10:56:04 +0100 Message-ID: <20231218095604.1950737-6-julien.massot@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218095604.1950737-1-julien.massot@collabora.com> References: <20231218095604.1950737-1-julien.massot@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jai Luthra Add support for RGB565, RGB888 and BGR888 media bus formats. The pixel formats for these have a different byte-order than the MIPI bus formats, given the SHIM IP [1] unpacks them into memory as follows: MIPI RGB888 unpacks to: BYTE3 BYTE2 BYTE1 BYTE0 00000000 RRRRRRRR GGGGGGGG BBBBBBBB MIPI RGB565 unpacks to: BIT 15-11 BIT 10-5 BIT 4-0 RRRRR GGGGGG BBBBB [1]: AM62x TRM: 12.6.1.4.5 "CSI_RX_IF Data Memory Organization Details" Link: https://www.ti.com/lit/pdf/spruiv7 Signed-off-by: Jai Luthra Signed-off-by: Julien Massot Tested-by: Julien Massot --- .../platform/ti/j721e-csi2rx/j721e-csi2rx.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c index 6e58112957ce..15ddc851737a 100644 --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c @@ -188,6 +188,24 @@ static const struct ti_csi2rx_fmt ti_csi2rx_formats[] = { .csi_dt = MIPI_CSI2_DT_RAW10, .bpp = 16, .size = SHIM_DMACNTX_SIZE_16, + }, { + .fourcc = V4L2_PIX_FMT_RGB565X, + .code = MEDIA_BUS_FMT_RGB565_1X16, + .csi_dt = MIPI_CSI2_DT_RGB565, + .bpp = 16, + .size = SHIM_DMACNTX_SIZE_16, + }, { + .fourcc = V4L2_PIX_FMT_XBGR32, + .code = MEDIA_BUS_FMT_RGB888_1X24, + .csi_dt = MIPI_CSI2_DT_RGB888, + .bpp = 32, + .size = SHIM_DMACNTX_SIZE_32, + }, { + .fourcc = V4L2_PIX_FMT_RGBX32, + .code = MEDIA_BUS_FMT_BGR888_1X24, + .csi_dt = MIPI_CSI2_DT_RGB888, + .bpp = 32, + .size = SHIM_DMACNTX_SIZE_32, }, /* More formats can be supported but they are not listed for now. */