From patchwork Wed May 20 16:39:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Towle X-Patchwork-Id: 29758 X-Patchwork-Delegate: g.liakhovetski@gmx.de Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1YvMOK-0002l2-E0; Thu, 21 May 2015 11:03:48 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.76/mailfrontend-5) with esmtp id 1YvMOI-0000VB-8A; Thu, 21 May 2015 11:03:48 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932224AbbEUJDn (ORCPT + 1 other); Thu, 21 May 2015 05:03:43 -0400 Received: from 82-70-136-246.dsl.in-addr.zen.co.uk ([82.70.136.246]:56776 "EHLO xk120.dyn.ducie.codethink.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932214AbbEUJDk (ORCPT ); Thu, 21 May 2015 05:03:40 -0400 Received: from william by xk120.dyn.ducie.codethink.co.uk with local (Exim 4.80) (envelope-from ) id 1Yv72J-0004Da-AY; Wed, 20 May 2015 17:40:03 +0100 From: William Towle To: linux-kernel@lists.codethink.co.uk, linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de, sergei.shtylyov@cogentembedded.com, hverkuil@xs4all.nl, rob.taylor@codethink.co.uk Subject: [PATCH 19/20] media: rcar_vin: Clean up format debugging statements Date: Wed, 20 May 2015 17:39:39 +0100 Message-Id: <1432139980-12619-20-git-send-email-william.towle@codethink.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432139980-12619-1-git-send-email-william.towle@codethink.co.uk> References: <1432139980-12619-1-git-send-email-william.towle@codethink.co.uk> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.5.21.85416 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, REFERENCES 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' Pretty print fourcc and code in format debugging statements. Signed-off-by: Rob Taylor Reviewed-by: William Towle --- drivers/media/platform/soc_camera/rcar_vin.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index b530503..0bebca5 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -39,6 +39,9 @@ #include "soc_scale_crop.h" +#define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \ + ((x) >> 24) & 0xff + #define DRV_NAME "rcar_vin" /* Register offsets for R-Car VIN */ @@ -1352,10 +1355,12 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx, fmt = soc_mbus_get_fmtdesc(code.code); if (!fmt) { - dev_warn(dev, "unsupported format code #%u: %d\n", idx, code.code); + dev_warn(dev, "unsupported format code #%u: %x\n", idx, code.code); return 0; } + dev_dbg(dev, "Supported format: %x (%c%c%c%c)", code.code, pixfmtstr(fmt->fourcc)); + ret = rcar_vin_try_bus_param(icd, fmt->bits_per_sample); if (ret < 0) return 0; @@ -1456,7 +1461,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx, for (k = 0; xlate && k < n; k++, xlate++) { xlate->host_fmt = &rcar_vin_formats[k]; xlate->code = code.code; - dev_dbg(dev, "Providing format %s using code %d\n", + dev_dbg(dev, "Providing format %s using code %x\n", rcar_vin_formats[k].name, code.code); } break; @@ -1596,8 +1601,8 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd, enum v4l2_field field; v4l2_std_id std; - dev_dbg(dev, "S_FMT(pix=0x%x, %ux%u)\n", - pixfmt, pix->width, pix->height); + dev_dbg(dev, "S_FMT(pix=%c%c%c%c, %ux%u)\n", + pixfmtstr(pixfmt), pix->width, pix->height); switch (pix->field) { default: @@ -1623,7 +1628,7 @@ static int rcar_vin_set_fmt(struct soc_camera_device *icd, xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); if (!xlate) { - dev_warn(dev, "Format %x not found\n", pixfmt); + dev_warn(dev, "Format %c%c%c%c not found\n", pixfmtstr(pixfmt)); return -EINVAL; } /* Calculate client output geometry */ @@ -1720,11 +1725,14 @@ static int rcar_vin_try_fmt(struct soc_camera_device *icd, int width, height; int ret; + dev_dbg(icd->parent, "TRY_FMT(%c%c%c%c, %ux%u)\n", + pixfmtstr(pix->pixelformat), pix->width, pix->height); + xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); if (!xlate) { xlate = icd->current_fmt; - dev_dbg(icd->parent, "Format %x not found, keeping %x\n", - pixfmt, xlate->host_fmt->fourcc); + dev_dbg(icd->parent, "Format %c%c%c%c not found, keeping %x\n", + pixfmtstr(pixfmt), xlate->host_fmt->fourcc); pixfmt = xlate->host_fmt->fourcc; pix->pixelformat = pixfmt; pix->colorspace = icd->colorspace;