The update for ABI 22 and NotifyFd left behind an important flush for
shadow rendering.
Fixes: 4ab9145c7748 ("Update to ABI 22 and NotifyFd")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since forever we have been passing region=NULL when doing a windowed
swapbuffer on vblank, and using that to mark the entire pixmap as being
damaged. For an uncomposited window, this is incorrect as it points to a
clipped region of the ScreenPixmap and so we were marking the entire
ScreenPixmap as being flushed, but only having operated on the windowed
region. Instead pass along the clip extents if region is unset.
References: https://bugs.freedesktop.org/show_bug.cgi?id=105720
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
During early init, xf86ScrnToScreen() may return NULL, so handle that
possibility inside the assert.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
For my HTPC setup, I'm using the option "CustomEDID".
With this option, output attaching and destroying events leads to
crashes.
The following sequence leads to a crash:
- In xorg.conf: Option "CustomEDID" "HDMI2:/etc/my_edid.bin"
- Starting Xorg
- Connect HDMI2
- Disconnect HDMI2
- Reconnect HDMI2
-> Crash
The crash happens in xf86OutputSetEDID
(xorg/xserver/hw/xfree86/modes/xf86Crtc.c)
at "free(output->MonInfo)". MonInfo is assigned with
sna_output->fake_edid_mon
which is allocated by intel driver in sna_output_load_fake_edid
(src/sna/sna_display.c).
Sequence details:
- Starting Xorg
-> fake_edid_mon is initialized
- Connect HDMI2
-> xf86OutputSetEDID is called:
- MonInfo is NULL
- MonInfo is assigned with fake_edid_mon pointer
- MonInfo is read by Xorg
- Disconnect HDMI2
- Reconnect HDMI2
-> xf86OutputSetEDID is called:
- MonInfo is freed thus also fake_edid_mon
- MonInfo is assigned with fake_edid_mon
- MonInfo is read but it was freed -> CRASH
The fix consists of a new instance of xf86MonPtr for each calls of
xf86OutputSetEDID.
is initialized with fake_edid_raw which render
fake_edid_mon useless.
With this proposal, the behaviour of an EDID override is similar to
a "real" EDID.
Signed-off-by: Dominique Constant <dom.constant@free.fr>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Use the new "COLOR_ENCODING" plane property to implement the
XV_COLORSPACE port attribute for sprite Xv adaptors.
v2: assert(colorspace < ARRAY_SIZE) (Chris)
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Oops. We never actually select the NV12 shader on gen8, causing
us to render garbage. Looks like this is the only one I somehow
missed.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Before checking st_rdev, we first need to validate that the file is a
device node, but we only want to check the file type bits and not
compare the permissions.
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The PICT_ are enums and so never report true to ifdef PICT_a2r10g10b10
and instead we need to check the xserver version they were introduced.
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Allow building the driver with meson. Could probably use
plenty of cleanups, but at least it gives me a working driver.
And I think I managed to make it build everything that
autotools builds.
Quite a few compiler warnings were suppressed as well. Might
want to look at those at some point.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
SKL reintroduced plane scaling once more. Let's try to make use of it.
The one annoying caveat is that you can't do colorkeying and scaling at
the same time :( For now we'll leave the choice of colorkey vs.
scaling to the user via that XV_ALWAYS_ON_TOP attribute.
One possible idea for improving the situation would be to add support
for autopaint colorkey, and automatically disable the colorkey whenever
the window is not obscured by anything and autopaint colorkey is enabled.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Add the Coffeelake PCI IDs based on the following kernel patches:
commit b056f8f3d6b900e8afd19f312719160346d263b4
Author: Anusha Srivatsa <anusha.srivatsa@intel.com>
Date: Thu Jun 8 16:41:05 2017 -0700
drm/i915/cfl: Add Coffee Lake PCI IDs for S Skus.
Signed-off-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Having requested an inactive snooped buffer, we know that it is
already flushed and do not need to flush it again. With debugging
enabled, we hit an assert while flushing that the buffer has a refcout,
which at this present time of being plucked from the snoop cache it does
not.
Reported-by: Adric Blake <promarbler14@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=104341#c2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Very early on when creating the sna privates, we call to_sna(scrn) before
we have even set the sna->scrn backpointer. Reorder the code such that
we always set sna->scrn before the first to_sna() so that the
assert(to_sna(scrn)->scrn == scrn) can always hold.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we fail to manipulate a bo from the active cache for reuse, then we
have to be careful not to immediately close it as it is still referenced
from the current batch.
Reported-by: Adric Blake <promarbler14@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=103025#c44
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Check that the struct sna we retrieve from the ScreenPtr points back to
the screen, and vice versa.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Xorg changed behaviour in 78f0667d6df9 (xf86Events: split xf86VTSwitch
into xf86VTLeave and xf86VTEnter functions) and stopped altering the
state of scrn->vtSema around calls to Leave/EnterVT. So we must do so
ourselves (albeit a bit belated in noticing the change!)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When being run as a secondary screen, we do not receive DPMS events
(xf86DPMS() only operates on the primary screen, I guess one day we will
have to fix that and undo this hack). As such we cannot defer the
modesets until the final DPMS as it will never be sent.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103618
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The code expected that a fresh pixmap header to be created for each
PRIME pixmap, but it appears that set_shared_pixmap is being called on
the same pixmap with fd=-1.
References: https://bugs.freedesktop.org/show_bug.cgi?id=103618
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
i830 can hang if 3DSTATE_BUFFER_INFO straddles two cachelines.
To prevent that emit MI_NOOPs to align 3DSTATE_BUFFER_INFO to
a cacheline boundary.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Two pushes later and the discovery that the build scripts no longer do a
debug build leads to some embarrassment.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the randr->rrPrimaryOutput is set to an output on a slave, we have to
reject it in favour of one of our own.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Avoid compiler trickery by making the layout of the sna_crtc_public
pointed to by xf86CrtcPtr->devPrivate known.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We need the debug code to be signalsafe as it may be run when updating
the cursor from a signal. This excludes the use of fopen() as it may
malloc (causing a potential recursion upon the malloc locks).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Insert the keepalive vblank into the sorted list of msc carefully. This
way we can discard redundant keepalives - as we don't want to queue a
second event for the same vblank needlessly.
Reported-by: Adric Blake <promarbler14@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=103025#c13
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Looks like a bug has snuck in somewhere in our set-tiling path. Since it
exists, try to workaround it whilst it is root caused.
Reported-by: Adric Blake <promarbler14@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=103025#c9
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we can't change tiling on the cached bo and we expect an exact match
(for e.g. scanout) then skip over the unwanted bo.
Reported-by: Adric Blake <promarbler14@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=103025#c5
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since we can assign larger framebuffer to a smaller CRTC, we can reuse
a bo even if it was last used for a bigger framebuffer (without
discarding that framebuffer or bo).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When pageflipping, we should be able to flip to an fb that is larger
than the CRTC, so we can relax the assertion that checking for the exact
size.
References: https://bugs.freedesktop.org/show_bug.cgi?id=102442#c12
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The bug we discovered back in
commit 3a22b6f6d5
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date: Wed Nov 19 15:10:05 2014 +0200
sna: gen8 BLT broken when address has bit 4 set
turns out to be even wider than our initial finding. It is now
recommended that you avoid using the BLT on LINEAR addresses that are not
cache-line aligned (64 bytes). You can convert the offset into a
coordinate offset (provided the address is at least pixel aligned), but
that remains quite hairy to fit into the current code base. So keep
saying no to misaligned blits (we either use the 3D engine instead,
which may end up thrashing the TLBs given the LINEAR layout, or we just
use the CPU).
The impact of issuing misaligned blits is that the blitter ends up
performing the blit presuming the aligned address, causing it to end up
offset (and vary per line).
Reported-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Just flag the DRI2 flush to occur on the next callback flush, as per
normal, instead of manually emitting the batch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit 74c1e45ed5 ("sna/dri2: Look for potential flip targets when
recreating backbuffers") cached the decision on whether to create the
new back buffer as a scanout target believing that we would always get
notified when the DRI2 drawable size changed. However, this is only true
inside a composited environment where we see a change in the Window's
pixmap. In a bare environment, we either need to chain into the
screen->ResizeWindow or check every time whether we think a new
backbuffer should be pre-allocated for use on the scanout.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
There are more reasons than just TearFree as to why the shadow may be
disabled (such as no outputs), so without taking those into account the
assert is bogus.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Present only unflips after a resize, after it has lost control of the
Screen. It's unflip request is stale and triggers an assert about the
graphical glitch - just reorder the assert to ignore the snafu.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The size we need to clear is pitch * height, not pitch * width.
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We use an on-stack array to GETPROPERTY value to try and do a single
ioctl/copy avoiding a short-lived malloc.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
RandR allows the Primary output to belong to a slave GPU, i.e. with the
condition that screen->primaryOutput->screen != screen. When we fallback
to using the PrimaryOutput, we therefore have to check that the output
belong to us before treating it as a sna_output.
Reported-by: Peter Wu <peter@lekensteyn.nl>
Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100382
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
commit 0803918e64262482035f042e5e1f2a571d3dea1b
Author: Adam Jackson <ajax@redhat.com>
Date: Sat Sep 24 19:40:52 2016 -0400
fb: Remove 24bpp support (v3)
removes the gc.pRotatedPixmap member without a guide to the ABI bump.
Don't initialize pRotatedPixmap out from the start of the unstable tag .
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>