i915 has a custom overlay IOCTL uAPI for display version 2-4, give or take a few platforms.
The implementation sits somewhere between i915 display and core (although the files are located under display). In order to properly separate display and core, a lot of refactoring would be required, splitting the functionality, defining better interfaces between them, and so on. The problem is, there are no IGT tests for the overlay IOCTLs, I915_OVERLAY_PUT_IMAGE and I915_OVERLAY_ATTRS, at all. And even if there were IGT tests, there seems to be only one PNV machine with overlay support left in CI, at this time. A significant refactoring without testing or CI support is bound to break something. In user space the functionality is, to the best of my knowledge, only supported by xf86-video-intel. There have been no updates to it in the past six years, and the last tag is from 10+ years ago. It's been at the end of the line for quite some time now. It's not really something people should be using. The question is, if we regressed the functionality, who is even going to notice, and when? Let's just drop the custom IOCTL support. The functionality is behind an I915_GETPARAM feature check, and the current IOCTLs expect the caller to respect that. Return 0 for the feature check, and -ENODEV for the IOCTLs, reusing and refactoring i915_gem_reject_pin_ioctl() as i915_enodev_ioctl() for the job. Cc: David Airlie <[email protected]> Cc: Simona Vetter <[email protected]> Cc: Ville Syrjälä <[email protected]> Signed-off-by: Jani Nikula <[email protected]> --- drivers/gpu/drm/i915/i915_driver.c | 13 +++++-------- drivers/gpu/drm/i915/i915_getparam.c | 4 +--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index c01a35ecfa2f..da8f0210cc46 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -65,7 +65,6 @@ #include "display/intel_gmbus.h" #include "display/intel_hotplug.h" #include "display/intel_opregion.h" -#include "display/intel_overlay.h" #include "display/intel_pch_refclk.h" #include "display/intel_pps.h" #include "display/intel_sbi.h" @@ -1772,9 +1771,7 @@ static const struct file_operations i915_driver_fops = { .fop_flags = FOP_UNSIGNED_OFFSET, }; -static int -i915_gem_reject_pin_ioctl(struct drm_device *dev, void *data, - struct drm_file *file) +static int i915_enodev_ioctl(struct drm_device *dev, void *data, struct drm_file *file) { return -ENODEV; } @@ -1800,8 +1797,8 @@ static const struct drm_ioctl_desc i915_ioctls[] = { DRM_IOCTL_DEF_DRV(I915_GEM_INIT, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), DRM_IOCTL_DEF_DRV(I915_GEM_EXECBUFFER, drm_invalid_op, DRM_AUTH), DRM_IOCTL_DEF_DRV(I915_GEM_EXECBUFFER2_WR, i915_gem_execbuffer2_ioctl, DRM_RENDER_ALLOW), - DRM_IOCTL_DEF_DRV(I915_GEM_PIN, i915_gem_reject_pin_ioctl, DRM_AUTH|DRM_ROOT_ONLY), - DRM_IOCTL_DEF_DRV(I915_GEM_UNPIN, i915_gem_reject_pin_ioctl, DRM_AUTH|DRM_ROOT_ONLY), + DRM_IOCTL_DEF_DRV(I915_GEM_PIN, i915_enodev_ioctl, DRM_AUTH|DRM_ROOT_ONLY), + DRM_IOCTL_DEF_DRV(I915_GEM_UNPIN, i915_enodev_ioctl, DRM_AUTH|DRM_ROOT_ONLY), DRM_IOCTL_DEF_DRV(I915_GEM_BUSY, i915_gem_busy_ioctl, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(I915_GEM_SET_CACHING, i915_gem_set_caching_ioctl, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(I915_GEM_GET_CACHING, i915_gem_get_caching_ioctl, DRM_RENDER_ALLOW), @@ -1821,8 +1818,8 @@ static const struct drm_ioctl_desc i915_ioctls[] = { DRM_IOCTL_DEF_DRV(I915_GEM_GET_APERTURE, i915_gem_get_aperture_ioctl, DRM_RENDER_ALLOW), DRM_IOCTL_DEF_DRV(I915_GET_PIPE_FROM_CRTC_ID, intel_crtc_get_pipe_from_crtc_id_ioctl, 0), DRM_IOCTL_DEF_DRV(I915_GEM_MADVISE, i915_gem_madvise_ioctl, DRM_RENDER_ALLOW), - DRM_IOCTL_DEF_DRV(I915_OVERLAY_PUT_IMAGE, intel_overlay_put_image_ioctl, DRM_MASTER), - DRM_IOCTL_DEF_DRV(I915_OVERLAY_ATTRS, intel_overlay_attrs_ioctl, DRM_MASTER), + DRM_IOCTL_DEF_DRV(I915_OVERLAY_PUT_IMAGE, i915_enodev_ioctl, DRM_MASTER), + DRM_IOCTL_DEF_DRV(I915_OVERLAY_ATTRS, i915_enodev_ioctl, DRM_MASTER), DRM_IOCTL_DEF_DRV(I915_SET_SPRITE_COLORKEY, intel_sprite_set_colorkey_ioctl, DRM_MASTER), DRM_IOCTL_DEF_DRV(I915_GET_SPRITE_COLORKEY, drm_noop, DRM_MASTER), DRM_IOCTL_DEF_DRV(I915_GEM_WAIT, i915_gem_wait_ioctl, DRM_RENDER_ALLOW), diff --git a/drivers/gpu/drm/i915/i915_getparam.c b/drivers/gpu/drm/i915/i915_getparam.c index cf47c2491a0a..cdf8ad4b6f3a 100644 --- a/drivers/gpu/drm/i915/i915_getparam.c +++ b/drivers/gpu/drm/i915/i915_getparam.c @@ -4,7 +4,6 @@ #include <drm/drm_print.h> -#include "display/intel_overlay.h" #include "gem/i915_gem_mman.h" #include "gt/intel_engine_user.h" #include "pxp/intel_pxp.h" @@ -18,7 +17,6 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_i915_private *i915 = to_i915(dev); - struct intel_display *display = i915->display; struct pci_dev *pdev = to_pci_dev(dev->dev); const struct sseu_dev_info *sseu = &to_gt(i915)->info.sseu; drm_i915_getparam_t *param = data; @@ -41,7 +39,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data, value = to_gt(i915)->ggtt->num_fences; break; case I915_PARAM_HAS_OVERLAY: - value = intel_overlay_available(display); + value = 0; break; case I915_PARAM_HAS_BSD: value = !!intel_engine_lookup_user(i915, -- 2.47.3
