Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp275884ima; Fri, 1 Feb 2019 03:12:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN6FhVILADzK8G6qr76KT8OtOGgZutw0LxWm5cOsn2NHxmEay9rR3sUFn9P0O9ozp08rFJkW X-Received: by 2002:a63:ff62:: with SMTP id s34mr35455037pgk.325.1549019534818; Fri, 01 Feb 2019 03:12:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549019534; cv=none; d=google.com; s=arc-20160816; b=CLXJ1jD2H+n6uCnzz+/K29tkctxI/uYdK/yB2lAIm0qZNjHiDHUHIRa3RLMfGL+S+i dr021dvHvjlu0e3CKZoNrCn3Q/XLQhAX1/MDZ8vaCwaZdSxiq4Clrn53kW/b/J14Vncz e8d46IKTCJSUTxkeYslQvz9DCqlS7FJqqU+wmz3yRZ4tJNMT+lFtxMcujYjdAEtsg0YC xu4AkIu/OakhjjY2KGR6dp67v+u6u/PNjICPWng66NZOyL2nnMe+bk0S6rU4q7sy82mt ZZ4965rY/TwOd+BcXysWD0gFl0RKQbg9BJ4B/axXLCYmI6IEZpuX7BqkFdhZDNRhO4t+ kg6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=T6LG9deuq9HOfM0Y/6zmKTK4Ss2h9EUZX+d3j2wWFO8=; b=lmJXV3+9SwPCXnTO0NwXJVSXFvpdkRVr4vCknNtWt5MYa8CNAKZAYKMWQJdE1Yrz9r J86p7LcomdUNZwF+VDmTC/e7f2m+ozAPJXR60WGR+9HKoUoE/MIVidZARn9hALhx2kUK LJnUe4DZFNmiwSHfZlmvEiKY/gtk8Zc86hjdiJfLmYGsBF3eyJrrb0Uepj3QeJko1AEt /2m3QIvpqR1WG9GNKndzPaNLdxncIxLq0OUykS8CDUJfyVplvJknqP5C2MaJjxC3UslA tmX/FZvYlV/+EuTi5gUTWEiTBys1jQD0e/dcdu3B3xoRyejB4BIqTinG2lp3vk7P2sp/ 8AQw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g31si7358834pld.358.2019.02.01.03.11.58; Fri, 01 Feb 2019 03:12:14 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730050AbfBALLp (ORCPT + 99 others); Fri, 1 Feb 2019 06:11:45 -0500 Received: from mga01.intel.com ([192.55.52.88]:46584 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726206AbfBALLp (ORCPT ); Fri, 1 Feb 2019 06:11:45 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2019 03:11:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,548,1539673200"; d="scan'208";a="143358970" Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.72.79]) by fmsmga001.fm.intel.com with ESMTP; 01 Feb 2019 03:11:42 -0800 From: Jani Nikula To: Andrzej Hajda , Sam Ravnborg , Thierry Reding Cc: David Airlie , Sean Paul , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Stefan Mavrodiev Subject: Re: [PATCH v1 0/19] drm/panel: drmP.h removal and DRM_DEV* In-Reply-To: <65d0b3cc-9d6b-737b-ded6-25d4174c16a8@samsung.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20190131192619.9763-1-sam@ravnborg.org> <20190131200723.GZ114153@art_vandelay> <20190131210312.GA8947@ravnborg.org> <20190131215417.GA13156@mithrandir> <20190201092037.GA9251@ravnborg.org> <87tvhnyf65.fsf@intel.com> <65d0b3cc-9d6b-737b-ded6-25d4174c16a8@samsung.com> Date: Fri, 01 Feb 2019 13:13:18 +0200 Message-ID: <87lg2zyd69.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 01 Feb 2019, Andrzej Hajda wrote: > On 01.02.2019 11:30, Jani Nikula wrote: >> On Fri, 01 Feb 2019, Sam Ravnborg wrote: >>> Hi Thierry. >>> >>>> I personally like the DRM_DEV_* variants better because of the >>>> additional information that they provide. That can be useful when >>>> grepping logs etc. >>>> >>>> I'm slightly on the fence about this patch. The unwritten, and >>>> admittedly fuzzy, rules that I've been using so far are that dev_*() are >>>> used or messages that have to do with the panel device itself, whereas >>>> DRM_* variants are used for things that are actually related to DRM. So >>>> typically this would mean that roughly everything in ->probe() or >>>> ->remove() would be dev_*(), while the rest would be DRM_DEV_*(). >>> For a rookie like me it is much simpler if one can use the same >>> logging primitives all over or at least the rules when to use what is simple. >>> It is simple to say that everything that exists below drivers/gpu/drm/ >>> relates to drm. >>> >>> Suggested set of rules to follow: >>> - If in drm core, use DRM_XXX where XXX represent the core functionality >>> - If in a driver use DRM_DEV* if a struct device is available >>> - If in a driver and no struct device, use plain DRM_ERROR/INFO >> Core and drivers are already pretty conflated: >> >> http://patchwork.freedesktop.org/patch/msgid/20181227162310.13023-1-jani.nikula@intel.com >> >> --- >> >> Side note, I'd like to switch i915 to dev based debugs, but I absolutely >> hate the idea of changing: >> >> DRM_DEBUG_KMS("...") >> >> to: >> >> DRM_DEV_DEBUG_KMS(dev_priv->drm.dev, "...") >> >> I think the dev based macros are way too long, and would serve *most* >> (though not all) drivers better by having struct drm_device * rather >> than struct device * as the first param. In the above, just the >> boilerplate consumes half the line. >> >> Basically I'd like to see drm_ prefixed analogues to all the dev_ based >> logging functions, e.g. drm_dbg that takes drm_device. But it's so much >> churn that I'm contemplating just making i915 specific wrappers >> instead. :( > > > Does it means I am the only one who is not convinced to use all these > DRM_DEV helpers. > > For me classic dev_(err|...) looks fine, if we really want to emphasize > that logs comes from DRM dev_* allows format modification, sth like this: > > #define dev_fmt(fmt) "DRM: %s:%d: " fmt, __func__, __LINE__ > > but it is still something I do not see very helpful. dev_dbg has all the fancy dynamic debug stuff, but no way to filter by category the way drm.debug bitmask allows. BR, Jani. > > > In general I think we have too many alternatives/flavours and developers > do not know what to choose, current usage of all these DRM_* shows it > clearly. > > > Regards > > Andrzej > > > >> >> BR, >> Jani. >> >> >> >> >>> If there is a need to distingush before/after one has a drm_device, >>> the best way would be to have a set of logging primitives that >>> take a drm_device. So we could extend the rule set: >>> - If in a driver use DRM_DRM* if a struct drm_device is available >>> (This rule would take precedence over a struct device) >>> >>> DRM_DRM*, or DRM_DDEV* or ... But you get the idea. >>> >>> But this is not where we are today. >>> >>> Shall I redo the patch-set so we go back to dev_*() in probe() / remove()? >>> >>> Sam >>> _______________________________________________ >>> dri-devel mailing list >>> dri-devel@lists.freedesktop.org >>> https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- Jani Nikula, Intel Open Source Graphics Center