summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-03-29 02:25:13 +0300
committerDave Airlie <airlied@redhat.com>2018-03-29 02:25:13 +0300
commit694f54f680f7fd8e9561928fbfc537d9afbc3d79 (patch)
tree484c98988c09a459c9d68a3f4494300c9884e027 /drivers
parent9f36f9c8eed847ee8920ecac689bbf3dd4660774 (diff)
parenta01c47737a9ca118ab75c6fd6e75739b824de830 (diff)
downloadlinux-694f54f680f7fd8e9561928fbfc537d9afbc3d79.tar.xz
Merge branch 'drm-misc-next-fixes' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
- Mask mode type garbage from userspace (Ville) Something went wrong on the misc tree side, but I'll pull the patch directly. * 'drm-misc-next-fixes' of git://anongit.freedesktop.org/drm/drm-misc: drm: Fix uabi regression by allowing garbage mode->type from userspace
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_modes.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index f6b7c0e36a1a..e82b61e08f8c 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1611,7 +1611,13 @@ int drm_mode_convert_umode(struct drm_device *dev,
out->vscan = in->vscan;
out->vrefresh = in->vrefresh;
out->flags = in->flags;
- out->type = in->type;
+ /*
+ * Old xf86-video-vmware (possibly others too) used to
+ * leave 'type' unititialized. Just ignore any bits we
+ * don't like. It's a just hint after all, and more
+ * useful for the kernel->userspace direction anyway.
+ */
+ out->type = in->type & DRM_MODE_TYPE_ALL;
strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
out->name[DRM_DISPLAY_MODE_LEN-1] = 0;