summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_drv.c
diff options
context:
space:
mode:
authorPeter Antoine <peter.antoine@intel.com>2015-06-23 10:18:49 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-07-02 18:00:47 +0300
commit0e975980d435d58df2d430d688b8c18778b42218 (patch)
treea70a0c2320b589e2e7ae75b49f6acdc58a7ced5f /drivers/gpu/drm/drm_drv.c
parent8b72ce158cf0dba443e36fc66e0bb29c2580e0b6 (diff)
downloadlinux-0e975980d435d58df2d430d688b8c18778b42218.tar.xz
drm: Turn off Legacy Context Functions
The context functions are not used by the i915 driver and should not be used by modeset drivers. These driver functions contain several bugs and security holes. This change makes these functions optional can be turned on by a setting, they are turned off by default for modeset driver with the exception of the nouvea driver that may require them with an old version of libdrm. The previous attempt was commit 7c510133d93dd6f15ca040733ba7b2891ed61fd1 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Thu Aug 8 15:41:21 2013 +0200 drm: mark context support as a legacy subsystem but this had to be reverted commit c21eb21cb50d58e7cbdcb8b9e7ff68b85cfa5095 Author: Dave Airlie <airlied@redhat.com> Date: Fri Sep 20 08:32:59 2013 +1000 Revert "drm: mark context support as a legacy subsystem" v2: remove returns from void function, and formatting (Daniel Vetter) v3: - s/Nova/nouveau/ in the commit message, and add references to the previous attempts - drop the part touching the drm hw lock, that should be a separate patch. Signed-off-by: Peter Antoine <peter.antoine@intel.com> (v2) Cc: Peter Antoine <peter.antoine@intel.com> (v2) Reviewed-by: Peter Antoine <peter.antoine@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r--drivers/gpu/drm/drm_drv.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index b7bf4ce8c012..838657503113 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -582,11 +582,14 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver,
if (drm_ht_create(&dev->map_hash, 12))
goto err_minors;
- ret = drm_legacy_ctxbitmap_init(dev);
- if (ret) {
- DRM_ERROR("Cannot allocate memory for context bitmap.\n");
- goto err_ht;
- }
+ if (drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) ||
+ !drm_core_check_feature(dev, DRIVER_MODESET))
+ ret = drm_legacy_ctxbitmap_init(dev);
+ if (ret) {
+ DRM_ERROR(
+ "Cannot allocate memory for context bitmap.\n");
+ goto err_ht;
+ }
if (drm_core_check_feature(dev, DRIVER_GEM)) {
ret = drm_gem_init(dev);