Skip to content
  1. Sep 21, 2018
  2. Sep 20, 2018
  3. Sep 19, 2018
  4. Sep 18, 2018
    • Ville Syrjälä's avatar
      drm/i915: Fix logic fumble in rotation vs. ccs check · 1ee516ff
      Ville Syrjälä authored
      
      
      Smatch reports:
      ../drivers/gpu/drm/i915/intel_sprite.c:1192 skl_plane_check_fb() warn: was || intended here instead of &&?
      
      Obviously smatch is correct here since we're trying to check if we're
      using either of the ccs modifiers. Since we now have is_ccs_modifier()
      let's use it to fix this.
      
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: José Roberto de Souza <jose.souza@intel.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Fixes: e21c2d33
      
       ("drm/i915: Move skl plane fb related checks into a better place")
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180918131059.793-1-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      1ee516ff
    • Ville Syrjälä's avatar
      drm/i915: Replace some PAGE_SHIFTs with I915_GTT_PAGE_SIZE · 21c62a9d
      Ville Syrjälä authored
      
      
      Clean up some cases where we're dealing with GTT pages instead of
      system pages to use I915_GTT_PAGE_SIZE instead of PAGE_SHIT. So
      just replace the the shifts with mul/div as appropriate. These
      are the easy ones, the rest probably need some actual thought.
      
      No real changes in the generated asm. Only gen8_ppgtt_insert_4lvl()
      was affected as gcc decided to do the following change:
      -     be9:       89 d9                   mov    %ebx,%ecx
      -     beb:       c1 e1 0c                shl    $0xc,%ecx
      -     bee:       48 63 c9                movslq %ecx,%rcx
      +     be9:       48 63 cb                movslq %ebx,%rcx
      +     bec:       48 c1 e1 0c             shl    $0xc,%rcx
      and that then shifted a bunch of the offset by one byte. I presume
      the sign extensions in the asm are due to integer promotions from
      u16 etc. Hopefully someone has confirmed that those don't end up
      doing the wrong thing for us.
      
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180917171414.19220-1-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      21c62a9d
  5. Sep 15, 2018
  6. Sep 14, 2018
    • Chris Wilson's avatar
      drm/i915/execlists: Reset CSB pointers on canceling requests (wedging) · 8db601f0
      Chris Wilson authored
      
      
      The prior assumption was that we did not need to reset the CSB on
      wedging when cancelling the outstanding requests as it would be cleaned
      up in the subsequent reset prior to restarting the GPU. However, what
      was not accounted for was that in preparing for the reset, we would try
      to process the outstanding CSB entries. If the GPU happened to complete
      a CS event just as we were performing the cancellation of requests, that
      event would be kept in the CSB until the reset -- but our bookkeeping
      was cleared, causing confusion when trying to complete the CS event.
      
      v2: Use a sanitize on unwedge to avoid interfering with eio suspend
      (where we intentionally disable GPU reset).
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107925
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180914080017.30308-3-chris@chris-wilson.co.uk
      8db601f0
    • Chris Wilson's avatar
      drm/i915: Include fence-hint for timeout warning · 5791bad4
      Chris Wilson authored
      
      
      If an asynchronous wait on a foriegn fence, we print a warning
      indicating which fence was not signaled. As i915_sw_fences become more
      common, include the debug hint (the symbol-name of the target) to help
      identify the waiter. E.g.
      
      [   31.968144] Asynchronous wait on fence sw_sync:gem_eio:1 timed out (hint:submit_notify [i915])
      
      We also want to downgrade from a warning to a notice (normal but
      significant condition) as the timeout is imposed and controlled by the
      caller (i.e. it is deliberate) and can be provoked by userspace.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180914124007.18790-1-chris@chris-wilson.co.uk
      5791bad4
    • Chris Wilson's avatar
      drm/i915/execlists: Use coherent writes into the context image · 666424ab
      Chris Wilson authored
      
      
      That we use a WB mapping for updating the RING_TAIL register inside the
      context image even on !llc machines has been a source of consternation
      for every reader. It appears to work on bsw+, but it may just have been
      that we have been incredibly bad at detecting the errors.
      
      v2: With extra enthusiasm.
      v3: Drop force of map type for pinned default_state as by the time we
      pin it, the map type is always WB and doesn't conflict with the earlier
      use by ce->state.
      v4: Transfer engine->default_state from MAP_WC to MAP_WB on creation so
      we do not need the MAP_FORCE littered around the backends
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180914123504.2062-3-chris@chris-wilson.co.uk
      666424ab
    • Chris Wilson's avatar
      drm/i915: Check engine->default_state mapping on module load · 37d7c9cc
      Chris Wilson authored
      
      
      Check we can indeed acquire a WB mapping of the context image on module
      load. Later this will give us the opportunity to validate that we can
      switch from WC to WB as required.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180914123504.2062-2-chris@chris-wilson.co.uk
      37d7c9cc
    • Chris Wilson's avatar
      drm/i915/execlists: Delay updating ring register state after resume · dee60ca1
      Chris Wilson authored
      
      
      Now that we reload both RING_HEAD and RING_TAIL when rebinding the
      context, we do not need to scrub those registers immediately on resume.
      
      v2: Handle the perma-pinned contexts.
      v3: Set RING_TAIL on context-pin so that we always have known state in
      the context image for the ring registers and all parties have similar
      code (ripe for refactoring).
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180914123504.2062-1-chris@chris-wilson.co.uk
      dee60ca1
    • Chris Wilson's avatar
      drm/i915: Flush the tasklet when checking for idle · 22495b68
      Chris Wilson authored
      
      
      In order to reduce latency when checking for idle we kick the tasklet
      directly. Sometimes this is not enough as it is queued on another cpu
      and so to improve the accuracy of this idle-check (and so to reduce
      latency overall by avoiding another pass, or worse declaring a timeout!)
      wait for the tasklet to complete.
      
      References: https://bugs.freedesktop.org/show_bug.cgi?id=107916
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180914080017.30308-2-chris@chris-wilson.co.uk
      22495b68
    • Chris Wilson's avatar
      drm/i915: Limit the backpressure for i915_request allocation · 11abf0c5
      Chris Wilson authored
      
      
      If we try and fail to allocate a i915_request, we apply some
      backpressure on the clients to throttle the memory allocations coming
      from i915.ko. Currently, we wait until completely idle, but this is far
      too heavy and leads to some situations where the only escape is to
      declare a client hung and reset the GPU. The intent is to only ratelimit
      the allocation requests and to allow ourselves to recycle requests and
      memory from any long queues built up by a client hog.
      
      Although the system memory is inherently a global resources, we don't
      want to overly penalize an unlucky client to pay the price of reaping a
      hog. To reduce the influence of one client on another, we can instead of
      waiting for the entire GPU to idle, impose a barrier on the local client.
      (One end goal for request allocation is for scalability to many
      concurrent allocators; simultaneous execbufs.)
      
      To prevent ourselves from getting caught out by long running requests
      (requests that may never finish without userspace intervention, whom we
      are blocking) we need to impose a finite timeout, ideally shorter than
      hangcheck. A long time ago Paul McKenney suggested that RCU users should
      ratelimit themselves using judicious use of cond_synchronize_rcu(). This
      gives us the opportunity to reduce our indefinite wait for the GPU to
      idle to a wait for the RCU grace period of the previous allocation along
      this timeline to expire, satisfying both the local and finite properties
      we desire for our ratelimiting.
      
      There are still a few global steps (reclaim not least amongst those!)
      when we exhaust the immediate slab pool, at least now the wait is itself
      decoupled from struct_mutex for our glorious highly parallel future!
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106680
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180914080017.30308-1-chris@chris-wilson.co.uk
      11abf0c5
    • Chris Wilson's avatar
      drm/i915: Mark up a couple of KMS debug messages as such · 43031788
      Chris Wilson authored
      
      
      For finding the panel fitter and PLL for a particular modeset is a part
      of that modeset and should be included with the reset of the
      DRM_DEBUG_KMS.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180913131629.3978-1-chris@chris-wilson.co.uk
      43031788
    • Mahesh Kumar's avatar
      drm/i915/kbl+: Enable IPC only for symmetric memory configurations · 8a6c5447
      Mahesh Kumar authored
      
      
      IPC may cause underflows if not used with dual channel symmetric
      memory configuration. Disable IPC for non symmetric configurations in
      affected platforms.
      Display WA #1141
      
      Changes Since V1:
       - Re-arrange the code.
       - update wrapper to return if memory is symmetric (Rodrigo)
      
      Signed-off-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180824093225.12598-6-mahesh1.kumar@intel.com
      8a6c5447
    • Mahesh Kumar's avatar
      drm/i915/skl+: don't trust IPC value set by BIOS · f361912a
      Mahesh Kumar authored
      
      
      If KMS decide to disable IPC make sure we override IPC configuration set
      by BIOS.
      
      Signed-off-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180824093225.12598-5-mahesh1.kumar@intel.com
      f361912a
    • Mahesh Kumar's avatar
      drm/i915: Implement 16GB dimm wa for latency level-0 · 86b59287
      Mahesh Kumar authored
      
      
      Memory with 16GB dimms require an increase of 1us in level-0 latency.
      This patch implements the same.
      Bspec: 4381
      
      changes since V1:
       - s/memdev_info/dram_info
       - make skl_is_16gb_dimm pure function
      Changes since V2:
       - make is_16gb_dimm more generic
       - rebase
      Changes since V3:
       - Simplify condition (Maarten)
      
      Signed-off-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180831110942.9234-1-mahesh1.kumar@intel.com
      86b59287
    • Mahesh Kumar's avatar
      drm/i915/skl+: Decode memory bandwidth and parameters · 5771caf8
      Mahesh Kumar authored
      
      
      This patch adds support to decode system memory bandwidth and other
      parameters for skylake and Gen9+ platforms, which will be used for
      arbitrated display memory bandwidth calculation in GEN9 based
      platforms and WM latency level-0 Work-around calculation on GEN9+.
      
      Changes Since V1:
       - s/memdev_info/dram_info
       - create a struct to hold channel info
      Changes Since V2:
       - rewrite code to adhere i915 coding style
       - not valid for GLK
      
      Signed-off-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180824093225.12598-3-mahesh1.kumar@intel.com
      5771caf8
    • Mahesh Kumar's avatar
      drm/i915/bxt: Decode memory bandwidth and parameters · cbfa59d4
      Mahesh Kumar authored
      
      
      This patch adds support to decode system memory bandwidth and other
      parameters for broxton platform, which will be used for arbitrated
      display memory bandwidth calculation in GEN9 based platforms and
      WM latency level-0 Work-around calculation on GEN9+ platforms.
      
      Changes since V1:
       - s/memdev_info/dram_info
      Changes since V2:
       - Adhere to i915 coding style (Rodrigo)
      
      Signed-off-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180824093225.12598-2-mahesh1.kumar@intel.com
      cbfa59d4
    • Anusha Srivatsa's avatar
      firmware/dmc/icl: load v1.07 on icelake. · 4445930f
      Anusha Srivatsa authored
      
      
      Add Support to load DMC on Icelake.
      
      While at it, also add support to load the firmware
      during system resume.
      
      v2: load firmware during system resume.(Imre)
      
      v3: enable has_csr for icelake.(Jyoti)
      
      v4: Only load the firmware in this patch
      
      Cc: Jyoti Yadav <jyoti.r.yadav@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarAnusha Srivatsa <anusha.srivatsa@intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180828003844.4682-2-anusha.srivatsa@intel.com
      4445930f
    • Ville Syrjälä's avatar
      drm/i915: Fix a potential integer overflow with framebuffers extending past 4 GiB · 4e05047d
      Ville Syrjälä authored
      
      
      If we have framebuffers that are >= 4GiB in size we will overflow
      the fb size check in intel_fill_fb_info().
      
      Currently that is only possible with NV12 and CCS as offsets[1]
      may be anything between 0 and 0xffffffff. offsets[0] is currently
      required to be 0 so we can't hit the overflow with any single
      plane format (thanks to max fb size of 8kx8k and max stride of
      32 KiB).
      
      In the future we may allow almost any framebuffer to exceed 4GiB
      in size so we really should fix the overflow. Not that the overflow
      is particularly dangerous. It's mostly just a sanity check against
      insane userspace. The display engine can't write to memory anyway
      so I suppose in the worst case we might anger the hw by attempting
      scanout past the end of the ggtt, or we might scan out some data
      that we're not supposed to see from other parts of the ggtt.
      
      Note that triggering this overflow depends on the driver
      aligning the fb height to the next tile boundary to push the
      calculated size above 4GiB. With linear buffers the effective
      tile height is one so that never happens, and the core already
      has a check for 32bit overflow of offsets[]+pitches[]*height.
      
      v2: Drop the unnecessary cast (Chris)
      
      Testcase: igt/kms_big_fb/x-tiled-addfb-size-offset-overflow
      Testcase: igt/kms_big_fb/y-tiled-addfb-size-offset-overflow
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180912180443.28649-1-ville.syrjala@linux.intel.com
      4e05047d
    • Ville Syrjälä's avatar
      drm/i915: Replace some PAGE_SIZE with I915_GTT_PAGE_SIZE · f6e35cda
      Ville Syrjälä authored
      
      
      Use I915_GTT_PAGE_SIZE when talking about GTT pages rather than
      physical pages.
      
      There are some PAGE_SHIFTs left though. Not sure if we want to
      introduce I915_GTT_PAGE_SHIFT or what?
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> # at least some of it :)
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180913150405.706-1-ville.syrjala@linux.intel.com
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      f6e35cda
  7. Sep 13, 2018
    • Tvrtko Ursulin's avatar
      i915/oa: Simplify updating contexts · 722f3de3
      Tvrtko Ursulin authored
      
      
      We can remove the update-via-batch-buffer code path, which is basically an
      effective duplicate of update-via-context-image path, if we notice that
      after we have idled the GPU, we can update the context image even of the
      kernel context directly. (Update-via-batch-buffer path existed only to
      solve the problem of how to update the kernel context image.)
      
      Only additional thing needed is to activate the edited configuration by
      sending one empty request down the pipe. This accomplishes context restore
      of the updated kernel context and so the OA configuration gets written out
      to it's control registers.
      
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180912152930.28237-1-tvrtko.ursulin@linux.intel.com
      722f3de3
  8. Sep 12, 2018