[PATCH v2 06/13] media: platform: mediatek: add isp_7x state ctrl

CK Hu (胡俊光) ck.hu at mediatek.com
Fri Jul 11 08:56:50 UTC 2025


On Mon, 2025-07-07 at 09:31 +0800, shangyao lin wrote:
> From: "shangyao.lin" <shangyao.lin at mediatek.com>
> 
> Introduce state management and debugging mechanisms for the MediaTek ISP7.x
> camsys platform. State management establishes control over ISP operations and
> events, defining distinct states for request handling, sensor control, and
> frame synchronization, ensuring proper event processing. The debugging
> mechanism ensures stable operation and timely data collection during anomalies.
> 
> ---
> 
> Changes in v2:
> - Removed mtk_cam-debug.c and mtk_cam-debug.h, along with related code
> - Various fixes per review comments
> 
> Signed-off-by: shangyao.lin <shangyao.lin at mediatek.com>
> ---

[snip]

> +static bool mtk_cam_request_drained(struct mtk_camsys_sensor_ctrl *sensor_ctrl)
> +{
> +	struct mtk_cam_ctx *ctx = sensor_ctrl->ctx;

You use struct mtk_cam_ctx in this patch, but it's defined in patch [8/13].
You should define it first and then use it.
But here you use struct mtk_cam_ctx which is defined in later patch.
To prevent this, you could apply one patch and build code once.
For example,

After apply patch [5/13], build code.
After apply patch [6/13], build code.
After apply patch [7/13], build code.
...

The step would help you to prevent using symbol which has not defined.
In addition, this patch just add .c file but not add it in Makefile.
When you add .c, also add it in Makefile so you could check it could be built successfully.

Regards,
CK

> +	int sensor_seq_no_next =
> +		atomic_read(&sensor_ctrl->sensor_request_seq_no) + 1;
> +	int res = 0;
> +
> +	if (sensor_seq_no_next <= atomic_read(&ctx->enqueued_frame_seq_no))
> +		res = 1;
> +	/* Send V4L2_EVENT_REQUEST_DRAINED event */
> +	if (res == 0) {
> +		mtk_cam_event_request_drained(ctx->pipe);
> +		dev_dbg(ctx->cam->dev, "request_drained:(%d)\n",
> +			sensor_seq_no_next);
> +	}
> +	return (res == 0);
> +}
> +

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20250711/60a5293f/attachment-0001.htm>


More information about the dri-devel mailing list