Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1304572ybb; Fri, 29 Mar 2019 01:39:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLC7QsywjjQgUPGRvl7hc93ao/f7ADBBgBkM5HG8f6i5mx2S31nAxj+pOz2MMdUPfrXwgB X-Received: by 2002:aa7:8818:: with SMTP id c24mr45482776pfo.129.1553848754189; Fri, 29 Mar 2019 01:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553848754; cv=none; d=google.com; s=arc-20160816; b=NR5b1FovcLR8yhOZUOEy/ouWrC2fTN4jXuI63obcI3OKPq5WGDYIwQq5mvvoerQxzI KnVIDOPjCH2FJADHZwp2Ubp6Fx29t9UgohCPXH75tjHsn0LbSH7jXwir/Qbh22DDsnhC 4Ezm3Fcbv1r74EPbozwqmCuvHO3+4PY839CsFLPFaALYEdtBJKyedhELzSn4vCTcLXCG gGIHMBI7+ceXaNbLxb/2rN4y/lbb3h60qrRnKpOenikWWF4l8A/BvKT8wXUVaz4V/E2v Ufk34SB2r2WRqmncqyLn3Y8TxV9Hlr96M7yqEMO+Ewus0Faol8uBxVcyCGz1A+dSK4aE aTBQ== 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-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=ldh1DeZZbyWaL0eQH1n+YhO96fj3m6Kxa4r5d6+/TFs=; b=HGuJ6MqM+O7SsNBFxqto4VxDL8j05YnfWPs/uAf5VQGH3U4JT1S/6h+yPo/FplVqY2 FXSv5dtfq8Feuwk/51RQlUT8f9BRzlbhiXy/QWQh6R4p+lfqn+YIQ8y7PAv47tPH1p0D ov5l1lCZrALap/XNVYbAk8CmD87kpbVDQT6PhO81ZUgs+wDTCLSoFTnWgcWKwnrWKneS JgxkB3b5bZO4tuestyN4QZko4MyVIPtHK276qaQQ1BFQoVOo5vZV6NfcLTpThjGuepps ly4hGOhnuH6IhV8iLwtJHIk6x8JSD+xUYGXQsjCIKXINu60T9M0a/8DhBjG38tQf5DkW d/1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b="Y579v6o/"; 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 z4si1405706plo.166.2019.03.29.01.38.58; Fri, 29 Mar 2019 01:39:14 -0700 (PDT) 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="Y579v6o/"; 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 S1729138AbfC2Ih5 (ORCPT + 99 others); Fri, 29 Mar 2019 04:37:57 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:39723 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729009AbfC2Ih5 (ORCPT ); Fri, 29 Mar 2019 04:37:57 -0400 Received: by mail-ed1-f67.google.com with SMTP id p20so1296649eds.6 for ; Fri, 29 Mar 2019 01:37:56 -0700 (PDT) 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:in-reply-to:user-agent; bh=ldh1DeZZbyWaL0eQH1n+YhO96fj3m6Kxa4r5d6+/TFs=; b=Y579v6o/c4JS38ajfPIJdiBFGQmixI7n536PsM9HUzmbOxh4SWdqJ/nViLVGQ7W1GL YMV7T5+G6R6dFZNLYMcnFyrtm0ptKK99fStJWvKsg6VvQPxg4sht/C90j1H+RUulsTRS pRtYBRbLfoqDHfquO5DBuTesXSgYqBIZZi0PE= 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 :in-reply-to:user-agent; bh=ldh1DeZZbyWaL0eQH1n+YhO96fj3m6Kxa4r5d6+/TFs=; b=Q65vYg17852JiS2wr1g9V5W2NIslO7/8rs9/aOJ2E7Nxk8Ko51UJvT77o571tcY4AU fzpL/u4dPGvPM3fKOVbAieQYATLMuXnBGeSRPNDWWVanV2RmS4HnesdhIn1WavlVIBzV g60w1DBYURrp/c31+xux6IHnfPvSsLDpWTHEAggykz+ZgujQz2/8t0MlYureC5fzdwlV crqwBc0wzQV5xl0+ePVjWcm33OgIO9Wkovx0wYXCmfE+NDJWINRyZK41TahhWtkyiIbC 28rp6Kmsj0uoTdaz9bu3cNZ5nTzb63lb5rHu6jjJKR/YOLzjWwgKBRbBT9oJoHgWK1D0 5ASw== X-Gm-Message-State: APjAAAUWIa3d34uyCwhu1kPX80QkGLzlMRQBlD3BPkzuCvaTjeIUWOfu bB17E/KeGRrOyB1ISaWxzLGhlw== X-Received: by 2002:a17:906:1545:: with SMTP id c5mr17258358ejd.135.1553848675461; Fri, 29 Mar 2019 01:37:55 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id j18sm479063edj.92.2019.03.29.01.37.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 01:37:54 -0700 (PDT) Date: Fri, 29 Mar 2019 09:37:52 +0100 From: Daniel Vetter To: Paul Kocialkowski Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Eric Anholt , Eben Upton , Thomas Petazzoni Subject: Re: [PATCH v3 1/2] drm/file: Rehabilitate the firstopen hook for non-legacy drivers Message-ID: <20190329083752.GD2665@phenom.ffwll.local> Mail-Followup-To: Paul Kocialkowski , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Eric Anholt , Eben Upton , Thomas Petazzoni References: <20190328161306.22757-1-paul.kocialkowski@bootlin.com> <20190328161306.22757-2-paul.kocialkowski@bootlin.com> <20190329083534.GC2665@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190329083534.GC2665@phenom.ffwll.local> X-Operating-System: Linux phenom 4.19.0-1-amd64 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 Fri, Mar 29, 2019 at 09:35:34AM +0100, Daniel Vetter wrote: > On Thu, Mar 28, 2019 at 05:13:05PM +0100, Paul Kocialkowski wrote: > > The firstopen DRM driver hook was initially used to perform hardware > > initialization, which is now considered legacy. Only a single user of > > firstopen remains at this point (savage). > > > > In some specific cases, non-legacy drivers may also need to implement > > these hooks. For instance on VC4, we need to allocate a 16 MiB buffer > > for the GPU. Because it's not required for fbcon, it's a waste to > > allocate it before userspace starts using the DRM device. > > > > Using firstopen and lastclose for this allocation seems like the best > > fit, so re-habilitate the hook to allow it to be called for non-legacy > > drivers. > > > > Signed-off-by: Paul Kocialkowski > > Reviewed-by: Eric Anholt > > --- > > drivers/gpu/drm/drm_file.c | 3 +-- > > include/drm/drm_drv.h | 3 --- > > 2 files changed, 1 insertion(+), 5 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c > > index b1838a41ad43..c011b5cbfb6b 100644 > > --- a/drivers/gpu/drm/drm_file.c > > +++ b/drivers/gpu/drm/drm_file.c > > @@ -266,8 +266,7 @@ static int drm_setup(struct drm_device * dev) > > { > > int ret; > > > > - if (dev->driver->firstopen && > > - drm_core_check_feature(dev, DRIVER_LEGACY)) { > > + if (dev->driver->firstopen) { > > If you guys insist on this (still not a fan myself) pls pull it out of > drm_setup - that's all just legacy hw setup in there. I still think > tracking this a bit more accurately (if you want to bother with this) > would be better. Maybe another one: Firstopen is called after ->open, which might be confusing. But we can't change that ever because legacy drivers surely rely on that somewhere (like the backwards load/unload calling sequence). -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch