From patchwork Tue Sep 11 18:35:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 1439581 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 13565DFAF3 for ; Tue, 11 Sep 2012 18:34:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D56899EFA6 for ; Tue, 11 Sep 2012 11:33:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id E03DC9E849 for ; Tue, 11 Sep 2012 11:33:49 -0700 (PDT) Received: by eekc13 with SMTP id c13so691693eek.36 for ; Tue, 11 Sep 2012 11:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=f2fXlX1LNrZHmKFJw20iLpC84NpQYBr/LLhLvsvWCEs=; b=BznxMvvNnWAmKZqvfc4UpgbwcNjaVeSvxjU/Lq0xECjAOReVuXqFgDqBfWUTyz8XHj wY9rHmR/LhRBG1XB7WCXp7XZV9kNCR/yQyIBicThZiRLNZfO8DVetDn1ybJt46t+fA1W YQnpIH0YmPn4zxhNXk9XLdViWw7liwuN0Qtp2gge6hwUdb/bg3MblWo+lPktz1yIgH+C 6svHA3NU/8L0+qE82LslHrE1U8Dxpn7TSl75u1MlCAi+d1VCjJ0jqV2vnFkEDfzaUTS6 t2REP4UxvHK0o5Xzgi+P1g5KPeWvh/1mE/J8KkfLtc6m9d0AS8SVVoIuo8B14FXOxhG6 2eAA== Received: by 10.204.129.16 with SMTP id m16mr5302521bks.136.1347388428810; Tue, 11 Sep 2012 11:33:48 -0700 (PDT) Received: from localhost.localdomain (stgt-5f71a020.pool.mediaWays.net. [95.113.160.32]) by mx.google.com with ESMTPS id j9sm10454286bkv.0.2012.09.11.11.33.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 11:33:48 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: make buffer management work without DRM_MASTER Date: Tue, 11 Sep 2012 20:35:11 +0200 Message-Id: <1347388511-3948-1-git-send-email-dh.herrmann@googlemail.com> X-Mailer: git-send-email 1.7.12 Cc: hoegsberg@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org DRM users should be able to create/destroy/manage dumb- and frame-buffers without DRM_MASTER. These ioctls do not affect modesetting so there is no reason to protect them by drm-master. Particularly, destroying buffers should always be possible as a client has only access to buffers that they created. Hence, there is no reason to prevent a client from destroying the buffers, considering a simple close() would destroy them, anyway. Furthermore, a display-server currently cannot shutdown correctly if it does not have DRM_MASTER. If some other display-server becomes active (or the kernel console), then the background display-server is unable to destroy its buffers. Under special curcumstances (like monitor reconfiguration) this might even happen during runtime. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_drv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 9238de4..1490e76 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -156,14 +156,14 @@ static struct drm_ioctl_desc drm_ioctls[] = { DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETPROPERTY, drm_mode_connector_property_set_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETPROPBLOB, drm_mode_getblob_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_CONTROL_ALLOW|DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB2, drm_mode_addfb2, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB2, drm_mode_addfb2, DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_MODE_PAGE_FLIP, drm_mode_page_flip_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_MODE_DIRTYFB, drm_mode_dirtyfb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_DUMB, drm_mode_create_dumb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_MODE_MAP_DUMB, drm_mode_mmap_dumb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROY_DUMB, drm_mode_destroy_dumb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_DUMB, drm_mode_create_dumb_ioctl, DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_MODE_MAP_DUMB, drm_mode_mmap_dumb_ioctl, DRM_CONTROL_ALLOW|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROY_DUMB, drm_mode_destroy_dumb_ioctl, DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_GETPROPERTIES, drm_mode_obj_get_properties_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_SETPROPERTY, drm_mode_obj_set_property_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), };