1. 12 7月, 2014 2 次提交
  2. 13 6月, 2014 2 次提交
    • M
      drm: Allow drivers to register cursor planes with crtc · fc1d3e44
      Matt Roper 提交于
      Universal plane support had placeholders for cursor planes, but didn't
      actually do anything with them.  Save the cursor plane reference inside
      the crtc and update the cursor plane parameter from void* to drm_plane.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: Pallavi G<pallavi.g@intel.com>
      Acked-by: NDave Airlie <airlied@linux.ie>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fc1d3e44
    • M
      drm: Support legacy cursor ioctls via universal planes when possible (v4) · 161d0dc1
      Matt Roper 提交于
      If drivers support universal planes and have registered a cursor plane
      with the DRM core, we should use that universal plane support when
      handling legacy cursor ioctls.  Drivers that transition to universal
      planes won't have to maintain separate legacy ioctl handling; drivers
      that don't transition to universal planes will continue to operate
      without any change to behavior.
      
      Note that there's a bit of a mismatch between the legacy cursor ioctls
      and the universal plane API's --- legacy ioctl's use driver buffer
      handles directly whereas the universal plane API takes drm_framebuffers.
      Since there's no way to recover the driver handle from a
      drm_framebuffer, we can implement legacy ioctl's in terms of universal
      plane interfaces, but cannot implement universal plane interfaces in
      terms of legacy ioctls.  Specifically, there's no way to create a
      general cursor helper in the way we previously created a primary plane
      helper.
      
      It's important to land this patch before any patches that add universal
      cursor support to individual drivers so that drivers don't have to worry
      about juggling two different styles of reference counting for cursor
      buffers when userspace mixes and matches legacy and universal cursor
      calls.  With this patch, a driver that switches to universal cursor
      support may assume that all cursor buffers are wrapped in a
      drm_framebuffer and can rely on framebuffer reference counting for all
      cursor operations.
      
      v4:
       - Add comments pointing out setplane_internal's reference-eating
         semantics.
      v3:
       - Drop drm_mode_rmfb() call that is no longer needed now that we're
         using setplane_internal(), which takes care of deref'ing the
         appropriate framebuffer.
      v2:
       - Use new add_framebuffer_internal() function to create framebuffer
         rather than trying to call directly into the ioctl interface and
         look up the handle returned.
       - Use new setplane_internal() function to update the cursor plane
         rather than calling through the ioctl interface.  Note that since
         we're no longer looking up an fb_id, no extra reference will be
         taken here.
       - Grab extra reference to fb under lock in !BO case to avoid issues
         where racing userspace could cause the fb to be destroyed out from
         under us after we grab the fb pointer.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: Pallavi G<pallavi.g@intel.com>
      Acked-by: NDave Airlie <airlied@linux.ie>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      161d0dc1
  3. 10 6月, 2014 1 次提交
  4. 05 6月, 2014 1 次提交
    • R
      drm: convert crtc and connection_mutex to ww_mutex (v5) · 51fd371b
      Rob Clark 提交于
      For atomic, it will be quite necessary to not need to care so much
      about locking order.  And 'state' gives us a convenient place to stash a
      ww_ctx for any sort of update that needs to grab multiple crtc locks.
      
      Because we will want to eventually make locking even more fine grained
      (giving locks to planes, connectors, etc), split out drm_modeset_lock
      and drm_modeset_acquire_ctx to track acquired locks.
      
      Atomic will use this to keep track of which locks have been acquired
      in a transaction.
      
      v1: original
      v2: remove a few things not needed until atomic, for now
      v3: update for v3 of connection_mutex patch..
      v4: squash in docbook
      v5: doc tweaks/fixes
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      51fd371b
  5. 04 6月, 2014 6 次提交
    • D
      drm: Split connection_mutex out of mode_config.mutex (v3) · 6e9f798d
      Daniel Vetter 提交于
      After the split-out of crtc locks from the big mode_config.mutex
      there's still two major areas it protects:
      - Various connector probe states, like connector->status, EDID
        properties, probed mode lists and similar information.
      - The links from connector->encoder and encoder->crtc and other
        modeset-relevant connector state (e.g. properties which control the
        panel fitter).
      
      The later is used by modeset operations. But they don't really care
      about the former since it's allowed to e.g. enable a disconnected VGA
      output or with a mode not in the probed list.
      
      Thus far this hasn't been a problem, but for the atomic modeset
      conversion Rob Clark needs to convert all modeset relevant locks into
      w/w locks. This is required because the order of acquisition is
      determined by how userspace supplies the atomic modeset data. This has
      run into troubles in the detect path since the i915 load detect code
      needs _both_ protections offered by the mode_config.mutex: It updates
      probe state and it needs to change the modeset configuration to enable
      the temporary load detect pipe.
      
      The big deal here is that for the probe/detect users of this lock a
      plain mutex fits best, but for atomic modesets we really want a w/w
      mutex. To fix this lets split out a new connection_mutex lock for the
      modeset relevant parts.
      
      For simplicity I've decided to only add one additional lock for all
      connector/encoder links and modeset configuration states. We have
      piles of different modeset objects in addition to those (like bridges
      or panels), so adding per-object locks would be much more effort.
      
      Also, we're guaranteed (at least for now) to do a full modeset if we
      need to acquire this lock. Which means that fine-grained locking is
      fairly irrelevant compared to the amount of time the full modeset will
      take.
      
      I've done a full audit, and there's just a few things that justify
      special focus:
      - Locking in drm_sysfs.c is almost completely absent. We should
        sprinkle mode_config.connection_mutex over this file a bit, but
        since it already lacks mode_config.mutex this patch wont make the
        situation any worse. This is material for a follow-up patch.
      
      - omap has a omap_framebuffer_flush function which walks the
        connector->encoder->crtc links and is called from many contexts.
        Some look like they don't acquire mode_config.mutex, so this is
        already racy. Again fixing this is material for a separate patch.
      
      - The radeon hot_plug function to retrain DP links looks at
        connector->dpms. Currently this happens without any locking, so is
        already racy. I think radeon_hotplug_work_func should gain
        mutex_lock/unlock calls for the mode_config.connection_mutex.
      
      - Same applies to i915's intel_dp_hot_plug. But again, this is already
        racy.
      
      - i915 load_detect code needs to acquire this lock. Which means the
        w/w dance due to Rob's work will be nicely contained to _just_ this
        function.
      
      I've added fixme comments everywhere where it looks suspicious but in
      the sysfs code. After a quick irc discussion with Dave Airlie it
      sounds like the lack of locking in there is due to sysfs cleanup fun
      at module unload.
      
      v1: original (only compile tested)
      
      v2: missing mutex_init(), etc (from Rob Clark)
      
      v3: i915 needs more care in the conversion:
      - Protect the edp pp logic with the connection_mutex.
      - Use connection_mutex in the backlight code due to
        get_pipe_from_connector.
      - Use drm_modeset_lock_all in suspend/resume paths.
      - Update lock checks in the overlay code.
      
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      6e9f798d
    • R
      drm: add signed-range property type · ebc44cf3
      Rob Clark 提交于
      Like range, but values are signed.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      ebc44cf3
    • R
      drm: add object property type · 98f75de4
      Rob Clark 提交于
      An object property is an id (idr) for a drm mode object.  This
      will allow a property to be used set/get a framebuffer, CRTC, etc.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      98f75de4
    • R
      drm: add extended property types · 5ea22f24
      Rob Clark 提交于
      If we continue to use bitmask for type, we will quickly run out of room
      to add new types.  Split this up so existing part of bitmask range
      continues to function as before, but reserve a chunk of the remaining
      space for an integer type-id.  Wrap this all up in some type-check
      helpers to keep the backwards-compat uglyness contained.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5ea22f24
    • R
      drm: helpers to find mode objects · a2b34e22
      Rob Clark 提交于
      Add a few more useful helpers to find mode objects.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a2b34e22
    • J
      drm: drop drm_get_connector_name() and drm_get_encoder_name() · d5ab2b43
      Jani Nikula 提交于
      No longer used or needed as the structs have a name field.
      Acked-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      d5ab2b43
  6. 30 5月, 2014 2 次提交
  7. 16 5月, 2014 1 次提交
  8. 22 4月, 2014 1 次提交
    • V
      drm/edid: Fill PAR in AVI infoframe based on CEA mode list · 0967e6a5
      Vandana Kannan 提交于
      Populate PAR in infoframe structure. If there is a user setting for PAR, then
      that value is set. Else, value is taken from CEA mode list if VIC is found.
      Else, PAR is calculated from resolution. If none of these conditions are
      satisfied, PAR is NONE as per initialization.
      
      v2: Removed the part which sets PAR according to user input, based on
      Daniel's review comments.
      
      A separate patch will be submitted to create a property that would enable a
      user space app to set aspect ratio for AVI infoframe.
      
      v2: Removed the part which sets PAR according to user input, based on
      Daniel's review comments.
      
      v3: Removed calculation of PAR for non-CEA modes as per discussion with
      Ville.
      
      A separate patch will be submitted to create a property that would enable a
      user space app to set aspect ratio for AVI infoframe.
      Signed-off-by: NVandana Kannan <vandana.kannan@intel.com>
      Cc: Jesse Barnes <jesse.barnes@intel.com>
      Cc: Vijay Purushothaman <vijay.a.purushothaman@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: intel-gfx@lists.freedesktop.org
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: Squash in fixup for htmldocs.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0967e6a5
  9. 02 4月, 2014 6 次提交
  10. 13 3月, 2014 2 次提交
  11. 19 2月, 2014 1 次提交
    • A
      drm: add DRM_CAPs for cursor size · 8716ed4e
      Alex Deucher 提交于
      Some hardware may not support standard 64x64 cursors.  Add
      a drm cap to query the cursor size from the kernel.  Some examples
      include radeon CIK parts (128x128 cursors) and armada (32x64 or 64x32).
      This allows things like device specific ddxes to remove asics specific
      logic and also allows xf86-video-modesetting to work properly with hw
      cursors on this hardware. Default to 64 if the driver doesn't specify
      a size.
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      8716ed4e
  12. 13 2月, 2014 1 次提交
  13. 21 1月, 2014 1 次提交
  14. 20 1月, 2014 1 次提交
  15. 14 1月, 2014 2 次提交
  16. 06 11月, 2013 1 次提交
  17. 22 10月, 2013 1 次提交
    • D
      drm/sysfs: sort out minor and connector device object lifetimes. · 5bdebb18
      Dave Airlie 提交于
      So drm was abusing device lifetimes, by having embedded device structures
      in the minor and connector it meant that the lifetime of the internal drm
      objects (drm_minor and drm_connector) were tied to the lifetime of the device
      files in sysfs, so if something kept those files opened the current code
      would kfree the objects and things would go downhill from there.
      
      Now in reality there is no need for these lifetimes to be so intertwined,
      especailly with hotplugging of devices where we wish to remove the sysfs
      and userspace facing pieces before we can unwind the internal objects due
      to open userspace files or mmaps, so split the objects out so the struct
      device is no longer embedded and do what fbdev does and just allocate
      and remove the sysfs inodes separately.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      5bdebb18
  18. 12 10月, 2013 1 次提交
    • R
      DRM: Armada: Add Armada DRM driver · 96f60e37
      Russell King 提交于
      This patch adds support for the pair of LCD controllers on the Marvell
      Armada 510 SoCs.  This driver supports:
      - multiple contiguous scanout buffers for video and graphics
      - shm backed cacheable buffer objects for X pixmaps for Vivante GPU
        acceleration
      - dual lcd0 and lcd1 crt operation
      - video overlay on each LCD crt via DRM planes
      - page flipping of the main scanout buffers
      - DRM prime for buffer export/import
      
      This driver is trivial to extend to other Armada SoCs.
      
      Included in this commit is the core driver with no output support; output
      support is platform and encoder driver dependent.
      Tested-by: NSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      96f60e37
  19. 01 10月, 2013 7 次提交