Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CF06E810A2 for ; Wed, 27 Sep 2023 08:07:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbjI0IHa (ORCPT ); Wed, 27 Sep 2023 04:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjI0IH3 (ORCPT ); Wed, 27 Sep 2023 04:07:29 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2CDFBF for ; Wed, 27 Sep 2023 01:07:27 -0700 (PDT) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EC134D20; Wed, 27 Sep 2023 10:05:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1695801945; bh=57ES37Ec1zJRgzzCWqvlLd/RvzDtNeTiWbqIfigjNkE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YjlyP0FRTR2TyQo+lKn4ic63LK1yHWNsKA05jR2M5mVnujDCxFNbtaTWJd6Jz7HIs CT1bj+P7okLPbsFwniv1Z0zmzYVhthcjfmWfAkEDF8o2GIki4cPRRH3emseKHKzS0O eHAStTw8fLs0NldVEruryVesOouyQ8tm+kkAJLEI= Date: Wed, 27 Sep 2023 11:07:35 +0300 From: Laurent Pinchart To: Sakari Ailus Cc: linux-media@vger.kernel.org, Tianshu Qiu , Bingbu Cao , Tomi Valkeinen , Jacopo Mondi , Rui Miguel Silva , Martin Kepplinger Subject: Re: [PATCH v6 11/13] media: v4l: subdev: Print debug information on frame descriptor Message-ID: <20230927080735.GQ5854@pendragon.ideasonboard.com> References: <20230927064120.367561-1-sakari.ailus@linux.intel.com> <20230927064120.367561-12-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230927064120.367561-12-sakari.ailus@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi Sakari, Thank you for the patch. On Wed, Sep 27, 2023 at 09:41:18AM +0300, Sakari Ailus wrote: > Print debug level information on returned frame descriptors. > > Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart > --- > drivers/media/v4l2-core/v4l2-subdev.c | 31 ++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c > index 9cb04ace86ae..d295a4e87b66 100644 > --- a/drivers/media/v4l2-core/v4l2-subdev.c > +++ b/drivers/media/v4l2-core/v4l2-subdev.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -309,9 +310,37 @@ static int call_set_selection(struct v4l2_subdev *sd, > static int call_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, > struct v4l2_mbus_frame_desc *fd) > { > + unsigned int i; > + int ret; > + > memset(fd, 0, sizeof(*fd)); > > - return sd->ops->pad->get_frame_desc(sd, pad, fd); > + ret = sd->ops->pad->get_frame_desc(sd, pad, fd); > + if (ret) > + return ret; > + > + dev_dbg(sd->dev, "Frame descriptor on pad %u, type %s\n", pad, > + fd->type == V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL ? "parallel" : > + fd->type == V4L2_MBUS_FRAME_DESC_TYPE_CSI2 ? "CSI-2" : > + "unknown"); > + > + for (i = 0; i < fd->num_entries; i++) { > + struct v4l2_mbus_frame_desc_entry *entry = &fd->entry[i]; > + char buf[20] = ""; > + > + if (fd->type == V4L2_MBUS_FRAME_DESC_TYPE_CSI2) > + WARN_ON(snprintf(buf, sizeof(buf), > + ", vc %u, dt 0x%02x", > + entry->bus.csi2.vc, > + entry->bus.csi2.dt) >= sizeof(buf)); > + > + dev_dbg(sd->dev, > + "\tstream %u, code 0x%04x, length %u, flags 0x%04x%s\n", > + entry->stream, entry->pixelcode, entry->length, > + entry->flags, buf); > + } > + > + return 0; > } > > static inline int check_edid(struct v4l2_subdev *sd, -- Regards, Laurent Pinchart