aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2017-02-21 05:42:27 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-14 22:02:49 -0400
commit56a567de553e0ad1440b111077dce521ecdd0cd8 (patch)
treef60e0c40b6725895356fdde66c9c84c2ef7e3c63 /drivers/gpu/drm
parent55f47122c2e8d77a2bdb0f4bd7da57423f947824 (diff)
drm/vmwgfx: Work around drm removal of control nodes
commit 31788ca803a0c89078f9e604e64286fbd9077926 upstream. 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. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170221104227.2854-1-thellstrom@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_drv.c11
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_drv.h4
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 18061a4bc2f2..36005bdf3749 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[] = {
199 VMW_IOCTL_DEF(VMW_PRESENT_READBACK, 199 VMW_IOCTL_DEF(VMW_PRESENT_READBACK,
200 vmw_present_readback_ioctl, 200 vmw_present_readback_ioctl,
201 DRM_MASTER | DRM_AUTH), 201 DRM_MASTER | DRM_AUTH),
202 /*
203 * The permissions of the below ioctl are overridden in
204 * vmw_generic_ioctl(). We require either
205 * DRM_MASTER or capable(CAP_SYS_ADMIN).
206 */
202 VMW_IOCTL_DEF(VMW_UPDATE_LAYOUT, 207 VMW_IOCTL_DEF(VMW_UPDATE_LAYOUT,
203 vmw_kms_update_layout_ioctl, 208 vmw_kms_update_layout_ioctl,
204 DRM_MASTER | DRM_CONTROL_ALLOW), 209 DRM_RENDER_ALLOW),
205 VMW_IOCTL_DEF(VMW_CREATE_SHADER, 210 VMW_IOCTL_DEF(VMW_CREATE_SHADER,
206 vmw_shader_define_ioctl, 211 vmw_shader_define_ioctl,
207 DRM_AUTH | DRM_RENDER_ALLOW), 212 DRM_AUTH | DRM_RENDER_ALLOW),
@@ -1125,6 +1130,10 @@ static long vmw_generic_ioctl(struct file *filp, unsigned int cmd,
1125 1130
1126 return (long) vmw_execbuf_ioctl(dev, arg, file_priv, 1131 return (long) vmw_execbuf_ioctl(dev, arg, file_priv,
1127 _IOC_SIZE(cmd)); 1132 _IOC_SIZE(cmd));
1133 } else if (nr == DRM_COMMAND_BASE + DRM_VMW_UPDATE_LAYOUT) {
1134 if (!drm_is_current_master(file_priv) &&
1135 !capable(CAP_SYS_ADMIN))
1136 return -EACCES;
1128 } 1137 }
1129 1138
1130 if (unlikely(ioctl->cmd != cmd)) 1139 if (unlikely(ioctl->cmd != cmd))
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 1e59a486bba8..59ff4197173a 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -41,9 +41,9 @@
41#include <drm/ttm/ttm_module.h> 41#include <drm/ttm/ttm_module.h>
42#include "vmwgfx_fence.h" 42#include "vmwgfx_fence.h"
43 43
44#define VMWGFX_DRIVER_DATE "20160210" 44#define VMWGFX_DRIVER_DATE "20170221"
45#define VMWGFX_DRIVER_MAJOR 2 45#define VMWGFX_DRIVER_MAJOR 2
46#define VMWGFX_DRIVER_MINOR 11 46#define VMWGFX_DRIVER_MINOR 12
47#define VMWGFX_DRIVER_PATCHLEVEL 0 47#define VMWGFX_DRIVER_PATCHLEVEL 0
48#define VMWGFX_FILE_PAGE_OFFSET 0x00100000 48#define VMWGFX_FILE_PAGE_OFFSET 0x00100000
49#define VMWGFX_FIFO_STATIC_SIZE (1024*1024) 49#define VMWGFX_FIFO_STATIC_SIZE (1024*1024)