1. 22 7月, 2014 1 次提交
    • D
      drm/i915: add DP 1.2 MST support (v0.7) · 0e32b39c
      Dave Airlie 提交于
      This adds DP 1.2 MST support on Haswell systems.
      
      Notes:
      a) this reworks irq handling for DP MST ports, so that we can
      avoid the mode config locking in the current hpd handlers, as
      we need to process up/down msgs at a better time.
      
      Changes since v0.1:
      use PORT_PCH_HOTPLUG to detect short vs long pulses
      add a workqueue to deal with digital events as they can get blocked on the
      main workqueue beyong mode_config mutex
      fix a bunch of modeset checker warnings
      acks irqs in the driver
      cleanup the MST encoders
      
      Changes since v0.2:
      check irq status again in work handler
      move around bring up and tear down to fix DPMS on/off
      use path properties.
      
      Changes since v0.3:
      updates for mst apis
      more state checker fixes
      irq handling improvements
      fbcon handling support
      improved reference counting of link - fixes redocking.
      
      Changes since v0.4:
      handle gpu reset hpd reinit without oopsing
      check link status on HPD irqs
      fix suspend/resume
      
      Changes since v0.5:
      use proper functions to get max link/lane counts
      fix another checker backtrace - due to connectors disappearing.
      set output type in more places fro, unknown->displayport
      don't talk to devices if no HPD asserted
      check mst on short irqs only
      check link status properly
      rebase onto prepping irq changes.
      drop unsued force_act
      
      Changes since v0.6:
      cleanup unused struct entry.
      
      [airlied: fix some sparse warnings].
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0e32b39c
  2. 11 7月, 2014 1 次提交
  3. 08 7月, 2014 2 次提交
    • D
      drm/fb-helper: Fix hpd vs. initial config races · 50c3dc97
      Daniel Vetter 提交于
      Some drivers need to be able to have a perfect race-free fbcon setup.
      Current drivers only enable hotplug processing after the call to
      drm_fb_helper_initial_config which leaves a tiny but important race.
      
      This race is especially noticable on embedded platforms where the
      driver itself enables the voltage for the hdmi output, since only then
      will monitors (after a bit of delay, as usual) respond by asserting
      the hpd pin.
      
      Most of the infrastructure is already there with the split-out
      drm_fb_helper_init. And drm_fb_helper_initial_config already has all
      the required locking to handle concurrent hpd events since
      
      commit 53f1904b
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Mar 20 14:26:35 2014 +0100
      
          drm/fb-helper: improve drm_fb_helper_initial_config locking
      
      The only missing bit is making drm_fb_helper_hotplug_event save
      against concurrent calls of drm_fb_helper_initial_config. The only
      unprotected bit is the check for fb_helper->fb.
      
      With that drivers can first initialize the fb helper, then enabel
      hotplug processing and then set up the initial config all in a
      completely race-free manner. Update kerneldoc and convert i915 as a
      proof of concept.
      
      Feature requested by Thierry since his tegra driver atm reliably boots
      slowly enough to misses the hotplug event for an external hdmi screen,
      but also reliably boots to quickly for the hpd pin to be asserted when
      the fb helper calls into the hdmi ->detect function.
      
      Cc: Thierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      50c3dc97
    • J
      drm/i915: Corrected 'file_priv' to 'file' in 'i915_driver_preclose()' · 2885f6ac
      John Harrison 提交于
      The 'i915_driver_preclose()' function has a parameter called 'file_priv'.
      However, this is misleading as the structure it points to is a 'drm_file' not a
      'drm_i915_file_private'. It should be named just 'file' to avoid confusion.
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2885f6ac
  4. 17 6月, 2014 1 次提交
    • S
      drm/i915: Replaced Blitter ring based flips with MMIO flips · 84c33a64
      Sourab Gupta 提交于
      This patch enables the framework for using MMIO based flip calls,
      in contrast with the CS based flip calls which are being used currently.
      
      MMIO based flip calls can be enabled on architectures where
      Render and Blitter engines reside in different power wells. The
      decision to use MMIO flips can be made based on workloads to give
      100% residency for Media power well.
      
      v2: The MMIO flips now use the interrupt driven mechanism for issuing the
      flips when target seqno is reached. (Incorporating Ville's idea)
      
      v3: Rebasing on latest code. Code restructuring after incorporating
      Damien's comments
      
      v4: Addressing Ville's review comments
          -general cleanup
          -updating only base addr instead of calling update_primary_plane
          -extending patch for gen5+ platforms
      
      v5: Addressed Ville's review comments
          -Making mmio flip vs cs flip selection based on module parameter
          -Adding check for DRIVER_MODESET feature in notify_ring before calling
           notify mmio flip.
          -Other changes mostly in function arguments
      
      v6: -Having a seperate function to check condition for using mmio flips (Ville)
          -propogating error code from i915_gem_check_olr (Ville)
      
      v7: -Adding __must_check with i915_gem_check_olr (Chris)
          -Renaming mmio_flip_data to mmio_flip (Chris)
          -Rebasing on latest nightly
      
      v8: -Rebasing on latest code
          -squash 3rd patch in series(mmio setbase vs page flip race) with this patch
          -Added new tiling mode update in intel_do_mmio_flip (Chris)
      
      v9: -check for obj->last_write_seqno being 0 instead of obj->ring being NULL in
      intel_postpone_flip, as this is a more restrictive condition (Chris)
      
      v10: -Applied Chris's suggestions for squashing patches 2,3 into this patch.
      These patches make the selection of CS vs MMIO flip at the page flip time, and
      make the module parameter for using mmio flips as tristate, the states being
      'force CS flips', 'force mmio flips', 'driver discretion'.
      Changed the logic for driver discretion (Chris)
      
      v11: Minor code cleanup(better readability, fixing whitespace errors, using
      lockdep to check mutex locked status in postpone_flip, removal of __must_check
      in function definition) (Chris)
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NSourab Gupta <sourab.gupta@intel.com>
      Signed-off-by: NAkash Goel <akash.goel@intel.com>
      Tested-by: Chris Wilson <chris@chris-wilson.co.uk> # snb, ivb
      [danvet: Fix up parameter alignement checkpatch spotted.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      84c33a64
  5. 13 6月, 2014 1 次提交
  6. 11 6月, 2014 1 次提交
  7. 10 6月, 2014 2 次提交
  8. 07 6月, 2014 1 次提交
  9. 27 5月, 2014 1 次提交
  10. 23 5月, 2014 3 次提交
    • O
      drm/i915: Split the ringbuffers from the rings (3/3) · 93b0a4e0
      Oscar Mateo 提交于
      Manual cleanup after the previous Coccinelle script.
      
      Yes, I could write another Coccinelle script to do this but I
      don't want labor-replacing robots making an honest programmer's
      work obsolete (also, I'm lazy).
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      93b0a4e0
    • O
      drm/i915: Split the ringbuffers from the rings (2/3) · ee1b1e5e
      Oscar Mateo 提交于
      This refactoring has been performed using the following Coccinelle
      semantic script:
      
          @@
          struct intel_engine_cs r;
          @@
          (
          - (r).obj
          + r.buffer->obj
          |
          - (r).virtual_start
          + r.buffer->virtual_start
          |
          - (r).head
          + r.buffer->head
          |
          - (r).tail
          + r.buffer->tail
          |
          - (r).space
          + r.buffer->space
          |
          - (r).size
          + r.buffer->size
          |
          - (r).effective_size
          + r.buffer->effective_size
          |
          - (r).last_retired_head
          + r.buffer->last_retired_head
          )
      
          @@
          struct intel_engine_cs *r;
          @@
          (
          - (r)->obj
          + r->buffer->obj
          |
          - (r)->virtual_start
          + r->buffer->virtual_start
          |
          - (r)->head
          + r->buffer->head
          |
          - (r)->tail
          + r->buffer->tail
          |
          - (r)->space
          + r->buffer->space
          |
          - (r)->size
          + r->buffer->size
          |
          - (r)->effective_size
          + r->buffer->effective_size
          |
          - (r)->last_retired_head
          + r->buffer->last_retired_head
          )
      
          @@
          expression E;
          @@
          (
          - LP_RING(E)->obj
          + LP_RING(E)->buffer->obj
          |
          - LP_RING(E)->virtual_start
          + LP_RING(E)->buffer->virtual_start
          |
          - LP_RING(E)->head
          + LP_RING(E)->buffer->head
          |
          - LP_RING(E)->tail
          + LP_RING(E)->buffer->tail
          |
          - LP_RING(E)->space
          + LP_RING(E)->buffer->space
          |
          - LP_RING(E)->size
          + LP_RING(E)->buffer->size
          |
          - LP_RING(E)->effective_size
          + LP_RING(E)->buffer->effective_size
          |
          - LP_RING(E)->last_retired_head
          + LP_RING(E)->buffer->last_retired_head
          )
      
      Note: On top of this this patch also removes the now unused ringbuffer
      fields in intel_engine_cs.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      [danvet: Add note about fixup patch included here.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ee1b1e5e
    • O
      drm/i915: s/intel_ring_buffer/intel_engine_cs · a4872ba6
      Oscar Mateo 提交于
      In the upcoming patches we plan to break the correlation between
      engine command streamers (a.k.a. rings) and ringbuffers, so it
      makes sense to refactor the code and make the change obvious.
      
      No functional changes.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a4872ba6
  11. 22 5月, 2014 1 次提交
    • D
      drm/i915: move bsd dispatch index somewhere better · bdf1e7e3
      Daniel Vetter 提交于
      Adding stuff at the bottom is really no how this should be done, since
      that's the place for ums/dri dungeons.
      
      This was added in
      
      commit a8ebba75
      Author: Zhao Yakui <yakui.zhao@intel.com>
      Date:   Thu Apr 17 10:37:40 2014 +0800
      
          drm/i915: Use the coarse ping-pong mechanism based on drm fd to dispatch the BSD command on BDW GT3
      
      Also add a note to prevent this from happening again - people really
      should be less lazy and take more time to look for a good home of
      their new driver-global state.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Zhao Yakui <yakui.zhao@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bdf1e7e3
  12. 21 5月, 2014 1 次提交
  13. 20 5月, 2014 1 次提交
  14. 17 5月, 2014 1 次提交
    • C
      drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl · 5cc9ed4b
      Chris Wilson 提交于
      By exporting the ability to map user address and inserting PTEs
      representing their backing pages into the GTT, we can exploit UMA in order
      to utilize normal application data as a texture source or even as a
      render target (depending upon the capabilities of the chipset). This has
      a number of uses, with zero-copy downloads to the GPU and efficient
      readback making the intermixed streaming of CPU and GPU operations
      fairly efficient. This ability has many widespread implications from
      faster rendering of client-side software rasterisers (chromium),
      mitigation of stalls due to read back (firefox) and to faster pipelining
      of texture data (such as pixel buffer objects in GL or data blobs in CL).
      
      v2: Compile with CONFIG_MMU_NOTIFIER
      v3: We can sleep while performing invalidate-range, which we can utilise
      to drop our page references prior to the kernel manipulating the vma
      (for either discard or cloning) and so protect normal users.
      v4: Only run the invalidate notifier if the range intercepts the bo.
      v5: Prevent userspace from attempting to GTT mmap non-page aligned buffers
      v6: Recheck after reacquire mutex for lost mmu.
      v7: Fix implicit padding of ioctl struct by rounding to next 64bit boundary.
      v8: Fix rebasing error after forwarding porting the back port.
      v9: Limit the userptr to page aligned entries. We now expect userspace
          to handle all the offset-in-page adjustments itself.
      v10: Prevent vma from being copied across fork to avoid issues with cow.
      v11: Drop vma behaviour changes -- locking is nigh on impossible.
           Use a worker to load user pages to avoid lock inversions.
      v12: Use get_task_mm()/mmput() for correct refcounting of mm.
      v13: Use a worker to release the mmu_notifier to avoid lock inversion
      v14: Decouple mmu_notifier from struct_mutex using a custom mmu_notifer
           with its own locking and tree of objects for each mm/mmu_notifier.
      v15: Prevent overlapping userptr objects, and invalidate all objects
           within the mmu_notifier range
      v16: Fix a typo for iterating over multiple objects in the range and
           rearrange error path to destroy the mmu_notifier locklessly.
           Also close a race between invalidate_range and the get_pages_worker.
      v17: Close a race between get_pages_worker/invalidate_range and fresh
           allocations of the same userptr range - and notice that
           struct_mutex was presumed to be held when during creation it wasn't.
      v18: Sigh. Fix the refactor of st_set_pages() to allocate enough memory
           for the struct sg_table and to clear it before reporting an error.
      v19: Always error out on read-only userptr requests as we don't have the
           hardware infrastructure to support them at the moment.
      v20: Refuse to implement read-only support until we have the required
           infrastructure - but reserve the bit in flags for future use.
      v21: use_mm() is not required for get_user_pages(). It is only meant to
           be used to fix up the kernel thread's current->mm for use with
           copy_user().
      v22: Use sg_alloc_table_from_pages for that chunky feeling
      v23: Export a function for sanity checking dma-buf rather than encode
           userptr details elsewhere, and clean up comments based on
           suggestions by Bradley.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: "Gong, Zhipeng" <zhipeng.gong@intel.com>
      Cc: Akash Goel <akash.goel@intel.com>
      Cc: "Volkin, Bradley D" <bradley.d.volkin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Reviewed-by: NBrad Volkin <bradley.d.volkin@intel.com>
      [danvet: Frob ioctl allocation to pick the next one - will cause a bit
      of fuss with create2 apparently, but such are the rules.]
      [danvet2: oops, forgot to git add after manual patch application]
      [danvet3: Appease sparse.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5cc9ed4b
  15. 14 5月, 2014 1 次提交
  16. 05 5月, 2014 2 次提交
    • I
      drm/i915: remove extraneous VGA power domain put calls · 713028b3
      Imre Deak 提交于
      In recent dmesg logs reported for unrelated issues I noticed some power
      domain WARNs caused by the following.
      
      The workaround
      
      commit ce352550
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Fri Sep 20 10:14:23 2013 +0300
      
          drm/i915: Fix unclaimed register access due to delayed VGA memory disable
      
      and following fixup of it
      
      commit a1485320
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Mon Sep 16 17:38:34 2013 +0300
      
          drm/i915: Move power well init earlier during driver load
      
      was partially reverted by
      
      commit 7f16e5c1
      Merge: 9d1cb914 5e01dc7b
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Mon Nov 4 16:28:47 2013 +0100
      
          Merge tag 'v3.12' into drm-intel-next
      
      but kept the power domain put calls on the error path.
      
      I think for now we can keep things as-is (not reintroduce the w/a) and just fix
      the error path, since
      - nobody complained seeing this issue
      - according to Ville someone is reworking the VGA arbitration scheme at the
        moment and when that's ready we have to rethink this part anyway
      
      So fix this by just removing the put calls from the error path as well.
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      713028b3
    • 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
  17. 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
  18. 02 4月, 2014 1 次提交
  19. 31 3月, 2014 1 次提交
  20. 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
  21. 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
  22. 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
  23. 06 3月, 2014 3 次提交
  24. 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
  25. 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
  26. 19 12月, 2013 1 次提交