From patchwork Fri Apr 20 06:51:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10351859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 893BF602B7 for ; Fri, 20 Apr 2018 06:52:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79F4628608 for ; Fri, 20 Apr 2018 06:52:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E50D28641; Fri, 20 Apr 2018 06:52:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E62CF28608 for ; Fri, 20 Apr 2018 06:52:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D1B96E126; Fri, 20 Apr 2018 06:52:12 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 039886E11F for ; Fri, 20 Apr 2018 06:52:11 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id h3-v6so19984911wrh.5 for ; Thu, 19 Apr 2018 23:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dyj0APx99JCAWnLptfT2rACD7vVw+X6KZO0Mi7YK+L8=; b=lTKXHpPpuw99lXN9KOEyzow7tgLLmjBIay7eVfv3prowWWsUw/VMPUKMb0Zs0YoywJ m/QDAaDH8BOlGokUM7ApZK0lO8LIBMFnXgLzMc4y8PAGSLKFfeUP/mFb4Lg8bXg4nJmX 3nePSs3UPVvKRA7FbrZBhBn9OiS3BW7oCLO9s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dyj0APx99JCAWnLptfT2rACD7vVw+X6KZO0Mi7YK+L8=; b=b8DMTheu7VUYc3NdGCQsFgnYYOnInlvuTJwoa7Wvm/eRblhi3fCuV9jC8yw0sIGNKi c3SxI8gIqGVm3euHmqH0mrjWfCrQ3jGAveYhggm8H1q2ve5xyPWMYzIwZIc7zH4mwJr0 nBMiaw9IrVQATnHwDlZ9W0OIY0UjL3d36AGYhHi2XAALXOskLSPaGDXlCf4MDThS8K6d s4PYjkHc5Kq/3JPH0N6hP+7fZi/SfXHKgKZDuLsrAzaP4zd7Ob+EXucZwrmeJKGxIuu3 rRUheebYePxyrbj98sBBg4VoAmP4OfYzYt1GEmt2zwxBZcdeWiY8n/hFujUk6cHnnSBt +PUg== X-Gm-Message-State: ALQs6tCrT4FR4cDG0p02Qy3MoTZXrnTM7zOhBTf4gz5QWgIOD3DwoWIh 5g2d6XAoDvlFYu4kF9sFTuK2VA== X-Google-Smtp-Source: AIpwx4/z6abt5e0k4jG2erqF+24IQOS7r5n/7OMRNIJDsAfD2fg1DoCSYIMnDBV/0MUyZvz0x+xRlw== X-Received: by 10.80.167.227 with SMTP id i90mr8115035edc.152.1524207129673; Thu, 19 Apr 2018 23:52:09 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5635:0:39d2:f87e:2033:9f6]) by smtp.gmail.com with ESMTPSA id c5sm3470023ede.63.2018.04.19.23.52.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 23:52:08 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Fri, 20 Apr 2018 08:51:59 +0200 Message-Id: <20180420065159.4531-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180420065159.4531-1-daniel.vetter@ffwll.ch> References: <20180420065159.4531-1-daniel.vetter@ffwll.ch> Subject: [Intel-gfx] [PATCH 4/4] drm: remove all control node code X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Intel Graphics Development , Daniel Vetter , Daniel Vetter MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP With the ioctl and driver prep done, we can remove everything else. Signed-off-by: Daniel Vetter Cc: Gustavo Padovan Cc: Maarten Lankhorst Cc: Sean Paul Cc: David Airlie Reviewed-by: Sean Paul --- drivers/gpu/drm/drm_drv.c | 10 ---------- drivers/gpu/drm/drm_framebuffer.c | 3 +-- drivers/gpu/drm/drm_ioctl.c | 8 +------- drivers/gpu/drm/drm_sysfs.c | 4 +--- include/drm/drm_device.h | 1 - include/drm/drm_file.h | 13 ------------- include/drm/drm_ioctl.h | 7 ------- 7 files changed, 3 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 32a83b41ab61..f6910ebe4d0e 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -99,8 +99,6 @@ static struct drm_minor **drm_minor_get_slot(struct drm_device *dev, return &dev->primary; case DRM_MINOR_RENDER: return &dev->render; - case DRM_MINOR_CONTROL: - return &dev->control; default: BUG(); } @@ -567,7 +565,6 @@ int drm_dev_init(struct drm_device *dev, err_minors: drm_minor_free(dev, DRM_MINOR_PRIMARY); drm_minor_free(dev, DRM_MINOR_RENDER); - drm_minor_free(dev, DRM_MINOR_CONTROL); drm_fs_inode_free(dev->anon_inode); err_free: mutex_destroy(&dev->master_mutex); @@ -603,7 +600,6 @@ void drm_dev_fini(struct drm_device *dev) drm_minor_free(dev, DRM_MINOR_PRIMARY); drm_minor_free(dev, DRM_MINOR_RENDER); - drm_minor_free(dev, DRM_MINOR_CONTROL); mutex_destroy(&dev->master_mutex); mutex_destroy(&dev->ctxlist_mutex); @@ -796,10 +792,6 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) mutex_lock(&drm_global_mutex); - ret = drm_minor_register(dev, DRM_MINOR_CONTROL); - if (ret) - goto err_minors; - ret = drm_minor_register(dev, DRM_MINOR_RENDER); if (ret) goto err_minors; @@ -837,7 +829,6 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) remove_compat_control_link(dev); drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); - drm_minor_unregister(dev, DRM_MINOR_CONTROL); out_unlock: mutex_unlock(&drm_global_mutex); return ret; @@ -882,7 +873,6 @@ void drm_dev_unregister(struct drm_device *dev) remove_compat_control_link(dev); drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); - drm_minor_unregister(dev, DRM_MINOR_CONTROL); } EXPORT_SYMBOL(drm_dev_unregister); diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 8c4d32adcc17..bfedceff87bb 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -484,8 +484,7 @@ int drm_mode_getfb(struct drm_device *dev, * backwards-compatibility reasons, we cannot make GET_FB() privileged, * so just return an invalid handle for non-masters. */ - if (!drm_is_current_master(file_priv) && !capable(CAP_SYS_ADMIN) && - !drm_is_control_client(file_priv)) { + if (!drm_is_current_master(file_priv) && !capable(CAP_SYS_ADMIN)) { r->handle = 0; ret = 0; goto out; diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 920279666cae..01b61c12d635 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -510,13 +510,7 @@ int drm_ioctl_permit(u32 flags, struct drm_file *file_priv) /* MASTER is only for master or control clients */ if (unlikely((flags & DRM_MASTER) && - !drm_is_current_master(file_priv) && - !drm_is_control_client(file_priv))) - return -EACCES; - - /* Control clients must be explicitly allowed */ - if (unlikely(!(flags & DRM_CONTROL_ALLOW) && - drm_is_control_client(file_priv))) + !drm_is_current_master(file_priv))) return -EACCES; /* Render clients must be explicitly allowed */ diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 1c5b5ce1fd7f..b3c1daad1169 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -331,9 +331,7 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor) struct device *kdev; int r; - if (minor->type == DRM_MINOR_CONTROL) - minor_str = "controlD%d"; - else if (minor->type == DRM_MINOR_RENDER) + if (minor->type == DRM_MINOR_RENDER) minor_str = "renderD%d"; else minor_str = "card%d"; diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h index 3a0eac2885b7..858ba19a3e29 100644 --- a/include/drm/drm_device.h +++ b/include/drm/drm_device.h @@ -38,7 +38,6 @@ struct drm_device { struct device *dev; /**< Device structure of bus-device */ struct drm_driver *driver; /**< DRM driver managing the device */ void *dev_private; /**< DRM driver private data */ - struct drm_minor *control; /**< Control node */ struct drm_minor *primary; /**< Primary node */ struct drm_minor *render; /**< Render node */ bool registered; diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 5176c3797680..99ab50cbab00 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -49,7 +49,6 @@ struct device; enum drm_minor_type { DRM_MINOR_PRIMARY, - DRM_MINOR_CONTROL, DRM_MINOR_RENDER, }; @@ -348,18 +347,6 @@ static inline bool drm_is_render_client(const struct drm_file *file_priv) return file_priv->minor->type == DRM_MINOR_RENDER; } -/** - * drm_is_control_client - is this an open file of the control node - * @file_priv: DRM file - * - * Control nodes are deprecated and in the process of getting removed from the - * DRM userspace API. Do not ever use! - */ -static inline bool drm_is_control_client(const struct drm_file *file_priv) -{ - return file_priv->minor->type == DRM_MINOR_CONTROL; -} - int drm_open(struct inode *inode, struct file *filp); ssize_t drm_read(struct file *filp, char __user *buffer, size_t count, loff_t *offset); diff --git a/include/drm/drm_ioctl.h b/include/drm/drm_ioctl.h index add42809642a..fafb6f592c4b 100644 --- a/include/drm/drm_ioctl.h +++ b/include/drm/drm_ioctl.h @@ -108,13 +108,6 @@ enum drm_ioctl_flags { * This is equivalent to callers with the SYSADMIN capability. */ DRM_ROOT_ONLY = BIT(2), - /** - * @DRM_CONTROL_ALLOW: - * - * Deprecated, do not use. Control nodes are in the process of getting - * removed. - */ - DRM_CONTROL_ALLOW = BIT(3), /** * @DRM_UNLOCKED: *