1. 08 3月, 2014 9 次提交
    • J
      drm/i915: add plane_config fetching infrastructure v2 · 46f297fb
      Jesse Barnes 提交于
      Early at init time, we can try to read out the plane config structure
      and try to preserve it if possible.
      
      v2: alloc fb obj at init time after fetching plane config
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      46f297fb
    • B
      drm/i915: Implement command buffer parsing logic · 351e3db2
      Brad Volkin 提交于
      The command parser scans batch buffers submitted via execbuffer ioctls before
      the driver submits them to hardware. At a high level, it looks for several
      things:
      
      1) Commands which are explicitly defined as privileged or which should only be
         used by the kernel driver. The parser generally rejects such commands, with
         the provision that it may allow some from the drm master process.
      2) Commands which access registers. To support correct/enhanced userspace
         functionality, particularly certain OpenGL extensions, the parser provides a
         whitelist of registers which userspace may safely access (for both normal and
         drm master processes).
      3) Commands which access privileged memory (i.e. GGTT, HWS page, etc). The
         parser always rejects such commands.
      
      See the overview comment in the source for more details.
      
      This patch only implements the logic. Subsequent patches will build the tables
      that drive the parser.
      
      v2: Don't set the secure bit if the parser succeeds
      Fail harder during init
      Makefile cleanup
      Kerneldoc cleanup
      Clarify module param description
      Convert ints to bools in a few places
      Move client/subclient defs to i915_reg.h
      Remove the bits_count field
      
      OTC-Tracker: AXIA-4631
      Change-Id: I50b98c71c6655893291c78a2d1b8954577b37a30
      Signed-off-by: NBrad Volkin <bradley.d.volkin@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      [danvet: Appease checkpatch.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      351e3db2
    • B
      drm/i915: Refactor shmem pread setup · 4c914c0c
      Brad Volkin 提交于
      The command parser is going to need the same synchronization and
      setup logic, so factor it out for reuse.
      
      v2: Add a check that the object is backed by shmem
      Signed-off-by: NBrad Volkin <bradley.d.volkin@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4c914c0c
    • I
      drm/i915: power domains: add vlv power wells · 77961eb9
      Imre Deak 提交于
      Based on an early draft from Jesse.
      
      Add support for powering on/off the dynamic power wells on VLV by
      registering its display and dpio dynamic power wells with the power
      domain framework.
      
      For now power on all PHY TX lanes regardless of the actual lane
      configuration. Later this can be optimized when the PHY side setup
      enables only the required lanes. Atm, it enables all lanes in all
      cases.
      
      v2:
      - undef function local COND macro after its last use (Ville)
      - Take dev_priv->irq_lock around the whole sequence of
        intel_set_cpu_fifo_underrun_reporting_nolock() and
        valleyview_disable_display_irqs(). They are short and releasing
        the lock in between only makes proving correctness more difficult.
      - sanitize local var names in vlv_power_well_enabled()
      v3:
      - rebase on latest -nightly
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: Resolve conflict due to my changes in the previous patch.
      Also throw in an assert_spin_locked for safety. And finally appease
      checkpatch.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      77961eb9
    • I
      drm/i915: vlv: factor out valleyview_display_irq_install · f8b79e58
      Imre Deak 提交于
      We'll need to disable/re-enable the display-side IRQs when turning
      off/on the VLV display power well. Factor out the helper functions
      for this. For now keep the display IRQs enabled by default, so the
      functionality doesn't change. This will be changed to enable/disable
      the IRQs on-demand when adding support for VLV power wells in an
      upcoming patch.
      
      v2:
      - take the irq spin lock for the whole enable/disable sequence as
        these can be called with interrupts enabled
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f8b79e58
    • I
      drm/i915: add port power domains · 319be8ae
      Imre Deak 提交于
      Parts that poke port specific HW blocks like the encoder HW state
      readout or connector hotplug detect code need a way to check whether
      required power domains are on or enable/disable these. For this purpose
      add a set of power domains that refer to the port HW blocks. Get the
      proper port power domains during modeset.
      
      For now when requesting the power domain for a DDI port get it for a 4
      lane configuration. This can be optimized later to request only the 2
      lane power domain, when proper support is added on the VLV PHY side for
      this. Atm, the PHY setup code assumes a 4 lane config in all cases.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      319be8ae
    • I
      drm/i915: split power well 'set' handler to separate enable/disable/sync_hw · c6cb582e
      Imre Deak 提交于
      Split the 'set' power well handler into an 'enable', 'disable' and
      'sync_hw' handler. This maps more conveniently to higher level
      operations, for example it allows us to push the hsw package c8 handling
      into the corresponding hsw/bdw enable/disable handlers and the hsw BIOS
      hand-over setting into the hsw/bdw sync_hw handler.
      
      No functional change.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: Appease checkpatch's whitespace complaints.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c6cb582e
    • I
      drm/i915: move power domain macros to intel_pm.c · efcad917
      Imre Deak 提交于
      These macros are used only locally, so move them to the .c file.
      
      No functional change.
      
      v2:
      - add init power domain to always-on power wells in the following
        - separate - patch (Paulo)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      efcad917
    • D
      drm/i915: Disable full ppgtt by default · 93a25a9e
      Daniel Vetter 提交于
      There are too many oustanding issues:
      
      - Fence handling in the current code is broken. There's a patch series
        from me, but it's blocked on and extended review (which includes
        writing the testcases).
      
      - IOMMU mapping handling is broken, we need to properly refcount it -
        currently it gets destroyed when the first vma is unbound, so way
        too early.
      
      - There's a pending reset issue on snb. Since Mika's reset work and
        full ppgtt have been pulled in in separate branches and ended up
        intermittingly breaking each another it's unclear who's the exact
        culprit here.
      
      - We still have persistent evidince of crazy recursion bugs through
        vma_unbind and ppgtt_relase, e.g.
      
        https://bugs.freedesktop.org/show_bug.cgi?id=73383
      
        This issue (and a few others meanwhile resolved) have blocked our
        performance measuring/tuning group since 3 months.
      
      - Secure batch dispatching is broken. This is blocking Brad Volkin's
        command checker work since 3 months.
      
      All these issues are confirmed to only happen when full ppgtt is
      enabled, falling back to aliasing ppgtt resolves them. But even
      aliasing ppgtt itself still has a regression:
      
      - We currently unconditionally bind objects into the aliasing ppgtt,
        which means all priviledged objects like ringbuffers are visible to
        unpriviledged access again. On top of that this also breaks the
        command checker for aliasing ppgtt, since it can't hide the
        validated batch any more.
      
      Furthermore topic/full-ppgtt has never been reviewed:
      
      - Lifetime rules around vma unbinding/release are unclear, resulting
        into this awesome hack called ppgtt_release. Which seems to take the
        blame for most of the recursion fallout.
      
      - Context/ring init works different on gpu reset than anywhere else.
        Such differeneces have in the past always lead to really hard to
        track down bugs.
      
      - Aliasing ppgtt is treated in a bunch of places as a real address
        space, but it isn't - the real address space is always the global
        gtt in that case. This results in a bit a mess between contexts and
        ppgtt object, further complication the context/ppgtt/vma lifetime
        rules.
      
      - We don't have any docs describing the overall concepts introduced
        with full ppgtt. A short, concise overview describing vmas and some
        of the strange bits around them (like the unbound vmas used by
        execbuf, or the new binding rules) really is needed.
      
      Note that a lot of the post topic/full-ppgtt merge fallout has already
      been addressed, this entire list here of 10 issues really only contains
      the still outstanding issues.
      
      Finally the 3.15 merge window is approaching and I think we need to
      use the remaining time to ensure that our fallback option of using
      aliasing ppgtt is in solid shape. Hence I think it's time to throw the
      switch. While at it demote the helper from static inline status
      because really.
      
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Dave Airlie <airlied@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      93a25a9e
  2. 06 3月, 2014 18 次提交
  3. 04 3月, 2014 2 次提交
    • B
      drm/i915: Make clear/insert vfuncs args absolute · 782f1495
      Ben Widawsky 提交于
      This patch converts insert_entries and clear_range, both functions which
      are specific to the VM. These functions tend to encapsulate the gen
      specific PTE writes. Passing absolute addresses to the insert_entries,
      and clear_range will help make the logic clearer within the functions as
      to what's going on. Currently, all callers simply do the appropriate
      page shift, which IMO, ends up looking weird with an upcoming change for
      the gen8 page table allocations.
      
      Up until now, the PPGTT was a funky 2 level page table. GEN8 changes
      this to look more like a 3 level page table, and to that extent we need
      a significant amount more memory simply for the page tables. To address
      this, the allocations will be split up in finer amounts.
      
      v2: Replace size_t with uint64_t (Chris, Imre)
      
      v3: Fix size in gen8_ppgtt_init (Ben)
      Fix Size in i915_gem_suspend_gtt_mappings/restore (Imre)
      
      Reviewed-by: Imre Deak <imre.deak@intel.com> (v2)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      782f1495
    • B
      drm/i915: Move ppgtt_release out of the header · 321f2ada
      Ben Widawsky 提交于
      At one time it was expected to be called in multiple places by kref_put.
      At the current time however, it is all contained within
      i915_gem_context.c.
      
      This patch makes an upcoming required addition a bit nicer since it too
      doesn't need to be defined in a header file.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      321f2ada
  4. 14 2月, 2014 4 次提交
    • D
      drm/i915: Simplify i915_gem_object_ggtt_unpin · b287110e
      Daniel Vetter 提交于
      Split out from Chris vma-bind rework.
      
      Jani wondered why this is save, and the reason is that i915_vma_unbind
      does all these checks, too. So they're redundant.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b287110e
    • D
      drm/i915: split PIN_GLOBAL out from PIN_MAPPABLE · bf3d149b
      Daniel Vetter 提交于
      With abitrary pin flags it makes sense to split out a "please bind
      this into global gtt" from the "please allocate in the mappable
      range".
      
      Use this unconditionally in our global gtt pin helper since this is
      what its callers want. Later patches will drop PIN_MAPPABLE where it's
      not strictly needed.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bf3d149b
    • D
      drm/i915: Consolidate binding parameters into flags · 1ec9e26d
      Daniel Vetter 提交于
      Anything more than just one bool parameter is just a pain to read,
      symbolic constants are much better.
      
      Split out from Chris' vma-binding rework patch.
      
      v2: Undo the behaviour change in object_pin that Chris spotted.
      
      v3: Split out misplaced hunk to handle set_cache_level errors,
      spotted by Jani.
      
      v4: Keep the current over-zealous binding logic in the execbuffer code
      working with a quick hack while the overall binding code gets shuffled
      around.
      
      v5: Reorder the PIN_ flags for more natural patch splitup.
      
      v6: Pull out the PIN_GLOBAL split-up again.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1ec9e26d
    • I
      drm/i915: add unregister callback to connector · 4932e2c3
      Imre Deak 提交于
      Since
      
      commit d9255d57
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Thu Sep 26 20:05:59 2013 -0300
      
      it became clear that we need to separate the unload sequence into two
      parts:
      
      1. remove all interfaces through which new operations on some object
         (crtc, encoder, connector) can be started and make sure all pending
         operations are completed
      2. do the actual tear down of the internal representation of the above
         objects
      
      The above commit achieved this separation for connectors by splitting
      out the sysfs removal part from the connector's destroy callback and
      doing this removal before calling drm_mode_config_cleanup() which does
      the actual tear-down of all the drm objects.
      
      Since we'll have to customize the interface removal part for different
      types of connectors in the upcoming patches, add a new unregister
      callback and move the interface removal part to it.
      
      No functional change.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NAntti Koskipää <antti.koskipaa@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4932e2c3
  5. 13 2月, 2014 7 次提交