1. 20 11月, 2014 1 次提交
  2. 17 11月, 2014 1 次提交
  3. 14 11月, 2014 1 次提交
    • C
      drm/i915: Make the physical object coherent with GTT · 6a2c4232
      Chris Wilson 提交于
      Currently objects for which the hardware needs a contiguous physical
      address are allocated a shadow backing storage to satisfy the contraint.
      This shadow buffer is not wired into the normal obj->pages and so the
      physical object is incoherent with accesses via the GPU, GTT and CPU. By
      setting up the appropriate scatter-gather table, we can allow userspace
      to access the physical object via either a GTT mmaping of or by rendering
      into the GEM bo. However, keeping the CPU mmap of the shmemfs backing
      storage coherent with the contiguous shadow is not yet possible.
      Fortuituously, CPU mmaps of objects requiring physical addresses are not
      expected to be coherent anyway.
      
      This allows the physical constraint of the GEM object to be transparent
      to userspace and allow it to efficiently render into or update them via
      the GTT and GPU.
      
      v2: Fix leak of pci handle spotted by Ville
      v3: Remove the now duplicate call to detach_phys_object during free.
      v4: Wait for rendering before pwrite. As this patch makes it possible to
      render into the phys object, we should make it correct as well!
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6a2c4232
  4. 24 10月, 2014 2 次提交
    • I
      drm/i915: unify switcheroo and legacy suspend/resume handlers · fc49b3da
      Imre Deak 提交于
      By now we handle switcheroo and legacy suspend/resume the same way, so
      no need to keep separate functions for them.
      
      No functional change.
      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>
      fc49b3da
    • P
      drm/i915: call drm_vblank_cleanup() earlier at unload · 2ebfaf5f
      Paulo Zanoni 提交于
      In its current place, it just segfaults while trying to access the
      CRTC structures:
      
      [ 9132.421681] Call Trace:
      [ 9132.421707]  [<ffffffffa01130d8>] i915_get_crtc_scanoutpos+0x1e8/0x220 [i915]
      [ 9132.421727]  [<ffffffffa001da34>] drm_calc_vbltimestamp_from_scanoutpos+0x94/0x330 [drm]
      [ 9132.421744]  [<ffffffffa001d240>] ?vblank_disable_and_save+0x40/0x1e0 [drm]
      [ 9132.421769]  [<ffffffffa0114328>] i915_get_vblank_timestamp+0x68/0xb0 [i915]
      [ 9132.421786]  [<ffffffffa001d094>] drm_get_last_vbltimestamp+0x44/0x80 [drm]
      [ 9132.421801]  [<ffffffffa001d3a6>] vblank_disable_and_save+0x1a6/0x1e0 [drm]
      [ 9132.421817]  [<ffffffffa001eac1>] drm_vblank_cleanup+0x61/0xa0 [drm]
      [ 9132.421849]  [<ffffffffa0177a5e>] i915_driver_unload+0xde/0x290 [i915]
      [ 9132.421867]  [<ffffffffa0020264>] drm_dev_unregister+0x24/0xb0 [drm]
      [ 9132.421884]  [<ffffffffa002090e>] drm_put_dev+0x1e/0x70 [drm]
      [ 9132.421901]  [<ffffffffa00e01e0>] i915_pci_remove+0x10/0x20 [i915]
      [ 9132.421910]  [<ffffffff81347556>] pci_device_remove+0x36/0xb0
      [ 9132.421920]  [<ffffffff8140084a>] __device_release_driver+0x7a/0xf0
      [ 9132.421928]  [<ffffffff81400fc8>] driver_detach+0xb8/0xc0
      [ 9132.421936]  [<ffffffff8140054a>] bus_remove_driver+0x4a/0xb0
      [ 9132.421944]  [<ffffffff81401717>] driver_unregister+0x27/0x50
      [ 9132.421953]  [<ffffffff81346f65>] pci_unregister_driver+0x25/0x70
      [ 9132.421971]  [<ffffffffa00229c8>] drm_pci_exit+0x78/0xa0 [drm]
      [ 9132.422000]  [<ffffffffa017a6d2>] i915_exit+0x20/0x94e [i915]
      [ 9132.422009]  [<ffffffff810fb9dc>] SyS_delete_module+0x13c/0x1f0
      [ 9132.422019]  [<ffffffff8131c5fb>] ?
      trace_hardirqs_on_thunk+0x3a/0x3f
      [ 9132.422028]  [<ffffffff816f7792>] system_call_fastpath+0x16/0x1b
      
      This means it has to be before intel_modeset_cleanup, which cleans the
      CRTC structures. But if we move it to before intel_fbdev_fini(), we
      get WARNs because intel_fbdev_fini() still tries to use the vblanks,
      so the only acceptable point for drm_vblank_cleanup() seems to be this
      place.
      
      Related commit:
      
          commit cbb47d17
          Author: Chris Wilson <chris@chris-wilson.co.uk>
          Date:   Mon Sep 23 17:33:20 2013 -0300
              drm/i915: Add some missing steps to i915_driver_load error path
      
      Testsuite: igt/drv_module_reload
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77511
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83484Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2ebfaf5f
  5. 03 10月, 2014 2 次提交
  6. 01 10月, 2014 2 次提交
  7. 24 9月, 2014 1 次提交
  8. 19 9月, 2014 1 次提交
  9. 12 9月, 2014 1 次提交
  10. 10 9月, 2014 1 次提交
  11. 08 9月, 2014 1 次提交
    • D
      drm/i915: Fix irq enable tracking in driver load · 4868b45d
      Daniel Vetter 提交于
      A bunch of warnings fire on some ->irq_postinstall hooks since those
      can enable interrupts (e.g. rps interrupts). And then our ordering
      self-checks fire and complain.
      
      To fix that set the tracking boolen before enabling the irqs with
      drm_irq_install. Quoting the discussion with Jesse why that's safe:
      
      On Tue, Aug 26, 2014 at 11:18 PM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
      > Yes, it might work, but if you look through the history, we set this
      > field carefully; first to true in the irq_init code, then to false only
      > after the irq_install completes.  So I think your fragility arguments
      > apply to this change too.
      
      Well we've done it in 4 commits or so, but currently we have:
      
      - Set irqs_disabled to true early in driver load to make sure checks
      that. That's done in irq_init, which is totally not the function that
      enables interrupts, only the function that initializes all the vtables
      and similar things. We actually have a fairly sane naming scheme
      nowadays (not fully consistent ofc): _init is sw setup,
      _enable/_hw_init is the actual hw setup. That is done in
      95f25bed
      
      - Set irqs_disabled to false right after the irqs are actually
      enabled. This is done in ed2e6df1
      
      So my change should only move the flag change over the ->preinstall
      and ->postinstall hooks. I've done a little audit and didn't spot
      anything amiss. Furthermore the runtime pm setup already clears
      irqs_disabled _before_ calling these two hooks.
      
      This regression has been introduced in
      
      commit ed2e6df1
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Fri Jun 20 09:39:36 2014 -0700
      
          drm/i915: clear pm._irqs_disabled field after installing IRQs
      
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Oliver Hartkopp <socketcan@hartkopp.net>
      Tested-by: NOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Tested-by: Chris Wilson <chris@chris-wilson.co.uk> # gm45, ilk
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      4868b45d
  12. 03 9月, 2014 2 次提交
  13. 13 8月, 2014 5 次提交
  14. 11 8月, 2014 2 次提交
  15. 08 8月, 2014 1 次提交
    • V
      drm/i915: Free pending page flip events at .preclose() · e2fcdaa9
      Ville Syrjälä 提交于
      If there are pending page flips when the fd gets closed those page
      flips may have events associated to them. When the page flip eventually
      completes it will queue the event to file_priv->event_list, but that
      may be too late and file_priv->event_list has already been cleaned up.
      Thus we leak a bit of kernel memory in the form of the event structure.
      
      To avoid such problems clear out such pending events from
      intel_crtc->unpin_work at ->preclose(). Any event that already made it
      to file_priv->event_list will get cleaned up by the drm_release_events()
      a bit later.
      
      We can ignore the file_priv->event_space accounting since file_priv is
      going away. This is already how drm core deals with pending vblank
      events, which are maintained by the drm core.
      
      What saves us from a total disaster (ie. dereferencing and alrady
      freed file_priv) is the fact that the fb descruction triggers a modeset
      and there we wait for pending flips.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e2fcdaa9
  16. 23 7月, 2014 2 次提交
  17. 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
  18. 11 7月, 2014 1 次提交
  19. 09 7月, 2014 1 次提交
    • D
      drm/i915: Only unbind vgacon, not other console drivers · 1bb9e632
      Daniel Vetter 提交于
      The console subsystem only provides a function to switch to a given
      console, but we want to actually only switach away from vgacon.
      Unconditionally switching to the dummy console resulted in switching
      away from fbcon in multi-gpu setups when other gpu drivers are loaded
      before i915.
      
      Then either the reinitialization of fbcon when i915 registers its
      fbdev emulation or the teardown of the fbcon driver killed the
      machine. So only switch to the dummy console when it's required.
      
      Kudos to Chris for the original idea, I've only refined it a bit to
      still unregister vgacon even when it's currently unused.
      
      This regression has been introduced in
      
      commit a4de0526
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Jun 5 16:20:46 2014 +0200
      
          drm/i915: Kick out vga console
      Reported-and-tested-by: NEd Tomlinson <edt@aei.ca>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1bb9e632
  20. 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
  21. 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
  22. 13 6月, 2014 1 次提交
  23. 11 6月, 2014 1 次提交
  24. 10 6月, 2014 2 次提交
  25. 07 6月, 2014 1 次提交
  26. 27 5月, 2014 1 次提交
  27. 23 5月, 2014 2 次提交
    • 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