aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx/nv04_2d.c
Commit message (Collapse)AuthorAgeFilesLines
* nouveau: fix includes for latest libdrmBen Skeggs2010-12-211-1/+1
| | | | Signed-off-by: Ben Skeggs <[email protected]>
* nvfx: move nv04_2d to rules-ng-ngLuca Barbieri2010-09-051-17/+20
|
* nvfx: move 2D format selection logic to 2D codeLuca Barbieri2010-09-041-20/+67
|
* nvfx: fix some subrectangle copiesLuca Barbieri2010-09-041-4/+6
| | | | | | Actually, we may want to get rid of the x/y coordinates for linear surfaces, and realign the origin from scratch if necessary, instead of doing this "on-demand realignment".
* nvfx: fix inlinining in nv04_2d.cLuca Barbieri2010-09-041-1/+1
|
* nvfx: Initialize variables on error path.Vinson Lee2010-08-241-0/+4
|
* nvfx: Silence unused variable warning.Vinson Lee2010-08-221-0/+1
| | | | The variable is used but only in the body of an assert.
* nvfx: Silence uninitialized variable warnings.Vinson Lee2010-08-211-4/+4
| | | | | | | | | Silence the following i686-apple-darwin10-gcc-4.2.1 warnings. nv04_2d.c: In function 'nv04_region_copy_cpu': nv04_2d.c:560: warning: 'dswy' may be used uninitialized in this function nv04_2d.c:559: warning: 'dswx' may be used uninitialized in this function nv04_2d.c:562: warning: 'sswy' may be used uninitialized in this function nv04_2d.c:561: warning: 'sswx' may be used uninitialized in this function
* nvfx: Fix SCons build.Vinson Lee2010-08-211-14/+30
| | | | | Move declarations before code. Fix void pointer arithmetic.
* nv04-nv40: new 2D: add new Gallium-independent 2D engineLuca Barbieri2010-08-211-0/+1320
This patch add a brand new nv04-nv40 2D engine module. It should correctly implement all operations involving swizzled, and 3D-swizzled surfaces. This code is independent from the Gallium framework and can thus be reused in the DDX and classic Mesa drivers (it's only likely to be useful in the latter, though). Currently, surface_copy and surface_fill are broken for 3D textures, for swizzled source textures and possibly for some misaligned cases The code is based around the new nv04_region structure, which encapsulates the information from pipe_surface needed for the 2D engine and CPU copies. The use of nv04_region makes the code independent of the Gallium framework and allows to transform the nv04_region without clobbering the nv04_region. The existing M2MF, blitter, and SWIZZLED_SURFACE paths have been improved and a new CPU path has been added. There is also support to tell the caller to use the 3D engine. The main feature of the copy/fill setup algorithm is linearization/contiguous-linearization of swizzled surfaces. The idea of linearization is that some swizzled surfaces are laid out like linear ones (1xN, 2xN, Nx1) and can thus be used as such (e.g. useful for copying single pixels). Also, some rectangles (e.g. the whole surface) are contiguous in memory. If both the source and destination rectangles are swizzled but contiguous, then they can be regarded as both linear: this is the idea of "contiguous linearization". This, for instance, allows to use the 2D engine to duplicate the content of a swizzled surface to another swizzled surface, by pretending they are actually linear. After linearization, the result may not be 64-byte aligned. Another transformation is done to enlarge the linear surface so that it becomes 64-byte aligned. This is also used to 64-byte align swizzled texture mipmaps. The inner loop of the CPU path is as optimized as possible without using SSE/SSE2. Future improvements could include SSE/SSE2 support, and possibly a faster coordinate swizzling algorithm (which is however not used in the inner loop). It may be a good idea to autogenerate swizzling code at least for all possible POT 2D texture dimensions (less than 256), maybe for all 3D ones too (less than 4096). Also, it woud be a very good idea to make a copy with the GPU first if the source surface is in uncached memory.