1. 21 9月, 2019 1 次提交
  2. 13 9月, 2019 2 次提交
  3. 12 9月, 2019 1 次提交
  4. 06 9月, 2019 1 次提交
    • C
      drm/i915: Protect debugfs per_file_stats with RCU lock · a8c15954
      Chris Wilson 提交于
      If we make sure we grab a strong reference to each object as we dump it,
      we can reduce the locks outside of our iterators to an rcu_read_lock.
      
      This should prevent errors like:
      [ 2138.371911] BUG: KASAN: use-after-free in per_file_stats+0x43/0x380 [i915]
      [ 2138.371924] Read of size 8 at addr ffff888223651000 by task cat/8293
      
      [ 2138.371947] CPU: 0 PID: 8293 Comm: cat Not tainted 5.3.0-rc6-CI-Custom_4352+ #1
      [ 2138.371953] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./J4205-ITX, BIOS P1.40 07/14/2017
      [ 2138.371959] Call Trace:
      [ 2138.371974]  dump_stack+0x7c/0xbb
      [ 2138.372099]  ? per_file_stats+0x43/0x380 [i915]
      [ 2138.372108]  print_address_description+0x73/0x3a0
      [ 2138.372231]  ? per_file_stats+0x43/0x380 [i915]
      [ 2138.372352]  ? per_file_stats+0x43/0x380 [i915]
      [ 2138.372362]  __kasan_report+0x14e/0x192
      [ 2138.372489]  ? per_file_stats+0x43/0x380 [i915]
      [ 2138.372502]  kasan_report+0xe/0x20
      [ 2138.372625]  per_file_stats+0x43/0x380 [i915]
      [ 2138.372751]  ? i915_panel_show+0x110/0x110 [i915]
      [ 2138.372761]  idr_for_each+0xa7/0x160
      [ 2138.372773]  ? idr_get_next_ul+0x110/0x110
      [ 2138.372782]  ? do_raw_spin_lock+0x10a/0x1d0
      [ 2138.372923]  print_context_stats+0x264/0x510 [i915]
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: NDavid Weinehall <david.weinehall@linux.intel.com>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190903062133.27360-1-chris@chris-wilson.co.uk
      a8c15954
  5. 03 9月, 2019 1 次提交
    • C
      drm/i915: Replace obj->pin_global with obj->frontbuffer · 5a90606d
      Chris Wilson 提交于
      obj->pin_global was originally used as a means to keep the shrinker off
      the active scanout, but we use the vma->pin_count itself for that and
      the obj->frontbuffer to delay shrinking active framebuffers. The other
      role that obj->pin_global gained was for spotting display objects inside
      GEM and working harder to keep those coherent; for which we can again
      simply inspect obj->frontbuffer directly.
      
      Coming up next, we will want to manipulate the pin_global counter
      outside of the principle locks, so would need to make pin_global atomic.
      However, since obj->frontbuffer is already managed atomically, it makes
      sense to use that the primary key for display objects instead of having
      pin_global.
      
      Ville pointed out the principle difference is that obj->frontbuffer is
      set for as long as an intel_framebuffer is attached to an object, but
      obj->pin_global was only raised for as long as the object was active. In
      practice, this means that we consider the object as being on the scanout
      for longer than is strictly required, causing us to be more proactive in
      flushing -- though it should be true that we would have flushed
      eventually when the back became the front, except that on the flip path
      that flush is async but when hit from another ioctl it will be
      synchronous.
      
      v2: i915_gem_object_is_framebuffer()
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190902040303.14195-5-chris@chris-wilson.co.uk
      5a90606d
  6. 02 9月, 2019 1 次提交
  7. 29 8月, 2019 1 次提交
    • I
      drm/i915: Align power domain names with port names · 8a84bacb
      Imre Deak 提交于
      There is a difference in BSpec's and the driver's designation of DDI
      ports. BSpec uses the following names:
      - before GEN11:
        BSpec/driver:
        	port A/B/C/D etc
      - GEN11:
        BSpec/driver:
      	port A-F
      - GEN12:
        BSpec:
        	port A/B/C for combo PHY ports
      	port TC1-6 for Type C PHY ports
        driver:
      	port A-I.
        The driver's port D name matches BSpec's TC1 port name.
      
      So far power domains were named according to the BSpec designation, to
      make it easier to match the code against the specification. That however
      can be confusing when a power domain needs to be matched to a port on
      GEN12+. To resolve that use the driver's port A-I designation for power
      domain names too and rename the corresponding power wells so that they
      reflect the mapping from the driver's to BSpec's port name.
      
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190823100711.27833-1-imre.deak@intel.com
      8a84bacb
  8. 24 8月, 2019 6 次提交
  9. 23 8月, 2019 1 次提交
    • J
      drm/i915/psr: Make PSR registers relative to transcoders · 4ab4fa10
      José Roberto de Souza 提交于
      PSR registers are a mess, some have the full address while others just
      have the additional offset from psr_mmio_base.
      
      For BDW+ psr_mmio_base is nothing more than TRANSCODER_EDP_OFFSET +
      0x800 and using it makes more difficult for people with an PSR
      register address or PSR register name from from BSpec as i915 also
      don't match the BSpec names.
      For HSW psr_mmio_base is _DDI_BUF_CTL_A + 0x800 and PSR registers are
      only available in DDIA.
      
      Other reason to make relative to transcoder is that since BDW every
      transcoder have PSR registers, so in theory it should be possible to
      have PSR enabled in a non-eDP transcoder.
      
      So for BDW+ we can use _TRANS2() to get the register offset of any
      PSR register in any transcoder while for HSW we have _HSW_PSR_ADJ
      that will calculate the register offset for the single PSR instance,
      noting that we are already guarded about trying to enable PSR in other
      port than DDIA on HSW by the 'if (dig_port->base.port != PORT_A)' in
      intel_psr_compute_config(), this check should only be valid for HSW
      and will be changed in future.
      PSR2 registers and PSR_EVENT was added after Haswell so that is why
      _PSR_ADJ() is not used in some macros.
      
      The only registers that can not be relative to transcoder are
      PSR_IMR and PSR_IIR that are not relative to anything, so keeping it
      hardcoded. That changed for TGL but it will be handled in another
      patch.
      
      Also removing BDW_EDP_PSR_BASE from GVT because it is not used as it
      is the only PSR register that GVT have.
      
      v5:
      - Macros changed to be more explicit about HSW (Dhinakaran)
      - Squashed with the patch that added the tran parameter to the
      macros (Dhinakaran)
      
      v6:
      - Checking for interruption errors after module reload in the
      transcoder that will be used (Dhinakaran)
      - Using lowercase to the registers offsets
      
      v7:
      - Removing IS_HASWELL() from registers macros(Jani)
      
      Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Zhi Wang <zhi.a.wang@intel.com>
      Reviewed-by: NLucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: NJosé Roberto de Souza <jose.souza@intel.com>
      Signed-off-by: NLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190820223325.27490-1-jose.souza@intel.com
      4ab4fa10
  10. 22 8月, 2019 2 次提交
  11. 18 8月, 2019 1 次提交
  12. 16 8月, 2019 1 次提交
  13. 14 8月, 2019 1 次提交
  14. 13 8月, 2019 1 次提交
  15. 11 8月, 2019 1 次提交
  16. 10 8月, 2019 2 次提交
  17. 09 8月, 2019 2 次提交
  18. 07 8月, 2019 2 次提交
  19. 06 8月, 2019 1 次提交
  20. 04 8月, 2019 1 次提交
  21. 03 8月, 2019 2 次提交
    • C
      drm/i915: Hide unshrinkable context objects from the shrinker · 1aff1903
      Chris Wilson 提交于
      The shrinker cannot touch objects used by the contexts (logical state
      and ring). Currently we mark those as "pin_global" to let the shrinker
      skip over them, however, if we remove them from the shrinker lists
      entirely, we don't event have to include them in our shrink accounting.
      
      By keeping the unshrinkable objects in our shrinker tracking, we report
      a large number of objects available to be shrunk, and leave the shrinker
      deeply unsatisfied when we fail to reclaim those. The shrinker will
      persist in trying to reclaim the unavailable objects, forcing the system
      into a livelock (not even hitting the dread oomkiller).
      
      v2: Extend unshrinkable protection for perma-pinned scratch and guc
      allocations (Tvrtko)
      v3: Notice that we should be pinned when marking unshrinkable and so the
      link cannot be empty; merge duplicate paths.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190802212137.22207-1-chris@chris-wilson.co.uk
      1aff1903
    • M
      drm/i915/uc: Move GuC error log to uc and release it on fini · 32ff76e8
      Michal Wajdeczko 提交于
      When we fail to load GuC and want to abort probe, we hit:
      
      <7> [229.915779] i915 0000:00:02.0: [drm:intel_uc_init_hw [i915]] GuC initialization failed -6
      <7> [229.915813] i915 0000:00:02.0: [drm:i915_gem_init_hw [i915]] Enabling uc failed (-6)
      <4> [229.953354] ------------[ cut here ]------------
      <4> [229.953355] WARN_ON(dev_priv->mm.shrink_count)
      <4> [229.953406] WARNING: CPU: 9 PID: 3287 at drivers/gpu/drm/i915/i915_gem.c:1684 i915_gem_cleanup_early+0xfc/0x110 [i915]
      <4> [229.953464] Call Trace:
      <4> [229.953489]  i915_driver_late_release+0x19/0x60 [i915]
      <4> [229.953514]  i915_driver_probe+0xb82/0x18a0 [i915]
      <4> [229.953519]  ? __pm_runtime_resume+0x4f/0x80
      <4> [229.953545]  i915_pci_probe+0x43/0x1b0 [i915]
      ...
      <4> [229.962951] ------------[ cut here ]------------
      <4> [229.962956] DEBUG_LOCKS_WARN_ON(lock->magic != lock)
      <4> [229.962959] WARNING: CPU: 8 PID: 2395 at kernel/locking/mutex.c:912 __mutex_lock+0x750/0x9b0
      <4> [229.963091] Call Trace:
      <4> [229.963129]  ? i915_vma_destroy+0x86/0x350 [i915]
      <4> [229.963166]  ? i915_vma_destroy+0x86/0x350 [i915]
      <4> [229.963201]  i915_vma_destroy+0x86/0x350 [i915]
      <4> [229.963236]  __i915_gem_free_objects+0xb8/0x510 [i915]
      <4> [229.963270]  __i915_gem_free_work+0x5a/0x90 [i915]
      <4> [229.963275]  process_one_work+0x245/0x610
      
      as since commit 6f76098f ("drm/i915/uc: Move uC early functions
      inside the GT ones") we cleanup uc after gem.
      
      Move captured GuC load error log to uc struct and release it
      in intel_uc_fini() instead of intel_uc_driver_late_release()
      
      Note that intel_uc_driver_late_release() is now empty, but
      we can leave it as a placeholder for future code.
      Signed-off-by: NMichal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190802184055.31988-5-michal.wajdeczko@intel.com
      32ff76e8
  22. 02 8月, 2019 1 次提交
  23. 25 7月, 2019 1 次提交
  24. 23 7月, 2019 1 次提交
  25. 16 7月, 2019 1 次提交
  26. 14 7月, 2019 2 次提交
  27. 13 7月, 2019 1 次提交
  28. 12 7月, 2019 1 次提交
    • I
      drm/i915/tgl: Add power well support · 656409bb
      Imre Deak 提交于
      The patch adds the new power wells introduced by TGL (GEN 12) and
      maps these to existing/new power domains. The changes for GEN 12 wrt
      to GEN 11 are the following:
      
      - Transcoder#EDP removed from power well#1 (Transcoder#A used in
        low-power mode instead)
      - Transcoder#A is now backed by power well#1 instead of power well#3
      - The DDI#B/C combo PHY ports are now backed by power well#1 instead of
        power well#3
      - New power well#5 added for pipe#D functionality (TODO)
      - 2 additional TC ports (TC#5-6) backed by power well#3, 2 port
        specific IO power wells (only for the non-TBT modes) and 4 port
        specific AUX power wells (2-2 for TBT vs. non-TBT modes)
      - Power well#2 backs now VDSC/joining for pipe#A instead of VDSC for
        eDP and MIPI DSI (TODO)
      
      On TGL Port DDI#C changed to be a combo PHY (native DP/HDMI) and
      BSpec has renamed ports DDI#D-F to TC#4-6 respectively. Thus on ICL we
      have the following naming for ports:
      
      - Combo PHYs (native DP/HDMI):
        DDI#A-B
      - TBT/non-TBT (TC altmode, native DP/HDMI) PHYs:
        DDI#C-F
      
      Starting from GEN 12 we have the following naming for ports:
      - Combo PHYs (native DP/HDMI):
        DDI#A-C
      - TBT/non-TBT (TC altmode, native DP/HDMI) PHYs:
        DDI TC#1-6
      
      To save some space in the power domain enum the power domain naming in
      the driver reflects the above change, that is power domains TC#1-3 are
      added as aliases for DDI#D-F and new power domains are reserved for
      TC#4-6.
      
      v2 (Lucas):
        - Separate out the bits and definitions for TGL from the ICL ones.
          Fix use of TRANSCODER_EDP_VDSC, that is now the correct define since
          we don't define TRANSCODER_A_VDSC power domain to spare a one bit in
          the bitmask (suggested by Ville)
      v3 (Lucas):
        - Fix missing squashes on v2
        - Rebase on renamed TRANSCODER_EDP_VDSC
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: José Roberto de Souza <jose.souza@intel.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NLucas De Marchi <lucas.demarchi@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190711173115.28296-9-lucas.demarchi@intel.com
      656409bb