From patchwork Tue Feb 21 10:42:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 9584251 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 258FA600C1 for ; Tue, 21 Feb 2017 11:15:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03BE9285B8 for ; Tue, 21 Feb 2017 11:15:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC982288B4; Tue, 21 Feb 2017 11:15:33 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, 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 406AB285B8 for ; Tue, 21 Feb 2017 11:15:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 98C7D6E62F; Tue, 21 Feb 2017 11:15:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1050 seconds by postgrey-1.35 at gabe; Tue, 21 Feb 2017 11:15:31 UTC Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0089.outbound.protection.outlook.com [104.47.40.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id 384C76E62F for ; Tue, 21 Feb 2017 11:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=N8UoDAxZeaawLJDjpzWKel5otlzNXuNmjbNQB1ILkD0=; b=q9uTKf74nAi/eYib2P7FnFwgPMJK+da+RiygnxiMHTxwKBNTZTJQcYYVlDmobcc24lL+LoBlh/vXzsLGL5FhRt8pQmGl8UGa6tPS4xuCpv2YKsdiAl+KNXuHg78XmrNSd0XZceUQbUb/y7OCbUft66zX07mQvqaG9yuhRfRx1GI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=thellstrom@vmware.com; Received: from vmf25template.localdomain (155.4.205.56) by BL2PR05MB2323.namprd05.prod.outlook.com (10.167.99.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.10; Tue, 21 Feb 2017 10:43:08 +0000 From: Thomas Hellstrom To: , Subject: [PATCH] drm/vmwgfx: Work around drm removal of control nodes Date: Tue, 21 Feb 2017 17:42:27 +0700 Message-ID: <20170221104227.2854-1-thellstrom@vmware.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: DB5PR08CA0020.eurprd08.prod.outlook.com (10.163.102.158) To BL2PR05MB2323.namprd05.prod.outlook.com (10.167.99.25) X-MS-Office365-Filtering-Correlation-Id: 90046652-eafe-48ed-a9bd-08d45a466d15 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BL2PR05MB2323; X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB2323; 3:ZqDCtjYX6O8aoAVdKX5QpM9z7ws5QOW4WSUui6MZUpSO+pQZCO44Mky/zU3SyPUmUZOLv1gHLEXly2czJfYYHUzjnf11ESL34d/ZU8bRo4gbZhuWHYIaXOTCUEGl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miXmTST8WxnNg6cXI1tCiFI+5FE6L81XzKZ5cl/ta7UUnqCVl7fvUCay2bAJZVAtbkRawZn+riQpLobbzTTlj9vR6t4S53vyGbnmeCaJzAc+4HzRyqtLEGLLtrsJkOXWun/lxddica735E8u2a4LgRd/JNU3mPrGXvgx26zqjMuvALMQCck7E2IxQen9AULnT3JcVyVPLFQ2M4O8Dh+xXOCo+mlzak8NIgoK+mbA2c2hvrW6Vq3c+mZEBB+aYFcGul+JnEtATOfxRnL+dnlGn/EtZv+UnHkkxCgTPKIa8ZA4G2xhkayhymFIunPKp9RkPGBKERbgDajw12QxbIYeiri461pHvH3Fn5FZF/Jnbi714u0lvWTiQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150)(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123558025)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148); SRVR:BL2PR05MB2323; BCL:0; PCL:0; RULEID:; SRVR:BL2PR05MB2323; X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB2323; 4:w1i/1159ehIQnWMgq1UxC6bPeKP4aFNxjKvq9+FK3RQd/tpTXC0ntyFJ9MTByTCvcwZ0riFqoFpmnswg6cXXRfvQuno6ju5EZM7moACwsNuTPZukTBKSpyMZJ1KKoLqu2gAGA6Ge5EGL8oHLu+V4PB0z5PDZfr2Z4kPY+NvZplyI2Xac+Fv/r4rcQSBzASo0qzq/MxOf+Nrlzxqa31ammHboOZi4Kg4YiQWRf4Sqmk8MxIzpxMHUdWtCBg5HxPV4SCEreNxI2BUPKblun+BctxqyZWhFIlO9yG0gMadDjhLMY8S+w2DhlP0eZoQtpG+9thWoEfPc222x92+oWj9ppOaGODMXPG5Ly9seIDZwnpraDaYEer2Gk7xXvCC3D/lbZtCXUVPl9ErZXXiR8k2B7fa+3oSws6MptqWTnn3tE6IQdM3XF1uKef4fe4mT6uX2YWEEfN745EtAO/nmwfWhEDuoaE6vS5DmNM+PeXLs8K38XAdEik9b4SbRgSCp1JRrCgigztasW9+nvAEVyzar30h4Cf+FRrGFx9FvP6qrAPsf8RlataTFv7AIyCaoYIGYMd6Pp8DgjiGnsAgDjcSYFkKxcx4sV5ObYhl6SU+pljCSBt0mtrMtxfvUHkYLXsnNjO1X0gVBQAVNc6aktQJXsMa8K/SWPpOXOyfRlmZBdKIxIw8e3RvCGNq9ayK6oJn4 X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(189002)(199003)(2906002)(53936002)(86362001)(5660300001)(4326007)(305945005)(7736002)(36756003)(50226002)(5003940100001)(6116002)(3846002)(38730400002)(8676002)(81156014)(33646002)(81166006)(92566002)(6666003)(189998001)(106356001)(50466002)(105586002)(48376002)(97736004)(6506006)(68736007)(101416001)(1076002)(6486002)(25786008)(42186005)(54906002)(66066001)(6512007)(47776003)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR05MB2323; H:vmf25template.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR05MB2323; 23:FkKNs6lftkWTgoFFAxDo2SMuD/VOWik0YCIWykmRG?= =?us-ascii?Q?5VJO9TJ2vnth4W5HUDAWm6yZ2w2HJklBc/rztn22BUn/mmtXBXaJ4PQlxvCi?= =?us-ascii?Q?Tu3TU+V204f2lQmPFhmACp2gyZK+khXZp0PS70IsMSadRAyhm52utAHFkKfP?= =?us-ascii?Q?KcBB0LF5TPdJ5h4Hwqub9v/AtDW8yLJI1x6BWY96g062YM8aOhqcneBXZ+JC?= =?us-ascii?Q?14OV0tzJZiGbW9uQRndRzT3JOlK3LGlp2GTSOrfRKGCEP+/IG/2owuKjBt8t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U+UUeWQG/+WQEpLB36ptmtJAHl0PkLU6qWgrbSoyiaFa732EA6zlaYKtpdAQMtcyGR5BJwYAERlDd6tc9eTX9b82MDKBDxEBS8WQxEiDV+S90xwjavWpefofQWBceqrLMHdWmEjPC9MldshbKvlazufEriv7i62ru3TtT9iW5MvT0zv/ctUYuNUgmiCd3klzSbfW1w3GBZ114s9p8ROpfYYiep7ONvhet7FOHmEdFaSN+aR06do65uJ3Nus4+CrW7pbB8CXcOZVSJvpWdxX8mUlRkM49sRZ9x2U1Ts+tJZQM9hui6PpPtMXSqxPnpXzCbKaxshDZAtWSIeAboD8vOVzLAhd6LOc7WCQ==; 5:Ftdgk9z65orHntgcG8dQsyP28j5WrFMyc2njcY6UZ7jeguJGCtfXg9PdGoIu2u6sQQTtllS8KczEHM+ffZgxUYdUx8vexQOcAUsm99pCHnntuk37LI/DQ4ryzjMNln+71mORjdvall9tTyRFi64d5u4Q/v592fPPfOC+bDKZt8Y=; 24:RNJ1HockYwA11qiIQbmhPcehd3DfYIn8tXqJnzsFzCkz+wBIest262bQqb2lmVjn9JUHgAUlF9D0Ingy9uoO26ygnYQ4ZH630+yCbUvxkr4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR05MB2323; 7:WoRFclBYlzUqyydzeg6/nPDJ5Cdcf40iDhIyi4tN6QGfRD6gilN2PSwkm9mf170+tBvRIn1kuLdSxUS8lCwqtBC93/KYHkrx+p0mqV1H6i0bYpfsR8lNtGZSYLeFag/RqUolAGtYsJ186ECbfDUI91EP8flCLvCkgPhj5MNV90YwshxexS/fgyvzZlaTTpu61/Is5Dmr4WhC+XvpsHWZn41lWr1ey0ygRCEeSXMuzBJFpdv5sNwK019riYrlnMRT3T+XeqoqXp1Ylpy/w0QXLfW58ciWzaW0SBuKKm80ddbQ1ZsXiJ6hzrZQqP2nWOHixI+jngKhgEw9mYfStCbQNg==; 20:W6Cd7TdJXv0JSdJDg+sI3Kf4p7AfwnQW9Iqk/jNpy1b0Qs8I0HtepMC7fChZeb/mLi80MbORmbyM5n8zSgV46K+7Ft/voYblokzwGiaJ4bU85D1JQrFsEDRRiySrcyfdxlBtM17NLC7d9ewWgC929SAHiCPG7PcUPlcBwIQQXWw= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 10:43:08.0371 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR05MB2323 Cc: daniel.vetter@intel.com, Thomas Hellstrom , stable@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP vmware tools has a daemon that gets layout information from the GUI and forwards it to DRM so that the modesetting code can set preferred connector locations and modes. This daemon was using control nodes but since control nodes were just removed, make it possible for the daemon to use render- or primary nodes instead. This is a bit ugly but will allow drm to proceed with removal of the mostly unused control-node code and allow vmware to proceed with fixing up automatic layout settings for gnome-shell/wayland. We bump minor to inform user-space about the api change. Cc: Signed-off-by: Thomas Hellstrom Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 11 ++++++++++- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 541a588..d08f269 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -199,9 +199,14 @@ static const struct drm_ioctl_desc vmw_ioctls[] = { VMW_IOCTL_DEF(VMW_PRESENT_READBACK, vmw_present_readback_ioctl, DRM_MASTER | DRM_AUTH), + /* + * The permissions of the below ioctl are overridden in + * vmw_generic_ioctl(). We require either + * DRM_MASTER or capable(CAP_SYS_ADMIN). + */ VMW_IOCTL_DEF(VMW_UPDATE_LAYOUT, vmw_kms_update_layout_ioctl, - DRM_MASTER | DRM_CONTROL_ALLOW), + DRM_RENDER_ALLOW), VMW_IOCTL_DEF(VMW_CREATE_SHADER, vmw_shader_define_ioctl, DRM_AUTH | DRM_RENDER_ALLOW), @@ -1123,6 +1128,10 @@ static long vmw_generic_ioctl(struct file *filp, unsigned int cmd, return (long) vmw_execbuf_ioctl(dev, arg, file_priv, _IOC_SIZE(cmd)); + } else if (nr == DRM_COMMAND_BASE + DRM_VMW_UPDATE_LAYOUT) { + if (!drm_is_current_master(file_priv) && + !capable(CAP_SYS_ADMIN)) + return -EACCES; } if (unlikely(ioctl->cmd != cmd)) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 1e59a48..59ff419 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -41,9 +41,9 @@ #include #include "vmwgfx_fence.h" -#define VMWGFX_DRIVER_DATE "20160210" +#define VMWGFX_DRIVER_DATE "20170221" #define VMWGFX_DRIVER_MAJOR 2 -#define VMWGFX_DRIVER_MINOR 11 +#define VMWGFX_DRIVER_MINOR 12 #define VMWGFX_DRIVER_PATCHLEVEL 0 #define VMWGFX_FILE_PAGE_OFFSET 0x00100000 #define VMWGFX_FIFO_STATIC_SIZE (1024*1024)