summaryrefslogtreecommitdiff
path: root/src/i965_render.c
AgeCommit message (Collapse)Author
2009-04-21Staticize a bunch of functions and variables in the driver.Eric Anholt
This cleans up findstatic.pl output for the i830+ code, which resulted in removing some code. The only odd part of this commit is the if (0) i830_sdvo_dump() in i830_sdvo.c -- it tells the compiler that the code is used, without using it since we want the code around while debugging. It's also in a likely place to ask for the dump, so I think it's OK.
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-04Fix serious memory leak at Enter/LeaveVTLukas Hejtmanek
This fixes huge memory leak at each VT switch (about 600 BOs + 6MB of RSS of Xserver).
2009-01-27Don't forget the new state bos in check_aperture.Eric Anholt
They're tiny so it shouldn't have been a problem, but play it safe. This is another <5% loss on top of the previously reported value, bringing the whole series to about 8%.
2009-01-21Move i965 render sampler state to BOs.Eric Anholt
This eliminates the pinned memory allocation for 965 render state.
2009-01-21Move i965 render kernels to BOs.Eric Anholt
2009-01-21Move 965 render unit state to BOs.Eric Anholt
This is a first step in a series of changes to avoid requiring a pinned object, which gets in the way of doing non-root KMS. This change appears to result in about a 2-6% loss in x11perf -aa10text, which better algorithms in libdrm could make up for (it hasn't really had to deal with code this bad before).
2009-01-21Remove 965 render wm scratch space, which was just unused.Eric Anholt
2009-01-20Use drm_intel_bo_subdata to put render vb data in.Eric Anholt
This improves performance by avoiding repeated map/unmap cycles, which are a bit expensive on my machine with lock debugging on in the kernel. It could do much better if we did more than 18 or so floats at a time.
2009-01-20Move i965 render vb setup to use time, and decouple state emit from it.Eric Anholt
The require_space had failed since it only checked for the space required by the batch emits in the function itself, but not in the i965_emit_composite_state() that it called (the state we were concerned about having set up for that 12 * 4 dwords to follow!). This is replaced by intel_batch_start_atomic(), which will catch such mistakes in the future.
2009-01-20Move i965 render transform setup from emit_composite_state to prepare_composite.Eric Anholt
2009-01-20i965: Pull check_aperture out to a separate function and make it dtrt.Eric Anholt
Previously it wouldn't count the pixmaps that were about to be used, which is pretty much the only purpose of having the pain around. This also eliminates the check_twice confusion with emit_batch_header_for_composite().
2009-01-20Move filter computation from emit_batch_header to prepare_composite.Eric Anholt
2009-01-20Use intel_emit_reloc from video to prettify 965 render bind_bo setup.Eric Anholt
2009-01-20Move i965 render state bo setup back to prepare_composite.Eric Anholt
We want the objects to be created once per prepare/done both for efficiency and so we can handle aperture checking better.
2009-01-06Handle drm_bo_map failure in 965 video and composite paths.Keith Packard
These two paths allocate a number of objects directly. Signed-off-by: Keith Packard <keithp@keithp.com>
2008-12-29Don't count vertex buffer in second aperture size checkZhenyu Wang
With batch flush notify vertex buffer will be unreferenced, so don't count it in later aperture check. Also adding uninitialized vertex buffer check in batch flush notify.
2008-12-08Set vertex_buffer_bo to NULL after unreference.Carl Worth
Which is just being tidy. We initially were looking at this code path due to a report of a crash on server shutdown which started after this unreference call was added. Setting this to NULL apparently didn't avoid the crash, but it's a good thing to do regardless.
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-24refresh batch_bo reference after intel_batch_flush()Wu Fengguang
The call into intel_batch_flush() will invalidate the pI830->batch_bo stored in bo_table[0]. Fix it by re-read the refreshed value. Signed-off-by: Wu Fengguang <wfg@linux.intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
2008-11-06Make IS_GM45 into IS_G4X defineZhenyu Wang
Those are identical that using one define is much clear. And it can also apply fixes for GM45 too, which is missing with origin define.
2008-11-05i965: Support render acceleration with pixmaps in BOs.Eric Anholt
This required reordering the relocation emits for surface/binding table so that we didn't add new relocations to things that had already been relocated at (the check_aperture requirement).
2008-11-05Make I830FALLBACK debugging a runtime instead of compile-time option.Eric Anholt
2008-11-03Use buffer objects for binding table and surface-state objects.Carl Worth
Instead of having a static array for these and doing an ugly sync everytime we recycle the array, we now simply allocate short-lived buffer objects for this dynamic state. The dri layer, in turn, can take care of efficiently reusing objects as necessary. On a GM965 this change was tested to improve the performance of x11perf -aa10text from roughly 120000 to 154000 glyphs/sec.
2008-11-03Unreference the vertex_buffer_bo in gen4_render_state_cleanupCarl Worth
This avoids leaking one buffer object.
2008-11-03Rename gen4_dynamic_state to gen4_vertex_bufferCarl Worth
We don't actually plan to put any other data in this structure, so it doesn't make sense to have a generic name, (since we'll only be using it for our vertex buffer).
2008-11-03965: Move composite setup to new _emit_batch_header_for_compositeCarl Worth
This function is the new name for _allocate_dynamic_state now that it also emits everything to the batch necessary for setting up a composite operation. This happens in prepare_composite() every time and in composite() whenever our vertex buffer fills up. It's not yet strictly necessary to be redoing this setup in composite() but it will be soon when the setup starts referring to buffer objects for surface state and binding table. This move prepares for that.
2008-11-03Use buffer object for vertex buffer (in new gen4_dynamic_state)Carl Worth
This begins the process of separating the dynamic data from the static data, (still to move are the surface state and binding table objects). The new dynamic_state is stored in a buffer object, so this patch restores the buffer-object-for-vertex-buffer functionality originally in commit 1abf4d3a7a and later reverted in 5c9a62a29f. A notable difference is that this time we actually do use check_aperture_space to ensure things will fit, (assuming there's a non-empty implementation under that).
2008-10-22Use consistent idiom for obtaining static_stateCarl Worth
This doesn't make any difference, but it's cleaner to have each function follow the same idiom for obtaining these pointers.
2008-10-22Rename state_base_offset to static_state_offset in gen4_static_state_initCarl Worth
More cleanup here, and again no functional change.
2008-10-22Rename gen4_state_init to gen4_static_state_initCarl Worth
This follows naturally from the structure rename. Also we make things less muddled by having this function actually accept a pointer to a gen4_static_state_t rather than a gen4_state_t, (and then fetching the desired pointer out from that). Again, no intended change in functionality here.
2008-10-22Rename gen4_state_t to gen4_static_state_tCarl Worth
It doesn't contain only static data yet, but it will soon, so this renaming prepares for that. Also, this helps make things more clear between gen4_render_state_t and gen4_state_t which were muddled before, (particularly because the corresponding identifiers were render_state and card_state). The card_state identifier is now known as static_state which should be less confusing. This change is strictly search-and-replace with no functional changes.
2008-10-06Document and use 'legacy' border color modeCarl Worth
It's very convenient that the hardware supports this non-default mode since it's exactly what is specified by the Render extension. This provides a more efficient means of fixing bug #16820: [EXA] Composition result in black for areas outside of source-surface bo https://bugs.freedesktop.org/show_bug.cgi?id=16820 without the software fallback we had in the earlier fix, (commit 76c9ece36e6400fd10f364ee330faea470e2da64 ).
2008-10-06Rename default_color to border_colorCarl Worth
This is consistent with the documentation, (and just plain makes more sense).
2008-10-06Revert "Fallback to software for RepeatNone with transformed RGB-only pictures."Carl Worth
This reverts commit 76c9ece36e6400fd10f364ee330faea470e2da64. We've learned a new technique that should let us avoid this fallback to software. See following commit.
2008-10-02Fallback to software for RepeatNone with transformed RGB-only pictures.Carl Worth
We wish it wouldn't, but the hardware ignores the alpha in the BorderColor we set when the source picture format has no alpha in it, (and it uses alpha of 1.0 where we want 0.0). For now, fallback for these cases. This gives a correct result, but obviously is not as fast as we would like. This fixes bug #16820: [EXA] Composition result in black for areas outside of source-surface bounds https://bugs.freedesktop.org/show_bug.cgi?id=16820
2008-10-01Prefer repeatType field over using both repeat and repeatType.Carl Worth
Eric informed me that the repeat field exists only for backwards compatibility with old drivers that weren't prepared for values other than 0 or 1 here. Since we are, we can just ignore that field and examine only repeatType. So the code's a (tiny) bit simpler this way.
2008-10-01Add support for RepeatPad and RepeatReflect.Carl Worth
It's quite simple to support these modes---we simply need to turn on the support for them in the hardware. These changes have been verified with the extend-pad and extend-reflect tests in cairo's test suite. However, this currently required using a custom-modified version of cairo. The issue is that released versions of cairo, (and even cairo master so far), don't pass RepeatPad and RepeatReflect to Render, (due to various bugs and workarounds in cairo and pixman). I do plan to fix those issues in cairo, so that in a future release of cairo, (1.8.2 perhaps?), the cairo test suite will usefully test these new repeat modes in our driver.
2008-10-01Examine picture repeatType as well as repeat field.Carl Worth
The existing switch statement was switching on the Boolean repeat field rather than the correct repeatType field. This had not caused any problem before as only two possible repeat values were supported (RepeatNone = 0 and RepeatNormal = 1) so they were always the same as the repeat field. Soon, however, we'll be supporting more repeat types, so we'll need to switch on the correct value.
2008-09-12Only BO map render state if kernel mode setting is activeJesse Barnes
We'll probably end up doing this differently, but avoid this path for now.
2008-08-14Map/unmap render state only when bo is availableJesse Barnes
Otherwise just use the GTT address.
2008-08-12Map gen4 render state buffer before initializingJesse Barnes
2008-08-06Revert "Switch to using a buffer object for the vertex buffer"Jesse Barnes
This reverts commit 1abf4d3a7a203ff5d6e5ceda29573e7fd69ddf8e. Conflicts: src/i965_render.c - flushing was removed, keep it that way
2008-08-05Merge branch 'drm-gem' of ↵Jesse Barnes
ssh://git.freedesktop.org/git/xorg/driver/xf86-video-intel into drm-gem
2008-07-31Eliminate unnecessary flush from i965_compositeCarl Worth
This improves 'x11perf -aa10text' performance from ~144k to ~169k
2008-07-31Switch to using a buffer object for the vertex bufferCarl Worth
2008-07-23shut up gcc warningZhenyu Wang
2008-07-12Use up to 256 separate vertex buffersCarl Worth
This allows us to only call i830WaitSync once every 128 calls to composite rather than on every call. However, we do need to also call MI_FLUSH to avoid the vertex cache getting in our way, (since our "separate" buffers are all allocated as one contiguous chunk).
2008-07-12Allow for multiple vertex buffers (though only use one for now)Carl Worth
Using more than one (in the future) will allow for doing less frequent calls to i830WaitSync.
2008-07-12Move VERTEX_BUFFERS setup from prepare_composite to compositeCarl Worth
This is in preparation for having larger (or multiple) vertex buffers in the future.