1. 05 5月, 2014 1 次提交
    • Z
      drm/i915: Use the coarse ping-pong mechanism based on drm fd to dispatch the BSD command on BDW GT3 · a8ebba75
      Zhao Yakui 提交于
      The BDW GT3 has two independent BSD rings, which can be used to process the
      video commands. To be simpler, it is transparent to user-space driver/middle.
      Instead the kernel driver will decide which ring is to dispatch the BSD video
      command.
      
      As every BSD ring is powerful, it is enough to dispatch the BSD video command
      based on the drm fd. In such case it can play back video stream while encoding
      another video stream. The coarse ping-pong mechanism is used to determine
      which BSD ring is used to dispatch the BSD video command.
      
      V1->V2: Follow Daniel's comment and use the simple ping-pong mechanism.
      This is only to add the support of dual BSD rings on BDW GT3 machine.
      The further optimization will be considered in another patch set.
      
      V2->V3: Follow Daniel's comment to use the struct_mutext instead of
      atomic_t during determining which ring can be used to dispatch Video command.
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NZhao Yakui <yakui.zhao@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a8ebba75
  2. 23 4月, 2014 2 次提交
    • D
      drm: pass the irq explicitly to drm_irq_install · bb0f1b5c
      Daniel Vetter 提交于
      Unfortunately this requires a drm-wide change, and I didn't see a sane
      way around that. Luckily it's fairly simple, we just need to inline
      the respective get_irq implementation from either drm_pci.c or
      drm_platform.c.
      
      With that we can now also remove drm_dev_to_irq from drm_irq.c.
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bb0f1b5c
    • D
      drm: Rip out totally bogus vga_switcheroo->can_switch locking · fc8fd40e
      Daniel Vetter 提交于
      So I just wanted to add a new field to struct drm_device and
      accidentally stumbled over something. According to comments
      dev->open_count is protected by dev->count_lock, but that's totally
      not the case. It's protected by drm_global_mutex.
      
      Unfortunately the vga switcheroo callbacks took this comment at face
      value. The problem is that we can't just take the drm_global_mutex
      because:
      - It would lead to a locking inversion with the driver load/unload
        paths.
      - It wouldn't actually protect anything, for that we'd need to wrap
        the entire vga switcheroo code in the drm_global_mutex. And I'm not
        sure whether that would actually solve anything.
      
      What we probably want is a try_to_grab_switcheroo reference kind of
      thing which is used in the driver's ->open callback. Then we could
      move all that ->can_switch madness into the vga switcheroo core where
      it really belongs.
      
      But since that would amount to real work take the easy way out and
      just add a comment. It's definitely not going to make anything worse
      since doing switcheroo state changes while restarting X just isn't
      recommended. Even though the delayed switching code does exactly that.
      
      v2:
      - Simplify the ->can_switch implementations more (Thierry)
      - Fix comment about the dev->open_count locking (Thierry)
      
      Cc: Thierry Reding <treding@nvidia.com>
      Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> (v1)
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fc8fd40e
  3. 02 4月, 2014 1 次提交
  4. 31 3月, 2014 1 次提交
  5. 19 3月, 2014 2 次提交
    • P
      drm/i915: make PC8 be part of runtime PM suspend/resume · a8a8bd54
      Paulo Zanoni 提交于
      Currently, when our driver becomes idle for i915.pc8_timeout (default:
      5s) we enable PC8, so we save some power, but not everything we can.
      Then, while PC8 is enabled, if we stay idle for more
      autosuspend_delay_ms (default: 10s) we'll enter runtime PM and put the
      graphics device in D3 state, saving even more power. The two features
      are separate things with increasing levels of power savings, but if we
      disable PC8 we'll never get into D3.
      
      While from the modularity point of view it would be nice to keep these
      features as separate, we have reasons to merge them:
       - We are not aware of anybody wanting a "PC8 without D3" environment.
       - If we keep both features as separate, we'll have to to test both
         PC8 and PC8+D3 code paths. We're already having a major pain to
         make QA do automated testing of just one thing, testing both paths
         will cost even more.
       - Only Haswell+ supports PC8, so if we want to add runtime PM support
         to, for example, IVB, we'll have to copy some code from the PC8
         feature to runtime PM, so merging both features as a single thing
         will make it easier for enabling runtime PM on other platforms.
      
      This patch only does the very basic steps required to have PC8 and
      runtime PM merged on a single feature: the next patches will take care
      of cleaning up everything.
      
      v2: - Rebase.
      v3: - Rebase.
          - Fully remove the deprecated i915 params since Daniel doesn't
            consider them as part of the ABI.
      v4: - Rebase.
          - Fix typo in the commit message.
      v5: - Rebase, again.
          - Add a huge comment explaining the different forcewake usage
            (Chris, Daniel).
          - Use open-coded forcewake functions (Daniel).
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a8a8bd54
    • J
      drm/i915/vlv: no MCHBAR on VLV · 11ea8b7d
      Jesse Barnes 提交于
      So don't try to allocate and program it, we're only fooling ourselves.
      Reported-by: N"Chang, Junxiao" <junxiao.chang@intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NJunxiao Chang <junxiao.chang@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      11ea8b7d
  6. 18 3月, 2014 1 次提交
    • D
      drm/i915: Fix up the forcewake timer initialization · 05efeebd
      Daniel Vetter 提交于
      This is a regression introduced in
      
      commit 0294ae7b
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Thu Mar 13 12:00:29 2014 +0000
      
          drm/i915: Consolidate forcewake resetting to a single function
      
      The reordered setup sequence ended up calling del_timer_sync before
      the timer was set up correctly, resulting in endless hilarity when
      loading the driver.
      
      Compared to Ben's patch (which moved around the setup_timer call to
      sanitize_early) this moves the sanitize_early call around in the
      driver load call. This way we avoid calling setup_timer again in the
      resume code (where we also call sanitize_early).
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Ben Widawsky <benjamin.widawsky@intel.com>
      Tested-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76242Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      05efeebd
  7. 08 3月, 2014 2 次提交
    • 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
  8. 06 3月, 2014 3 次提交
  9. 13 2月, 2014 5 次提交
    • D
      drm/i915: delay master/sarea deref for legacy ioctls · 4d10cc0f
      Daniel Vetter 提交于
      ... past the check for DRIVER_MODESET. Avoids races with userspace
      opening a master and our sarea setup.
      
      Cc: Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4d10cc0f
    • D
      drm/i915: Provide a command line option to disable display · a0bae57f
      Damien Lespiau 提交于
      If we can't actually determine at run-time we have a fused-off display,
      provide at least an option to disable it.
      
      v2: Move the i915.disable_display test in a separate check
          (Daniel Vetter)
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a0bae57f
    • D
      drm/i915: Disable display when fused off · 658ac4c6
      Damien Lespiau 提交于
      FUSE_STRAP has a bit to inform us that the display has been fused off.
      Use it to setup the definitive number of pipes at run-time.
      
      v2: actually tweak num_pipes, not num_planes
      v3: also tests SFUSE_STRAP bit 7
      v4: rebase on top of drm-nightly
          use DRM_INFO() for the message telling display is fused off
          try to read the FUSE_LOCK bit to determine if PCH display is disabled
      v5: Don't read SFUSE_STRAP (register on the PCH) if num_pipes is already 0
          from the initial device info struct (to prevent hangs) (Daniel Vetter)
      
      Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> (for v3)
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (for v3)
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      658ac4c6
    • D
      drm/i915: Move num_plane to the intel_device_info structure · 22d3fd46
      Damien Lespiau 提交于
      And rename it to num_sprites as this value doesn't count the primary
      plane.
      
      This limit lives with num_pipes really, and now that dev_priv->info is
      writable we can put it there instead.
      
      While at it, introduce a intel_device_info_runtime_init() where we'll be
      able to gather the device info fields at run-time.
      
      v2: rename num_plane to num_sprites (Ville Syrjälä)
      v3: rebase on top of latest drm-nightly
      
      Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> (for v2)
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (for v2)
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      22d3fd46
    • D
      drm/i915: Make the intel_device_info structure kept in dev_priv writable · 5c969aa7
      Damien Lespiau 提交于
      Turns out it'd be nice to change some device information at run-time or simply
      have some code to fill in the info struct instead of having to declare the
      values in 30+ structures.
      
      What prompted this change is handling fused out display/pipe and tweaking
      num_pipes at run-time, but I'm quite sure we'll find other flags/limits to
      stick into dev_priv->info.
      
      Most of the changes were done with a sed:
      sed -i -e 's/dev_priv->info->/dev_priv->info./g' drivers/gpu/drm/i915/*[ch]
      
      with a few tweaks to make it all work:
      - Change the field definition in struct drm_i915_private
      - adjust i915_dump_device_info()
      - adjust i915_driver_load()
      - adjust the INTEL_INFO() macro
      
      v2: cast the info pointer returned by INTEL_INFO() to be const to catch
          uses that would modify the structure post-initialization.
          (Ville Syrjälä)
      
      v3: Redo the patch onto latest drm-nightly,
          Keep the info field const to catch post initialization writes
          instead of the v2 solution,
          Use a direct structure copy for the initial info initialization to
          use the compiler type safety (Ville Syrjälä)
      
      Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> (for v2)
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (for v2)
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5c969aa7
  10. 25 1月, 2014 1 次提交
    • S
      i915: remove pm_qos request on error · 22accca0
      Stanislaw Gruszka 提交于
      Not removing pm qos request and free memory for it can cause crash,
      when some other driver use pm qos. For example, this oops:
      
      BUG: unable to handle kernel paging request at fffffffffffffff8
      IP: [<ffffffff81307a6b>] plist_add+0x5b/0xd0
      Call Trace:
       [<ffffffff810acf25>] pm_qos_update_target+0x125/0x1e0
       [<ffffffff810ad071>] pm_qos_add_request+0x91/0x100
       [<ffffffffa053ec14>] e1000_open+0xe4/0x5b0 [e1000e]
      
      was caused by earlier i915 probe failure:
      
      [drm:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking
      [drm:init_ring_common] *ERROR* render ring initialization failed ctl 0001f001 head 00003004 tail 00000000 start 00003000
      [drm:i915_driver_load] *ERROR* failed to init modeset
      i915: probe of 0000:00:02.0 failed with error -5
      
      Bug report:
      http://bugzilla.redhat.com/show_bug.cgi?id=1057533Reported-by: NGiandomenico De Tullio <ghisha@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      [danvet: Drop unnecessary code movement.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      22accca0
  11. 19 12月, 2013 1 次提交
  12. 18 12月, 2013 5 次提交
    • B
      drm/i915: Use multiple VMs -- the point of no return · 7e0d96bc
      Ben Widawsky 提交于
      As with processes which run on the CPU, the goal of multiple VMs is to
      provide process isolation. Specific to GEN, there is also the ability to
      map more objects per process (2GB each instead of 2Gb-2k total).
      
      For the most part, all the pipes have been laid, and all we need to do
      is remove asserts and actually start changing address spaces with the
      context switch. Since prior to this we've converted the setting of the
      page tables to a streamed version, this is quite easy.
      
      One important thing to point out (since it'd been hotly contested) is
      that with this patch, every context created will have it's own address
      space (provided the HW can do it).
      
      v2: Disable BDW on rebase
      
      NOTE: I tried to make this commit as small as possible. I needed one
      place where I could "turn everything on" and that is here. It could be
      split into finer commits, but I didn't really see much point.
      
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7e0d96bc
    • B
      drm/i915: Do aliasing PPGTT init with contexts · bdf4fd7e
      Ben Widawsky 提交于
      We have a default context which suits the aliasing PPGTT well. Tie them
      together so it looks like any other context/PPGTT pair. This makes the
      code cleaner as it won't have to special case aliasing as often.
      
      The patch has one slightly tricky part in the default context creation
      function. In the future (and on aliased setup) we create a new VM for a
      context (potentially). However, if we have aliasing PPGTT, which occurs
      at this point in time for all platforms GEN6+, we can simply manage the
      refcounting to allow things to behave as normal. Now is a good time to
      recall that the aliasing_ppgtt doesn't have a real VM, it uses the GGTT
      drm_mm.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bdf4fd7e
    • D
      drm: Kill DRM_COPY_(TO|FROM)_USER · 1d6ac185
      Daniel Vetter 提交于
      Less yelling ftw!
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1d6ac185
    • D
      drm: Kill DRM_HZ · bfd8303a
      Daniel Vetter 提交于
      We don't have any userspace interfaces that use HZ as a time unit, so
      having our own DRM define is useless.
      
      Remove this remnant from the shared drm core days.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      bfd8303a
    • D
      drm: kill DRIVER_REQUIRE_AGP · 24986ee0
      Daniel Vetter 提交于
      Only the two intel drivers need this and they can easily check for
      working agp support in their driver ->load callbacks.
      
      This is the only reason why agp initialization could fail, so allows
      us to rip out a bit of error handling code in the next patch.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      24986ee0
  13. 17 12月, 2013 1 次提交
  14. 11 12月, 2013 2 次提交
    • D
      drm/i915: don't update the dri1 breadcrumb with modesetting · 6c719fac
      Daniel Vetter 提交于
      The update is horribly racy since it doesn't protect at all against
      concurrent closing of the master fd. And it can't really since that
      requires us to grab a mutex.
      
      Instead of jumping through hoops and offloading this to a worker
      thread just block this bit of code for the modesetting driver.
      
      Note that the race is fairly easy to hit since we call the breadcrumb
      function for any interrupt. So the vblank interrupt (which usually
      keeps going for a bit) is enough. But even if we'd block this and only
      update the breadcrumb for user interrupts from the CS we could hit
      this race with kms/gem userspace: If a non-master is waiting somewhere
      (and hence has interrupts enabled) and the master closes its fd
      (probably due to crashing).
      
      v2: Add a code comment to explain why fixing this for real isn't
      really worth it. Also improve the commit message a bit.
      
      v3: Fix the spelling in the comment.
      Reported-by: NEugene Shatokhin <eugene.shatokhin@rosalab.ru>
      Cc: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
      Cc: stable@vger.kernel.org
      Acked-by: NChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: NEugene Shatokhin <eugene.shatokhin@rosalab.ru>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6c719fac
    • P
      drm/i915: add initial Runtime PM functions · 8a187455
      Paulo Zanoni 提交于
      This patch adds the initial infrastructure to allow a Runtime PM
      implementation that sets the device to its D3 state. The patch just
      adds the necessary callbacks and the initial infrastructure.
      
      We still don't have any platform that actually uses this
      infrastructure, we still don't call get/put in all the places we need
      to, and we don't have any function to save/restore the state of the
      registers. This is not a problem since no platform uses the code added
      by this patch. We have a few people simultaneously working on runtime
      PM, so this initial code could help everybody make their plans.
      
      V2: - Move some functions to intel_pm.c
          - Remove useless pm_runtime_allow() call at init
          - Remove useless pm_runtime_mark_last_busy() call at get
          - Use pm_runtime_get_sync() instead of 2 calls
          - Add a WARN to check if we're really awake
      
      V3: - Rebase.
      
      V4: - Don't need to call pci_{save,restore}_state and
            pci_set_power_sate, since they're already called by the PCI
            layer
          - Remove wrong pm_runtime_enable() call at init_runtime_pm
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8a187455
  15. 06 12月, 2013 1 次提交
  16. 05 12月, 2013 1 次提交
  17. 04 12月, 2013 1 次提交
  18. 27 11月, 2013 1 次提交
    • I
      drm/i915: add a default always-on power well · 1c2256df
      Imre Deak 提交于
      So far we distinguished platforms without a dynamic power well with
      the HAS_POWER_WELL macro and for such platforms we didn't call any power
      domain functions. Instead of doing this check we can add an always-on
      power well for these platforms and call the power domain functions
      unconditionally. For always-on power wells we only increase/decrease
      their refcounts, otherwise they are nop.
      
      This makes high level driver code more readable and as a bonus provides
      some idea of the current power domains state for all platforms (once
      the relevant debugfs entry is added).
      
      v3: rename intel_power_wells to i9xx_always_on_power_well (Paulo)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1c2256df
  19. 26 11月, 2013 1 次提交
  20. 13 11月, 2013 1 次提交
  21. 12 11月, 2013 1 次提交
    • M
      drm/i915: add i915_get_reset_stats_ioctl · b6359918
      Mika Kuoppala 提交于
      This ioctl returns reset stats for specified context.
      
      The struct returned contains context loss counters.
      
      reset_count:    all resets across all contexts
      batch_active:   active batches lost on resets
      batch_pending:  pending batches lost on resets
      
      v2: get rid of state tracking completely and deliver only counts. Idea
          from Chris Wilson.
      
      v3: fix commit message
      
      v4: default context handled inside i915_gem_context_get_hang_stats
      
      v5: reset_count only for priviledged process
      
      v6: ctx=0 needs CAP_SYS_ADMIN for batch_* counters (Chris Wilson)
      
      v7: context hang stats never returns NULL
      
      v8: rebased on top of reworked context hang stats
          DRM_RENDER_ALLOW for ioctl
      
      v9: use DEFAULT_CONTEXT_ID. Improve comments for ioctl struct members
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Cc: Ian Romanick <idr@freedesktop.org>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: NIan Romanick <ian.d.romanick@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b6359918
  22. 30 10月, 2013 1 次提交
    • I
      drm/i915: rename i915_init_power_well to init_power_domains_init · ddb642fb
      Imre Deak 提交于
      Similarly rename the other related functions in the power domain
      interface.
      
      Higher level driver code calling these functions knows only about power
      domains, not the underlying power wells which may be different on
      different platforms. Also these functions really init/cleanup/resume
      power domains and only through that all related power wells, so rename
      them accordingly.
      
      Note that I left i915_{request,release}_power_well as is, since that
      really changes the state only of a single power well (and is HSW
      specific). It should also get a better name once we make it more
      generic by controlling things through a new audio power domain.
      
      v4:
      - use intel prefix instead of i915 everywhere (Paulo)
      - use a $prefix_$block_$action format (Daniel)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ddb642fb
  23. 28 10月, 2013 1 次提交
    • I
      drm/i915: use power get/put instead of set for power on after init · baa70707
      Imre Deak 提交于
      Currently we make sure that all power domains are enabled during driver
      init and turn off unneded ones only after the first modeset. Similarly
      during suspend we enable all power domains, which will remain on through
      the following resume until the first modeset.
      
      This logic is supported by intel_set_power_well() in the power domain
      framework. It would be nice to simplify the API, so that we only have
      get/put functions and make it more explicit on the higher level how this
      "power well on during init" logic works. This will make it also easier
      if in the future we want to shorten the time the power wells are on.
      
      For this add a new device private flag tracking whether we have the
      power wells on because of init/suspend and use only
      intel_display_power_get()/put(). As nothing else uses
      intel_set_power_well() we can remove it.
      
      This also fixes
      
      commit 6efdf354
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Wed Oct 16 17:25:52 2013 +0300
      
          drm/i915: enable only the needed power domains during modeset
      
      where removing intel_set_power_well() resulted in not releasing the
      reference on the power well that was taken during init and thus leaving
      the power well on all the time. Regression reported by Paulo.
      
      v2:
      - move the init_power_on flag to the power_domains struct (Daniel)
      
      v3:
      - add note about this being a regression fix too (Paulo)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      baa70707
  24. 17 10月, 2013 1 次提交
    • C
      drm/i915: Disable all GEM timers and work on unload · 45c5f202
      Chris Wilson 提交于
      We have two once very similar functions, i915_gpu_idle() and
      i915_gem_idle(). The former is used as the lower level operation to
      flush work on the GPU, whereas the latter is the high level interface to
      flush the GEM bookkeeping in addition to flushing the GPU. As such
      i915_gem_idle() also clears out the request and activity lists and
      cancels the delayed work. This is what we need for unloading the driver,
      unfortunately we called i915_gpu_idle() instead.
      
      In the process, make sure that when cancelling the delayed work and
      timer, which is synchronous, that we do not hold any locks to prevent a
      deadlock if the work item is already waiting upon the mutex. This
      requires us to push the mutex down from the caller to i915_gem_idle().
      
      v2: s/i915_gem_idle/i915_gem_suspend/
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70334Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: xunx.fang@intel.com
      [danvet: Only set ums.suspended for !kms as discussed earlier. Chris
      noticed that this slipped through.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      45c5f202
  25. 16 10月, 2013 1 次提交
    • D
      drm/i915: Implement blocking read for pipe CRC files · 07144428
      Damien Lespiau 提交于
      seq_file is not quite the right interface for these ones. We have a
      circular buffer with a new entry per vblank on one side and a process
      wanting to dequeue the CRC with a read().
      
      It's quite racy to wait for vblank in user land and then try to read a
      pipe_crc file, sometimes the CRC interrupt hasn't been fired and we end
      up with an EOF.
      
      So, let's have the read on the pipe_crc file block until the interrupt
      gives us a new entry. At that point we can wake the reading process.
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      07144428
  26. 12 10月, 2013 1 次提交