[RFCv2 00/10] Universal plane support

Matt Roper matthew.d.roper at intel.com
Fri Mar 7 16:03:12 PST 2014

One of the stepping stones on the way to atomic/nuclear operation is to expose
all types of hardware planes to userspace via a consistent interface.  Until
now, the DRM plane interface has only operated on planes that drivers consider
"overlay" or "sprite" planes; primary planes were simply represented by extra
state hanging off the CRTC, and cursor planes had no direct representation in
userspace, but were manipulated via separate ioctl's.  This patch set begins
the process of unifying the various plane types into a single, consistent

With this patchset, userspace clients that set a
DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit will receive a full list
of all hardware planes, including primary planes and cursor planes, not just
the overlay/sprite planes that have historically been returned.  Userspace
should be able to make drmModeSetPlane() calls against any type of plane and
have them operate as expected (to the extent supported by the underlying

This benefits of this unified interface will be most evident once driver state
is fully property-ized as part of the upcoming atomic modeset / nuclear
pageflip work.  However there are a few benefits that may be achieved even
before then:
 * Drivers for hardware with scaling-capable primary planes may honor userspace
   scaling requests for the primary plane made with the drmModeSetPlane() call.
   Previously there was no interface that allowed userspace to specify desired
   scaling on primary planes.
 * Drivers for hardware that may disable primary planes independently from
   the underlying CRTC may now do so when userspace passes a NULL framebuffer
   to the drmModeSetPlane() interface.

This patchset is organized as follows:
 - Patch 1 updates the DRM core with the general concept of multiple plane
   types and prepares for there to be multiple types of planes on the
   DRM plane list.

 - Patch 2 adds a set of primary plane helper functions that drivers may use
   to quickly support plane operations against primary planes.  These helpers
   implement plane update operations by calling into the driver's modeset
   interface.  These helpers are optional; drivers are free to provide their
   own implementation.

 - Patches 3 and 4 update loops over the DRM plane list in the exynos and i915
   drivers to ignore non-overlay planes.  This ensures that the behavior of
   these loops will not change when new plane types show up on the DRM plane
   list in future patches.
 - Patch 5 adds a "plane type" property that allows userspace to identify
   the types of the planes it receives.  Note that we replace the 'priv'
   parameter to drm_plane_init() with the type that should be used for
   this property; in doing so, we create the first opportunity for
   non-overlay planes to appear on the DRM plane list for some drivers (
   msm, omap, and imx), although they will not be visible to userspace at
   this time.

 - Patch 6 updates all drivers to call drm_primary_helper_create_plane() before
   CRTC creation and then pass the resulting plane to drm_crtc_init().  This
   will create a primary plane via the primary plane helper and add it to the
   DRM plane list.  Note that this is the first time that *all* drivers will
   have non-overlay planes on their plane list (msm, omap, and imx had their
   previously-private planes show up in the plane list in patch 5).
   These non-overlay planes still cannot be exposed to userspace.

 - Patch 7 drops the 'fb' field from drm_crtc and switches everything to
   using crtc->primary->fb instead.

 - Patch 8 adds the client capability bit which allows userspace to request
   the full plane list rather than just the overlay list.  This is the first
   patch that may have a userspace-visible effect.

 - Patch 9 is a simple function name update in i915 to avoid confusion.

 - Patch 10 replaces the primary plane helper usage in i915 with a custom
   implementation of primary planes.  On Intel hardware, we can disable the
   primary plane without disabling the entire CRTC; the custom implementation
   here allows us to avoid that limitation assumed by the helpers.

This patch set is still a work in progress.  Specific work that still needs to
be done:
 * Update msm, omap, and imx to properly associate their primary planes with
   the appropriate CRTC (and stop creating a separate dummy primary plane).  At
   the moment the formerly "private" planes that these drivers use are created
   as primary planes, but they're never specifically associated with the
   correct CRTC (i.e., passed at drm_crtc_init()).  I think this should be
   pretty straightforward, but I just haven't had enough time to look through
   how those drivers are structured yet to make the change.  [suggested by Rob

 * Add cursor plane implementation.  The general infrastructure necessary to
   support cursors is present, but no default helpers exist yet and no driver
   actually registers any cursor planes.

 * Add extra read-only plane properties to inform userspace of what a plane's
   true limitations and capabilities are.  Although the "plane type" property
   is probably enough to get by with something like a driver-specific DDX in
   userspace, hardware-independent userspace like Weston will need more
   information about what can and can't be done with each plane.  This is
   especially important for cursor planes since they can largely be viewed as
   additional overlay planes that just have some extra limitations attached.

 * Disallow usage of legacy cursor interfaces by clients that request universal
   plane support.  Make the new, unified interface the only interface for
   clients that can support it.  [suggested by Ville Syrjälä]

Matt Roper (10):
  drm: Add support for multiple plane types
  drm: Add primary plane helpers
  drm/exynos: Restrict plane loops to only operate on overlay planes
  drm/i915: Restrict plane loops to only operate on overlay planes
  drm: Add plane type property
  drm: Specify primary plane at CRTC initialization
  drm: Replace crtc fb with primary plane fb
  drm: Allow userspace to ask for full plane list (universal planes)
  drm/i915: Rename similar plane functions to avoid confusion
  drm/i915: Intel-specific primary plane handling

 drivers/gpu/drm/armada/armada_crtc.c        |   4 +-
 drivers/gpu/drm/armada/armada_overlay.c     |   3 +-
 drivers/gpu/drm/ast/ast_mode.c              |   4 +-
 drivers/gpu/drm/bochs/bochs_kms.c           |   4 +-
 drivers/gpu/drm/cirrus/cirrus_mode.c        |   4 +-
 drivers/gpu/drm/drm_crtc.c                  | 447 ++++++++++++++++++++++------
 drivers/gpu/drm/drm_crtc_helper.c           |  21 +-
 drivers/gpu/drm/drm_fb_helper.c             |   9 +-
 drivers/gpu/drm/drm_ioctl.c                 |   5 +
 drivers/gpu/drm/exynos/exynos_drm_crtc.c    |   4 +-
 drivers/gpu/drm/exynos/exynos_drm_encoder.c |   6 +
 drivers/gpu/drm/exynos/exynos_drm_plane.c   |   4 +-
 drivers/gpu/drm/gma500/psb_intel_display.c  |   4 +-
 drivers/gpu/drm/i915/i915_debugfs.c         |   4 +-
 drivers/gpu/drm/i915/i915_drv.h             |   5 +-
 drivers/gpu/drm/i915/i915_irq.c             |   4 +-
 drivers/gpu/drm/i915/intel_display.c        | 238 +++++++++++----
 drivers/gpu/drm/i915/intel_dp.c             |   5 +-
 drivers/gpu/drm/i915/intel_drv.h            |   1 +
 drivers/gpu/drm/i915/intel_overlay.c        |   4 +-
 drivers/gpu/drm/i915/intel_pm.c             |  39 +--
 drivers/gpu/drm/i915/intel_sprite.c         |   2 +-
 drivers/gpu/drm/mgag200/mgag200_mode.c      |   4 +-
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c    |   4 +-
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c   |   4 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c    |   4 +-
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c   |   3 +-
 drivers/gpu/drm/nouveau/dispnv04/crtc.c     |  24 +-
 drivers/gpu/drm/nouveau/dispnv04/dfp.c      |   2 +-
 drivers/gpu/drm/nouveau/dispnv04/overlay.c  |   4 +-
 drivers/gpu/drm/nouveau/nouveau_display.c   |   8 +-
 drivers/gpu/drm/nouveau/nv50_display.c      |  21 +-
 drivers/gpu/drm/omapdrm/omap_crtc.c         |   4 +-
 drivers/gpu/drm/omapdrm/omap_plane.c        |   4 +-
 drivers/gpu/drm/qxl/qxl_display.c           |   4 +-
 drivers/gpu/drm/radeon/atombios_crtc.c      |  20 +-
 drivers/gpu/drm/radeon/r100.c               |   4 +-
 drivers/gpu/drm/radeon/radeon_connectors.c  |   2 +-
 drivers/gpu/drm/radeon/radeon_device.c      |   3 +-
 drivers/gpu/drm/radeon/radeon_display.c     |   8 +-
 drivers/gpu/drm/radeon/radeon_legacy_crtc.c |  16 +-
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c      |   4 +-
 drivers/gpu/drm/rcar-du/rcar_du_plane.c     |   3 +-
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c   |   3 +-
 drivers/gpu/drm/shmobile/shmob_drm_plane.c  |   2 +-
 drivers/gpu/drm/tegra/dc.c                  |   7 +-
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c        |   4 +-
 drivers/gpu/drm/udl/udl_modeset.c           |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c         |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c        |   4 +-
 drivers/staging/imx-drm/imx-drm-core.c      |   4 +-
 drivers/staging/imx-drm/ipuv3-plane.c       |   4 +-
 include/drm/drmP.h                          |   5 +
 include/drm/drm_crtc.h                      | 108 ++++++-
 include/uapi/drm/drm.h                      |   8 +
 55 files changed, 853 insertions(+), 275 deletions(-)


More information about the dri-devel mailing list