Re: [RFC 00/12] Support render-node only drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 21, 2014 at 08:55:16AM +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@xxxxxxxxxx>
> 
> This series builds on top of David's reliable DRM minor series:
> 
> 	[PATCH 00/13] DRM Reliable Minor-IDs
> 
> Tegra K1 has a Kepler-type GPU without any display engine. Instead it
> reuses the Tegra display engine. That means that effectively the GPU
> becomes a render-node only device. In order to reflect that, it would
> be preferable for the associated /dev/dri/cardX node not to show up.

Why would it be preferable exactly?

- There's not really a security risk if we have it around as long as you
  sufficiently lock down access rights to it.

- Older userspace would still need the legacy node for e.g. X prime
  support using just dri2.

i915 (and iirc also radeon) can run on hw without any outputs, and simply
not registering any crtcs or other modeset objects is all that's needed
really. Of course userspace could still create kms framebuffer objects,
but those don't really hurt anyone.

> To achieve that, the DRIVER_MODESET feature needs to be removed from
> the GPU driver, but that unfortunately implies activating a bunch of
> legacy behaviour for pre-KMS drivers. To allow for drivers that don't
> support modesetting IOCTLs (because they drive no output) but which
> aren't legacy either, the meaning of the DRIVER_MODESET needs to be
> redefined.
> 
> This series attempts to do so by first renaming DRM_MINOR_LEGACY to
> DRM_MINOR_PRIMARY to more accurately reflect its purpose. Legacy and
> modesetting are then decoupled by introducing a DRIVER_LEGACY driver
> feature that can be set by truly legacy drivers. This allows the old
> DRIVER_MODESET feature to advertise support only for modesetting
> functionality, without implying that it is a non-legacy driver.

I haven't done a full review but the crux with a catch-all DRIVER_LEGACY
is that there's shocking amounts of userspace out there which require a
shocking mix of modeset ioctls and legacy ioctls. At least I've burned my
fingers a few times already trying to sort this stuff out and patches had
to be reverted ...

Cheers, Daniel

> After all the drivers have been updated, the core can be modified to
> create the primary minor only when DRIVER_MODESET is available.
> 
> The remainder of the series cleans up some drm_core_check_feature()
> usage and drop some unused code related to that.
> 
> Thierry
> 
> Thierry Reding (12):
>   drm: Rename DRM_MINOR_LEGACY to DRM_MINOR_PRIMARY
>   drm: Introduce DRIVER_LEGACY feature
>   drm/i915: Mark as legacy if KMS is disabled
>   drm: Separate DRIVER_MODESET and DRIVER_LEGACY
>   drm: Create primary minor only if mode-setting is supported
>   drm: Remove gratuituous blank line
>   drm: Use drm_core_check_feature() where possible
>   drm/exynos: Remove dead code
>   drm/gma500: Remove dead code
>   drm/i810: Remove dead code
>   drm/i915: Remove dead code
>   drm/qxl: Remove dead code
> 
>  drivers/gpu/drm/drm_bufs.c              | 12 +++++------
>  drivers/gpu/drm/drm_crtc.c              |  1 -
>  drivers/gpu/drm/drm_dma.c               |  4 ++--
>  drivers/gpu/drm/drm_fops.c              | 14 ++++++------
>  drivers/gpu/drm/drm_gem.c               |  6 +++---
>  drivers/gpu/drm/drm_irq.c               | 12 +++++------
>  drivers/gpu/drm/drm_pci.c               | 12 +++++------
>  drivers/gpu/drm/drm_scatter.c           |  6 +++---
>  drivers/gpu/drm/drm_stub.c              | 24 +++++++++++----------
>  drivers/gpu/drm/drm_sysfs.c             |  8 +++----
>  drivers/gpu/drm/exynos/exynos_drm_gem.c | 10 ---------
>  drivers/gpu/drm/gma500/gem.c            |  3 ---
>  drivers/gpu/drm/i810/i810_dma.c         |  7 ------
>  drivers/gpu/drm/i810/i810_drv.c         |  3 ++-
>  drivers/gpu/drm/i915/i915_dma.c         | 38 ++++++++++++++++-----------------
>  drivers/gpu/drm/i915/i915_drv.c         | 18 ++++++++++------
>  drivers/gpu/drm/i915/i915_gem.c         | 17 +++++++--------
>  drivers/gpu/drm/i915/i915_gem_context.c |  6 ------
>  drivers/gpu/drm/i915/i915_irq.c         |  6 +++---
>  drivers/gpu/drm/i915/i915_suspend.c     | 15 ++++++-------
>  drivers/gpu/drm/i915/intel_ringbuffer.c |  2 +-
>  drivers/gpu/drm/mga/mga_drv.c           |  3 ++-
>  drivers/gpu/drm/qxl/qxl_kms.c           |  4 ----
>  drivers/gpu/drm/radeon/radeon_drv.c     |  3 ++-
>  drivers/gpu/drm/savage/savage_drv.c     |  2 +-
>  drivers/gpu/drm/sis/sis_drv.c           |  2 +-
>  drivers/gpu/drm/tdfx/tdfx_drv.c         |  1 +
>  drivers/gpu/drm/via/via_drv.c           |  2 +-
>  include/drm/drmP.h                      |  3 ++-
>  29 files changed, 112 insertions(+), 132 deletions(-)
> 
> -- 
> 1.8.4.2
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux