Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7179701imu; Thu, 27 Dec 2018 14:05:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN48t+dzgYlhU3+y98tG2TArjzRlEh04WiFxSBdQaNLAEPa6x2GDFPneKtgK719FZ/5xdcXF X-Received: by 2002:a63:5f50:: with SMTP id t77mr24198193pgb.76.1545948309373; Thu, 27 Dec 2018 14:05:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545948309; cv=none; d=google.com; s=arc-20160816; b=j4wQAxPpCrcWFVnnc1HavctBgRr72anD9jdmt4MCjjBDMW2Ysh9iWKd/HiIzeebGYW KkU6WiivapVQ0SBvgi1YuKqEljJVqgH1ly9h0IakXf7Yr3aU9NdZWij9doxH/RpupWwa DgZlPFCD6QsQTN3PB8Sm9USOUDhaG3l0oAmAKreGf+Ow/4yaqVmJ6hn5JuY/oOr68DsI f0BShPweVyuRp820AkwGJA5oyWjxINeWqcvNi4dJnqT+7f6vGc1E72XOoIsihqTWa4ua v084SVq4q3flsVcUPGTSryTPiaHqNzDdl14iwxvw4H4p3txzKTqmKgvXPs4uZFJ9rOAp A5Ew== 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:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=oSmBbyFlcd4Vbqc07UuobxFNkmU5iZuoUmyD5uzDAUE=; b=IANt9asfskoMeNPGDTvLSz/DhaZqBFyr2H9R3/GRPfD8Xh0a1+V/5W8NPVKthLyElb hjaIwnU+7cbMEE2N6x8l9me9fV8GM13fhLzYXuaL2eSbhzPd2mQfw2tsmty4xKaSfzN5 sxapbLSunrJz0hsRz8qpDu6FuyXKz7Efqo587JXgKnuS6rsHG4fo//0XH2lSfKcRgHzC WwEjF/TCMgxHH4F93Rq6ZRg4zWzAm4/IkWNQ4ZBsVmhrdpk05GkrsfcHgsAMbcEHdDi3 ZefasUNnd7T7V35m3S0Ejmum+BE1Un2q0y7wkoVJNID/lmY8QNlpc3A9lxx8F8Rbeqau NBqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=Yn5RV9KK; 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 3si37220165plo.102.2018.12.27.14.04.54; Thu, 27 Dec 2018 14:05:09 -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; dkim=fail header.i=@ffwll.ch header.s=google header.b=Yn5RV9KK; 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 S1730991AbeL0MOt (ORCPT + 99 others); Thu, 27 Dec 2018 07:14:49 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:37297 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730960AbeL0MOs (ORCPT ); Thu, 27 Dec 2018 07:14:48 -0500 Received: by mail-ed1-f65.google.com with SMTP id h15so15100696edb.4 for ; Thu, 27 Dec 2018 04:14:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=oSmBbyFlcd4Vbqc07UuobxFNkmU5iZuoUmyD5uzDAUE=; b=Yn5RV9KK/EWohm7Evp61eYl8M8zEVsJKd3DsFGjbfQPmcCfGhQ7ZOqHo8tnXnpZEfv xYJWYLU2We6sTtgpfXKvyM6WH6ljOoIR4TgoHS9dQHyvOAc1Y9Do16cjC2c7F7Vm4jqN IBlq8uZaTOKmXAq+d8rtfzekX4+GjGuBQ9rMc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=oSmBbyFlcd4Vbqc07UuobxFNkmU5iZuoUmyD5uzDAUE=; b=Hih6CrDyNNFCgwpL9pEqxrEIr3ZacqRogsEuxAiGoDIX3js2mzX2qYssixcwAQtFRx rB9qyR7bg1bu8GBD0KraXYJxCQyHr2wvfFPuV82hxt4M/4Wso0d3K0thZtgCHsI2Extm VABTumqn5iIRms7w4lAckm9ink7q9QxTvVNTsQFaoJv/prQurea0LUyu2qGoegYFtVNJ Ivm7uMjHsKX+RvIf6MwcP81GIpR6AWheEJZ2rtEnxTmOrs1pGefoVFIbFgxJqmea2KPz o+ln72XQjXjzP2Pk42Sa7QQpJvFVF81dm/VHdy+Pghh2JzWC8UkMJjygKlt/6aQfjljw tCDQ== X-Gm-Message-State: AA+aEWbuWgpiN8yMaN0h+873ng7rxGVtDCEOQf4wdYlEZEZkKifPChMH t5p4Z515hikkV4cJY5pJSoFx5K3EPJ8= X-Received: by 2002:a17:906:6b99:: with SMTP id l25-v6mr15215283ejr.154.1545912886103; Thu, 27 Dec 2018 04:14:46 -0800 (PST) Received: from dvetter-linux.ger.corp.intel.com ([194.230.159.220]) by smtp.gmail.com with ESMTPSA id j8sm11385499ede.55.2018.12.27.04.14.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Dec 2018 04:14:45 -0800 (PST) Date: Thu, 27 Dec 2018 13:14:41 +0100 From: Daniel Vetter To: Sam Ravnborg Cc: Daniel Vetter , David Airlie , Maarten Lankhorst , Maxime Ripard , Sean Paul , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , "David (ChunMing) Zhou" , Gerd Hoffmann , Rob Clark , Tomi Valkeinen , Eric Anholt Subject: Re: [PATCH v1 3/7] drm: move drm_can_sleep() to drm_util.h Message-ID: <20181227121441.GF9058@dvetter-linux.ger.corp.intel.com> Mail-Followup-To: Sam Ravnborg , David Airlie , Maarten Lankhorst , Maxime Ripard , Sean Paul , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , "David (ChunMing) Zhou" , Gerd Hoffmann , Rob Clark , Tomi Valkeinen , Eric Anholt References: <20181226210215.GA27610@ravnborg.org> <20181226210353.13993-3-sam@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181226210353.13993-3-sam@ravnborg.org> X-Operating-System: Linux dvetter-linux.ger.corp.intel.com 4.19.10-200.fc28.x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 26, 2018 at 10:03:49PM +0100, Sam Ravnborg wrote: > Move drm_can_sleep() out of drmP.h to allow users > to get rid of the drmP.h include. > > There was no header file that was a good match for this helper function. > So add this to drm_util with the relevant includes. > > Add include of drm_util.h to all users. > > Signed-off-by: Sam Ravnborg > Cc: Maarten Lankhorst > Cc: Maxime Ripard > Cc: Sean Paul > Cc: David Airlie > Cc: Daniel Vetter > Cc: Alex Deucher > Cc: "Christian K?nig" > Cc: "David (ChunMing) Zhou" > Cc: Gerd Hoffmann > Cc: Rob Clark > Cc: Tomi Valkeinen > Cc: Eric Anholt > --- > drivers/gpu/drm/amd/amdgpu/atom.c | 2 ++ > drivers/gpu/drm/ast/ast_fb.c | 1 + > drivers/gpu/drm/cirrus/cirrus_fbdev.c | 1 + > drivers/gpu/drm/drm_flip_work.c | 1 + > drivers/gpu/drm/mgag200/mgag200_fb.c | 1 + > drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c | 1 + > drivers/gpu/drm/omapdrm/omap_fbdev.c | 1 + > drivers/gpu/drm/qxl/qxl_cmd.c | 2 ++ > drivers/gpu/drm/radeon/atom.c | 2 ++ > drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 1 + > drivers/gpu/drm/vc4/vc4_drv.h | 1 + > include/drm/drmP.h | 8 -------- > include/drm/drm_util.h | 13 +++++++++++++ > 13 files changed, 27 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c > index e9934de1b9cf..dd30f4e61a8c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/atom.c > +++ b/drivers/gpu/drm/amd/amdgpu/atom.c > @@ -27,6 +27,8 @@ > #include > #include > > +#include > + > #define ATOM_DEBUG > > #include "atom.h" > diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c > index de26df0c6044..fb56fe848e81 100644 > --- a/drivers/gpu/drm/ast/ast_fb.c > +++ b/drivers/gpu/drm/ast/ast_fb.c > @@ -38,6 +38,7 @@ > > #include > #include > +#include > #include > #include > #include "ast_drv.h" > diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c > index 68ab1821e15b..1544fa55d1ff 100644 > --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c > +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c > @@ -10,6 +10,7 @@ > */ > #include > #include > +#include > #include > #include > > diff --git a/drivers/gpu/drm/drm_flip_work.c b/drivers/gpu/drm/drm_flip_work.c > index 12dea16f22a8..3da3bf5af405 100644 > --- a/drivers/gpu/drm/drm_flip_work.c > +++ b/drivers/gpu/drm/drm_flip_work.c > @@ -22,6 +22,7 @@ > */ > > #include > +#include > #include > > /** > diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c > index 30726c9fe28c..6893934b26c0 100644 > --- a/drivers/gpu/drm/mgag200/mgag200_fb.c > +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c > @@ -12,6 +12,7 @@ > */ > #include > #include > +#include > #include > #include > > diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c > index 96c2b828dba4..fa2d1d8995ee 100644 > --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c > +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c > @@ -16,6 +16,7 @@ > * this program. If not, see . > */ > > +#include > > #include "mdp5_kms.h" > #include "mdp5_smp.h" > diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c > index aee99194499f..851c59f07eb1 100644 > --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c > +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c > @@ -16,6 +16,7 @@ > */ > > #include > +#include > #include > > #include "omap_drv.h" > diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c > index 208af9f37914..d17676824377 100644 > --- a/drivers/gpu/drm/qxl/qxl_cmd.c > +++ b/drivers/gpu/drm/qxl/qxl_cmd.c > @@ -25,6 +25,8 @@ > > /* QXL cmd/ring handling */ > > +#include > + > #include "qxl_drv.h" > #include "qxl_object.h" > > diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c > index e55cbeee7a53..ac98ad561870 100644 > --- a/drivers/gpu/drm/radeon/atom.c > +++ b/drivers/gpu/drm/radeon/atom.c > @@ -27,6 +27,8 @@ > #include > #include > > +#include > + > #define ATOM_DEBUG > > #include "atom.h" > diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c > index 222a1fa41d7c..7e3257e8fd56 100644 > --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c > +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c > @@ -24,6 +24,7 @@ > * Alex Deucher > */ > #include > +#include > #include > #include > #include "radeon.h" > diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h > index bd6ef1f31822..79c6bcc4f509 100644 > --- a/drivers/gpu/drm/vc4/vc4_drv.h > +++ b/drivers/gpu/drm/vc4/vc4_drv.h > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > #include > #include > #include > diff --git a/include/drm/drmP.h b/include/drm/drmP.h > index 2ba786820052..a77c9ee43b68 100644 > --- a/include/drm/drmP.h > +++ b/include/drm/drmP.h > @@ -95,12 +95,4 @@ struct dma_buf_attachment; > struct pci_dev; > struct pci_controller; > > -/* returns true if currently okay to sleep */ > -static inline bool drm_can_sleep(void) > -{ > - if (in_atomic() || in_dbg_master() || irqs_disabled()) > - return false; > - return true; > -} > - > #endif > diff --git a/include/drm/drm_util.h b/include/drm/drm_util.h > index 88abdca89baa..e3200980d3f3 100644 > --- a/include/drm/drm_util.h > +++ b/include/drm/drm_util.h > @@ -26,7 +26,20 @@ > #ifndef _DRM_UTIL_H_ > #define _DRM_UTIL_H_ > > +#include > +#include > +#include > +#include > + > /* helper for handling conditionals in various for_each macros */ > #define for_each_if(condition) if (!(condition)) {} else > > +/* returns true if currently okay to sleep */ Kerneldoc would be nice for this, specifically a huge warning that this shouldn't be used (it doesn't work everywhere) and a FIXME that all users should be removed. We might even want to include this as a todo item in gpu/todo.rst -Daniel > +static inline bool drm_can_sleep(void) > +{ > + if (in_atomic() || in_dbg_master() || irqs_disabled()) > + return false; > + return true; > +} > + > #endif > -- > 2.12.0 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch