Commit Graph

7730 Commits

Author SHA1 Message Date
Chris Wilson 69d584c6ac sna: Prepare fr changes in dirty tracking api (Prime)
Future commit "pixmap: fix reverse optimus support with multiple heads"
will allow for tracking within pixmaps (i.e. break the presumption that
everything starts at offset 0,0 in the target pixmap).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 07:29:49 +01:00
Chris Wilson 016599783c intel: Limit read to always fit in the buffer
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26 12:46:50 +01:00
Chris Wilson 51037706b0 sna: Fix attaching to a headless configuration
ADDFB fails with a headless config (as any fb size is invalid).
Fortunately, with headless we can use any depth we like.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26 11:43:28 +01:00
Chris Wilson 8c5229cf8f sna: Make one last gasp at submitting the execbuffer before bailing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-24 16:25:05 +01:00
Chris Wilson 12c051d5c6 sna/dri2: Unhook event from draw list upon client destruction
When the client goes away, we need to free its events. However, we
have to defer the freeing of any pending event (ones currently routed
through the kernel) for those we need to remember to decouple the event
from the Drawable's list before they are freed.

Reported-by: John Lindgren <john.lindgren@aol.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82979
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-23 16:28:27 +01:00
Chris Wilson 1bbacf80a9 sna/dri2: Assert event is queued when marked as next pending flip
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-23 16:28:21 +01:00
Chris Wilson 48000371c9 sna/dri2: Remove the redundant parameter passed to free event
draw is always the same as event->draw, so just use event->draw.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-23 16:28:21 +01:00
Chris Wilson fef2f4dbae sna: DBG message fix for !xvmc
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-22 18:57:32 +01:00
Chris Wilson 9b2cf5c7ab sna: Propagate failure from changing backlight value
Especially when we delete the output property halfway through and the
ChangeProperty routine then attempts to wire it back up...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82833
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-21 08:17:41 +01:00
Chris Wilson 61ec162dc9 backlight: Move the fd out of the select range
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-21 07:56:44 +01:00
Chris Wilson 726f1a38a5 sna: Only send the bl change notification if the randr_output exists
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-21 07:56:44 +01:00
Chris Wilson f5469681b6 sna: Be defensive during FreeScreen()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-18 14:37:44 +01:00
Chris Wilson bfacb9d8dc sna: Add some DBG warnings for early PreInit failures
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-18 14:37:19 +01:00
Chris Wilson 16b9447c51 intel: Only dump debugfs on linux
Other platforms are not going to have the same debug infrastructure, nor
even the same mount(2).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-18 07:00:48 +01:00
Chris Wilson f8e632f396 sna: Select appropriate tiling mode for TearFree shadow buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:35:34 +01:00
Chris Wilson c3b093b3c0 sna: DBG log invalid surface sizes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:32:48 +01:00
Chris Wilson e59ea828f5 sna: DBG log all bo allocation failure paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:31:32 +01:00
Chris Wilson 9b8f7db5c9 sna: DBG Log all failure paths in allocating CRTC pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:27:34 +01:00
Chris Wilson e461427ad3 sna: Add error message to explain modesetting failures due to allocation
Since this is an error path with a major user visible failure (the
modeset fails), make sure that we log the reason.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:19:10 +01:00
Chris Wilson 72ed21c694 sna: Do not force creation of a linear GPU bo that we don't want
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 21:15:26 +01:00
Chris Wilson 3bb9311e5d sna: Use a shadow buffer for linear framebuffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 17:38:49 +01:00
Chris Wilson 0f1280bab9 sna/dri2: Fix compilation with Xorg-1.12.4
In Xorg-1.12.4 we have DRI2 version 6 (and so triple buffering support
by Xorg) but we don't yet have Prime. Remove the check for the Prime bug
in the Xserver for that case.

Reported-by: Axel Rohde
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 07:43:15 +01:00
Chris Wilson d974dabc8a sna: Relax the square cursor assumption
Internally only use a square cursor, but 845g/865g actually supports
rectangular cursors (as they have a relaxed cursor height restriction).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-13 07:58:57 +01:00
Chris Wilson ec10cef592 sna: Only apply a DPMS change for an enabled CRTC
Mostly paranoia, but we need to validate that the stored mode is valid
before applying the modeset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-12 10:52:38 +01:00
Chris Wilson 9cc72c2dc7 sna: Suppress "switch to mode" messages for internal CRTC applies
We only want to log a mode change when it is initiated by the user. For
internal updates, such as changing the frame or restoring a mode from
DPMS, we want to silently apply the current mode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-12 10:49:20 +01:00
Chris Wilson b3138bee8d sna: Separate panel checks from adding default modes
The flags are now separate, so treat them individually.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-12 09:00:04 +01:00
Chris Wilson 6554cf0a69 sna: Parse output options early during initialisation
Before we can query whether an option is set, we first need to generate
the options table. This is done through xf86OutputUseScreenMonitor() so
make sure it is called as early as possible in the proceedings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-11 12:23:24 +01:00
Chris Wilson 8e1961e7fc sna: Respect monitor option "DefaultModes"
The is a monitor option to allow the user to specify whether to add the
default modes, use it to determine adding the extra modes for panels.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-10 06:51:33 +01:00
Chris Wilson f6e85048b0 sna: Reorder output array to match primary placement for InitialConfiguration
xf86InitialConfiguration() depends upon the order of the outputs for its
mode selection and expects the Primary output to be listed first.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82205
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-09 08:07:10 +01:00
Chris Wilson 5c7965f00f intel: If need be, try mounting debugfs
If we require debugging information from debugfs and we cannot find it,
silently mount it and dump the information we need.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-09 07:37:58 +01:00
Chris Wilson dea65e8be7 intel: Log open clients on master takeover fail
If we fail to claim the DRM device as master, dump /debugfs/.../clients
so that we can check to see who failed to drop master for us.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-09 07:15:56 +01:00
Chris Wilson 8d135867c8 sna: Update check for static driver data on loading error
Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1354424
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-08 14:04:14 +01:00
Chris Wilson 59f0374188 sna: Restore the clear before pwriting the cursor
Along the legacy phys cursor path, we use a common scratch buffer. As
this is global, we need to be careful not to trust the cursor local
dirty tracking and be sure to clear the image before uploading.

Reported-by: Dirk Griesbach
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82337
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-08 10:26:13 +01:00
Chris Wilson afea9ba079 Prepare for spurious Xv ABI changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-08 08:26:08 +01:00
Chris Wilson 6f69188cb2 sna: Clear old cursors when resizing
When changing the stride on a cursor, we have to clear the whole area
and not just the rectangle outside of our overwritten area.

Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82273
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-08 07:26:54 +01:00
Chris Wilson fab976cef8 uxa: Compile fix for Ubuntu 11.04
../../../src/uxa/intel_uxa.c: In function 'intel_uxa_init':
../../../src/uxa/intel_uxa.c:1557:27: error: 'true' undeclared (first use in this function)
../../../src/uxa/intel_uxa.c:1557:27: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-07 14:35:22 +01:00
Chris Wilson 52c1e64692 sna: Flush cursor width changes
The kernel only sees changes in the cursor width when the cursor handle
is updated. In the cases where we reuse larger bo for smaller cursors,
make sure we then reset the cursor handle (even though it has not
changed) so tht the kernel updates its width.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-07 11:34:26 +01:00
Chris Wilson 105d478cdd sna: Enable kernel rotation support by default
The kernel API is now upstream and so we can rely on it not changing.
Time to use it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-06 09:10:30 +01:00
Chris Wilson f36b7a4aac intel: Use NOACCEL to avoid a symbol clash on old Xorg
Old Xorg xf86str.h defines NONE preventing us from using it within an
enum. Use NOACCEL instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-05 16:38:42 +01:00
Chris Wilson c5e654cf2a sna: Set the RandR primary output from the option
If the user specifies the Option "Primary" for a monitor, we need to set
it as the RandR primary output.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82193
2014-08-05 16:22:53 +01:00
Chris Wilson 999c8dc700 sna: Add intermediate modes to any output with a scaler
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-05 15:38:44 +01:00
Chris Wilson cea47f8cfc sna: Add DSI to the list of recognised panel connectors.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-05 15:38:44 +01:00
Chris Wilson 941ae4c868 sna: Add some extra logging for hotplugging of outputs
References: https://bugs.freedesktop.org/show_bug.cgi?id=82153
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-05 10:19:05 +01:00
Chris Wilson 5926da0ab3 sna: Mark the current mode as preferred if no other mode is
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-05 06:26:06 +01:00
Chris Wilson ab3f1526f1 sna: Add the current CRTC mode last
We only want to add the current mode to the modelist if it is not
already present in the EDID. At the moment, we always add the current
mode first which causes the list to be reordered. If we add it after
checking the EDID, then we will not perturb the list.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82068
2014-08-05 06:25:57 +01:00
Edward Sheldrake ebd1907304 backlight: Fix regression
The backlight xrandr property is missing unless the backlight level
was 0 on starting X, regression introduced in

commit f9e7ac7db7
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 21:53:31 2014 +0100

    backlight: Set structure to safe values when not initialised

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82146
2014-08-04 20:20:41 +01:00
Chris Wilson 926631ee41 sna: Restore single CRTC flips
CRTC flips depend upon having a proxy front buffer, so

commit 33a0dd8f0b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jul 29 09:11:01 2014 +0100

    sna/dri2: Also check for stale buffers before exchanges

was false and disabling every other CRTC flip. However,

commit 70868c7aa8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Jul 23 08:37:46 2014 +0100

    sna/dri2: Recreate buffer in reuse rather than force recreate

was not the entire story and to prevent unnecessary confusion when
multiple clients share the same front buffer, we have to force the
recreation of the back. Do this inside the xchg routine to avoid the
confusion first fixed by 70868c7aa8.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-03 20:36:13 +01:00
Chris Wilson 623fa61090 sna: Rearrange showing cursors
Just tidying and explaining why cursor show on a particular pipe may be
skipped.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-03 20:32:28 +01:00
Chris Wilson 0b93857335 sna: Add some paranoid asserts around get_window_pixmap()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-03 20:31:51 +01:00
Chris Wilson 4de3f9bd79 sna: Relax restriction on fenced aperture check
This is done upfront based on the fenced size within the batch, so we do
not need to assume everything is fenced later on.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-03 07:33:35 +01:00