platform/upstream/libdrm.git
15 years agonouveau: turn another assertion into an error
Ben Skeggs [Wed, 4 Nov 2009 07:31:18 +0000 (17:31 +1000)]
nouveau: turn another assertion into an error

Signed-off-by: Ben Skeggs <skeggsb@beleth.(none)>
15 years agonouveau: modify api slightly to allow caller to handle reloc failures
Ben Skeggs [Wed, 4 Nov 2009 05:23:53 +0000 (15:23 +1000)]
nouveau: modify api slightly to allow caller to handle reloc failures

Signed-off-by: Ben Skeggs <skeggsb@beleth.(none)>
15 years agonouveau: add reloc refcnt to pending bo list
Ben Skeggs [Tue, 27 Oct 2009 04:32:40 +0000 (14:32 +1000)]
nouveau: add reloc refcnt to pending bo list

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
15 years agonouveau: drop rendering on the floor rather than asserting if flush fails
Ben Skeggs [Tue, 3 Nov 2009 03:14:32 +0000 (13:14 +1000)]
nouveau: drop rendering on the floor rather than asserting if flush fails

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
15 years agonouveau: update view of available aperture space after each flush
Ben Skeggs [Mon, 2 Nov 2009 08:49:40 +0000 (18:49 +1000)]
nouveau: update view of available aperture space after each flush

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
15 years agoradeon: fix allocation
Mathias Fröhlich [Tue, 3 Nov 2009 16:41:26 +0000 (11:41 -0500)]
radeon: fix allocation

The old code increments the command stream size by another kbyte, but does
not make sure that the requested packet size fits into the stream. The patch
ensures that the whole next packet fits there and rounds the allocated size to
a power of two.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
15 years agoAdd support for vblank events
Kristian Høgsberg [Fri, 11 Sep 2009 17:27:35 +0000 (13:27 -0400)]
Add support for vblank events

The kernel will now write data to the DRM fd for various event types if
requested.  Currently, the only supported event is a vblank event: it contains
the vblank count for the event as well as a timestamp from when the event
ocurred.  Since the DRM fd is now pollable, it's easy to integrate into
existing event loops.

15 years agointel: Only call clock_gettime once per unreference_final.
Eric Anholt [Tue, 20 Oct 2009 21:19:38 +0000 (14:19 -0700)]
intel: Only call clock_gettime once per unreference_final.

Notably when freeing a batchbuffer, we often end up freeing many of the
buffers it points at as well.  Avoiding repeated calls brings us a 9% CPU
win for cairo-gl.

[ # ]  backend                         test   min(s) median(s) stddev. count
before:
[  0]       gl            firefox-talos-gfx   58.941   58.966   0.75%    3/3
after:
[  0]       gl            firefox-talos-gfx   54.186   54.195   0.49%    3/3

15 years agointel: Improve bo_references performance by skipping the tree walk.
Eric Anholt [Tue, 20 Oct 2009 20:20:55 +0000 (13:20 -0700)]
intel: Improve bo_references performance by skipping the tree walk.

If the target we're asking about hasn't ever been used as a relocation
target, then it obviously hasn't been used as a target by the batch's reloc
tree.  This is the common case for good GL programming where you only map
fresh buffers, and gives us a 5% win in cairo-gl.

[ # ]  backend                         test   min(s) median(s) stddev. count
before:
[  0]       gl            firefox-talos-gfx   64.680   64.756   0.06%    3/3
after:
[  0]       gl            firefox-talos-gfx   60.816   60.970   0.29%    3/3

15 years agonouveau: retry if pushbuf ioctl interrupted by signal
Ben Skeggs [Tue, 20 Oct 2009 02:57:46 +0000 (12:57 +1000)]
nouveau: retry if pushbuf ioctl interrupted by signal

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
15 years agonouveau: function to return status of bo being referenced in pushbuf
Ben Skeggs [Sun, 18 Oct 2009 23:04:37 +0000 (09:04 +1000)]
nouveau: function to return status of bo being referenced in pushbuf

Will be used to implement gallium's is_{texture,buffer}_referenced()
callbacks properly.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
15 years agonouveau: nv30: add render target logbase2 width,height
Patrice Mandin [Tue, 13 Oct 2009 20:50:46 +0000 (22:50 +0200)]
nouveau: nv30: add render target logbase2 width,height

15 years agointel: Add the defines for the kernel overlay support landing in 2.6.33.
Eric Anholt [Tue, 13 Oct 2009 18:35:05 +0000 (11:35 -0700)]
intel: Add the defines for the kernel overlay support landing in 2.6.33.

15 years agointel: Fallback to atomic-ops.h [libatomic-ops-dev]
Chris Wilson [Tue, 13 Oct 2009 14:13:00 +0000 (15:13 +0100)]
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>
15 years agoconfigure: Typo in error message.
Chris Wilson [Tue, 13 Oct 2009 13:25:54 +0000 (14:25 +0100)]
configure: Typo in error message.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
15 years agoconfigure: Conditionally build libdrm_intel
Chris Wilson [Mon, 12 Oct 2009 22:58:47 +0000 (23:58 +0100)]
configure: Conditionally build libdrm_intel

Only build libdrm_intel automatically if we have support for atomic
operations. To force configure to build drm pass --enable-intel, which
will cause the configure to error if no support is found. Or pass
--disable-intel to explicitly prevent libdrm_intel from being built.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
15 years agoBump to 2.4.15 for release. 2.4.15
Eric Anholt [Thu, 8 Oct 2009 23:59:17 +0000 (16:59 -0700)]
Bump to 2.4.15 for release.

15 years agointel: Remove the asserts about the ignored alignment parameter.
Eric Anholt [Thu, 8 Oct 2009 22:39:27 +0000 (15:39 -0700)]
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.

15 years agointel: Add a bo_alloc function for tiled BOs.
Jesse Barnes [Tue, 6 Oct 2009 21:34:06 +0000 (14:34 -0700)]
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]

15 years agointel: Fix up some stale doxygen comments.
Eric Anholt [Tue, 6 Oct 2009 22:25:21 +0000 (15:25 -0700)]
intel: Fix up some stale doxygen comments.

15 years agointel: Reformat to the kernel coding style. Welcome to the 8-space future.
Eric Anholt [Tue, 6 Oct 2009 19:40:42 +0000 (12:40 -0700)]
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.

15 years agointel: Don't allocate more relocation entries than the BO could support.
Eric Anholt [Mon, 5 Oct 2009 23:35:32 +0000 (16:35 -0700)]
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.

15 years agotests: Disable intel-specific tests with --disable-intel
Chris Wilson [Sat, 3 Oct 2009 22:17:57 +0000 (23:17 +0100)]
tests: Disable intel-specific tests with --disable-intel

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
15 years agointel: Add a configure option to *disable* building libdrm-intel
Chris Wilson [Sat, 3 Oct 2009 21:56:04 +0000 (22:56 +0100)]
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>
15 years agointel: report errno
Chris Wilson [Sun, 20 Sep 2009 02:11:59 +0000 (03:11 +0100)]
intel: report errno

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
15 years agolibdrm_radeon: Update RADEON_TILING_* flags to what's in current kernels.
Michel Dänzer [Sat, 3 Oct 2009 15:37:07 +0000 (17:37 +0200)]
libdrm_radeon: Update RADEON_TILING_* flags to what's in current kernels.

15 years agolibdrm_radeon: Zero-initialize structures to silence valgrind warnings
Nicolai Hähnle [Sat, 3 Oct 2009 11:43:42 +0000 (13:43 +0200)]
libdrm_radeon: Zero-initialize structures to silence valgrind warnings

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
15 years agointel: Use atomic refcounters
Chris Wilson [Fri, 2 Oct 2009 03:39:22 +0000 (04:39 +0100)]
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>
15 years agointel: Mark cached bo as purgeable
Chris Wilson [Fri, 2 Oct 2009 03:31:34 +0000 (04:31 +0100)]
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>
15 years agointel: Don't free the reloc list when putting a freed BO in the cache.
Eric Anholt [Fri, 2 Oct 2009 18:11:31 +0000 (11:11 -0700)]
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.

15 years agointel: Add a new function to check if a BO's reloc tree references some BO.
Eric Anholt [Fri, 2 Oct 2009 02:09:26 +0000 (19:09 -0700)]
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.

15 years agoBump to 2.4.14 for release. libdrm-2.4.14
Eric Anholt [Mon, 21 Sep 2009 22:29:58 +0000 (15:29 -0700)]
Bump to 2.4.14 for release.

15 years agointel: Remove the max_entries stuff that complicated bo reuse.
Eric Anholt [Mon, 7 Sep 2009 06:17:14 +0000 (23:17 -0700)]
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.

15 years agointel: Remove the old swrast flag for reducing cache flushing.
Eric Anholt [Mon, 7 Sep 2009 06:02:21 +0000 (23:02 -0700)]
intel: Remove the old swrast flag for reducing cache flushing.

It hasn't been doing anything effective since
52e5d24fae4af6f2f4a5304a516c8c5ab347a11b, and we pretty much don't bo_map
pinned buffers any more anyway.

15 years agodrmModeFreeConnector: free encoders and properties
Keith Packard [Fri, 18 Sep 2009 00:28:08 +0000 (17:28 -0700)]
drmModeFreeConnector: free encoders and properties

These were leaking.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 years agoradeon: fix 32/64 bit issue with sign extension
Dave Airlie [Mon, 14 Sep 2009 21:29:02 +0000 (07:29 +1000)]
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>
15 years agolibdrm_intel: include B43 chipset check
Zhenyu Wang [Mon, 7 Sep 2009 08:17:04 +0000 (16:17 +0800)]
libdrm_intel: include B43 chipset check

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
15 years agolibdrm_intel: add new pci ids
Zhenyu Wang [Fri, 4 Sep 2009 01:24:23 +0000 (09:24 +0800)]
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>
15 years agoBump to version 2.4.13 for release. libdrm-2.4.13
Eric Anholt [Fri, 28 Aug 2009 22:20:22 +0000 (15:20 -0700)]
Bump to version 2.4.13 for release.

15 years agoAdd drm_intel_bo_busy to query whether mapping a BO would block.
Eric Anholt [Fri, 28 Aug 2009 01:32:07 +0000 (18:32 -0700)]
Add drm_intel_bo_busy to query whether mapping a BO would block.

15 years agoRevert "libdrm_radeon: Always wait for BO idle in bo_map."
Michel Dänzer [Fri, 28 Aug 2009 09:42:07 +0000 (11:42 +0200)]
Revert "libdrm_radeon: Always wait for BO idle in bo_map."

This reverts commit 0a732983f059c353b267b6bf877e1f0eea4e033f.

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.

15 years agolibdrm_radeon: Always wait for BO idle in bo_map.
Michel Dänzer [Thu, 27 Aug 2009 06:36:58 +0000 (08:36 +0200)]
libdrm_radeon: Always wait for BO idle in bo_map.

This allows users to eliminate explicit bo_wait calls before bo_map calls.

15 years agoKill last remnant of replacefb ioctl
Jakob Bornecrantz [Fri, 21 Aug 2009 12:06:51 +0000 (14:06 +0200)]
Kill last remnant of replacefb ioctl

Kenrels doesn't expose this ioctl

15 years agoradeon: pull in z pipe changes from kernel
Alex Deucher [Mon, 24 Aug 2009 22:15:03 +0000 (18:15 -0400)]
radeon: pull in z pipe changes from kernel

15 years agoradeon: add support for busy/domain check interface.
Pauli Nieminen [Sat, 22 Aug 2009 03:16:18 +0000 (13:16 +1000)]
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>
15 years agonouveau: fix a thinko in copyless pushbuf ioctl
Ben Skeggs [Wed, 19 Aug 2009 05:55:05 +0000 (15:55 +1000)]
nouveau: fix a thinko in copyless pushbuf ioctl

No idea why G80 doesn't hit this, but, this fixes at least one NV40 card.

15 years agolibdrm_radeon: Optimize copy of table to cs buffer with specialized call.
Pauli Nieminen [Tue, 18 Aug 2009 15:51:38 +0000 (18:51 +0300)]
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>
15 years agolibdrm_radeon: Fix loops so that compiler can optimize them.
Pauli Nieminen [Tue, 18 Aug 2009 15:51:37 +0000 (18:51 +0300)]
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>
15 years agolibdrm/radeon: Update head of linked list not to point freed memory.
Pauli Nieminen [Fri, 7 Aug 2009 17:03:26 +0000 (20:03 +0300)]
libdrm/radeon: Update head of linked list not to point freed memory.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
15 years agonouveau: support for copy-less pushbuf ioctl
Ben Skeggs [Wed, 12 Aug 2009 04:21:00 +0000 (14:21 +1000)]
nouveau: support for copy-less pushbuf ioctl

15 years agonouveau: for the moment, assert if we exceed some reloc limits
Ben Skeggs [Tue, 18 Aug 2009 04:25:50 +0000 (14:25 +1000)]
nouveau: for the moment, assert if we exceed some reloc limits

Nasty, but nicer than silently not writing into the pushbuf

15 years agoradeon: fix bo wait at map time.
Dave Airlie [Mon, 17 Aug 2009 11:21:02 +0000 (21:21 +1000)]
radeon: fix bo wait at map time.

15 years agoFilter radeon pkgconfig file as do intel and nouveau
Christoph Brill [Sun, 16 Aug 2009 06:26:25 +0000 (08:26 +0200)]
Filter radeon pkgconfig file as do intel and nouveau

15 years agoradeon: fix GTT writing space check
Dave Airlie [Sat, 15 Aug 2009 11:32:35 +0000 (21:32 +1000)]
radeon: fix GTT writing space check

Noticed by vehemens on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agolink libdrm_intel with -lrt for new use of clock_gettime().
Anssi Hannula [Fri, 24 Jul 2009 18:58:43 +0000 (21:58 +0300)]
link libdrm_intel with -lrt for new use of clock_gettime().

Signed-off-by: Eric Anholt <eric@anholt.net>
15 years agolibdrm_radeon: add tiling support
Dave Airlie [Sat, 1 Aug 2009 07:19:43 +0000 (17:19 +1000)]
libdrm_radeon: add tiling support

15 years agoradeon: don't map/unmap explicitly.
Dave Airlie [Sat, 1 Aug 2009 06:47:24 +0000 (16:47 +1000)]
radeon: don't map/unmap explicitly.

This caches the mapping and just use mapping as a sync point

15 years agonouveau: don't overwrite user-specified bo size needlessly
Ben Skeggs [Mon, 27 Jul 2009 22:12:21 +0000 (08:12 +1000)]
nouveau: don't overwrite user-specified bo size needlessly

15 years agonouveau: user buffers need to be mappable
Ben Skeggs [Mon, 27 Jul 2009 21:46:20 +0000 (07:46 +1000)]
nouveau: user buffers need to be mappable

15 years agonouveau: drm api 0.0.15, update object header, remove fake bo support
Ben Skeggs [Sun, 26 Jul 2009 21:23:09 +0000 (07:23 +1000)]
nouveau: drm api 0.0.15, update object header, remove fake bo support

15 years agolibdrm/nouveau: unmap before ufree means nvbo->sysmem != NULL, which inbalances cpu_p...
Maarten Maathuis [Mon, 27 Jul 2009 17:24:13 +0000 (19:24 +0200)]
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.

15 years agoAdd RADEON_INIT_R600_CP too
Alex Deucher [Wed, 15 Jul 2009 18:51:38 +0000 (14:51 -0400)]
Add RADEON_INIT_R600_CP too

this rounds out the r6xx/r7xx stuff in radeon_drm.h

15 years agoAdd R600_SCRATCH_REG_OFFSET to radeon_drm.h
Alex Deucher [Wed, 15 Jul 2009 18:40:41 +0000 (14:40 -0400)]
Add R600_SCRATCH_REG_OFFSET to radeon_drm.h

This lets us libdrm from master for r6xx/r7xx 3d

15 years agoBump to version 2.4.12 for release. libdrm-2.4.12
Eric Anholt [Wed, 15 Jul 2009 17:04:44 +0000 (10:04 -0700)]
Bump to version 2.4.12 for release.

15 years agointel: Free buffers in the BO cache that haven't been reused in a while.
Eric Anholt [Fri, 10 Jul 2009 00:49:46 +0000 (17:49 -0700)]
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.

15 years agoconfigure: move AC_USE_SYSTEM_EXTENSIONS up higher
Dave Airlie [Thu, 9 Jul 2009 16:38:13 +0000 (02:38 +1000)]
configure: move AC_USE_SYSTEM_EXTENSIONS up higher

this was giving me a warning on automake 1.11

15 years agonouveau: fix pin for buffers created with bo_wrap
Ben Skeggs [Thu, 9 Jul 2009 01:41:47 +0000 (11:41 +1000)]
nouveau: fix pin for buffers created with bo_wrap

15 years agos/AC_USE_SYSTEM_MACROS/AC_USE_SYSTEM_EXTENSIONS/
Ian Romanick [Mon, 6 Jul 2009 22:36:20 +0000 (15:36 -0700)]
s/AC_USE_SYSTEM_MACROS/AC_USE_SYSTEM_EXTENSIONS/

Not sure what I was thinking.

15 years agolibdrm: Make chown check for return value
Pauli Nieminen [Mon, 6 Jul 2009 20:37:20 +0000 (23:37 +0300)]
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>
15 years agolibdrm: Set _XOPEN_SOURCE and _GNU_SOURCE
Ian Romanick [Mon, 6 Jul 2009 20:23:46 +0000 (13:23 -0700)]
libdrm: Set _XOPEN_SOURCE and _GNU_SOURCE

Several POSIX extensions are used in the libdrm code (e.g., mknod and ffs).
Set _XOPEN_SOURCE and _GNU_SOURCE to something reasonable to ensure that
prototypes for these functions are available.  This is done in configure.ac
using AC_USE_SYSTEM_MACROS.  This requires autoconf 2.60 or later.  Eventually
the code should check for the existance of these defines and do something
reasonable if they are not available.

Inspired by a patch by Pauli Nieminen and suggestions from Julien Cristau.
Thanks.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
15 years agointel: Fix up math errors when allocating very large BOs.
Eric Anholt [Mon, 6 Jul 2009 18:55:28 +0000 (11:55 -0700)]
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.

15 years agointel: fix compiler warning about returning a void value.
Edward O'Callaghan [Thu, 2 Jul 2009 18:03:48 +0000 (11:03 -0700)]
intel: fix compiler warning about returning a void value.

bug #21999

15 years agolibdrm: Fix pci id numbers to unsigned so code won't mix signed/unsigned integers.
Pauli Nieminen [Fri, 3 Jul 2009 23:18:51 +0000 (02:18 +0300)]
libdrm: Fix pci id numbers to unsigned so code won't mix signed/unsigned integers.

15 years agostrcasecmp is in strings.h.
Ian Romanick [Mon, 6 Jul 2009 16:23:59 +0000 (09:23 -0700)]
strcasecmp is in strings.h.

Based on patch by Pauli Nieminen.  Thanks.

15 years agolibdrm: Remove typedef for non-existing enum
Pauli Nieminen [Fri, 3 Jul 2009 23:18:49 +0000 (02:18 +0300)]
libdrm: Remove typedef for non-existing enum

15 years agoradeon: move cs space checking code to libdrm_radeon.
Dave Airlie [Mon, 6 Jul 2009 03:34:24 +0000 (13:34 +1000)]
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.

15 years agoradeon: fix cs buffer realloc padding
Jerome Glisse [Fri, 3 Jul 2009 13:03:03 +0000 (15:03 +0200)]
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.

15 years agoradeon: fix realloc of packets.
Dave Airlie [Fri, 3 Jul 2009 11:13:22 +0000 (21:13 +1000)]
radeon: fix realloc of packets.

This should use ndw not cdw, using cdw leads to realloc alignment going wrong

15 years agoradeon: add buffer naming function
Dave Airlie [Thu, 2 Jul 2009 05:42:01 +0000 (15:42 +1000)]
radeon: add buffer naming function

15 years agoradeon: add support for write followed by read relocs.
Dave Airlie [Tue, 30 Jun 2009 02:19:28 +0000 (12:19 +1000)]
radeon: add support for write followed by read relocs.

the DDX does this and used to handle it internally

15 years agoremove some old ttm bits
Dave Airlie [Mon, 22 Jun 2009 23:51:05 +0000 (09:51 +1000)]
remove some old ttm bits

15 years agodrm: Strip old ttm.
Thomas Hellstrom [Mon, 22 Jun 2009 21:07:26 +0000 (23:07 +0200)]
drm: Strip old ttm.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
15 years agomodetest: use gtt unmap for object
Jesse Barnes [Mon, 22 Jun 2009 19:27:49 +0000 (12:27 -0700)]
modetest: use gtt unmap for object

Match gtt map/unmap for correctness.

15 years agolibdrm/radeon: add initial libdrm_radeon
Dave Airlie [Wed, 17 Jun 2009 07:47:42 +0000 (17:47 +1000)]
libdrm/radeon: add initial libdrm_radeon

requires --enable-radeon-experimental-api for now

15 years agonouveau: 0.0.14 + extend bo interface to support subrange mapping
Ben Skeggs [Wed, 3 Jun 2009 03:54:43 +0000 (13:54 +1000)]
nouveau: 0.0.14 + extend bo interface to support subrange mapping

Normal map() should operate as before, and map_range()/map_flush() should
give correct results but lacking any performance difference from map().

Nothing exiting being done here yet, but the interface is a good start.

15 years agonouveau: fix bo mapping issue
Ben Skeggs [Wed, 3 Jun 2009 22:59:53 +0000 (08:59 +1000)]
nouveau: fix bo mapping issue

15 years agoFix build on kernels < 2.6.26
Pekka Paalanen [Wed, 3 Jun 2009 19:26:43 +0000 (22:26 +0300)]
Fix build on kernels < 2.6.26

The commit 651e3dc6dd58a79c90db7513ee2fb28360a4560d, "drm: Fix
compilation on 2.6.30" broke all builds on kernels before 2.6.26.
Variadic functions cannot be inlined.

The variadic inline function is replaced with a variadic macro.

Also, the function dev_name() added by that same commit is never used,
so it is removed.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
15 years agonouveau: fill in bo->tiled field for referenced buffers
Ben Skeggs [Wed, 3 Jun 2009 00:24:30 +0000 (10:24 +1000)]
nouveau: fill in bo->tiled field for referenced buffers

Fixes the dri1 gallium driver if the front buffer happens to be non-linear.

15 years agonv50: magic fix for "3d busted without the binary driver first" issue
Ben Skeggs [Tue, 2 Jun 2009 07:06:34 +0000 (17:06 +1000)]
nv50: magic fix for "3d busted without the binary driver first" issue

No idea what this reg does.. NVIDIA put 0x802 into it on some chips, the
criteria aren't too clear on when they do that however.  Hopefully 0x800
will work everywhere...

15 years agodrm: Fix compilation on 2.6.30
Michael Buesch [Sun, 10 May 2009 22:21:14 +0000 (00:21 +0200)]
drm: Fix compilation on 2.6.30

This fixes DRM compilation of nouveau.ko on kernel 2.6.30.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
15 years agonouveau: bump for 0.0.13
Ben Skeggs [Tue, 26 May 2009 04:14:04 +0000 (14:14 +1000)]
nouveau: bump for 0.0.13

15 years agonouveau: backlight support for ppc laptops
Danny Tholen [Wed, 6 May 2009 23:11:34 +0000 (00:11 +0100)]
nouveau: backlight support for ppc laptops

Patch allows the backlight to be manipulated under gnome on apple powerpc
based NV30 machines.  It works fine on my powerbook, and should also work
for older NV17/NV18 machines.

Note that older powerpc specific tools (pbbuttonsd) have some problems with
this implementation (because the device is not yet there at the start time
of the daemon, and the code makes incorrect assumptions about the max
brightness values). However, IMHO these things can and should be addressed
in the daemon.

Some style/warning fixes applied by Stuart Bennett <stuart@freedesktop.org>

15 years agointel: quiet a warning.
Eric Anholt [Tue, 19 May 2009 17:07:16 +0000 (10:07 -0700)]
intel: quiet a warning.

15 years agointel: Only do BO caching up to 64MB objects.
Eric Anholt [Mon, 18 May 2009 23:07:45 +0000 (16:07 -0700)]
intel: Only do BO caching up to 64MB objects.

This avoids making objects significantly bigger than they would be
otherwise, which would result in some failing at binding to the GTT.
Found from firefox hanging on:
http://upload.wikimedia.org/wikipedia/commons/b/b7/Singapore_port_panorama.jpg
due to a software fallback trying to do a GTT-mapped copy between two 73MB
BOs that were instead each 128MB, and failing because both couldn't fit
simultaneously.

The cost here is that we get no opportunity to cache these objects and
avoid the mapping.  But since the objects are a significant percentage
of the aperture size, each mapped access is likely having to fault and rebind
the object most of the time anyway.

Bug #20152 (2/3)

15 years agolibdrm/intel: Make get_pipe_from_crtc_id per-bufmgr. Return -1 on failure. libdrm-2.4.11
Keith Packard [Thu, 14 May 2009 23:58:14 +0000 (16:58 -0700)]
libdrm/intel: Make get_pipe_from_crtc_id per-bufmgr. Return -1 on failure.

The convention is that all APIs are per-bufmgr, so make this one the same.
Then, have it return -1 on failure so that the application can know what's
going on and do something sensible.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 years agoAdd new drm_intel_get_pipe_from_crtc_id function.
Carl Worth [Wed, 29 Apr 2009 21:43:55 +0000 (14:43 -0700)]
Add new drm_intel_get_pipe_from_crtc_id function.

This wraps the new DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID ioctl,
allowing applications to discover the pipe number corresponding
to a given CRTC ID. This is necessary for doing pipe-specific
operations such as waiting for vblank on a given CRTC.

15 years agoBump to version 2.4.10 to mark addition of drm_intel_bo_disable_reuse
Keith Packard [Tue, 12 May 2009 22:33:28 +0000 (15:33 -0700)]
Bump to version 2.4.10 to mark addition of drm_intel_bo_disable_reuse

New API, new version.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
15 years agolibdrm/intel: add drm_intel_bo_disable_reuse api
Keith Packard [Mon, 11 May 2009 20:42:12 +0000 (13:42 -0700)]
libdrm/intel: add drm_intel_bo_disable_reuse api

Scanout buffers need to be freed through the kernel as it holds a reference
to them; exposing this API allows applications allocating scanout buffers to
flag them as not reusable.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
15 years agoUse C99 versions of __FUNCTION__ & __volatile__ when not building with gcc
Alan Coopersmith [Tue, 10 Jun 2008 00:03:28 +0000 (17:03 -0700)]
Use C99 versions of __FUNCTION__ & __volatile__ when not building with gcc

15 years agoDelete extra libdrm_lists.h line after libdrm_la_SOURCES in libdrm/Makefile.am
Alan Coopersmith [Sun, 10 May 2009 00:21:29 +0000 (17:21 -0700)]
Delete extra libdrm_lists.h line after libdrm_la_SOURCES in libdrm/Makefile.am

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>