Commit Graph

89 Commits

Author SHA1 Message Date
Jerome Glisse 363dfb83f1 r600g: move chip class to radeon common structure
So texture code can be shared btw new state design
& old one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 11:59:20 -04:00
Dave Airlie d172ef3138 r600g: fix r700 cube map sizing.
this fixes fbo-cubemap on r700.
2010-09-20 15:30:52 +10:00
Dave Airlie 3a1defa5e8 r600g: add color/texture support for more depth formats. 2010-09-20 12:21:35 +10:00
Henri Verbeet affd46cc2b r600g: Buffer object maps imply a wait.
Unless e.g. PB_USAGE_DONTBLOCK or PB_USAGE_UNSYNCHRONIZED would be specified.
2010-09-19 19:43:05 +02:00
Henri Verbeet de9c8015eb r600g: Remove a redundant flush in r600_texture_transfer_map().
radeon_ws_bo_map() will already take care of that if needed.
2010-09-19 19:43:05 +02:00
Jerome Glisse fd266ec62c r600g: alternative command stream building from context
Winsys context build a list of register block a register block is
a set of consecutive register that will be emited together in the
same pm4 packet (the various r600_block* are there to provide basic
grouping that try to take advantage of states that are linked together)
Some consecutive register are emited each in a different block,
for instance the various cb[0-7]_base. At winsys context creation,
the list of block is created & an index into the list of block. So
to find into which block a register is in you simply use the register
offset and lookup the block index. Block are grouped together into
group which are the various pkt3 group of config, context, resource,

Pipe state build a list of register each state want to modify,
beside register value it also give a register mask so only subpart
of a register can be updated by a given pipe state (the oring is
in the winsys) There is no prebuild register list or define for
each pipe state. Once pipe state are built they are bound to
the winsys context.

Each of this functions will go through the list of register and
will find into which block each reg falls and will update the
value of the block with proper masking (vs/ps resource/constant
are specialized variant with somewhat limited capabilities).

Each block modified by r600_context_pipe_state_set* is marked as
dirty and we update a count of dwords needed to emit all dirty
state so far.

r600_context_pipe_state_set* should be call only when pipe context
change some of the state (thus when pipe bind state or set state)

Then to draw primitive you make a call to r600_context_draw
void r600_context_draw(struct r600_context *ctx, struct r600_draw *draw)
It will check if there is enough dwords in current cs buffer and
if not will flush. Once there is enough room it will copy packet
from dirty block and then add the draw packet3 to initiate the draw.

The flush will send the current cs, reset the count of dwords to
0 and remark all states that are enabled as dirty and recompute
the number of dwords needed to send the current context.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-17 10:49:05 -04:00
Dave Airlie 7c1fcc41be r600g: move constant buffer creation behind winsys abstraction.
this paves the way for moving to pb bufmgrs now.
2010-09-17 15:29:31 +10:00
Dave Airlie f70f79f6f6 r600g: attempt to abstract kernel bos from pipe driver.
introduce an abstraction layer between kernel bos and the winsys BOs.

this is to allow plugging in pb manager with minimal disruption to pipe driver.
2010-09-17 10:57:49 +10:00
Dave Airlie ef2808f56f r600g: fix texture bos and avoid doing depth blit on evergreen
since the depth blit code is hardcoded hex yay \o/
2010-09-16 21:48:02 +10:00
Dave Airlie 9a589961a2 r600g: fixup texture state on evergreen.
This whole set of state just seems wrong, another cut-n-paste nightmare.
2010-09-16 21:29:08 +10:00
John Doe e0b6df4fcc r600g: misc cleanup
Avoid using r600_screen structure to get ptr to radeon
winsys structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-15 11:48:34 -04:00
Tilman Sauerbeck ac2bddb9f2 r600g: Fixed a bo leak in r600_texture_from_handle().
We would leak bo if the argument check failed.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Dave Airlie 50526e094f r600g: add initial evergreen support
adds shader opcodes + assembler support (except ARL)
uses constant buffers
add interp instructions in fragment shader
adds all evergreen hw states
adds evergreen pm4 support.

this runs gears for me on my evergreen
2010-09-10 19:41:18 +10:00
Dave Airlie e8ff0f63b6 r600g: fix depth texture tests 2010-09-02 15:51:23 +10:00
Jerome Glisse 67234b4b42 r600g: refix db/cb state
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 18:05:52 -04:00
Jerome Glisse 66e4cb1cd5 r600g: avoid dynamic allocation of states
Make state statically allocated, this kills a bunch of code
and avoid intensive use of malloc/free. There is still a lot
of useless duplicate function wrapping that can be kill. This
doesn't improve yet performance, needs to avoid memcpy states
in radeon_ctx_set_draw and to avoid rebuilding vs_resources,
dsa, scissor, cb_cntl, ... states at each draw command.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 13:16:23 -04:00
Jerome Glisse 15ce70252c Revert "Revert "r600g: precompute some of the hw state""
This reverts commit 1fa7245c34.

Conflicts:

	src/gallium/drivers/r600/r600_state.c
2010-09-01 13:04:42 -04:00
Dave Airlie 1fa7245c34 Revert "r600g: precompute some of the hw state"
This reverts commit de0b76cab2, its pre-computes the texture state wrong,

you can't just use an array of levels, since you can have FBOs to depth texture slices inside a level as well
it would get really messy quickly. Probably need to split commits like this up into pieces for each piece
of state, so we can revert bits easier in case of regressions.

This also break 5 piglit tests, and valgrind starts to warn about invalid read/writes after this.
2010-09-01 14:56:04 +10:00
Jerome Glisse de0b76cab2 r600g: precompute some of the hw state
Idea is to build hw state at pipe state creation and
reuse them while keeping a non PM4 packet interface
btw winsys & pipe driver. This commit also force rebuild
of pm4 packet on each call to radeon_state_pm4 which
in turn slow down everythings, this will be addressed.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-30 15:00:55 -04:00
Dave Airlie 69c30f5d6d r600g: fixup states generation in winsys.
The current states code had an unhealthy relationship between
that had to somehow magically align themselves, editing either
place meant renumbering all states after the one you were on,
and it was pretty unapproachable code.

This replaces the huge types structures with a simple type + sub
type struct, which is keyed on an stype enum in radeon.h. Each
stype can have a per-shader type subclassing (4 types supported,
PS/VS/GS/FS), and also has a number of states per-subtype. So you
have 256 constants per 4 shaders per one CONSTANT stype.

The interface from the driver is changed to pass in the tuple,
(stype, id, shader_type), and we look for this. If
radeon_state_shader ever shows up on profile, it could use a
hashtable based on stype/shader_type to speed things up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-30 15:00:55 -04:00
Dave Airlie 2184f3ec30 Revert "r600g: simplify states"
This reverts commit bd25e23bf3.

Apart from introducing a lot of hex magic numbers and being highly impenetable code,
it causes lots of lockups on an average piglit run that always runs without lockups.

Always run piglit before/after doing big things like this.
2010-08-27 15:45:58 +10:00
Jerome Glisse bd25e23bf3 r600g: simplify states
Directly build PM4 packet, avoid using malloc (no states are
bigger than 128 dwords), remove unecessary informations,
remove pm4 building in favor of prebuild pm4 packet.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-25 17:41:50 -04:00
Jerome Glisse d843bbfd3f r600g: fix DB decompression
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-22 17:14:48 -04:00
Jerome Glisse ed99c28d12 r600g: depth buffer likely needs decompression when used as texture
Before using depth buffer as texture, it needs to be decompressed
(tile pattern of db are different from one used for colorbuffer
like texture)

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-22 14:26:05 -04:00
Jerome Glisse 36efb86c05 r600g: partialy fix texturing from depth buffer + initial support for untiling
Partialy fix texturing from depth buffer, depth buffer is tiled
following different tile organisation that color buffer. This
properly set the tile type & array mode field of texture sampler
when sampling from db resource.

Add initial support to untiling buffer when transfering them,
it's kind of broken by corruption the vertex buffer of previous
draw.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-21 22:52:38 -04:00
Luca Barbieri ae0ef6f69f gallium: make all checks for PIPE_TEXTURE_2D check for PIPE_TEXTURE_RECT too
Searched for them with:
git grep -E '[!=]=.*PIPE_TEXTURE_2D|PIPE_TEXTURE_2D.*[!=]=|case.*PIPE_TEXTURE_2D'

Behavior hasn't been changed.
2010-08-20 12:04:00 +02:00
Dave Airlie 03c59e4ab1 r600g: fixup pitch alignment like r600c.
This still needs work, passes tex3d, fbo-scissor-bitmap, scissor-bitmap
2010-08-18 12:49:59 +10:00
Dave Airlie edb465e9bb r600g: fix height calcs for miptree
h needs to be rounded up, this probably needs revisiting when we get
to tiling etc.

fixes fbo-generatemipmap-npot
2010-08-18 10:50:19 +10:00
Dave Airlie e2df0a8b23 r600g: improve texture format checker.
This takes the r300g texture format checker and fixes it up for r600g,
it passes glean texSwizzle, pixelformats, and texture_srgb tests,

however I think it L8S8_SRGB is broken as is L8_SRGB, need to investigate.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 16:20:31 +10:00
Dave Airlie 121a625c16 r600g: add bo wait after map. 2010-08-06 11:46:52 +10:00
Jerome Glisse 12dac449fb r600g: force flush on map as temporary fix to readpixel
Should allow more piglit test to pass. Need to plugin
proper flushing.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-04 16:29:56 -04:00
Vinson Lee 5fa1af0905 r600g: Remove unnecessary header. 2010-07-31 14:56:53 -07:00
Jerome Glisse 7a73390f91 r600g: mipmap early support + EX2/ABS instruction + culling
Add mipmap support (demos/src/redbook/mipmap is working)
Add EX2/ABS shader instruction support.
Add face culling support.

Misc fixes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-29 19:05:57 -04:00
Jerome Glisse 742ee7935d r600g: cleanup resource buffer/texture mess
Use a common function, fix the mess it was before.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 12:18:19 -04:00
Jerome Glisse 641c9adb09 r600g: texture support
Add texture mapping support, redbook/texbind works if
you comment out glClear and second checkboard. Need to
fix :
 - texture overwritting
 - lod & mip/map handling
 - unormalized coordinate handling
 - texture view with first leve > 0
 - and many other things

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-27 20:18:32 -04:00
Jakob Bornecrantz 92fde20de3 r600g: Move bootstrap code to target 2010-06-24 02:15:50 +02:00
Bas Nieuwenhuizen 9e8a6f801d r600g: various fixes
- enabled flushing a buffer more than once
- enabled the blitter for r600_clear
- added some more colors to r600_is_format_supported (copied from r600_conv_pipe_format)
- r600_set_framebuffer_state now sets rctx->fb_state
- more states are saved before a blit (had to add some accounting for the viewport and the vertex elements state)
- fixed a few errors with reference counting
2010-05-27 23:24:22 +02:00
Marek Olšák b8fb1d75ce r600g: adapt to latest interfaces changes
- Wrapped the buffer and texture create/destroy/transfer/... functions
  using u_resource, which is then used to implement the resource functions.
- Implemented texture transfers.
  I left the buffer and texture transfers separate because one day we'll
  need a special codepath for textures.
- Added index_bias to the draw_*elements functions.
- Removed nonexistent *REP and *FOR instructions.
- Some pipe formats have changed channel ordering, so I've removed/fixed
  nonexistent ones.
- Added stubs for create/set/destroy sampler views.
- Added a naive implementation of vertex elements state (new CSO).
- Reworked {texture,buffer}_{from,to}_handle.
- Reorganized winsys files, removed dri,egl,python directories.
- Added a new build target dri-r600.
2010-05-27 23:24:02 +02:00
Jerome Glisse 72128962d6 r600g: Initial import 2010-05-27 23:23:56 +02:00