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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66FD0CF042C for ; Tue, 8 Oct 2024 21:16:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D44910E5E2; Tue, 8 Oct 2024 21:16:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="k2McSnep"; dkim-atps=neutral Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2045.outbound.protection.outlook.com [40.107.223.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E95210E5DB for ; Tue, 8 Oct 2024 21:16:38 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CGPWkgKBiduhzbLNZU/5GlOQPCaeueNlM/JIQ7eQIqshAB7J87f1t30XGfHsWBpdityuI76yv5zgGYtINjjyukCeoCj3dZ+Ojr6qkaiA5g++mfpRZtwpGqQlVkTmREC9Fh41mGiQqxnmyHBiexVeVag15umX3TcNzSufCKcjmO4gLVEZCQiXrT429yfQq7tZ3Pkr/JTI7TKl2zNaAsc4FI1Z5VbsF/Mdy+suhwCdtrX50zt1pa1iGbClJhaw+8p00Aj1R8FNE/CGW+n7NmK9UK8QgagnEsl/V9L3WdnzxJBcwyHsM7Oi395jbC6LFW7Lc7DbZ3yi2kDTXhkC4rVEqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T80VrH5rpnP7x7rs6EtCJpqfi57qCile3WYB90KaJq8=; b=dr7HnqZlrCKjT40KmRIfSYeOlQtH6jGKbsxcWI42v4KSbHOIcK7ZDaxhcZEtQa4fqjAZhHUHoBOE7pSC39dM4TstOtO7l+uFyuNtpM4NcliiVEtNGV3SFJYYJGT4Ls4fYofHpqQIlrcwYnvcfRupbfCXDN5kE++HlhncnFp0UxTxCedBlxay0Y02Gw9pY9Kos8LJCabRkg2b/oJ3xIO4SMHTrlhX2vaAsPkQ5aOcB/Ysb15YUlHLqqZhDVZxntGIbDQI9aq7Brkp+Vt5mczklK6xqsQUUSDeFv5EIUFnZYWQEP4InoQv2rE2uCaLplZe9oJLjjBV8hCtQExayFruZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T80VrH5rpnP7x7rs6EtCJpqfi57qCile3WYB90KaJq8=; b=k2McSnep4akuUr9FsCbD3ruHK4LzOcgLSeDad3ddu17uID50HsuLW5xNkoaLpyNzOuY8BJxRwu94sIqRSDfaB+IIS9WYVZWpme0YxJP0WcvsWjO1h4mENB8Ikiv/riK1wtVF8+z5W49cCbPWCkCoQqiWFruzrm7PBCtYXkCQl1I= Received: from CH0PR03CA0412.namprd03.prod.outlook.com (2603:10b6:610:11b::24) by PH0PR12MB8151.namprd12.prod.outlook.com (2603:10b6:510:299::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 21:16:34 +0000 Received: from DS2PEPF00003442.namprd04.prod.outlook.com (2603:10b6:610:11b:cafe::2c) by CH0PR03CA0412.outlook.office365.com (2603:10b6:610:11b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.24 via Frontend Transport; Tue, 8 Oct 2024 21:16:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003442.mail.protection.outlook.com (10.167.17.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8048.13 via Frontend Transport; Tue, 8 Oct 2024 21:16:34 +0000 Received: from atitest-Rembrandt.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 8 Oct 2024 16:16:29 -0500 From: To: , , , , CC: Boyuan Zhang Subject: [PATCH 28/32] drm/amdgpu: print_ip_state for each vcn instance Date: Tue, 8 Oct 2024 17:15:49 -0400 Message-ID: <20241008211553.36264-29-boyuan.zhang@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241008211553.36264-1-boyuan.zhang@amd.com> References: <20241008211553.36264-1-boyuan.zhang@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003442:EE_|PH0PR12MB8151:EE_ X-MS-Office365-Filtering-Correlation-Id: de2705d3-9e5c-42ed-9897-08dce7de7cca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?bNJk1eWjEeHeWnv6M6VFwK0y+9snGepYA45TEA1tOiIxRFuSDl8TPrQ9M6fY?= =?us-ascii?Q?r3n6SrRFMXmcU2uKlGFv+6CU5JzcLg6W9pnMw4/+8gfWyJxI/WGahtCJ/umF?= =?us-ascii?Q?YNcEPHX52DCQBiD4LjUMF2Q3qfR+QYkZTYPBQ7tMNrJ3FpIwZ3ve6FYvQU7p?= =?us-ascii?Q?0n/7uEp7p2sHG8O1Yug8iAXrSyMjN705Ma51Wfh9aB9iT9HwaRqZz7ce4jb+?= =?us-ascii?Q?Wj7IRtIzDYbC5As4vJQ4L/G2+logBwX8a3UfPIhfjyXx5gvVk53UfGhKea+1?= =?us-ascii?Q?gTHmf9WOrO3MesPDM0SFLTHrzGxmEh5uGsGE66YdVCeq+GAIZbURGWkBOG45?= =?us-ascii?Q?VHP/TK7hLxpSCs7X+M9Y/trWtKhaNOy3qwCJQ2Nt2D2AOqGG3ry+qOnzdw58?= =?us-ascii?Q?oOoiDwM30h465owOO9ngnpPHxEKMkDWC6viLDWENjAja2QMAuV1XHzi6kwVG?= =?us-ascii?Q?tS+9cGho2dUl0bbHqYn8EYKXeI/x1/9BY/UYhs/vcOLcrocZUTFh3RRjEHhA?= =?us-ascii?Q?s13bX4+qsYxSmoi523YPIy9N6hZionrIvNiKV8N2zTwZYHpKNx2QAQkvj/gM?= =?us-ascii?Q?EYj6XFuVS45HlwNg4xtRy5ZE1ZNL296UKRBgQOCa9ugUIypXLf5r57+wdaRk?= =?us-ascii?Q?q7O6MyHtT8zhWfREfnHWbauHQKjNlIDE/FjQSk9NRqw4kRG4/o78aqu1pf9G?= =?us-ascii?Q?58kVkBPW+y1FqOYW39ivIJ4nvFhiQJMZjJZEDDnNTvVqe2euabmne8mk5obO?= =?us-ascii?Q?QhYSD1wEhbaCSQp66pzRbQBFqe0EzkdfmAj4FMAnXc0ElL4oJHHoGrh7Hq3W?= =?us-ascii?Q?Z0ecjMBT35oJYEWRNQv/WXPqAln3Mb3JRwqxn5uYzXk+6YTVtrejwuElozEy?= =?us-ascii?Q?+YG3WMLD6dHC0ItBgbAPmQ+IYUHa4GgaXS2qz3ab+0Hc1pHcXwWfdP6bnD/W?= =?us-ascii?Q?6SzLa8Jcs2cRCClmag12xSG0OOP/CA9Y+6BKclXLwn+C//U/l8oA/y1niyS9?= =?us-ascii?Q?uksa4x2FNCaKHsyjMtDRalRg61bhgWoQceFWFqDJ5TEXI+TrTxH/RghaPmw4?= =?us-ascii?Q?Dm2o6yVNUgUPGdJBP6jxx1qBQbNYVdHqgWtTjwFXqY8RlhShaLysZAXpb1sH?= =?us-ascii?Q?lr0ezcwu4bxJSy62onbWn4lMQmtXTzcJXYzGe9S19GFlmbCDrwV53wEJ++Ct?= =?us-ascii?Q?NvxHXyyvTzFW0tcFQ8R5FC3w+7AChVSFnuqsua5NHXX574aZZEDIuMj/hZHv?= =?us-ascii?Q?M9Yxy7AYKRp/tvh8MqdYLx3B84CTSbCWCMbw9sw4K5p84Jl8Nd2YtNsVH0cI?= =?us-ascii?Q?itENLOp8fanrIyw6geMHAR+dSECo2W5LHq24ep8TvZOAgF9JQLo3H/LChMij?= =?us-ascii?Q?MnHk/Rw=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 21:16:34.0458 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de2705d3-9e5c-42ed-9897-08dce7de7cca X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003442.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8151 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" From: Boyuan Zhang Perform print_ip_state only for the instance of the current vcn IP block, instead of perform it for all vcn instances. Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 33 ++++++++++++------------- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 33 ++++++++++++------------- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 33 ++++++++++++------------- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 33 ++++++++++++------------- drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 33 ++++++++++++------------- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 33 ++++++++++++------------- drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 33 ++++++++++++------------- drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 33 ++++++++++++------------- 8 files changed, 128 insertions(+), 136 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index ab06c4173b66..9255bcfc6c3d 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c @@ -1933,7 +1933,8 @@ void vcn_v1_0_ring_end_use(struct amdgpu_ring *ring) static void vcn_v1_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm_printer *p) { struct amdgpu_device *adev = ip_block->adev; - int i, j; + int inst = ip_block->instance; + int j; uint32_t reg_count = ARRAY_SIZE(vcn_reg_list_1_0); uint32_t inst_off, is_powered; @@ -1941,24 +1942,22 @@ static void vcn_v1_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm return; drm_printf(p, "num_instances:%d\n", adev->vcn.num_vcn_inst); - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - if (adev->vcn.harvest_config & (1 << i)) { - drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", i); - continue; - } + if (adev->vcn.harvest_config & (1 << inst)) { + drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", inst); + return; + } - inst_off = i * reg_count; - is_powered = (adev->vcn.ip_dump[inst_off] & - UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; + inst_off = inst * reg_count; + is_powered = (adev->vcn.ip_dump[inst_off] & + UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; - if (is_powered) { - drm_printf(p, "\nActive Instance:VCN%d\n", i); - for (j = 0; j < reg_count; j++) - drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_1_0[j].reg_name, - adev->vcn.ip_dump[inst_off + j]); - } else { - drm_printf(p, "\nInactive Instance:VCN%d\n", i); - } + if (is_powered) { + drm_printf(p, "\nActive Instance:VCN%d\n", inst); + for (j = 0; j < reg_count; j++) + drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_1_0[j].reg_name, + adev->vcn.ip_dump[inst_off + j]); + } else { + drm_printf(p, "\nInactive Instance:VCN%d\n", inst); } } diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c index 59c6458c99af..94f000ed4895 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c @@ -2041,7 +2041,8 @@ static int vcn_v2_0_start_sriov(struct amdgpu_device *adev) static void vcn_v2_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm_printer *p) { struct amdgpu_device *adev = ip_block->adev; - int i, j; + int inst = ip_block->instance; + int j; uint32_t reg_count = ARRAY_SIZE(vcn_reg_list_2_0); uint32_t inst_off, is_powered; @@ -2049,24 +2050,22 @@ static void vcn_v2_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm return; drm_printf(p, "num_instances:%d\n", adev->vcn.num_vcn_inst); - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - if (adev->vcn.harvest_config & (1 << i)) { - drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", i); - continue; - } + if (adev->vcn.harvest_config & (1 << inst)) { + drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", inst); + return; + } - inst_off = i * reg_count; - is_powered = (adev->vcn.ip_dump[inst_off] & - UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; + inst_off = inst * reg_count; + is_powered = (adev->vcn.ip_dump[inst_off] & + UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; - if (is_powered) { - drm_printf(p, "\nActive Instance:VCN%d\n", i); - for (j = 0; j < reg_count; j++) - drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_2_0[j].reg_name, - adev->vcn.ip_dump[inst_off + j]); - } else { - drm_printf(p, "\nInactive Instance:VCN%d\n", i); - } + if (is_powered) { + drm_printf(p, "\nActive Instance:VCN%d\n", inst); + for (j = 0; j < reg_count; j++) + drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_2_0[j].reg_name, + adev->vcn.ip_dump[inst_off + j]); + } else { + drm_printf(p, "\nInactive Instance:VCN%d\n", inst); } } diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c index b0d14330722b..7c9a0169215e 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c @@ -1915,7 +1915,8 @@ static void vcn_v2_5_set_irq_funcs(struct amdgpu_device *adev, int inst) static void vcn_v2_5_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm_printer *p) { struct amdgpu_device *adev = ip_block->adev; - int i, j; + int inst = ip_block->instance; + int j; uint32_t reg_count = ARRAY_SIZE(vcn_reg_list_2_5); uint32_t inst_off, is_powered; @@ -1923,24 +1924,22 @@ static void vcn_v2_5_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm return; drm_printf(p, "num_instances:%d\n", adev->vcn.num_vcn_inst); - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - if (adev->vcn.harvest_config & (1 << i)) { - drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", i); - continue; - } + if (adev->vcn.harvest_config & (1 << inst)) { + drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", inst); + return; + } - inst_off = i * reg_count; - is_powered = (adev->vcn.ip_dump[inst_off] & - UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; + inst_off = inst * reg_count; + is_powered = (adev->vcn.ip_dump[inst_off] & + UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; - if (is_powered) { - drm_printf(p, "\nActive Instance:VCN%d\n", i); - for (j = 0; j < reg_count; j++) - drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_2_5[j].reg_name, - adev->vcn.ip_dump[inst_off + j]); - } else { - drm_printf(p, "\nInactive Instance:VCN%d\n", i); - } + if (is_powered) { + drm_printf(p, "\nActive Instance:VCN%d\n", inst); + for (j = 0; j < reg_count; j++) + drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_2_5[j].reg_name, + adev->vcn.ip_dump[inst_off + j]); + } else { + drm_printf(p, "\nInactive Instance:VCN%d\n", inst); } } diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c index 9a9acec4c4ce..061c958700d8 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c @@ -2237,7 +2237,8 @@ static void vcn_v3_0_set_irq_funcs(struct amdgpu_device *adev, int inst) static void vcn_v3_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm_printer *p) { struct amdgpu_device *adev = ip_block->adev; - int i, j; + int inst = ip_block->instance; + int j; uint32_t reg_count = ARRAY_SIZE(vcn_reg_list_3_0); uint32_t inst_off; bool is_powered; @@ -2246,24 +2247,22 @@ static void vcn_v3_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm return; drm_printf(p, "num_instances:%d\n", adev->vcn.num_vcn_inst); - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - if (adev->vcn.harvest_config & (1 << i)) { - drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", i); - continue; - } + if (adev->vcn.harvest_config & (1 << inst)) { + drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", inst); + return; + } - inst_off = i * reg_count; - is_powered = (adev->vcn.ip_dump[inst_off] & - UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; + inst_off = inst * reg_count; + is_powered = (adev->vcn.ip_dump[inst_off] & + UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; - if (is_powered) { - drm_printf(p, "\nActive Instance:VCN%d\n", i); - for (j = 0; j < reg_count; j++) - drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_3_0[j].reg_name, - adev->vcn.ip_dump[inst_off + j]); - } else { - drm_printf(p, "\nInactive Instance:VCN%d\n", i); - } + if (is_powered) { + drm_printf(p, "\nActive Instance:VCN%d\n", inst); + for (j = 0; j < reg_count; j++) + drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_3_0[j].reg_name, + adev->vcn.ip_dump[inst_off + j]); + } else { + drm_printf(p, "\nInactive Instance:VCN%d\n", inst); } } diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c index ff256fb4d054..fdf346bf3e34 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c @@ -2146,7 +2146,8 @@ static void vcn_v4_0_set_irq_funcs(struct amdgpu_device *adev, int inst) static void vcn_v4_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm_printer *p) { struct amdgpu_device *adev = ip_block->adev; - int i, j; + int inst = ip_block->instance; + int j; uint32_t reg_count = ARRAY_SIZE(vcn_reg_list_4_0); uint32_t inst_off, is_powered; @@ -2154,24 +2155,22 @@ static void vcn_v4_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm return; drm_printf(p, "num_instances:%d\n", adev->vcn.num_vcn_inst); - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - if (adev->vcn.harvest_config & (1 << i)) { - drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", i); - continue; - } + if (adev->vcn.harvest_config & (1 << inst)) { + drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", inst); + return; + } - inst_off = i * reg_count; - is_powered = (adev->vcn.ip_dump[inst_off] & - UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; + inst_off = inst * reg_count; + is_powered = (adev->vcn.ip_dump[inst_off] & + UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; - if (is_powered) { - drm_printf(p, "\nActive Instance:VCN%d\n", i); - for (j = 0; j < reg_count; j++) - drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_4_0[j].reg_name, - adev->vcn.ip_dump[inst_off + j]); - } else { - drm_printf(p, "\nInactive Instance:VCN%d\n", i); - } + if (is_powered) { + drm_printf(p, "\nActive Instance:VCN%d\n", inst); + for (j = 0; j < reg_count; j++) + drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_4_0[j].reg_name, + adev->vcn.ip_dump[inst_off + j]); + } else { + drm_printf(p, "\nInactive Instance:VCN%d\n", inst); } } diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c index 544c96e082b9..daaf2fb6b3e5 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c @@ -1726,7 +1726,8 @@ static void vcn_v4_0_3_set_irq_funcs(struct amdgpu_device *adev, int inst) static void vcn_v4_0_3_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm_printer *p) { struct amdgpu_device *adev = ip_block->adev; - int i, j; + int inst = ip_block->instance; + int j; uint32_t reg_count = ARRAY_SIZE(vcn_reg_list_4_0_3); uint32_t inst_off, is_powered; @@ -1734,24 +1735,22 @@ static void vcn_v4_0_3_print_ip_state(struct amdgpu_ip_block *ip_block, struct d return; drm_printf(p, "num_instances:%d\n", adev->vcn.num_vcn_inst); - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - if (adev->vcn.harvest_config & (1 << i)) { - drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", i); - continue; - } + if (adev->vcn.harvest_config & (1 << inst)) { + drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", inst); + return; + } - inst_off = i * reg_count; - is_powered = (adev->vcn.ip_dump[inst_off] & - UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; + inst_off = inst * reg_count; + is_powered = (adev->vcn.ip_dump[inst_off] & + UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; - if (is_powered) { - drm_printf(p, "\nActive Instance:VCN%d\n", i); - for (j = 0; j < reg_count; j++) - drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_4_0_3[j].reg_name, - adev->vcn.ip_dump[inst_off + j]); - } else { - drm_printf(p, "\nInactive Instance:VCN%d\n", i); - } + if (is_powered) { + drm_printf(p, "\nActive Instance:VCN%d\n", inst); + for (j = 0; j < reg_count; j++) + drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_4_0_3[j].reg_name, + adev->vcn.ip_dump[inst_off + j]); + } else { + drm_printf(p, "\nInactive Instance:VCN%d\n", inst); } } diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c index 880353f75296..ff8db22b9614 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c @@ -1607,7 +1607,8 @@ static void vcn_v4_0_5_set_irq_funcs(struct amdgpu_device *adev, int inst) static void vcn_v4_0_5_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm_printer *p) { struct amdgpu_device *adev = ip_block->adev; - int i, j; + int inst = ip_block->instance; + int j; uint32_t reg_count = ARRAY_SIZE(vcn_reg_list_4_0_5); uint32_t inst_off, is_powered; @@ -1615,24 +1616,22 @@ static void vcn_v4_0_5_print_ip_state(struct amdgpu_ip_block *ip_block, struct d return; drm_printf(p, "num_instances:%d\n", adev->vcn.num_vcn_inst); - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - if (adev->vcn.harvest_config & (1 << i)) { - drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", i); - continue; - } + if (adev->vcn.harvest_config & (1 << inst)) { + drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", inst); + return; + } - inst_off = i * reg_count; - is_powered = (adev->vcn.ip_dump[inst_off] & - UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; + inst_off = inst * reg_count; + is_powered = (adev->vcn.ip_dump[inst_off] & + UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; - if (is_powered) { - drm_printf(p, "\nActive Instance:VCN%d\n", i); - for (j = 0; j < reg_count; j++) - drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_4_0_5[j].reg_name, - adev->vcn.ip_dump[inst_off + j]); - } else { - drm_printf(p, "\nInactive Instance:VCN%d\n", i); - } + if (is_powered) { + drm_printf(p, "\nActive Instance:VCN%d\n", inst); + for (j = 0; j < reg_count; j++) + drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_4_0_5[j].reg_name, + adev->vcn.ip_dump[inst_off + j]); + } else { + drm_printf(p, "\nInactive Instance:VCN%d\n", inst); } } diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c index a4d1b9a086b2..c83a5c09f410 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c @@ -1334,7 +1334,8 @@ static void vcn_v5_0_0_set_irq_funcs(struct amdgpu_device *adev, int inst) static void vcn_v5_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm_printer *p) { struct amdgpu_device *adev = ip_block->adev; - int i, j; + int inst = ip_block->instance; + int j; uint32_t reg_count = ARRAY_SIZE(vcn_reg_list_5_0); uint32_t inst_off, is_powered; @@ -1342,24 +1343,22 @@ static void vcn_v5_0_print_ip_state(struct amdgpu_ip_block *ip_block, struct drm return; drm_printf(p, "num_instances:%d\n", adev->vcn.num_vcn_inst); - for (i = 0; i < adev->vcn.num_vcn_inst; i++) { - if (adev->vcn.harvest_config & (1 << i)) { - drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", i); - continue; - } + if (adev->vcn.harvest_config & (1 << inst)) { + drm_printf(p, "\nHarvested Instance:VCN%d Skipping dump\n", inst); + return; + } - inst_off = i * reg_count; - is_powered = (adev->vcn.ip_dump[inst_off] & - UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; + inst_off = inst * reg_count; + is_powered = (adev->vcn.ip_dump[inst_off] & + UVD_POWER_STATUS__UVD_POWER_STATUS_MASK) != 1; - if (is_powered) { - drm_printf(p, "\nActive Instance:VCN%d\n", i); - for (j = 0; j < reg_count; j++) - drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_5_0[j].reg_name, - adev->vcn.ip_dump[inst_off + j]); - } else { - drm_printf(p, "\nInactive Instance:VCN%d\n", i); - } + if (is_powered) { + drm_printf(p, "\nActive Instance:VCN%d\n", inst); + for (j = 0; j < reg_count; j++) + drm_printf(p, "%-50s \t 0x%08x\n", vcn_reg_list_5_0[j].reg_name, + adev->vcn.ip_dump[inst_off + j]); + } else { + drm_printf(p, "\nInactive Instance:VCN%d\n", inst); } } -- 2.34.1