Hi all,
Spurred by Ian's abuse of drmAgpSize I've figued it's time we accelerate the demisse of the fake agp stuff and our ums code a bit. The idea is to send out the same probe the radone guys have done and deprecate legacy stuff for now. Then (presuming we don't get any reports from hurt users) we can rip the code out after a few releases.
In both cases (killing fake agp and killing ums) we can just keep doing what we've done thus far as contingency. But for ums I expect that we need to copy-paste the driver long term to stay sane. Just removing it is obviously easier ;-)
Cheers, Daniel
Daniel Vetter (3): drm/i915: Make AGP=n work even on gen3 drm/i915: Kill legeacy AGP for gen3 kms drm/i915: Deprecated UMS support
drivers/gpu/drm/i915/Kconfig | 24 +++++++++++++++++++----- drivers/gpu/drm/i915/i915_drv.c | 14 ++------------ 2 files changed, 21 insertions(+), 17 deletions(-)
Most platforms din't hit this condition, but if we want to allow building without agp we should also make this allowed on gen3.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch --- drivers/gpu/drm/i915/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 38a344694e35..d7c922051c89 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -158,7 +158,7 @@ static struct drm_driver driver; #if IS_ENABLED(CONFIG_AGP_INTEL) extern int intel_agp_enabled; #else -static int intel_agp_enabled; +static int intel_agp_enabled = 1; #endif
static const struct intel_device_info intel_i830_info = {
On Mon, Nov 11, 2013 at 09:35:17AM +0100, Daniel Vetter wrote:
Most platforms din't hit this condition, but if we want to allow building without agp we should also make this allowed on gen3.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 38a344694e35..d7c922051c89 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -158,7 +158,7 @@ static struct drm_driver driver; #if IS_ENABLED(CONFIG_AGP_INTEL) extern int intel_agp_enabled; #else -static int intel_agp_enabled; +static int intel_agp_enabled = 1;
Patch 2/3 eliminates our only use of intel_agp_enabled, so this patch seems pointless.
#endif
static const struct intel_device_info intel_i830_info = {
1.8.4.rc3
On Wed, Nov 13, 2013 at 08:59:56PM +0200, Ville Syrjälä wrote:
On Mon, Nov 11, 2013 at 09:35:17AM +0100, Daniel Vetter wrote:
Most platforms din't hit this condition, but if we want to allow building without agp we should also make this allowed on gen3.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 38a344694e35..d7c922051c89 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -158,7 +158,7 @@ static struct drm_driver driver; #if IS_ENABLED(CONFIG_AGP_INTEL) extern int intel_agp_enabled; #else -static int intel_agp_enabled; +static int intel_agp_enabled = 1;
Patch 2/3 eliminates our only use of intel_agp_enabled, so this patch seems pointless.
Patch 2 has a good chance to get reverted, so having this separate isn't completely pointless. Should have mentioned this in the cover letter ;-) -Daniel
On Wed, Nov 13, 2013 at 09:21:44PM +0100, Daniel Vetter wrote:
On Wed, Nov 13, 2013 at 08:59:56PM +0200, Ville Syrjälä wrote:
On Mon, Nov 11, 2013 at 09:35:17AM +0100, Daniel Vetter wrote:
Most platforms din't hit this condition, but if we want to allow building without agp we should also make this allowed on gen3.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 38a344694e35..d7c922051c89 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -158,7 +158,7 @@ static struct drm_driver driver; #if IS_ENABLED(CONFIG_AGP_INTEL) extern int intel_agp_enabled; #else -static int intel_agp_enabled; +static int intel_agp_enabled = 1;
Patch 2/3 eliminates our only use of intel_agp_enabled, so this patch seems pointless.
Patch 2 has a good chance to get reverted, so having this separate isn't completely pointless. Should have mentioned this in the cover letter ;-)
OK, makes sense.
Reviewed-by: Ville Syrjälä ville.syrjala@linux.intel.com
On Thu, Nov 14, 2013 at 01:24:57AM +0200, Ville Syrjälä wrote:
On Wed, Nov 13, 2013 at 09:21:44PM +0100, Daniel Vetter wrote:
On Wed, Nov 13, 2013 at 08:59:56PM +0200, Ville Syrjälä wrote:
On Mon, Nov 11, 2013 at 09:35:17AM +0100, Daniel Vetter wrote:
Most platforms din't hit this condition, but if we want to allow building without agp we should also make this allowed on gen3.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 38a344694e35..d7c922051c89 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -158,7 +158,7 @@ static struct drm_driver driver; #if IS_ENABLED(CONFIG_AGP_INTEL) extern int intel_agp_enabled; #else -static int intel_agp_enabled; +static int intel_agp_enabled = 1;
Patch 2/3 eliminates our only use of intel_agp_enabled, so this patch seems pointless.
Patch 2 has a good chance to get reverted, so having this separate isn't completely pointless. Should have mentioned this in the cover letter ;-)
OK, makes sense.
Reviewed-by: Ville Syrjälä ville.syrjala@linux.intel.com
Ok, I've pulled them all in (with Dave's irc-ack for 2&3), thanks for the review. -Daniel
Thus far we've tried to carefully work around the fact that old userspace relied on the AGP-backed legacy buffer mapping ioctls for a bit too long. But it's really horribly, and now some new users for it started to show up again:
http://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg45547.html
This uses drmAgpSize to figure out the GTT size, which is both the wrong thing to inquire and also might force us to keep this crap around for another few years.
So I want to stop this particular zombie from raising ever again. Now it's only been 4 years since XvMC was fixed for gen3, so a bit early by the usual rules. But since Linus explicitly said that an ABI breakage only counts if someone actually observes it I want to tempt fate an accelarate the demise of AGP.
We probably need to wait 2-3 kernel releases with this shipping until we go on a killing spree code-wise.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Dave Airlie airlied@gmail.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch --- drivers/gpu/drm/i915/i915_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index d7c922051c89..93a8e0316bd0 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -797,17 +797,7 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (PCI_FUNC(pdev->devfn)) return -ENODEV;
- /* We've managed to ship a kms-enabled ddx that shipped with an XvMC - * implementation for gen3 (and only gen3) that used legacy drm maps - * (gasp!) to share buffers between X and the client. Hence we need to - * keep around the fake agp stuff for gen3, even when kms is enabled. */ - if (intel_info->gen != 3) { - driver.driver_features &= - ~(DRIVER_USE_AGP | DRIVER_REQUIRE_AGP); - } else if (!intel_agp_enabled) { - DRM_ERROR("drm/i915 can't work without intel_agp module!\n"); - return -ENODEV; - } + driver.driver_features &= ~(DRIVER_USE_AGP | DRIVER_REQUIRE_AGP);
return drm_get_pci_dev(pdev, ent, &driver); }
On Mon, Nov 11, 2013 at 09:35:18AM +0100, Daniel Vetter wrote:
Thus far we've tried to carefully work around the fact that old userspace relied on the AGP-backed legacy buffer mapping ioctls for a bit too long. But it's really horribly, and now some new users for it started to show up again:
http://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg45547.html
This uses drmAgpSize to figure out the GTT size, which is both the wrong thing to inquire and also might force us to keep this crap around for another few years.
So I want to stop this particular zombie from raising ever again. Now it's only been 4 years since XvMC was fixed for gen3, so a bit early by the usual rules. But since Linus explicitly said that an ABI breakage only counts if someone actually observes it I want to tempt fate an accelarate the demise of AGP.
We probably need to wait 2-3 kernel releases with this shipping until we go on a killing spree code-wise.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Dave Airlie airlied@gmail.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/i915_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index d7c922051c89..93a8e0316bd0 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -797,17 +797,7 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (PCI_FUNC(pdev->devfn)) return -ENODEV;
- /* We've managed to ship a kms-enabled ddx that shipped with an XvMC
* implementation for gen3 (and only gen3) that used legacy drm maps
* (gasp!) to share buffers between X and the client. Hence we need to
* keep around the fake agp stuff for gen3, even when kms is enabled. */
- if (intel_info->gen != 3) {
driver.driver_features &=
~(DRIVER_USE_AGP | DRIVER_REQUIRE_AGP);
- } else if (!intel_agp_enabled) {
DRM_ERROR("drm/i915 can't work without intel_agp module!\n");
return -ENODEV;
- }
- driver.driver_features &= ~(DRIVER_USE_AGP | DRIVER_REQUIRE_AGP);
Nothing else uses intel_agp_enabled, so it could be killed entirely.
return drm_get_pci_dev(pdev, ent, &driver); } -- 1.8.4.rc3
It's been 5 years since kms support was merged and roughly 4 years since UMS support was ripped out from userspace drivers.
Thus far it's not been a big burden to keep the ums paths alive, and we've made some good progress in better separating it from the kms code by sprinkling DRIVER_MODESET checks all over the place.
But now that the drm demidlayering is within reach this changes. I want to make the driver loading code more robust using devres.c and other cool tricks. But that doesn't work with ums due to the shadow-attach trick. Which means we either a) need to split out a complete ums codebase like radeon has b) kill it for good.
The 2nd option is obviously much less work than the first, so I think it's time to test the waters and see how many people out there still use ums.
I've decided that silently failing to initialize the driver (and not e.g. failing to load the module) is the right thing. That way we should only get reports from users that actually care about some ums features (like accelerated gl or support for secondary outputs). Everyone else will just fall back to the vesa X driver.
For developers there's a small info level dmesg output.
The plan is to drop this Kconfig option after 3.16 (so gives us 2 full releases) and then start killing code for real 2-3 releases afterwards. That should be more than enough time for users to pipe up.
Of course if anyone does we need to revisit this plan and maybe go with option a) above.
Also enable the KMS support by default in Kconfig and polish the help texts a bit.
Cc: Dave Airlie airlied@gmail.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch --- drivers/gpu/drm/i915/Kconfig | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index b0f61679c598..b0fa4c4055ee 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -37,12 +37,11 @@ config DRM_I915 config DRM_I915_KMS bool "Enable modesetting on intel by default" depends on DRM_I915 + default y help - Choose this option if you want kernel modesetting enabled by default, - and you have a new enough userspace to support this. Running old - userspaces with this enabled will cause pain. Note that this causes - the driver to bind to PCI devices, which precludes loading things - like intelfb. + Choose this option if you want kernel modesetting enabled by default. + + If in doubt, say "Y".
config DRM_I915_FBDEV bool "Enable legacy fbdev support for the modesettting intel driver" @@ -57,9 +56,12 @@ config DRM_I915_FBDEV support. Note that this support also provide the linux console support on top of the intel modesetting driver.
+ If in doubt, say "Y". + config DRM_I915_PRELIMINARY_HW_SUPPORT bool "Enable preliminary support for prerelease Intel hardware by default" depends on DRM_I915 + default n help Choose this option if you have prerelease Intel hardware and want the i915 driver to support it by default. You can enable such support at @@ -67,3 +69,15 @@ config DRM_I915_PRELIMINARY_HW_SUPPORT option changes the default for that module option.
If in doubt, say "N". + +config DRM_I915_UMS + bool "Enable userspace modesetting on Intel hardware (DEPRECATED)" + depends on DRM_I915 + default n + help + Choose this option if you still need userspace modesetting. + + Userspace modesetting is deprecated for quite some time now, so + enable this only if you have ancient versions of the DDX drivers. + + If in doubt, say "N".
On Mon, Nov 11, 2013 at 09:35:19AM +0100, Daniel Vetter wrote:
It's been 5 years since kms support was merged and roughly 4 years since UMS support was ripped out from userspace drivers.
Thus far it's not been a big burden to keep the ums paths alive, and we've made some good progress in better separating it from the kms code by sprinkling DRIVER_MODESET checks all over the place.
But now that the drm demidlayering is within reach this changes. I want to make the driver loading code more robust using devres.c and other cool tricks. But that doesn't work with ums due to the shadow-attach trick. Which means we either a) need to split out a complete ums codebase like radeon has b) kill it for good.
The 2nd option is obviously much less work than the first, so I think it's time to test the waters and see how many people out there still use ums.
I've decided that silently failing to initialize the driver (and not e.g. failing to load the module) is the right thing. That way we should only get reports from users that actually care about some ums features (like accelerated gl or support for secondary outputs). Everyone else will just fall back to the vesa X driver.
For developers there's a small info level dmesg output.
The plan is to drop this Kconfig option after 3.16 (so gives us 2 full releases) and then start killing code for real 2-3 releases afterwards. That should be more than enough time for users to pipe up.
Of course if anyone does we need to revisit this plan and maybe go with option a) above.
Also enable the KMS support by default in Kconfig and polish the help texts a bit.
Cc: Dave Airlie airlied@gmail.com Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/Kconfig | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index b0f61679c598..b0fa4c4055ee 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -37,12 +37,11 @@ config DRM_I915 config DRM_I915_KMS bool "Enable modesetting on intel by default" depends on DRM_I915
- default y help
Choose this option if you want kernel modesetting enabled by default,
and you have a new enough userspace to support this. Running old
userspaces with this enabled will cause pain. Note that this causes
the driver to bind to PCI devices, which precludes loading things
like intelfb.
Choose this option if you want kernel modesetting enabled by default.
If in doubt, say "Y".
config DRM_I915_FBDEV bool "Enable legacy fbdev support for the modesettting intel driver" @@ -57,9 +56,12 @@ config DRM_I915_FBDEV support. Note that this support also provide the linux console support on top of the intel modesetting driver.
If in doubt, say "Y".
config DRM_I915_PRELIMINARY_HW_SUPPORT bool "Enable preliminary support for prerelease Intel hardware by default" depends on DRM_I915
- default n help Choose this option if you have prerelease Intel hardware and want the i915 driver to support it by default. You can enable such support at
@@ -67,3 +69,15 @@ config DRM_I915_PRELIMINARY_HW_SUPPORT option changes the default for that module option.
If in doubt, say "N".
+config DRM_I915_UMS
Was there supposed to be some user for this config option?
- bool "Enable userspace modesetting on Intel hardware (DEPRECATED)"
- depends on DRM_I915
- default n
- help
Choose this option if you still need userspace modesetting.
Userspace modesetting is deprecated for quite some time now, so
enable this only if you have ancient versions of the DDX drivers.
If in doubt, say "N".
-- 1.8.4.rc3
Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx
dri-devel@lists.freedesktop.org