summaryrefslogtreecommitdiff
path: root/src/i830_batchbuffer.c
AgeCommit message (Collapse)Author
2010-02-20Remove dead i830_ring.h.Eric Anholt
2009-12-07batch: Ensure we send a MI_FLUSH in the block handler for TFPChris Wilson
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-02batch: Downgrade batch submission from a FatalError.Chris Wilson
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-02Remove flush parameter from intel_batch_flush()Chris Wilson
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-02Review use of errno after libdrm callChris Wilson
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-11-30debug: Enable dumping of batchbuffer [compile-time only]Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-11-30debug: Don't always flush the batch when emitting a debugging flushChris Wilson
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-29batch: Track pixmap domains.Chris Wilson
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-10Check that batch buffers are atomic.Chris Wilson
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-10-14conf: Add debugging flush optionsChris Wilson
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-08Rename the xf86 screen private from pScrn to scrn.Eric Anholt
2009-10-08Rename the screen private from I830Ptr pI830 to intel_screen_private *intel.Eric Anholt
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-06Move to kernel coding style.Eric Anholt
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-06Remove UMS support.Eric Anholt
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-06-11intel_batch_init: test have_gem, not directRenderingTypeKeith Packard
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-05-13Add new have_gem flagJesse Barnes
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-04-27Replace I830Sync's irq emit/wait code with bufmgr use.Eric Anholt
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-03-06intel: Nuke shared-entity support (zaphod mode).Eric Anholt
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-06Fix another VT switch leakLukáš Hejtmánek
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-01-17intel: fix DRI2 should be DRI_DRI2Dave Airlie
2009-01-15Fix invarient state emits for DRI2 (do it per batch, since there's no lock).Eric Anholt
2009-01-06FatalError on batchbuffer map failureKeith Packard
Yes, it would be nice to do something other than crash here. Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-08i965: Add batch_flush_notify hook to create new vertex-buffer boCarl Worth
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-11-17Merge commit 'origin/master' into dri2Kristian Høgsberg
Conflicts: src/i830_dri.c src/i830_driver.c src/i830_memory.c
2008-10-19Reduce incidence of MI_FLUSH usage.Keith Packard
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-14Merge commit 'origin/master' into HEADKristian Høgsberg
2008-10-09For non-DRM, add NOOPs after BATCH_BUFFER_START to verify completionKeith Packard
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-09i830 nondrm batch buffer insertion was missing ADVANCE_LP_RING() callKeith Packard
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-09-12Fix mis-merge of DRI2 changes related to pI830->directRenderingTypeKeith Packard
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-11Fix build failures that should have been in the previous merge commit.Eric Anholt
2008-09-09Track move of exec to bufmgr, and restoration of emit/wait funcs for non-drm.Eric Anholt
2008-08-29Fix build when using kernel DRM headersJesse Barnes
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-06-13[gem] Catch -EINTR from blocking GEM ioctl and restart.Eric Anholt
2008-06-10[gem] Don't set up the ring in GEM mode, as that'll be handled by the kernel.Eric Anholt
2008-06-10Use bufmgr_gem when available instead of the fake bufmgr.Eric Anholt
This is a bit unstable still sometimes.
2008-06-10Use the DRM for submitting batchbuffers when available.Eric Anholt
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-10Avoid needless flush emits in the blockhandler.Eric Anholt
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-10Use batchbuffers instead of ring emits for general commands.Eric Anholt
The batchbuffers are managed using libdrm and bufmgr_fake, and dispatched from the ring from userland.