Commit Graph

12 Commits

Author SHA1 Message Date
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
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
Marek Olšák de22d8f1ee r300g: remove unused function prototypes, update copyright 2011-02-11 06:07:23 +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
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
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
Vinson Lee 075a807f43 r300g: Remove unnecessary header. 2010-12-23 16:05:28 -08: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
Marek Olšák 6947e52548 r300g: cleanup winsys 2010-12-05 05:47:10 +01:00
Renamed from src/gallium/winsys/radeon/drm/radeon_drm.c (Browse further)