Commit Graph

90 Commits

Author SHA1 Message Date
Wu Fengguang d978cd4b45 refresh batch_bo reference after intel_batch_flush()
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-24 15:10:39 -08:00
Zhenyu Wang 5cbf1e7271 Make IS_GM45 into IS_G4X define
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-06 09:46:54 +08:00
Eric Anholt 78b6cff3b6 i965: Support render acceleration with pixmaps in BOs.
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-05 17:22:02 -08:00
Eric Anholt 801f0eac4f Make I830FALLBACK debugging a runtime instead of compile-time option. 2008-11-05 17:22:00 -08:00
Carl Worth 08914cceda Use buffer objects for binding table and surface-state objects.
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-03 22:46:28 -08:00
Carl Worth 47cc3d79da Unreference the vertex_buffer_bo in gen4_render_state_cleanup
This avoids leaking one buffer object.
2008-11-03 22:46:28 -08:00
Carl Worth 88700acf30 Rename gen4_dynamic_state to gen4_vertex_buffer
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-03 22:46:28 -08:00
Carl Worth 9e95722763 965: Move composite setup to new _emit_batch_header_for_composite
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-03 22:46:28 -08:00
Carl Worth fcb2a5a125 Use buffer object for vertex buffer (in new gen4_dynamic_state)
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-11-03 22:46:17 -08:00
Carl Worth 4d5360b1f3 Use consistent idiom for obtaining static_state
This doesn't make any difference, but it's cleaner to have
each function follow the same idiom for obtaining these pointers.
2008-10-22 16:17:39 -07:00
Carl Worth 36fc53d068 Rename state_base_offset to static_state_offset in gen4_static_state_init
More cleanup here, and again no functional change.
2008-10-22 16:16:30 -07:00
Carl Worth 8fda7df007 Rename gen4_state_init to gen4_static_state_init
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-22 15:43:21 -07:00
Carl Worth acba423811 Rename gen4_state_t to gen4_static_state_t
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-22 15:20:22 -07:00
Carl Worth 260cbcfe61 Document and use 'legacy' border color mode
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 76c9ece36e ).
2008-10-06 13:22:08 -07:00
Carl Worth 98ca9e2af1 Rename default_color to border_color
This is consistent with the documentation, (and just plain makes
more sense).
2008-10-06 13:22:08 -07:00
Carl Worth 175b30e382 Revert "Fallback to software for RepeatNone with transformed RGB-only pictures."
This reverts commit 76c9ece36e.

We've learned a new technique that should let us avoid this fallback
to software. See following commit.
2008-10-06 13:22:07 -07:00
Carl Worth 76c9ece36e Fallback to software for RepeatNone with transformed RGB-only pictures.
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-02 20:40:14 -07:00
Carl Worth ab2b70f831 Prefer repeatType field over using both repeat and repeatType.
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-01 16:05:16 -07:00
Carl Worth 128223ee9b Add support for RepeatPad and RepeatReflect.
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-01 15:33:04 -07:00
Carl Worth b7279f1be1 Examine picture repeatType as well as repeat field.
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-10-01 15:33:04 -07:00
Jesse Barnes e2743a409a Only BO map render state if kernel mode setting is active
We'll probably end up doing this differently, but avoid this path for now.
2008-09-12 14:22:48 -07:00
Jesse Barnes c1687f9ca9 Map/unmap render state only when bo is available
Otherwise just use the GTT address.
2008-08-14 15:48:02 -07:00
Jesse Barnes 1ab7239b73 Map gen4 render state buffer before initializing 2008-08-12 18:16:37 -07:00
Jesse Barnes 5c9a62a29f Revert "Switch to using a buffer object for the vertex buffer"
This reverts commit 1abf4d3a7a.

Conflicts:

	src/i965_render.c - flushing was removed, keep it that way
2008-08-06 12:39:03 -07:00
Jesse Barnes c2f0df4dc9 Merge branch 'drm-gem' of ssh://git.freedesktop.org/git/xorg/driver/xf86-video-intel into drm-gem 2008-08-05 13:03:46 -07:00
Carl Worth b3c1a14867 Eliminate unnecessary flush from i965_composite
This improves 'x11perf -aa10text' performance from ~144k to ~169k
2008-07-31 11:14:25 -07:00
Carl Worth 1abf4d3a7a Switch to using a buffer object for the vertex buffer 2008-07-31 11:14:25 -07:00
Zhenyu Wang 6ac352f146 shut up gcc warning 2008-07-23 15:10:07 +08:00
Carl Worth 757c00927a Use up to 256 separate vertex buffers
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-12 08:15:08 -07:00
Carl Worth 0c548cd040 Allow for multiple vertex buffers (though only use one for now)
Using more than one (in the future) will allow for doing less frequent calls
to i830WaitSync.
2008-07-12 00:44:30 -07:00
Carl Worth cc2249333c Move VERTEX_BUFFERS setup from prepare_composite to composite
This is in preparation for having larger (or multiple) vertex buffers
in the future.
2008-07-12 00:44:30 -07:00
Zhenyu Wang a34a4e3f64 Fix official name for GM45 chipset 2008-07-03 01:03:14 +08:00
Zhenyu Wang 1cfe769c74 Add support for Intel 4 series chipsets. 2008-06-17 12:39:28 -07:00
Zhenyu Wang 548d4c0f97 Fix i965 render getting dest format error
Depend on value returned by function within assert is wrong.
Fixed weird render corrupt on i965.
2008-05-08 12:43:30 +08:00
Eric Anholt 2c135ef8ac Make the binding table and surface state be arrays to reduce syncing. 2008-04-17 11:08:28 -07:00
Eric Anholt 23d1df22d1 Abstract surface setup into a separate function. 2008-04-14 23:54:38 -07:00
Eric Anholt e27ce4238f Move the vertex buffer to the state structure as well. 2008-04-14 23:30:21 -07:00
Eric Anholt 69709fe36c Move the binding table for 965 to the state structure. 2008-04-14 18:34:13 -07:00
Eric Anholt 049d057dfd Move the 965 static variables local to the function they're used in. 2008-04-14 17:09:22 -07:00
Eric Anholt 092962c962 Make the VS unit state static for 965 render. 2008-04-14 14:02:58 -07:00
Eric Anholt 4bbdd7096d Rename some variables in i965_render.c for clarity.
The gen4_render_state is now always called "render_state" (i965_render.c
bookkeeping) and gen4_state_t is now always called "card_state" (the buffer
for state used by the chip).
2008-04-14 13:53:36 -07:00
Carl Worth 456bb52933 Associate one sf_state object with each sf_kernel
(cherry picked from a2b5c23184d19b386fdfd04f578a55566df60132 commit)
2008-04-14 13:24:50 -07:00
Keith Packard 269809030e Move wm_scratch first to meet alignment requirements 2008-04-13 12:47:02 -07:00
Eric Anholt 03836067b7 Fix the offset to sampler default color, and a compiler warning. 2008-04-11 14:15:49 -07:00
Carl Worth d3138d9ff0 Enumerate all possible wm_state objects
We have a collection of wm_state objects for each ps kernel,
(one for each combination of src and mask extend and repeat
values).

Thanks to Dave Airlie for noticing an errant write through a
wild wm_state pointer in an early version of this commit.

(cherry picked from 7763706a93d3021907273f9b330750ba110e2fc3 commit)

This cherry-pick required more reformatting than most, due to the
projective texturing merge.
2008-04-11 14:15:49 -07:00
Carl Worth 2293a3677d Enumerate all possible src,mask sampler state pairs
This will eventually allow for the elimination of sampler state
updates while compositing---and initializing everything in the
initialization function.

(cherry picked from commit d0874697be8086cd64740c24698df8cd4d31c76f)
2008-04-11 14:15:48 -07:00
Carl Worth baa55ffe3b Enumerate all possible cc_state objects
We need one for each possible combination of src and dst
blend_factors. Again, as with recent changes, this eliminates
state updates from prepare_composite and allows that function
to instead simply reference an existing object initialized
within gen4_state_init.

Thanks to Dave Airlie (and git-bisect) for pointing out that with
gnome-terminal all text was appearing as solid black with an early
version of this commit. As expected the bug was an alignment issue.

(cherry picked from 0c0ab52c2d100c47f38c7ef826ef585c8b9815e9 commit)

Performance is approximately equivalent on text tests, but may be
around +2%.
2008-04-10 16:03:29 -07:00
Keith Packard b01d582e23 Revert "Compute pixel values directly into data port"
This reverts commit 346cf57deabb4c336612df4c13650a87b5ef6775.

Mixing randr transforms and video caused screen corruption for Render
operations. No, I don't understand why.
2008-04-10 16:58:11 -05:00
Keith Packard 32ef985183 Compute pixel values directly into data port
Instead of leaving pixel values in src_sample registers, compute the pixel
values directl to the data port to save 8 moves. This cannot work when no
computation is done as there is both no way to wait for the sampler to
finish and because the sampler returns data in a different order from that
required by the data port (sigh).
2008-04-10 16:58:11 -05:00
Eric Anholt 2871ac8eef Statically allocate the sampler default color, which we never change.
Performance change is in the noise.  Also from Carl Worth.
2008-04-10 13:53:40 -07:00