Commit Graph

182 Commits

Author SHA1 Message Date
Michel Dänzer 7446a0407d gallium/radeon: Fix r300g tiling breakage.
Commit 11f056a3f0 broke the r300g build. Fix it
up, and reinstate some code which isn't needed by r600g and radeonsi but is
by r300g.
2012-05-16 23:52:19 +02:00
Michel Dänzer 11f056a3f0 r600g: Set tiling information for BOs being shared.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48747
2012-05-16 18:30:45 +02:00
Marek Olšák 0a6120244e winsys/radeon: simplify buffer map/unmap functions
The idea is not to use pb_map and pb_unmap wrappers, calling straight
into the winsys.
2012-04-29 14:46:52 +02:00
Marek Olšák a52b3338c6 u_vbuf: remove u_vbuf_resource 2012-04-24 01:39:21 +02:00
Christian König fb016854bc r600g: add support for subsampled rgb formats
v2: r600 formats are msb first!

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:43:49 +01:00
Marek Olšák 330b6c85c9 r600g: cleanup includes 2012-03-05 15:57:32 +01:00
Marek Olšák 0d91ddf1d4 r600g: don't enable tiling for STAGING and STREAM usage cases
Reviewed by: Christian König <christian.koenig@amd.com>
2012-03-05 14:55:46 +01:00
Marek Olšák 29e55bc5f1 winsys/radeon: add usage parameter to cs_is_buffer_referenced
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák 515a64a28c r600g: permit blitting between textures with STREAM and STAGING usage
Eventually I'd like to make every format blittable, so that the function
can go away.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák 370c8b5ee7 r600g: remove obsolete todo comments
Also use XXX in the other ones, because it's the most used word for that
purpose in Mesa.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák 62f44f670b Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"
This reverts commit 0950086376.

It was decided to refactor the transfer API instead of adding workarounds
to address the performance issues.
2012-03-05 13:47:49 +01:00
Marek Olšák bf4fedcef3 r600g: use u_default_transfer_flush_region for all resource types 2012-02-27 16:22:40 +01:00
Marek Olšák ab13288821 r600g: use u_default_transfer_inline_write for all resource types 2012-02-27 16:22:34 +01:00
Marek Olšák 897af1d499 r600g: cleanup r600_transfer_struct
Especially rename staging_texture to staging and change its type
to r600_resource. I will reuse it for buffers later.
2012-02-27 02:03:24 +01:00
Marek Olšák b85fc0ac7e r600g: move initialization of use_surface flag into screen_create
Also change the type to bool and give it a less ambiguous name.
2012-02-27 02:03:23 +01:00
Marek Olšák 81c0484862 r600g: properly check whether texture is busy in get_transfer 2012-02-27 02:03:23 +01:00
Marek Olšák d334d591a7 r600g: rename r600_resource_texture::depth to bool is_depth
It's used as a boolean.
2012-02-27 02:03:23 +01:00
Marek Olšák 85571ed53c r600g: remove unused variable 2012-02-14 15:49:24 +01:00
Jerome Glisse c0c979eebc r600g: add support for common surface allocator for tiling v13
Tiled surface have all kind of alignment constraint that needs to
be met. Instead of having all this code duplicated btw ddx and
mesa use common code in libdrm_radeon this also ensure that both
ddx and mesa compute those alignment in the same way.

v2 fix evergreen
v3 fix compressed texture and workaround cube texture issue by
   disabling 2D array mode for cubemap (need to check if r7xx and
   newer are also affected by the issue)
v4 fix texture array
v5 fix evergreen and newer, split surface values computation from
   mipmap tree generation so that we can get them directly from the
   ddx
v6 final fix to evergreen tile split value
v7 fix mipmap offset to avoid to use random value, use color view
   depth view to address different layer as hardware is doing some
   magic rotation depending on the layer
v8 fix COLOR_VIEW on r6xx for linear array mode, use COLOR_VIEW on
   evergreen, align bytes per pixel to a multiple of a dword
v9 fix handling of stencil on evergreen, half fix for compressed
   texture
v10 fix evergreen compressed texture proper support for stencil
    tile split. Fix stencil issue when array mode was clear by
    the kernel, always program stencil bo. On evergreen depth
    buffer bo need to be big enough to hold depth buffer + stencil
    buffer as even with stencil disabled things get written there.
v11 rebase on top of mesa, fix pitch issue with 1d surface on evergreen,
    old ddx overestimate those. Fix linear case when pitch*height < 64.
    Fix r300g.
v12 Fix linear case when pitch*height < 64 for old path, adapt to
    libdrm API change
v13 add libdrm check

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-06 18:36:37 -05:00
Marek Olšák e4340c1908 r600g: merge r600_context with r600_pipe_context
The split made no sense.
2012-01-31 23:12:30 +01:00
Dave Airlie a9d8809f16 r600g: srgb mode is only valid on certain format types.
"If set, forces degamma on XYZ if format is
FMT_8_8_8_8, FMT_BC1, FMT_BC2, or FMT_BC3"

Don't claim support for sRGB on any other formts.

This fixes glean texture_srgb.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 16:53:46 +00:00
Marek Olšák 0950086376 gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY
Please see the diff for further info.

This paves the way for moving user buffer uploads out of drivers and should
allow to clean up the mess in u_upload_mgr in the meantime.

For now only allowed for buffers on r300 and r600.

Acked-by: Christian König <deathsimple@vodafone.de>
2012-01-05 18:29:11 +01:00
Marek Olšák 93f4e3cb6c winsys/radeon: move managing GEM domains back to drivers
This partially reverts commit 363ff84475.

It caused severe performance drops in Nexuiz. Reported by Phoronix.

Tested by me on r300g and by IRC people on r600g.
2011-12-24 21:28:43 +01:00
Dave Airlie d38768fe38 r600g: add int support for 2/10/10/10 format.
integer wasn't set properly for the non-uniform types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 19:32:05 +00:00
Vadim Girlin d5e91a2364 r600g: fix stencil buffer ref counting on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:25:16 -05:00
Marek Olšák dbd24b5df6 r600g: remove useless texture barrier 2011-11-10 18:49:26 +01:00
Mathias Fröhlich e8139ebf58 r600g: Replace needless flush in texture upload.
Replace pipe->flush() with pipe->texture_barrier() in
the texture upload path for the staging texture.
This should be enough to get data out of the gpu
caches ready to be read for texture fetch.
2011-10-29 18:36:42 +02:00
Dave Airlie 866f9b18c6 gallium: rename ZS stencil type to UINT (v2)
these are never USCALED, always UINT in reality.

taken from some work by Christoph Bumiller

v2: fixup formatting of table + tabs

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-11 16:13:29 +01:00
Dave Airlie 0110aa09e5 r600g/eg: add integer types support
adds handling for int texture/vertices to evergreen.

TODO r600/700 support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:06:18 +01:00
Marek Olšák 363ff84475 winsys/radeon: move GEM domains out of the drivers into winsys
The drivers don't need to care about the domains. All they need to set
are the bind and usage flags. This simplifies the winsys too.

This also fixes on r600g:
- fbo-depth-GL_DEPTH_COMPONENT32F-copypixels
- fbo-depth-GL_DEPTH_COMPONENT16-copypixels
- fbo-depth-GL_DEPTH_COMPONENT24-copypixels
- fbo-depth-GL_DEPTH_COMPONENT32-copypixels
- fbo-depth-GL_DEPTH24_STENCIL8-copypixels
I can't explain it.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák af8eb5c851 winsys/radeon: remove a redundant parameter 'size' from buffer_from_handle
It's part of pb_buffer already.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák 518557d74a r600g: move family and chip_class from struct radeon to r600_screen
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák 6101b6d442 r600g: merge r600_bo with r600_resource
I have moved 'last_flush' and 'binding' from r600_bo to winsys/radeon.
The other members are now part of r600_resource.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Dave Airlie f2bae9456f r600g: interpret integer texture types as ints.
For signed/unsigned with no normalisation or srgb, assume its an INT
type texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:26:57 +01:00
Marek Olšák 1a532ca79a r600g: inline some of the winsys r600_get functions 2011-09-12 22:03:03 +02:00
Marek Olšák 3603d15788 r600g: compute tiling info in the pipe, not in the winsys
The winsys doesn't need it.
2011-09-12 22:03:02 +02:00
Marek Olšák 840ad139af r600g: always decompress all mipmaps and layers, slices, or faces of zbuffers
This fixes piglit/fbo-depth-array.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-10 08:53:29 +02:00
Christian König 8f4ec55f77 r600g: Make unaligned 3D textures work on +evergreen
The layersize calculation is slightly different on +evergreen.
This makes mpeg2 video decoding and piglits texture-packed-formats
test work correctly on this hardware.
2011-08-30 15:33:51 +02:00
Kai Wasserbäch 8fb7f1a8a4 r600g: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Michel Dänzer 702838a706 r600g: Handle PIPE_TRANSFER_MAP_DIRECTLY.
If the state tracker tries to map the resource directly but we can't or don't
want to do that, fail to create a transfer.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-26 18:21:18 +02:00
Marek Olšák db71537f01 r600g: don't allocate separate depth and stencil for transfer textures on EG
The state tracker expects depth and stencil pixels interleaved.
Evergreen can bind an interleaved depth-stencil resource as a colorbuffer,
but not as a zbuffer.

The hardware can do the interleaving for us when decompressing.
2011-08-19 23:12:15 +02:00
Marek Olšák 751a6ed893 r600g: hack around a problem with texture alignment 2011-08-19 23:12:11 +02:00
Marek Olšák 98a87a594b r600g: simplify the conditionals determining array mode 2011-08-19 23:12:11 +02:00
Marek Olšák 7f29824fd5 r600g: put depth and stencil into one backing buffer
For DRI2 sharing.
2011-08-19 23:12:11 +02:00
Marek Olšák 68c54abb2c r600g: fix depth-stencil on evergreen
Such that it actually works in apps which use both.

A separate buffer is allocated for stencil. The only exception is
the window-system-provided depth-stencil buffer, where depth and stencil
share the same buffer.

This fixes:
- fbo-depthstencil-GL_DEPTH24_STENCIL8-clear
- fbo-depthstencil-GL_DEPTH24_STENCIL8-drawpixels-FLOAT-and-USHORT
- fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8
- fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-FLOAT-and-USHORT
2011-08-19 23:12:11 +02:00
Marek Olšák c79e9f0ed5 r600g: enable thread offloading
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 041ed559e1 r600g: remove an unused parameter from r600_bo_destroy
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák ab630b5768 r600g: use buffer_map/unmap from radeon_winsys
This also drops the unneeded bo_busy/wait functions.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák 2ce783d8dd r600g: put radeon_winsys in screen::winsys, don't include drm_driver in the pipe
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák be7407b75b gallium/util: add functions for manipulating swizzles
Some of those have been in drivers already.
2011-08-02 18:49:30 +02:00