]>
Commit | Line | Data |
---|---|---|
6fa1c118 GKH |
1 | From b30a43ac7132cdda833ac4b13dd1ebd35ace14b7 Mon Sep 17 00:00:00 2001 |
2 | From: Dave Airlie <airlied@redhat.com> | |
3 | Date: Thu, 18 Apr 2019 16:45:15 +1000 | |
4 | Subject: drm/nouveau: add kconfig option to turn off nouveau legacy contexts. (v3) | |
5 | ||
6 | From: Dave Airlie <airlied@redhat.com> | |
7 | ||
8 | commit b30a43ac7132cdda833ac4b13dd1ebd35ace14b7 upstream. | |
9 | ||
10 | There was a nouveau DDX that relied on legacy context ioctls to work, | |
11 | but we fixed it years ago, give distros that have a modern DDX the | |
12 | option to break the uAPI and close the mess of holes that legacy | |
13 | context support is. | |
14 | ||
15 | Full context of the story: | |
16 | ||
17 | commit 0e975980d435d58df2d430d688b8c18778b42218 | |
18 | Author: Peter Antoine <peter.antoine@intel.com> | |
19 | Date: Tue Jun 23 08:18:49 2015 +0100 | |
20 | ||
21 | drm: Turn off Legacy Context Functions | |
22 | ||
23 | The context functions are not used by the i915 driver and should not | |
24 | be used by modeset drivers. These driver functions contain several bugs | |
25 | and security holes. This change makes these functions optional can be | |
26 | turned on by a setting, they are turned off by default for modeset | |
27 | driver with the exception of the nouvea driver that may require them with | |
28 | an old version of libdrm. | |
29 | ||
30 | The previous attempt was | |
31 | ||
32 | commit 7c510133d93dd6f15ca040733ba7b2891ed61fd1 | |
33 | Author: Daniel Vetter <daniel.vetter@ffwll.ch> | |
34 | Date: Thu Aug 8 15:41:21 2013 +0200 | |
35 | ||
36 | drm: mark context support as a legacy subsystem | |
37 | ||
38 | but this had to be reverted | |
39 | ||
40 | commit c21eb21cb50d58e7cbdcb8b9e7ff68b85cfa5095 | |
41 | Author: Dave Airlie <airlied@redhat.com> | |
42 | Date: Fri Sep 20 08:32:59 2013 +1000 | |
43 | ||
44 | Revert "drm: mark context support as a legacy subsystem" | |
45 | ||
46 | v2: remove returns from void function, and formatting (Daniel Vetter) | |
47 | ||
48 | v3: | |
49 | - s/Nova/nouveau/ in the commit message, and add references to the | |
50 | previous attempts | |
51 | - drop the part touching the drm hw lock, that should be a separate | |
52 | patch. | |
53 | ||
54 | Signed-off-by: Peter Antoine <peter.antoine@intel.com> (v2) | |
55 | Cc: Peter Antoine <peter.antoine@intel.com> (v2) | |
56 | Reviewed-by: Peter Antoine <peter.antoine@intel.com> | |
57 | Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> | |
58 | ||
59 | v2: move DRM_VM dependency into legacy config. | |
60 | v3: fix missing dep (kbuild robot) | |
61 | ||
62 | Cc: stable@vger.kernel.org | |
63 | Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> | |
64 | Signed-off-by: Dave Airlie <airlied@redhat.com> | |
65 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
66 | ||
67 | --- | |
68 | drivers/gpu/drm/nouveau/Kconfig | 13 ++++++++++++- | |
69 | drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +++++-- | |
70 | 2 files changed, 17 insertions(+), 3 deletions(-) | |
71 | ||
72 | --- a/drivers/gpu/drm/nouveau/Kconfig | |
73 | +++ b/drivers/gpu/drm/nouveau/Kconfig | |
74 | @@ -16,10 +16,21 @@ config DRM_NOUVEAU | |
75 | select INPUT if ACPI && X86 | |
76 | select THERMAL if ACPI && X86 | |
77 | select ACPI_VIDEO if ACPI && X86 | |
78 | - select DRM_VM | |
79 | help | |
80 | Choose this option for open-source NVIDIA support. | |
81 | ||
82 | +config NOUVEAU_LEGACY_CTX_SUPPORT | |
83 | + bool "Nouveau legacy context support" | |
84 | + depends on DRM_NOUVEAU | |
85 | + select DRM_VM | |
86 | + default y | |
87 | + help | |
88 | + There was a version of the nouveau DDX that relied on legacy | |
89 | + ctx ioctls not erroring out. But that was back in time a long | |
90 | + ways, so offer a way to disable it now. For uapi compat with | |
91 | + old nouveau ddx this should be on by default, but modern distros | |
92 | + should consider turning it off. | |
93 | + | |
94 | config NOUVEAU_PLATFORM_DRIVER | |
95 | bool "Nouveau (NVIDIA) SoC GPUs" | |
96 | depends on DRM_NOUVEAU && ARCH_TEGRA | |
97 | --- a/drivers/gpu/drm/nouveau/nouveau_drm.c | |
98 | +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |
99 | @@ -1015,8 +1015,11 @@ nouveau_driver_fops = { | |
100 | static struct drm_driver | |
101 | driver_stub = { | |
102 | .driver_features = | |
103 | - DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER | | |
104 | - DRIVER_KMS_LEGACY_CONTEXT, | |
105 | + DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER | |
106 | +#if defined(CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT) | |
107 | + | DRIVER_KMS_LEGACY_CONTEXT | |
108 | +#endif | |
109 | + , | |
110 | ||
111 | .load = nouveau_drm_load, | |
112 | .unload = nouveau_drm_unload, |