Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1303812ybb; Fri, 29 Mar 2019 01:38:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyxLMoW1T3SUTz+cXTab9SrKxXel3nCejZPawexJ/YP3dde5B2xQodULpD5vTMdaZwXhOW X-Received: by 2002:a63:6a42:: with SMTP id f63mr18128107pgc.207.1553848680538; Fri, 29 Mar 2019 01:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553848680; cv=none; d=google.com; s=arc-20160816; b=gLkslWZ9XERs+/iYYiUIsgqWOUfo3u+LZwclEl7FrGHvM86kTfGia1HnHMm4DHAG7g 6G3Agl183Zyl0+I39UmZ5eLwiUTu7QtYvVJ/t5Pc3vlj0cNbfYXnMKwQvO+SvxwR2hDh 2mEum+TdlMO1dvMb7Hz3THeETs3gtBd6fOXwTJNaxj8AGWkqjbUOt+I7+Ro0j5/8Gltz lyeS6lrPzbqajjmsWGPv1nLkxhh3RM8EbHNVfbHr1VG4tSCXm+Anx1x7kmnHgoHQBs4Z T97V/IKdJEo+uKPed4uJmIhkPWrw6MrWerfg5FnhY6LV11q3S6BR2ct5NktxeL8RjMuS o9vg== 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=+ZdFhwwiqQSWEHGRuBQZrT8aspWLzFfbpYFYWTarALE=; b=L+he94+ZDUi2UJr4evqIS+W7EnaUbz5pkZ0Dq8Ryej4F/mzKiBcnTMW3KsCwnYMohW 9kZQSFunlqwWIk7DYcZnA+L8aqSotQ7LooRvZ/LwMx9CYzizn5Ac82zt09xkVPM5OJ2e Oo8ptQbCGtkqFqnxz0QBf4j4T8fv//jzCyrquFj7cIesrEUXrEZIi9E1eSSWCEZr9g+S K5yKjJXdAn7dnC2ccuiwIIZyIttAH77v76djzuiGFHGQ/GFbMI+fglMDiay1m3grEMqU 7jWUQWDuuQQ8Wewvo5y5ozBWiJHsRS4y+icHuSQjA46Kn0kjQeM7rtzdnd7JQghD/Mja TdEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=a3NQlXpq; 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 38si1460799pln.90.2019.03.29.01.37.44; Fri, 29 Mar 2019 01:38:00 -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=a3NQlXpq; 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 S1729093AbfC2Ifk (ORCPT + 99 others); Fri, 29 Mar 2019 04:35:40 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38876 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728972AbfC2Ifj (ORCPT ); Fri, 29 Mar 2019 04:35:39 -0400 Received: by mail-ed1-f68.google.com with SMTP id q14so1294846edr.5 for ; Fri, 29 Mar 2019 01:35:38 -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=+ZdFhwwiqQSWEHGRuBQZrT8aspWLzFfbpYFYWTarALE=; b=a3NQlXpqawv6jIaPK1UPmfS/miE7rG8c85wJoXiREKQ2IpLJtWKK1dtyvDN/ItaOSd lcExuT48Kmw2jwL+3TZoJyMT5UhzUjDU0reiuYVO8n7fjdPyGkXKHW4zUgmmLb740jXZ eQV5OTwtQfY4+EEaDcPEjEwAOsyNtaOXsB+Xs= 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=+ZdFhwwiqQSWEHGRuBQZrT8aspWLzFfbpYFYWTarALE=; b=fo7z/68eDH/M3YcCS51yWspmbEcoB8M4/QoaSJhSR3XBGjLY0qWaDmGqz72NXVMAdL a6+SR+hQT4zb3cxjblnKBFyBc07ixK5b5PMUxhYeT8hBQSQpE8iMRHgSwuVZbenbfv0r Q6BNLaqe82i+h7AkbWdJ6mzfDM0yAa/C7pLVvucj+klz30aw/S8h+xucffR1L1+DS323 D5b+oC9IL/T7Ti8QoJZEo3Ozlkc+z30u+h+X73Htju4mxF22VLH8ArmqZEBqzM0xVR5g bURVP4MwaPhVhtbT/81YlZodKManp87XgjZOcX1DzzUI8o9SoXbf54tSCp/PXTyddM+w vGtw== X-Gm-Message-State: APjAAAXQkOpCx6rr7yd3Bn93jtnGKxXcg6uO7fC1anu3ujhkIpuv36wL nbARLT4F905pu0OAZnVn2zM4+g== X-Received: by 2002:a17:906:708d:: with SMTP id b13mr25350179ejk.120.1553848537347; Fri, 29 Mar 2019 01:35:37 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id d20sm473120eda.82.2019.03.29.01.35.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 01:35:36 -0700 (PDT) Date: Fri, 29 Mar 2019 09:35:34 +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: <20190329083534.GC2665@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190328161306.22757-2-paul.kocialkowski@bootlin.com> 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 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. -Daniel > ret = dev->driver->firstopen(dev); > if (ret != 0) > return ret; > diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h > index ca46a45a9cce..de5637494503 100644 > --- a/include/drm/drm_drv.h > +++ b/include/drm/drm_drv.h > @@ -234,9 +234,6 @@ struct drm_driver { > * kernel driver does not really own the hardware. Instead ownershipe is > * handled with the help of userspace through an inheritedly racy dance > * to set/unset the VT into raw mode. > - * > - * Legacy drivers initialize the hardware in the @firstopen callback, > - * which isn't even called for modern drivers. > */ > void (*lastclose) (struct drm_device *); > > -- > 2.21.0 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch