<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/i915/intel_sprite.c, branch linux-3.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-10-12T14:27:45Z</updated>
<entry>
<title>drm/i915: Workaround VLV/CHV DSI scanline counter hardware fail</title>
<updated>2017-10-12T14:27:45Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2016-12-15T17:47:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88db7e7379763a2e6a9923867a76132afa11fd90'/>
<id>urn:sha1:88db7e7379763a2e6a9923867a76132afa11fd90</id>
<content type='text'>
commit ec1b4ee2834e66884e5b0d3d465f347ff212e372 upstream.

The scanline counter is bonkers on VLV/CHV DSI. The scanline counter
increment is not lined up with the start of vblank like it is on
every other platform and output type. This causes problems for
both the vblank timestamping and atomic update vblank evasion.

On my FFRD8 machine at least, the scanline counter increment
happens about 1/3 of a scanline ahead of the start of vblank (which
is where all register latching happens still). That means we can't
trust the scanline counter to tell us whether we're in vblank or not
while we're on that particular line. In order to keep vblank
timestamping in working condition when called from the vblank irq,
we'll leave scanline_offset at one, which means that the entire
line containing the start of vblank is considered to be inside
the vblank.

For the vblank evasion we'll need to consider that entire line
to be bad, since we can't tell whether the registers already
got latched or not. And we can't actually use the start of vblank
interrupt to get us past that line as the interrupt would fire
too soon, and then we'd up waiting for the next start of vblank
instead. One way around that would using the frame start
interrupt instead since that wouldn't fire until the next
scanline, but that would require some bigger changes in the
interrupt code. So for simplicity we'll just poll until we get
past the bad line.

v2: Adjust the comments a bit

Cc: Jonas Aaberg &lt;cja@gmx.net&gt;
Tested-by: Jonas Aaberg &lt;cja@gmx.net&gt;
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99086
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20161215174734.28779-1-ville.syrjala@linux.intel.com
Tested-by: Mika Kahola &lt;mika.kahola@intel.com&gt;
Reviewed-by: Mika Kahola &lt;mika.kahola@intel.com&gt;
[bwh: Backported to 3.16:
 - Pass dev instead of dev_priv to hardware type predicates
 - Use intel_pipe_has_type() to check output type]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>drm/i915: Wait for vblank after enabling the primary plane on BDW</title>
<updated>2014-06-27T14:36:11Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2014-06-24T10:59:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=33c3b0d19184cb11bfe8cf8e552918650f81f767'/>
<id>urn:sha1:33c3b0d19184cb11bfe8cf8e552918650f81f767</id>
<content type='text'>
BDW signals the flip done interrupt immediately after the DSPSURF write
when the plane is disabled. This is true even if we've already armed
DSPCNTR to enable the plane at the next vblank. This causes major
problems for our page flip code which relies on the flip done interrupts
happening at vblank time.

So what happens is that we enable the plane, and immediately allow
userspace to submit a page flip. If the plane is still in the process
of being enabled when the page flip is issued, the flip done gets
signalled immediately. Our DSPSURFLIVE check catches this to prevent
premature flip completion, but it also means that we don't get a flip
done interrupt when the plane actually gets enabled, and so the page
flip is never completed.

Work around this by re-introducing blocking vblank waits on BDW
whenever we enable the primary plane.

I removed some of the vblank waits here:
 commit 6304cd91e7f05f8802ea6f91287cac09741d9c46
 Author: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
 Date:   Fri Apr 25 13:30:12 2014 +0300

    drm/i915: Drop the excessive vblank waits from modeset codepaths

To avoid these blocking vblank waits we should start using the vblank
interrupt instead of the flip done interrupt to complete page flips.
But that's material for another patch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79354
Tested-by: Guo Jinxian &lt;jinxianx.guo@intel.com&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
</content>
</entry>
<entry>
<title>drm: convert crtc and connection_mutex to ww_mutex (v5)</title>
<updated>2014-06-04T23:54:33Z</updated>
<author>
<name>Rob Clark</name>
</author>
<published>2013-11-19T17:10:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51fd371bbaf94018a1223b4e2cf20b9880fd92d4'/>
<id>urn:sha1:51fd371bbaf94018a1223b4e2cf20b9880fd92d4</id>
<content type='text'>
For atomic, it will be quite necessary to not need to care so much
about locking order.  And 'state' gives us a convenient place to stash a
ww_ctx for any sort of update that needs to grab multiple crtc locks.

Because we will want to eventually make locking even more fine grained
(giving locks to planes, connectors, etc), split out drm_modeset_lock
and drm_modeset_acquire_ctx to track acquired locks.

Atomic will use this to keep track of which locks have been acquired
in a transaction.

v1: original
v2: remove a few things not needed until atomic, for now
v3: update for v3 of connection_mutex patch..
v4: squash in docbook
v5: doc tweaks/fixes

Signed-off-by: Rob Clark &lt;robdclark@gmail.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/i915: Wait for pending page flips before enabling/disabling the primary plane</title>
<updated>2014-05-22T13:06:33Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2014-05-21T11:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=46a55d3016083bf43568a6a20ad95567fb79202d'/>
<id>urn:sha1:46a55d3016083bf43568a6a20ad95567fb79202d</id>
<content type='text'>
We have to write to the primary plane base address registrer when we
enable/disable the primary plane in response to sprite coverage. Those
writes will cause the flip counter to increment which could interfere
with the detection of CS flip completion. We could end up completing
CS flips before the CS has even executed the commands from the ring.

To avoid such issues, wait for CS flips to finish before we toggle the
primary plane on/off.

v2: Rebased due to atomic sprite update changes

Testcase: igt/kms_mmio_vs_cs_flip/setplane_vs_cs_flip
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by Rodrigo Vivi &lt;rodrigo.vivi@gmail.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/i915: Wait for vblank in hsw_enable_ips()</title>
<updated>2014-05-21T07:55:52Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2014-04-15T18:41:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cea165c34502052cb2aafc7e6bb36fe2036a19df'/>
<id>urn:sha1:cea165c34502052cb2aafc7e6bb36fe2036a19df</id>
<content type='text'>
Now that the vblank wait is gone from intel_enable_primary_plane(),
hsw_enable_ips() needs to do the vblank wait itself.

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Rodrigo Vivi &lt;rodrigo.vivi@gmail.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/i915: Add pipe update trace points</title>
<updated>2014-05-06T08:18:03Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2014-04-29T10:35:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=25ef284a2a7de5393b2ef608046e0d48db0e6e2a'/>
<id>urn:sha1:25ef284a2a7de5393b2ef608046e0d48db0e6e2a</id>
<content type='text'>
Add trace points for observing the atomic pipe update mechanism.

v2: Rebased due to earlier changes
v3: Pass intel_crtc instead of drm_crtc (Daniel)
v4: Pass frame counter from the caller to evaded/end since
    the caller now always has that ready

Reviewed-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Reviewed-by: Sourab Gupta &lt;sourabgupta@gmail.com&gt;
Reviewed-by: Akash Goel &lt;akash.goels@gmail.com&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/i915: Perform primary enable/disable atomically with sprite updates</title>
<updated>2014-05-06T08:18:02Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2014-04-29T10:35:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b633d6b8e3aa1f3ba3daa568416e36e054a3bb1'/>
<id>urn:sha1:5b633d6b8e3aa1f3ba3daa568416e36e054a3bb1</id>
<content type='text'>
Move the primary plane enable/disable to occur atomically with the
sprite update that caused the primary plane visibility to change.

FBC and IPS enable/disable is left to happen well before or after
the primary plane change.

v2: Pass intel_crtc instead of drm_crtc (Daniel)

Reviewed-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Reviewed-by: Sourab Gupta &lt;sourabgupta@gmail.com&gt;
Reviewed-by: Akash Goel &lt;akash.goels@gmail.com&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/i915: Make sprite updates atomic</title>
<updated>2014-05-06T08:18:02Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2014-04-29T10:35:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d7849db3eab7f560deba145dfed3cd4df97c975'/>
<id>urn:sha1:8d7849db3eab7f560deba145dfed3cd4df97c975</id>
<content type='text'>
Add a mechanism by which we can evade the leading edge of vblank. This
guarantees that no two sprite register writes will straddle on either
side of the vblank start, and that means all the writes will be latched
together in one atomic operation.

We do the vblank evade by checking the scanline counter, and if it's too
close to the start of vblank (too close has been hardcoded to 100usec
for now), we will wait for the vblank start to pass. In order to
eliminate random delayes from the rest of the system, we operate with
interrupts disabled, except when waiting for the vblank obviously.

Note that we now go digging through pipe_to_crtc_mapping[] in the
vblank interrupt handler, which is a bit dangerous since we set up
interrupts before the crtcs. However in this case since it's the vblank
interrupt, we don't actually unmask it until some piece of code
requests it.

v2: preempt_check_resched() calls after local_irq_enable() (Jesse)
    Hook up the vblank irq stuff on BDW as well
v3: Pass intel_crtc instead of drm_crtc (Daniel)
    Warn if crtc.mutex isn't locked (Daniel)
    Add an explicit compiler barrier and document the barriers (Daniel)
    Note the irq vs. modeset setup madness in the commit message (Daniel)
v4: Use prepare_to_wait() &amp; co. directly and eliminate vbl_received
v5: Refactor intel_pipe_handle_vblank() vs. drm_handle_vblank() (Chris)
    Check for min/max scanline &lt;= 0 (Chris)
    Don't call intel_pipe_update_end() if start failed totally (Chris)
    Check that the vblank counters match on both sides of the critical
    section (Chris)
v6: Fix atomic update for interlaced modes
v7: Reorder code for better readability (Chris)
v8: Drop preempt_check_resched(). It's not available to modules
    anymore and isn't even needed unless we ourselves cause
    a wakeup needing reschedule while interrupts are off

Reviewed-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Reviewed-by: Sourab Gupta &lt;sourabgupta@gmail.com&gt;
Reviewed-by: Akash Goel &lt;akash.goels@gmail.com&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>drm/i915: Shuffle sprite register writes into a tighter group</title>
<updated>2014-01-24T16:22:53Z</updated>
<author>
<name>Ville Syrjälä</name>
</author>
<published>2014-01-17T18:09:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca6ad02523972b331f862161eff93e1a62f34d32'/>
<id>urn:sha1:ca6ad02523972b331f862161eff93e1a62f34d32</id>
<content type='text'>
Group the sprite register writes a bit tighter. We want to write
the registers atomically, and so doing the base address/offset
artihmetic within the critical section is pointless when it can
all be done beforehand.

Reviewed-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
<entry>
<title>Revert "drm/i915: Mask reserved bits in display/sprite address registers"</title>
<updated>2014-01-24T16:22:00Z</updated>
<author>
<name>Daniel Vetter</name>
</author>
<published>2014-01-24T09:31:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=85ba7b7d399dd2c4c65bd84b9ae4dfbd707e79e7'/>
<id>urn:sha1:85ba7b7d399dd2c4c65bd84b9ae4dfbd707e79e7</id>
<content type='text'>
This reverts commit 446f254566ea8911c9e19c7bc8a162fc0e53cf31.

I've left the masking in the pageflip code since that seems to be some
useful piece of preemptive robustness.

Iirc I've merged this patch under the assumption that the BIOS leaves
some random gunk in the lower bits and gets unhappy if we trample on
them. We have quite a few case like this, so this made sense.

Now I've just learned that there's actual hardware features bits in
the low 12 bits, and the kernel needs to preserve them to allow a
userspace blob to do its job. Given Dave Airlie's clear stance on
userspace blob drivers I've quickly chatted with him and he doesn't
seem too happy. So let's revert this.

If there are indeed bits that we must preserve in this range then we
can ressurrect this patch, but with proper documentation for those
bits supplied. And we probably also need to think a bit about
interactions with our driver.

Cc: Armin Reese &lt;armin.c.reese@intel.com&gt;
Cc: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Cc: Dave Airlie &lt;airlied@linux.ie&gt;
Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
</entry>
</feed>
