1. 01 Nov, 2017 1 commit
    • Arnd Bergmann's avatar
      drm/msm: use %z format modifier for printing size_t · 39ae0d3e
      Arnd Bergmann authored
      The return type of ARRAY_SIZE() is size_t, so we have to use
      %zu instead of %lu to avoid this warning:
      
      drivers/gpu/drm/msm/msm_gpu.c: In function 'msm_gpu_init':
      drivers/gpu/drm/msm/msm_gpu.c:742:31: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'unsigned int' [-Werror=format=]
      
      The warning it otherwise harmless as size_t is always the
      same size as unsigned long in all supported architectures,
      but gcc doesn't know that.
      
      Fixes: c2fceabca6d5 ("drm/msm: Support multiple ringbuffers")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      39ae0d3e
  2. 28 Oct, 2017 37 commits
  3. 25 Oct, 2017 2 commits
    • Keith Packard's avatar
      drm: Add four ioctls for managing drm mode object leases [v7] · 62884cd3
      Keith Packard authored
      drm_mode_create_lease
      
      	Creates a lease for a list of drm mode objects, returning an
      	fd for the new drm_master and a 64-bit identifier for the lessee
      
      drm_mode_list_lesees
      
      	List the identifiers of the lessees for a master file
      
      drm_mode_get_lease
      
      	List the leased objects for a master file
      
      drm_mode_revoke_lease
      
      	Erase the set of objects managed by a lease.
      
      This should suffice to at least create and query leases.
      
      Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:
      
       * query ioctls only query the master associated with
         the provided file.
      
       * 'mask_lease' value has been removed
      
       * change ioctl has been removed.
      
      Changes for v3 suggested in part by Dave Airlie <airlied@gmail.com>
      
       * Add revoke ioctl.
      
      Changes for v4 suggested by Dave Airlie <airlied@gmail.com>
      
       * Expand on the comment about the magic use of &drm_lease_idr_object
       * Pad lease ioctl structures to align on 64-bit boundaries
      
      Changes for v5 suggested by Dave Airlie <airlied@gmail.com>
      
       * Check for non-negative object_id in create_lease to avoid debug
         output from the kernel.
      
      Changes for v6 provided by Dave Airlie <airlied@gmail.com>
      
       * For non-universal planes add primary/cursor planes to lease
      
         If we aren't exposing universal planes to this userspace client,
         and it requests a lease on a crtc, we should implicitly export the
         primary and cursor planes for the crtc.
      
         If the lessee doesn't request universal planes, it will just see
         the crtc, but if it does request them it will then see the plane
         objects as well.
      
         This also moves the object look ups earlier as a side effect, so
         we'd exit the ioctl quicker for non-existant objects.
      
       * Restrict leases to crtc/connector/planes.
      
         This only allows leasing for objects we wish to allow.
      
      Changes for v7 provided by Dave Airlie <airlied@gmail.com>
      
       * Check pad args are 0
       * Check create flags and object count are valid.
       * Check return from fd allocation
       * Refactor lease idr setup and add some simple validation
       * Use idr_mutex uniformly (Keith)
      Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      62884cd3
    • Keith Packard's avatar
      drm: Check mode object lease status in all master ioctl paths [v4] · 7de440db
      Keith Packard authored
      Attempts to modify un-leased objects are rejected with an error.
      Information returned about unleased objects is modified to make them
      appear unusable and/or disconnected.
      
      Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:
      
       * With the change in the __drm_mode_object_find API to pass the
         file_priv along, we can now centralize most of the lease-based
         access checks in that function.
      
       * A few places skip that API and require in-line checks.
      
      Changes for v3 provided by Dave Airlie <airlied@redhat.com>
      
       * remove support for leasing encoders.
       * add support for leasing planes.
      
      Changes for v4
      
       * Only call drm_lease_held if DRIVER_MODESET.
      Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      7de440db