From patchwork Fri Mar 12 06:11:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11560 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 1C47BBD1F1 for ; Fri, 12 Mar 2021 06:11:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 37A9B602ED; Fri, 12 Mar 2021 07:11:37 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gFJn/Jbl"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EF712602ED for ; Fri, 12 Mar 2021 07:11:35 +0100 (CET) Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 609FF88F; Fri, 12 Mar 2021 07:11:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615529495; bh=AtcxaXqSP4673NukEdS8kTwsl1ohYEd0P5StS6iEj3k=; h=From:To:Cc:Subject:Date:From; b=gFJn/JblSA8ysTI9LNO5/rB2JF2JkMzCB6tNMHfwYqZ/akxxWZhLKzuD16w6tRtbn IDfvLvoDhICAttwEypJU/9jEiWNXj2ELkiWR2lvz9V2gicsrzvRMcSmBKqfOKiAYsb IvQs0XJ8lbmYJPfFirqHwvnLqV2vL3slbR2JrUFA= From: Kieran Bingham To: libcamera devel Date: Fri, 12 Mar 2021 06:11:23 +0000 Message-Id: <20210312061131.854849-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/8] IPU3 Debug improvements X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" These patches have been split from the IPU3 stability series, as they do not by themselves contribute to resolving the issues seen on the IPU3. There were however some potentially interesting developments while investigating that may be worth integrating or discussing further. Patches [1/8] and [2/8] extend the Request object to contain a sequence number, and facilitate easily reporting the state of a request. I found this to be incredibily useful while debugging to visualise what was happening. Patch [3/8] is somewhat RFC as it may or may not be desirable to reset the sequence counter for each run of the camara, and also it may be better to do so in a base class to ensure all pipeline handlers have consistent behaviour. Patch [4/8] ties the FrameInfo sequence id to the Request sequence number, and makes it easy to pair relevant debug prints with the correct request operation that it relates to. Patch [5/8] adds the ability to inspect the state of the FrameInfo structures which was invaluable to seeing what and why the state of requests were when they were left in the pending requests queue. Patch [6/8] and [7\/8] reorganise the FrameInfo and set the request object on the internal buffers. This may allow future optimisations to obtain the request faster than with a search by buffer on internal buffers. Finally patch [8/8] is RFC only as I thought it was helpful, but don't expect to see it integrated unless it's highly favoured, but I couldn't throw it away without at least posting it to the list first. Kieran Bingham (8): libcamera: request: Provide a sequence number libcamera: request: Add a toString() libcamera: pipeline: ipu3: Reset sequence counts to zero on stop libcamera: pipeline: ipu3: frames: Use the request sequence libcamera: pipeline: ipu3: frames: Add FrameInfo state tracing libcamera: pipeline: ipu3: frames: Group FrameBuffer operations libcamera: pipeline: ipu3: frames: Associate buffers with the reqeust [RFC-Only] libcamera: request: A request canary include/libcamera/internal/pipeline_handler.h | 4 ++- include/libcamera/request.h | 6 ++++ src/libcamera/pipeline/ipu3/frames.cpp | 33 ++++++++++++++--- src/libcamera/pipeline/ipu3/frames.h | 5 ++- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 ++ src/libcamera/pipeline_handler.cpp | 2 ++ src/libcamera/request.cpp | 35 ++++++++++++++++++- 7 files changed, 80 insertions(+), 7 deletions(-)