History log of /external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8a5684d1bd2bdd4fc73ec5008685caab2919fbb0 15-Mar-2017 Topi Pohjolainen <topi.pohjolainen@intel.com> i965/gen8+: Do full stall when switching pipeline

just as earlier gens do.

CC: "17.0 13.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96743
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit bd25d9670b466043cdb5d9668f82accbd587c889)
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
477ea60b68d3e9a16d1f4947f95e3e7ce20e6f67 01-Oct-2016 Nanley Chery <nanley.g.chery@intel.com> i965: Program 3DSTATE_AA_LINE_PARAMETERS in upload_invariant_state

This packet is non-pipelined and doesn't ever change across emissions.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
c30b7164b757e5ee68f4856adecc6b720ff9d941 24-Oct-2016 Jason Ekstrand <jason.ekstrand@intel.com> i965/miptree: Remove the stencil_as_y_tiled parameter from get_aligned_offset

The only actual user of this parameter was blorp and, since the conversion
to ISL, it no longer uses this function.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0aa0b397695b9001d5e962622909f9546e2a6836 23-Jun-2016 Jason Ekstrand <jason.ekstrand@intel.com> i965/miptree: Remove the stencil_as_y_tiled parameter from get_tile_masks

It's only used to stomp the tiling to Y and it's only used by blorp so
there's no reason why blorp can't do it itself.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
04f74d66293222d5e1905cfb930bfa083e30463c 01-Jul-2016 Francisco Jerez <currojerez@riseup.net> i965: Emit SNB write cache flush W/A from brw_emit_pipe_control_flush.

Shouldn't cause any functional changes at this point, but we have
forgotten to apply this workaround several times in the past, make
sure it doesn't happen again.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
83c6749ddb9bb767e754aa886cdc872af0557898 24-May-2016 Matt Turner <mattst88@gmail.com> i965: Assert that a depth_mt exists when using HiZ.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
b6f250d7f2f704c8681aaa2a158d1a39851b8494 27-Apr-2016 Kenneth Graunke <kenneth@whitecape.org> i965: Send the minimal number of STATE_BASE_ADDRESS packets.

STATE_BASE_ADDRESS stalls the whole pipeline, and the documentation
cautions us to emit it as little as possible for better performance.

We recently put some hacks in BLORP to try and avoid emitting it
if it was already set correctly. However, this wasn't quite minimal:
if BLORP is the first operation (i.e. glClear()), then it would emit
it, and subsequent draw calls would emit it again.

This caused a small drop in performance in GPUTest Triangle when
switching from Meta to BLORP.

Unlike most packets, STATE_BASE_ADDRESS isn't influenced by GL state:
it needs to be emitted once per batch, before most other commands, or
whenever we change the program cache BO. It's also valid in both the
3D and compute pipelines, which makes it even more unique.

This patch removes it from the atom mechanism and instead directly
calls it as part of every draw, compute dispatch, or BLORP operation.
We introduce a new flag indicating that STATE_BASE_ADDRESS has already
been emitted this batch, and if so, skip doing it again. When we make
a new program cache BO, we simply reset the flag, so the next operation
will emit it again. When we flush/reset the batch, we reset the flag.

This guarantees that we'll emit STATE_BASE_ADDRESS only when we have to.
It's also less code than the old atom mechanism.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
97179c606c998b4f6810b4dc1c5007c848cda4ee 27-Apr-2016 Kenneth Graunke <kenneth@whitecape.org> i965: Combine Gen4-7 and Gen8+ state base address emitters.

We're about to start calling it directly, and this means the callers
won't have to think about generations.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e9ca952581d6cecf61df73534c8664a9662fd558 11-May-2016 Kenneth Graunke <kenneth@whitecape.org> i965: Drop BRW_NEW_BLORP from stipple and line parameter packets.

BLORP never touches these, and they're all non-pipelined. Some
are fairly large packets as well.

I haven't tried to benchmark this; the effect is likely to be small.
However, we may as well stop the pointless papercuts; maybe they'll
add up someday.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
9e153c06920eb825198385085f0e7085b1fc5c00 22-Apr-2016 Topi Pohjolainen <topi.pohjolainen@intel.com> i965/blorp: Do not trigger re-emission of base state address

In case blorp needs to configure it will be just as if render or
compute pipeline had configured it.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
6d5ce1b0433f4cbc5cd88b4bfeaf4cdcba6beda8 22-Apr-2016 Kenneth Graunke <kenneth@whitecape.org> i965: Make all atoms to track BRW_NEW_BLORP by default

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
53739fddc65a4cb34a2da14b873e95a451916267 14-Jan-2016 Francisco Jerez <currojerez@riseup.net> i965: Rename define for the PIPE_CONTROL DC flush bit.

Its previous name was somewhat misleading, this really behaves like a
RW cache flush rather than an invalidation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0556b87de4302195402ade43f400e859d9bfad0e 03-Jan-2016 Francisco Jerez <currojerez@riseup.net> i965/gen7.5+: Disable resource streamer during GPGPU workloads.

The RS and hardware binding tables are only supported on the 3D
pipeline and can lead to corruption if left enabled during a GPGPU
workload. Disable it when switching to the GPGPU (or media) pipeline
and re-enable it when switching back to the 3D pipeline.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
c8df0e7bf35cbab649c8d0e0205746293e686ce3 03-Jan-2016 Francisco Jerez <currojerez@riseup.net> i965/gen7: Emit stall and dummy primitive draw after switching to the 3D pipeline.

This hardware bug can supposedly lead to a hang on IVB and VLV.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
635be1402c485b154ab1bf23e5448827364e70a5 03-Jan-2016 Francisco Jerez <currojerez@riseup.net> i965/gen4-5: Emit MI_FLUSH as required prior to switching pipelines.

AFAIK brw_emit_select_pipeline() is only called once during context
init on Gen4-5, at which point the pipeline is likely to be already
idle so it may just happen to work by luck regardless of the MI_FLUSH.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
18c76551ee425b981efefc61f663a7781df17882 03-Jan-2016 Francisco Jerez <currojerez@riseup.net> i965/gen6-7: Implement stall and flushes required prior to switching pipelines.

Switching the current pipeline while it's not completely idle or the
read and write caches aren't flushed can lead to corruption. Fixes
misrendering of at least the following Khronos CTS test:

ES31-CTS.shader_image_load_store.basic-allTargets-store-fs

The stall and flushes are no longer required on Gen8+.

v2: Emit PIPE_CONTROL with non-zero post-sync op before the write
cache flush on SNB due to hardware bug. (Ken)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93323
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
044acb9256046bebec890cac7e42043754459fc2 03-Jan-2016 Francisco Jerez <currojerez@riseup.net> i965/gen8+: Invalidate color calc state when switching to the GPGPU pipeline.

This hardware bug can cause a hang on context restore while the
current pipeline is set to GPGPU (BDWGFX HSD 1909593). In addition to
clearing the valid bit, mark the CC state as dirty to make sure that
the CC indirect state pointer is re-emitted when we switch back to the
3D pipeline.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
dbae576f7f25fef72ca0b9f6f4822e0fddf7d607 19-Jun-2015 Ilia Mirkin <imirkin@alum.mit.edu> i965: add EXT_polygon_offset_clamp support to gen4/gen5

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
1dc41be9ebd07825836b0ca4b98e00ffc7ecc0ec 19-Aug-2015 Anuj Phogat <anuj.phogat@gmail.com> i965: Use intel_get_tile_dims() to get tile masks

This will require change in the parameters passed to
intel_miptree_get_tile_masks().

V2: Rearrange the order of parameters. (Ben)
Change the name to intel_get_tile_masks(). (Topi)

V3: Use temporary variables in intel_get_tile_masks()
for clarity. Fix mask_y computation.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
4e5752e2b78243a71766538f62ca0a80488047a7 23-Aug-2015 Chris Wilson <chris@chris-wilson.co.uk> i965: Always re-emit the pipeline select during invariant state emission

On the older platforms where we don't have logical contexts preserving
state across batches, we emit the invariant state setup on every batch
using the brw_invariant_state atom. This includes the pipeline selection
which is cached with the introduction of

commit 0e0e23ef537c9add672ff322f34e129a07edc55e
Author: Jordan Justen <jordan.l.justen@intel.com>
Date: Wed Apr 22 11:43:50 2015 -0700

i965/state: Emit pipeline select when changing pipelines

However, we do not reset the cache between batches on context-less
platforms resulting in us not setting the pipeline selection and can
cause GPU hangs if a media pipelined was loaded in the meantime (e.g.
mixing mplayer/gstreamer using libva and gnome-shell). A simple solution
is to just forcibly re-emit the pipeline select along with the invariant
state and reset the cache at that point.

Reported-and-tested-by: Tomasz C. <tomaszc@o2.pl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91254
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
07433760e3311ff17c0f909514ececdae9f6e9c6 25-Jun-2015 Ian Romanick <ian.d.romanick@intel.com> i965: Trivial formatting changes in brw_misc_state.c

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
c1da15709a0c0c2775bd9e534f67c60f7dc95ce8 12-Jul-2015 Matt Turner <mattst88@gmail.com> i965: Use float calculations when double is unnecessary.

Literals without an f/F suffix are of type double, and implicit
conversion rules specify that the float in (float op double) be
converted to a double before the operation is performed. I believe float
execution was intended (in nearly all cases) or is sufficient (in the
case of gen7_urb.c).

Removes a lot of float <-> double conversion instructions and replaces
many double instructions with float instructions which are cheaper.

text data bss dec hex filename
4928659 195160 26192 5150011 4e953b i965_dri.so before
4928315 195152 26192 5149659 4e93db i965_dri.so after

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
4b35ab9bdb4e663f41ff5c9ae5bbcc650b6093f9 30-Apr-2015 Chris Wilson <chris@chris-wilson.co.uk> i965: Rename intel_emit* to reflect their new location in brw_pipe_control

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
41b6db225f42a5d81beec1b4455ec7b504e2416d 17-Jun-2015 Kevin Rogovin <kevin.rogovin@intel.com> i965: Use _mesa_geometric_ functions appropriately

Change references to gl_framebuffer::Width, Height, MaxNumLayers
and Visual::samples to use the _mesa_geometry_ convenience functions
for those places where the geometry of the gl_framebuffer is needed
(in contrast to the geometry of the intersection of the attachments
of the gl_framebuffer).

This patch is to pave the way to enable GL_ARB_framebuffer_no_attachments
on Gen7 and higher in i965.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kevin Rogovin <kevin.rogovin@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0e0e23ef537c9add672ff322f34e129a07edc55e 22-Apr-2015 Jordan Justen <jordan.l.justen@intel.com> i965/state: Emit pipeline select when changing pipelines

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
4e56a9ad46ff7fe85308ce12e21719ff2b476516 20-Mar-2015 Jordan Justen <jordan.l.justen@intel.com> i965/state: Don't use brw->state.dirty.brw

Now, we only use ctx->NewDriverState.

I used this bash & sed command in the i965 directory:
for file in *.[ch] *.[ch]pp; do
sed -i -e 's/state\.dirty\.brw/ctx.NewDriverState/g' $file
done

Followed by manual changes to brw_state_upload.c.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
aedcd466bb9d899e892f9d47f96fbca5e5647133 29-Jun-2014 Jordan Justen <jordan.l.justen@intel.com> i965/hiz: Start to separate miptree out from hiz buffers

Today we allocate a miptree's for the hiz buffer. We needed this in
the past because we would point the hardware at offsets of the hiz
buffer. Since the hiz format is not documented, this is not a good
idea.

Since moving to support layered rendering on Gen7+, we no longer point
at an offset into the buffer on Gen7+.

Therefore, to support hiz on Gen7+, we don't need a full miptree
structure allocated.

This patch starts to create a new auxiliary buffer structure
(intel_miptree_aux_buffer) that can be a more simplistic miptree
side-band buffer associated with a miptree. (For example, to serve the
needs of the hiz buffer.)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0b499abb51c80867ad034f2a6d9fcb1e86d021cc 10-Jan-2015 Kenneth Graunke <kenneth@whitecape.org> i965: Do Sandybridge workaround flushes before each primitive.

Sandybridge requires the post-sync non-zero workaround in a ton of
places, and if you ever miss one, the GPU usually hangs.

Currently, we try to track exactly when a workaround flush is
necessary (via the brw->batch.need_workaround_flush flag). This is
tricky to get right, and we've botched it several times in the past.

This patch unconditionally performs the post-sync non-zero flush at the
start of each primitive's state upload (including BLORP). We drop the
needs_workaround_flush flag, and drop all the other callers, as the
flush has already been performed.

We have no data to indicate that simply flushing all the time will
hurt performance, and it has the potential to help stability.

v2: Add post-sync workaround to initial GPU state upload to be extra
cautious (suggested by Chad Versace).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
5f34a18f96e58aff1aca2d2971fca1c91dc6931d 25-Nov-2014 Kenneth Graunke <kenneth@whitecape.org> i965: Delete brw_state_flags::cache and related code.

It's been merged into brw_state_flags::brw for simplicity and
efficiency.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
4f24c168c87e9938f35f5ec135062408148be373 25-Nov-2014 Kenneth Graunke <kenneth@whitecape.org> i965: Move BRW_NEW_*_PROG_DATA flags to .brw (not .cache).

I put the BRW_NEW_*_PROG_DATA flags at the beginning so that
brw_state_cache.c can still continue using 1 << brw_cache_id.

I also added a comment explaining the difference between
BRW_NEW_*_PROG_DATA and BRW_NEW_*_PROGRAM, as it took me a long time
to remember it.

Non-mechanical changes:
- brw_state_cache.c and brw_ff_gs.c now signal .brw, not .cache.
- brw_state_upload.c - INTEL_DEBUG=state changes.
- brw_context.h - bit definition merging.

v2: Correct the explanation of BRW_NEW_*_PROG_DATA to mention
state-based recompiles, and nix the "proper subset" claim,
as it's false. (Caught by Kristian Høgsberg).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
ce44b2061cf59264b4f22271e8d70cdc826af6de 25-Nov-2014 Kenneth Graunke <kenneth@whitecape.org> i965: Rename CACHE_NEW_*_PROG to BRW_NEW_*_PROG_DATA.

Now that we've moved a bunch of CACHE_NEW_* bits to BRW_NEW_*, the only
ones that are left are legitimately related to the program cache. Yet,
it seems a bit wasteful to have an entire bitfield for only 7 bits.

State upload is one of the hottest paths in the driver. For each atom
in the list, we call check_state() to see if it needs to be emitted.
Currently, this involves comparing three separate bitfields (mesa, brw,
and cache). Consolidating the brw and cache bitfields would save a
small amount of CPU overhead per atom. Broadwell, for example, has
57 state atoms, so this small savings can add up.

CACHE_NEW_*_PROG covers the brw_*_prog_data structures, as well as the
offset into the program cache BO (prog_offset). Since most uses refer
to brw_*_prog_data, I decided to use BRW_NEW_*_PROG_DATA as the name.

Removing "cache" completely is a bit painful, so I decided to do it in
several patches for easier review, and to separate mechanical changes
from manual ones. This one simply renames things, and was made via:

$ for file in *.[ch]; do
sed -i -e 's/CACHE_NEW_\([A-Z_\*]*\)_PROG/BRW_NEW_\1_PROG_DATA/g' \
-e 's/BRW_NEW_WM_PROG_DATA/BRW_NEW_FS_PROG_DATA/g' $file
done

Note that BRW_NEW_*_PROG_DATA is still in .cache, not .brw!
The next patch will remedy this flaw. It will also fix the
alphabetization issues.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Matt Turner <mattst88@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f421db70ba5b987891458b98ae3b0d0ddc586315 26-Sep-2014 Kenneth Graunke <kenneth@whitecape.org> i965: Combine CACHE_NEW_*_UNIT into BRW_NEW_GEN4_UNIT_STATE.

On Gen4-5, unit state is specified as indirect state, rather than
commands. If any unit state changes, we upload it via brw_state_batch
and arrange for 3DSTATE_PIPELINED_POINTERS to be re-emitted, which
updates pointers to all unit state at once.

Since there's only one command and state atom (brw_psp_urb_cs) that
needs to know about this, there's no benefit to having six separate
flags. We can combine CACHE_NEW_*_UNIT into a single flag.

We also haven't cached these in a long time, so it doesn't make sense
to use the "CACHE_NEW_" prefix. Instead, use the "BRW_NEW_" prefix.

This also saves 12 * sizeof(void *) bytes of memory per context, as
we remove useless aux_compare/aux_free functions for each CACHE bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
bea9b8e306e8424ffacbdfc99ca2fc91f1c9912b 25-Nov-2014 Kenneth Graunke <kenneth@whitecape.org> i965: Alphabetize brw_tracked_state flags and use a consistent style.

Most of the dirty flags were listed in some arbitrary order. Some used
bonus parenthesis. Some put multiple flags on one line, others put one
per line. Some used tabs instead of spaces...but only on some lines.

This patch settles on one flag per line, in alphabetical order, using
spaces instead of tabs, and sheds the unnecessary parentheses.

Sorting was mostly done with vim's visual block feature and !sort,
although I alphabetized short lists by hand; it was pretty manual.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f14a35f9dc932a7aff80134cacfef60e73320e89 13-Nov-2014 Ben Widawsky <benjamin.widawsky@intel.com> i965: Always enable VF statistics

Every other unit in the geometry pipeline automatically enables
statistics gathering. This part of the pipe has been controlled by the
DEBUG_STATS variable, but this is asymmetric. This dates back to the
original implementation, and I am not sure if there is a reason for it.

I need access to these stats to implement ARB_pipeline_statistics_query.

Eric wrote it, and Ken touched it last. Do you have any opposition?

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86145
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
822e791321c387cadcec562820a0521aae90cc77 22-Apr-2014 Kenneth Graunke <kenneth@whitecape.org> i965/skl: Set mask bits in PIPELINE_SELECT on Skylake.

Skylake has some extra bits in PIPELINE_SELECT, none of which are
interesting for a 3D driver. In order to selectively change them, it
also introduces new "mask bits" in 15:8. We care about the "Pipeline
Selection" bits (1:0), so set the mask to 0x3.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
864c463485aafaa2802b18a7427f8b75dc96e3ef 03-Sep-2014 Jordan Justen <jordan.l.justen@intel.com> Revert 5 i965 patches: 8e27a4d2, 373143ed, c5bdf9be, 6f56e142, 88e3d404

Reverts
* "i965: Modify state upload to allow 2 different sets of state atoms."
8e27a4d2b3e4e74e9a77446bce49607433d86be3
* "i965: Modify dirty bit handling to support 2 pipelines."
373143ed9187c4d4ce1e3c486b5dd0880d18ec8b
* "i965: Create a macro for checking a dirty bit."
c5bdf9be1eca190417998d548fd140c1eca37a54
Conflicts:
src/mesa/drivers/dri/i965/brw_context.h
* "i965: Create a macro for setting all dirty bits."
6f56e1424d923fd80c84090fbf4506c9eaaffea1
Conflicts:
src/mesa/drivers/dri/i965/brw_blorp.cpp
src/mesa/drivers/dri/i965/brw_state_cache.c
src/mesa/drivers/dri/i965/brw_state_upload.c
* "i965: Create a macro for setting a dirty bit."
88e3d404dad009d8cff5124cf8acee7daeaceb64

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
88e3d404dad009d8cff5124cf8acee7daeaceb64 10-Jan-2014 Paul Berry <stereotype441@gmail.com> i965: Create a macro for setting a dirty bit.

This will make it easier to extend dirty bit handling to support
compute shaders.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
56cdb55e38ca352a0d521d7aa69b46ffbd855192 10-Jul-2013 Jordan Justen <jordan.l.justen@intel.com> i965/gen6 depth surface: program 3DSTATE_DEPTH_BUFFER to top of surface

(bf25ee2 for gen6)

Previously we would always find the 2D sub-surface of interest,
and then program the surface to this location. Now we always
program the 3DSTATE_DEPTH_BUFFER at the start of the surface.
To select the lod/slice, we utilize the lod & minimum array
element fields.

We also must disable brw_workaround_depthstencil_alignment for
gen >= 6. Now the hardware will handle alignment when rendering
to additional slices/LODs.

v3:
* Set depth_mt bo RELOC offset to 0, as was done in bf25ee2

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56127
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
11bef60d0932649bbbb95a3518d3b7de06dd2938 23-Apr-2014 Eric Anholt <eric@anholt.net> i965: Move has_hiz from the slice to the level.

The value depends only on the level, so no need to store the bool per slice.
Shrinks intel_mipmap_slice from 24 bytes to 16, while slotting into an
existing hole in intel_mipmap_level.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e7f65655cbddc53a95ca9d9b6f5d738e82797aac 25-Apr-2014 Eric Anholt <eric@anholt.net> i965: Delete the intel_regions.c code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e16c5c906316c58c0633e9bba02339ef981e5ef3 25-Apr-2014 Eric Anholt <eric@anholt.net> i965: Drop use of intel_region from miptrees.

Note: region->width/height used to reflect the total_width/height padding
of separate stencil, though mt->total_width didn't. region->width/height
was being used in EGL images, where the padded value would have been the
wrong one, so I converted them to use rb->Width/Height.

v2: Drop debug printf that slipped in (caught by Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
3033f80af5dbc0858907df3c41ccf7b9de8a01a4 25-Apr-2014 Eric Anholt <eric@anholt.net> i965: Move intel_region_get_aligned_offset() to be a miptree function.

All the consumers are doing it on a miptree.

v2: fix a silly duplicated dereference (review by Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
9791eb4280a5814de9af6d9197d947221342dc4e 25-Apr-2014 Eric Anholt <eric@anholt.net> i965: Move intel_region_get_tile_masks() to be a miptree function.

All the consumers are doing it on a miptree.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
ac30e1adb49ec6947f740b47d90f8403fe416314 29-Apr-2014 Kenneth Graunke <kenneth@whitecape.org> i965: Actually emit PIPELINE_SELECT and 3DSTATE_VF_STATISTICS.

For platforms using hardware contexts (currently Gen6+), we failed to
emit PIPELINE_SELECT and 3DSTATE_VF_STATISTICS, instead emitting MI_NOOP
for both.

During one of the context initialization reordering patches, we
accidentally moved brw_init_state before we set brw->CMD_PIPELINE_SELECT
and brw->CMD_VF_STATISTICS. So, when brw_init_state uploaded initial
GPU state (brw_init_state -> brw_upload_initial_gpu_state ->
brw_upload_invariant_state), these would be 0 (MI_NOOP).

Storing the commands in the context is not worthwhile. We have many
generation checks in our state upload code, and for platforms with
hardware contexts, this only gets called once per GL context anyway.
The cost is negligable, and it's easy to botch context creation
ordering.

This may fix hangs on Gen6+ when using the media pipeline.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
c10896b593720457e99a731e9493ce8d6c497fab 05-Mar-2014 Eric Anholt <eric@anholt.net> i965: Fix render-to-texture in non-FinishRenderTexture cases.

We've had several problems now with FinishRenderTexture not getting called
enough, and we're ready to just give up on it ever doing what we need. In
particular, an upcoming Steam title had rendering bugs that could be fixed
by always_flush_cache=true.

Instead of hoping Mesa core can figure out when we need to flush our
caches, just track what BOs we've rendered to in a set, and when we render
from a BO in that set, emit a flush and clear the set.

There's some overhead to keeping this set, but most of that is just
hashing the pointer -- it turns out our set never even gets very large,
because cache flushes are so common (even on cairo-gl).

No statistically significant performance difference in cairo-gl (n=100),
despite spending ~.5% CPU in these set operations.

v1: (Original patch by Eric Anholt.)
v2: (Changes by Ken Graunke.)
- Rebase forward from May 7th 2013 -> March 4th 2014.
- Drop the FinishRenderTexture hook entirely; after rebasing the
patch, the hook was just an empty function.
- Move the brw_render_cache_set_clear() call from
intel_batchbuffer_emit_flush() to brw_emit_pipe_control_flush().
In theory, this could catch more cases where we've flushed.
- Consider stencil as a possible texturing source.
v3: (changes by anholt):
- Move set_clear() back to emit_mi_flush() -- it means we can drop
more forced flushes from the code. In the previous location, it
wouldn't have been called when we wanted pre-gen6.
- Move the set clear from batch init to reset -- it should be empty at
the start of every batch, since the kernel handled any inter-batch
flush for us.
v4: Drop the debug code in set.c that I accidentally committed.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com> [v2]
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
09d9a8913e8c28fc4c1c60d7da85a2f093786894 08-Feb-2014 Kenneth Graunke <kenneth@whitecape.org> i965: Pull format conversion logic out of brw_depthbuffer_format.

brw_depthbuffer_format is not very reusable at the moment, since it
uses global state (ctx->DrawBuffer) to access a particular depth buffer.

For HiZ on Broadwell, I need a function which simply converts the
formats. However, at least one existing user of brw_depthbuffer_format
really wants the existing interface. So, I've created a new function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a487ef87fe4aa8c4b8e5c0d888bfb18727c8e570 08-Feb-2014 Kenneth Graunke <kenneth@whitecape.org> mesa: Fix MESA_FORMAT_Z24_UNORM_S8_UINT vs. X8_UINT mix-up.

In commit eeed49f5f290793870c60b5b635b977a732a1eb4, Mark accidentally
renamed MESA_FORMAT_S8_Z24 to MESA_FORMAT_Z24_UNORM_X8_UINT and
MESA_FORMAT_X8_Z24 to MESA_FORMAT_Z24_UNORM_S8_UINT, reversing their
sense. The commit message was correct, but what sed commands actually
got run didn't match that.

This patch swaps the two enum names, reversing them. This should undo
the damage, but might break things if people have manually fixed a few
instances in the meantime...

Mark's commit also failed to mention renames:
s/MESA_FORMAT_ARGB2101010_UINT\b/MESA_FORMAT_B10G10R10A2_UINT/g
s/MESA_FORMAT_ABGR2101010\b/MESA_FORMAT_R10G10B10A2_UNORM/g
but those seem okay.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
eeed49f5f290793870c60b5b635b977a732a1eb4 27-Jan-2014 Mark Mueller <MarkKMueller@gmail.com> mesa: Change many Type P MESA_FORMATs to meet naming spec

Conversion of Type P formats as follows (w/related comment fixes):
s/MESA_FORMAT_RGB565\b/MESA_FORMAT_B5G6R5_UNORM/g
s/MESA_FORMAT_RGB565_REV\b/MESA_FORMAT_R5G6B5_UNORM/g
s/MESA_FORMAT_ARGB4444\b/MESA_FORMAT_B4G4R4A4_UNORM/g
s/MESA_FORMAT_ARGB4444_REV\b/MESA_FORMAT_A4R4G4B4_UNORM/g
s/MESA_FORMAT_RGBA5551\b/MESA_FORMAT_A1B5G5R5_UNORM/g
s/MESA_FORMAT_XBGR8888_SNORM\b/MESA_FORMAT_R8G8B8X8_SNORM/g
s/MESA_FORMAT_XBGR8888_SRGB\b/MESA_FORMAT_R8G8B8X8_SRGB/g
s/MESA_FORMAT_ARGB1555\b/MESA_FORMAT_B5G5R5A1_UNORM/g
s/MESA_FORMAT_ARGB1555_REV\b/MESA_FORMAT_A1R5G5B5_UNORM/g
s/MESA_FORMAT_AL44\b/MESA_FORMAT_L4A4_UNORM/g
s/MESA_FORMAT_RGB332\b/MESA_FORMAT_B2G3R3_UNORM/g
s/MESA_FORMAT_ARGB2101010\b/MESA_FORMAT_B10G10R10A2_UNORM/g
s/MESA_FORMAT_Z24_S8\b/MESA_FORMAT_S8_UINT_Z24_UNORM/g
s/MESA_FORMAT_S8_Z24\b/MESA_FORMAT_Z24_UNORM_S8_UINT/g
s/MESA_FORMAT_X8_Z24\b/MESA_FORMAT_Z24_UNORM_X8_UINT/g
s/MESA_FORMAT_Z24_X8\b/MESA_FORMAT_X8Z24_UNORM/g
s/MESA_FORMAT_RGB9_E5_FLOAT\b/MESA_FORMAT_R9G9B9E5_FLOAT/g
s/MESA_FORMAT_R11_G11_B10_FLOAT\b/MESA_FORMAT_R11G11B10_FLOAT/g
s/MESA_FORMAT_Z32_FLOAT_X24S8\b/MESA_FORMAT_Z32_FLOAT_S8X24_UINT/g
s/MESA_FORMAT_ABGR2101010_UINT\b/MESA_FORMAT_R10G10B10A2_UINT/g
s/MESA_FORMAT_XRGB4444_UNORM\b/MESA_FORMAT_B4G4R4X4_UNORM/g
s/MESA_FORMAT_XRGB1555_UNORM\b/MESA_FORMAT_B5G5R5X1_UNORM/g
s/MESA_FORMAT_XRGB2101010_UNORM\b/MESA_FORMAT_B10G10R10X2_UNORM/g
s/MESA_FORMAT_AL88\b/MESA_FORMAT_L8A8_UNORM/g
s/MESA_FORMAT_AL88_REV\b/MESA_FORMAT_A8L8_UNORM/g
s/MESA_FORMAT_AL1616\b/MESA_FORMAT_L16A16_UNORM/g
s/MESA_FORMAT_AL1616_REV\b/MESA_FORMAT_A16L16_UNORM/g
s/MESA_FORMAT_RG88\b/MESA_FORMAT_G8R8_UNORM/g
s/MESA_FORMAT_GR88\b/MESA_FORMAT_R8G8_UNORM/g
s/MESA_FORMAT_GR1616\b/MESA_FORMAT_R16G16_UNORM/g
s/MESA_FORMAT_RG1616\b/MESA_FORMAT_G16R16_UNORM/g
s/MESA_FORMAT_SRGBA8\b/MESA_FORMAT_A8B8G8R8_SRGB/g
s/MESA_FORMAT_SARGB8\b/MESA_FORMAT_B8G8R8A8_SRGB/g
s/MESA_FORMAT_SLA8\b/MESA_FORMAT_L8A8_SRGB/g

Conflicts:
src/mesa/drivers/dri/i965/brw_surface_formats.c
src/mesa/main/format_pack.c
src/mesa/main/format_unpack.c
src/mesa/main/formats.c
src/mesa/main/texformat.c
src/mesa/main/texstore.c
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
50a01d2acafb2a937e62b24258e2e777c0cd1489 21-Jan-2014 Mark Mueller <MarkKMueller@gmail.com> mesa: Change many Type A MESA_FORMATs to meet naming standard

Update comments. Conversion of the following Type A formats:
s/MESA_FORMAT_RGB888\b/MESA_FORMAT_BGR_UNORM8/g
s/MESA_FORMAT_BGR888\b/MESA_FORMAT_RGB_UNORM8/g
s/MESA_FORMAT_A8\b/MESA_FORMAT_A_UNORM8/g
s/MESA_FORMAT_A16\b/MESA_FORMAT_A_UNORM16/g
s/MESA_FORMAT_L8\b/MESA_FORMAT_L_UNORM8/g
s/MESA_FORMAT_L16\b/MESA_FORMAT_L_UNORM16/g
s/MESA_FORMAT_I8\b/MESA_FORMAT_I_UNORM8/g
s/MESA_FORMAT_I16\b/MESA_FORMAT_I_UNORM16/g
s/MESA_FORMAT_R8\b/MESA_FORMAT_R_UNORM8/g
s/MESA_FORMAT_R16\b/MESA_FORMAT_R_UNORM16/g
s/MESA_FORMAT_Z16\b/MESA_FORMAT_Z_UNORM16/g
s/MESA_FORMAT_Z32\b/MESA_FORMAT_Z_UNORM32/g
s/MESA_FORMAT_S8\b/MESA_FORMAT_S_UINT8/g
s/MESA_FORMAT_SRGB8\b/MESA_FORMAT_BGR_SRGB8/g
s/MESA_FORMAT_RGBA_16\b/MESA_FORMAT_RGBA_UNORM16/g
s/MESA_FORMAT_SL8\b/MESA_FORMAT_L_SRGB8/g
s/MESA_FORMAT_Z32_FLOAT\b/MESA_FORMAT_Z_FLOAT32/g
s/MESA_FORMAT_XBGR16161616_UNORM\b/MESA_FORMAT_RGBX_UNORM16/g
s/MESA_FORMAT_XBGR16161616_SNORM\b/MESA_FORMAT_RGBX_SNORM16/g
s/MESA_FORMAT_XBGR16161616_FLOAT\b/MESA_FORMAT_RGBX_FLOAT16/g
s/MESA_FORMAT_XBGR16161616_UINT\b/MESA_FORMAT_RGBX_UINT16/g
s/MESA_FORMAT_XBGR16161616_SINT\b/MESA_FORMAT_RGBX_SINT16/g
s/MESA_FORMAT_XBGR32323232_FLOAT\b/MESA_FORMAT_RGBX_FLOAT32/g
s/MESA_FORMAT_XBGR32323232_UINT\b/MESA_FORMAT_RGBX_UINT32/g
s/MESA_FORMAT_XBGR32323232_SINT\b/MESA_FORMAT_RGBX_SINT32/g
s/MESA_FORMAT_XBGR8888_UINT\b/MESA_FORMAT_RGBX_UINT8/g
s/MESA_FORMAT_XBGR8888_SINT\b/MESA_FORMAT_RGBX_SINT8/g
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
4c6a1d380abdfc85c2862f62719fa3c98c97f7ba 04-Dec-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Update invariant state for Broadwell.

The only difference is that STATE_SIP takes a 48-bit address, so we need
to output two zeroes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
1c5e2965a0de296240dd8f5af12482164416b7f1 26-Aug-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Remove CACHED_BATCH support altogether.

Using an unoptimized variant of glamor spending 50% of its CPU time in
brw_draw_prims() (and hitting the cache *very* frequently):

N Min Max Median Avg Stddev
x 200 29200 40500 34900 34750 958.43256
+ 200 31000 40300 34700 34622 916.35941
No difference proven at 95.0% confidence

Similarly, no difference on GLB2.7:

N Min Max Median Avg Stddev
x 63 64.1 71.36 70.69 70.113175 1.6782026
+ 63 63.6 71.18 70.75 70.223651 1.6044186
No difference proven at 95.0% confidence

v2: Rebase on master (by anholt)
v3: Add a missing BEGIN_BATCH(3) to aa_line_parameters -- CACHED_BATCH
didn't have the asserts about batchbuffer usage that ADVANCE_BATCH
does, so we started assertion failing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
877128505431adaf817dc8069172ebe4a1cdf5d8 17-Jan-2014 José Fonseca <jfonseca@vmware.com> s/Tungsten Graphics/VMware/

Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the
old copyright name is creating unnecessary confusion, hence this change.

This was the sed script I used:

$ cat tg2vmw.sed
# Run as:
#
# git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed
#

# Rename copyrights
s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g
/Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./
s/TUNGSTEN GRAPHICS/VMWARE/g

# Rename emails
s/alanh@tungstengraphics.com/alanh@vmware.com/
s/jens@tungstengraphics.com/jowen@vmware.com/g
s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/
s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g
s/keithw\?@tungstengraphics.com/keithw@vmware.com/g
s/michel@tungstengraphics.com/daenzer@vmware.com/g
s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/
s/zack@tungstengraphics.com/zackr@vmware.com/

# Remove dead links
s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g

# C string src/gallium/state_trackers/vega/api_misc.c
s/"Tungsten Graphics, Inc"/"VMware, Inc"/

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a7bdd4cba8ddcab8dff59ecaaa7efbd436c6c307 26-Nov-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Drop trailing whitespace from the rest of the driver.

Performed via:
$ for file in *; do sed -i 's/ *//g'; done

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
c6a3fb69c6a0d993f111518f12b34dde3925c190 06-Nov-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Use has_surface_tile_offset in depth/stencil alignment workaround.

Currently, has_surface_tile_offset is equivalent to gen == 4 && !is_g4x.

We already use it for related checks in brw_wm_surface_state.c, so it
makes sense to use it here too. It's simpler and more future-proof.

Broadwell also lacks surface tile offsets. With this patch, I won't
need to update any generation checking; I can simply not set the flag.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
3aef1fefb4dc2a66101725f2fdc3f2bb0eb926c2 24-Oct-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Emit post-sync non-zero flush before 3DSTATE_DRAWING_RECTANGLE.

This is another non-pipelined command that needs a flush on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Xinkai Chen <yeled.nova@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
fc5b865cec99c34586b2f5484c46af419b2a0395 26-Sep-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Remove has_aa_line_parameters.

This flag is only used in one place, and is only set on one platform.
Just check for original Gen4 in the relevant function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
feaad189b45cafe860b5f23bf534618ff30b5bd2 14-Sep-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Move binding table code to a new file, brw_binding_tables.c.

The code to upload the binding tables for each stage was scattered
across brw_{vs,gs,wm}_surface_state.c and brw_misc_state.c, which also
contain a lot of code to populate individual SURFACE_STATE structures.

This patch brings all the binding table upload code together, and splits
it out from the code which fills in SURFACE_STATE entries.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
4b3c0a797f89830fd5ba0943b061abf4fc38337e 02-Sep-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Use brw_stage_state for WM data as well.

This gets the VS, GS, and PS all using the same data structure.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
ec94e3c3d02857e26ba66e7e6a4b54044c820a0a 24-Aug-2013 Paul Berry <stereotype441@gmail.com> i965: Move data from brw->vs into a base class if gs will also need it.

This paves the way for sharing the code that will set up the vertex
and geometry shader pipeline state.

v2: Rename the base class to brw_stage_state.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
32e16e23377ecbba7783e33428ebb4575b874fe5 24-Aug-2013 Paul Berry <stereotype441@gmail.com> i965: rename legacy gs structs and functions to ff_gs.

"ff" is for "fixed function". This frees up the name "gs" to refer to
user-defined geometry shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e6893b99adcd6d9fb1bd49067883f66cc5603fe7 12-Aug-2013 Ville Syrjälä <ville.syrjala@linux.intel.com> i965/gen7: Set MOCS L3 cacheability for IVB/BYT (v2)

IVB/BYT also has the same L3 cacheability control in MOCS as HSW,
so let's make use of it.

pts/xonotic and pts/reaction @ 1920x1080 gain ~4% on my IVB GT2. Most
other things show less gains/no regressions, except furmark which
loses some 10 points.

I didn't have a BYT at hand for testing.

v2: Don't check (brw->gen == 7) in gen7 functions. (chadv)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
22161983c38fe19b393e5b983f4945dc527ccb1b 12-Aug-2013 Ville Syrjälä <ville.syrjala@linux.intel.com> i965/hsw: Populate MOCS for STATE_BASE_ADDRESS (v2)

Just spotted these unpopulated MOCS fields when comparing the code
against BSpec. Set the MOCS to the same as everywhere else in Haswell:
L3-cacheable.

v2: Annotate state packet fields (chadv).

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
bf25ee284045c5d2ddf3b2d234d7344187e6da29 10-Jul-2013 Jordan Justen <jordan.l.justen@intel.com> gen7 depth surface: program 3DSTATE_DEPTH_BUFFER to top of surface

Previously we would always find the 2D sub-surface of interest,
and then program the surface to this location. Now we always
program the 3DSTATE_DEPTH_BUFFER at the start of the surface.
To select the lod/slice, we utilize the lod & minimum array
element fields.

As part of this change, we must revert 1f112ccf:
Revert "i965/gen7: Align all depth miplevels to 8 in the X direction."

We also must disable brw_workaround_depthstencil_alignment for
gen >= 7. Now the hardware will handle alignment when rendering
to additional slices/LODs.

v2:
* Merge with recent MOCS changes

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0e6be2e67b409d1542fd02e7c0f454676fc04587 09-Jul-2013 Jordan Justen <jordan.l.justen@intel.com> i965: init global state first in brw_workaround_depthstencil_alignment

In a future pass this will allow us to exit-early from this
routine to disable it for gen >= 7.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
8c9a54e7bcfc80295ad77097910d35958dfd3644 06-Jul-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Delete intel_context entirely.

This makes brw_context inherit directly from gl_context; that was the
only thing left in intel_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
53631be4ebaa4fb13a7f129727c1cdd32fcc6f3d 06-Jul-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Move intel_context::gen and gt fields to brw_context.

Most functions no longer use intel_context, so this patch additionally
removes the local "intel" variables to avoid compiler warnings.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
794de2f3873bcedc78300b3ba69656adc755894c 06-Jul-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Move intel_context::is_<platform> flags to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
44fd490067692f0f9c1b5cff86e2e24a915af0c1 06-Jul-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Move must_use/has_separate_stencil fields to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e3c2bb1eb4ef73c1c9576f0d5b747605b5de47ef 04-Jul-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Shorten context base class dereference chains.

ctx->DrawBuffer is much more sensible than brw->intel.ctx.DrawBuffer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
329779a0b45b63be17627f026533c80b2c8f7991 03-Jul-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Move intel_context::batch to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e43043c316a8274f5f07a8cf818960ef1387a788 03-Jul-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Move intel_context::vtbl to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
ca437579b3974b91a5298707c459908a628c1098 03-Jul-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Pass brw_context to functions rather than intel_context.

This makes brw_context available in every function that used
intel_context. This makes it possible to start migrating fields from
intel_context to brw_context.

Surprisingly, this actually removes some code, as functions that use
OUT_BATCH don't need to declare "intel"; they just use "brw."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
adf8afa168fe9fe2e4a2b35afc3003040d05273f 27-Jun-2013 Matt Turner <mattst88@gmail.com> i965: NULL check depth_mt to quiet static analysis.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d671eb140f05d4974cebf6e6643282a8a7ce45db 08-Jun-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Emit invariant state once at startup on Gen6+.

Now that we have hardware contexts, we can safely initialize our GPU
state once at startup, rather than needing a state atom with the
BRW_NEW_CONTEXT flag set.

This removes a tiny bit of code from our drawing loop.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
64a87f29ce29d3c2e01b7fd79386bf6ace454f62 17-May-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Kill software primitive counting entirely.

Now that we have hardware contexts, we don't need to continually
reprogram the GS_SVBI_INDEX registers. They're automatically saved and
restored with the context, so they can just increment over time. We
only need to reset them when starting transform feedback.

There's also no reason to delay until the next drawing operation; we can
just emit the packet immediately. However, this means we must drop the
initialization in brw_invariant_state, as BeginTransformFeedback may
occur before the first drawing in a context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
75d402b2118c55b0131025016a859a35733746b5 10-Apr-2013 Chia-I Wu <olvaffe@gmail.com> i965/gen7: fix 3DSTATE_LINE_STIPPLE_PATTERN

The inverse repeat count should taks up bits 31:15 and is in U1.16. Fixes
the "Restarting lines within a single Begin/End block" subtest of piglit
linestipple, and gets the other failing subtests much closer to passing.

v2: Rewrite commit message with more detailed piglit info (by anholt)

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
28170c5b7f1feaa5918f4f5427435b0ad53a8c2f 11-Apr-2013 Eric Anholt <eric@anholt.net> i965: Fix an unused variable warning in the release build.

I think this actually clarifies what's going on in the asserts a bit,
given how many regions we've got floating around.

Reviewed-by: Matt Turner <mattst88@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
916d1ea7dc5ac6cba358eafd766440f836a74c16 05-Apr-2013 Chad Versace <chad.versace@linux.intel.com> i965: Remove brw_context::depthstencil::hiz_mt

After recent refactorings, the field is written but no longer read.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
2d3bbc576c095f0942d131db886f5661dec5680c 08-Apr-2013 Chad Versace <chad.versace@linux.intel.com> intel: Replace checks for hiz_mt with intel_has*hiz()

When appropriate, replace each check `hiz_mt != NULL` with either a call
to intel_miptree_slice_has_hiz() or intel_renderbuffer_has_hiz(). No
behavioral change.

This prepares for selectively enabling hiz on individual miptree slices
for Haswell.

This refactoring had several side effects.

1. To prevent new warnings about discarding the const qualifier,
I removed 'const' from some variable declarations in
intel_validate_framebuffer(). The alternative was to add const
qualifiers to multiple function signatures in the
intel_renderbuffer_has_hiz call graph. Since the dominant convention
in the Intel code is to not qualify function parameters as const,
I chose to remove rather than add const qualifiers.

2. I changed the signature of brw_emit_depth_stencil_hiz() by replacing
`struct intel_mipmap_tree *hiz_mt` with `bool hiz`. The function used
hiz_mt mostly as a boolean indicator of the presence of hiz, so the
signature change is consistent with the patch's goal.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
5b79705526efdb3d9b919634ff0e3e412b707b92 05-Apr-2013 Chad Versace <chad.versace@linux.intel.com> i965: Change signature of brw_get_depthstencil_tile_masks()

Add new parameters `depth_level` and `depth_layer`, which specify depth
miptree's slice of interest. A following patch will pass the new
parameters through to intel_miptree_slice_has_hiz().

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
41e4bccc754bf3942255630ddd03601b95096c03 26-Mar-2013 Paul Berry <stereotype441@gmail.com> i965: Reduce code duplication in handling of depth, stencil, and HiZ.

This patch consolidates duplicate code in the brw_depthbuffer and
gen7_depthbuffer state atoms. Previously, these state atoms contained
5 chunks of code for emitting the _3DSTATE_DEPTH_BUFFER packet (3 for
Gen4-6 and 2 for Gen7). Also a lot of logic for determining the
appropriate buffer setup was duplicated between the Gen4-6 and Gen7
functions.

This refactor splits the code into three separate functions:
brw_emit_depthbuffer(), which determines the appropriate buffer setup
in a mostly generation-independent way, brw_emit_depth_stencil_hiz(),
which emits the appropriate state packets for Gen4-6, and
gen7_emit_depth_stencil_hiz(), which emits the appropriate state
packets for Gen7.

Tested using Piglit on Gen5-7 (no regressions).

v2: Re-word some comments. Fix an assertion that incorrectly
prohibited packed depth/stencil formats on Gen6 (these are allowed
provided that HiZ is disabled).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0af56c9d53a454477645f4537b8086120a638d3e 08-Mar-2013 Paul Berry <stereotype441@gmail.com> i965: Avoid unnecessary copy when depthstencil workaround invoked by clear.

Since apps typically begin rendering with a call to glClear(), it is
likely that when brw_workaround_depthstencil_alignment() moves a
miplevel to a temporary buffer, it can avoid doing a blit, since the
contents of the miplevel are about to be erased.

This patch adds the necessary plumbing to determine when
brw_workaround_depthstencil_alignment() is being called as a
consequence of glClear(), and avoids the unnecessary blit when it is
safe to do so.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Eliminate unnecessary call to _mesa_is_depthstencil_format(). Fix
handling of depth buffer in depth/stencil format.

v3: Use correct bitfields for clear_mask. Fix handling of depth
buffer in depth/stencil format when hardware uses separate stencil.
When invalidating, make sure we still reassociate the image to the new
miptree.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
60894edeef973e86a73067276f658b72f84271b6 11-Jan-2013 Eric Anholt <eric@anholt.net> intel: Make intel_region's pitch be bytes instead of pixels.

We almost never want a stride in pixels -- if you're doing anything with
a stride, you're specifying an offset or incrementing a pointer, and in
both cases you had to multiply by cpp to get the bytes value you wanted.
But worse, on the way to creating a region from a new tiled BO, we
divided by cpp to get pitch in pixels, and for an RGB32 buffer (an
upcoming change) the pitch wouldn't divide exactly, and we'd end up with
a wrong stride in our region.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0d6a722ec4df73595d4159e5b35c6fd61f847a6c 18-Dec-2012 Eric Anholt <eric@anholt.net> i965: Add perf debug for depth/stencil alignment workaround.

Fixing these rendering bugs has been implicated in performance
regressions (which may be unfixable), but at least knowing that it's
happening should help diagnose those regressions.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
c8ed9f6262a73849a64c55bcfaac2a50e42e0945 26-Nov-2012 Eric Anholt <eric@anholt.net> i965/gen4-5: Fix segfaults with stencil-only depth/stencil setups.

Fixes a ton of piglit regressions since the depthstencil fixes for gen6+.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57309
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
fdd6d146d988f920744592ad7ba5667ef2981620 05-Nov-2012 Eric Anholt <eric@anholt.net> i965: Use the separate stencil buffer's offsets for stencil setup.

For a packed depth/stencil buffer on separate stencil hardware, the
separate depth miptree is set up with alignment of 4,4 and the separate
stencil miptree is setup with alignment of 8,8. We can't just use the
irb->draw_{x,y} offsets for stencil, since that is the offset in the
depth miptree.

Fixes 12 piglit depthstencil testcases on ivb.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
52ee1a7269b84b60558760655a4c722d827703d4 04-Nov-2012 Eric Anholt <eric@anholt.net> i965: Move all the depth/stencil/hiz offset logic into the workaround.

Given that we have the mask information here (assuming the rebase is to
the same tiling, which is safe), we can just save a set of miptrees and
offsets and the global intra-tile offset in the context and cut out a
bunch of logic. This will also save emitting the next fix I need to do
twice.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
9ec6a54ba94264d4d6c6ddbced2144a882a23cfa 04-Nov-2012 Eric Anholt <eric@anholt.net> i965: When rebasing depth or stencil, update x/y before deciding the other.

Fixes a theoretical problem where we had an aligned depth buffer and a
misaligned stencil buffer with a matching tile offset, so we would fail
to rebase depth even after the needed tile offset changed due to the
rebase of stencil.

It should also fix double-rebase of a misaligned packed depth/stencil
renderbuffer, which may have been a performance issue.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
56f8ed4c356f9994d150552e9c18ec35717ce503 31-Oct-2012 Eric Anholt <eric@anholt.net> i965/gen4: Fix assertion failures in depthstencil piglit tests.

Don't forget to set depth_mt even if !hiz_mt.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
7139ab80ca9b1b3572ef6da98765ca783e8e5e3b 08-Aug-2012 Eric Anholt <eric@anholt.net> i965: Fix rendering to small mipmaps of depth/stencil buffers using a temp mt.

Fixes 51 piglit tests (fbo-clear-formats, and most of the remaining failures
in depthstencil).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
5c8dd6cf7995ae52a5482c1209c218f0b9a7b1c1 08-Aug-2012 Eric Anholt <eric@anholt.net> i965: Share the draw x/y offset masking code between main/blorp and all gens.

This code is twisty, and the comment before most of the blocks was actually
giving me the opposite impression from its intention: We want to apply as much
of our offset as possible through coarse tile-aligned adjustment, since we can
do so independently per buffer, and apply the minimum we can through
fine-grained drawing offset x/y, since it has to agree between all buffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
b760c9913dcff848a2aa0e60abeb48e596ae8fee 30-Aug-2012 Paul Berry <stereotype441@gmail.com> intel: Add map_stencil_as_y_tiled to intel_region_get_aligned_offset.

This patch modifies intel_region_get_aligned_offset() to make the
appropriate calculation when the blorp engine sets up a W-tiled
stencil buffer using a Y-tiled SURFACE_STATE.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
50dec7fc2d5ba813aaa822596d124098a22db301 30-Aug-2012 Paul Berry <stereotype441@gmail.com> intel: Add map_stencil_as_y_tiled to intel_region_get_tile_masks.

When the blorp engine is performing a blit from one stencil buffer to
another, it sets up the surface state for these buffers as Y-tiled, so
it needs to be able to force intel_region_get_tile_masks() to return
the appropriate masks for a Y-tiled region.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
68216f35814ab8d292f37b8c0fa0a5f181b7f20d 18-May-2012 Eric Anholt <eric@anholt.net> i965/gen6+: Add support for fast depth clears.

Improves citybench high-res performance 3.0% +- 0.4%, n=10. Improves
Lightsmark 1024x768 performance 0.74% +/- 0.20% (n=78). No
significant difference on openarena (n=5, didn't fast clear) or nexuiz
(n=3).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
19e9b24626c2b9d7abef054d57bb2a52106c545b 30-Apr-2012 Paul Berry <stereotype441@gmail.com> i965/gen6: Initial implementation of MSAA.

This patch enables MSAA for Gen6, by modifying intel_mipmap_tree to
understand multisampled buffers, adapting the rendering pipeline setup
to enable multisampled rendering, and adding multisample resolve
operations to brw_blorp_blit.cpp. Some preparation work is also
included for Gen7, but it is not yet enabled.

MSAA support is still fairly preliminary. In particular, the
following are not yet supported:
- Fully general blits between MSAA and non-MSAA buffers.
- Formats other than RGBA8, DEPTH24, and STENCIL8.
- Centroid interpolation.
- Coverage parameters (glSampleCoverage, GL_SAMPLE_ALPHA_TO_COVERAGE,
GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
GL_SAMPLE_COVERAGE_INVERT).

Fixes piglit tests "EXT_framebuffer_multisample/accuracy" on
i965/Gen6.

v2:
- In intel_alloc_renderbuffer_storage(), quantize the requested number
of samples to the next higher sample count supported by the
hardware. This ensures that a query of GL_SAMPLES will return the
correct value. It also ensures that MSAA is fully disabled on Gen7
for now (since Gen7 MSAA support doesn't work yet).
- When reading from a non-MSAA surface, ensure that s_is_zero is true
so that we won't try to read from a nonexistent sample.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a683012a80a3408b3b71f22b2a97d9eaaac11a46 26-Apr-2012 Paul Berry <stereotype441@gmail.com> i965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.

In i965 Gen6, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0. Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4. When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0. This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

(Note that we have only ever observed this GPU hang on Gen6 when HiZ
is enabled, so another possible stopgap would be to disable HiZ).

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
3ec0e55b63db3c1067f3bbf4563beb3b98a19288 15-Apr-2012 Paul Berry <stereotype441@gmail.com> i965: Fix mipmap offsets for HiZ and separate stencil buffers.

When rendering to a miplevel other than 0 within a color, depth,
stencil, or HiZ buffer, we need to tell the GPU to render to an offset
within the buffer, so that the data is written into the correct
miplevel. We do this using a coarse offset (in pages), and a fine
adjustment (the so-called "tile_x" and "tile_y" values, which are
measured in pixels).

We have always computed the coarse offset and fine adjustment using
intel_renderbuffer_tile_offsets() function. This worked fine for
color and combined depth/stencil buffers, but failed to work properly
when HiZ and separate stencil were in use. It failed to work because
there is only one set of fine adjustment controls shared by the HiZ,
depth, and stencil buffers, so we need to choose tile_x and tile_y
values that are compatible with the tiling of all three buffers, and
then compute separate coarse offsets for each buffer.

This patch fixes the HiZ and separate stencil case by replacing the
call to intel_renderbuffer_tile_offsets() with calls to two functions:
intel_region_get_tile_masks(), which determines how much of the
adjustment can be performed using offsets and how much can be
performed using tile_x and tile_y, and
intel_region_get_aligned_offset(), which computes the coarse offset.

intel_region_get_tile_offsets() is still used for color renderbuffers,
so to avoid code duplication, I've re-worked it to use
intel_region_get_tile_masks() and intel_region_get_aligned_offset().

On i965 Gen6, fixes piglit tests
"texturing/depthstencil-render-miplevels 1024 X" where X is one of
(depth, depth_and_stencil, depth_stencil_single_binding, depth_x,
depth_x_and_stencil, stencil, stencil_and_depth, stencil_and_depth_x).

On i965 Gen7, the variants of
"texturing/depthstencil-render-miplevels" that contain a stencil
buffer still fail, due to another problem: Gen7 seems to ignore the 3
LSB's of the tile_y adjustment (and possibly also tile_x).

v2: Removed spurious comments. Added assertions to check
preconditions of intel_region_get_aligned_offset().

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
4433b0302d0aa9dc61002e8bb4fd1b752b0be338 20-Apr-2012 Brian Paul <brianp@vmware.com> intel: use _mesa_is_winsys/user_fbo() helpers

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a27c7d80afc3160a0face4b8781bf921229bc3cc 06-Apr-2012 Paul Berry <stereotype441@gmail.com> i965: Stop lying about cpp and height of a stencil buffer.

When using a separate stencil buffer, i965 requires that the pitch of
the buffer (in the 3DSTATE_STENCIL_BUFFER command) be specified as 2x
the actual pitch.

Previously this was accomplished by doubling the "cpp" and "pitch"
values stored in the intel_region data structure, and halving the
height. However, this was confusing, and it led to a subtle (but
benign) bug: since a stencil buffer is W-tiled, its true height must
be aligned to a multiple of 64; we were accidentally aligning its faux
height to a multiple of 64, causing memory to be wasted.

Note that for window system stencil buffers, the DDX also doubles the
cpp and pitch values. To facilitate fixing this DDX server bug in the
future, we fix the cpp and pitch values we receive from the X server
only if cpp has the "incorrect" value of 2.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>

v2: Clarify comments about the DDX.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
b2ace06cbbbb1021e2d7ace12a985c6406821939 29-Feb-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Fix Gen6+ dynamic state upper bound on older kernels.

Kernels prior to 271d81b84171d84723357ae6d172ec16b0d8139c (March 2011)
don't support relocations outside of the target buffer object. Rather
than guarding this with a I915_PARAM_HAS_RELAXED_DELTA check, just
smash the bound to 0xfffff001 like we do on Ironlake.

This effectively gives us no upper bound check, just like we did prior
to commit 271d81b84171d84723357ae6d172ec16b0d8139c.

Daniel Vetter would also like to mention that this relies on the guard
page at the end of the GTT.

NOTE: This is a candidate for release branches.
Fixes a regression since 271d81b84171d84723357ae6d172ec16b0d8139c.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46766
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
5a7942c2f1e3af4daedd92c1ddf21fa6a0e4e752 15-Feb-2012 Eric Anholt <eric@anholt.net> i965: Rename the original binding table to mention that it's the WM now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f9c3ea32cd9b243050ee16f10d6eb9d9c8b3a8ea 15-Feb-2012 Eric Anholt <eric@anholt.net> i965: Split the gen6 GS binding table to a separate table.

Improves VS state change microbenchmark performance by 7.08729% +/-
1.22289% (n=10) on gen7, because we don't upload the 64 dwords of
unused binding table any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
07e00b3040d6da381595c65db5afe597f20d99fc 15-Feb-2012 Eric Anholt <eric@anholt.net> i965: Split the VS binding table to a separate table.

This is a step toward making the samplers/binding tables reflect
sampler uniform mappings instead of embedding those in the programs.
No significant performance difference on the microbenchmark (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
3340b47c2280346ba2f44dde44466f09d898b9d8 09-Feb-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Fix border color on Ironlake.

Ironlake appears to check our pointer against the General State Base
Address upper bound, rather than ignoring the zero bound as it ought.

Unfortunately, since we leave GSBA set to zero, there is no logical
upper bound. Set it to the maximum possible value, which should work
since our virtual addresses only go up to 2GB.

+94 piglits.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
9f8ed9d66298e2dc5dff508e3ea723469fe06d93 16-Jan-2012 Brian Paul <brianp@vmware.com> intel: derive intel_renderbuffer from swrast_renderbuffer

Drivers that rely on swrast need to do this, as with swrast_texture_image.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
924de7dc96f4607cb3d833637b5f69f4b9e2a6d0 16-Jan-2012 Brian Paul <brianp@vmware.com> intel: use intel_rb_format() to get renderbuffer format

This will make future changes cleaner and less invasive.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
c25e5300cba7628b58df93ead14ebc3cc32f338c 20-Jan-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Fix border color on Sandybridge and Ivybridge.

While reading through the simulator, I found some interesting code that
looks like it checks the sampler default color pointer against the bound
set in STATE_BASE_ADDRESS. On failure, it appears to program it to the
base address itself.

So I decided to try programming a legitimate bound, and lo and behold,
border color worked.

+92 piglits on Sandybridge. Also fixes Lightsmark on Ivybridge.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38868
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a6dd4bf5fcce2520ab199201fdd1ad155457d781 18-Jan-2012 Chad Versace <chad.versace@linux.intel.com> i965/gen5: Fix rendering of depth buffers without stencil [v2]

Fixes the following OGLConform tests on gen5:
depth-stencil(misc.state_on.depth_int)
fbo_db_ARBfp(basic.OnlyDepthBuffDrawBufferRender)

The problem was that, if the depth buffer's Mesa format was X8_Z24, then
we emitted the hardware format D24_UNORM_X8. But, on gen5, D24_UNORM_S8
must be emitted.

This bug was introduced by:
commit d84a180417d1eabd680554970f1eaaa93abcd41e
Author: Eric Anholt <eric@anholt.net>
i965: Base HW depth format setup based on MESA_FORMAT, not bpp.

v2: Deref 'intel' directly. Move the branch for newer chipset to top.
Quote the PRM. As requested by Ken.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43408
Note: This is a candidate for the 8.0 branch.
Reported-by: Xunx Fang <xunx.fang@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e6d6a10c5a2962f93d4adcd251b9a47a4e438121 12-Jan-2012 Eric Anholt <eric@anholt.net> i965/gen7: Fix depth buffer rendering to tile offsets.

Previously, we were saying that everything from the starting tile to
region width+height was part of the limits of our depthbuffer, even if
the tile was near the bottom of the depthbuffer. This mean that our
range was not clipping to buffer buonds if the start tile was anything
but the start of the buffer.

In bebc91f0f3a1f2d19d36a7f1a4f7c992ace064e9, this was changed to
saying that we're just rendering to a region of the size of the
renderbuffer. This is great -- we get a range that should actually
match what we want. However, the hardware's range checking occurs
after the X/Y offset addition, so we were clipping out rendering to
small depth mip levels when an X/Y offset was present. Just add
tile_x/y to the width in that case -- the WM won't produce negative
x/y values pre-offset, so we just need to get the left/bottom sides of
the region to cover our buffer.

Fixes the following Piglit regressions on gen7:
spec/ARB_depth_buffer_float/fbo-clear-formats
spec/ARB_depth_texture/fbo-clear-formats
spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 8.0 branch.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
254b24f19511014cdf4741b73d69349ac9e931a2 11-Jan-2012 Eric Anholt <eric@anholt.net> i965: Fix compiler warnings from hiz changes.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
bebc91f0f3a1f2d19d36a7f1a4f7c992ace064e9 22-Dec-2011 Chad Versace <chad.versace@linux.intel.com> i965: Replace references to stencil region size with buffer size

It is unwise to use a stencil region's size to determine its
renderbuffer's size, because at region creation we fudge the width and
height to accomodate interleaved rows. (See the comment for MESA_FORMAT_S8
in intel_miptree_create()). Most users of stencil_region->{width,height}
should be converted to use stencil_rb->{Width,Height}.

We have already done the replacement in several locations. This patch
continues the replacement in {brw,gen7}_emit_depthbuffer(). To make those
functions look consistent, I've also done the equivalent replacement for
the depth buffer.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
6a26005c1e298ec205c339b1b53b3dff6e1fd03c 08-Jan-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Correct misspellings of "invariant".

$ dict invarient
No definitions found for "invarient", perhaps you mean:
gcide: Invariant
wn: invariant

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
9df8662e28ff6b60e5296dc4583372e0771a3263 21-Dec-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Don't use BRW_DEPTHFORMAT_D24_UNORM_X8_UINT on Gen4.

X8 depth formats weren't supported until Ironlake (Gen 5).

Fixes GPU hangs introduced in d84a180417d1eabd680554970f1eaaa93abcd41e.
One example test case was "fbo-missing-attachment-blit from".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
9308f298300beaa757194a0db8ed50924754c011 28-Nov-2011 Paul Berry <stereotype441@gmail.com> i965 gen6: Initial implementation of transform feedback.

This patch adds basic transform feedback capability for Gen6 hardware.
This consists of several related pieces of functionality:

(1) In gen6_sol.c, we set up binding table entries for use by
transform feedback. We use one binding table entry per transform
feedback varying (this allows us to avoid doing pointer arithmetic in
the shader, since we can set up the binding table entries with the
appropriate offsets and surface pitches to place each varying at the
correct address).

(2) In brw_context.c, we advertise the hardware capabilities, which
are as follows:

MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 64
MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 4
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 16

OpenGL 3.0 requires these values to be at least 64, 4, and 4,
respectively. The reason we advertise a larger value than required
for MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS is that we have already
set aside 64 binding table entries, so we might as well make them all
available in both separate attribs and interleaved modes.

(3) We set aside a single SVBI ("streamed vertex buffer index") for
use by transform feedback. The hardware supports four independent
SVBI's, but we only need one, since vertices are added to all
transform feedback buffers at the same rate. Note: at the moment this
index is reset to 0 only when the driver is initialized. It needs to
be reset to 0 whenever BeginTransformFeedback() is called, and
otherwise preserved.

(4) In brw_gs_emit.c and brw_gs.c, we modify the geometry shader
program to output transform feedback data as a side effect.

(5) In gen6_gs_state.c, we configure the geometry shader stage to
handle the SVBI pointer correctly.

Note: ordering of vertices is not yet correct for triangle strips
(alternate triangles are improperly oriented). This will be addressed
in a future patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
507e71e45a2e46c6e01423ab00948a72f435396c 18-Nov-2011 Eric Anholt <eric@anholt.net> i965: Add support for GL_ARB_depth_buffer_float under 3.0 override.

This is not exposed generally yet because some of the swrast paths hit
in piglit (drawpixels, copypixels, blit) aren't yet converted to
MapRenderbuffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
4790c4ae2489b8c72e6d98f3f80b5a9e7f799203 07-Dec-2011 Eric Anholt <eric@anholt.net> i965: Add separate stencil/HiZ setup for MESA_FORMAT_Z32_FLOAT_X24S8.

This is a little more unusual than the separate MESA_FORMAT_S8_Z24
support, because in addition to storing the real stencil data in a
MESA_FORMAT_S8 miptree, we also make the Z miptree be
MESA_FORMAT_Z32_FLOAT instead of the requested format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0b8b6c7e974930daf12e97fb8f0b2a2cc29396d9 08-Dec-2011 Eric Anholt <eric@anholt.net> intel: Stop creating the wrapped stencil irb.

There were only two places it was really used at this point, which was
in the batchbuffer emit of the separate stencil packets for gen6/7.
Just write in the ->stencil_mt reference in those two places and ditch
all this flailing around with allocation and refcounts.

v2: Fix separate stencil on gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d464a21e2d796e396e7e4c0cfe971b41003e2d2a 07-Dec-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Return BRW_DEPTHBUFFER_D32_FLOAT as the null-depthbuffer format.

Fixes many crashes on Ivybridge due to upload_sf_state calling
brw_depthbuffer_format without an actual depth buffer. This was a
recent regression on master.

+3992 piglits on Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d84a180417d1eabd680554970f1eaaa93abcd41e 17-Nov-2011 Eric Anholt <eric@anholt.net> i965: Base HW depth format setup based on MESA_FORMAT, not bpp.

This will make handling new formats (like actually exposing Z32F)
easier and more reliable.

v2: Remove the check for hiz buffer -- the MESA_FORMAT should really
be giving us the value we want even for hiz.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f99d5af03b0f97d7a1b7076b2142069770879471 23-Nov-2011 Chad Versace <chad.versace@linux.intel.com> i965/gen6: Fix GPU hang when using stencil buffer without depth

Enable the bit 3DSTATE_DEPTH_BUFFER.Tiled_Surface. From the Sandybridge
PRM, Volume 2, Part 1, Section 7.5.5.1.1 3DSTATE_DEPTH_BUFFER, Bit 1.27
Tiled Surface:
[DevGT+]: This field must be set to TRUE.

Fixes GPU hangs on the following Piglit tests:
hiz-stencil-test-fbo-d0-s8
hiz-stencil-read-fbo-d0-s8

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a2e44b0813e956440c451c107cf5564b56cbe98e 17-Nov-2011 Chad Versace <chad.versace@linux.intel.com> intel: Replace intel_mipmap_tree::hiz_region with a miptree [v2]

This is required to correctly implement HiZ for mipmapped and
multi-layered textures.

v2: Accomodate refcount fixes in intel_process_dri2_buffer_*() that were
introduced in v2 of commit
intel: Replace intel_renderbuffer::region with a miptree [v2]

Reviewed-by: Eric Anholt <eric@anholt>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
da2816a45e6e3a33246a341fee72e6f893f315d9 16-Nov-2011 Chad Versace <chad.versace@linux.intel.com> intel: Replace intel_renderbuffer::region with a miptree [v3]

Essentially, this patch just globally substitutes `irb->region` with
`irb->mt->region` and then does some minor cleanups to avoid segfaults
and other problems.

This is in preparation for
1. Fixing scatter/gather for mipmapped separate stencil textures.
2. Supporting HiZ for mipmapped depth textures.

As a nice benefit, this lays down some preliminary groundwork for easily
texturing from any renderbuffer, even those of the window system.

A future commit will replace intel_mipmap_tree::hiz_region with a miptree.

v2:
- Return early in intel_process_dri2_buffer_*() if region allocation
fails.
- Fix double semicolon.
- Fix miptree reference leaks in the following functions:
intel_process_dri2_buffer_with_separate_stencil()
intel_image_target_renderbuffer_storage()

v3:
- [anholt] Fix check for hiz allocation failure. Replace
``if (!irb->mt)` with ``if(!irb->mt->hiz_region)``.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e7c29c5de82f6de3d30ed1143d9672dd2e25f0e7 31-Oct-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Use a single binding table for all pipeline stages.

Although the hardware supports separate binding tables for each pipeline
stage, we don't see much advantage over a single shared table.

Consider the contents of the binding table:
- Textures (16)
- Draw buffers (8)
- Pull constant buffers (1 for VS, 1 for WM)

OpenGL's texture bindings are global: the same set of textures is
available to all shader targets. So our binding table entries for
textures would be exactly the same in every table.

There are only two pull constant buffers (not many), and although draw
buffers aren't interesting to the VS, it shouldn't hurt to have them in
the table. The hardware supports up to 254 binding table entries, and
we currently only use 26.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
eaf4d3e6e2493a6e0b20d1205a5fb33ce500c9c2 22-Oct-2011 Eric Anholt <eric@anholt.net> i965: Remove the validated BO list, now that it's unused.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
8004a1cb95b8a195f3f4bbaa8d39d2f3297167de 22-Sep-2011 Eric Anholt <eric@anholt.net> intel: Rename region->buffer to region->bo, and remove accessor function.

We call all the other drm_intel_bo pointers in intel/*.h "bo", so this
one was rather out of place.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
8bd27a5b080157cb1d5fc0383ce45574c7b16aa5 01-Sep-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Emit depth stalls and flushes before changing depth state on Gen6+.

Fixes OpenArena on Gen7. Technically, adding only the first depth stall
fixes it, but the documentation says to do all three, and the Windows
driver seems to do it.

Not observed to fix anything on Gen6 yet.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38863
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
7288d010e0afeade5357502fdc018fc4928330f6 19-Sep-2011 Eric Anholt <eric@anholt.net> i965: Fix polygon stipple offset state flagging.

_NEW_WINDOW_POS wasn't a real Mesa state flag, but we were missing
_NEW_BUFFERS to update the stipple offset when FBO binding or window
size changed, and _NEW_POLYGON to update when stippling gets enabled.

Fixes oglconform's tristrip test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
4c9b09d3c2cc50b1dd46b9eb8a89d6086016484b 19-Sep-2011 Eric Anholt <eric@anholt.net> i965: Add missing _NEW_POLYGON flag to polygon stipple upload.

Because we skip the pattern upload when stippling is disabled, we need
to check again when it might have been turned on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
fb5ff51f422e1718c09da01f3c5bb5baecc9d68e 19-Jul-2011 Eric Anholt <eric@anholt.net> i965: Fix regression in 29a911c50e4443dfebef0a2e32c39b64992fa3cc.

The previous define was the full 32-bit header, while the new define
was just the top 16 bits.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
29a911c50e4443dfebef0a2e32c39b64992fa3cc 13-Jul-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Rename 3DSTATE_DRAWRECT_INFO_I965 to 3DSTATE_DRAWING_RECTANGLE.

The documentation uses 3DSTATE_DRAWING_RECTANGLE, and we already had it
defined in brw_defines.h; we were simply using an old #define from
intel_reg.h.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
247e4c69ce6389805437256524d043019abfa6d1 30-Jun-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Convert system instruction pointer to OUT_BATCH style.

Also rename it from CMD_STATE_INSN_POINTER to CMD_STATE_SIP to match the
documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
87de78523ae96737a39267aaa135ddabff05f2f2 30-Jun-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Convert PIPELINE_SELECT to OUT_BATCH style.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
473a519d20c97b54504ff61aaedc0665529c14b7 30-Jun-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Emit 3DSTATE_VF_STATISTICS in OUT_BATCH style.

This is a little different from most because it's a single DWord;
there's no length field.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a68c5e6b71ac9abf70eb443637d4e79ffba66595 30-Jun-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Convert 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP to OUT_BATCH style.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a09c5c2e3053c48a33134cf28229105bfef52e6f 19-Jun-2011 Eric Anholt <eric@anholt.net> i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.

This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
babe1fc004b56202b2bd54d9689f5208dc4fd607 20-Jun-2011 Eric Anholt <eric@anholt.net> i965/gen6: Add a couple more packets to the nonpipelined workaround list.

All the packets chosen before came from grepping the pdf for
nonpipelined, and these two came from grepping for non.pipelined. We
could stand a review by looking at all packets emitted and identifying
what kind they are.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f6e5230b2614cc91e4c849c07781b2230878d274 18-Jun-2011 Eric Anholt <eric@anholt.net> i965/gen6: Apply documented workaround for nonpipelined state packets.

Fixes a 100% reproducible GPU hang in topogun-1.06-orc-84k.trace.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
c173541d9769d41a85cc899bc49699a3587df4bf 27-Apr-2011 Eric Anholt <eric@anholt.net> i965: Use state streaming on programs, and state base address on gen5+.

There will be a little bit of thrashing of the program cache BO as the
cache warms up, but once the application is in steady state, this
reduces relocations on gen5 and later.

On my T420 laptop, cairogl firefox-talos-gfx performance improves 2.6%
+/- 1.3% (n=6). No statistically significant performance difference
on nexuiz (n=5).
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d105f6684dfbfe596e57ddeb9377e7f9e4e57dcb 09-Jun-2011 Chad Versace <chad@chad-versace.us> i965/gen5,6: Fix hang when emitting hiz buffer without stencil buffer

When emitting either a hiz or stencil buffer, the 'separate stencil
enable' and 'hiz enable' bits are set in 3DSTATE_DEPTH_BUFFER. Therefore
we must emit both 3DSTATE_HIER_DEPTH_BUFFER and 3DSTATE_STENCIL_BUFFER.

Even if there is no stencil buffer, 3DSTATE_STENCIL_BUFFER must be
emitted; failure to do so causes a hang on gen5 and a stall on gen6.

This also fixes a silly, obvious segfault that occured when a hiz buffer
xor separate stencil buffer existed.

Fixes the piglit tests below on Gen5 when hiz and separate stencil are
manually enabled:
fbo-alphatest-nocolor
fbo-depth-sample-compare
fbo
hiz-depth-read-fbo-d24-s0
hiz-depth-stencil-test-fbo-d24-s0
hiz-depth-test-fbo-d24-s0
hiz-stencil-read-fbo-d0-s8
hiz-stencil-test-fbo-d0-s8
fbo-missing-attachment-clear
fbo-clear-formats
fbo-depth-*

Changes piglit test result from crash to fail:
hiz-depth-stencil-test-fbo-d0-s8

Signed-off-by: Chad Versace <chad@chad-versace.us>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
b17aab5753a6d14c9e757bedb186963b2dae8823 31-May-2011 Eric Anholt <eric@anholt.net> intel: Move the draw_x/draw_y to the renderbuffer where it belongs.

It was originally located in the region because the tracking of
depth/color buffers was on the regions, and getting back to the irb
would have been tricky. Now, we're keying off of the renderbuffer in
more places, which means we can move these fields where they belong.

This could fix potential rendering failure with a single texture
having multiple images attached to different renderbuffers across
shareCtx (as far as I can tell, this was the only failure we could
cause, since anything else should trigger intel_render_texture in
between, for example a BindFramebuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
97d230b0bcf8ed001f685ebac314fbd8e1955718 10-Jun-2011 Chad Versace <chad@chad-versace.us> i965/brw: Fix emit_depthbuffer() when packed depth/stencil texture is attached

If either depth or stencil buffer has packed depth/stencil format, then do
not use separate stencil.

Before this commit, emit_depthbuffer() incorrectly assumed that the
texture's stencil renderbuffer wrapper was a *separate* stencil buffer,
because the depth and stencil renderbuffer wrappers are distinct for
depth/stencil textures (that is, depth_irb != stencil_irb).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38134
Signed-off-by: Chad Versace <chad@chad-versace.us>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
2a638076165eaa1294708a7e4518c2d72560e066 06-Jun-2011 Kenneth Graunke <kenneth@whitecape.org> i965/gen7: Don't emit 3DSTATE_GS_SVB_INDEX on Ivybridge.

According to vol2a.07, it only applies from Cantiga to Sandybridge.

I found this in my ringbuffers while investigating various GPU hangs.
While it may not have been the cause, it seemed wise to remove it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
2abc8cae87b4cd037ebde68b4b9a1d02254657df 23-May-2011 Chad Versace <chad@chad-versace.us> i965/brw: Emit state for hiz and separate stencil buffers

When emitting 3DSTATE_DEPTH_BUFFER, also emit 3DSTATE_HIER_DEPTH_BUFFER if
there is a hiz buffer. Ditto for 3DSTATE_STENCIL_BUFFER and a separate
stencil buffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
3e43adef95ee24dd218279d2de56939b90edcb4c 13-May-2011 Eric Anholt <eric@anholt.net> i965: Add support for rendering to depthbuffer mipmap levels > 0.

Fixes
GL_ARB_depth_texture/fbo-clear-formats
GL_EXT_packed_depth_stencil/fbo-clear-formats
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a98dd64af750fb6dae54b2dc02e0c5a3711156af 13-May-2011 Eric Anholt <eric@anholt.net> i965: Stop caching the combined depth/stencil region in brw_context.c.

This was going to get in the way of separate depth/stencil (which
wants to know about both, and whether they are the same rb), and also
wasn't a sufficient flag for the fix in the following commit.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d58400eb4a2605640267436f63d9e856fb3c1f96 09-Apr-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Emit extra 0's in 3DSTATE_MULTISAMPLE on Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e0e2c045965f7bd4becae3dce8394f8455184e0d 22-Feb-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Split BRW_NEW_BINDING_TABLE dirty bit into one per stage.

Ivybridge can update each stage's binding table pointer independently,
so we want separate dirty bits. Previous generations can simply
subscribe to all three dirty bits and emit as usual.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
acb4d5cd96d91320b8e5edb727ff3a268f04587f 25-Apr-2011 Eric Anholt <eric@anholt.net> i965/gen4: Move the GS state to state streaming.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
8ba0c025a4e0aba97ae596e2121416cf04c0c300 25-Apr-2011 Eric Anholt <eric@anholt.net> i965/gen4: Move clip state to state streaming

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
588cebce2d5b6afd24b72603d744d390481310dd 25-Apr-2011 Eric Anholt <eric@anholt.net> i965/gen4: Move VS state to state streaming.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a82a43e8d99e1715dd11c9c091b5ab734079b6a6 23-Apr-2011 Eric Anholt <eric@anholt.net> i965/gen6: Use the dynamic state base address to reduce relocations.

Now that all the dynamic state is streamed through the top of the
batchbuffer, we can cut out many of our relocations to that state by
using the base address.

Improves 3DMMES taiji performance 3.3% +/- 0.4% (n=15).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
855f56ca13c1003396a81da1a110357d624a2101 25-Apr-2011 Eric Anholt <eric@anholt.net> i965/gen6: Move scissor state to state streaming.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
1a447749ed421db8eb6ba20012630785aef9bb12 23-Apr-2011 Eric Anholt <eric@anholt.net> i965/gen4: Move WM state to state streaming.

The samplers are about to become streamed for gen6 performance, which
would cause this unit to blow out the state cache.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d3cc3901ab67823af3aba08efc863daa22ed1408 07-Apr-2011 Chad Versace <chad.versace@intel.com> i965: Change assertion condition from implicit to explicit

... because grokking explicit assertions requires fewer neurons.

In brw_misc_state.c:emit_depthbuffer, change assertion condition
tiling != I915_TILING_X && tiling != I915_TILING_NONE
to
tiling == I915_TILING_Y

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
05173c61c7cb987d08681f182ac78a1a179e02a4 08-Apr-2011 Chad Versace <chad.versace@intel.com> i965: Document brw_context.state.depth_region

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
b1be5bd205d3efcaf4012d2c9a12831da57fc7fb 09-Mar-2011 Eric Anholt <eric@anholt.net> i965: Change the SF unit from state caching to state streaming.

This is a 28.1% +/- 1.4% (n=10) performance improvement for the
hacked-up-for-cache-misses scissor-many (n=10), and no statistically
significant wall-time performance difference for the
hacked-up-for-cache-hits version (n=9, first outlier in each removed
since IPS was warming up. User time increased by about 4.7%, but
kernel time decreased equivalently).
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
aac120977d1ead319141d48d65c9bba626ec03b8 20-Feb-2011 Chris Wilson <chris@chris-wilson.co.uk> i965: Move repeat-instruction-suppression to batchbuffer core

Move the tracking of the last emitted instructions into the core
batchbuffer routines and take advantage of the shadow batch copy to
avoid extra memory allocations and copies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
8d68a90e225d831a395ba788e425cb717eec1f9a 10-Feb-2011 Chris Wilson <chris@chris-wilson.co.uk> intel: use pwrite for batch

It's faster. Not only is the memcpy more efficiently performed in the
kernel (making up for the system call overhead), but by not using mmap
we remove the greater overhead of tracking the vma of every batch.

And it means we can read back from the batch buffer without incurring
the cost of a uncached read through the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
3f55683927278e57f3ef8a151d15f4cffdc060dc 10-Feb-2011 Chris Wilson <chris@chris-wilson.co.uk> i965: drop state_bo references to batch_bo

As we use state relocations and we know that all the state belongs to
the same bo, we can drop the multiple references to the same bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
71acbb54f49089b03d3498b6f88c1681d3f649ac 09-Feb-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Rename a few more commands to match the documentation.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
1feee7b1b39e54c279ffdc3c27f3911c04658430 10-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Rename more #defines to 3DSTATE rather than CMD or CMD_3D.

Again, this makes it match the documentation.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e31defc825ee94f1d1092e277954abad7097c552 04-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> i965: Rename various gen6 #defines to match the documentation.

This should make it easier to cross-reference the code and hardware
documentation, as well as clear up any confusion on whether constants
like CMD_3D_WM_STATE mean WM_STATE (pre-gen6) or 3DSTATE_WM (gen6+).

This does not rename any pre-gen6 defines.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
59fa8600d8efa803a4f86a41beaca78f7be41d7c 28-Dec-2010 Zhenyu Wang <zhenyuw@linux.intel.com> Revert "i965: upload multisample state for fragment program change"

This reverts commit de6fd527a545f8344e074312544517d05573fb72.

Revert this workaround as it seems the real trouble is caused by
lineloop, which doesn't require GS convert on sandybridge actually.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
de6fd527a545f8344e074312544517d05573fb72 23-Dec-2010 Zhenyu Wang <zhenyuw@linux.intel.com> i965: upload multisample state for fragment program change

This makes conformance tests stable on sandybridge D0 to track
multisample state before SF/WM state.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
8a7cf99457f5061c3c5aae48f14fb23b2ca07503 19-Nov-2010 Eric Anholt <eric@anholt.net> i965: Don't upload line smooth params unless we're line smoothing.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
008fd3779bc7adf603b27f49f4c90b21cee814e0 19-Nov-2010 Eric Anholt <eric@anholt.net> i965: Don't upload line stipple pattern unless we're stippling.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e29e3c32d9d52fc206ab3ccc8674683adc880e82 19-Nov-2010 Eric Anholt <eric@anholt.net> i965: Don't upload polygon stipple unless required.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
7720bfffa3fd537789b5ded30ecc23afa21dc410 19-Nov-2010 Eric Anholt <eric@anholt.net> i965: Move gen4 blend constant color to the gen4 blending file.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
bb1540835056cdea5db6f55b19c0c87358f14cd1 03-Nov-2010 Eric Anholt <eric@anholt.net> intel: Annotate debug printout checks with unlikely().

This provides the optimizer with hints about code hotness, which we're
quite certain about for debug printouts (or, rather, while we
developers often hit the checks for debug printouts, we don't care
about performance while doing so).
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
2595589f1df351895bc5b1a92f19e995a19da15b 19-Oct-2010 Eric Anholt <eric@anholt.net> i965: Remove the gen6 emit_mi_flushes I sprinkled around the driver.

These were for debugging in bringup. Now that relatively complicated
apps are working, they haven't helped debug anything in quite a while.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f9995b30756140724f41daf963fa06167912be7f 12-Oct-2010 Kristian Høgsberg <krh@bitplanet.net> Drop GLcontext typedef and use struct gl_context instead
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d4da253b298677c63def5f2f774608d660be31a1 29-Sep-2010 Zhenyu Wang <zhenyuw@linux.intel.com> Revert "i965: Always set tiling for depth buffer on sandybridge"

This reverts commit 0a1910c26760762eb8d67f68dfd87494ab479e38.

oops, shouldn't apply tiling depth buffer for other chips as well.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0a1910c26760762eb8d67f68dfd87494ab479e38 29-Sep-2010 Zhenyu Wang <zhenyuw@linux.intel.com> i965: Always set tiling for depth buffer on sandybridge

Sandybridge only support tiling depth buffer, always set tiling bit.

Fix 'fbo_firecube' demo.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
24ff42e7d56ac489caeca6b5ffcc3091cc8194b5 31-Aug-2010 Zhenyu Wang <zhenyuw@linux.intel.com> i965: fix depth test on sandybridge

This includes several corrections for fixing depth test on sandybridge.
Fix wrong bits definition in depth stencil state. Fix wrong order of
state buffer offset in 3DSTATE_CC_STATE_POINTERS command. Correctly use
buffer width parameter in depth buffer setting.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
527a9a4de218cae89d7faf92788f88ce1f9387b6 22-Aug-2010 Eric Anholt <eric@anholt.net> i965: Use intel->gen >= 6 instead of IS_GEN6.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
7ad26b0030f6b14e6ec069eafdec6faf75e8007c 11-Jun-2010 Eric Anholt <eric@anholt.net> i965: Stream out CC unit state.

before:
[ # ] backend test min(s) median(s) stddev. count
[ 0] gl firefox-talos-gfx 31.791 32.287 1.11% 6/6
after:
[ 0] gl firefox-talos-gfx 31.198 31.675 0.96% 6/6
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
27bc2de5461c1d66c8e005b35de77e7b9e214754 11-Jun-2010 Eric Anholt <eric@anholt.net> i965: Use the state base address to avoid relocations.

This makes the binding table code simpler, and is required for gen6,
which requires binding table addresses to be under 64k offset from the
surface state base addr.

No significant change in performance on firefox-talos-gfx.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
73de09f265cb1c66d70fd9eb92021882bfbbbef6 07-Jun-2010 Eric Anholt <eric@anholt.net> i965: Convert the binding table to streamed indirect state.

This slightly reduces reduces cairo-gl firefox-talos-gfx runtime on my
Ironlake:
before:
[ # ] backend test min(s) median(s) stddev. count
[ 0] gl firefox-talos-gfx 38.236 38.383 0.43% 5/6
after:
[ 0] gl firefox-talos-gfx 37.799 38.203 0.39% 6/6

It turns out the cost of caching these objects and looking them up in
the cache again is greater than the cost of just computing the object
again, particularly when the overhead of having a separate BO to pin
is removed.

(Those that are paying close attention will note that this is a
reversal of the path I was moving the driver in a couple of years ago.
The major thing that has changed is that back then all state was
recomputed when we wrapped the streaming state buffer, including
recompiling our precious programs. Now, we're uncaching just the
objects that are cheap to compute, and retaining caching of expensive
objects)
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
ddb10c3e603ee03e1287a992d23a5507779b7ffd 24-May-2010 Eric Anholt <eric@anholt.net> i965: Move Gen6 debugging emit_mi_flush into the Gen6 block.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
6e2330daa6d7872405485ffabfe613a7c053d890 24-May-2010 Eric Anholt <eric@anholt.net> i965: Emit MI_FLUSH before PSP on Ironlake for clip max threads errata.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
cdcef6cbf4dd80047819e9098e34a3b98bd502a4 19-Apr-2010 Zhenyu Wang <zhenyuw@linux.intel.com> intel: Clean up chipset name and gen num for Ironlake

Rename old IGDNG to Ironlake, and set 'gen' number for
Ironlake as 5, so tracking the features with generation num
instead of special is_ironlake flag.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f69d46150c308285a518391db02cc9cba0f2a12d 01-Feb-2010 Eric Anholt <eric@anholt.net> i965: Add a couple SNB state packets I saw in other batchbuffer dumps.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
737fac7ba220e4a2d66a8e2100ae0af620c274df 21-Dec-2009 Eric Anholt <eric@anholt.net> i965: Hook up remaining Sandybridge state packets besides WM.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a38096aa94ef62dba73792f1680098059b697662 14-Dec-2009 Eric Anholt <eric@anholt.net> i965: Set the state base address on Sandybridge.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
9dce60f35b25f4f5605b22d75447bac5d9f55515 03-Nov-2009 Eric Anholt <eric@anholt.net> i965: Set up sandybridge binding table pointers but don't enable it yet.

It hangs the GPU at the clipper stage, presumably because we're lacking
other setup.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
719f2b1d8570aa58b970bd28941221ee6c34af9b 03-Nov-2009 Eric Anholt <eric@anholt.net> i965: Set up sandybridge depthbuffer.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a3d8e7e48152d88217a409bf366e10497ee75763 27-Jan-2010 Eric Anholt <eric@anholt.net> i965: Remove DRI1 leftovers from stipple offset handling.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
2861d9200be15cc44e8825387d3bd79086523c67 02-Jan-2010 Kristian Høgsberg <krh@bitplanet.net> intel: Drop more cliprect bookkeeping
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
5203b7227ccb6b618fa42f08434d4a3cf123dca2 02-Jan-2010 Kristian Høgsberg <krh@bitplanet.net> intel: Drop batchbuffer cliprect_mode tracking
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d61f07318c8678901b948fdaa8ccdf37aa3203e9 01-Jan-2010 Kristian Høgsberg <krh@bitplanet.net> Remove leftover __DRI{screen,drawable,context}Private references

As part of the DRI driver interface rewrite I merged __DRIscreenPrivate
and __DRIscreen, and likewise for __DRIdrawablePrivate and
__DRIcontextPrivate. I left typedefs in place though, to avoid renaming
all the *Private use internal to the driver. That was probably a
mistake, and it turns out a one-line find+sed combo can do the mass
rename. Better late than never.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
cb3810dd19760797e699c47929f655b829c4d339 17-Dec-2009 Eric Anholt <eric@anholt.net> intel: Replace IS_965 checks with context structure usage.

Saves another 600 bytes or so of code.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0b87f143c466f7e5bd730895ee29f1cd20a68f9b 17-Dec-2009 Eric Anholt <eric@anholt.net> intel: Replace IS_G4X() across the driver with context structure usage.

Saves ~2KB of code.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
1c96e85c9d6b8c636b0636f3320d1057ab5357b3 16-Dec-2009 Eric Anholt <eric@anholt.net> intel: Replace IS_IGDNG checks with intel->is_ironlake or needs_ff_sync.

Saves ~480 bytes of code.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
99077e77927ec26edf85bfef81a6d433171c3a1e 13-Nov-2009 Eric Anholt <eric@anholt.net> i965: Flag BRW_NEW_CONTEXT on some context state.

Fixing this is a prereq for avoiding flagging all state at new
batch time. Eliminating that still causes problems, though (notably
glean logicOp fails on my GM965).
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f5539b6991e336aa1cf302dbdb1a29b3e85cff36 20-Aug-2009 Xiang, Haihao <haihao.xiang@intel.com> i965: validate sf state
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
2995bf0d68f1b28ba68b81e9dc79e3ab52bc2795 13-Jul-2009 Xiang, Haihao <haihao.xiang@intel.com> i965: add support for new chipsets

1. new PCI ids
2. fix some 3D commands on new chipset
3. fix send instruction on new chipset
4. new VUE vertex header
5. ff_sync message (added by Zou Nan Hai <nanhai.zou@intel.com>)
6. the offset in JMPI is in unit of 64bits on new chipset
7. new cube map layout
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e0a4e25f938953201fef2bf702e2e709451200f4 23-Jun-2009 Eric Anholt <eric@anholt.net> i965: Fix packed depth/stencil textures to be Y-tiled as well.

Fixes shadowtex.c. And an assert is added to catch this sooner next time.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
9490d86808300e5819941a40784e272c290e05ee 05-May-2009 Eric Anholt <eric@anholt.net> i965: Disentangle VS constant surface state from WM surface state.

Also, only create VS surface state if there's a VS constant buffer to be
uploaded, and set the contents of the buffer at the same time as creation.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
cafea7528052624c8d3e4cd1c5b26a61bf04d1d0 14-Apr-2009 Brian Paul <brianp@vmware.com> i965: checkpoint commit: VS constant buffers

Hook up a constant buffer, binding table, etc for the VS unit.
This will allow using large constant buffers with vertex shaders.
The new code is disabled at this time (use_const_buffer=FALSE).
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
29309b45b011b4c44721b8f7346272fb22a4d4c2 12-Mar-2009 Robert Ellison <papillo@vmware.com> i965: fix polygon stipple when rendering to FBO

The polygon stipple pattern, like the viewport and the
polygon face orientation, must be inverted on the i965
when rendering to a FBO (which itself has an inverted pixel
coordinate system compared to raw Mesa).

In addition, the polygon stipple offset, which orients
the stipple to the window system, disappears when rendering
to an FBO (because the window system offset doesn't apply,
and there's no associated FBO offset).

With these fixes, the conform triangle and polygon stipple
tests pass when rendering to texture.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d0415a5a01c1a8c2c2a389d977401a7f6cee031b 25-Feb-2009 Eric Anholt <eric@anholt.net> i965: Rename CMD_CONST_BUFFER_STATE to the CS_URB_STATE used in the docs.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
052c1d66a1ab1f2665870dc77dab28d20416cdf1 30-Jan-2009 Eric Anholt <eric@anholt.net> i965: Remove brw->attribs now that we can just always look in the GLcontext.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
14321fcfde9e30d0b9f15aab3c9a057271ae6295 30-Jan-2009 Eric Anholt <eric@anholt.net> i965: Delete old metaops code now that there are no remaining consumers.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
34b1776e8d965605d12807884c9c447214d57281 02-Nov-2008 Eric Anholt <eric@anholt.net> i965: Merge GM45 into the G4X chipset define.

The mobile and desktop chipsets are the same, and having them separate is
more typing and more chances to screw up.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
59b2c2adbbece27ccf54e58b598ea29cb3a5aa85 24-Oct-2008 Eric Anholt <eric@anholt.net> i965: Fix check_aperture calls to cover everything needed for the prim at once.

Previously, since my check_aperture API change, we would check each piece of
state against the batchbuffer individually, but not all the state against the
batchbuffer at once. In addition to not being terribly useful in assuring
success, it probably also increased CPU load by calling check_aperture many
times per primitive.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
0cade4de4f74f6b0e86fb6622e2fc370c73fd840 20-Oct-2008 Eric Anholt <eric@anholt.net> intel: Don't keep intel->pClipRects, and instead just calculate it when needed.

This avoids issues with dereferencing stale cliprects around intel_draw_buffer
time. Additionally, take advantage of cliprects staying constant for FBOs and
DRI2, and emit cliprects in the batchbuffer instead of having to flush batch
each time they change.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
ec8076264ea2390d4cb749be5c88bbf2bf5d4847 24-Oct-2008 Xiang, Haihao <haihao.xiang@intel.com> i965: don't emit state when dri_bufmgr_check_aperture_space fails.

This ensures there is an unfilled batchbuffer used for emitting states again. Partial fix for #17964.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f75843a517bd188639e6866db2a7b04de3524e16 24-Aug-2008 Dave Airlie <airlied@linux.ie> Revert "Revert "Merge branch 'drm-gem'""

This reverts commit 7c81124d7c4a4d1da9f48cbf7e82ab1a3a970a7a.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
7c81124d7c4a4d1da9f48cbf7e82ab1a3a970a7a 24-Aug-2008 Dave Airlie <airlied@linux.ie> Revert "Merge branch 'drm-gem'"

This reverts commit 53675e5c05c0598b7ea206d5c27dbcae786a2c03.

Conflicts:

src/mesa/drivers/dri/i965/brw_wm_surface_state.c
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d2796939f18815935c8fe1effb01fa9765d6c7d8 08-Aug-2008 Eric Anholt <eric@anholt.net> intel-gem: Update to new check_aperture API for classic mode.

To do this, I had to clean up some of 965 state upload stuff. We may end
up over-emitting state in the aperture overflow case, but that should be rare,
and I'd rather have the simplification of state management.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
527e1cf172cb0a4d1f2891a351498669be1620cd 08-Aug-2008 Eric Anholt <eric@anholt.net> 965: cleanups to state emission from aperture checking and state ordering.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
1e645b365900cf1c71ca5594bd6b549a1f203040 26-Jul-2008 Ian Romanick <ian.d.romanick@intel.com> Merge branch 'master' into drm-gem

Conflicts:

src/mesa/drivers/dri/common/dri_bufmgr.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
2e841880cfc1006a2818d4a8bfefd21136dc39a9 11-Jul-2008 Eric Anholt <eric@anholt.net> drm-gem: Use new GEM ioctls for tiling state, and support new swizzle modes.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
92c075eeb7c330ea420400d1c2bae57356b19f03 08-Jul-2008 Xiang, Haihao <haihao.xiang@intel.com> i965: official name for GM45 chipset
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
407ce3da3c53c9ebba0fbf827d7b0f610122d44b 11-Jun-2008 Eric Anholt <eric@anholt.net> [intel-gem] Chase domain flag renaming in the DRM.

This is an API breakage only.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
ead798eb103e4cfe801704bc15eb4fe8df078fa8 07-May-2008 Eric Anholt <eric@anholt.net> GEM: Remove already-disabled PIPE_CONTROL command.

This existed to get the icache flushed. However, GEM handles this for us
now for sure, and we had disabled it prematurely anyway.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
ab50ddaa9173ae108833db0edb209045788efc41 07-May-2008 Eric Anholt <eric@anholt.net> GEM: Make dri_emit_reloc take GEM domain flags instead of TTM flags.

The GEM flags are much more descriptive for what we need. Since this makes
bufmgr_fake rather device-specific, move it to the intel common directory.
We've wanted to do device-specific stuff to it before.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
27e06a52342b94b4fb1d60a57c3bdaa2b30607cf 18-Apr-2008 Dave Airlie <airlied@panoply-rh.(none)> i965: fixup depth buffer check
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
008653ac55776d6b1c6d1627ad20937aa1c4dbda 17-Apr-2008 Dave Airlie <airlied@redhat.com> i965: initial attempt at fixing the aperture overflow

Makes state emission into a 2 phase, prepare sets things up and accounts
the size of all referenced buffer objects. The emit stage then actually
does the batchbuffer touching for emitting the objects.

There is an assert in dri_emit_reloc if a reloc occurs for a buffer
that hasn't been accounted yet.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
c99fa92ff84e927c82e1231d96921fda9a2b0852 22-Feb-2008 Kristian Høgsberg <krh@redhat.com> Merge {i915,i965}/intel_context.h as intel/intel_context.h
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
70908a793b7755c973fe024844185ff9e14924ea 07-Feb-2008 Eric Anholt <eric@anholt.net> [965] Flush icache on new batch, not just new context.

This is required since our buffer manager may now move our
instruction-containing buffers at any batchbuffer emit.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
8e444fb9e2685e3eac42beb848b08e91dc20c88a 29-Jan-2008 Xiang, Haihao <haihao.xiang@intel.com> i965: new integrated graphics chipset support
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
a04b632350e5d0e9994fc667afc59407a39da0ba 10-Jan-2008 Eric Anholt <eric@anholt.net> [intel] Add more cliprect modes to cover other meanings for batch emits.

The previous change gave us only two modes, one which looped over the batch
per cliprect (3d drawing) and one that didn't (state updeast).
However, we really want 4:

- Batch doesn't care about cliprects (state updates)
- Batch needs DRAWING_RECTANGLE looping per cliprect (3d drawing)
- Batch needs to be executed just once (region fills, copies, etc.)
- Batch already includes cliprect handling, and must be flushed by unlock time
(copybuffers, clears).

All callers should now be fixed to use one of these states for any batchbuffer
emits. Thanks to Keith Whitwell for pointing out the failure.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
dc1608ae9d90a490ce32aa005488e3591a6d8369 09-Jan-2008 Eric Anholt <eric@anholt.net> [965] Replace the always_update dirty flag with BRW_NEW_BATCH.

This allows us to avoid re-emitting some state when validate_state happens
multiple times per batchbuffer. Even though we flush batch per primitive
currently, that may still happen already if the primitive changed (this should
probably be fixed as well).
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
d9edd8e90588417e3d549f25132dab2f21445792 09-Jan-2008 Eric Anholt <eric@anholt.net> [965] Remove drawing rect upload, which is handled (better) by the kernel.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
bea6b5fe5aa3138cec8d057766ae48da4aa57dee 20-Dec-2007 Eric Anholt <eric@anholt.net> [965] Enable EXT_framebuffer_object.

To do so, merge the remainnig necessary code from the buffers, blit, span, and
screen code to shared, and replace it with those.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
146030aad2c41eb8303935a13333c93fdc7c4a58 18-Dec-2007 Eric Anholt <eric@anholt.net> [965] Allow draw or depth regions to be NULL.

With FBOs, we end up wanting to do 3D metaops against one or the other without
having to find the other one to fill in if we're not going to draw to it.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
38bad7677e57d629eeffd4ef39a7fc254db12735 14-Dec-2007 Eric Anholt <eric@anholt.net> [965] Replace the state cache suballocator with direct dri_bufmgr use.

The user-space suballocator that was used avoided relocation computations by
using the general and surface state base registers and allocating those types
of buffers out of pools built on top of single buffer objects. It also
avoided calls into the buffer manager for these small state allocations, since
only one buffer object was being used.

However, the buffer allocation cost appears to be low, and with relocation
caching, computing relocations for buffers is essentially free. Additionally,
implementing the suballocator required a don't-fence-subdata flag to disable
waiting on buffer maps so that writing new data didn't block on rendering using
old data, and careful handling when mapping to update old data (which we need
to do for unavoidable relocations with FBOs). More importantly, when the
suballocator filled, it had no replacement algorithm and just threw out all
of the contents and forced them to be recomputed, which is a significant cost.

This is the first step, which just changes the buffer type, but doesn't yet
improve the hash table to not result in full recompute on overflow. Because
the buffers are all allocated out of the general buffer allocator, we can
no longer use the general/surface state bases to avoid relocations, and they
are set to 0 instead.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
e3a6e60040b7f6ea7965e52f8f9881ed31e0347c 08-Dec-2007 Eric Anholt <eric@anholt.net> [965] Convert the driver to dri_bufmgr interface and enable TTM.

This is currently believed to work but be a significant performance loss.
Performance recovery should be soon to follow.

The dri_bo_fake_disable_backing_store() call was added to allow backing store
disable like bufmgr_fake.c did, which is a significant performance win (though
it's missing the no-fence-subdata part).

This commit is a squash merge of the 965-ttm branch, which had some history
I wanted to avoid pulling due to noisiness and brokenness at many points
for git-bisecting.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
f79360858d4c94629ef543a35e4e44a13419ac0e 08-Dec-2006 Xiang, Haihao <haihao.xiang@intel.com> fix bug#9237
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
759facb4d87843f6368fad9c5f20a5b1b3d95055 23-Oct-2006 Keith Whitwell <keith@tungstengraphics.com> Emit cliprects in the userspace driver as required, rather than
passing them to the kernel. This works because all drawing commands
in the 965 driver are emitted with the lock held and the batchbuffer
is always flushed prior to releasing the lock. This allows multiple
cliprects to be dealt with, without replaying entire batchbuffers and
redundantly re-emitting state.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
133f14168009393c5f396d218521625cb79b653f 07-Sep-2006 Keith Whitwell <keith@tungstengraphics.com> Make sure bmBufferOffset is called for all active buffers every time
we render. Currenly requires that some state be re-examined after
every LOCK_HARDWARE().
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c
9f344b3e7d6e23674dd4747faec253f103563b36 09-Aug-2006 Eric Anholt <anholt@FreeBSD.org> Add Intel i965G/Q DRI driver.

This driver comes from Tungsten Graphics, with a few further modifications by
Intel.
/external/mesa3d/src/mesa/drivers/dri/i965/brw_misc_state.c