<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/i915/intel_ringbuffer.h, branch linux-4.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-05-23T13:21:04Z</updated>
<entry>
<title>drm/i915: Unify intel_ring_begin()</title>
<updated>2016-05-23T13:21:04Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-04-28T08:56:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=92dcc67c11d51671cca8df543e25c601e52336ad'/>
<id>urn:sha1:92dcc67c11d51671cca8df543e25c601e52336ad</id>
<content type='text'>
Combine the near identical implementations of intel_logical_ring_begin()
and intel_ring_begin() - the only difference is that the logical wait
has to check for a matching ring (which is assumed by legacy).

In the process some debug messages are culled as there were following a
WARN if we hit an actual error.

v2: Updated commentary

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Cc: Tvrtko Ursulin &lt;tvrtko.ursulin@linux.intel.com&gt;
Reviewed-by: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1461833819-3991-12-git-send-email-chris@chris-wilson.co.uk
(cherry picked from commit 987046ad65361a8b038fbf8d76d152237fb7acf1)
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>drm/i915: Fix gen8 semaphores id for legacy mode</title>
<updated>2016-05-23T08:17:39Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-04-29T12:18:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=83e538020018e3235f5ec40a1f2dfc673bb5ae3c'/>
<id>urn:sha1:83e538020018e3235f5ec40a1f2dfc673bb5ae3c</id>
<content type='text'>
With the introduction of a distinct engine-&gt;id vs the hardware id, we need
to fix up the value we use for selecting the target engine when signaling
a semaphore. Note that these values can be merged with engine-&gt;guc_id.

Fixes: de1add360522c876c25ef2bbbbab1c94bdb509ab
Cc: stable@vger.kernel.org # v4.6
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1461932305-14637-3-git-send-email-chris@chris-wilson.co.uk
(cherry picked from commit 215a7e3210eb208abe634480741e418b5a8bf60c)
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>drm/i915: Only grab correct forcewake for the engine with execlists</title>
<updated>2016-04-12T14:35:22Z</updated>
<author>
<name>Tvrtko Ursulin</name>
</author>
<published>2016-04-12T13:37:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3756685a18e6aa74ca3484192b64f4f8a11c8bb5'/>
<id>urn:sha1:3756685a18e6aa74ca3484192b64f4f8a11c8bb5</id>
<content type='text'>
Rather than blindly waking up all forcewake domains on command
submission, we can teach each engine what is (or are) the correct
one to take.

On platforms with multiple forcewake domains like VLV, CHV, SKL
and BXT, this has the potential of lowering the GPU and CPU
power use and submission latency.

To implement it we add a function named
intel_uncore_forcewake_for_reg whose purpose is to query which
forcewake domains need to be taken to read or write a specific
register with raw mmio accessors.

These enables the execlists engine setup  to query which
forcewake domains are relevant per engine on the currently
running platform.

v2:
  * Kerneldoc.
  * Split from intel_uncore.c macro extraction, WARN_ON,
    no warns on old platforms. (Chris Wilson)

v3:
  * Single domain per engine, mention all registers,
    bi-directional function and a new name, fix handling
    of gen6 and gen7 writes. (Chris Wilson)

Signed-off-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1460468251-14069-1-git-send-email-tvrtko.ursulin@linux.intel.com
</content>
</entry>
<entry>
<title>drm/i915: Replace manual barrier() with READ_ONCE() in HWS accessor</title>
<updated>2016-04-09T11:09:59Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-04-09T09:57:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5dd8e50c27cd9294e53fc4c4b25b86abc469a4d4'/>
<id>urn:sha1:5dd8e50c27cd9294e53fc4c4b25b86abc469a4d4</id>
<content type='text'>
When reading from the HWS page, we use barrier() to prevent the compiler
optimising away the read from the volatile (may be updated by the GPU)
memory address. This is more suited to READ_ONCE(); make it so.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Mika Kuoppala &lt;mika.kuoppala@intel.com&gt;
Reviewed-by: Mika Kuoppala &lt;mika.kuoppala@intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1460195877-20520-5-git-send-email-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915: Use simplest form for flushing the single cacheline in the HWS</title>
<updated>2016-04-09T11:09:45Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-04-09T09:57:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d317ce99e226a338fe0962e711795c6a8ed2cb2'/>
<id>urn:sha1:0d317ce99e226a338fe0962e711795c6a8ed2cb2</id>
<content type='text'>
Rather than call a function to compute the matching cachelines and
clflush them, just call the clflush *instruction* directly. We also know
that we can use the unpatched plain clflush rather than the clflushopt
alternative.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Mika Kuoppala &lt;mika.kuoppala@intel.com&gt;
Cc: Imre Deak &lt;imre.deak@intel.com&gt;
Reviewed-by: Mika Kuoppala &lt;mika.kuoppala@intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1460195877-20520-4-git-send-email-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915: Harden detection of missed interrupts</title>
<updated>2016-04-09T11:09:29Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-04-09T09:57:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=12471ba87a08bd1dd0aac18015d7782e02ea02de'/>
<id>urn:sha1:12471ba87a08bd1dd0aac18015d7782e02ea02de</id>
<content type='text'>
Only declare a missed interrupt if we find that the GPU is idle with
waiters and a hangcheck interval has passed in which no new user
interrupts have been raised.

v2: Clear the stuck interrupt marker between successful batches

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Mika Kuoppala &lt;mika.kuoppala@intel.com&gt;
Reviewed-by: Mika Kuoppala &lt;mika.kuoppala@intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1460195877-20520-3-git-send-email-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915: Separate out the seqno-barrier from engine-&gt;get_seqno</title>
<updated>2016-04-09T11:09:05Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-04-09T09:57:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c04e0f3b4ea01b3b1d81ccfce0a73bb0b297ba46'/>
<id>urn:sha1:c04e0f3b4ea01b3b1d81ccfce0a73bb0b297ba46</id>
<content type='text'>
In order to simplify future patches, extract the
lazy_coherency optimisation our of the engine-&gt;get_seqno() vfunc into
its own callback.

v2: Rename the barrier to engine-&gt;irq_seqno_barrier to try and better
reflect that the barrier is only required after the user interrupt before
reading the seqno (to ensure that the seqno update lands in time as we
do not have strict seqno-irq ordering on all platforms).

Reviewed-by: Dave Gordon &lt;david.s.gordon@intel.com&gt; [#v2]

v3: Comments for hangcheck paranoia. Mika wanted to keep the extra
barrier inside the hangcheck, just in case. I can argue that it doesn't
provide a barrier against anything, but the side-effects of applying the
barrier may prevent a false declaration of a hung GPU.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Mika Kuoppala &lt;mika.kuoppala@intel.com&gt;
Cc: Dave Gordon &lt;david.s.gordon@intel.com&gt;
Reviewed-by: Mika Kuoppala &lt;mika.kuoppala@intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1460195877-20520-2-git-send-email-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915: Refactor gen8 semaphore offset calculation</title>
<updated>2016-04-08T10:43:48Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2016-04-07T06:29:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8c12672ee2d386924c65c3bbb30bf0da415b2918'/>
<id>urn:sha1:8c12672ee2d386924c65c3bbb30bf0da415b2918</id>
<content type='text'>
We reuse the same calculation into two macros, and I want to add a third
user. Time to refactor.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1460010558-10705-5-git-send-email-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/i915: Move execlists irq handler to a bottom half</title>
<updated>2016-04-04T13:08:52Z</updated>
<author>
<name>Tvrtko Ursulin</name>
</author>
<published>2016-04-04T11:11:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=27af5eea54d161e1636001a7f2b5efd3b7a3d1f9'/>
<id>urn:sha1:27af5eea54d161e1636001a7f2b5efd3b7a3d1f9</id>
<content type='text'>
Doing a lot of work in the interrupt handler introduces huge
latencies to the system as a whole.

Most dramatic effect can be seen by running an all engine
stress test like igt/gem_exec_nop/all where, when the kernel
config is lean enough, the whole system can be brought into
multi-second periods of complete non-interactivty. That can
look for example like this:

 NMI watchdog: BUG: soft lockup - CPU#0 stuck for 23s! [kworker/u8:3:143]
 Modules linked in: [redacted for brevity]
 CPU: 0 PID: 143 Comm: kworker/u8:3 Tainted: G     U       L  4.5.0-160321+ #183
 Hardware name: Intel Corporation Broadwell Client platform/WhiteTip Mountain 1
 Workqueue: i915 gen6_pm_rps_work [i915]
 task: ffff8800aae88000 ti: ffff8800aae90000 task.ti: ffff8800aae90000
 RIP: 0010:[&lt;ffffffff8104a3c2&gt;]  [&lt;ffffffff8104a3c2&gt;] __do_softirq+0x72/0x1d0
 RSP: 0000:ffff88014f403f38  EFLAGS: 00000206
 RAX: ffff8800aae94000 RBX: 0000000000000000 RCX: 00000000000006e0
 RDX: 0000000000000020 RSI: 0000000004208060 RDI: 0000000000215d80
 RBP: ffff88014f403f80 R08: 0000000b1b42c180 R09: 0000000000000022
 R10: 0000000000000004 R11: 00000000ffffffff R12: 000000000000a030
 R13: 0000000000000082 R14: ffff8800aa4d0080 R15: 0000000000000082
 FS:  0000000000000000(0000) GS:ffff88014f400000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00007fa53b90c000 CR3: 0000000001a0a000 CR4: 00000000001406f0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
 Stack:
  042080601b33869f ffff8800aae94000 00000000fffc2678 ffff88010000000a
  0000000000000000 000000000000a030 0000000000005302 ffff8800aa4d0080
  0000000000000206 ffff88014f403f90 ffffffff8104a716 ffff88014f403fa8
 Call Trace:
  &lt;IRQ&gt;
  [&lt;ffffffff8104a716&gt;] irq_exit+0x86/0x90
  [&lt;ffffffff81031e7d&gt;] smp_apic_timer_interrupt+0x3d/0x50
  [&lt;ffffffff814f3eac&gt;] apic_timer_interrupt+0x7c/0x90
  &lt;EOI&gt;
  [&lt;ffffffffa01c5b40&gt;] ? gen8_write64+0x1a0/0x1a0 [i915]
  [&lt;ffffffff814f2b39&gt;] ? _raw_spin_unlock_irqrestore+0x9/0x20
  [&lt;ffffffffa01c5c44&gt;] gen8_write32+0x104/0x1a0 [i915]
  [&lt;ffffffff8132c6a2&gt;] ? n_tty_receive_buf_common+0x372/0xae0
  [&lt;ffffffffa017cc9e&gt;] gen6_set_rps_thresholds+0x1be/0x330 [i915]
  [&lt;ffffffffa017eaf0&gt;] gen6_set_rps+0x70/0x200 [i915]
  [&lt;ffffffffa0185375&gt;] intel_set_rps+0x25/0x30 [i915]
  [&lt;ffffffffa01768fd&gt;] gen6_pm_rps_work+0x10d/0x2e0 [i915]
  [&lt;ffffffff81063852&gt;] ? finish_task_switch+0x72/0x1c0
  [&lt;ffffffff8105ab29&gt;] process_one_work+0x139/0x350
  [&lt;ffffffff8105b186&gt;] worker_thread+0x126/0x490
  [&lt;ffffffff8105b060&gt;] ? rescuer_thread+0x320/0x320
  [&lt;ffffffff8105fa64&gt;] kthread+0xc4/0xe0
  [&lt;ffffffff8105f9a0&gt;] ? kthread_create_on_node+0x170/0x170
  [&lt;ffffffff814f351f&gt;] ret_from_fork+0x3f/0x70
  [&lt;ffffffff8105f9a0&gt;] ? kthread_create_on_node+0x170/0x170

I could not explain, or find a code path, which would explain
a +20 second lockup, but from some instrumentation it was
apparent the interrupts off proportion of time was between
10-25% under heavy load which is quite bad.

When a interrupt "cliff" is reached, which was &gt;~320k irq/s on
my machine, the whole system goes into a terrible state of the
above described multi-second lockups.

By moving the GT interrupt handling to a tasklet in a most
simple way, the problem above disappears completely.

Testing the effect on sytem-wide latencies using
igt/gem_syslatency shows the following before this patch:

gem_syslatency: cycles=1532739, latency mean=416531.829us max=2499237us
gem_syslatency: cycles=1839434, latency mean=1458099.157us max=4998944us
gem_syslatency: cycles=1432570, latency mean=2688.451us max=1201185us
gem_syslatency: cycles=1533543, latency mean=416520.499us max=2498886us

This shows that the unrelated process is experiencing huge
delays in its wake-up latency. After the patch the results
look like this:

gem_syslatency: cycles=808907, latency mean=53.133us max=1640us
gem_syslatency: cycles=862154, latency mean=62.778us max=2117us
gem_syslatency: cycles=856039, latency mean=58.079us max=2123us
gem_syslatency: cycles=841683, latency mean=56.914us max=1667us

Showing a huge improvement in the unrelated process wake-up
latency. It also shows an approximate halving in the number
of total empty batches submitted during the test. This may
not be worrying since the test puts the driver under
a very unrealistic load with ncpu threads doing empty batch
submission to all GPU engines each.

Another benefit compared to the hard-irq handling is that now
work on all engines can be dispatched in parallel since we can
have up to number of CPUs active tasklets. (While previously
a single hard-irq would serially dispatch on one engine after
another.)

More interesting scenario with regards to throughput is
"gem_latency -n 100" which  shows 25% better throughput and
CPU usage, and 14% better dispatch latencies.

I did not find any gains or regressions with Synmark2 or
GLbench under light testing. More benchmarking is certainly
required.

v2:
   * execlists_lock should be taken as spin_lock_bh when
     queuing work from userspace now. (Chris Wilson)
   * uncore.lock must be taken with spin_lock_irq when
     submitting requests since that now runs from either
     softirq or process context.

v3:
   * Expanded commit message with more testing data;
   * converted missed locking sites to _bh;
   * added execlist_lock comment. (Chris Wilson)

v4:
   * Mention dispatch parallelism in commit. (Chris Wilson)
   * Do not hold uncore.lock over MMIO reads since the block
     is already serialised per-engine via the tasklet itself.
     (Chris Wilson)
   * intel_lrc_irq_handler should be static. (Chris Wilson)
   * Cancel/sync the tasklet on GPU reset. (Chris Wilson)
   * Document and WARN that tasklet cannot be active/pending
     on engine cleanup. (Chris Wilson/Imre Deak)

Signed-off-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Imre Deak &lt;imre.deak@intel.com&gt;
Testcase: igt/gem_exec_nop/all
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94350
Reviewed-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1459768316-6670-1-git-send-email-tvrtko.ursulin@linux.intel.com
</content>
</entry>
<entry>
<title>drm/i915: Use an array of register tables in command parser</title>
<updated>2016-03-21T09:02:01Z</updated>
<author>
<name>Jordan Justen</name>
</author>
<published>2016-03-07T07:30:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=361b027bc6ae8501756829043ac98e42e40494f8'/>
<id>urn:sha1:361b027bc6ae8501756829043ac98e42e40494f8</id>
<content type='text'>
For Haswell, we will want another table of registers while retaining
the large common table of whitelisted registers shared by all gen7
devices.

Signed-off-by: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Reviewed-by: Francisco Jerez &lt;currojerez@riseup.net&gt;
[danvet: Pipe patch through sed -e 's/\&lt;ring\&gt;/engine/g' to make it
apply.]
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
</feed>
