From patchwork Mon Oct 21 16:47:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihail Atanassov X-Patchwork-Id: 11202755 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75E3613B1 for ; Mon, 21 Oct 2019 16:47:50 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5D13320873 for ; Mon, 21 Oct 2019 16:47:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D13320873 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 741FE6E18E; Mon, 21 Oct 2019 16:47:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on060d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::60d]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC4BA6E187 for ; Mon, 21 Oct 2019 16:47:44 +0000 (UTC) Received: from VI1PR08CA0150.eurprd08.prod.outlook.com (2603:10a6:800:d5::28) by AM5PR0801MB1987.eurprd08.prod.outlook.com (2603:10a6:203:47::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.19; Mon, 21 Oct 2019 16:47:40 +0000 Received: from DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::202) by VI1PR08CA0150.outlook.office365.com (2603:10a6:800:d5::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2367.21 via Frontend Transport; Mon, 21 Oct 2019 16:47:40 +0000 Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT015.mail.protection.outlook.com (10.152.20.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2305.15 via Frontend Transport; Mon, 21 Oct 2019 16:47:39 +0000 Received: ("Tessian outbound 0cf06bf5c60e:v33"); Mon, 21 Oct 2019 16:47:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 89bd12e1453a1bd7 X-CR-MTA-TID: 64aa7808 Received: from 26dbf25f3ac7.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.9.50]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9AA667B3-BC90-4D48-A6C9-F3A33A3B69B5.1; Mon, 21 Oct 2019 16:47:27 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03lp2050.outbound.protection.outlook.com [104.47.9.50]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 26dbf25f3ac7.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 21 Oct 2019 16:47:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FpLw7VCKGQF0I9Wxbi3OUepmlFpgjF4OUW++aSWsnYNeWr726at2Fk5fvYRikwgVgbye95LxX6JWjZFIcbRF2LUZ/PXLPdgUmKGKcJEweyY1O8VV3k0XQjEXykL51egjLwykskbXJ+9s0sRo1+g2muX6pajGB6RnxCdw2mwXDRhWaedxjKO2Sjz+gUWzQWNEDlqbVW0p+swpiWqIdXaBe4t05cUXtc2qM/+9+MusX1G5dzafmRzH8YWoxxlAB6zJZw7T3tt4tlPYpgbGHamgXPsnSEntiAN5wQXmd1NhfcsoD/bS48xxdodL5d0lDiWLCNjyR1wRDdY+LyefnehGmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e2yjDsqDr+TeKkIanekjVyEis3xaMX3qJidSclXgt24=; b=b0dLeeo3FYwc4fpZyiBOrhwv02z2EuvlGoRXyQ77cLwLwc8DNktN3J/GiefLEFIFPUxzx9xnelQHFlt0ZbL85GfYOjBQWhXFz2tGgdy91JSZlrCE2Ua6IAYcG0cLH3idWBcsHr48+qaiIhBX+xUjKzQzSmCIfKifwi7YFS9gGFq0jEmfjc6+r/qsgXUTdy3eAcT+ZrfIEdwQ3gUtvjbo1fb1balEPW+rSWctsc5bBH+OkGMSGrdtS2blZB3t+Gy5MweYJ0iwbYkXjrX0F6y/26ts9N6yC2L1SalIDGj6u3nR52yxCCdJ5RY93bATySz1DBV+4Lm004XBr4kC6fne1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VI1PR08MB4078.eurprd08.prod.outlook.com (20.178.127.92) by VI1PR08MB3693.eurprd08.prod.outlook.com (20.178.13.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.18; Mon, 21 Oct 2019 16:47:24 +0000 Received: from VI1PR08MB4078.eurprd08.prod.outlook.com ([fe80::7d25:d1f2:e3eb:868b]) by VI1PR08MB4078.eurprd08.prod.outlook.com ([fe80::7d25:d1f2:e3eb:868b%6]) with mapi id 15.20.2367.022; Mon, 21 Oct 2019 16:47:24 +0000 From: Mihail Atanassov To: "dri-devel@lists.freedesktop.org" Subject: [PATCH 3/5] drm/komeda: Optionally dump DRM state on interrupts Thread-Topic: [PATCH 3/5] drm/komeda: Optionally dump DRM state on interrupts Thread-Index: AQHViC82sr9B7tdJG0SX6V/x8vl4Ug== Date: Mon, 21 Oct 2019 16:47:24 +0000 Message-ID: <20191021164654.9642-4-mihail.atanassov@arm.com> References: <20191021164654.9642-1-mihail.atanassov@arm.com> In-Reply-To: <20191021164654.9642-1-mihail.atanassov@arm.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [217.140.106.51] x-clientproxiedby: LO2P123CA0003.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:a6::15) To VI1PR08MB4078.eurprd08.prod.outlook.com (2603:10a6:803:e5::28) x-mailer: git-send-email 2.23.0 Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Mihail.Atanassov@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: c96deefc-311b-4ce8-29f5-08d756466237 X-MS-Office365-Filtering-HT: Tenant X-MS-TrafficTypeDiagnostic: VI1PR08MB3693:|VI1PR08MB3693:|AM5PR0801MB1987: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; x-forefront-prvs: 0197AFBD92 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(366004)(396003)(346002)(39860400002)(199004)(189003)(11346002)(6436002)(316002)(54906003)(256004)(8936002)(6512007)(14444005)(2501003)(71200400001)(5640700003)(71190400001)(50226002)(486006)(2906002)(446003)(6486002)(2616005)(44832011)(5660300002)(8676002)(476003)(305945005)(66066001)(36756003)(86362001)(25786009)(14454004)(186003)(478600001)(6506007)(386003)(102836004)(26005)(4326008)(2351001)(81156014)(1076003)(6116002)(3846002)(66946007)(81166006)(66556008)(52116002)(66476007)(7736002)(64756008)(66446008)(99286004)(76176011)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3693; H:VI1PR08MB4078.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: fI5DFA0OaEvwUGRfBjUPpzYFwp6+qufH86B3IzpDme/hNcrwas42rl1RYOzrMJPeIZ2q6f8U3D1D8ndhzgGxG8dLQWv3tNPFRM5aPCF+97FZ53Pv/ZJovdyEHv4T7jieGQKUwp92S/AHF3ySlxHg5iduTFhpjRKhz6jexhe+dLSGsg98p9R17dPnrbEtXOB1NoRZih9H4MuVBmrnDAtsfP7YCrFT5eYb+okQRDGJVuJs3OV24WiliUsQ+aTppItNJCUD82IxN0mNCPTvybzSxrfXvvgn25NFZgC+XZBRUt67ouRZJeEPqsHCIz72POzorwIxPRwmsQCAUB+ySdaq07ySxkmttrXa5lNe8vTf2eaQbhZt+TCsCrk8apbgHqlEGlb+1AyYPkbJbkz5NQ3Spiq3Xc+GTcv0exOBHgXc3U+mHPgsDNMsHWJA+r6bm4zw MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3693 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Mihail.Atanassov@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(39860400002)(376002)(346002)(396003)(199004)(189003)(99286004)(6916009)(22756006)(14444005)(356004)(25786009)(76176011)(102836004)(386003)(6506007)(14454004)(2351001)(5660300002)(66066001)(6512007)(1076003)(47776003)(5640700003)(63350400001)(336012)(305945005)(7736002)(486006)(446003)(126002)(476003)(4326008)(26005)(2616005)(11346002)(26826003)(8746002)(6486002)(36756003)(70586007)(76130400001)(478600001)(2906002)(81156014)(186003)(81166006)(8676002)(3846002)(54906003)(6116002)(70206006)(2501003)(8936002)(86362001)(50466002)(107886003)(50226002)(23756003)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1987; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:TempError; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; A:1; MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: b784c45c-298f-4e8e-90b0-08d75646595f NoDisclaimer: True X-Forefront-PRVS: 0197AFBD92 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XEv93rUfbNutz8Yv3V1JnWYqCbTSV281tSUnonYMsmXnDlr7P6OGQa8u4yIgIKmKFvNQn11S/5peCFNe0nZYDiOdlu3KbZuj4mQcTIaz1B6liDp8bxmGOF2E5O2ljsV/9DeUP7calPPvXx3SsQAmCWQhwg6CLHjOyaHCKKrouRIRwE6+gkjMOlamx3H8QN9jwuhG94V/UNYWcFjtV3xcTNEWZYeOdNPEc2HsTN51dXPc7swegRret8xGNEBN06zRAfuhfrIf59qKZ4arfJl812Hr6x+ucs4cA8cfkbczoeZfGZLjDvBuO3qKULsQv0YozPpcGT4DMEQIfprtFJMG+fTbnPZDx9QeRuEo9C41fxAnCV4YWzKmulnnvcdMZ/7tN7ECJ9bkoVLtG8RQsbCXcdao4ABha0FsD3i88wAQOE+WfMu+eyUBfYex0AjZkeLO X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2019 16:47:39.1175 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c96deefc-311b-4ce8-29f5-08d756466237 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1987 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e2yjDsqDr+TeKkIanekjVyEis3xaMX3qJidSclXgt24=; b=QqpqHXPcUBjttmeWlYY57e05gCm61hv5Lljdi6SfJw6DQJnqtdexMLY7YSyTYnpNq7fvfWKTKffp9idrN843Pmb+Bi/G7bnEh7TcOIT4XhNgnnAV6MGCul7upB2JUm3fyaW2qZZ3gf3hWpSoMODzyCUe6H6D6d9SzhvXygoMO7s= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e2yjDsqDr+TeKkIanekjVyEis3xaMX3qJidSclXgt24=; b=QqpqHXPcUBjttmeWlYY57e05gCm61hv5Lljdi6SfJw6DQJnqtdexMLY7YSyTYnpNq7fvfWKTKffp9idrN843Pmb+Bi/G7bnEh7TcOIT4XhNgnnAV6MGCul7upB2JUm3fyaW2qZZ3gf3hWpSoMODzyCUe6H6D6d9SzhvXygoMO7s= X-Mailman-Original-Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.freedesktop.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.freedesktop.org; dmarc=none action=none header.from=arm.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mihail Atanassov , David Airlie , Liviu Dudau , "linux-kernel@vger.kernel.org" , "james qian wang \(Arm Technology China\)" , "Lowry Li \(Arm Technology China\)" , nd , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It's potentially useful information when diagnosing error/warn IRQs, so dump it to dmesg with a drm_info_printer. Hide this extra debug dumping behind another komeda_dev->err_verbosity bit. Note that there's not much sense in dumping it for INFO events, since the VSYNC event will swamp the log. Signed-off-by: Mihail Atanassov Reviewed-by: James Qian Wang (Arm Technology China) --- drivers/gpu/drm/arm/display/komeda/komeda_dev.h | 5 ++++- drivers/gpu/drm/arm/display/komeda/komeda_event.c | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h index 831c375180f8..4809000c1efb 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h @@ -205,11 +205,14 @@ struct komeda_dev { /** * @err_verbosity: bitmask for how much extra info to print on error * - * See KOMEDA_DEV_* macros for details. + * See KOMEDA_DEV_* macros for details. Low byte contains the debug + * level categories, the high byte contains extra debug options. */ u16 err_verbosity; /* Print a single line per error per frame with error events. */ #define KOMEDA_DEV_PRINT_ERR_EVENTS BIT(0) + /* Dump DRM state on an error or warning event. */ +#define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8) }; static inline bool diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c index 575ed4df74ed..5da61e7d75d5 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c @@ -4,6 +4,7 @@ * Author: James.Qian.Wang * */ +#include #include #include "komeda_dev.h" @@ -113,6 +114,7 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev) static bool en_print = true; struct komeda_dev *mdev = dev->dev_private; u16 const err_verbosity = mdev->err_verbosity; + u64 evts_mask = evts->global | evts->pipes[0] | evts->pipes[1]; /* reduce the same msg print, only print the first evt for one frame */ if (evts->global || is_new_frame(evts)) @@ -123,9 +125,10 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev) if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS) print_evts |= KOMEDA_ERR_EVENTS; - if ((evts->global | evts->pipes[0] | evts->pipes[1]) & print_evts) { + if (evts_mask & print_evts) { char msg[256]; struct komeda_str str; + struct drm_printer p = drm_info_printer(dev->dev); str.str = msg; str.sz = sizeof(msg); @@ -139,6 +142,9 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev) evt_str(&str, evts->pipes[1]); DRM_ERROR("err detect: %s\n", msg); + if ((err_verbosity & KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT) + && (evts_mask & (KOMEDA_ERR_EVENTS | KOMEDA_WARN_EVENTS))) + drm_state_dump(dev, &p); en_print = false; }