Commit Graph

1209 Commits

Author SHA1 Message Date
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
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
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
Marek Olšák b8fb1d75ce r600g: adapt to latest interfaces changes
- Wrapped the buffer and texture create/destroy/transfer/... functions
  using u_resource, which is then used to implement the resource functions.
- Implemented texture transfers.
  I left the buffer and texture transfers separate because one day we'll
  need a special codepath for textures.
- Added index_bias to the draw_*elements functions.
- Removed nonexistent *REP and *FOR instructions.
- Some pipe formats have changed channel ordering, so I've removed/fixed
  nonexistent ones.
- Added stubs for create/set/destroy sampler views.
- Added a naive implementation of vertex elements state (new CSO).
- Reworked {texture,buffer}_{from,to}_handle.
- Reorganized winsys files, removed dri,egl,python directories.
- Added a new build target dri-r600.
2010-05-27 23:24:02 +02:00
Jerome Glisse 72128962d6 r600g: Initial import 2010-05-27 23:23:56 +02:00
Brian Paul 0faefb194e sw/xlib: avoid dereferencing a null pointer 2010-05-27 13:40:16 -06:00
Marek Olšák a81730cb32 r300g: add get_cs_info winsys entrypoint, abandon check_cs 2010-05-26 22:22:52 +02:00
Jakob Bornecrantz b9706886db drm_api: Remove type argument from create screen callback
With the removal of DRI1 support there where no use of this argument,
some drivers didn't even properly check it.
2010-05-25 19:05:07 +01:00
Jakob Bornecrantz 395b605e19 gallium: Remove dri1_api.h and winsys support for DRI1
Since DRI1 support was dropped from st/dri it
makes no sense to keep this code around.
2010-05-25 19:04:11 +01:00
Brian Paul e5d0c730d1 sw/xlib: NULL-out pointers after freeing image data
This fixes a double-free() error when not using a shared memory XImage.
The XDestroyImage() function frees the ximage->data buffer if non-NULL.
If we free it ourselves, we also need to NULL-out the pointer.
2010-05-24 16:21:55 -06:00
Jakob Bornecrantz 734522acee xorg-vmwgfx: Add vmwctrl proto 2010-04-30 11:47:27 +01:00