Commit Graph

48165 Commits

Author SHA1 Message Date
Paul Berry 43e39b58c7 i965 gen6: Allocate URB space for GS
When the GS is not in use, the entire URB space is available for the
VS.  When the GS is in use, we split the URB space 50/50.

The 50/50 split is probably not optimal--we'll probably want tune this
for performance in a future patch.  For example, in most situations,
it's probably worth allocating more than 50% of the space to the VS,
since VS space is used for vertex caching.  But for now this is good
enough.

Based on previous work by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 16:38:01 -08:00
Kenneth Graunke 7a63a311e5 i965: Set the maximum number of GS URB entries on Sandybridge.
We never filled this in before because we didn't care.

I'm skeptical these are correct; my sources indicate that both the VS
and GS # of entries are 256 on both GT1 and GT2.

I'm also loathe to change it and break stuff.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-07 16:38:00 -08:00
Paul Berry dabe15da4f i965: Only convert if/else to conditional adds prior to Gen6.
Normally when outputting instructions in SPF (single program flow)
mode, we convert IF and ELSE instructions to conditional ADD
instructions applied to the IP register.  On platforms prior to Gen6,
flow control instructions cause an implied thread switch, so this is a
significant savings.

However, according to the SandyBridge PRM (Volume 4 part 2, p79):

   [Errata DevSNB{WA}] - When SPF is ON, IP may not be updated by
   non-flow control instructions.

So we have to disable this optimization on Gen6.

On later platforms, there is no significant benefit to converting flow
control instructions to ADDs, so for the sake of consistency, this
patch disables the optimization on later platforms too.

The reason we never noticed this problem before is that so far we
haven't needed to use SPF mode on Gen6.  However, later patches in
this series will introduce a Gen6 GS program which uses SPF mode.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07 16:38:00 -08:00
Paul Berry fcae281f06 i965 gs: Remove unnecessary mapping of key->primitive.
Previously, GS generation code contained a lookup table that mapped
primitive types POLYGON, TRISTRIP, and TRIFAN to TRILIST, mapped
LINESTRIP to LINELIST, and left all other primitives unchanged.  This
was silly, because we never generate a GS program for those primitive
types anyhow.

This patch removes the unnecessary lookup table.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07 16:38:00 -08:00
Paul Berry a98ceee0ee mesa: Track changes to transform feedback state.
This patch adds a new bit to the ctx->NewState bitfield,
_NEW_TRANSFORM_FEEDBACK, to track state changes that affect
ctx->TransformFeedback.  This bit can be used by driver back-ends to
avoid expensive recomputations when transform feedback state has not
been modified.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 16:38:00 -08:00
Aaron Plattner 63a6fd6603 glx: Fix indirect fallback when a non-Mesa GLX extension is present.
When driCreateScreen calls driConvertConfigs to try to convert the
configs for swrast, it fails and returns NULL.  Instead of checking,
it just clobbers psc->base.configs.  Then, when the application asks
for the FBconfigs, there aren't any.

Instead, make the caller responsible for freeing the old modes lists
if both calls to driConvertConfigs succeed.

Without the second fix, glxinfo fails unless you run it with
LIBGL_ALWAYS_INDIRECT:

    $ glxinfo
    name of display: :0.0
    Error: couldn't find RGB GLX visual or fbconfig

    $ LIBGL_ALWAYS_INDIRECT=1 glxinfo
    name of display: :0.0
    display: :0  screen: 0
    direct rendering: No (LIBGL_ALWAYS_INDIRECT set)
    server glx vendor string: NVIDIA Corporation
    server glx version string: 1.4
    [...]

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-07 17:20:10 -07:00
Anuj Phogat 4558987818 glsl: Fix samplerCubeShadow support in shader compiler
This patch fixes the samplerCubeShadow support in GLSL shader compiler.
shader compiler was picking the 'r' texture coordinate for shadow comparison
when the expected behaviour is to use 'q' texture coordinate in case of cube
shadow maps.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-07 15:11:29 -08:00
Kenneth Graunke 4273943a07 i965: Set Ivybridge's is_array SURFACE_STATE bit.
Fixes piglit tests fbo-array, fbo-depth-array, fbo-generatemipmap-array,
and array-texture, as well as the array variants of my new textureSize
and texelFetch tests.

Not a candidate for 7.11 because EXT_texture_array wasn't supported.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 14:51:12 -08:00
Kenneth Graunke d464a21e2d 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>
2011-12-07 14:51:12 -08:00
Eric Anholt 5b27e44652 intel: Update comment about how depth/stencil miptrees are handled.
This evolved over several commits, and I also wanted to document some
new information about how we handle formats.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:38:54 -08:00
Eric Anholt 96159c37e3 intel: Rely on miptree mapping for all renderbuffer maps.
Now that all RBs have miptrees, and miptree mapping covered these last
two code paths, consistently use them.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:38:54 -08:00
Eric Anholt 5655ebf466 intel: Add support for LLC-cached reads of X-tiled miptrees using a blit.
This mimics the MapRenderbuffer code, and should improve the
performance of glGetTexImage().

v2: Fix broken error handling.
2011-12-07 13:38:53 -08:00
Eric Anholt 2d2bfd1f26 intel: Handle MapRenderbuffer of fake packed depth/stencil using miptree maps.
This gets the same performance win as the miptree maps did, and
removes a pile of code duplication.
2011-12-07 13:38:53 -08:00
Eric Anholt e0d67a3a8b intel: Track miptrees for fake packed depth/stencil renderbuffers.
Right now the fake packed d/s RBs are creating two sub-renderbuffers
with their own storage, and the hardware setup and the mapping code
have been explicitly referencing them.  By setting miptrees on them,
we'll be able to make our renderbuffer code for fake packed
depth/stencil more consistent with all our other renderbuffers.

The interesting new behavior here is that there is now a mt with a
non-depthstencil format (X8Z24) that has a stencil_mt field
associated.  This looks like it should be safe, and we'll need to be
able to do this for floating point depth/stencil as well.
2011-12-07 13:38:51 -08:00
Eric Anholt ed3aeb56ec intel: Make the fake packed depth/stencil mappings use a cached temporary.
Before, we had an uncached read of S8 to untile, then a RMW (so
uncached penalty) of the packed S8Z24 to store the value, then the
consumer would uncached read that once per pixel.  If data was written
to the map, we would then have to uncached read the written data back
out and do the scatter to the tiled S8 buffer (also uncached access
penalties, since WC couldn't actually combine).  So 3 or 5 uncached
accesses per pixel in the ROI (and we we were ignoring the ROI, so it
was the whole image).

Now we get an uncached read of S8 to untile, and an uncached read of
Z.  The consumer gets to do cached accesses.  Then if data was
written, we do streaming Z writes (WC success), and scattered S8
tiling writes (uncached penalty).  So 2 or 3 uncached accesses per
pixel in the ROI.

This should be a performance win, to the extent that anybody is doing
software accesses of packed depth/stencil buffers.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:38:08 -08:00
Eric Anholt 4cb1d6a25e intel: Make intel_region_map return void *.
We don't gripe about void * arithmetic for our driver, and this
prevents silly casting when assigning the result of mapping to
non-byte types.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt b48c3bca87 intel: Move separate-stencil s8 mapping logic to intel_miptree_map.
We're going to want to reuse this logic in mapping of fake packed
miptrees wrapping separate depth/stencil miptrees.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt baeaa062e9 intel: Move the gtt-particular texture mapping logic to a helper function.
This code will be incrementally moving to a model like intel_fbo.c's
renderbuffer mapping with helper functions, as I move that code here.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt 221a36514b intel: Make mapping of texture slices track the region of interest.
This will be used for things like packed depth/stencil temporaries and
making LLC-cached temporary mappings using blits.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt b75291c61c intel: Move the teximage mapping logic to a miptree level/slice mapping.
This will let us share teximage mapping logic with renderbuffer
mapping, which has an intel_mipmap_tree but not a gl_texture_image.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt 5c9a55665d intel: Only prefer separate stencil when we can do HiZ.
This required is_hiz_depth_format to start returning true on S8_Z24 as
well, since that's the format we have here.  The two previous callers
are only calling it on non-depthstencil formats.

This avoids us needing to have HiZ working on a new Z format
immediately upon exposing the format (particularly painful for
Z32_FLOAT_X24S8, which means all the fake packed depth/stencil paths).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Thomas Hellstrom 576161289d st/dri: Use depth instead of bpp when communicating formats with the X server v3
Some hardware can't reinterpret the format of hardware buffers and thus
the X server needs to know the format when the buffer is created.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Daenzer <michel@daenzer.net>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-12-07 20:05:24 +01:00
Kenneth Graunke 6781fd05e9 i965: Set SURFACE_STATE vertical alignment bit on Ivybridge.
See intel_vertical_texture_alignment_unit() in intel_tex_layout.c;
certain surface types require setting this to VALIGN_4.

Analogous to commit dd0e46c410 on Gen6.

Fixes piglit test fbo-generatemipmap-formats with the
GL_ARB_depth_texture and GL_EXT_packed_depth_stencil arguments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-06 15:14:56 -08:00
Patrice Mandin 9419894835 nouveau/nvfx: Add more unsupported PIPE_CAP values
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2011-12-06 21:42:31 +01:00
Dave Airlie 2ee8704a8a radeon: add original r100 to the always tiled depth list.
According to Alex, he thinks r100 is also covered.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 16:10:43 +00:00
Fabio Pedretti 9ab43f7454 vega: remove unused vars
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-06 08:44:07 -07:00
Fabio Pedretti 0b34074bdb osmesa: remove unused bpc variable
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-06 08:42:54 -07:00
Dave Airlie 781a204bcf radeon/r200: add RV200 detiling + add an always tiled flag
passes readpix sanity on the M7.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 15:12:00 +00:00
Dave Airlie 1136da9c6b r200: add Z16 depth detiling.
This passes readPixSanity with z16 visuals.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 15:11:36 +00:00
Dave Airlie 61a40581d2 r200: handle Z24 depth buffers correctly
The same detiling pattern applies to X8_Z24 as well.

Signed-off-by: Dave Airlie <Airlied@redhat.com>
2011-12-06 15:11:36 +00:00
Vadim Girlin e98521e0f3 r600g: check shaders presence in r600_draw_vbo
This patch should prevent the crashes when some shaders are absent,
see https://bugs.freedesktop.org/show_bug.cgi?id=43341

Note this is a candidate for the stable branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-12-06 09:53:35 -05:00
Dave Airlie 81a715605a r200: fix cb microtile setup
We shouldn't see this in buffers from the DDX but just in case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 10:34:16 +00:00
Dave Airlie 4d4cecd05b r200: enable tiling flags on blitter setup.
The r200 blitter also didn't set the correct tiling flags.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 10:34:16 +00:00
Anuj Phogat c3aae7745a swrast: Add depth cube map support.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-05 17:02:13 -08:00
Anuj Phogat 29a7d7784d mesa: Allow glTexImage2D with a depth component cube map.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-05 17:02:05 -08:00
Kenneth Graunke 84d6201567 i965: Fix incorrect comment about single program flow on Ironlake.
The code forces single program flow to be enabled on Ironlake, or
equivalently, disables multiple program flow.  The comment was reversed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-05 17:00:07 -08:00
Jerome Glisse e368eefc68 r600g: fix error path and use util_slab_free
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-12-05 18:42:38 -05:00
Jerome Glisse bbc320a94d gallium/radeon: fix indentation
Indentation cleanup, to keep consistency.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-12-05 18:40:53 -05:00
Dave Airlie a8bbbcae4a radeon/r200: drop old span depth/stencil code.
This is no longer used with the new renderbuffer code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 19:15:52 +00:00
Dave Airlie 7d91ecf7a3 radeon/r200: add draw/stencil buffer detiling
This moves the detiling to the fbo mapping, r200 depth is always tiled,
and we can't detile it with the blitter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 19:15:04 +00:00
Dave Airlie c48763643e radeon: fix warnings 2011-12-05 16:51:03 +00:00
Dave Airlie f24e106ead radeon: use mesa renderbuffer accessors for depth for now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 16:25:27 +00:00
Dave Airlie 5c666bdfdb radeon: add some tiling support for r100.
This sets up the tiling flags on the blitter.

Fixes some piglit tests with tiling enabled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 15:41:24 +00:00
Dave Airlie b2596c36c8 radeon: texture/renderbuffer overhaul.
This could have been split up better, but the driver is just broken now,
so bisecting the brokenness is going to be painful no matter what.

This adds renderbuffer mapping/unmapping along with texture image allocation.
It drops all the old texture upload paths, some of which could possible be
reimplemented with the blitter later.

It also redoes the span code paths to use its own set of image mapping handlers,
along with removing the tiling decode paths for the color buffers, since
we now hope to use the blitter for this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 14:36:19 +00:00
Dave Airlie fd7fcfcc2d radeon: set texture bits to always emit.
I think there is a missing state update or flush somewhere, and every
so often PP_CNTL goes to the kernel with a texture enabled but no texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Dave Airlie 4ed8a58584 radeon: update flush according to glXMakeCurrent man page
This also copies code from intel driver to do this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Dave Airlie 6d573c4dd7 radeon: drop border check
now that we strip borders off earlier.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Dave Airlie fbfa807034 radeon: add a bit more debugging to the blit debug code.
For debugging blits it helps if we printed out the offsets as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Eric Anholt 887c349d54 mesa: Reject glDrawPixels(integer format).
When folding GL_EXT_texture_integer into the core, a new (and very
sensible) restriction was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-04 14:54:16 -08:00
Brian Paul 1bb59b382a util: add casts in fprintf() calls to silence warnings
And wrap to 80 columns.
2011-12-03 09:31:45 -07:00