Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1456099pxb; Fri, 22 Oct 2021 01:00:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1xkVOK2GEbkrU8JuXJwfyCnqrsLPaT61VHuNGsthm5Lot0OnXmj2pIGb+Drz7uMEDkDTV X-Received: by 2002:a17:906:5e17:: with SMTP id n23mr13384459eju.258.1634889652663; Fri, 22 Oct 2021 01:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634889652; cv=none; d=google.com; s=arc-20160816; b=nGqEq7jHWApKVi6fT8RL8DzDIzEpMjWrgLN+Kr2bn667PMCEFUHw+/0dwcyddN0oQk yWbiv9p4q+7Q6jNMcSRMK/6yt8UzNpOdTzbeyOl3ao4nB+/6lf1WsYyG362Ch60BFkbK d/e44gj/j0Ds9mBtRsdg19sfpDtoUb+YJBcOCYCQWARPB6GROihVxowyOa8jxxTZ7Oiz HyIeIqPTchEwIE1BJwgpusUCjWQterbBufy4ttjbLrEST3jJkceQ8y+ItCJtDzsLicf7 8yax1fCX7/bpOtUoaQfP8kgmrYIXILYH7bMuozZUgH9jc4l6X12EJEv5ds6NiCADGvBJ RuTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:dkim-signature; bh=G4nKLUZZfzMGF0gvC6FNYRSvxNd6P6DFB+WLVqV+Kjo=; b=hRDrqHMpiQ/CO58FFkMJSf8Z31WIcyiM5KD8sTX7mz72qLM312g4HkzVu7M/2cfoJ1 l9WncSX8I+gzXL4tmWnchnqt7E0EYLBoZJrFIEh/eYzNSd3e/4BHc6gidbElBy53FfMs Jws+5jDPlCjIktoUiY/BmIfC4x6nqtdcdXRyKEVkGYLt0iKF73gDn6waGjSBDeXOoIGk kWHVQ9CMrFV0BD4wfXo4DMhUvNndoXwotFrYy1xz7AtkJhhbfpjyHDvsAuUhmVfFXH0S 7JX6TYChyje1GiMr/Ht+XhLUm5idskFEunA3+eo4DYQYKe4znMIlkiZg6kWT1RM4fK8Q YhWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=r11jyMlm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gm1si13457908ejc.106.2021.10.22.01.00.22; Fri, 22 Oct 2021 01:00:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=r11jyMlm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232518AbhJVH5i (ORCPT + 99 others); Fri, 22 Oct 2021 03:57:38 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:17446 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232585AbhJVH5Q (ORCPT ); Fri, 22 Oct 2021 03:57:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634889299; x=1666425299; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nWSLtOBP89ZKPr7pkblnuPZXTqOXvF6+GrCCZxMsTgs=; b=r11jyMlmtUEOkkLKg0fWbYqfiTLkCFmyuuvkqMegDErOUAS6Uriij+76 HkEYl7jF80npS79fGDOr5hCrIWWWFrHDp1X07Rtlc6S76623UE+ky2uz1 Uf1jrMnHjLb9guTSGo62CbItDVqPXovb5Cxo5yN5XdZAqjT0dU3J+uJEv 3F1DzxcJo0Rjwvkoazo5uJjWBqlqDavjia/CahL2Y84Z/EqJDhXf6l75m ir2PSIyo8hReYyqoAahd5PRYuxtbBsTuS+yOuNVYPbNNjZN8sb2Cd2gqx ZyasgKLJ2tkMYBYk11kBZYs2mM/irMfCfs8V/z44HdzNZTeCqMXwORAlS A==; IronPort-SDR: E1PSMpB5xUajAd7LRMEcZlOJKma4QnDaxhDfmJMIQabvI5OzcR2lR9N0Jl1GNHlsIvphgLV2bp 7THor6gDVyfhR6QwPVjOOMrp8n+O7+CCneB5A4U56RJl04Vns4fnDGHyUsNudqJqx/kb8sHfl1 kWAskcDrDiPvESxTfaRBVsD1gYVN4re3w1HV+m4RoK0W+SI0JxWWmGRTnpsJ3IUbZNtMFP3ZFY 4Zb8GVFMm2IMzxqUZzMFQ7LewSatm0UpQ/zFFQCcTvhP/Q1cIPm1Ml4yN9FDMj9GKBn3D7Z9TN 1GxxVsI2KbPfq4OqzN0DK48g X-IronPort-AV: E=Sophos;i="5.87,172,1631602800"; d="scan'208";a="136538157" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Oct 2021 00:54:58 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 22 Oct 2021 00:54:58 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 22 Oct 2021 00:54:54 -0700 From: Eugen Hristev To: , , , CC: , , , , , Eugen Hristev Subject: [PATCH 20/21] media: atmel: atmel-isc-base: add wb debug messages Date: Fri, 22 Oct 2021 10:52:46 +0300 Message-ID: <20211022075247.518880-21-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022075247.518880-1-eugen.hristev@microchip.com> References: <20211022075247.518880-1-eugen.hristev@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add debug messages that make it easier to debug white balance algorithm. Signed-off-by: Eugen Hristev --- drivers/media/platform/atmel/atmel-isc-base.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index 7ebe0a2d130f..071ac5eec7ec 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1330,10 +1330,15 @@ static void isc_hist_count(struct isc_device *isc, u32 *min, u32 *max) if (!*min) *min = 1; + + v4l2_dbg(1, debug, &isc->v4l2_dev, + "isc wb: hist_id %u, hist_count %u", + ctrls->hist_id, *hist_count); } static void isc_wb_update(struct isc_ctrls *ctrls) { + struct isc_device *isc = container_of(ctrls, struct isc_device, ctrls); u32 *hist_count = &ctrls->hist_count[0]; u32 c, offset[4]; u64 avg = 0; @@ -1350,6 +1355,9 @@ static void isc_wb_update(struct isc_ctrls *ctrls) (u64)hist_count[ISC_HIS_CFG_MODE_GB]; avg >>= 1; + v4l2_dbg(1, debug, &isc->v4l2_dev, + "isc wb: green components average %llu\n", avg); + /* Green histogram is null, nothing to do */ if (!avg) return; @@ -1402,9 +1410,15 @@ static void isc_wb_update(struct isc_ctrls *ctrls) else gw_gain[c] = 1 << 9; + v4l2_dbg(1, debug, &isc->v4l2_dev, + "isc wb: component %d, s_gain %u, gw_gain %u\n", + c, s_gain[c], gw_gain[c]); /* multiply both gains and adjust for decimals */ ctrls->gain[c] = s_gain[c] * gw_gain[c]; ctrls->gain[c] >>= 9; + v4l2_dbg(1, debug, &isc->v4l2_dev, + "isc wb: component %d, final gain %u\n", + c, ctrls->gain[c]); } } @@ -1424,6 +1438,10 @@ static void isc_awb_work(struct work_struct *w) return; isc_hist_count(isc, &min, &max); + + v4l2_dbg(1, debug, &isc->v4l2_dev, + "isc wb mode %d: hist min %u , max %u\n", hist_id, min, max); + ctrls->hist_minmax[hist_id][HIST_MIN_INDEX] = min; ctrls->hist_minmax[hist_id][HIST_MAX_INDEX] = max; -- 2.25.1