Devicetree
 help / color / mirror / Atom feed
From: Antoine Bouyer <antoine.bouyer@nxp.com>
To: julien.vuillaumier@nxp.com, alexi.birlinger@nxp.com,
	daniel.baluta@nxp.com, peng.fan@nxp.com, frank.li@nxp.com,
	jacopo.mondi@ideasonboard.com, laurent.pinchart@ideasonboard.com,
	mchehab@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, michael.riesch@collabora.com,
	anthony.mcgivern@arm.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	ai.luthra@ideasonboard.com, paul.elder@ideasonboard.com,
	geert@linux-m68k.org
Subject: Re: [PATCH v2 6/8] media: platform: Add NXP Neoisp Image Signal Processor
Date: Mon, 11 May 2026 16:43:24 +0200	[thread overview]
Message-ID: <00b5463f-5c74-4e40-a1fa-dd43dfe3384b@nxp.com> (raw)
In-Reply-To: <20260511132629.1300868-7-antoine.bouyer@nxp.com>

On 5/11/26 3:26 PM, Antoine Bouyer wrote:
> First NXP neoisp driver version with the following contents:
> 
> This driver was initially inspired from raspberrypi pisp_be driver. It
> reuses same approach for ISP job scheduling.
> 
> The Neoisp driver supports:
> * 8, 10, 12, 14 and 16-bits RAW Bayer images input.
> * Monochrome sensors input.
> * RGB/YUV, IR and Greyscale output formats.
> 
> The neoisp features are:
> * Provides single context to limit amount of v4l2 devices.
> * Supports M2M operations.
> * Support SDR and HDR modes.
> * Supports generic v4l2-isp framework for extensible Parameters and
> Statistics buffers.
> * Provides a `core_media_register` API to register neoisp's media entities
> into another media graph.
> * A module parameter to run in standalone mode with its own media device.
> 
> Co-developed-by: Alexi Birlinger <alexi.birlinger@nxp.com>
> Signed-off-by: Alexi Birlinger <alexi.birlinger@nxp.com>
> Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com>
> ---
>   MAINTAINERS                                   |    9 +
>   drivers/media/platform/nxp/Kconfig            |    1 +
>   drivers/media/platform/nxp/Makefile           |    1 +
>   drivers/media/platform/nxp/neoisp/Kconfig     |   16 +
>   drivers/media/platform/nxp/neoisp/Makefile    |    6 +
>   drivers/media/platform/nxp/neoisp/neoisp.h    |  247 ++
>   .../media/platform/nxp/neoisp/neoisp_core.h   |   30 +
>   .../media/platform/nxp/neoisp/neoisp_ctx.c    | 2657 +++++++++++++++++
>   .../media/platform/nxp/neoisp/neoisp_ctx.h    |   78 +
>   .../media/platform/nxp/neoisp/neoisp_fmt.h    |  495 +++
>   drivers/media/platform/nxp/neoisp/neoisp_hw.h |  557 ++++
>   .../media/platform/nxp/neoisp/neoisp_main.c   | 1899 ++++++++++++
>   .../media/platform/nxp/neoisp/neoisp_nodes.h  |   54 +
>   .../media/platform/nxp/neoisp/neoisp_regs.h   | 2498 ++++++++++++++++
>   include/uapi/linux/media/nxp/nxp_neoisp.h     |   67 -
>   15 files changed, 8548 insertions(+), 67 deletions(-)
>   create mode 100644 drivers/media/platform/nxp/neoisp/Kconfig
>   create mode 100644 drivers/media/platform/nxp/neoisp/Makefile
>   create mode 100644 drivers/media/platform/nxp/neoisp/neoisp.h
>   create mode 100644 drivers/media/platform/nxp/neoisp/neoisp_core.h
>   create mode 100644 drivers/media/platform/nxp/neoisp/neoisp_ctx.c
>   create mode 100644 drivers/media/platform/nxp/neoisp/neoisp_ctx.h
>   create mode 100644 drivers/media/platform/nxp/neoisp/neoisp_fmt.h
>   create mode 100644 drivers/media/platform/nxp/neoisp/neoisp_hw.h
>   create mode 100644 drivers/media/platform/nxp/neoisp/neoisp_main.c
>   create mode 100644 drivers/media/platform/nxp/neoisp/neoisp_nodes.h
>   create mode 100644 drivers/media/platform/nxp/neoisp/neoisp_regs.h
> 

[snip]

> diff --git a/drivers/media/platform/nxp/neoisp/neoisp_ctx.c b/drivers/media/platform/nxp/neoisp/neoisp_ctx.c
> new file mode 100644
> index 000000000000..cbb50257be57
> --- /dev/null
> +++ b/drivers/media/platform/nxp/neoisp/neoisp_ctx.c
> @@ -0,0 +1,2657 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * NEOISP context registers/memory setting helpers
> + *
> + * Copyright 2023-2026 NXP
> + */
[snip]

> +void neoisp_ctx_get_stats(struct neoisp_dev_s *neoispd, struct neoisp_buffer_s *buf)
> +{
> +	struct neoisp_node_s *node = &neoispd->node[NEOISP_STATS_NODE];
> +	u8 *src = (u8 *)(uintptr_t)neoispd->mmio_tcm;
> +	struct v4l2_isp_buffer *stats;
> +	u32 *blk_list, count;
> +
> +	/* Check if stats node link is enabled */
> +	if (!neoisp_node_link_is_enabled(node))
> +		return;
> +
> +	if (IS_ERR_OR_NULL(buf) || IS_ERR_OR_NULL(src)) {
> +		dev_err(neoispd->dev, "Error: stats pointer\n");
> +		return;
> +	}
> +
> +	stats = (struct v4l2_isp_buffer *)get_vaddr(buf);
> +	v4l2_isp_stats_init_buffer(stats, V4L2_ISP_VERSION_V1);
> +
> +	blk_list = (u32 *)neoisp_stats_blocks;
> +	count = ARRAY_SIZE(neoisp_stats_blocks);
> +	for (int i = 0; i < count; i++) {
> +		struct v4l2_isp_block_header *header =
> +			v4l2_isp_stats_init_block(neoispd->dev, stats,
> +						  neoisp_stats_block_types_info,
> +						  ARRAY_SIZE(neoisp_stats_block_types_info),
> +						  blk_list[i], NEOISP_EXT_STATS_MAX_SIZE);
> +		if (!header) {

oops. I missed to apply the fix on my driver :(

IS_ERR(header) must be used instead of null pointer check.

> +			dev_err(neoispd->dev, "Error: initializing stats block %d\n", i);
> +			continue;
> +		}
> +
> +		neoisp_ctx_get_stats_blk(neoispd, blk_list[i], src,
> +					 (union neoisp_stats_block_u *)header);
> +	}
> +}

  reply	other threads:[~2026-05-11 14:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 13:26 [PATCH v2 0/8] media: Add iMX95 neoisp driver Antoine Bouyer
2026-05-11 13:26 ` [PATCH v2 1/8] dt-bindings: media: Add nxp neoisp support Antoine Bouyer
2026-05-11 16:26   ` Conor Dooley
2026-05-11 13:26 ` [PATCH v2 2/8] media: v4l2-ctrls: Add user control base for NXP neoisp controls Antoine Bouyer
2026-05-11 13:26 ` [PATCH v2 3/8] media: Add meta formats supported by NXP neoisp driver Antoine Bouyer
2026-05-11 13:26 ` [PATCH v2 4/8] media: uapi: Add NXP NEOISP user interface header file Antoine Bouyer
2026-05-12  4:47   ` sashiko-bot
2026-05-11 13:26 ` [PATCH v2 5/8] media: Documentation: Add NXP neoisp driver documentation Antoine Bouyer
2026-05-12  5:04   ` sashiko-bot
2026-05-11 13:26 ` [PATCH v2 6/8] media: platform: Add NXP Neoisp Image Signal Processor Antoine Bouyer
2026-05-11 14:43   ` Antoine Bouyer [this message]
2026-05-12  5:29   ` sashiko-bot
2026-05-11 13:26 ` [PATCH v2 7/8] media: platform: neoisp: Add debugfs support Antoine Bouyer
2026-05-12  5:47   ` sashiko-bot
2026-05-11 13:26 ` [PATCH v2 8/8] arm64: dts: freescale: imx95: Add NXP neoisp device tree node Antoine Bouyer

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=00b5463f-5c74-4e40-a1fa-dd43dfe3384b@nxp.com \
    --to=antoine.bouyer@nxp.com \
    --cc=ai.luthra@ideasonboard.com \
    --cc=alexi.birlinger@nxp.com \
    --cc=anthony.mcgivern@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frank.li@nxp.com \
    --cc=geert@linux-m68k.org \
    --cc=imx@lists.linux.dev \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=julien.vuillaumier@nxp.com \
    --cc=krzk+dt@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=michael.riesch@collabora.com \
    --cc=paul.elder@ideasonboard.com \
    --cc=peng.fan@nxp.com \
    --cc=robh@kernel.org \
    /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