Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4773459pxu; Tue, 13 Oct 2020 06:55:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJy9aMpepEgJSjYkNICiElOwADVUthUxX968rNFbOkMHKo7YMxVY2AQ9o2I6+SPj//BRHT X-Received: by 2002:a50:ec8e:: with SMTP id e14mr19926201edr.98.1602597312467; Tue, 13 Oct 2020 06:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602597312; cv=none; d=google.com; s=arc-20160816; b=gGrIp/bz0yqC1oG0c21kdbQAgEMzSeqpEblT9niJXKtGKBd0E2eCJyBhq6zQ3GMFi/ ZZ/g5LPYgyjqBie/XGZsiHZz94a4aKyxj2IA6AQI3DSl5JWrmFIRDW6CV44wAvtoOvcK RRCgbMgj69N1rYJox166VsendjJrTq1CWI3FAQTt0sdJHcUTY/ymgeo4DtDD+DcrAOmz 8/PIa6H0ZE1Lq2w/5V8vCmChaKMgwvqlhELVcrCczVa/pBHgyis1CdOCu4mN/+lpiiUC cDUHdCqkvmovdVWC5uQKDIvblWrvw/gCa5PwXVGqaWZt3DL7IWw2iO1RzgWTktMqOEEp W4Ng== 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; bh=4n1K/0jwH1CHbkD0CkUpdEofsXu/NH/IkDb7qdDg5Pw=; b=nsDGGXoZdXSJBooFw6PRGjmkvazzPK5HONelL0j9+khG63xOHgCLP83ZBoB7+lJyTq 6IyE+6Vwz1I/W+ooas0txZjMU9o0ub2qJvH+wmQXsjD73el5L0oGaYaFLZzLRJFyXiZs eFys0Bg0cFtsy6++l23RHzxeG4ATO5zJ2fwgKB4IVSjx669C5nzgy5NlXYa3oF77gF3l nBvxgyWpD5yOk/jadRX8Zrju4Z3WGnWPzbksX4SvBRzXa1x5JdsgvFxwHr83YpOBVRe8 JKnL/E3t5zshVt9FXAbKqHs10CozbofZKo4BHwiTbjjBw3StG5+zssG5gY7U7zIdL1oi Z51Q== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si3373025ejb.631.2020.10.13.06.54.47; Tue, 13 Oct 2020 06:55:12 -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; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731729AbgJLU7m (ORCPT + 99 others); Mon, 12 Oct 2020 16:59:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731801AbgJLU7K (ORCPT ); Mon, 12 Oct 2020 16:59:10 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CF07C0613D1; Mon, 12 Oct 2020 13:59:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id F30831F44C5B From: Adrian Ratiu To: Ezequiel Garcia , Philipp Zabel Cc: Mark Brown , Mauro Carvalho Chehab , Fruehberger Peter , kuhanh.murugasen.krishnan@intel.com, Daniel Vetter , kernel@collabora.com, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/18] media: hantro: add dump registers debug option before decode start Date: Mon, 12 Oct 2020 23:59:56 +0300 Message-Id: <20201012205957.889185-18-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012205957.889185-1-adrian.ratiu@collabora.com> References: <20201012205957.889185-1-adrian.ratiu@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is very useful to know the status of all the decoder configuration registers right before starting a decode operation, so add an option to print them if register debugging is enabled (debug bit 7 is set). Signed-off-by: Adrian Ratiu --- drivers/staging/media/hantro/hantro.h | 1 + drivers/staging/media/hantro/hantro_h264_dec.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/hantro/hantro.h b/drivers/staging/media/hantro/hantro.h index 70aeb11b1149..1b0c441ff15a 100644 --- a/drivers/staging/media/hantro/hantro.h +++ b/drivers/staging/media/hantro/hantro.h @@ -304,6 +304,7 @@ struct hantro_reg { * bit 4 - detail fmt, ctrl, buffer q/dq information * bit 5 - detail function enter/leave trace information * bit 6 - register write/read information + * bit 7 - dump */ extern int hantro_debug; diff --git a/drivers/staging/media/hantro/hantro_h264_dec.c b/drivers/staging/media/hantro/hantro_h264_dec.c index e64b59c84111..2c53394cbb0c 100644 --- a/drivers/staging/media/hantro/hantro_h264_dec.c +++ b/drivers/staging/media/hantro/hantro_h264_dec.c @@ -381,7 +381,9 @@ void hantro_g1_h264_dec_run(struct hantro_ctx *ctx) struct hantro_dev *vpu = ctx->dev; struct hantro_regmap_fields_dec *fields = vpu->reg_fields_dec; bool do_high10 = (vpu->h264_hw_mode == HANTRO_H264_HIGH10); - int reg; + u32 max_reg = hantro_regmap_dec.max_register; + u32 reg_stride = hantro_regmap_dec.reg_stride; + int reg, i; /* Prepare the H264 decoder context. */ if (hantro_h264_dec_prepare_run(ctx)) @@ -421,6 +423,11 @@ void hantro_g1_h264_dec_run(struct hantro_ctx *ctx) regmap_field_write(fields->dec_max_burst, 16); regmap_field_write(fields->dec_axi_rd_id, 16); + vpu_debug(7, "Reg dump at decoding start\n"); + for (i = 0; hantro_debug & BIT(7) && i <= max_reg; i += reg_stride) + vpu_debug(7, "swreg %03d: %08x\n", i / 4, vdpu_read(vpu, i)); + vpu_debug(7, "Reg dump end\n"); + /* Start decoding! */ vdpu_write(vpu, G1_REG_INTERRUPT_DEC_E, G1_REG_INTERRUPT); } -- 2.28.0