From patchwork Thu Nov 7 11:42:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihail Atanassov X-Patchwork-Id: 11232687 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 CA49713BD for ; Thu, 7 Nov 2019 11:42:44 +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 B13E6218AE for ; Thu, 7 Nov 2019 11:42:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B13E6218AE 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 ABC376F65B; Thu, 7 Nov 2019 11:42:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00058.outbound.protection.outlook.com [40.107.0.58]) by gabe.freedesktop.org (Postfix) with ESMTPS id 993266F65B for ; Thu, 7 Nov 2019 11:42:39 +0000 (UTC) Received: from VI1PR08CA0202.eurprd08.prod.outlook.com (2603:10a6:800:d2::32) by VE1PR08MB4862.eurprd08.prod.outlook.com (2603:10a6:802:a7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Thu, 7 Nov 2019 11:42:36 +0000 Received: from AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::201) by VI1PR08CA0202.outlook.office365.com (2603:10a6:800:d2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2430.23 via Frontend Transport; Thu, 7 Nov 2019 11:42:36 +0000 Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT037.mail.protection.outlook.com (10.152.17.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2430.21 via Frontend Transport; Thu, 7 Nov 2019 11:42:36 +0000 Received: ("Tessian outbound 6481c7fa5a3c:v33"); Thu, 07 Nov 2019 11:42:36 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 645030880de1a3c0 X-CR-MTA-TID: 64aa7808 Received: from 0078b69d08ee.2 (cr-mta-lb-1.cr-mta-net [104.47.10.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 31FF26D5-CEA3-4BE4-BA96-E536CF898A93.1; Thu, 07 Nov 2019 11:42:30 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03lp2059.outbound.protection.outlook.com [104.47.10.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0078b69d08ee.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 07 Nov 2019 11:42:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ioa/rERS0IR96CSsebILIvJdVJfjfUwQ+a7LD3u/cN5l4Gpz+mjOA+8W/1WTo6htPTSHgxZaNnTA8ILz1rFhv1EdLXDSqHWlM8pFnxgDZRAei+iT4RqA6kDNOY9h9Sj2A3lA1rhrTEDAUOtQYx23tqT7DS3116XB71sbxYtXX6VzTjIs/QyUE7pjS1zhkuC136cxbI+H92vbGk95pzgbCDGCcKDhVmCBVmpuHevG1K6Bb75nVcAAtbFlhMWKCoFNrxNKCA10QwWO5BPQIsU/a+RI5SKWLJTo2Vg7iW8jmbgfq0eQL5o7tUdDIP82z/ZEJCsxC7UaTm/BQcamrx+xuQ== 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=Px3I5x1exalU7sGPOYZ9So+eq2jzh/DWgR8Nc28y2p4=; b=Ige5gDllKU8Jl7sUi8isYnY40owRp57XStDVnugbNw6dc1rTwyZ5yUfNsL3UiS6fnGOhDsAsFjSWVns+k7e1yzWFx1P7hw0VSl1MiijSyx2+TI4/HD1Lt34bzM+ZHSi+OxQ67o5mNmHikaNtTDTNEdpYFHZkdjfJ2CiFqSFMHg0cIKwQ8OI9qgJ2rBuDAtyjItt7c+iByieR4jiNYYf7X+TP6wTqnH/p+KaeYGC+yZytXihbL8Zzj50znGbi6YAoynlyzxMGCME9lzcJUjcrNgphLTwtS7eC2KeU05dPxYBU/KljzdtRED0+G87gSZ/63nnBfBXprkIyHibDUoKvIg== 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 VI1PR08MB4351.eurprd08.prod.outlook.com (20.179.27.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.20; Thu, 7 Nov 2019 11:42:29 +0000 Received: from VI1PR08MB4078.eurprd08.prod.outlook.com ([fe80::8191:f0ac:574a:d24d]) by VI1PR08MB4078.eurprd08.prod.outlook.com ([fe80::8191:f0ac:574a:d24d%3]) with mapi id 15.20.2408.028; Thu, 7 Nov 2019 11:42:29 +0000 From: Mihail Atanassov To: "dri-devel@lists.freedesktop.org" Subject: [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity Thread-Topic: [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity Thread-Index: AQHVlWBvEMFUMNrqkUyDY5X/ImK4tw== Date: Thu, 7 Nov 2019 11:42:28 +0000 Message-ID: <20191107114155.54307-2-mihail.atanassov@arm.com> References: <20191107114155.54307-1-mihail.atanassov@arm.com> In-Reply-To: <20191107114155.54307-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.55] x-clientproxiedby: LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) 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-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 20a34134-500f-450f-8d47-08d7637795c9 X-MS-TrafficTypeDiagnostic: VI1PR08MB4351:|VI1PR08MB4351:|VE1PR08MB4862: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:1850;OLM:1850; x-forefront-prvs: 0214EB3F68 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(366004)(346002)(396003)(39860400002)(376002)(136003)(189003)(199004)(11346002)(316002)(54906003)(446003)(476003)(50226002)(71200400001)(6512007)(305945005)(6916009)(2906002)(8936002)(2616005)(44832011)(4326008)(6436002)(66066001)(256004)(486006)(86362001)(26005)(71190400001)(36756003)(52116002)(2351001)(6506007)(99286004)(6486002)(102836004)(2501003)(76176011)(386003)(186003)(6116002)(14454004)(66946007)(66476007)(66556008)(64756008)(66446008)(25786009)(478600001)(1076003)(3846002)(8676002)(81166006)(81156014)(7736002)(5640700003)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB4351; H:VI1PR08MB4078.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: O6fniMMiVL7OOTWcx4Fpdn0GZf/4hC/7AiTbyJwvDTeRaPWaOCgbb6d3XBgVaVounvbFj2azzgmxdCxv6b8Hd7QGemG/8lTedZGqSH+ZOcEFTTIyEYBJ9rpapOvRYEdy4TacFDWw68BrYywusoOpWFLwNZowH/t4iC+3wkcCgOms7FKokjYwZYPMTOk8Qt6mGpZKqNr9maK3gqVY36DL2GZaK7awGdczv+yg6+e0Bt07rMd/UltxKmv/HS/Zj6O8o0PpUYKLvZFsth0Wf6EKrie/KgdL64c/FNMXBolBMQnN0m9HukqSn38A2xO8Vl57jZ3AZkTv7ImDRw/i1vfKnnrzYQs87NJII1TRRZYF8LYlxOvgPrzNXLSmJuK/Y1UnJjSpt7nLYhHc6DEzlSJZ9ZRdHj8hgaoXUnmBymDnYG1OFf91umvIafj3nUhsiNao MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4351 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Mihail.Atanassov@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT037.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)(396003)(346002)(39860400002)(136003)(376002)(1110001)(339900001)(189003)(199004)(11346002)(6116002)(2351001)(8676002)(6916009)(86362001)(66066001)(5660300002)(5640700003)(81166006)(386003)(14454004)(356004)(76176011)(486006)(3846002)(47776003)(316002)(22756006)(81156014)(99286004)(476003)(102836004)(105606002)(2616005)(126002)(6506007)(186003)(26005)(2501003)(50226002)(336012)(26826003)(446003)(107886003)(70206006)(4326008)(478600001)(54906003)(70586007)(8936002)(8746002)(25786009)(7736002)(305945005)(76130400001)(2906002)(36756003)(23756003)(6512007)(50466002)(1076003)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4862; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 92ec3c68-c2d0-4213-9fd9-08d763779159 NoDisclaimer: True X-Forefront-PRVS: 0214EB3F68 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SA2fRD75Y2KUNFWK5vZEeKFDAAvDiC5CGvR98wxjiFwsCe8U2HxhP2VXsxq0rmSFyBZl4FIaN4hzYE9EUxYOvy0IEWasIvxI9rL6lFKrfgCJ3lj/Haf5RsbE7s8kQPIWVFvfDxP3AQKsSzkOcnzePmeQKiZvGdil5Yo+MTwUjVz8wR8qnoM07kfxBVk98zqvY2bqt+UXkMnN/9tEY7oq/FTy9vQzpSsiJaF8a5gA4TBHS7lG4N1TXwXKAvEz0uRlGYo4k7xoF0RzB26mKquOOeNReTQKSj6dh6Li2lDeIK/VY9vpiOg/5J/pgoHA85qv33p7Z9tEt2yFO2UI8qHzzzWU6oIEgsF1tB/8PuS7qLMseHM4sQGqcYwXVLjk2pSCXzle6yNWP0/aqbjiYzXMCGACT7Y5JWay67Z2wXYbi7hQ/mJo3CstxvjV6YC+dm6w X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2019 11:42:36.0906 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20a34134-500f-450f-8d47-08d7637795c9 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: VE1PR08MB4862 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=Px3I5x1exalU7sGPOYZ9So+eq2jzh/DWgR8Nc28y2p4=; b=MDIcln5YVLw6ZbC2AFHkCetlmx6MjLTc5GHrSUiLdDI5H6eKOlFMpoH/X70r0I0QWV/ImCiwsrH1s2yZ2cRRNkatG0PiA2eeJ0aJ74k9F8GigHNi35TwJItz60xAbbchiiqRyIQT9lGiBoAxYLVXFsNR17nL2ppM4t8zGwGmxQ8= 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=Px3I5x1exalU7sGPOYZ9So+eq2jzh/DWgR8Nc28y2p4=; b=MDIcln5YVLw6ZbC2AFHkCetlmx6MjLTc5GHrSUiLdDI5H6eKOlFMpoH/X70r0I0QWV/ImCiwsrH1s2yZ2cRRNkatG0PiA2eeJ0aJ74k9F8GigHNi35TwJItz60xAbbchiiqRyIQT9lGiBoAxYLVXFsNR17nL2ppM4t8zGwGmxQ8= X-Mailman-Original-Authentication-Results: spf=fail (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" Named 'err_verbosity', currently with only 1 active bit in that replicates the existing level - print error events once per flip. Reviewed-by: James Qian Wang (Arm Technology China) Signed-off-by: Mihail Atanassov Acked-by: Liviu Dudau --- drivers/gpu/drm/arm/display/komeda/komeda_dev.c | 4 ++++ drivers/gpu/drm/arm/display/komeda/komeda_dev.h | 14 ++++++++++++-- drivers/gpu/drm/arm/display/komeda/komeda_event.c | 9 +++++++-- drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c index 14d5c5da9e3b..4e46f650fddf 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -58,6 +58,8 @@ static void komeda_debugfs_init(struct komeda_dev *mdev) mdev->debugfs_root = debugfs_create_dir("komeda", NULL); debugfs_create_file("register", 0444, mdev->debugfs_root, mdev, &komeda_register_fops); + debugfs_create_x16("err_verbosity", 0664, mdev->debugfs_root, + &mdev->err_verbosity); } #endif @@ -273,6 +275,8 @@ struct komeda_dev *komeda_dev_create(struct device *dev) goto err_cleanup; } + mdev->err_verbosity = KOMEDA_DEV_PRINT_ERR_EVENTS; + #ifdef CONFIG_DEBUG_FS komeda_debugfs_init(mdev); #endif diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h index 414200233b64..b5bd3d5898ee 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h @@ -202,6 +202,14 @@ struct komeda_dev { /** @debugfs_root: root directory of komeda debugfs */ struct dentry *debugfs_root; + /** + * @err_verbosity: bitmask for how much extra info to print on error + * + * See KOMEDA_DEV_* macros for details. + */ + u16 err_verbosity; + /* Print a single line per error per frame with error events. */ +#define KOMEDA_DEV_PRINT_ERR_EVENTS BIT(0) }; static inline bool @@ -219,9 +227,11 @@ void komeda_dev_destroy(struct komeda_dev *mdev); struct komeda_dev *dev_to_mdev(struct device *dev); #ifdef CONFIG_DRM_KOMEDA_ERROR_PRINT -void komeda_print_events(struct komeda_events *evts); +void komeda_print_events(struct komeda_events *evts, struct drm_device *dev); #else -static inline void komeda_print_events(struct komeda_events *evts) {} +static inline void komeda_print_events(struct komeda_events *evts, + struct drm_device *dev) +{} #endif int komeda_dev_resume(struct komeda_dev *mdev); diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c index a36fb86cc054..575ed4df74ed 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c @@ -107,10 +107,12 @@ static bool is_new_frame(struct komeda_events *a) (KOMEDA_EVENT_FLIP | KOMEDA_EVENT_EOW); } -void komeda_print_events(struct komeda_events *evts) +void komeda_print_events(struct komeda_events *evts, struct drm_device *dev) { - u64 print_evts = KOMEDA_ERR_EVENTS; + u64 print_evts = 0; static bool en_print = true; + struct komeda_dev *mdev = dev->dev_private; + u16 const err_verbosity = mdev->err_verbosity; /* reduce the same msg print, only print the first evt for one frame */ if (evts->global || is_new_frame(evts)) @@ -118,6 +120,9 @@ void komeda_print_events(struct komeda_events *evts) if (!en_print) return; + if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS) + print_evts |= KOMEDA_ERR_EVENTS; + if ((evts->global | evts->pipes[0] | evts->pipes[1]) & print_evts) { char msg[256]; struct komeda_str str; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c index d49772de93e0..e30a5b43caa9 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -48,7 +48,7 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data) memset(&evts, 0, sizeof(evts)); status = mdev->funcs->irq_handler(mdev, &evts); - komeda_print_events(&evts); + komeda_print_events(&evts, drm); /* Notify the crtc to handle the events */ for (i = 0; i < kms->n_crtcs; i++)