Commit Graph

7843 Commits

Author SHA1 Message Date
Chris Wilson e501aa6676 sna: Cursors only need to be cleared when they are shrunk
If we completely overwrite the old contents, we do not need to clear it
first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 21:59:08 +00:00
Chris Wilson 5c4d6d1ad7 sna: Reorder the cursor cache search
Search for an exact match first, before looking for a cursor we can
reuse. This should help reuse with multiple rotated screens not stealing
the others' cursor on every pass.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 21:39:58 +00:00
Chris Wilson e8be2a438d sna: Clear the surrounding areas of small cursors
If the cursor does not completely fill the size of the hardware cursor,
we will retain whatever contents already filled that area.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 21:09:45 +00:00
Chris Wilson 25ca8f136c sna: Support variable sized cursors
One of the downsides with supporting large cursors is that the full size
is very rarely used leading to a waste of permanently allocated
resources. Refactor our cursor handling so that we can allocate fresh
cursors on the fly that are appropriately sized.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 15:23:15 +00:00
Chris Wilson e3810cff42 sna: Move cursor reload into crtc notify
This only needs to be done once per-screen reconfiguration.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 14:26:54 +00:00
Chris Wilson 6bdd3b39bf sna: Tighten detection of GCs that translate to solid fills
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 14:26:54 +00:00
Chris Wilson 771b86e2a8 intel-virtual-output: Add DBG option to force 16 bit transfers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27 14:26:54 +00:00
Chris Wilson e46c196ecc sna: Print probed maximum cursor size
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-26 12:18:39 +00:00
Chris Wilson a273b207b9 intel-virtual-output: Fix damage iteration over active list
When iterating over the active list to mark the current damage, we need
to chase the ->active pointer rather than ->next or else we walk the
wrong list from the wrong starting point.

Reported-by: Kirill Müller <mail@kirill-mueller.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76271
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-25 09:40:40 +00:00
Chris Wilson bfd51e2056 intel-virtual-output: Add a little more DBG around damaging clones
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-25 08:59:58 +00:00
Chris Wilson 278ef8f7bc intel-virtual-output: Do not detach with DBG enabled
Since DBG is sent to stdout, we only see it if we do not daemonize
(which closes stdout).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-25 08:33:46 +00:00
Chris Wilson 7addfcbf0f sna: Remove one conditional from rendering glyphs into a mask
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-24 16:56:10 +00:00
Chris Wilson d3050dbaf7 sna: Consolidate handling of uncacheable glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-24 16:56:09 +00:00
Chris Wilson 79399ff926 sna: Eliminate a few conditionals in glyph fast path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-24 16:55:24 +00:00
Chris Wilson 220accd828 sna: Only enable cursor support if the hw cursor is supported
Under a host, we naturally will not setup the cursor capability, and
this provides a safeguard in case we have a machine that does not
support hardware cursors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-20 09:03:31 +00:00
Chris Wilson 7cf0676ff8 intel: Do not close server fds
If we are given an fd by the Xserver, then it is not our responsibility
to close it during CloseScreen.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
2014-03-20 08:52:12 +00:00
Chris Wilson 9f4c121974 intel: Refactor finding device path if unknown
Since we already lookup the device path if we do not know it after
opening the fd, we can remove the special case along the legacy PCI
probe path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-20 08:48:40 +00:00
Chris Wilson 582adf067c 2.99.911 snapshot 2014-03-19 14:58:00 +00:00
Chris Wilson 6802ee00e5 sna: Assert after applying clipping that the draw rectangle is wholly contained
Otherwise we ignore the purpose of applying the clip!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-19 10:25:05 +00:00
Chris Wilson 15be6b7c9a uxa: Implement minimal flushing for bdw+
Based on the patch by Kenneth Graunke,
"Several places (such as intel_cache_expire) call intel_emit_batch_flush,
so it needs to work on Broadwell.  Sometimes the batch is empty, in
which case current_batch may not yet be BLT_RING.

The PIPE_CONTROL code has not been ported to work on Broadwell, so
trying to do a render ring flush will hang the GPU.  It also doesn't
make any sense to do a render ring flush, given that we never use the
render ring for UXA on Broadwell."

Cc: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-18 16:52:40 +00:00
Hans de Goede 6446bf96f0 intel: Don't close the fd on probe failure if it is server managed
I hit this corner case when testing a single X server spanning both intel
gfx + an usb display link adapter driven by xf86-video-modesetting.

In this scenario the intel driver gets its platformProbe method called first,
and if it then closes the server managed fd, the xf86-video-modesetting gets
EBADFD errors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-03-18 15:55:54 +00:00
Chris Wilson 4a6e09c6cd uxa: Add support for server managed fds (via intel_device)
Based on the patch by Hans de Goede, this removes the handling of
drmOpen() and DRM_MASTER from within uxa and instead uses the common
routines. This reduces the duplicate code from within uxa, and enables
new features such as server managed fds.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-18 15:52:19 +00:00
Chris Wilson dc66e663a0 sna: Improve guard against loading palettes whilst headless
Whilst hosted, which is very similar to being headless, we do not even
have the kmode pointer and so checking kmode->count_crtcs is fatal.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-17 13:50:18 +00:00
Chris Wilson 28ebbe8fa9 sna: Fix logic inversion in use of imprecise transform conversion
An accidental drop of the if (!is_translation) broke composite copies
under a transform.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76244
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-17 07:56:39 +00:00
Chris Wilson 57e63221ec intel-virtual-output: Minor DBG fixes
Improve the summary after failing to detect MIT-SHM, and fix a DBG

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 19:49:59 +00:00
Chris Wilson 8cc1f005c6 intel-virtual-output: Iterate over remote outputs in the same order as listed
If we walk the output lists in the same order as they are listed by
RandR, we are more likely to hit favourable priority sorting. E.g. the
user is likely to setup the outputs in the same order as listed, meaning
fewer CRTC transitions etc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 15:55:41 +00:00
Chris Wilson a55bbe3b59 intel-virtual-output: Disable panning before setting mode on CRTC
For whatever reason, presumably to do with the switch between CRTCs, we
need to disable the panning before setting the mode in order for our
desired CRTC position to take effect.

Reported-by: Jeff Katz <bugzilla@kraln.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76146
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 15:47:20 +00:00
Chris Wilson 5079830bd5 intel-virtual-output: Mode names are freed with ScreenResources
So we have to be careful not to continue to reference the strings after
they may be freed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 14:35:29 +00:00
Chris Wilson c64d2572ba sna: Allow some leeway when deciding to discard common translations
Under PictFilterNearest, we can ignore fractional translations (not all
renderers discard those.) And if we are being approximate, we can loosen
our tolerance as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 13:40:55 +00:00
Chris Wilson b61e6398f0 sna: Ensure we flush SHM pixmaps if rendering to a GPU shadow
Normally, we try to render into the CPU bo of a SHM pixmap. However, under
the right circumstances we may try to do a series of rendering into the
GPU bo and then copy it back to the CPU bo. In that case, we need to be
sure to mark the pixmap as requiring the flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 11:38:19 +00:00
Chris Wilson f47f192f22 intel-virtual-output: Include extra debug information for modesets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 11:38:19 +00:00
Chris Wilson 0ad54325e9 intel-virtual-output: Disable remote CRTCs at startup
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14 08:15:24 +00:00
Kenneth Graunke cbcc1b6190 uxa: Enable BLT acceleration on Broadwell.
This supports solid, copy, put_image, and get_image acceleration via the
BLT engine.  RENDER acceleration (composite) and Xv would be piles of work,
which is not worth doing since SNA exists, and Glamor is coming.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-13 15:04:59 +00:00
Kenneth Graunke c1d7abadbb uxa: Remove implicit length from BLT command #defines.
These command packets grew on Gen8.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-13 14:52:59 +00:00
Chris Wilson 44fe210183 sna/gen6+: Simplify BLT vs RENDER decisions for fill ops
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-13 08:54:56 +00:00
Chris Wilson 5d8ded0dd6 sna: Nullify extra fill.ops
I forgot that the initial memset(&fill, 0, sizeof(fill)) was no longer
performed and we rely on explicit initialisation during the setup, so
add the missing fields.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76088
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-13 08:54:56 +00:00
Chris Wilson 923b158e5c intel: Fallback to drmGetDeviceNameFromFd()
If we are not supplied the path, call the libdrm function to search for
the canonical name for our device.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-13 08:14:48 +00:00
Chris Wilson 202787ffa2 sna: Restore asserts that we do not map a freed buffer
The complication comes with stolen bo that we treat as purged (because
they have no backing storage we can access) and so require an extra
caveat.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-12 23:57:04 +00:00
Chris Wilson 4368a74b1c sna: Add DBG around using pixman's glyph cache
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-12 17:37:01 +00:00
Chris Wilson 08d73f1a44 sna: Only couple up a proxy->rq when inserting into the request->buffers list
Otherwise, we may never decouple it again afterwards leading to a
dangling pointer dereference.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289923
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-12 12:23:53 +00:00
Chris Wilson 2f50261539 sna: Simplify code when no 64-bit registers are available in the ISA
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-12 10:55:00 +00:00
Chris Wilson 20026626d2 sna: Missing fixes for using BLT points
On a lone machine I had a vital fix for setting the destination tiling
bit inside the XY_PIXEL_BLT command. Sadly, I forgot about the fix before
the patch from another machine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-11 14:16:20 +00:00
Chris Wilson fd189c8689 sna/glyphs: Add a smattering of DBG for validating the glyph mask
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-11 11:37:01 +00:00
Chris Wilson d31569455c sna: Avoid using the wrong pitch for comparing replacement sizes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-11 11:08:00 +00:00
Chris Wilson 8c5593037f sna: Assert that the pixmap pitch is initialised before use
This is a sanity check that the pixmap is mapped for use by the CPU
prior to us actually using it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-11 10:44:52 +00:00
Chris Wilson dd1ff32302 intel: Protect against a NULL platform device with server fd
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-11 10:06:24 +00:00
Chris Wilson 59f2f4885d intel: Fix versioning of SUPPORTS_SERVER_FD
The current snapshot is 1.15.99.901, which means that the new feature
will first be available in 1.15.99.902.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-11 10:01:04 +00:00
Chris Wilson 78970676e7 sna: Be defensive when applying size restrictions to bo
The assumption that all paths prevalidate the restrictions upon creation
the bo are false. Some important paths try to force the bo creation in
order to meet client expectations (e.g. DRI). So we are faced with
impossible requests which must fail, so make sure we do report those
failures.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289049
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-11 07:33:09 +00:00
Chris Wilson d10a5abcbd intel: Supply a fallback guess for the device path
If for some reason we have an fd, but no device path, use the likely
default path (derived from and validated against the major/minor of the
open device fd).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-10 22:19:25 +00:00
Hans de Goede 28cab948f5 intel: Add support for server managed fds
In the post-modern world, the platform device nodes are handed to a
non-privileged Xserver by systemd/logind. We can then query the core for
our assigned fd rather than try to open the device for ourselves (which
would fail when trying to obtain DRM_MASTER status). A consequence is
that we then do not directly control DRM_MASTER status and must act as a
delegate of systemd.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-03-10 22:19:25 +00:00