Commit Graph

1832 Commits

Author SHA1 Message Date
Christian König 2ec350ff1d [g3dvl] make pipe_context mandatory for creation pipe_video_context 2011-07-08 12:03:13 +02:00
Stéphane Marchesin e53b41f263 i915g: Improve flushing using heuristics. 2011-07-06 02:49:58 -07:00
Vadim Girlin 6bde225b8b r600g: fix buffer overflow check in r600_query_begin 2011-07-05 15:57:11 -04:00
Vadim Girlin 971e1b743e r600g: fix bo map usage flags in r600_query_begin 2011-07-05 15:57:08 -04:00
Vadim Girlin fbe9d4261f r600g: reduce flushes for queries 2011-07-05 15:57:06 -04:00
Vadim Girlin 9bf4c30d73 r600g: fix buffer offset in r600_query_begin 2011-07-05 15:57:01 -04:00
Christian König c3b2230b71 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/r600/r600_state_inlines.h
	src/gallium/tests/trivial/Makefile
	src/gallium/winsys/g3dvl/dri/XF86dri.c
	src/gallium/winsys/g3dvl/dri/driclient.c
	src/gallium/winsys/g3dvl/dri/driclient.h
	src/gallium/winsys/g3dvl/dri/xf86dri.h
	src/gallium/winsys/g3dvl/dri/xf86dristr.h
	src/gallium/winsys/r600/drm/r600_bo.c
2011-07-04 15:04:41 +02:00
Vadim Girlin 61c976c3cc r600g: fix check for empty cs 2011-06-30 16:39:08 -04:00
José Fonseca 235225ec93 scons: Expose pkg-config in a simpler manner. 2011-06-30 17:36:37 +01:00
Chia-I Wu aa281dd392 st/egl: update fbdev backend
Considering fbdev as an in-kernel window system,

 - opening a device opens a connection
 - there is only one window: the framebuffer
 - fb_var_screeninfo decides window position, size, and even color format
 - there is no pixmap

Now EGL is built on top of this window system.  So we should have

 - the fd as the handle of the native display
 - reject all but one native window: NULL
 - no pixmap support

modeset support is still around, but it should be removed soon.
2011-06-28 15:07:30 +09:00
Alex Deucher c4930cb417 r600g: fix num_banks interpretation on eg+
Field is encoded:
0 = 4 banks
1 = 8 banks
2 = 16 banks

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-22 12:34:37 -04:00
Benjamin Franzke 8c91d751c8 winsys/wayland: Fix warning 2011-06-21 13:11:43 -04:00
Mathias Fröhlich b0f1767d77 r600g: Allow VRAM for the initial domain for every buffer binding. 2011-06-13 11:33:14 -04:00
Mathias Fröhlich e1f88016ec r600g: Set the domains value also for recycled buffer objects. 2011-06-13 11:31:55 -04:00
Daniel Vetter 219150433a i915g: implement fence signalling
v2: Incorporated feedback from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-06-11 17:11:26 +02:00
Alex Deucher eca3e910ed r600g: VGT_PRIMITIVE_TYPE is special
It's a special reg and does not require a flush like
the other CONFIG regs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:54:23 -04:00
Alex Deucher 8681ebcf7f r600g: Handle CONFIG regs properly
CONFIG regs (byte offsets 0x8000-0xac00) are single state and the pipeline
must be flushed and hw idle when they are changed.  Border color regs
are in the CONFIG range and this is why a flush is required when changing
them.  CONTEXT regs (byte offset 0x28000+) are multi-state and those do
not require flushes when changing them.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-09 16:26:50 -04:00
Christian König 003401f95c Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/tests/unit/u_format_test.c
	src/gallium/winsys/r600/drm/r600_hw_context.c
2011-06-09 09:35:09 +02:00
Dave Airlie 04554c7d3a r600g: adjust vs/ps gprs on r600/r700 cards when needed.
Ideally we'd have a compiler and register spilling and all that
but this is good enough for now to avoid the gpu hang in piglit,

glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined

on r600/r700 cards.

based on r600c patch
Andre Maasikas <amaasikas@gmail.com>
r600c: bump sq gpr resources if a shader needs more than default

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-09 11:25:02 +10:00
Brian Paul 5f2deba9f3 gallium: s/bool/boolean/ 2011-06-08 08:05:40 -06:00
Dave Airlie 9fb404b47e r600g: set enable always bits for r600/r700 sq registers.
This makes sure these are enabled even if set to 0 at startup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:50:58 +10:00
Dave Airlie e84981dede r600g: fix warnings in winsys.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:49 +10:00
Dave Airlie c1f9884bbf r600g: enable dynamic GPR resource management on evergreen
Evergreen can do this as well as cayman, so we should enable it.

This fixes a gpu lockup with
glsl-vs-vec4-indexing-temp-dst-in-nested-loop-combined.shader_test

I need to add a better workaround for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:11:48 +10:00
Dave Airlie f659cc46bc r600g: only add blocks once to the dirty/enabled lists.
This caused a loop in some tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 14:04:26 +10:00
Dave Airlie a5329d4f78 r600g: fix regression in recent state changes.
We weren't emitting the SQ setup regs at all which really is
fail.

When a state is always enabled we need to add it to the dirty list
as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 13:22:02 +10:00
Dave Airlie 745abb53cf r600g: move simple part of bo reloc processing inline.
This just moves the messy stuff out of the fast path,
and leaves the fast-case in the fast path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:01 +10:00
Dave Airlie ba78a5a679 r600g: split resource emit path from main register emit path
Since resources don't generally vary in size, this splits
the emit path, it also takes into a/c that texture and vertex resources
have different number of relocs, and avoids emitting the extra
reloc for vertex resources.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie ff8717527d r600g: exit bo per reg scanning loop early.
Exit this loop early to avoid pointless iterations later.

Move the resource bos to the first two regs, it actually
doesn't matter which regs we use for this in resource land.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie 138f660b58 r600g: reorder evergreen draw packets to be smaller.
We were always re-emitting lots of unnecessary changes here,
avoid doing that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:47:00 +10:00
Dave Airlie 4707ae20ad r600g: inline r600_bo_reference.
This relies on the reference member being first, so document it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie ff298a66d7 r600g: no need to drop the references here.
We drop them when we reference the new objects in the next line.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:59 +10:00
Dave Airlie e21601e46e r600g: use memcmp instead of a loop in state_set_resource
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-08 11:46:50 +10:00
Pierre-Eric Pelloux-Prayer bdf2e11285 r600g : fix incorrect size computation in r600_query_result
query->num_results already has the size in dwords of the query
buffer.  There no need to multiply again.  We were reading past
the end of the buffer, resulting in reading garbage.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37028

agd5f: clarify the comment.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:40:37 -04:00
Alex Deucher 5d4c479822 r600g: remove pre-r6xx asic families and pci ids
Not sure why these were included originally.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 17:04:52 -04:00
Alex Deucher 7c1d478192 r600g: always clear query memory
According to the hw documentation, the driver needs to:
- allocate 128 bits for each possible DB
- clear the 128 bits for each possible DB
- write 1 to bits 127 and 63 for upper DBs that don't
exist on a particular asic

Previously we were only doing these steps if the
asic had less than the max possible DBs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 16:44:40 -04:00
Benjamin Franzke 42ba8d141f r300g: Remove is_r3xx
Use r300_pci_ids.h instead.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Benjamin Franzke 2bb253120e r600g: Use radeon pciid list for the family lookup table
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-07 10:28:20 -04:00
Dave Airlie ca01fe007d r600g: optimise the draw emission packets for r600/eg
This just reduces code size a bit for this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:43:09 +10:00
Dave Airlie 63184bc8b2 r600g: use an enabled list to track enabled blocks.
At the end of flushing we were scanning over 450 blocks
with generally about 50 enabled. This reduces the scanning
to just the list of enabled blocks.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:33:53 +10:00
Dave Airlie f356bb74de r600g/winsys: overhaul resource range/blocks.
There isn't much point taking the overhead of range/block lookups on resources
we aren't going to be getting resource registers at wierd offsets.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:29 +10:00
Dave Airlie be7af43f5a r600g: split out block init
This just splits this function up as pre-cursor to reusing
the internals of it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:32:00 +10:00
Dave Airlie cf0f02e501 r600g: move resource setting to its own structures.
resource setting could be a fair bit more lightweight,
this patch just separates the resource structs from the standard
reg tracking structs in the driver, later patches will improve
the winsys.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:30:55 +10:00
Dave Airlie eb4bb48ef4 r600g: only call bo loop if nbos is positive.
we don't need to loop over all the registers unless we have
some bos in the block, also avoid setting the ctx flags,
and move the optional stuff down below this chunk.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:28:59 +10:00
Dave Airlie 6cd3534676 r600g: don't need to call the packet dirty function if not dirty.
also fix a unneeded dirty check and add a dirty check speedup.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-07 09:25:50 +10:00
Christian König 1eb957bb41 Merge remote-tracking branch 'origin/master' into pipe-video 2011-06-05 00:11:41 +02:00
Dave Airlie 4423c79ddf r600g: work out range/block etc at state build time.
This moves the overhead of working out the range/block to state build time,
it also allows the compiler to use constants for a lot of things instead
of working them out each time.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:59:29 +10:00
Dave Airlie 991dbd71fd r600g: migrate macros from r600_priv.h to r600.h
this is just an precursor change for some later patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:42:11 +10:00
Dave Airlie c1159eea54 r600g: remote ctx arg to block/range macros.
These aren't used anymore.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:40:40 +10:00
Dave Airlie 8782fdc1db r600g: avoid copying unnecessary pieces of a block.
This just avoids copying stuff if its going to modify the number of dwords
later anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:29:37 +10:00
Dave Airlie 8fcafeb475 r600g: force new evergreen blocks for large range.
This range was 76 dwords long, the 75th dword changes, the first 60 or so
don't. split the block so it emits less often.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-02 14:22:42 +10:00
Alex Deucher 414cd5df50 r600g: add llano support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 18:10:01 -04:00
Alex Deucher b5518834e3 r600g: cs init fixes
- all asics need to emit CONTEXT_CONTROL
- all r6xx asics need to emit 3D_START_CMDBUF

The ddx and r600c already do this. r600g should as well.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-31 10:43:31 -04:00
Dave Airlie 0cdd82df53 r600g: add context control to start of CS
On my original R600 card this at least lets gnome shell run for a while longer
and the piglit r300-readcache test case works a lot more reliably.

Still a few more stability issues running a piglit test run though.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 15:42:45 +10:00
Dave Airlie 65ee7cd1df r600g: don't emit color blend register on original R600.
The original R600 doesn't have these so don't emit them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-31 10:52:07 +10:00
Dave Airlie 7779f6d1df r600g: add initial cayman acceleration support.
Cayman is the RadeonHD 69xx series of GPUs. This adds support for
3D acceleration to the r600g driver.

Major changes:
Some context registers moved around - mainly MSAA and clipping/guardband related.
GPR allocation is all dynamic
no vertex cache - all unified in texture cache.
5-wide to 4-wide shader engines (no scalar or trans slot)
	- some changes to how instructions are placed into slots
	- removal of END_OF_PROGRAM bit in favour of END flow control clause
	- no vertex fetch clause - TC accepts vertex or texture

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 11:42:45 +10:00
Dave Airlie ece871c038 r600g: flush the DB dest base as well.
If we do this for CB bases then we should do it for DB bases.

noticed while adding cayman support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-25 09:37:33 +10:00
Christian König aa63ebc48a Merge remote-tracking branch 'origin/master' into pipe-video 2011-05-21 16:43:12 +02:00
Dave Airlie ecc051d65b r600g: bump domain selection up one layer.
this is taken from a patch from Mathias Froehlich, just going to
stage it in a few pieces.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-18 17:31:51 +10:00
Christian König 828540e491 Merge remote-tracking branch 'origin/master' into pipe-video 2011-05-15 19:26:53 +02:00
Dave Airlie bd5b7a6f71 r600g: reduce flushes so only when texture and CB overlap.
We only need to do this when the texture and CB are using the
same memory area.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-15 18:09:15 +10:00
Marek Olšák fdd37af3f7 r300g: dynamically ask for and release Hyper-Z access
We ask for Hyper-Z access when clearing a zbuffer.
We release it if no zbuffer clear has been done for 2 seconds.
2011-05-15 03:28:32 +02:00
Dave Airlie c7b1497f4e r600g: don't unmap if we haven't mapped
should fix https://bugs.freedesktop.org/show_bug.cgi?id=37157

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 14:03:47 +10:00
Dave Airlie 1ca3efe548 r600g: use a local var to store pointer to which register we are working on
this just makes the code a little bit cleaner.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:17 +10:00
Dave Airlie 240049adfa r600g: make range/block act more like a page table
only allocate the blocks ptr in the range if we ever have one,
otherwise don't bother wasting the memory.

valgrind glxinfo
before:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

after:
==5227==     in use at exit: 419,754 bytes in 706 blocks
==5227==   total heap usage: 3,452 allocs, 2,746 frees, 3,140,531 bytes allocate

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:26:16 +10:00
Dave Airlie d79a4a612b r600g: reduce r600_reg footprint
This drops 6k of the text segment, a minor drop in the ocean, however
it also makes the code a lot cleaner and removes a lot of duplicated
information, hopefully making it more maintainable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:41 +10:00
Dave Airlie d015d2f391 r600g: reduce memory usage from range/block hash table.
This table covered a large range unnecessarily, reduce the address
range covered, use the fact that the bottom two bits aren't significant,
and remove unused fields from the range struct. It also drops the hash_size/shift in context in favour of a define, which should make doing the math
a bit less CPU intensive.

valgrind glxinfo
Before:
==320==     in use at exit: 419,754 bytes in 706 blocks
==320==   total heap usage: 3,691 allocs, 2,985 frees, 7,272,467 bytes allocated

After:
==967==     in use at exit: 419,754 bytes in 706 blocks
==967==   total heap usage: 3,552 allocs, 2,846 frees, 3,550,131 bytes allocated

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:40 +10:00
Dave Airlie 5e15497452 r600g: delay mapping until first map request. (v2)
Currently r600g always maps every bo, this is quite pointless as it wastes
VM and on 32-bit with wine running VM space is quite useful.

So with this patch we don't create the mappings until first use, without
tiling enabled this probably won't make a major difference on its own,
but with tiled staged uploads it should avoid keeping maps for most of the
textures unnecessarily.

v2: add bo data ptr check

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-13 09:22:39 +10:00
Alex Deucher b9f2750900 r600g: fix flushes on rs780/rs880
They need the same hack as rv670.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-11 12:10:01 -04:00
José Fonseca 2812b60a84 svga/drm: Implement svga_winsys_screen::get_hw_version. 2011-05-10 16:36:35 +01:00
Christian König 213b9004a6 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_state.c
2011-05-07 14:11:40 +02:00
Alex Deucher 3b20a89941 r600g: avoid recursion in rv670 flush workaround
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=36914

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-06 13:19:21 -04:00
Kostas Georgiou 8c3226be90 Add pci id for FirePro 2270
Signed-off-by: Kostas Georgiou <georgiou@opengamma.com>
2011-05-06 13:03:40 -04:00
Alex Deucher bf7a3ddca6 r600g: further r6xx cache flush fixes
Don't emit sync packets for additional CBs or DB.
Spotted by Fredrik Höglund.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 18:45:55 -04:00
Dave Airlie 5066f7cd0e r600g: add rv670 flushing workaround.
Hopefully we can find out the proper fix for this, but for now
this makes the fbo mipmap tests pass on my rv670 (x2 card).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:41:13 +10:00
Alex Deucher d116fe51c1 r600g: fix cache flushes on r6xx
r6xx asics have some problems with the surface
sync logic for the CB and DB.  It's recommended
to use the event write interface for flushing
the DB/CB caches rather than the sync packets.
A single event write flush flushes all dst
caches, so we only need one for all CBs and DB.

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=35312

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-05-06 08:07:12 +10:00
Dave Airlie ae7abf080b r600g: do RV6xx base updates inline with state updates.
This seems more in line with what the documentation suggests we should be
doing. It doesn't fix the rv635 regression, though I thought it might,
so it means I've no idea whats actually going wrong there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-05 09:07:49 +10:00
Brian Paul fc30910c65 i915g: add const qualifier to silence warning 2011-05-03 18:56:20 -06:00
Alex Deucher c120d9d1cc r600g: add some new pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-05-03 15:26:07 -04:00
Christian König e602ecf9ef r600g: revert commit 68cc6bc5d8
Revert commit "remove the unneeded bo from COLOR[0-9]_INFO
Also implement a working alternative.
2011-04-26 19:09:45 +02:00
Benjamin Franzke 6a35ed1f66 winsys/wayland: Fix typo in Makefile
Reported by dir1212 on irc.
2011-04-25 18:17:07 +02:00
Benjamin Franzke aaa3c0d6de winsys: Add wayland shm sw winsys 2011-04-25 10:45:56 -04:00
Marek Olšák 71667533d1 r600g: remove some pointless and unused functions 2011-04-25 01:20:40 +02:00
Marek Olšák 512c814849 r600g: do not reset device to 0 when doing unrelated operations
Seems to be a copy-paste bug.
2011-04-25 01:20:40 +02:00
Christian König 68cc6bc5d8 r600g: remove the unneeded bo from COLOR[0-9]_INFO
The COLOR[0-7]_INFO registers doesn't neeed a bo.
2011-04-24 12:47:42 +02:00
Christian König fa31b1095e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configs/linux-dri
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_state.c
	src/gallium/include/pipe/p_format.h
	src/gallium/tests/graw/fragment-shader/frag-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-add.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-2d.sh
	src/gallium/tests/graw/fragment-shader/frag-dp3.sh
	src/gallium/tests/graw/fragment-shader/frag-dp4.sh
	src/gallium/tests/graw/fragment-shader/frag-dst.sh
	src/gallium/tests/graw/fragment-shader/frag-ex2.sh
	src/gallium/tests/graw/fragment-shader/frag-face.sh
	src/gallium/tests/graw/fragment-shader/frag-flr.sh
	src/gallium/tests/graw/fragment-shader/frag-frc.sh
	src/gallium/tests/graw/fragment-shader/frag-kil.sh
	src/gallium/tests/graw/fragment-shader/frag-lg2.sh
	src/gallium/tests/graw/fragment-shader/frag-lit.sh
	src/gallium/tests/graw/fragment-shader/frag-lrp.sh
	src/gallium/tests/graw/fragment-shader/frag-mad-immx.sh
	src/gallium/tests/graw/fragment-shader/frag-mad.sh
	src/gallium/tests/graw/fragment-shader/frag-max.sh
	src/gallium/tests/graw/fragment-shader/frag-min.sh
	src/gallium/tests/graw/fragment-shader/frag-mov.sh
	src/gallium/tests/graw/fragment-shader/frag-mul.sh
	src/gallium/tests/graw/fragment-shader/frag-rcp.sh
	src/gallium/tests/graw/fragment-shader/frag-rsq.sh
	src/gallium/tests/graw/fragment-shader/frag-sge.sh
	src/gallium/tests/graw/fragment-shader/frag-slt.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-absneg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-neg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-swz.sh
	src/gallium/tests/graw/fragment-shader/frag-sub.sh
	src/gallium/tests/graw/fragment-shader/frag-tempx.sh
	src/gallium/tests/graw/fragment-shader/frag-xpd.sh
	src/gallium/tests/graw/vertex-shader/vert-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-add.sh
	src/gallium/tests/graw/vertex-shader/vert-arl.sh
	src/gallium/tests/graw/vertex-shader/vert-arr.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-2d.sh
	src/gallium/tests/graw/vertex-shader/vert-dp3.sh
	src/gallium/tests/graw/vertex-shader/vert-dp4.sh
	src/gallium/tests/graw/vertex-shader/vert-dst.sh
	src/gallium/tests/graw/vertex-shader/vert-ex2.sh
	src/gallium/tests/graw/vertex-shader/vert-flr.sh
	src/gallium/tests/graw/vertex-shader/vert-frc.sh
	src/gallium/tests/graw/vertex-shader/vert-lg2.sh
	src/gallium/tests/graw/vertex-shader/vert-lit.sh
	src/gallium/tests/graw/vertex-shader/vert-lrp.sh
	src/gallium/tests/graw/vertex-shader/vert-mad.sh
	src/gallium/tests/graw/vertex-shader/vert-max.sh
	src/gallium/tests/graw/vertex-shader/vert-min.sh
	src/gallium/tests/graw/vertex-shader/vert-mov.sh
	src/gallium/tests/graw/vertex-shader/vert-mul.sh
	src/gallium/tests/graw/vertex-shader/vert-rcp.sh
	src/gallium/tests/graw/vertex-shader/vert-rsq.sh
	src/gallium/tests/graw/vertex-shader/vert-sge.sh
	src/gallium/tests/graw/vertex-shader/vert-slt.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-absneg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-neg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-swz.sh
	src/gallium/tests/graw/vertex-shader/vert-sub.sh
	src/gallium/tests/graw/vertex-shader/vert-xpd.sh
	src/gallium/tools/trace/dump.py
	src/gallium/tools/trace/format.py
	src/gallium/tools/trace/model.py
	src/gallium/tools/trace/parse.py
2011-04-23 14:27:40 +02:00
Alex Deucher abee17057f r600g: fix userspace fences again
reinstate b7617346dc after the
rework in 6067a2a67f.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-20 13:09:09 -04:00
Fredrik Höglund 6067a2a67f r600g: don't flush the dest caches on every draw
Keep track of when the caches are dirty, and only flush them when
the framebuffer state is set and when the context is flushed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-20 09:08:15 +10:00
Dave Airlie 723e35d4a6 r600g: make loop const always flush
this needs revisiting, we really don't want to be flushing all 32 of these,
but currently we don't flush any of them, and it seems to have caused a regression
as reported on irc with doom3 on evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 16:39:50 +10:00
Dave Airlie f05adb83f5 r600g: add dirty tracking to context reg.
just makes the code more consistent.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie 5b5a16e320 r600g: deinline some large functions.
really at these sort of sizes these are pointless inlines.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie a6e32da8bd r600g: consolidate r600/evergreen code for resource emission.
These really didn't have much difference, and totally not inline material.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Bas Nieuwenhuizen 02522b76a1 r600g: don't flush caches if we already did so, even for a subset of the flags
Merging the flushes that are left doesn't seem to give a significant
performance improvement

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie e3b9cf15bb r600g: attempt to avoid emitting resources that are the same
This just avoids reemitting resources that haven't changed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:20 +10:00
Dave Airlie 162bc40eed r600g: modify block to only emit the first few dirty registers. (v2)
This gets me from 2200 to 1978 dwords for a gears frame.

This is due to us having some 32-dwords blocks in the SPI, that we only
modify the first dwords off.

v2: fix dirty reg count from Bas Nieuwenhuizen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Dave Airlie c058067e57 r600g: track dirty registers better. (v2)
This is a first step to decreasing the CPU usage, by decreasing how much
stuff we pass to the GPU and hence to the kernel CS checker.

This adds a check to see if the values we need to write are actually dirty,
and avoids writing if they are. However certain register need to always
be written so we add a new flag to say which ones should be always written
if used. (Note this could probably be done cleaner with a larger refactoring,
 since I think the CONST_BUFFER_SIZE_PS/VS and CONST_CACHE_PS/VS might
be better off as a special state).

It also moves the need_bo to be a flags on the register now.

With this, a frame of gears goes from emitting 3k dwords to emitting 2k dwords,
and I'm sure it could get a lot smaller.

v2: fix some evergreen dirty bits.

Original patch from: Bas Nieuwenhuizen, I NIHed nearly the same thing
before seeing his patch on the list, oops.

Reviewed-by: Bas Nieuwenhuizen
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-19 10:12:19 +10:00
Marek Olšák d35aeff4bb r300g/winsys: rename r300->radeon and do a little cleanup
Renaming a few files, types, and functions.
Also make the winsys independent of r300g.
2011-04-18 02:52:32 +02:00
Dave Airlie 93d42571a6 r600g: use some loops.
unrolling loops is for Gentoo users, and I really want to put something
else inside these loops later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:19:28 +10:00
Dave Airlie 70de2705b4 r600g: consolidate the same piece of cut-n-paste code into a function.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-04-17 17:11:36 +10:00
Christian König 8b0a9cc62c [g3dvl] get softpipe to work again 2011-04-10 00:33:36 +02:00
Marek Olšák aac4bae986 r300g: fix crash when adding a new relocation
No idea why it's so hard to reproduce.
Broken with: c35572352e

Thanks to Toni Spets for assistance.
2011-04-08 21:34:16 +02:00
Marek Olšák 9d5de0fcb6 r300g: add 'radeon: ' prefix to error messages in winsys 2011-04-08 04:38:36 +02:00
Christian König 19402275fb [g3dvl] stop waiting for replay of DRI2CopyRegion 2011-04-07 23:04:10 +02:00
Christian König d9ad3aa3b9 [g3dvl] and finally split the decoder part out of the context
This should give a good basis to implement vdpau ontop of it.
2011-04-06 00:06:20 +02:00
Alex Deucher a0fc40f0d5 r600g: add some additional ontario pci ids
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-04-04 11:15:18 -04:00
Marek Olšák 6caac3ecb8 r300g: do not wait for a busy BO if neither GPU nor CPU is changing it
Improves frame rate in apps with at least one user vertex buffer and
a hw index buffer.
2011-04-03 22:49:22 +02:00
Marek Olšák 9d881cbd5a r300g: remove unused RADEON_PB_USAGE_CACHE 2011-04-03 21:18:03 +02:00
Marek Olšák 652bf121f2 r300g: avoid mapping the same buffer twice
Shouldn't happen, but you never know.
2011-04-03 19:32:27 +02:00
Marek Olšák c35572352e r300g: remove the redundant reference counter in radeon_bo
We already have pb_buffer::reference::count.
2011-04-03 19:32:27 +02:00
Fredrik Höglund d04ab396a5 r600g: implement texture barrier 2011-03-29 16:54:19 -04:00
Fredrik Höglund 948e1eb8e9 r600g: implement the pipe_screen fence functions
v2: Allocate the fences from a single shared buffer object.
v3: Allocate the r600_fence structs in blocks of 16.
    Spin a few times before calling sched_yield in r600_fence_finish().
2011-03-29 16:37:04 -04:00
Vinson Lee 2737350157 i915g: Fix build.
Fix build failures introduced with commit 0fbb64a529.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
2011-03-28 17:37:33 -07:00
Daniel Vetter 0fbb64a529 i915g: use drm ioctl to get pci devid
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-28 21:23:31 +02:00
Dave Airlie e4b040c2b9 r600g: fix bo names causing -35 EDEADLCK
this is a port of the r300 winsys code to do the same thing.
2011-03-22 11:48:36 +10:00
Christian König 2bf95c519e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/tests/unit/SConscript
2011-03-19 01:02:40 +01:00
Christian König d1655b60b0 get softpipe winsys to compile again 2011-03-19 00:06:46 +01:00
Alex Deucher 39d60610e8 r600g: fix logic error in 028987c803
Spotted by Henri on IRC.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 18:07:15 -04:00
Alex Deucher 028987c803 r600g: emit SURFACE_BASE_UPDATE packet on rv6xx
This packet is required when updating the DB, CB,
or STRMOUT base addresses on rv6xx for the surface
sync logic to work correctly.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-03-14 17:42:19 -04:00
Marek Olšák 7e02303497 gallium: remove flags from the flush function
The drivers have been changed so that they behave as if all of the flags
were set. This is already implicit in most hardware drivers and required
for multiple contexts.

Some state trackers were also abusing the PIPE_FLUSH_RENDER_CACHE flag
to decide whether flush_frontbuffer should be called.
New flag ST_FLUSH_FRONT has been added to st_api.h as a replacement.
2011-03-11 21:39:31 +01:00
Dave Airlie 9b7f377635 r600: don't close fd on failed load
This fd gets passed in from outside, closing it causes the X.org server
to crap out when the driver doesn't identify the chipset.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-10 12:01:43 +10:00
Vinson Lee c0d3fb4b6c scons: Fix immediate Python exceptions with SCons on SunOS.
The build still fails.
2011-03-08 17:59:57 -08:00
Marek Olšák 5650a719f0 r300g: decide whether a flush should be asynchronous when calling it
Thread offloading is not sometimes desirable, e.g. when mapping a buffer.
2011-03-08 08:23:29 +01:00
Christian König 0eccb1038a Merge remote branch 'origin/master' into pipe-video 2011-03-03 00:59:12 +01:00
Marek Olšák a6314eb47f r300g: require DRM 2.3.0 (kernel 2.6.34)
Running any older kernel is not recommended anyway.
2011-03-02 17:54:36 +01:00
Marek Olšák f6dbcb92bf r300g: do not use ioctl thread offloading on single-core machines 2011-03-02 17:54:36 +01:00
Daniel Vetter 8f9e546fde i915g: kill relocs accouting
No one ever cared. libdrm does dynamic resizing of its reloc-table,
anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-03-01 22:18:11 +01:00
Dave Airlie a44b65312e r600g: add NV_conditional_render support.
This is reliant on a drm patch that I posted on the list + a version bump.

These will appear in drm-next today.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:09:00 +10:00
Dave Airlie 929be6eb95 r600g: start using drm minor version to enable things.
If the drm minor version is > 9 (i.e. whats in drm-next),
we enable s3tc + texture tiling by default now.

this changes R600_FORCE_TILING to R600_TILING which can
be set to false to disable tiling on working drm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-03-01 15:08:50 +10:00
Christian König b97e41c7b1 Merge remote branch 'origin/master' into pipe-video 2011-02-28 23:59:53 +01:00
Daniel Vetter 3c59b3eb4b i915g/winsys: buffer validation support
v2: Add the batch bo to the libdrm validation lost, for otherwise
libdrm won't take previously used buffers into account.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 18:49:56 +01:00
Daniel Vetter e20c3255e2 i915g: add raw batchbuffer dumping in drm winsys
These files can be decoded with intel_dump_decode from the intel-gpu-tools
available at:

http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-27 16:32:38 +01:00
Jakob Bornecrantz acc290aff0 i915g: Use the same debug env vars in drm and sw winsys 2011-02-26 15:35:13 +01:00
Jakob Bornecrantz 9a371b938c i915g: Use unchecked writes in sw winsys batchbuffer 2011-02-26 15:29:21 +01:00
Vinson Lee eb17802386 scons: Reduce all Cygwin platform names to 'cygwin'.
platform.system in SCons on Cygwin includes the OS version number.
Windows XP - CYGWIN_NT-5.1
Windows Vista - CYGWIN_NT-6.0
Windows 7 - CYGWIN_NT-6.1

Reduce all Cygwin platform variants to just 'cygwin' so anything
downstream can simply use 'cygwin' instead of the different full
platform names.
2011-02-24 19:49:37 -08:00
Christian König b922a0ce12 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_asm.h
	src/gallium/drivers/r600/r600_shader.c
	src/gallium/drivers/r600/r600_state_inlines.h
	src/gallium/drivers/r600/r600_texture.c
2011-02-24 22:02:42 +01:00
Vinson Lee 100cd214e3 scons: Fix Cygwin platform names.
Fixes immediate Python exceptions with SCons on Cygwin.
2011-02-23 18:21:14 -08:00
Jakob Bornecrantz fbd681f1a0 i915g: Use dump function in sw winsys 2011-02-24 00:26:02 +00:00
Daniel Vetter 55a3c35243 i915g: add some throttling
Intel classic drivers switched to this, too, so it must be good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:54 +00:00
Daniel Vetter 1e966636d0 i915g: s/bool/boolean/ style-fixup in winsys
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 23:42:53 +00:00
Jakob Bornecrantz 593ba7b05b i915g: Fix warning 2011-02-21 23:42:53 +00:00
Vinson Lee 8033700814 i915g: s/__func__/__FUNCTION__/ 2011-02-20 21:23:45 -08:00
Daniel Vetter c0122daf10 i915g: kill remnants of mmapped batchbuffer support
We're using bo_subdata.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-02-21 00:50:16 +01:00
Jakob Bornecrantz fa186804a6 i915g: Add winsys/i915/sw to scons build 2011-02-21 00:50:16 +01:00
Jakob Bornecrantz 20ff6a2752 i915g: Fix void ptr arith 2011-02-21 00:50:16 +01:00
Marek Olšák e9e5380f22 r300g: fix invalid dereference in winsys
radeon_bo_unref may destroy the buffer, so call it after p_atomic_dec, not before.
2011-02-19 00:06:52 +01:00
Marek Olšák fa3f1348e4 r300g: fix a race between CS and SET_TILING ioctls 2011-02-16 22:23:23 +01:00
Marek Olšák b9e2cde600 r300g: offload the CS ioctl to another thread
This is a multi-threading optimization which hides the kernel overhead
behind a thread. It improves performance in CPU-limited apps by 2-15%.
Of course you must have at least 2 cores for it to make any difference.

It can be disabled with:

export RADEON_THREAD=0
2011-02-15 09:17:39 +01:00
Marek Olšák 333d3daf47 r300g: actually implement the is_buffer_busy hook the right way
Ooops.
2011-02-15 04:00:47 +01:00
Marek Olšák 45e1cd522b r300g: handle interaction between UNSYNCHRONIZED and DONTBLOCK flags in bo_map
The VBO module uses both, but they are somewhat opposite to each other.
In this case, we pick UNSYNCHRONIZED and ignore DONTBLOCK.
2011-02-15 04:00:47 +01:00
Marek Olšák 8decb0a96d r300g: fix a possible race condition when mapping a buffer
This is the last one I think.
2011-02-15 04:00:47 +01:00
Marek Olšák 89ee0d527c r300g: flush CS in bo_map even if we get USAGE_DONTBLOCK
Because an app may do something like this:

while (!(ptr = bo_map(..., DONT_BLOCK))) {
    /* Do some other work. */
}

And it would be looping endlessly if we didn't flush.
2011-02-14 23:34:45 +01:00
Marek Olšák a87730ff3f r300g: implement pb_manager::is_buffer_busy 2011-02-14 22:02:40 +01:00
Marek Olšák 8ab1fcc66a r300g: fixup the handle_compare function
Accidentally negated in 685c3262b9.
2011-02-13 00:31:04 +01:00
Marek Olšák 685c3262b9 r300g: typecast void* to unsigned correctly 2011-02-12 23:36:48 +01:00
Marek Olšák df54b53b7d r300g: improve function radeon_bo_is_referenced_by_cs
This should prevent calling into radeon_get_reloc when there's
only one context.
2011-02-12 03:08:39 +01:00
Marek Olšák de22d8f1ee r300g: remove unused function prototypes, update copyright 2011-02-11 06:07:23 +01:00
Marek Olšák 032b162ce8 r300g: plug a memory leak in winsys 2011-02-11 02:34:15 +01:00
Marek Olšák 862ebb411b r300g: remove unneeded code in winsys
We don't need the read/write flags.
2011-02-11 01:32:44 +01:00
Marek Olšák 6ccab620a0 r300g: import the last bits of libdrm and cleanup the whole thing
Based on Dave's branch.

The majority of this commit is a cleanup, mainly renaming things.
There wasn't much code to import, just ioctl calls.

Also done:
- implemented unsynchronized bo_map (important optimization!)
- radeon_bo_is_referenced_by_cs is no longer a refcount hack
- dropped the libdrm_radeon dependency

I'm surprised that this has resulted in less code in the end.
2011-02-11 01:07:25 +01:00
Brian Paterni 4d78dafc84 r600g: silence a few valgrind warnings 2011-02-08 12:48:44 +01:00
Henri Verbeet a6a710cbe7 r600g: Make some more things static. 2011-02-03 21:13:12 +01:00
José Fonseca 637ed52f59 svga/drm: Flushing preemptively on a 1/3 of the aperture.
Exactly one half would be the ideal, but this is a soft limit, and one
more byte over brings us to synchronous behavior.

Flushing when the referred GMR exceeds one third of the aperture gives us
statistically better performance.
2011-02-03 15:15:23 +00:00
José Fonseca 63c0a504a0 svga/drm: Update for pb_vtbl::map argument addition. 2011-02-03 15:15:23 +00:00
Dave Airlie a112cc283d r600g: align the tiling modes with what the DDX and kernel expects.
If we see a MACRO bit on r600g its 2D tiled,
if don't see a MACRO bit and we do see a MICRO bit then its 1D tiled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-01 14:23:35 +10:00
Dave Airlie 42b5f68198 r600g: start looking at evergreen tiling.
this just adds the ioctl interface and sets the tile type
and array mode in the correct place.

This seems to bring eg 1D tiling to the same level, and issues
as on r600. No idea how to address 2D yet.
2011-02-01 10:36:57 +10:00
Vinson Lee 8c115aa247 scons: Gracefully handle pkg-config errors with libdrm_radeon.
Print warnings and continue build.
2011-01-31 10:50:06 -08:00
Dave Airlie ea5ede2178 r600g: fix eg OQ properly.
the context init is separate for these gpus.
2011-01-31 20:44:47 +10:00
Alex Deucher 26a4c1cb65 r600g: fix OQ on evergreen
6xx/7xx have a max of 4 DBs, evergreen have a max of 8.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-01-31 02:49:27 -05:00
Dave Airlie df8089df90 r600g: fix occlusion query results.
Like on some r5xx, there are multiple DB backends on the r600,
we need to add up the query results from each of these to get the
final correct value.

So far I'm not 100% sure how to calculate the num_db, value
setting it to 4 should be harmless enough until we do.

This fixes occulsion_query piglit test on my rv740.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-31 16:14:03 +10:00
Marek Olšák 82e60236a9 r300g: print driver info if RADEON_DEBUG=info 2011-01-27 23:17:41 +01:00
Marek Olšák 39f16e2aa7 r300g: add winsys flag CAN_AACOMPRESS 2011-01-27 23:13:28 +01:00
Marek Olšák 2e3ccada07 r300g: rename flag squaretiling -> drm_2_1_0 2011-01-27 23:06:15 +01:00
Mathias Fröhlich 90c2fd8640 r600g: Implement timer queries. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich e7ec532735 r600g: Implement asyncronous query results. 2011-01-25 14:18:19 -05:00
Mathias Fröhlich b55fd961e1 r600g: Fix meaning of num_results for queries. 2011-01-25 14:18:19 -05:00
Tim Wiederhake 4102c7c7e2 fix potential leak in r600_context_init 2011-01-25 14:18:19 -05:00
Tim Wiederhake 9d41e5ee46 silences some valgrind warnings
==5547== Conditional jump or move depends on uninitialised value(s)
==5547==    at 0x8FE745D: r600_drm_winsys_create (r600_drm.c:86)
2011-01-25 14:18:19 -05:00
Christian König 78faf8d0e9 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
2011-01-20 22:43:18 +01:00
Christian König d2ff6b8715 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_shader.c
2011-01-20 22:10:37 +01:00
Henri Verbeet 9e964baaf3 r600g: Kill trailing whitespace. 2011-01-18 20:57:04 +01:00
Henri Verbeet a25473b535 r600g: Remove the redundant radeon_new() prototype. 2011-01-15 19:48:43 +01:00
Christian König a96fe679e2 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_shader.c
2011-01-12 00:48:10 +01:00
Jerome Glisse 63b9790a55 r600g: move user fence into base radeon structure
This avoid any issue when context is free and we still try to
access fence through radeon structure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-01-11 14:34:25 -05:00
Christian König 1b1c15a54a r600g: place buffers into different domains, based on usage flags 2011-01-10 22:09:41 +01:00
Dave Airlie 3ee8d13c00 i965g: update disassembler code from classic.
still a bit of work to do, the winsys gen setting is a bit of a hack.
2011-01-09 17:21:10 +10:00
Christian König 72e3099155 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/r600/eg_asm.c
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_asm.h
	src/gallium/include/pipe/p_format.h
	src/gallium/targets/dri-nouveau/Makefile
2011-01-08 13:24:36 +01:00
Marek Olšák 1f0348c4a2 r300g: rework command submission and resource space checking
The motivation behind this rework is to get some speed by reducing
CPU overhead. The performance increase depends on many factors,
but it's measurable (I think it's about 10% increase in Torcs).

This commit replaces libdrm's radeon_cs_gem with our own implemention.
It's optimized specifically for r300g, but r600g could use it as well.
Reloc writes and space checking are faster and simpler than their
counterparts in libdrm (the time complexity of all the functions
is O(1) in nearly all scenarios, thanks to hashing).
(libdrm's radeon_bo_gem is still being used in the driver.)

It works like this:

cs_add_reloc(cs, buf, read_domain, write_domain) adds a new relocation and
also adds the size of 'buf' to the used_gart and used_vram winsys variables
based on the domains, which are simply or'd for the accounting purposes.
The adding is skipped if the reloc is already present in the list, but it
accounts any newly-referenced domains.

cs_validate is then called, which just checks:
    used_vram/gart < vram/gart_size * 0.8
The 0.8 number allows for some memory fragmentation. If the validation
fails, the pipe driver flushes CS and tries do the validation again,
i.e. it validates only that one operation. If it fails again, it drops
the operation on the floor and prints some nasty message to stderr.

cs_write_reloc(cs, buf) just writes a reloc that has been added using
cs_add_reloc. The read_domain and write_domain parameters have been removed,
because we already specify them in cs_add_reloc.

The space checking has been tested by putting small values in vram/gart_size
variables.
2011-01-08 07:05:42 +01:00
Alex Deucher f54366bcf6 r600g: add support for NI (Northern Islands) GPUs
This adds support for Barts, Turks, and Caicos asics.
2011-01-06 18:05:16 -05:00
Christoph Bumiller cd1cf78828 Merge remote branch 'origin/nvc0' 2011-01-04 18:20:05 +01:00
Christian König e179a8bf34 Merge remote branch 'origin/master' into pipe-video 2010-12-22 21:12:24 +01:00
Henri Verbeet 2fd718d560 r600g: r600_new() and r600_delete() are unused. 2010-12-22 09:19:48 +01:00
Alex Deucher 341d048e45 r600g: remove useless switch statements
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-12-22 01:30:41 -05:00
Dave Airlie f431e0452b r600g: drop unused code in evergreen.
this code was pretty much duplicated, thanks to Henri Verbeet on irc for
pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-12-22 15:58:29 +10:00
Marek Olšák 2a95542088 r300g: support B10G10R10A2 render targets only with DRM 2.8.0 or later versions 2010-12-22 03:39:37 +01:00
Christoph Bumiller 0f68236a24 Merge remote branch 'origin/master' into nvc0-new 2010-12-19 21:46:33 +01:00
Jakob Bornecrantz c28debbf6f svga: Remove debug print in winsys 2010-12-16 09:44:02 +01:00
Jakob Bornecrantz 0967d77a9a wrapper: Flush pipe on unmap
For drivers that does DMA transfers instead of mapping directly
2010-12-16 08:53:26 +01:00
Jakob Bornecrantz 8b60bf4e9f wrapper: Fix width and height given to map and remove uneeded fields 2010-12-16 08:53:26 +01:00
Vinson Lee 075a807f43 r300g: Remove unnecessary header. 2010-12-23 16:05:28 -08:00
Christian König 772b25e1f3 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_texture.c
2010-12-11 13:43:44 +01:00
Jerome Glisse b22c8e8bbc r600g: fix bo size when creating bo from handle
Spoted by Alex Diomin

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-10 11:17:27 -05:00
Vinson Lee af5f7b3260 r600g: Fix SCons build. 2010-12-09 14:03:58 -08:00
Jerome Glisse 15753cf54d r600g: avoid using pb* helper we are loosing previous cpu cycle with it
r600g is up to a point where all small CPU cycle matter and pb* turn
high on profile. It's mostly because pb try to be generic and thus
trigger unecessary check for r600g driver. To avoid having too much
abstraction & too much depth in the call embedded everythings into
r600_bo. Make code simpler & faster. The performance win highly depend
on the CPU & application considered being more important on slower CPU
and marginal/unoticeable on faster one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-09 16:07:01 -05:00
Jerome Glisse b7617346dc r600g: fix userspace fence against lastest kernel
R6XX GPU doesn't like to have two partial flush writting
back to memory in row without a prior flush of the pipeline.
Add PS_PARTIAL_FLUSH to flush all work between the CP and
the ES, GS, VS, PS shaders.

Thanks a lot to Alban Browaeys (prahal on irc) for investigating
this issue.

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-07 17:54:56 -05:00
Jerome Glisse e0d554ab78 r600g: remove useless flush map
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-06 15:50:50 -05:00
Henri Verbeet 308cfb80f5 r600g: Cleanup block bo references in r600_context_fini(). 2010-12-05 18:44:44 +01:00
Marek Olšák 6947e52548 r300g: cleanup winsys 2010-12-05 05:47:10 +01:00
Jerome Glisse edda44e0dc r600g: more indentation fix + warning silencing + dead code removal
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-03 13:06:53 -05:00
Marek Olšák 3ba8843307 r300g: use internal BO handle for add_buffer and write_reloc
Small perf improvement in ipers.

radeon_drm_get_cs_handle is exactly what this commit tries to avoid
in every write_reloc.
2010-12-03 04:40:22 +01:00
Roland Scheidegger 4c70014626 gallium: support for array textures and related changes
resources have a array_size parameter now.
get_tex_surface and tex_surface_destroy have been renamed to create_surface
and surface_destroy and moved to context, similar to sampler views (and
create_surface now uses a template just like create_sampler_view). Surfaces
now really should only be used for rendering. In particular they shouldn't be
used as some kind of 2d abstraction for sharing a texture. offset/layout fields
don't make sense any longer and have been removed, width/height should go too.
surfaces and sampler views now specify a layer range (for texture resources),
layer is either array slice, depth slice or cube face.
pipe_subresource is gone array slices (or cube faces) are now treated the same
as depth slices in transfers etc. (that is, they use the z coord of the
respective functions).

Squashed commit of the following:

commit a45bd509014743d21a532194d7b658a1aeb00cb7
Merge: 1aeca28 32e1e59
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Dec 2 04:32:06 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/i915/i915_resource_texture.c
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/drivers/i915/i915_surface.c

commit 1aeca287a827f29206078fa1204715a477072c08
Merge: 912f042 6f7c8c3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Dec 2 00:37:11 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/state_trackers/vega/api_filters.c
    	src/gallium/state_trackers/vega/api_images.c
    	src/gallium/state_trackers/vega/mask.c
    	src/gallium/state_trackers/vega/paint.c
    	src/gallium/state_trackers/vega/renderer.c
    	src/gallium/state_trackers/vega/st_inlines.h
    	src/gallium/state_trackers/vega/vg_context.c
    	src/gallium/state_trackers/vega/vg_manager.c

commit 912f042e1d439de17b36be9a740358c876fcd144
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Dec 1 03:01:55 2010 +0100

    gallium: even more compile fixes after merge

commit 6fc95a58866d2a291def333608ba9c10c3f07e82
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Dec 1 00:22:26 2010 +0100

    gallium: some fixes after merge

commit a8d5ffaeb5397ffaa12fb422e4e7efdf0494c3e2
Merge: f7a202f 2da02e7
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 30 23:41:26 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/i915/i915_state_emit.c
    	src/gallium/state_trackers/vega/api_images.c
    	src/gallium/state_trackers/vega/vg_context.c

commit f7a202fde2aea2ec78ef58830f945a5e214e56ab
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Nov 24 19:19:32 2010 +0100

    gallium: even more fixes/cleanups after merge

commit 6895a7f969ed7f9fa8ceb788810df8dbcf04c4c9
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Nov 24 03:07:36 2010 +0100

    gallium: more compile fixes after merge

commit af0501a5103b9756bc4d79167bd81051ad6e8670
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 23 19:24:45 2010 +0100

    gallium: lots of compile fixes after merge

commit 0332003c2feb60f2a20e9a40368180c4ecd33e6b
Merge: 26c6346 b6b91fa
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Nov 23 17:02:26 2010 +0100

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/gallivm/lp_bld_sample.c
    	src/gallium/auxiliary/util/u_blit.c
    	src/gallium/auxiliary/util/u_blitter.c
    	src/gallium/auxiliary/util/u_inlines.h
    	src/gallium/auxiliary/util/u_surface.c
    	src/gallium/auxiliary/util/u_surfaces.c
    	src/gallium/docs/source/context.rst
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/nv50/nv50_state_validate.c
    	src/gallium/drivers/nvfx/nv04_surface_2d.c
    	src/gallium/drivers/nvfx/nv04_surface_2d.h
    	src/gallium/drivers/nvfx/nvfx_buffer.c
    	src/gallium/drivers/nvfx/nvfx_miptree.c
    	src/gallium/drivers/nvfx/nvfx_resource.c
    	src/gallium/drivers/nvfx/nvfx_resource.h
    	src/gallium/drivers/nvfx/nvfx_state_fb.c
    	src/gallium/drivers/nvfx/nvfx_surface.c
    	src/gallium/drivers/nvfx/nvfx_transfer.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r600/r600_blit.c
    	src/gallium/drivers/r600/r600_buffer.c
    	src/gallium/drivers/r600/r600_context.h
    	src/gallium/drivers/r600/r600_screen.c
    	src/gallium/drivers/r600/r600_screen.h
    	src/gallium/drivers/r600/r600_state.c
    	src/gallium/drivers/r600/r600_texture.c
    	src/gallium/include/pipe/p_defines.h
    	src/gallium/state_trackers/egl/common/egl_g3d_api.c
    	src/gallium/state_trackers/glx/xlib/xm_st.c
    	src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c
    	src/gallium/targets/libgl-gdi/libgl_gdi.c
    	src/gallium/tests/graw/tri.c
    	src/mesa/state_tracker/st_cb_blit.c
    	src/mesa/state_tracker/st_cb_readpixels.c

commit 26c6346b385929fba94775f33838d0cceaaf1127
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Aug 2 19:37:21 2010 +0200

    fix more merge breakage

commit b30d87c6025eefe7f6979ffa8e369bbe755d5c1d
Merge: 9461bf3 1f1928d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Aug 2 19:15:38 2010 +0200

    Merge remote branch 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_rast_priv.h
    	src/gallium/drivers/r300/r300_blit.c
    	src/gallium/drivers/r300/r300_screen_buffer.c
    	src/gallium/drivers/r300/r300_state_derived.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_texture.h
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/drivers/r600/r600_screen.c
    	src/gallium/drivers/r600/r600_state.c
    	src/gallium/drivers/r600/r600_texture.c
    	src/gallium/drivers/r600/r600_texture.h
    	src/gallium/state_trackers/dri/common/dri1_helper.c
    	src/gallium/state_trackers/dri/sw/drisw.c
    	src/gallium/state_trackers/xorg/xorg_exa.c

commit 9461bf3cfb647d2301364ae29fc3084fff52862a
Merge: 17492d7 0eaccb3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 15 20:13:45 2010 +0200

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/util/u_blitter.c
    	src/gallium/drivers/llvmpipe/lp_rast.c
    	src/gallium/drivers/llvmpipe/lp_surface.c
    	src/gallium/drivers/r300/r300_render.c
    	src/gallium/drivers/r300/r300_state.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/tests/trivial/quad-tex.c

commit 17492d705e7b7f607b71db045c3bf344cb6842b3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Jun 18 10:58:08 2010 +0100

    gallium: rename element_offset/width fields in views to first/last_element

    This is much more consistent with the other fields used there
    (first/last level, first/last layer).
    Actually thinking about removing the ugly union/structs again and
    rename first/last_layer to something even more generic which could also
    be used for buffers (like first/last_member) without inducing headaches.

commit 1b717a289299f942de834dcccafbab91361e20ab
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 14:46:09 2010 +0100

    gallium: remove PIPE_SURFACE_LAYOUT_LINEAR definition

    This was only used by the layout field of pipe_surface, but this
    driver internal stuff is gone so there's no need for this driver independent
    layout definition neither.

commit 10cb644b31b3ef47e6c7b55e514ad24bb891fac4
Merge: 5691db9 c85971d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 12:20:41 2010 +0100

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/docs/source/glossary.rst
    	src/gallium/tests/graw/fs-test.c
    	src/gallium/tests/graw/gs-test.c

commit 5691db960ca3d525ce7d6c32d9c7a28f5e907f3b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 17 11:29:03 2010 +0100

    st/wgl: fix interface changes bugs

commit 2303ec32143d363b46e59e4b7c91b0ebd34a16b2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 19:42:32 2010 +0100

    gallium: adapt code to interface changes...

commit dcae4f586f0d0885b72674a355e5d56d47afe77d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 19:42:05 2010 +0100

    gallium: separate depth0 and array_size in the resource itself.

    These fields are still mutually exclusive (since no 3d array textures exist)
    but it ultimately seemed to error-prone to adapt all code accept the new
    meaning of depth0 (drivers stick that into hardware regs, calculate mipmap
    sizes etc.). And it isn't really cleaner anyway.
    So, array textures will have depth0 of 1, but instead use array_size,
    3D textures will continue to use depth0 (and have array_size of 1). Cube
    maps also will use array_size to indicate their 6 faces, but since all drivers
    should just be fine by inferring this themselves from the fact it's a cube map
    as they always used to nothing should break.

commit 621737a638d187d208712250fc19a91978fdea6b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 17:47:38 2010 +0100

    gallium: adapt code to interface changes

    There are still usages of pipe_surface where pipe_resource should be used,
    which should eventually be fixed.

commit 2d17f5efe166b2c3d51957c76294165ab30b8ae2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 16 17:46:14 2010 +0100

    gallium: more interface changes

    In particular to enable usage of buffers in views, and ability to use a
    different pipe_format in pipe_surface.
    Get rid of layout and offset parameter in pipe_surface - the former was
    not used in any (public) code anyway, and the latter should either be computed
    on-demand or driver can use subclass of pipe_surface.
    Also make create_surface() use a template to be more consistent with
    other functions.

commit 71f885ee16aa5cf2742c44bfaf0dc5b8734b9901
Merge: 3232d11 8ad410d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 14:19:51 2010 +0100

    Merge commit 'origin/master' into gallium-array-textures

    Conflicts:
    	src/gallium/auxiliary/util/u_box.h
    	src/gallium/drivers/nv50/nv50_surface.c
    	src/gallium/drivers/nvfx/nvfx_surface.c
    	src/gallium/drivers/r300/r300_blit.c
    	src/gallium/drivers/r300/r300_texture.c
    	src/gallium/drivers/r300/r300_transfer.c
    	src/gallium/drivers/r600/r600_blit.c
    	src/gallium/drivers/r600/r600_screen.h
    	src/gallium/include/pipe/p_state.h

commit 3232d11fe3ebf7686286013c357b404714853984
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 11:40:04 2010 +0100

    mesa/st: adapt to interface changes

    still need to fix pipe_surface sharing
    (as that is now per-context).
    Also broken is depth0 handling - half the code assumes
    this is also used for array textures (and hence by extension
    of that cube maps would have depth 6), half the code does not...

commit f433b7f7f552720e5eade0b4078db94590ee85e1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 14 11:35:52 2010 +0100

    gallium: fix a couple of bugs in interface chnage fixes

commit 818366b28ea18f514dc791646248ce6f08d9bbcf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:42:11 2010 +0200

    targets: adapt to interface changes

    Yes even that needs adjustments...

commit 66c511ab1682c9918e0200902039247793acb41e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:41:13 2010 +0200

    tests: adapt to interface changes

    Everything needs to be fixed :-(.

commit 6b494635d9dbdaa7605bc87b1ebf682b138c5808
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:39:50 2010 +0200

    st: adapt non-rendering state trackers to interface changes

    might not be quite right in all places, but they really don't want
    to use pipe_surface.

commit 00c4289a35d86e4fe85919ec32aa9f5ffe69d16d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:38:48 2010 +0200

    winsys: adapt to interface changes

commit 39d858554dc9ed5dbc795626fec3ef9deae552a0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:26:54 2010 +0200

    st/python: adapt to interface changes

    don't think that will work, sorry.

commit 6e9336bc49b32139cec4e683857d0958000e15e3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:26:07 2010 +0200

    st/vega: adapt to interface changes

commit e07f2ae9aaf8842757d5d50865f76f8276245e11
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:25:56 2010 +0200

    st/xorg: adapt to interface changes

commit 05531c10a74a4358103e30d3b38a5eceb25c947f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:53 2010 +0200

    nv50: adapt to interface changes

commit 97704f388d7042121c6d496ba8c003afa3ea2bf3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:45 2010 +0200

    nvfx: adapt to interface changes

commit a8a9c93d703af6e8f5c12e1cea9ec665add1abe0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:24:01 2010 +0200

    i965g: adapt to interface changes

commit 0dde209589872d20cc34ed0b237e3ed7ae0e2de3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:22:38 2010 +0200

    i915g: adapt to interface changes

commit 5cac9beede69d12f5807ee1a247a4c864652799e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:20:58 2010 +0200

    svga: adapt to interface changes

    resource_copy_region still looking fishy.
    Was not very suited to unified zslice/face approach...

commit 08b5a6af4b963a3e4c75fc336bf6c0772dce5150
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:20:01 2010 +0200

    rbug: adapt to interface changes

    Not sure if that won't need changes elsewhere?

commit c9fd24b1f586bcef2e0a6e76b68e40fca3408964
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:31 2010 +0200

    trace: adapt to interface changes

commit ed84e010afc5635a1a47390b32247a266f65b8d1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:21 2010 +0200

    failover: adapt to interface changes

commit a1d4b4a293da933276908e3393435ec4b43cf201
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:19:12 2010 +0200

    identity: adapt to interface changes

commit a8dd73e2c56c7d95ffcf174408f38f4f35fd2f4c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:55 2010 +0200

    softpipe: adapt to interface changes

commit a886085893e461e8473978e8206ec2312b7077ff
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:44 2010 +0200

    llvmpipe: adapt to interface changes

commit 70523f6d567d8b7cfda682157556370fd3c43460
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:14 2010 +0200

    r600g: adapt to interface changes

commit 3f4bc72bd80994865eb9f6b8dfd11e2b97060d19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:18:05 2010 +0200

    r300g: adapt to interface changes

commit 5d353b55ee14db0ac0515b5a3cf9389430832c19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:17:37 2010 +0200

    cell: adapt to interface changes

    not even compile tested

commit cf5d03601322c2dcb12d7a9c2f1745e2b2a35eb4
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:14:59 2010 +0200

    util: adapt to interface changes

    amazing how much code changes just due to some subtle interface changes?

commit dc98d713c6937c0e177fc2caf23020402cc7ea7b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 12 02:12:40 2010 +0200

    gallium: more interface fail, docs

    this also changes flush_frontbuffer to use a pipe_resource instead of
    a pipe_surface - pipe_surface is not meant to be (or at least no longer)
    an abstraction for standalone 2d images which get passed around.
    (This has also implications for the non-rendering state-trackers.)

commit 08436d27ddd59857c22827c609b692aa0c407b7b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 10 17:42:52 2010 +0200

    gallium: fix array texture interface changes bugs, docs

commit 4a4d927609b62b4d7fb9dffa35158afe282f277b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 3 22:02:44 2010 +0200

    gallium: interface changes for array textures and related cleanups

    This patch introduces array textures to gallium (note they are not immediately
    usable without the associated changes to the shader side).
    Also, this abandons pipe_subresource in favor of using level and layer
    parameters since the distinction between several faces (which was part of
    pipe_subresource for cube textures) and several z slices (which were not part
    of pipe_subresource but instead part of pipe_box where appropriate for 3d
    textures) is gone at the resource level.
    Textures, be it array, cube, or 3d, now use a "unified" set of parameters,
    there is no distinction between array members, cube faces, or 3d zslices.
    This is unlike d3d10, whose subresource index includes layer information for
    array textures, but which considers all z slices of a 3d texture to be part
    of the same subresource.
    In contrast to d3d10, OpenGL though reuses old 2d and 3d function entry points
    for 1d and 2d array textures, respectively, which also implies that for instance
    it is possible to specify all layers of a 2d array texture at once (note that
    this is not possible for cube maps, which use the 2d entry points, although
    it is possible for cube map arrays, which aren't supported yet in gallium).
    This should possibly make drivers a bit simpler, and also get rid of mutually
    exclusive parameters in some functions (as z and face were exclusive), one
    potential downside would be that 3d array textures could not easily be supported
    without reverting this, but those are nowhere to be seen.

    Also along with adjusting to new parameters, rename get_tex_surface /
    tex_surface_destroy to create_surface / surface_destroy and move them from
    screen to context, which reflects much better what those do (they are analogous
    to create_sampler_view / sampler_view_destroy).

    PIPE_CAP_ARRAY_TEXTURES is used to indicate if a driver supports all of this
    functionality (that is, both sampling from array texture as well as use a range
    of layers as a render target, with selecting the layer from the geometry shader).
2010-12-02 04:33:43 +01:00
Chris Wilson f6476822a0 i915g: Fix closure of full batch buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: incorporate comments by Dr_Jakob]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:14 +01:00
Daniel Vetter 2ff0879a63 i915g: return tiling in iws->buffer_from_handle
This is needed to properly implement tiling flags. And the gem
implemention fo buffer_from_handle already calls get_tiling, so
it's for free.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter 135b083461 i915g: prepare winsys/batchbuffer for execbuf2
Wire up a fenced parameter, switch all relocations to _FENCED

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter 1c60840338 i915g: switch to tiled allocations, kill set_fence
This way relaxed fencing is handled by libdrm. And buffers _can't_
ever change their tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:13 +01:00
Daniel Vetter 4a666488c4 i915g: add winsys function to create tiled buffers
Different kernels have different restrictions for tiled buffers.
Hence use the libdrm abstraction to calculate the necessary
stride and height alignment requirements.

Not yet used.

v2: Incorporate review comments from Jakob Bornecrantz

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:12 +01:00
Daniel Vetter c62f5c7e7b i915g: drop alignment parameter from iws->buffer_create
It's unnecessary. The kernel gem ignores it totally and we can't
run on the old userspace fake bo manager due to lack of dri2.

Also drop the redundant name string from the sw winsys as suggested
by Jakob Bornecrantz

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-12-02 01:34:12 +01:00
Dave Airlie 3b5a3fd8d1 r300g/r600g: bump cache manager timeouts to 1s
On lightsmark on my r500 this drop the bufmgr allocations of the sysprof.
2010-11-25 09:18:19 +10:00
Alex Deucher ed8b5fb24e gallium/egl: fix r300 vs r600 loading
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=31841
2010-11-23 15:18:31 -05:00
Alex Deucher 0e4c5f63b9 r600g: add support for ontario APUs
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-11-22 18:01:26 -05:00
Alex Deucher 271b7b5914 r600g: fix some winsys functions to deal properly with evergreen
Are these functions actually used anywhere?
2010-11-22 17:39:54 -05:00
Alex Deucher bf9c80976f r600g: fix additional EVENT_WRITE packet
Add explicit EVENT_TYPE field
2010-11-22 17:39:16 -05:00
Christian König e6b71530da Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
2010-11-21 19:40:52 +01:00
Daniel Vetter c8fca58d9d i915g: kill idws->pool
The drm winsys only ever handles one gem memory manager. Rip out
the unnecessary complication.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Daniel Vetter e182618853 i915g: kill buf->map_gtt
Not using the gtt is considered harmful for performance. And for
partial uploads there's always drm_intel_bo_subdata.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-11-21 16:41:19 +01:00
Jerome Glisse f609b2ab03 r600g: add fetch shader capabilities
Use fetch shader instead of having fetch instruction in the vertex
shader. Allow to restrict shader update to a smaller part when
vertex buffer input layout changes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-19 13:40:55 -05:00
Alex Deucher 3e76ed4e25 r600g: All EVENT_WRITE packets need the EVENT_INDEX field
6xx-evergreen
2010-11-19 13:35:53 -05:00
Jerome Glisse fab804bdfe r600g: fix occlusion query on evergreen (avoid lockup)
Occlusion query on evergreen need the event index field to be
set otherwise we endup locking up the GPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-19 11:53:01 -05:00
Alex Deucher a23f25eba1 r600g: fix buffer alignment
This should fix the remaining buffer alignment issues in r600g.
2010-11-17 21:33:40 -05:00
Henri Verbeet da8c877733 r600g: Cleanup the fenced_bo list in r600_context_fini(). 2010-11-15 22:20:12 +01:00
Christoph Bumiller 4c22475383 nvc0: import nvc0 gallium driver 2010-11-12 15:17:40 +01:00
Christian König 195bbe8ce2 Merge remote branch 'origin/master' into pipe-video 2010-11-11 21:07:42 +01:00
Jerome Glisse 8e0230a85c r600g: allow driver to work without submitting cmd to GPU
For driver performance analysis it usefull to be able to
disable as much as possible the GPU interaction so that
one can profile the userspace only.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-11-10 16:49:50 -05:00
Keith Whitwell 9a04eca2f8 ws/r600: match bo_busy shared/fence logic in bo_wait
Fixes crash in piglit depthrange-clear.
2010-11-10 11:04:38 +00:00
Vinson Lee 520140a6c9 winsys/xlib: Add cygwin to SConscript.
Fixes SCons NameError exception on Cygwin.
2010-11-09 12:31:11 -08:00
Benjamin Franzke 46c1970067 r600g: implement texture_get_handle (needed for eglExportDRMImageMESA) 2010-11-08 13:44:54 -05:00
Jakob Bornecrantz b4ac0adb75 scons: Detabify
Drivers scons files for a later time
2010-11-05 20:58:49 +00:00
Keith Whitwell c3974dc837 r600g: set hardware pixel centers according to gl_rasterization_rules
These were previously being left in the default (D3D) mode.  This mean
that triangles were drawn slightly incorrectly, but also because this
state is relied on by the u_blitter code, all blits were half a pixel
off.
2010-11-03 09:36:01 +00:00
Keith Whitwell 29c4a15bf6 r600g: propogate resource usage flags to winsys, use to choose bo domains
This opens the question of what interface the winsys layer should
really have for talking about these concepts.

For now I'm using the existing gallium resource usage concept, but
there is no reason not use terms closer to what the hardware
understands - eg. the domains themselves.
2010-11-03 09:36:01 +00:00
Tilman Sauerbeck 907efeea18 r600g: Fixed two memory leaks in winsys.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck 86778dadc5 r600g: Made radeon_bo::map_count signed.
That way assert(map_count >= 0) can actually fail when we screwed up.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:39 +01:00
Tilman Sauerbeck 34e75b0ca8 r600g: Fixed unmap condition in radeon_bo_pb_destroy().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck b675266f0e r600g: Made radeon_bo_pb_map_internal() actually call radeon_bo_map().
This ensures that we increase bo->map_count when radeon_bo_map_internal()
returns successfully, which in turn makes sure we don't decrement
bo->map_count below zero later.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
Tilman Sauerbeck 4e34393162 r600g: Removed unused 'ptr' argument from radeon_bo().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-11-02 21:52:38 +01:00
José Fonseca 601498ae73 scons: Revamp how to specify targets to build.
Use scons target and dependency system instead of ad-hoc options.

Now is simply a matter of naming what to build. For example:

  scons libgl-xlib

  scons libgl-gdi

  scons graw-progs

  scons llvmpipe

and so on. And there is also the possibility of scepcified subdirs, e.g.

  scons src/gallium/drivers

If nothing is specified then everything will be build.

There might be some rough corners over the next days. Please bare with me.
2010-11-01 13:30:22 +00:00
Christian König 41ed47d6b8 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	src/gallium/include/pipe/p_format.h
2010-10-28 20:24:56 +02:00
Tilman Sauerbeck c6b10cd986 r600g: In radeon_bo(), call LIST_INITHEAD early.
radeon_bo_destroy() will want to read the list field. Without this patch,
we'd end up evaluating the list pointers before they have been properly
set up when we destroyed the newly created bo if it cannot be mapped.

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-10-27 08:44:35 +02:00
Christian König ba9caba9c8 Some more merge fixes 2010-10-23 13:54:47 +02:00
Dave Airlie 39c742fe2a r600g: not fatal if we can't get tiling info from kernel 2010-10-23 07:45:59 +10:00
Brian Paul aa86c7657c winsys/xlib: rename xm->xlib
Move away from the old Mesa-oriented names.
2010-10-21 19:55:03 -06:00
Brian Paul 3bc6fe371c winsys/xlib: fix up allocation/dealloction of XImage
Fixes a crash upon exit when using remote display.
2010-10-21 19:49:34 -06:00
Brian Paul 4d24f01cb3 winsys/xlib: use Bool type for shm field 2010-10-21 19:37:11 -06:00
Brian Paul e3298eaf52 winsys/xlib: formatting fixes 2010-10-21 19:17:44 -06:00
Dave Airlie 8a74f7422b r600g: retrieve tiling info from kernel for shared buffers.
we need to know if the back is tiled so we can blit from it properly.
2010-10-18 13:46:42 +10:00
Dave Airlie 7b3fa03883 r600g: get tiling info from kernel 2010-10-18 09:25:22 +10:00
Christian König b13a0af510 Fix problems created by Merge 2010-10-16 16:41:09 +02:00
Jakob Bornecrantz 44207ff71b wrapper: Add a way to dewrap a pipe screen without destroying it 2010-10-15 19:13:00 +01:00
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
Christian König 695cc370a2 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/nvfx/Makefile
	src/gallium/include/pipe/p_defines.h
	src/gallium/include/pipe/p_screen.h
	src/gallium/include/state_tracker/dri1_api.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/winsys/nouveau/drm/nouveau_drm_api.c
2010-10-12 23:07:29 +02: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
Dave Airlie 09ef8e9283 r300g: fix buffer reuse issue caused by previous commit
caused by 0b9eb5c9bb

test run glxgears, resize.
2010-09-15 13:26:04 +02:00
Marek Olšák 0b9eb5c9bb r300g: prevent creating multiple winsys BOs for the same handle
This fixes a DRM deadlock in the cubestorm xscreensaver, because somehow
there must not be 2 different BOs relocated in one CS if both BOs back
the same handle. I was told it is impossible to happen, but apparently
it is not, or there is something else wrong.
2010-09-15 04:29:18 +02:00
Marek Olšák ae1aa14965 r300g: fix map_buffer
https://bugs.freedesktop.org/show_bug.cgi?id=30145
2010-09-13 07:52:13 +02:00
Dave Airlie b5fcf0c8e0 pb: add void * for flush ctx to mapping functions
If the buffer we are attempting to map is referenced by the unsubmitted
command stream for this context, we need to flush the command stream,
however to do that we need to be able to access the context at the lowest
level map function, currently we set the buffer in the toplevel map, but this
racy between context. (we probably have a lot more issues than that.)

I'll look into a proper solution as suggested by jrfonseca when I get some time.
2010-09-12 13:32:43 +10:00
Tilman Sauerbeck 0b4c529da5 r600g: Only increase a bo's map_count if radeon_bo_map() succeeded.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Tilman Sauerbeck 56a80535b6 r600g: Fixed a bo leak in the error path of radeon_ctx_set_bo_new().
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-10 13:09:33 +02:00
Dave Airlie fcae8ca575 r600g: fixup state calculations for picking states.
for evergreen I ended up using a non-contig array of states, but
this code needs a bit of fixing up to deal with that.
2010-09-10 22:41:00 +10:00
Dave Airlie ad5ada4372 r600g: evergreen CBs are more sane to support with a single state 2010-09-10 13:52:02 +10:00
Dave Airlie 7d564fdddd r600g: add multi-buffer flush support properly. 2010-09-10 13:52:02 +10:00
Dave Airlie ab686d340a r600g: fix regression in multi-buffer tests since CB flush merge 2010-09-10 13:52:02 +10: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 42da027433 r600g: align flushing of cb/db with DDX/r600c.
the DDX and r600c both flush cb/db after the draw is emitted,
as long as they do that, r600g can't be different, as it races.

We end up with r600g flush, set CB, DDX set CB, flush. This
was causing misrendering on my evergreen, where sometimes the drawing
would go to an old CB.
2010-09-10 11:29:23 +10:00
Dave Airlie e795ca8f31 r600g: don't need 3 bos here.
the code should reloc correctly a single BO 3 times.
2010-09-10 11:29:23 +10:00
Brian Paul 5c3f678790 winsys: emit warning in null_sw_displaytarget_create() 2010-09-09 19:19:28 -06:00
Dave Airlie d42efb9e8d r600g: add support for constants in memory buffers.
DX9 constants were in the constant file, and evergreen no longer support
cfile. r600/700 can also use constants in memory buffers, so add the code
(disabled for now) to enable that as precursor for evergreen.
2010-09-08 08:41:57 +10:00
Dave Airlie 48cdad70d9 r600g: add script to generate header file with offsets into state objects.
This was inherently fragile as any changes to r600_states.h would also
need manual updating of all of the bits in radeon.h. Just add a simple
python script to do the conversion, its not hooked up to make at all.

This also will make adding evergreen a bit easier.
2010-09-06 10:28:08 +10:00
Jerome Glisse f8d11b2e8e r600g: force unbind of previously bind sampler/sampler_view
Previously bind sampler/sampler_view can be converted and endup
overwritting the current state we want to schedule. Example :
bind texA texB to sampler_view[0] & sampler_view[1], render,
bind texB to sampler_view[0] render. Now state associated to
texB are set to configure sampler_view slot 0, but as we don't
unbind sampler_view[1] still point to texB state so we end up
with sampler_view[1] overwritting sampler_view[0], which gives
wrong rendering if next rendering bind texA to sampler_view[0],
it will endup as texB is bound to sampler_view[0]. If you are
not confuse at that point give me a call i will be buying you
beer.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-02 16:58:47 -04:00
Jerome Glisse e73c5501b2 r600g: fix memory/bo leak
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-02 11:47:30 -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 c48ae0b6ed r600g: drop file I added by mistake in a previous commit 2010-08-29 18:45:26 +10: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
Marcin Slusarz a49167c1c0 nouveau: handle early initialization errors
handle very early errors in pipe_screen creation (failure of
nouveau_screen_init in nv50_screen_create)

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2010-08-26 00:28:01 +02: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
Henri Verbeet 8a878c266a r600g: Don't blindly unmap NULL->size.
There may actually be something mapped in that range, especially for large
buffers like e.g. the GL Drawable.
2010-08-22 12:43:11 +02:00
Dave Airlie 63d010115c r600g: add occlusion query support
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20 16:43:44 +02:00
Luca Barbieri 96a82cc314 winsys/sw: use PIPE_TEXTURE_RECT if appropriate 2010-08-20 12:04:08 +02:00
Dave Airlie 6043ee6e62 r600g: kill event type magic number in winsys
these events have names, use them.
2010-08-17 16:07:48 +10:00
Dave Airlie 3e58007892 r600g: add user clip plane support.
Apart from the fact that the radeon.h/r600_states.h editing is a nightmare, this
wasn't so bad.

passes piglit user-clip test now also trivial tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 14:19:09 +10:00
Dave Airlie f50df65fcc r600g: drop libdrm_radeon link 2010-08-17 10:56:58 +10:00
Vinson Lee db0e24e34a scons: Fix r600g build. 2010-08-14 12:18:51 -07:00
Vinson Lee 77458b565a r600g: Remove unnecessary headers. 2010-08-14 11:56:26 -07:00
Vinson Lee e01a49af61 r300g: Remove unnecessary header. 2010-08-14 11:44:01 -07:00
Dave Airlie 527ac905f6 r600g: fix warning in the winsys 2010-08-13 10:22:46 +10:00
Dave Airlie f2804e7062 r600g: fix memory leaks running gears.
I noticed gears memory usage was heading skywards, some r600 "states"
aren't properly refcounted, and the ctx->state is never freed.
2010-08-13 10:22:46 +10:00
Vinson Lee 61205f6189 svga: Remove unnecessary headers. 2010-08-10 17:53:08 -07:00
Jerome Glisse 72f8edfc0b r600g: avoid reemiting literal, avoid scheduling empty cs
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-10 11:53:05 -04:00
Marek Olšák 757c78afe7 r300g: generalize the way we ask for hyperz
This makes it compatible with the modified DRM interface in drm-radeon-testing.

Also, now you need to set RADEON_HYPERZ=1 to be able to use hyperz.
It's not bug-free yet.
2010-08-08 22:28:35 +02:00
Jerome Glisse c3ad060488 r600g: finish multi target rendering support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 16:12:22 -04:00
Jerome Glisse 6e6103004c Revert "r600g: don't use dynamic state allocation for states"
This reverts commit 9c949d4a4d.

Conflicts:

	src/gallium/drivers/r600/r600_context.h
	src/gallium/drivers/r600/r600_draw.c
	src/gallium/drivers/r600/r600_shader.c
	src/gallium/drivers/r600/r600_state.c
2010-08-06 10:59:27 -04:00
Marek Olšák 4d10ec4f18 r300g: do not emit GB_Z_PEQ_CONFIG on non-r500 if DRM < 2.6.0 2010-08-06 03:14:43 +02:00
Jerome Glisse 9c949d4a4d r600g: don't use dynamic state allocation for states
Simplify state handly by avoiding state allocation.
Next step is to allocate once for all context packet
buffer and then avoid rebuilding pm4 packet each time
(through use of combined crc) this would also avoid
number of memcpy.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-05 15:41:35 -04:00
Marek Olšák fc94fd9bfa r300g: debug_print on startup whether we can use hyper-z 2010-08-05 19:05:11 +02:00
Dave Airlie 6eb2a7fbaf r300g: implement hyper-z support. (v4)
This implements fast Z clear, Z compression, and HiZ support for r300->r500
GPUs.

It also allows cbzb clears when fast Z clears are being used for the ZB.

It requires a kernel with hyper-z support.

Thanks to Marek Olšák <maraeo@gmail.com>, who started this off, and Alex Deucher at AMD for providing lots of hints.

v2:
squashed zmask ram size fix]
squashed r300g/blitter: fix Z readback when compressed]

v3:
rebase around texture changes in master - .1 fix more bits

v4:
migrated to using u_mm in r300_texture to manage hiz/zmask rams consistently
disabled HiZ when using OQ
flush z-cache before turning hyper-z off
update hyper-z state on dsa state change
store depthclearvalue across cbzb clears and replace it afterwards.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-05 20:32:05 +10:00
Jerome Glisse 6f0f6c6459 r600g: split pipe state creating/binding from hw state creation
Split hw vs pipe states creation handling as hw states group doesn't
match pipe state group exactly. Right now be dumb about that and
rebuild all hw states on each draw call. More optimization on that
side coming.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 19:36:16 -04:00
Marek Olšák 065e3f7ff2 r300g: reject resources from handles which are not large enough
The driver gets a buffer and its size in resource_from_handle.
It computes the required minimum buffer size from given texture
properties, and compares the two sizes.

This is to early detect DDX bugs.
2010-07-25 10:25:21 +02:00
Thomas Hellstrom a96feddddb xorg/vmwgfx: Implement early mode pruning based on max fb size.
Also move some initialization from screen init to pre-init, now
that it is possible.

Also import a new vmwgfx drm (1.3) header.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-07-23 04:48:33 +02:00
Jakob Bornecrantz 095e99ddf6 i915g: Rename winsys debug options 2010-07-22 20:26:35 -07:00
Dave Airlie 9433d0e801 r600g: add family retrival
allow pipe driver to get the family of the gpu.
2010-07-21 17:05:36 -04:00
Marek Olšák 3eb5577783 r300g: do not make copies of constant buffers, emit them directly 2010-07-16 21:13:21 +02:00
Marek Olšák fe3caa91d3 r300g: rebuild winsys and command submission to support multiple contexts 2010-07-16 08:51:16 +02:00
Marek Olšák d63cb78ddd r300g: do not print a rejected CS if RADEON_DUMP_CS is not set
Also print relocation failures on non-debug builds too.
2010-07-10 20:46:26 +02:00
Marek Olšák 61a26cdfdc r300g: store/return the stride for winsys_handle in winsys 2010-07-08 22:39:52 +02:00
Jakob Bornecrantz 2d818ed0f8 i915g: Add flag to not send commands to hw 2010-07-04 13:32:02 +01:00
Jakob Bornecrantz 34bd0569d3 i915g: If the kernel reject the batchbuffer print it then assert 2010-07-04 13:32:02 +01:00
Marek Olšák 6a34287bb5 r300g: move one flush from winsys to the context
This flush happens when changing the tiling flags, and it should really be
done in the context.

I hope this fixes FDO bug #28630.
2010-06-30 00:03:04 +02:00
Jakob Bornecrantz a01e0afd9f Merge branch 'gallium-drm-driver-drescriptor'
Conflicts:
	src/gallium/state_trackers/egl/x11/native_dri2.c
	src/gallium/state_trackers/egl/x11/native_x11.c
	src/gallium/state_trackers/egl/x11/native_x11.h
	src/gallium/state_trackers/xorg/xorg_driver.c
	src/gallium/winsys/radeon/drm/radeon_drm.c
2010-06-28 21:14:45 +02:00
Jakob Bornecrantz 09b73b2a5f i965g: Remove last references to drm_api 2010-06-24 02:30:00 +02:00
Jakob Bornecrantz 59981d418f gallium: Fix scons build 2010-06-24 02:15:50 +02:00
Jakob Bornecrantz 92fde20de3 r600g: Move bootstrap code to target 2010-06-24 02:15:50 +02:00
Jakob Bornecrantz cf91accc93 nouveau: Move bootstrap code to targets
Well sorta, at least I removed the drm_api dependancy and the
target can layer anything it wants to now.
2010-06-23 23:15:07 +02:00
Jakob Bornecrantz 10e3b9f4d0 nouveau: Rename winsys file 2010-06-23 22:49:11 +02:00
Corbin Simpson 9526305834 glhd: Use an environment variable (GALAHAD) to enable. Off by default. 2010-06-23 11:06:42 -07:00
Corbin Simpson 7dc1cf19ac radeong: Disable Galahad for now; breaks texturing. 2010-06-23 00:11:42 -07:00
Corbin Simpson 40faedfe7b targets, radeong: Add Galahad.
Currently unconditional and causes segfaults.
2010-06-22 22:49:13 -07:00
Jakob Bornecrantz 23a915e2cf gallium: Drop sw drm winsys
Last user went away
2010-06-23 03:43:52 +02:00
Jakob Bornecrantz 41e0f6bc2f i965g: Move bootstrap code to targets 2010-06-23 03:43:48 +02:00
Jakob Bornecrantz 0106be903a i965g: Rename winsys file 2010-06-23 03:20:45 +02:00
Jakob Bornecrantz 2b15e37348 i965g: Moved pci_id to winsys struct 2010-06-23 03:20:45 +02:00
Marek Olšák eb7ef433bb r300g: optimize the immediate mode emission path a bit 2010-06-22 06:50:23 +02:00
Marek Olšák c85e53bebf r600g: handle DRM_API_HANDLE_TYPE_KMS in buffer_get_handle 2010-06-20 03:59:32 +02:00
Marek Olšák e4fe18a620 r300g: cleanup buffer_{from, get}_handle 2010-06-20 03:59:32 +02:00
Marek Olšák 1c0e5ba9f1 r300g: drop begin_cs/end_cs
I have had a look at the libdrm sources and they just contain more or less
the same checking we do in macros, and begin_cs may realloc the CS buffer
if we overflow it, which never happens with r300g. So these are pretty
much useless.

There is a small but measurable performance increase by dropping the two
functions.
2010-06-14 12:46:38 +02:00
Marek Olšák ae182296ce r300g: replace r300_cs_info with simplier get_cs_free_dwords 2010-06-13 17:43:38 +02:00
Chia-I Wu ce0c837f60 winsys: Add fbdev software winsys.
This is a simple winsys that mmap()s the framebuffer device and
memcpy()s the contents of display targets to the framebuffer device for
displaying.
2010-06-11 12:23:38 +08:00
Younes Manton 6414952efe vl: Drop DRI1, clean up DRI2 bits. 2010-06-06 12:19:22 -04:00
Jakob Bornecrantz 6e3fc2de2a r300g: Move bootstrap code to targets 2010-06-06 13:02:56 +01:00
Jakob Bornecrantz c7015877be i915g: Move bootstrap code to targets 2010-06-06 13:02:49 +01:00
Jakob Bornecrantz 9ff10b67bc svga: Move bootstrap code to targets 2010-06-06 13:02:43 +01:00
Jakob Bornecrantz 20ef3a793f nouveau: Remove left over argument in drm api 2010-06-06 12:12:54 +01:00
Vinson Lee f5b9ad9a7d i915g: Rename winsys c file.
This was missed in commit e7f0f6bb72.
Fixes i915g SCons build.
2010-06-04 16:19:08 -07:00
Marek Olšák bb45a15168 r300g: use r300_buffer_domain everywhere 2010-06-02 06:26:15 +02:00
Marek Olšák 37f3454eb3 r300g: let the driver determine the GEM domain for buffer_create 2010-06-02 06:01:22 +02:00
Thomas Hellstrom d12f2bb9c0 st/xorg, vmware: Make throttling configurable.
The xorg state tracker gets two new options to let the user choose
whether to enable / disable dirty throttling and swapbuffer throttling.
The default value of these options are enabled, unless the winsys
supplies a customizer with other values. The customizer record has been
extended to allow this, and also to set winsys-based throttling on a per-
context basis.

The vmware part of this patch disables the dirty throttling if the kernel
supports command submission throttling, and also in that case sets kernel
based throttling for everything but swapbuffers. The vmware winsys does not
set throttling per context, even if it theoretically could, but instead
sets throttling per screen. This should perhaps be changed, should the
xorg state tracker start to use multiple rendering contexts. Kernel throttling
is off by default for all new screens/contexts, so the dri state tracker
is not affected.

This significantly improves interactivity of the vmware xorg driver.

Cherry-picked from commit a8f3b3f88acc1f0193fa740e76e9d815f07f32ab

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2010-05-31 22:34:59 +01:00
Alex Deucher 3b869b4cdb r600g: RS880 is r6xx-based
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-30 16:08:55 -04:00
Younes Manton ea3a01ae4d vl: Get nouveau building again.
Still some DRI2 bits to sort out.
2010-05-29 19:22:14 -04:00
Marek Olšák b5c147caba r600g: remove unused variable 2010-05-29 15:41:22 +02:00
Marek Olšák 7d9396d7cf r600g: fix gallium function parameters 2010-05-29 15:41:22 +02:00
Jakob Bornecrantz e7f0f6bb72 i915g: Rename winsys c file 2010-05-29 13:31:30 +02:00
Jakob Bornecrantz 835f5a65a1 i915g: Move pci id to winsys struct 2010-05-29 13:30:25 +02:00
Jakob Bornecrantz aeee52691c r600g: Integrate into build
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-05-27 23:24:12 +02:00