summaryrefslogtreecommitdiff
path: root/src/intel_uxa.c
AgeCommit message (Collapse)Author
2012-02-08uxa/glamor: Refine CloseScreen and InitScreen process.Zhigang Gong
The previous version calls glamor_egl_close_screen and glamor_egl_free_screen manually which is not align with standard process. Now glamor change the way to follow standard method: glamor layer and glamor egl layer both have their internal CloseScreens. The correct sequence is after the I830CloseScreen is registered, then register glamor_egl_close_screen and the last one is glamor_close_screen. So we move out the intel_glamor_init from the intel_uxa_init to I830ScreenInit and just after the registration of I830CloseScreen. As the glamor interfaces changed, we need to check the glamor version when load the glamor egl module to make sure we are loading the right glamor module. If failed, it will switch back to UXA path. This depends upon glamor commit 1bc8bf tagged with version 0.3.0. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-16uxa/glamor: Create glamor pixmap by default.Zhigang Gong
When creating native glamor pixmaps we will get much better performance than using the textured-drm pixmap, this commit is to make that the default behaviour when configured to use glamor. Another advantage of this commit is that we reduce the risk of encountering the "incompatible region exists for this name" and the associated render corruption. And since we now never intentionally allocate a reusable pixmap we could just make all (intel_glamor) allocations non-reusable without incurring too great an overhead. A side effect is that those glamor pixmaps do not have a valid BO attached to them and thus it fails to get a DRI drawable. This commit also fixes that problem by adjusting the fixup_shadow mechanism to recreate a textured-drm pixmap from the native glamor pixmap. I tested this with mutter, and it works fine. The performance gain to apply this patch is about 10% to 20% with different workload. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-16uxa/glamor: Fallback to new glamor pixmap if failed to create textured pixmap.Zhigang Gong
If we failed to create textured pixmap from BO's handle, we turn to create a new glamor pixmap by call glamor_create_pixmap rather than fallback to in-memory pixmap. Have to introduce a new wrapper function intel_glamor_create_pixmap. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-12-14uxa/glamor: Allocate a fbPixmap with storage for fallbacksChris Wilson
When we try to create a glamor pixmap and fail we need to create a real pixmap along with its pixel allocation, instead of detaching ourselves and returning the fake pixmap header. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-14uxa/glamor: Enable the rest of the glamor rendering routinesZhigang Gong
This commit hooks up all the remaining rendering routines to call into glamor; the takeover is nearly complete! When tested with the latest glamor master branch, it passes rendercheck. One thing need to be pointed out is the picture's handling. Pictures support many different color formats, but glamor's texture only support a few color formats. And the most common scenario is that we create a pixmap with a color depth and then attach it to a picture which has a specific color format with the same color depth. But there is no way to change a texture's internal format after the texture was allocated. If you do that, the OpenGL will allocate a new texture. And then the glamor side and UXA side will be inconsitent. So for all the picture related operations, we can't fallback to UXA path directly, even it is rather a straight forward operation. So for the get_image, Addtraps.., we have to add wrappers function for them to jump into glamor firstly. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> [ickle: prefer access; ok = glamor(); finish; if (!ok) goto fallback; return; ] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-13uxa: Wakeup 3s after the last rendering to reap the bo-cacheChris Wilson
libdrm expires its bo 2s after entry into the cache, but we need to free a buffer to trigger the reaper. So schedule a timer event to trigger 3s after the last rendering is submitted to free any resident bo during long periods of idleness. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05uxa: Unmap the buffer after swrastChris Wilson
Otherwise we may exhaust the per-process vma limit and cause applications to stop rendering and eventually crash the X server. Will only work in conjunction with a new libdrm (2.4.28) and commit c549a77c (intel: Unmap buffers during drm_intel_gem_bo_unmap) in particular. Reported-by: nobled@dreamwidth.org References: https://bugs.freedesktop.org/show_bug.cgi?id=43075 References: https://bugs.freedesktop.org/show_bug.cgi?id=40066 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-21uxa: Make the glamor/uxa transition more verboseChris Wilson
And so hopefully make it clearer. In the process we restore the flushing behaviour for UXA back to before the glamor intervention. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-17glamor: Initial commit to introduce glamor acceleration.Zhigang Gong
Added one configuration option --enable-glamor to control whether use glamor. Added one new file intel_glamor.c to wrap glamor egl API for intel driver's usage. This commit doesn't really change the driver's control path. It just adds necessary files for glamor and change some configuration. Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-16Compile out UXA if so desiredChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-03uxa: Remove caching of surface binding locationChris Wilson
If the pixmap were to be used multiple times within a batch with mulitple formats, the cache would only return the initial location with the incorrect format and so cause rendering glitches. For instance, GTK+ uses the same pixmap as an xrgb source and as an argb mask in order to premultiply and composite in a single pass. Rather than introduce an overly complication caching (handle, format) mechanism, kiss and remove the invalid implementation. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40926 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-17snb,ivb: Workaround unknown blitter deathChris Wilson
The first workaround was a performance killing MI_FLUSH_DW after every op. This workaround appears to be a stable compromise instead, only requiring a redundant command after every BLT command with little impact on throughput. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=27892 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39524 Tested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-29video: check that the pixmap exists before useChris Wilson
Now, the pixmap being used is meant to the Screen pixmap and by rights that has to exists in a GPU buffer! Evidence contrary to the above exists and so we had better check that we have a bo before using... Reported-by: Toralf Förster <toralf.foerster@gmx.de> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40439 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-08intel: Restore manual flush for old kernelsChris Wilson
Daniel Vetter pointed out that the automagic flush by the kernel for the busy-ioctl was only introduced upstream in 2.6.37. So we still need to manually emit a flush on old kernels. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-04Take advantage of the kernel flush for dirty bo in the busy ioctlChris Wilson
Rather than just creating and submitting a batch that simply contains a flush in order to periodically ensure that rendering reaches the scanout, we can simply ask the kernel whether the scanout is busy. The kernel will then submit a flush on our behalf if it is dirty, which takes advantage of the kernel's dirty state tracking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-29Cleanup gen2 tiling confusionDaniel Vetter
A tile on gen2 has a size of 2kb, stride of 128 bytes and 16 rows. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-09Update priv->stride after bo reallocationChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-22Fix relaxed tiling on gen2Daniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-01-20Create the UXA generational resources during screen createChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-08Remove unused GTT/Map sizes and addressesChris Wilson
These have been made obsolete by KMS and GEM. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-30Don't replace the scanout bo through PutImageChris Wilson
As the bo may be pinned for either use by the scanout or through sharing with another application, under those circumstances we cannot replace the bo itself but must force the blit for PutImage. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31367 Reported-and-tested-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-23i830: amalgamate consecutive composites into a single primitiveChris Wilson
Improve aa10text on i845 from 218kglyphs/s to 234kglyphs/s Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-07i965: Invalidate pixmap binding location on reuse.Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-07Always flush the batch before blocking for new X requestsChris Wilson
This should prevent any lag when waiting upon user input, for example whilst logging in with gdm. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-05uxa: Prevent reading past the last byte on upload/downloadChris Wilson
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29752 Reported-by: Sergey Samokhin <prikrutil@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-03i965: Amalgamate surface binding tablesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-03i965: Upload an entire vbo in a single pwrite, rather than per-rectangleChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-14uxa: Relax fencing some more for gen3Chris Wilson
Allow fenced allocations even for small pixmaps if the kernel supports relaxing fencing (where only the used pages are allocated). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-01Support BLT acceleration on gen6Zou Nan hai
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-18Fix violation of gen6 requirements for depthbuffer tiling.Eric Anholt
In general, demoting of tiling of DRI2 buffers seems dubious, as we've got various bits of functionality that won't all work together unless buffers are tiled as expected. This just covers one instance of the problem, caught by assertions in Mesa. Fixes: fbo-1d fbo-d24s8. glean/readPixSanity glean/rgbTriStrip glean/scissor
2010-10-07Include a chipset generation number to clarify device specific paths.Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-06uxa: Re-enable acceleration.Chris Wilson
A side-effect of discriminating offscreen based on the devPrivate.ptr was that it broke uxa_finish_access and so after any fallback to s/w on a Pixmap, it remained in software for the reminder of its life. Introduce an explicit boolean to mark whether or not hardware acceleration is enabled for a pixmap (with a GEM buffer). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-06Revert "Clear pixmap->devPrivate.ptr [regression in 7c7294e]"Chris Wilson
This reverts commit 48b4e224297fa807be0e2bc7a67bf7e94579e8de. The better fix is to manually mark the pixmap when acceleration is and is not permitted. Whilst the devPrivate.ptr are invalid upon creation, it is not worth carring code that serves no purpose.
2010-10-06Clear pixmap->devPrivate.ptr [regression from 7c7294e]Chris Wilson
ModifyPixmapHeader(pixdata = NULL) does not clear the pixmap->devPrivate.ptr, instead the NULL value is interpreted as meaning to keep the current value. (This is similar to the interpretation of the other invalid values like depth=-1 which also mean not to change the current property). However pixadata=NULL is indeed a valid value, and in 7c7294e, devPrivate.ptr == NULL was used to differentiate a bo pixmap from a system pixmap. Except that we never did clear the ptr as intended, and so X would immediately crash. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-04shadow+dri2: Allow dri2 to be independently enabled with shadowChris Wilson
To enable DRI we create GEM buffers for the client to render into with hardware acceleration. In order to maintain coherency between any 2D render operations with the independent 3D clients (this includes the reading of 2D rasterisation by the direct rendering client, e.g. compiz using texture_from_pixmap) we need to replace the shadow pixmap with the GTT mapping. Therefore 2D rendering to a DRI buffer will be to uncached memory and thus penalised -- but the direct rendering clients will have full hardware acceleration. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-04Split shadow handling routines to their own file.Chris Wilson
This is about to get messy, so separate out the shadow from the normal code. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-13uxa: Apply source clipping to blitsChris Wilson
Yes, this should be done in the higher layers. Yes, I have written code to that. No, it is not ready, hence add the sanity check to the SRC_COPY_BLT. This isn't the first report that I've seen, but will be the last. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30120 Reported-by: rezbit.hex@gmail.com Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-10shadow: Simply modify the Screen pixmap headerChris Wilson
This is a slightly less risky strategy than having to remember to update all pointers to the old Screen pixmap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-08Enable a shadow buffer and disable GPU acceleration.Chris Wilson
An attempt to workaround the incoherency in gen2 chipsets, we avoid using dynamic reallocation as much as possible. The first step is to disable allocation of pixmaps using GEM and simply create them in system memory without a backing buffer object. This forces all rendering to use S/W fallbacks. The second step is to allocate a shadow front buffer and assign that to the Screen pixmap. This ensure that the front buffer remains in the GTT and pinned for scanout. The shadow buffer will be rendered to in the normal fashion via the Screen pixmap, and be marked dirty. In the block handler, the dirty shadow buffer is then blitted (using the GPU) over the front buffer. This should completely avoid having to move pages around in the GTT and avoid incurring the wrath of those early chipsets. Secondly, performance should be reasonable as we avoid the ping-pong caused by the small aperture and weak GPU forcing software fallbacks. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-04Force use of GTT and fence registers for mapping tiled objectsChris Wilson
If the buffer object is tiled, we need to use the fence registers to perform the appropriate untiling for CPU access. Ensure that we always take this path for tiled objects, regardless of their size. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-22Remove accel_pitch_alignmentChris Wilson
This has to be 64 on all generations currently, so replace the variable with a constant. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-22Replace ROUND_* macros with ALIGN.Matt Turner
Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-20intel: respect tiling disable.Dave Airlie
For testing purposes its nice to know tiling isn't being used anywhere. Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-06-25Remove unused inclusion of <sys/mman.h>Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-25Rename common infrastructure to the intel namespace.Chris Wilson
After splitting out the i810 driver into its own legacy directory, we can identify the common routines not as i830 but as intel. This clarifies the code which *is* i830 specific. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>