Commit Graph

4683 Commits

Author SHA1 Message Date
Chris Wilson e456291350 Allow runtime switching of AccelMethod between uxa/sna and even glamor
Section "Device"
  Option "AccelMethod" "uxa/glamor/sna"
EndSection

The appropriate backend must also be enabled at compile time for the
runtime option to be available (i.e. --enable-uxa (default) --enable-sna
--enable-glamor)

Demanded-by: Adam Jackson <ajax@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50290
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-24 19:01:22 +01:00
Eugeni Dodonov df6ab02c36 Unify options handling between UXA and SNA
Unifies available options for both UXA and SNA drivers, and
moves them into a common header file, intel_opts.h.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-05-24 18:47:41 +01:00
Chris Wilson ae2be7e25b sna/trapezoids: Correct rounding for downsampling onto sample grid
Reported-by: S. Christian Collins <s_chriscollins@hotmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49446
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-24 16:33:27 +01:00
Chris Wilson 0ab226e27e sna: Query CRTC states following a hotplug event
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-24 12:51:46 +01:00
Chris Wilson 3f3bde4f0c uxa: Only consider an output valid if the kernel reports it attached
Reported-by: Kyle Hill <kyle.hill@tacomafia.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50078
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-24 12:03:14 +01:00
Chris Wilson 11db66fedf sna: Add some more DBG tracepoints around modesetting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-24 11:18:18 +01:00
Chris Wilson fb9da4cb9e sna: Only mark an unattached output as inactive
So that a latter attempt to set the DesiredMode may succeed and we do
not modify the configuration without notifying clients.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 13:53:37 +01:00
Chris Wilson 5ae032e22b sna: Suppress modesetting errors on return from VT switch
If we presume that userspace will set the correct mode shortly
afterwards, we can ignore the failure of the automatic restore.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 13:27:07 +01:00
Chris Wilson 34882a979d sna: Keep checking retirement for flushing list
Even after all outstanding requests have been completed we may still
have buffers on the flushing list that need to become idle.
Once such consequence would be to prevent the vblank flush from going
idle, causing spurious wakeups every vrefresh when otherwise idle.

References: https://bugs.freedesktop.org/show_bug.cgi?id=50078
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-23 11:10:53 +01:00
Dave Airlie 54fde5bf05 intel: convert sna/uxa to using new glyph picture accessors.
The compat-api.h takes care of old/new servers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23 11:02:20 +01:00
Dave Airlie 43a34186d1 intel: convert to new screen conversion APIs
The compat header takes care of the old server vs new server.

this commit was autogenerated from util/modular/x-driver-screen-scrn-conv.sh

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23 11:02:20 +01:00
Dave Airlie 9aabc04d76 intel: add compat header file for conversion fns
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23 11:00:29 +01:00
Dave Airlie c9ce6ae8a6 legacy/i810: rename pScreen->screen
For consistency before moving to new APIs.

This just changes the files where the API changes will touch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23 08:37:43 +01:00
Dave Airlie 70ee0f84f5 legacy/i810: rename pScrn->scrn
This is need to make the compat api stuff easier to implement.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23 08:31:52 +01:00
Chris Wilson 3410db008c sna/dri: Avoid confusion of attempting to exchange pixmaps for DPMS-off flips
Not only do we confuse ourselves, but we end up confusing the damage
tracking on the root window whenever we update the Screen Pixmap. So for
the time being, don't.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-22 16:24:21 +01:00
Chris Wilson 28c4fb0b70 sna: Swallow disconnection event upon mode restoration
So that we can VT switch back to X even though the output configuration
has now changed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-22 09:49:53 +01:00
Chris Wilson b17c44c8d2 sna: Remove incorrect assertion for mode restoration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-22 09:43:51 +01:00
Chris Wilson 49b7742999 sna: Force config restoration after VT switch
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-22 09:42:01 +01:00
Chris Wilson 952e3dcba3 sna: Only override active on DPMSModeOff
Along the enable path we then only want to change the value if we
actually call sna_crtc_apply.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-21 19:49:55 +01:00
Chris Wilson afdaf18459 sna: Add a log message for the change of CRTC mode
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-21 14:32:39 +01:00
Chris Wilson 9fb18462ec sna: Confirm that the modeset takes
If we attempt to change to a mode with a disabled connector the kernel
will silently switch off that connector (and crtc) and report that the
modeswitch is successful.

Reported-by: Kyle Hill <kyle.hill@tacomafia.net>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50078
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-21 14:12:23 +01:00
Chris Wilson cd3b488544 sna/gen7: Trim a dead assignment
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-20 14:28:06 +01:00
Chris Wilson cf79cd3e27 sna: Emit a new batch if we need to clip after PolyText without space
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-19 12:44:11 +01:00
Chris Wilson f91dcc44dc sna: Give the proxy a unique name
So that if we cache the current destination bo (for example, gen3) then
a new proxy (or even just a new batchbuffer) will indeed cause the
destination buffer to be updated.

Reported-and-tested-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48636
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-18 21:08:24 +01:00
Chris Wilson ee073d613b sna/traps: Fix processing of full-steps
A missing factor of Y-height caused the computation of coverage for the
spans to be completely wrong. This affects the vertical segments of
rounded rectangles, for instance.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-18 15:39:32 +01:00
Chris Wilson 8ba800c639 sna: Don't consider uploading inplace if the dst bo is unmappable
Handle (and take advantage of) the fallback at the high level rather
than masquerading an inplace write.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-18 15:36:38 +01:00
Chris Wilson dad24721a1 Revert "sna: Always try to operate inplace if we an LLC gpu bo"
This reverts commit 10b4a9bb5f as it
causes a regression for pixel data uploads to active buffers.
2012-05-18 15:36:38 +01:00
Chris Wilson 681c6e7241 sna: Track flushing status of live bo
Currently we only move a bo with an outstanding kernel flush onto the
flushing list if it is no longer in use. This leaves us potentially
stalling on a flush if we try then to write to the object believing it
to be retired and idle.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-18 15:36:38 +01:00
Chris Wilson d99502a33d sna/glyphs: Pass the extents to the backend for preparing to composite glyphs
This information should not be required, but it might come in handy, so
pass it along.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-17 17:56:43 +01:00
Chris Wilson fb21c2df1a sna/io: Assert that we do not replace a bo->flush object
These should be pinned by the higher layers and so we should never be
attempting to replace them. If we do replace a bo->flush, then we will
end up miscounting outstanding flush bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-17 16:56:23 +01:00
Chris Wilson 596c0a6870 sna: Assign GCops after checking for fallback to pass sanity checks
We assert that prior to installing the fallback GCops the current ops
are the default set. This is broken if we point GCops to our GPU ops,
but then fallback. So check for the fallback first.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-15 18:53:39 +01:00
Chris Wilson 3c9759ef2a sna/gen3: Fix pre-multiplication of opacity masks
The return type for the multipliation was only 8-bits wide dating back
to the time when the function just computed a single channel and didn't
try to blend the output back into the argb pixel value. Inlining the
shift into the function means that we need the output to be 32-bits wide
instead.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49887
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 14:12:06 +01:00
Chris Wilson 053bd5bf24 sna: Use the correct storage for box_from_seg
Fixes regression from 3aa98289e3 with clipped segments. As we clipped
the empty box rather than the segment, we never drew any outlines.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 12:08:09 +01:00
Chris Wilson b654b8794d sna/trapezoids: Fix picture creation for fallback trapezoids
Being a little lax in not updating the format after upconversion to
PICT_a8, meant we were trying to composite with a depth 1, 8 bpp a8
image and thoroughly confusing everybody when creating the upload
trapezoid mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 11:39:55 +01:00
Chris Wilson 80567f61af sna/trapezoids: Do not reduce SRC to a clear pixmap to unbounded
As we instruct the migration code to drop the clear when copying from
the GPU to the CPU, we then need to emit the zeros during the span
writing.

Fixes some occassional corruption behind complex clip masks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 10:40:38 +01:00
Chris Wilson 067e937580 sna: Trim unused partial buffer uploads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 10:00:00 +01:00
Chris Wilson effb0b9ec5 sna: Tweak usage of kgem_bo_can_map vs kgem_bo_mapped
More often than not we only want to consider whether we can map the bo
and decide whether doing so is the better option. Whether the bo is
already mapped is not such an issue any more with the throttling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-13 19:31:13 +01:00
Chris Wilson 37aa1e1291 sna: Simplify partial buffer tracking
As we only want to track partial buffers with asynchronous reuse,
exclude all overs from the active buffers list. Secondly, keep the list
in most-recently-used order rather than by size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-13 19:29:24 +01:00
Chris Wilson 7048a71fb6 sna: Flush batch if GPU is idle upon wakeup
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-13 18:27:26 +01:00
Chris Wilson 12e340c4b8 sna: Optimise kgem_clear_dirty() by keeping dirty buffers at the front
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-13 12:10:29 +01:00
Chris Wilson b0dfd8223a sna: Flush the batch before blocking if the GPU is idle
If we have work pending for the GPU and we believe it is idle, just
submit the batch in order to improve GPU/CPU concurrency and reduce
latency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-13 08:33:23 +01:00
Chris Wilson 6924fc525d sna: Fix off-by-one in computation of width for inplace trapezoids
This lead to the dropping of the last pixel for small area trapezoids,
such as the right hand outline of buttons under ClearLooks.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48320
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 14:05:35 +01:00
Chris Wilson a58a543e84 sna: handle vmap creation failures gracefully
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 13:07:08 +01:00
Chris Wilson 9af651fdf9 sna: Include some DBG for segment drawing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 11:20:41 +01:00
Chris Wilson 3aa98289e3 sna: Correct adjustment of LineCap for rectilinear segments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 10:53:42 +01:00
Chris Wilson ad69316ab1 sna: Include a small amount of timer-slack to avoid very short sleeps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 10:03:49 +01:00
Chris Wilson 29d1d409b2 sna: Avoid doubling the final step of poly lines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 09:54:53 +01:00
Chris Wilson a83d90ee61 sna: Avoid randomly changing domains of active bo
After attaching the bo to the scanout, mark it as retired in order to
update its domains so that the assertion during retirement later is
correct.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49526
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-09 20:36:24 +01:00
Chris Wilson d5200510b8 sna: Respect the error terms when reversing the PolyLine DDA
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-09 19:25:20 +01:00
Chris Wilson a3d37fb29f sna: Force remapping for IO transfer
Should fix regression from fcccc5528 (sna: Improve handling of inplace
IO for large transfers) whereby it was aborting the transfer it we need
to remap the buffer for the upload.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49546
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-08 15:47:14 +01:00