Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6354223ybx; Mon, 11 Nov 2019 07:53:54 -0800 (PST) X-Google-Smtp-Source: APXvYqymC67WboqsatQhrVHuAyrzJw8P1fpVhAsfnnG0CnElwhA8yBwitfVnc8WLbaG1T0Bm4a2q X-Received: by 2002:a17:906:c45:: with SMTP id t5mr22753183ejf.296.1573487634281; Mon, 11 Nov 2019 07:53:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573487634; cv=none; d=google.com; s=arc-20160816; b=PxvBdgkeqLNKu3qG4q5RK/uOx7hvzcasAJsWVfOygZgN2yT+07nqT1+NMPKUUYOzp5 k9GLL7oydUEV4RjKQ17fqoW93sxsizfiO3w7NfztRvOWJ7RSRKmBxjT/LEejr8nSh1Y1 AK+pWsK0dvuQ2QpEzBt1CFlxbVb+waCObk/N0LlXS4S6xNJ+AZ2VaPxXIMczvFaQ1jfV hmU5vt/SJZ1A6OlQSuOoWmenZG/jrzc/hl3qPex4foTFe27eipxznrpfOYi9pht8tuWL Rzp3B4HhteylSrK6vGQbcDbMSoPa+RaxGG4YbXOFk/jxGuxtnC0+dZ7oRUEN2t7GvZ+6 C13Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=xv6WUE+g8Uck16Rxx1HkAXD/O/4dJmIXlxPKi4z2xTc=; b=mRKKrOlxqCczLaZPSCmpX1lUIcF6u+A3goIRP8yB90VMw/5d9Thqn78iCM6RE1qWEe neYJe3Px/CyRF2MDaSgMQs42NQQStwdLnBy4nMUSLm3jarkKbzCY9tux969shQv2Rd/N MMtD67PKGjQvbYj17CHk3OhbcXcOsNYoBmNUMCsoDhwM1l70gOkKICm1lycHJ2ZIOk6S diM4i9IIoGL67rbRC+Z6HLtrAR8XHGslyITvaB8+Xn3yJf7Ib7SNuoLQiOmrd95NSR4T efNaeGySg6+egawJ1O56kA9pXeRdBznYDQfcp1ovUDmMLrs6AxH5ns0Ws2giANqAVBo2 MQCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dt19si9436198ejb.206.2019.11.11.07.53.29; Mon, 11 Nov 2019 07:53:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726915AbfKKPwM (ORCPT + 99 others); Mon, 11 Nov 2019 10:52:12 -0500 Received: from foss.arm.com ([217.140.110.172]:47350 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbfKKPwM (ORCPT ); Mon, 11 Nov 2019 10:52:12 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5936331B; Mon, 11 Nov 2019 07:52:11 -0800 (PST) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1434B3F534; Mon, 11 Nov 2019 07:52:11 -0800 (PST) Received: by e110455-lin.cambridge.arm.com (Postfix, from userid 1000) id C954D682AC2; Mon, 11 Nov 2019 15:52:09 +0000 (GMT) Date: Mon, 11 Nov 2019 15:52:09 +0000 From: Liviu Dudau To: Mihail Atanassov Cc: "dri-devel@lists.freedesktop.org" , nd , Maarten Lankhorst , Maxime Ripard , Sean Paul , Brian Starkey , David Airlie , Daniel Vetter , "james qian wang (Arm Technology China)" , "Lowry Li (Arm Technology China)" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity Message-ID: <20191111155209.zxkgqj4m4x6mphd7@e110455-lin.cambridge.arm.com> References: <20191107114155.54307-1-mihail.atanassov@arm.com> <20191107114155.54307-2-mihail.atanassov@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191107114155.54307-2-mihail.atanassov@arm.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 11:42:28AM +0000, Mihail Atanassov wrote: > 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 Best regards, Liviu > --- > 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++) > -- > 2.23.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯