Commit Graph

461 Commits (3a387a983ec40cd443e22c1f8d9a6b5b5a8fa0d1)

Author SHA1 Message Date
Patrice Mandin 3a387a983e nouveau: nv30: add render target logbase2 width,height 2009-10-13 22:50:46 +02:00
Chris Wilson 901bacd29c intel: Fallback to atomic-ops.h [libatomic-ops-dev]
Use the external implementation for atomic operations across a wide
range of architectures.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-13 15:13:00 +01:00
Eric Anholt 9764061ab1 intel: Remove the asserts about the ignored alignment parameter.
I slipped it in with the alloc_tiled changes, since we were explicitly
throwing the parameter away.  It caught some bogus released code, which
we've now fixed, so remove the asserts to keep old drivers working.
2009-10-08 15:55:02 -07:00
Jesse Barnes 3a7dfcdfaf intel: Add a bo_alloc function for tiled BOs.
This simplifies driver code in handling object allocation, and also gives us
an opportunity to possibly cache tiled buffers if it turns out to be a win.

[anholt: This is chopped out of the execbuf2 patch, as it seems to be useful
separately and cleans up the execbuf2 changes to be more obvious]
2009-10-06 15:45:10 -07:00
Eric Anholt 02c775fc75 intel: Fix up some stale doxygen comments. 2009-10-06 15:45:10 -07:00
Eric Anholt d70d60529f intel: Reformat to the kernel coding style. Welcome to the 8-space future.
This is done with:
Lindent *.[ch]
perl -pi -e 's|drm_intel_bo \* |drm_intel_bo *|g' *.[ch]
perl -pi -e 's|drm_intel_bufmgr \* |drm_intel_bufmgr *|g' *.[ch]
perl -pi -e 's|drm_intel_bo_gem \* |drm_intel_bo_gem *|g' *.[ch]
perl -pi -e 's|drm_intel_bufmgr_gem \* |drm_intel_bufmgr_gem *|g' *.[ch]
perl -pi -e 's|_fake \* |_fake *|g' *.[ch]
hand-editing to whack indented comments into line and other touchups.
2009-10-06 15:45:06 -07:00
Eric Anholt 3c9bd068e0 intel: Don't allocate more relocation entries than the BO could support.
This saves 32k of relocation entry storage for many 965 state buffers.  No
noticeable impact on performance for cairo-gl firefox.
2009-10-06 13:30:07 -07:00
Chris Wilson ab3300c581 intel: Add a configure option to *disable* building libdrm-intel
In conjunction with the atomic operation patch, it may be more
convenient for some people to disable building libdrm-intel and its
dependencies upon the atomic intrinsics then it is for them to use a
supported compiler.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-03 22:58:25 +01:00
Chris Wilson 61bddf8504 intel: report errno
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-10-03 22:58:16 +01:00
Nicolai Hähnle a5fb264257 libdrm_radeon: Zero-initialize structures to silence valgrind warnings
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-10-03 13:46:10 +02:00
Chris Wilson 04495eeec2 intel: Use atomic refcounters
As the target architecture for Intel GPUs is the x86, we can presume to
have reasonable compiler support for Intel atomic intrinsics, i.e. gcc,
and so use those in preference to pulling in a complicated mess of
fragile assembly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[anholt: hand-resolved against my previous commit.  This brings cairo-gl
firefox-talos-gfx time from 65 seconds back down to 62 seconds.]
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-02 13:21:23 -07:00
Chris Wilson 0fb215ae31 intel: Mark cached bo as purgeable
Set the DONTNEED flag on cached buffers so that the kernel is free to
discard those when under memory pressure.

[anholt: This takes firefox-talos-gfx time from ~62 seconds to ~65 seconds
on my GM965, but it seems like a hit worth taking for the improved
functionality from saving memory]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-10-02 12:54:13 -07:00
Eric Anholt 12d9b7cc85 intel: Don't free the reloc list when putting a freed BO in the cache.
This takes firefox-talos-gfx from 74 seconds to 70 seconds on my GM965.
2009-10-02 11:11:31 -07:00
Eric Anholt 769b105780 intel: Add a new function to check if a BO's reloc tree references some BO.
There are a bunch of places in GL where if we can't do this we have to
flush the batchbuffer, and the cost of lookups here is outweighed by flush
savings.
2009-10-01 19:09:26 -07:00
Eric Anholt 51b89733c5 intel: Remove the max_entries stuff that complicated bo reuse.
I thought I was going to do all sorts of crazy experiments with it.  I never
did, and it turned out the free-after-a-few-seconds plan is working out fine.
2009-09-21 15:23:05 -07:00
Eric Anholt 456a358b9a intel: Remove the old swrast flag for reducing cache flushing.
It hasn't been doing anything effective since
52e5d24fae, and we pretty much don't bo_map
pinned buffers any more anyway.
2009-09-21 15:23:05 -07:00
Keith Packard 0a24654129 drmModeFreeConnector: free encoders and properties
These were leaking.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-17 17:28:49 -07:00
Dave Airlie cdd325b59a radeon: fix 32/64 bit issue with sign extension
Not sure what intptr_t was up to here.

Reported and tested by: Kevin DeKorte
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-09-15 07:30:22 +10:00
Zhenyu Wang 67e4172394 libdrm_intel: include B43 chipset check
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-09-07 16:17:04 +08:00
Zhenyu Wang 121b9648f8 libdrm_intel: add new pci ids
New ids for G41, Clarkdale and Arrandale.
Make sure we don't need to count fence also on new chips.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2009-09-04 09:24:23 +08:00
Eric Anholt 8214a65ad1 Add drm_intel_bo_busy to query whether mapping a BO would block. 2009-08-28 14:56:41 -07:00
Michel Dänzer 19d6fadfa2 Revert "libdrm_radeon: Always wait for BO idle in bo_map."
This reverts commit 0a732983f0.

Paul Nieminen and Dave Airlie pointed out on IRC that this shouldn't be
necessary. I was seeing visual corruption in X before I made this change, but
I can't reproduce that anymore so it was probably an unrelated issue.
2009-08-28 11:42:07 +02:00
Michel Dänzer 0a732983f0 libdrm_radeon: Always wait for BO idle in bo_map.
This allows users to eliminate explicit bo_wait calls before bo_map calls.
2009-08-27 08:36:58 +02:00
Pauli Nieminen caad8d8555 radeon: add support for busy/domain check interface.
airlied: modified the interface to drop busy return value, just return
it normally, also fixed int->uint32_t for domain

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2009-08-22 13:16:18 +10:00
Ben Skeggs cbb3ae3dab nouveau: fix a thinko in copyless pushbuf ioctl
No idea why G80 doesn't hit this, but, this fixes at least one NV40 card.
2009-08-19 15:56:24 +10:00
Pauli Nieminen 8c43b79b21 libdrm_radeon: Optimize copy of table to cs buffer with specialized call.
Using this call in OUT_BATCH_TABLE reduces radeonEmitState cpu usage from
9% to 5% and emit_vpu goes from 7% to 1.5%. I did use calgrind to profile
gears for cpu hotspots with r500 card.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2009-08-18 14:54:25 -04:00
Pauli Nieminen a474fd978c libdrm_radeon: Fix loops so that compiler can optimize them.
GCC did war about optimization not possible because possible forever loop.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2009-08-18 14:53:46 -04:00
Pauli Nieminen 64cef1e465 libdrm/radeon: Update head of linked list not to point freed memory.
Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
2009-08-18 14:52:43 -04:00
Ben Skeggs 28f4bfa04b nouveau: support for copy-less pushbuf ioctl 2009-08-18 15:55:42 +10:00
Ben Skeggs 250ab3a38e nouveau: for the moment, assert if we exceed some reloc limits
Nasty, but nicer than silently not writing into the pushbuf
2009-08-18 15:55:02 +10:00
Dave Airlie 1978f6d8d1 radeon: fix bo wait at map time. 2009-08-17 21:21:53 +10:00
Dave Airlie 1d465178fb radeon: fix GTT writing space check
Noticed by vehemens on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-08-15 21:32:35 +10:00
Anssi Hannula d74c67fb13 link libdrm_intel with -lrt for new use of clock_gettime().
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-08-05 11:26:40 -07:00
Dave Airlie 4507863058 libdrm_radeon: add tiling support 2009-08-01 17:20:38 +10:00
Dave Airlie 322cf6cf73 radeon: don't map/unmap explicitly.
This caches the mapping and just use mapping as a sync point
2009-08-01 17:20:35 +10:00
Ben Skeggs 5a73f066ba nouveau: don't overwrite user-specified bo size needlessly 2009-07-28 20:59:05 +10:00
Ben Skeggs 0bf8fb3bce nouveau: user buffers need to be mappable 2009-07-28 20:59:05 +10:00
Ben Skeggs 001331f4f1 nouveau: drm api 0.0.15, update object header, remove fake bo support 2009-07-28 20:59:05 +10:00
Maarten Maathuis 30449829c0 libdrm/nouveau: unmap before ufree means nvbo->sysmem != NULL, which inbalances cpu_prep/cpu_finish
- The bo was mapped with sysmem == NULL, so this means cpu prep is called.
- The bo was unmapped with sysmem != NULL, so this means cpu finish is not called.
- This can lead to a non-zero "cpu writers" count in ttm_bo.
2009-07-27 19:24:13 +02:00
Eric Anholt 3f3c5be6f9 intel: Free buffers in the BO cache that haven't been reused in a while.
The goal of the BO cache is to keep buffers on hand for fast continuous use,
as in every frame of a game or every batchbuffer of the X Server.  Keeping
older buffers on hand not only doesn't serve this purpose, it may hurt
performance by resulting in disk cache getting kicked out, or even driving
the system to swap.

Bug #20766.
2009-07-09 20:17:53 -07:00
Ben Skeggs f257201c11 nouveau: fix pin for buffers created with bo_wrap 2009-07-09 11:41:47 +10:00
Pauli Nieminen c5a5bbbe89 libdrm: Make chown check for return value
If call was interrupted by signal we have to make call again.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2009-07-06 14:17:05 -07:00
Eric Anholt 78fa590a1d intel: Fix up math errors when allocating very large BOs.
The logbase2 would overflow and wrap the size around to 0, making the code
allocate a 4kb object instead.  By simplifying the code to just walk the
14-entry bucket array comparing sizes instead of indexing on
ffs(1 << logbase2(size)), we avoid silly math errors and have code of
approximately the same speed.

Many thanks to Simon Farnsworth for debugging and providing a working patch.
Bug #27365.
2009-07-06 13:11:03 -07:00
Edward O'Callaghan cea2d29ee4 intel: fix compiler warning about returning a void value.
bug #21999
2009-07-06 13:11:03 -07:00
Pauli Nieminen 90ae0f2bb8 libdrm: Fix pci id numbers to unsigned so code won't mix signed/unsigned integers. 2009-07-06 10:05:52 -07:00
Ian Romanick 015efd1bfa strcasecmp is in strings.h.
Based on patch by Pauli Nieminen.  Thanks.
2009-07-06 09:23:59 -07:00
Dave Airlie 39970c67b7 radeon: move cs space checking code to libdrm_radeon.
This ports a lot of the space checking code into a the common
library, so that the DDX and mesa can use it.
2009-07-06 15:10:11 +10:00
Jerome Glisse 72a29340ea radeon: fix cs buffer realloc padding
We always realloc at least 0x1000 dwords (page on most system)
when growing the cs buffer this is to avoid having to realloc
at each cs_begin.
2009-07-03 15:03:03 +02:00
Dave Airlie af90222c45 radeon: fix realloc of packets.
This should use ndw not cdw, using cdw leads to realloc alignment going wrong
2009-07-03 21:13:22 +10:00
Dave Airlie fbac5891b9 radeon: add buffer naming function 2009-07-02 15:42:01 +10:00