1. 11 8月, 2014 1 次提交
    • D
      drm: Add a plane->reset hook · 2a0d7cfd
      Daniel Vetter 提交于
      In general having this can't hurt, and the atomic helpers will need
      it to be able to reset the state objects properly. The overall idea
      is to reset in the order pixels flow, so planes -> crtcs ->
      encoders -> connectors.
      
      v2: Squash in fixup from Ville to correctly deference struct drm_plane
      instead of drm_crtc when walking the plane list. Fixes an oops in
      driver init and resume.
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2a0d7cfd
  2. 08 8月, 2014 5 次提交
    • D
      drm: trylock modest locking for fbdev panics · cb597bb3
      Daniel Vetter 提交于
      In the fbdev code we want to do trylocks only to avoid deadlocks and
      other ugly issues. Thus far we've only grabbed the overall modeset
      lock, but that already failed to exclude a pile of potential
      concurrent operations. With proper atomic support this will be worse.
      
      So add a trylock mode to the modeset locking code which attempts all
      locks only with trylocks, if possible. We need to track this in the
      locking functions themselves and can't restrict this to drivers since
      driver-private w/w mutexes must be treated the same way.
      
      There's still the issue that other driver private locks aren't handled
      here at all, but well can't have everything. With this we will at
      least not regress, even once atomic allows lots of concurrent kms
      activity.
      
      Aside: We should move the acquire context to stack-based allocation in
      the callers to get rid of that awful WARN_ON(kmalloc_failed) control
      flow which just blows up when memory is short. But that's material for
      separate patches.
      
      v2:
      - Fix logic inversion fumble in the fb helper.
      - Add proper kerneldoc.
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cb597bb3
    • D
      drm: Move ->old_fb from crtc to plane · 3d30a59b
      Daniel Vetter 提交于
      Atomic implemenations for legacy ioctls must be able to drop locks.
      Which doesn't cause havoc since we only do that while constructing
      the new state, so no driver or hardware state change has happened.
      
      The only troubling bit is the fb refcounting the core does - if
      someone else has snuck in then it might potentially unref an
      outdated framebuffer. To fix that move the old_fb temporary storage
      into struct drm_plane for all ioctls, so that the atomic helpers can
      update it.
      
      v2: Fix up the error case handling as suggested by Matt Roper and just
      grab locks uncoditionally - there's no point in optimizing the locking
      for when userspace gets it wrong.
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3d30a59b
    • D
      drm: Handle legacy per-crtc locking with full acquire ctx · d059f652
      Daniel Vetter 提交于
      So drivers using the atomic interfaces expect that they can acquire
      additional locks internal to the driver as-needed. Examples would be
      locks to protect shared state like shared display PLLs.
      
      Unfortunately the legacy ioctls assume that all locking is fully done
      by the drm core. Now for those paths which grab all locks we already
      have to keep around an acquire context in dev->mode_config. Helper
      functions that implement legacy interfaces in terms of atomic support
      can therefore grab this acquire contexts and reuse it.
      
      The only interfaces left are the cursor and pageflip ioctls. So add
      functions to grab the crtc lock these need using an acquire context
      and preserve it for atomic drivers to reuse.
      
      v2:
      - Fixup comments&kerneldoc.
      - Drop the WARNING from modeset_lock_all_crtcs since that can be used
        in legacy paths with crtc locking.
      
      v3: Fix a type on the kerneldoc Dave spotted.
      
      Cc: Dave Airlie <airlied@redhat.com>
      Reviewed-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d059f652
    • D
      drm: Move modeset_lock_all helpers to drm_modeset_lock.[hc] · a6a8bb84
      Daniel Vetter 提交于
      Somehow we've forgotten about this little bit of OCD.
      Reviewed-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a6a8bb84
    • D
      drm: Add drm_plane/connector_index · 10f637bf
      Daniel Vetter 提交于
      In the atomic state we'll have an array of states for crtcs, planes
      and connectors and need to be able to at them by their index. We
      already have a drm_crtc_index function so add the missing ones for
      planes and connectors.
      
      If it later on turns out that the list walking is too expensive we can
      add the index to the relevant modeset objects.
      
      Rob Clark doesn't like the loops too much, but we can always add an
      obj->idx parameter later on. And for now reiterating is actually safer
      since nowadays we have hotpluggable connectors (thanks to DP MST).
      
      v2: Fix embarrassing copypasta fail in kerneldoc and header
      declarations, spotted by Matt Roper.
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      10f637bf
  3. 06 8月, 2014 1 次提交
    • C
      drm: Perform cmdline mode parsing during connector initialisation · eaf99c74
      Chris Wilson 提交于
      i915.ko has a custom fbdev initialisation routine that aims to preserve
      the current mode set by the BIOS, unless overruled by the user. The
      user's wishes are determined by what, if any, mode is specified on the
      command line (via the video= parameter). However, that command line mode
      is first parsed by drm_fb_helper_initial_config() which is called after
      i915.ko's custom initial_config() as a fallback method. So in order for
      us to honour it, we need to move the cmdline parser earlier. If we
      perform the connector cmdline parsing as soon as we initialise the
      connector, that cmdline mode and forced status is then available even if
      the fbdev helper is not compiled in or never called.
      
      We also then expose the cmdline user mode in the connector mode lists.
      
      v2: Rebase after connector->name upheaval.
      
      v3: Adapt mga200 to look for the cmdline mode in the new place. Nicely
      simplifies things while at that.
      
      v4: Fix checkpatch.
      
      v5: Select FB_CMDLINE to adapt to the changed fbdev patch.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73154
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v2)
      Cc: dri-devel@lists.freedesktop.org
      Cc: Julia Lemire <jlemire@matrox.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      eaf99c74
  4. 02 8月, 2014 2 次提交
  5. 23 7月, 2014 1 次提交
  6. 12 7月, 2014 5 次提交
  7. 11 7月, 2014 1 次提交
  8. 08 7月, 2014 11 次提交
    • M
      drm: Remove command line guard for universal planes · c7dbc6c9
      Matt Roper 提交于
      Universal planes are ready to leave 'experimental' state so drop the
      kernel command line parameter that we've been hiding them behind.
      Userspace clients that wish to receive universal planes will still need
      to opt-in by setting the appropriate capability bit, so this should have
      no impact on existing userspace.
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c7dbc6c9
    • D
      drm/helper: add Displayport multi-stream helper (v0.6) · ad7f8a1f
      Dave Airlie 提交于
      This is the initial import of the helper for displayport multistream.
      
      It consists of a topology manager, init/destroy/set mst state
      
      It supports DP 1.2 MST sideband msg protocol handler - via hpd irqs
      
      connector detect and edid retrieval interface.
      
      It supports i2c device over DP 1.2 sideband msg protocol (EDID reads only)
      
      bandwidth manager API via vcpi allocation and payload updating,
      along with a helper to check the ACT status.
      
      Objects:
      MST topology manager - one per toplevel MST capable GPU port - not sure if this should be higher level again
      MST branch unit - one instance per plugged branching unit - one at top of hierarchy - others hanging from ports
      MST port - one port per port reported by branching units, can have MST units hanging from them as well.
      
      Changes since initial posting:
      a) add a mutex responsbile for the queues, it locks the sideband and msg slots, and msgs to transmit state
      b) add worker to handle connection state change events, for MST device chaining and hotplug
      c) add a payload spinlock
      d) add path sideband msg support
      e) fixup enum path resources transmit
      f) reduce max dpcd msg to 16, as per DP1.2 spec.
      g) separate tx queue kicking from irq processing and move irq acking back to drivers.
      
      Changes since v0.2:
      a) reorganise code,
      b) drop ACT forcing code
      c) add connector naming interface using path property
      d) add topology dumper helper
      e) proper reference counting and lookup for ports and mstbs.
      f) move tx kicking into a workq
      g) add aux locking - this should be redone
      h) split teardown into two parts
      i) start working on documentation on interface.
      
      Changes since v0.3:
      a) vc payload locking and tracking fixes
      b) add hotplug callback into driver - replaces crazy return 1 scheme
      c) txmsg + mst branch device refcount fixes
      d) don't bail on mst shutdown if device is gone
      e) change irq handler to take all 4 bytes of SINK_COUNT + ESI vectors
      f) make DP payload updates timeout longer - observed on docking station redock
      g) add more info to debugfs dumper
      
      Changes since v0.4:
      a) suspend/resume support
      b) more debugging in debugfs
      
      Changes since v0.5:
      a) use byte * to avoid unnecessary stack usage
      b) fix num_sdp_streams interpretation.
      c) init payload state for unplug events
      d) remove lenovo dock sink count hack
      e) drop aux lock - post rebase
      f) call hotplug on port destroy
      
      TODO:
      misc features
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ad7f8a1f
    • D
      drm: add a path blob property · 43aba7eb
      Dave Airlie 提交于
      This property will be used by the MST code to provide userspace
      with a path to parse so it can recognise connectors around hotplugs.
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      43aba7eb
    • D
      drm/fb_helper: allow adding/removing connectors later · 65c2a89c
      Dave Airlie 提交于
      This is required to get fbcon probing to work on new connectors,
      callers should acquire the mode config lock before calling these.
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      65c2a89c
    • D
      drm/crtc: add interface to reinitialise the legacy mode group · 2390cd11
      Dave Airlie 提交于
      This can be called to update things after dynamic connectors/encoders
      are created/deleted.
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      2390cd11
    • T
      drm: Introduce drm_fb_helper_prepare() · 10a23102
      Thierry Reding 提交于
      To implement hotplug detection in a race-free manner, drivers must call
      drm_kms_helper_poll_init() before hotplug events can be triggered. Such
      events can be triggered right after any of the encoders or connectors
      are initialized. At the same time, if the drm_fb_helper_hotplug_event()
      helper is used by a driver, then the poll helper requires some parts of
      the FB helper to be initialized to prevent a crash.
      
      At the same time, drm_fb_helper_init() requires information that is not
      necessarily available at such an early stage (number of CRTCs and
      connectors), so it cannot be used yet.
      
      Add a new helper, drm_fb_helper_prepare(), that initializes the bare
      minimum needed to allow drm_kms_helper_poll_init() to execute and any
      subsequent hotplug events to be processed properly.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      10a23102
    • T
      drm: Constify struct drm_fb_helper_funcs · 3a493879
      Thierry Reding 提交于
      There's no need for this to be modifiable. Make it const so that it can
      be put into the .rodata section.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3a493879
    • C
      drm/ttm: fix handling of TTM_PL_FLAG_TOPDOWN v2 · e3f20279
      Christian König 提交于
      bo->mem.placement is not initialized when ttm_bo_man_get_node is called,
      so the flag had no effect at all.
      
      v2: change nouveau and vmwgfx as well
      Signed-off-by: NChristian König <christian.koenig@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e3f20279
    • D
      drm: enable render-nodes by default · 6d6dfcfb
      David Herrmann 提交于
      We introduced render-nodes about 1/2 year ago and no problems showed up.
      Remove the drm_rnodes argument and enable them by default now.
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      6d6dfcfb
    • A
      drm/ttm: remove declaration of ttm_tt_cache_flush · 15f8f657
      Alexandre Courbot 提交于
      ttm_tt_cache_flush's implementation was removed in 2009 by commit
      c9c97b8c, but its declaration has been hiding in ttm_bo_driver.h since
      then.
      
      It has been surviving in the dark for too long now ; give it the mercy
      blow.
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      15f8f657
    • D
      drm/gem: remove misleading gfp parameter to get_pages() · 0cdbe8ac
      David Herrmann 提交于
      drm_gem_get_pages() currently allows passing a 'gfp' parameter that is
      passed to shmem combined with mapping_gfp_mask(). Given that the default
      mapping_gfp_mask() is GFP_HIGHUSER, it is _very_ unlikely that anyone will
      ever make use of that parameter. In fact, all drivers currently pass
      redundant flags or 0.
      
      This patch removes the 'gfp' parameter. The only reason to keep it is to
      remove flags like __GFP_WAIT. But in its current form, it can only be used
      to add flags. So to remove __GFP_WAIT, you'd have to drop it from the
      mapping_gfp_mask, which again is stupid as this mask is used by shmem-core
      for other allocations, too.
      
      If any driver ever requires that parameter, we can introduce a new helper
      that takes the raw 'gfp' parameter. The caller'd be responsible to combine
      it with mapping_gfp_mask() in a suitable way. The current
      drm_gem_get_pages() helper would then simply use mapping_gfp_mask() and
      call the new helper. This is what shmem_read_mapping_pages{_gfp,} does
      right now.
      
      Moreover, the gfp-zone flag-usage is not obvious: If you pass a modified
      zone, shmem core will WARN() or even BUG(). In other words, the following
      must be true for 'gfp' passed to shmem_read_mapping_pages_gfp():
          gfp_zone(mapping_gfp_mask(mapping)) == gfp_zone(gfp)
      Add a comment to drm_gem_read_pages() explaining that constraint.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      0cdbe8ac
  9. 04 7月, 2014 1 次提交
  10. 24 6月, 2014 1 次提交
  11. 19 6月, 2014 3 次提交
  12. 16 6月, 2014 1 次提交
    • T
      drm/i915, HD-audio: Don't continue probing when nomodeset is given · 74b0c2d7
      Takashi Iwai 提交于
      When a machine is booted with nomodeset option, i915 driver skips the
      whole initialization.  Meanwhile, HD-audio tries to bind wth i915 just
      by request_symbol() without knowing that the initialization was
      skipped, and eventually it hits WARN_ON() in i915_request_power_well()
      and i915_release_power_well() wrongly but still continues probing,
      even though it doesn't work at all.
      
      In this patch, both functions are changed to return an error in case
      of uninitialized state instead of WARN_ON(), so that HD-audio driver
      can give up HDMI controller initialization at the right time.
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: <stable@vger.kernel.org> [3.15]
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      74b0c2d7
  13. 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
  14. 10 6月, 2014 2 次提交
  15. 06 6月, 2014 1 次提交
  16. 05 6月, 2014 2 次提交
    • T
      drm/dsi: Support device shutdown · d1621803
      Thierry Reding 提交于
      Hook up the MIPI DSI bus's .shutdown() function to allow drivers to
      implement code that should be run when a device is shut down.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      d1621803
    • M
      drm/plane-helper: Add drm_plane_helper_check_update() (v3) · 7daf8d54
      Matt Roper 提交于
      Pull the parameter checking from drm_primary_helper_update() out into
      its own function; drivers that provide their own setplane()
      implementations rather than using the helper may still want to share
      this parameter checking logic.
      
      A few of the checks here were also updated based on suggestions by
      Ville Syrjälä.
      
      v3:
       - s/primary_helper/plane_helper/ --- this checking logic may be useful
         for other types of planes as well.
       - Fix visibility check (need to dereference visibility pointer)
      v2:
       - Pass src/dest/clip rects and min/max scaling down to helper to avoid
         duplication of effort between helper and drivers (suggested by
         Ville).
       - Allow caller to specify whether the primary plane should be
         updatable while the crtc is disabled.
      
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: NChon Ming Lee <chon.ming.lee@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Acked-by: NDave Airlie <airlied@gmail.com>
      [danvet: Include header properly and fixup declaration mismatch to
      make this compile.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7daf8d54