Commit Graph

43 Commits

Author SHA1 Message Date
Chris Wilson 5e04a81369 i830: Remove vestigal debugging ALWAYS_FLUSH and ALWAYS_SYNC
These are now debugging options exposed in Xorg.conf, and now unused int
the source code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-17 15:16:25 +01:00
Chris Wilson 5bd0227395 i830: Teardown batch entries on reset.
By not cleaning up the batch entries when resetting the X server, we left
the pointers in an inconsistent state and caused X to crash.
2010-05-14 15:50:05 +01:00
Chris Wilson c374c94e41 uxa: Reuse in-flight bo
When we need to allocate a new bo for use as a gpu target, first check
if we can reuse a pixmap that has already been relocated into the
aperture as a temporary target, for instance a glyph mask or a clip mask.

Before:
backend                      test   min(s) median(s) stddev.
xlib         firefox-planet-gnome   50.568   50.873   0.30%
 xcb         firefox-planet-gnome   49.686   53.003   3.92%
xlib                    evolution   40.115   40.131   0.86%
 xcb                    evolution   28.241   28.285   0.18%

After:
backend                      test   min(s) median(s) stddev.
xlib         firefox-planet-gnome   47.759   48.233   0.80%
 xcb         firefox-planet-gnome   48.611   48.657   0.87%
xlib                    evolution   38.954   38.991   0.05%
 xcb                    evolution   26.561   26.654   0.19%

And even more dramatic improvements when using a font size larger than
the maximum size of the glyph cache:
 xcb firefox-36-20090611:  1.79x speedup
xlib firefox-36-20090611:  1.74x speedup
 xcb firefox-36-20090609:  1.62x speedup
xlib firefox-36-20090609:  1.59x speedup

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-15 21:37:32 +01:00
Chris Wilson 54ac4e2df9 Rate limit batch buffer error.
Once we hit this error it's unlikely that we're coming back - so don't
flood the logs with redundant information.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-05 09:24:33 +00:00
Eric Anholt 4ada6d7a85 Remove 3D state clobber on EnterVT, and always clobber at batch start.
We know that it's clobbered at each batchbuffer, anyway.  And even if
this server isn't running DRI2, it can still be clobbered at batch
start in the KMS world.
2010-03-04 10:13:34 -08:00
Eric Anholt b320449f75 Remove dead i830_ring.h. 2010-02-20 12:55:13 -05:00
Chris Wilson cd475bad23 batch: Ensure we send a MI_FLUSH in the block handler for TFP
This should restore the previous level of synchronisation between
textures and pixmaps, but *does not* guarantee that a texture will be
flushed before use. tfp should be fixed so that the ddx can submit the
batch if required to flush the pixmap.

A side-effect of this patch is to rename intel_batch_flush() to
intel_batch_submit() to reduce the confusion of executing a batch buffer
with that of emitting a MI_FLUSH.

Should fix the remaining rendering corruption involving tfp [inc compiz]:

  Bug 25431 [i915 bisected] piglit/texturing_tfp regressed
  http://bugs.freedesktop.org/show_bug.cgi?id=25431

  Bug 25481 Wrong cursor format and cursor blink rate with compiz enabled
  http://bugs.freedesktop.org/show_bug.cgi?id=25481

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-07 11:15:42 +00:00
Chris Wilson a938673ee8 batch: Downgrade batch submission from a FatalError.
If we wedge the GPU then we will return -EIO for the current batch and
then attempt to reset the GPU. Meanwhile the X server detects the error,
throws a FatalError and to all intents and purposes appears to crash to
the user - whereas before it often just appeared to momentarily freeze.
Of course, on older hardware the server remains frozen until we can find
a way to reset those GPUs at runtime.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 20:54:54 +00:00
Chris Wilson 98e1121036 Remove flush parameter from intel_batch_flush()
There is only a single caller that wishes to forcibly append a flush
into the batch: intel_sync(). So move the logic there.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 20:49:54 +00:00
Chris Wilson b68d3646f1 Review use of errno after libdrm call
Since drm may not actually set the appropriate errno after a failure, we
must use the return code instead when determining the cause of failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 14:12:19 +00:00
Chris Wilson 47916ea9d3 debug: Enable dumping of batchbuffer [compile-time only]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 14:03:10 +00:00
Chris Wilson a8ea20100d debug: Don't always flush the batch when emitting a debugging flush
I incorrectly changed the logic in 285f286 and caused the batch to
always be flushed when debugging, instead of merely inserting a MI_FLUSH
between operations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30 10:13:18 +00:00
Chris Wilson 285f286597 batch: Track pixmap domains.
In order to detect when we require cache flushes we need to track which
domains the pixmap currently belongs to. So to do so we create a device
private structure to hold the extra information and hook it up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-29 22:42:03 +00:00
Chris Wilson 67af5a9925 Check that batch buffers are atomic.
Since batch buffers are rarely emitted by themselves but as part of a
sequence of state and vertices, the whole sequence is emitted atomically.

Here we just enforce that batches are marked as being part of an atomic
sequence as appropriate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-10 15:19:08 +00:00
Chris Wilson 3c0815abf2 conf: Add debugging flush options
Make the following options available via xorg.conf:
  Section "Driver"
    Option "DebugFlushBatches" "1" # Flush the batch buffer after every
                                   # single operation;

    Option "DebugFlushCaches" "1" # Include a MI_FLUSH at the end of every
                                  # batch buffer to force data to be
                                  # flushed out of cache and into memory
                                  # before the completion of the batch.

    Option "DebugWait" "1" # Wait for the completion of every batch buffer
                           # before continuing, i.e. perform synchronous
                           # rendering.
  EndSection

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-14 11:53:20 +01:00
Eric Anholt af27a3a0a5 Rename the xf86 screen private from pScrn to scrn. 2009-10-08 15:34:09 -07:00
Eric Anholt cc5d3ba3c3 Rename the screen private from I830Ptr pI830 to intel_screen_private *intel.
This is the beginning of the campaign to remove some of the absurd use of
Hungarian in the driver.  Not that I don't like Hungarian, but I don't need
to know that pI830 is a pPointer.
2009-10-08 15:34:09 -07:00
Eric Anholt 8ae0e44e42 Move to kernel coding style.
We've talked about doing this since the start of the project, putting it off
until "some convenient time".  Just after removing a third of the driver seems
like a convenient time, when backporting's probably not happening much anyway.
2009-10-06 17:10:31 -07:00
Eric Anholt b9b159c498 Remove UMS support.
At this point, the only remaining feature regressions should be the lack of
overlay support (about to land), and the need to update the XVMC code to work
in the presence of KMS.

Acked-by: Keith Packard <keithp@keithp.com> (in principle)
Acked-by: Carl Worth <cworth@cworth.org> (in principle)
2009-10-06 16:22:31 -07:00
Keith Packard cdbf84f202 intel_batch_init: test have_gem, not directRenderingType
Under KMS, directRenderingType will get set to DRI_NONE during driver
initialization. When the first batch buffer is allocated, as
directRenderingType is DRI_NONE, the GEM bufmgr would get trashed as
intel_batch_init called a fake-bufmgr specific function.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-06-11 13:57:09 -07:00
Jesse Barnes 1c68bc376a Add new have_gem flag
Prior to this patch, code that wanted to check whether GEM was present
would look at pI830->memory_manager.  This turned out to be occasionally
problematic in the KMS case, since memory_manager didn't always get set
correctly.  So add a new pI830->have_gem flag to make things clear in
the various code paths, and set it after GEM initializes or when KMS is
detected.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Magnus Kessler <Magnus.Kessler@gmx.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-05-13 13:19:53 -07:00
Eric Anholt d82ea4372f Replace I830Sync's irq emit/wait code with bufmgr use.
This pre-GEM code was all sorts of broken -- see intel_bufmgr_fake.c for
the hoops that must be jumped to use that kernel interface successfully.
Yet we continued to use it even with KMS/DRI2/UXA, which may account for
some hangs.
2009-04-27 17:05:59 -07:00
Eric Anholt 73b7190421 intel: Nuke shared-entity support (zaphod mode).
It's been broken for years now, and KMS offers a much better chance of getting
this working sensibly without making a mess of the 2D driver.
2009-03-06 13:26:10 -08:00
Lukáš Hejtmánek 1cc9b1423c Fix another VT switch leak
The batch_bo buffer object is reallocated on enter VT, so we need to
unref it on leave vt.

Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz>
2009-03-06 14:44:03 -05:00
Dave Airlie 1459f794e2 intel: fix DRI2 should be DRI_DRI2 2009-01-17 22:14:26 +10:00
Eric Anholt cab5b7a7b0 Fix invarient state emits for DRI2 (do it per batch, since there's no lock). 2009-01-15 09:31:55 -08:00
Keith Packard 7736b65be4 FatalError on batchbuffer map failure
Yes, it would be nice to do something other than crash here.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-01-06 09:31:39 -08:00
Carl Worth e8b95efbf5 i965: Add batch_flush_notify hook to create new vertex-buffer bo
This avoids mapping a buffer object which is being referenced
by a batch that has already been flushed, (which is a terribly
expensive operation).

On my machine this brings the performance of x11perf -aa10text
from 85k back to 150k, (where it was before a recent kernel
upgrade). Also, before this patch, when I used my X server
actively performance would drop as low as 15k---hopefully that
bug is gone with this change.
2008-12-08 12:50:39 -08:00
Kristian Høgsberg ee87f7becc Merge commit 'origin/master' into dri2
Conflicts:
	src/i830_dri.c
	src/i830_driver.c
	src/i830_memory.c
2008-11-17 12:26:38 -05:00
Keith Packard 546e2aca5b Reduce incidence of MI_FLUSH usage.
This tracks whether the last command in each batch is an MI_FLUSH command
and avoids appending another MI_FLUSH in the non-GEM cases.

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-10-19 14:46:12 -07:00
Kristian Høgsberg 282f51c3f0 Merge commit 'origin/master' into HEAD 2008-10-14 23:13:40 -04:00
Keith Packard 140451abb4 For non-DRM, add NOOPs after BATCH_BUFFER_START to verify completion
In non-DRM mode, the driver waits for the hardware by checking the ring
pointers; when the ring is empty, it assumes the hardware is idle. However,
the hardware updates the ring pointers before executing a command, so if the
MI_BATCH_BUFFER_START is the last command in the ring, the driver will think
the hardware is idle while it may still be processing the contents of the
batch buffer. Placing NOOPs after the BATCH_BUFFER_START allows the driver
to know that the hardware has completed the batch buffer.

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-10-09 18:23:26 -07:00
Keith Packard d09d938bf2 i830 nondrm batch buffer insertion was missing ADVANCE_LP_RING() call
The ring commands to insert a batch buffer to the ring in i830 form were not
terminated by a call to ADVANCE_LP_RING(). This surely would have caused
chaos.

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-10-09 18:23:26 -07:00
Keith Packard 8a54e3be5c Fix mis-merge of DRI2 changes related to pI830->directRenderingType
The old code had a directRendering boolean, the new one has an enum. A bunch
of the merges failed to remove the '!' in front of the old name, breaking a
bunch of 'we don't have DRI' tests.
2008-09-12 12:47:13 -07:00
Eric Anholt d8d95d8c71 Fix build failures that should have been in the previous merge commit. 2008-09-11 16:11:46 -07:00
Eric Anholt 58a3817305 Track move of exec to bufmgr, and restoration of emit/wait funcs for non-drm. 2008-09-09 19:18:10 -07:00
Jesse Barnes 3733a1b54c Fix build when using kernel DRM headers
Unfortunate mismatch between kernel and DRM master headers.
Kernel:
typedef struct _drm_i915_batchbuffer { ... } drm_i915_batchbuffer_t;
DRM master:
typedef struct drm_i915_batchbuffer { ... } drm_i915_batchbuffer_t;

so use the typedef rather than the morphing structure name.
2008-08-29 09:12:05 -07:00
Eric Anholt d775ddc64d [gem] Catch -EINTR from blocking GEM ioctl and restart. 2008-06-13 10:13:35 -07:00
Eric Anholt 339f00e340 [gem] Don't set up the ring in GEM mode, as that'll be handled by the kernel. 2008-06-10 22:50:01 -07:00
Eric Anholt e930c0dc5b Use bufmgr_gem when available instead of the fake bufmgr.
This is a bit unstable still sometimes.
2008-06-10 11:37:04 -07:00
Eric Anholt bade7d7d25 Use the DRM for submitting batchbuffers when available.
There are some concerns with this, as the DRM will be setting the nonsecure
flag on the batchbuffer, and the server may be submitting some secure-only
commands.  It appears to work on the 915GM test system currently.
2008-06-10 11:37:03 -07:00
Eric Anholt 6e94affcc2 Avoid needless flush emits in the blockhandler.
The EmitFlush in i830_dri.c was added as a pageflipping workaround, and was
noted to not even be sufficient then.  There's no reason for it to be there,
so it's removed.  After that, we just have to not emit an MI_FLUSH if we
already had, and cursor movement no longer bashes memory manager.
2008-06-10 11:37:03 -07:00
Eric Anholt b2216e7bc2 Use batchbuffers instead of ring emits for general commands.
The batchbuffers are managed using libdrm and bufmgr_fake, and dispatched from
the ring from userland.
2008-06-10 11:37:03 -07:00