Jakob Bornecrantz
f8f3baa43a
wrapper: Fix spelling
2010-10-15 19:13:00 +01:00
Keith Whitwell
cbf2fb5543
r600/drm: fix segfaults in winsys create failure path
...
Would try to destroy radeon->cman, radeon->kman both which were still
NULL.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-10-15 08:33:00 +10:00
Vinson Lee
3b16c591a4
r600g: Silence uninitialized variable warning.
2010-10-08 14:17:14 -07:00
Vinson Lee
36b65a373a
r600g: Silence uninitialized variable warning.
2010-10-08 14:14:16 -07:00
Vinson Lee
131485efae
r600g: Silence uninitialized variable warning.
2010-10-08 14:08:50 -07:00
Vinson Lee
1f01f5cfcf
r600g: Remove unnecessary header.
2010-10-08 04:56:49 -07:00
Jerome Glisse
3fabd218a0
r600g: fix dirty state handling
...
Avoid having object ending up in dead list of dirty object.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-06 13:01:31 -04:00
Jerome Glisse
1644bb0f40
r600g: avoid segfault due to unintialized list pointer
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-06 09:41:19 -04:00
Jerome Glisse
ea5a74fb58
r600g: userspace fence to avoid kernel call for testing bo busy status
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 17:04:25 -04:00
Jerome Glisse
2cf3199ee3
r600g: simplify block relocation
...
Since flush rework there could be only one relocation per
register in a block.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 15:23:07 -04:00
Bas Nieuwenhuizen
ac8a1ebe55
r600g: use dirty list to track dirty blocks
...
Got a speed up by tracking the dirty blocks in a seperate list instead of looping through all blocks. This version should work with block that get their dirty state disabled again and I added a dirty check during the flush as some blocks were already dirty.
2010-10-05 15:16:06 -04:00
Jerome Glisse
585e4098aa
r600g: improve bo flushing
...
Flush read cache before writting register. Track flushing inside
of a same cs and avoid reflushing same bo if not necessary. Allmost
properly force flush if bo rendered too and then use as a texture
in same cs (missing pipeline flush dunno if it's needed or not).
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 10:43:23 -04:00
Jerome Glisse
12d16e5f14
r600g: store reloc information in bo structure
...
Allow fast lookup of relocation information & id which
was a CPU time consumming operation.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-05 10:42:56 -04:00
Dave Airlie
12be1568d0
r600g: avoid unneeded bo wait
...
if we know the bo has gone not busy, no need to add another bo wait
thanks to Andre (taiu) on irc for pointing this out.
2010-10-05 16:00:48 +10:00
Dave Airlie
d2c06b5037
r600g: drop use_mem_constant.
...
since we plan on using dx10 constant buffers everywhere.
2010-10-05 16:00:23 +10:00
Dave Airlie
46997d4fc2
r600g: drop mman allocator
...
we don't use this since constant buffers are now being used on all gpus.
2010-10-05 15:57:57 +10:00
Dave Airlie
05813ad5f4
r600g: add bo busy backoff.
...
When we go to do a lot of bos in one draw like constant bufs we need
to avoid bouncing off the busy ioctl, this mitigates by backing off
on busy bos for a short amount of times.
2010-10-05 15:51:38 +10:00
Dave Airlie
3c38e4f138
r600g: add bo fenced list.
...
this just keeps a list of bos submitted together, and uses them to decide
bo busy state for the whole group.
2010-10-05 15:35:52 +10:00
Vinson Lee
a0a8e24385
r600g: Fix SCons build.
2010-10-04 15:56:55 -07:00
Jerome Glisse
b25c52201b
r600g: remove dead label & fix indentation
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
243d6ea609
r600g: rename radeon_ws_bo to r600_bo
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
674452faf9
r600g: use r600_bo for relocation argument, simplify code
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
d22a1247d8
r600g: allow r600_bo to be a sub allocation of a big bo
...
Add bo offset everywhere needed if r600_bo is ever a sub bo
of a bigger bo.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Jerome Glisse
294c9fce1b
r600g: rename radeon_ws_bo to r600_bo
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-10-04 17:25:19 -04:00
Dave Airlie
3d45d57044
r600g: TODO domain management
...
no wonder it was slow, the code is deliberately forcing stuff into GTT,
we used to have domain management but it seems to have disappeared.
2010-10-04 16:41:49 +10:00
Dave Airlie
1c2b3cb1e9
r600g: fix wwarning in bo_map function
2010-10-04 16:26:46 +10:00
Dave Airlie
92aba9c1f5
r600g: break out of search for reloc bo after finding it.
...
this function was taking quite a lot of pointless CPU.
2010-10-04 15:58:39 +10:00
Dave Airlie
738aa29289
r600g: setup basic loop consts on r600 + evergreen.
...
this sets up a single loop constant like r600c does.
2010-10-01 16:06:31 +10:00
Dave Airlie
539a2978ed
r600g: flush SH cache on constant change on evergreen
2010-10-01 14:43:02 +10:00
Dave Airlie
b67aa5311f
r600g: fix evergreen draw-buffers
...
just a typo in the register headers.
2010-10-01 14:24:14 +10:00
Dave Airlie
14c95bb4ee
r600g: add cb flushing for extra buffers + depth buffer on r600/evergreen
2010-10-01 14:05:02 +10:00
Dave Airlie
ac225c76a6
r600g: sync vertex/texture cache on resources on evergreen
...
this gets rid of lots of the instability on evergreen,
which isn't surprising since it really broken not to flush caches.
2010-10-01 14:04:32 +10:00
Dave Airlie
5eccdc62b9
r600g: add reloc for evergreen color attrib
...
we'll need this for color tiling on evergreen.
2010-10-01 10:52:09 +10:00
Dave Airlie
05d1d86907
r600g: add winsys support for CTL constants.
...
These need to be emitted, we also need them to do proper vtx start,
instead of abusing index offset.
2010-10-01 10:30:16 +10:00
Dave Airlie
7ae4da8056
r600g: use Elements macro instead of manual sizeofs
2010-10-01 10:17:20 +10:00
John Doe
40181aef60
r600g: keep a mapping around for each bo
...
Save a lot of call into the kernel and thus improve performances.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 17:53:36 -04:00
John Doe
dde1391cc9
r600g: don't double count dirty block
...
This avoid to overcount the number of dwords we need and
thus avoid maximazation of cs buffer use.
Signed-off-by: Jerome Glisse <jglisse@redhat.com
2010-09-30 17:38:18 -04:00
Jerome Glisse
113f1cdfce
evergreeng: avoid overlapping border color btw VS & PS
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 17:07:28 -04:00
Jerome Glisse
153105cfbf
r600g: use constant buffer instead of register for constant
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-30 13:47:29 -04:00
Nicolas Kaiser
3f28dbd9bb
gallium/winsys: remove duplicated include
...
Remove duplicated include.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:23 -06:00
Dave Airlie
dbcd652602
r600g: clean up some code from move to new paths.
...
mainly remove 2 suffix from function names
2010-09-30 09:12:57 +10:00
Vinson Lee
38c31de445
r600g: Fix SCons build.
2010-09-29 13:14:34 -07:00
Jerome Glisse
6abd7771c6
r600g: more cleanup
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29 15:40:32 -04:00
Vinson Lee
7e536371f9
r600g: Update SConscript.
...
Fixes SCons build.
2010-09-29 12:16:39 -07:00
Jerome Glisse
1235becaa1
r600g: cleanup
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29 15:06:04 -04:00
Jerome Glisse
9c284b5cae
r600g: delete old path
...
Lot of clean can now happen.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29 14:28:48 -04:00
Jerome Glisse
5646964b13
r600g: use a hash table instead of group
...
Instead of creating group of register use a hash table
to lookup into which block each register belongs. This
simplify code a bit.
Signed-off-by: Jerome Glisse <jglisse@redhat.com
2010-09-29 12:44:32 -04:00
Dave Airlie
301ab49605
r600g: move radeon.h members around to add back map flushing.
2010-09-29 09:19:22 +10:00
Jerome Glisse
fe790a3c34
r600g: suspend/resume occlusion query around clear/copy
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-28 14:24:18 -04:00
Jerome Glisse
0282682e98
r600g: fix occlusion query after change to block structure
...
block->reg point to register value not block->pm4 which point
to packet.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 17:00:07 -04:00
Jerome Glisse
1617daaf49
r600g: fix pointsprite & resource unbinding
...
When asking to bind NULL resource assume it's unbinding
so free resource and unreference assoicated buffer.
Also fix pointsprite parameter.
Fix glsl-fs-pointcoord & fp-fragment-position
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 15:00:17 -04:00
Jerome Glisse
99c422ef5a
r600g: build packet header once
...
Build packet header once and allow to add fake register support so
we can handle things like indexed set of register (evergreen sampler
border registers for instance.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-27 11:53:34 -04:00
Dave Airlie
7eab5ef425
r600g: add evergreen texture resource properly.
...
adding sampler border looks impossible with current design, another day, another corner case not worked out.
2010-09-27 14:35:41 +10:00
Joakim Sindholt
16baa465a2
radeong: fix leaks
2010-09-26 19:39:05 +02:00
Jerome Glisse
a852615946
r600g: disable early cull optimization when occlusion query running
...
When occlusion query are running we want to have accurate
fragment count thus disable any early culling optimization
GPU has.
Based on work from Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-26 12:06:46 -04:00
Vinson Lee
6f16e497af
r600g: Include p_compiler.h instead of malloc.h.
2010-09-26 03:23:31 -07:00
Vinson Lee
15f16328be
r600g: Remove unused variables.
...
Fixes these GCC warnings.
radeon.c: In function 'radeon_new':
radeon.c:59: warning: unused variable 'k'
radeon.c:59: warning: unused variable 'j'
radeon.c:59: warning: unused variable 'id'
radeon.c:59: warning: unused variable 'i'
2010-09-26 03:18:12 -07:00
Vinson Lee
51bfd4e34a
r600g: Don't return a value in function returning void.
...
Fixes this GCC warning.
radeon_state.c: In function 'radeon_state_fini':
radeon_state.c:140: warning: 'return' with a value, in function returning void
2010-09-26 03:10:58 -07:00
Vinson Lee
048bda175b
r600g: Remove unused variable.
...
Fixes this GCC warning.
radeon_bo_pb.c: In function 'radeon_bo_pb_create_buffer':
radeon_bo_pb.c:178: warning: unused variable 'domain'
2010-09-25 15:19:29 -07:00
Dave Airlie
b6469a8dc7
r600g: add eg db count control register.
2010-09-25 22:14:08 +10:00
Jerome Glisse
6613605d79
r600g: bring over fix from old path to new path
...
Up to 2010-09-19:
r600g: fix tiling support for ddx supplied buffers
9b146eae25
user buffer seems to be broken... new to fix that.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 17:33:30 -04:00
Jerome Glisse
3ad4486bfe
r600g: fix evergreen new path
...
glxgears seems to work, had somelockup but now they seems to have vanish.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 16:17:28 -04:00
Jerome Glisse
ba7e6ccc95
r600g: fix evergreen new path
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 15:02:33 -04:00
Jerome Glisse
eff1af65af
r600g: evergreen fix for new design
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:41:01 -04:00
Jerome Glisse
cb3aed80db
r600g: move use_mem_constants flags for new designs structure alignment
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:41:01 -04:00
Jerome Glisse
3672bc14af
r600g: fix typo in evergreen define (resource are in [0x30000;0x34000] range)
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-24 10:41:01 -04:00
Marek Olšák
a333485386
r300g: make accessing map_list and buffer_handles thread-safe
...
NOTE: This is a candidate for the 7.9 branch.
2010-09-24 02:29:05 +02:00
Marek Olšák
206d92912c
r300g: fixup long-lived BO maps being incorrectly unmapped when flushing
...
Based on commit 3ddc714b20
by Dave Airlie.
NOTE: This is a candidate for the 7.9 branch.
2010-09-24 02:29:04 +02:00
Jerome Glisse
b360c050b6
r600g: initial evergreen support in new path
...
This doesn't work yet.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-23 17:10:28 -04:00
Dave Airlie
fa11c400d0
r600g: fix typo in evergreen register list
...
pointed out by glisse on irc.
2010-09-23 10:30:35 +10:00
Jerome Glisse
b8835a3992
r600g: disable shader rebuild optimization & account cb flush packet
...
Shader rebuild should be more clever, we should store along each
shader all the value that change shader program rather than using
flags in context (ie change sequence like : change vs buffer, draw,
change vs buffer, switch shader will trigger useless shader rebuild).
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-22 14:19:05 -04:00
Jerome Glisse
1abe48afbe
r600g: flush color buffer after draw command
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-22 10:35:14 -04:00
Luca Barbieri
feb9c8c510
winsys: automatically build sw winsys needed by EGL and d3d1x
...
A cleaner solution would be preferable, but this does no harm and works.
2010-09-22 09:37:23 +02:00
Jerome Glisse
ca35292a44
r600g: occlusion query for new design
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 20:25:39 -04:00
Jerome Glisse
6048be8969
r600g: directly allocate bo for user buffer
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-21 14:37:38 -04:00
Dave Airlie
8893427377
r600g: fix eg texture borders.
...
texture border regs are indexed on evergreen.
2010-09-21 20:53:09 +10:00
Jerome Glisse
4fc5050f82
r600g: add back reference check when mapping buffer
...
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 17:21:37 -04:00
Jerome Glisse
0f099f2906
r600g: use pipe context for flushing inside map
...
This allow to share code path btw old & new, also
remove check on reference this might make things
a little slower but new design doesn't use reference
stuff.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20 16:02:13 -04:00
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
f4020c66fd
r600g: only flush for the correct colorbuffer, not all of them.
2010-09-20 15:39:03 +10:00
Dave Airlie
b110ddd9a9
r600g: fixup r700 CB_SHADER_CONTROL register.
...
r600c emits this with a mask of each written output.
2010-09-20 15:36:52 +10:00
Dave Airlie
9b146eae25
r600g: fix tiling support for ddx supplied buffers
...
needed to emit some more relocs to the kernel.
2010-09-20 11:40:33 +10:00
Dave Airlie
3d12c207d7
r600g: send correct surface base update for multi-cbufs
2010-09-20 10:15:26 +10:00
Henri Verbeet
0f9181811f
r600g: Respect PB_USAGE_UNSYNCHRONIZED in radeon_bo_pb_map_internal().
2010-09-19 23:03:03 +02: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
b68030e9f8
r600g: Check for other references before checking for existing mappings in radeon_bo_pb_map_internal().
...
Having a non-NULL data pointer doesn't imply it's safe to reuse that mapping,
it may have been unmapped but not flushed yet.
2010-09-19 19:43:05 +02:00
Vinson Lee
d74a8da2cb
r600g: Silence uninitialized variable warning.
2010-09-17 14:21:32 -07:00
Vinson Lee
2da4694955
r600g: Fix memory leak on error path.
2010-09-17 14:17:26 -07:00
Vinson Lee
d56e46577e
r600g: Fix implicit declaration warning.
...
Fixes this GCC warning.
r600_state2.c: In function 'r600_context_flush':
r600_state2.c:946: error: implicit declaration of function 'drmCommandWriteRead'
2010-09-17 14:06:23 -07:00
Vinson Lee
36033a6446
r600g: Remove unnecessary headers.
2010-09-17 12:40:54 -07: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
dab2a7660a
r600g: oops got the use_mem_constant the wrong way around.
...
this fixes evergreen gears again.
2010-09-18 00:28:06 +10:00
Dave Airlie
d0502297e0
r600g: use calloc for ctx bo allocations
...
since the reference code relies on these being NULL.
2010-09-17 15:29:32 +10:00
Dave Airlie
3ddc714b20
r600g: fixup map flushing.
...
long lived maps were getting removed when they shouldn't this
tries to avoid that problem by only adding to the flush list
on unmap.
2010-09-17 15:29:32 +10:00
Dave Airlie
a927d0477a
r600g: add winsys bo caching.
...
this adds the bo caching layer and uses it for vertex/index/constant bos.
ctx needs to take references on hw bos so the flushing works okay, also
needs to flush the maps.
2010-09-17 15:29:31 +10:00
Dave Airlie
da96313afe
r600g: add support for kernel bo
...
this moves to using a pb bufmgr instead of kernel bos directly.
2010-09-17 15:29:31 +10:00
Dave Airlie
189a597513
r600g: use malloc bufmgr for constant buffers
2010-09-17 15:29:31 +10: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
ec9d838aa5
r600g: hide radeon_ctx inside winsys.
...
no need for this info to be exported to pipe driver.
2010-09-17 10:57:44 +10:00