Skip to content

Commit b30a43a

Browse files
committed
drm/nouveau: add kconfig option to turn off nouveau legacy contexts. (v3)
There was a nouveau DDX that relied on legacy context ioctls to work, but we fixed it years ago, give distros that have a modern DDX the option to break the uAPI and close the mess of holes that legacy context support is. Full context of the story: commit 0e97598 Author: Peter Antoine <[email protected]> Date: Tue Jun 23 08:18:49 2015 +0100 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 7c51013 Author: Daniel Vetter <[email protected]> Date: Thu Aug 8 15:41:21 2013 +0200 drm: mark context support as a legacy subsystem but this had to be reverted commit c21eb21 Author: Dave Airlie <[email protected]> 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 <[email protected]> (v2) Cc: Peter Antoine <[email protected]> (v2) Reviewed-by: Peter Antoine <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> v2: move DRM_VM dependency into legacy config. v3: fix missing dep (kbuild robot) Cc: [email protected] Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent dbb9247 commit b30a43a

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

drivers/gpu/drm/nouveau/Kconfig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,21 @@ config DRM_NOUVEAU
1717
select INPUT if ACPI && X86
1818
select THERMAL if ACPI && X86
1919
select ACPI_VIDEO if ACPI && X86
20-
select DRM_VM
2120
help
2221
Choose this option for open-source NVIDIA support.
2322

23+
config NOUVEAU_LEGACY_CTX_SUPPORT
24+
bool "Nouveau legacy context support"
25+
depends on DRM_NOUVEAU
26+
select DRM_VM
27+
default y
28+
help
29+
There was a version of the nouveau DDX that relied on legacy
30+
ctx ioctls not erroring out. But that was back in time a long
31+
ways, so offer a way to disable it now. For uapi compat with
32+
old nouveau ddx this should be on by default, but modern distros
33+
should consider turning it off.
34+
2435
config NOUVEAU_PLATFORM_DRIVER
2536
bool "Nouveau (NVIDIA) SoC GPUs"
2637
depends on DRM_NOUVEAU && ARCH_TEGRA

drivers/gpu/drm/nouveau/nouveau_drm.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,8 +1094,11 @@ nouveau_driver_fops = {
10941094
static struct drm_driver
10951095
driver_stub = {
10961096
.driver_features =
1097-
DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER |
1098-
DRIVER_KMS_LEGACY_CONTEXT,
1097+
DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER
1098+
#if defined(CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT)
1099+
| DRIVER_KMS_LEGACY_CONTEXT
1100+
#endif
1101+
,
10991102

11001103
.open = nouveau_drm_open,
11011104
.postclose = nouveau_drm_postclose,

0 commit comments

Comments
 (0)