glsdk/libdrm.git
12 years agoMerge branch 'master' into libkms-master
Jakob Bornecrantz [Tue, 5 Jan 2010 19:59:24 +0000 (20:59 +0100)]
Merge branch 'master' into libkms-master

Conflicts:
configure.ac

12 years agolibkms: Disable by default
Jakob Bornecrantz [Tue, 5 Jan 2010 19:58:37 +0000 (20:58 +0100)]
libkms: Disable by default

12 years agovmwgfx: Add experimental vmwgfx kernel header
Jakob Bornecrantz [Tue, 5 Jan 2010 18:53:10 +0000 (19:53 +0100)]
vmwgfx: Add experimental vmwgfx kernel header

12 years agonouveau: add BEGIN_RING_NI
Marcin Slusarz [Wed, 30 Dec 2009 20:32:40 +0000 (21:32 +0100)]
nouveau: add BEGIN_RING_NI

12 years agonouveau: Unreference pushbuf objects on channel destruction.
Younes Manton [Mon, 28 Dec 2009 23:00:09 +0000 (18:00 -0500)]
nouveau: Unreference pushbuf objects on channel destruction.

- unreference pushbuf objects on channel destruction

Based on Krzysztof Smiechowicz's patch.

12 years agonouveau: Update some object definitions from renouveau.xml.
Francisco Jerez [Mon, 28 Dec 2009 17:01:42 +0000 (18:01 +0100)]
nouveau: Update some object definitions from renouveau.xml.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
12 years agonouveau: Update nouveau_class.h with new renouveau.xml definitions.
Marcin Kościelnicki [Tue, 24 Nov 2009 17:23:54 +0000 (17:23 +0000)]
nouveau: Update nouveau_class.h with new renouveau.xml definitions.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
12 years agolibdrm 2.4.17
Dave Airlie [Mon, 21 Dec 2009 05:03:31 +0000 (15:03 +1000)]
libdrm 2.4.17

12 years agoradeon: fix BO null check, should be in higher level fn
Dave Airlie [Mon, 21 Dec 2009 04:59:48 +0000 (14:59 +1000)]
radeon: fix BO null check, should be in higher level fn

12 years agoradeon: straighten out the API insanity.
Dave Airlie [Thu, 17 Dec 2009 04:11:55 +0000 (14:11 +1000)]
radeon: straighten out the API insanity.

as Michel pointed out we are exposing too much info for these object
for this to be maintainable going forward.

This patch set minimises the exposed parts of the radeon_bo and
radeon_cs objects to the piece necessary for ddx/mesa to operate
at a decent speed.

The major problem is mesa contains a legacy BO/CS managers which we still
need to expose functionality to, and we really cannot change the API
until we can drop the non-KMS codepaths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agonouveau: remove delayed kernel bo creation
Ben Skeggs [Thu, 17 Dec 2009 03:07:18 +0000 (13:07 +1000)]
nouveau: remove delayed kernel bo creation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agoBe less chatty in drmSetMaster/drmDropMaster
Kristian Høgsberg [Wed, 9 Dec 2009 15:37:40 +0000 (10:37 -0500)]
Be less chatty in drmSetMaster/drmDropMaster

12 years agomodetest: Error out if pageflipping is requested but not available
Kristian Høgsberg [Wed, 9 Dec 2009 15:36:53 +0000 (10:36 -0500)]
modetest: Error out if pageflipping is requested but not available

12 years agovmwgfx: Fetch the latest header
Jakob Bornecrantz [Mon, 14 Dec 2009 21:53:10 +0000 (22:53 +0100)]
vmwgfx: Fetch the latest header

12 years agonouveau: Use drmIoctl so we restart ioctl on EINTR or EAGAIN
Ben Skeggs [Wed, 9 Dec 2009 04:50:15 +0000 (14:50 +1000)]
nouveau: Use drmIoctl so we restart ioctl on EINTR or EAGAIN

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agonouveau: move reloc code down, nothing to see here
Ben Skeggs [Wed, 9 Dec 2009 03:15:07 +0000 (13:15 +1000)]
nouveau: move reloc code down, nothing to see here

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
12 years agointel: Clear virtual after failing to mmap_gtt.
Chris Wilson [Tue, 8 Dec 2009 22:35:24 +0000 (22:35 +0000)]
intel: Clear virtual after failing to mmap_gtt.

Don't store the error return in bo_gem->gtt_virtual or else we will
attempt to use that as a valid pointer in future mappings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agolibkms: Change destroy api a bit
Jakob Bornecrantz [Fri, 4 Dec 2009 15:06:42 +0000 (16:06 +0100)]
libkms: Change destroy api a bit

13 years agolibkms: Add libkms
Jakob Bornecrantz [Tue, 24 Nov 2009 16:54:10 +0000 (17:54 +0100)]
libkms: Add libkms

13 years agoIgnore config.h.in
Jakob Bornecrantz [Fri, 4 Dec 2009 15:07:51 +0000 (16:07 +0100)]
Ignore config.h.in

12 years agoradeon: Use drmIoctl so we restart ioctl on EINTR or EAGAIN
Jerome Glisse [Mon, 7 Dec 2009 17:30:52 +0000 (18:30 +0100)]
radeon: Use drmIoctl so we restart ioctl on EINTR or EAGAIN

This is needed as change in kernel will lead to ioctl returning
EINTR if they are interrupted.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
13 years agointel: Expect caller to guarantee thread-safety of bo during reloc
Chris Wilson [Tue, 1 Dec 2009 23:01:34 +0000 (23:01 +0000)]
intel: Expect caller to guarantee thread-safety of bo during reloc

This removes the foremost prolific user of mutexes in libdrm_intel.so.
The other uses of the bufmgr_gem->mutex to serial access to individual
bos are currently required by Mesa, and are far less frequent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[anholt: This chunk looks good...]
Acked-by: Eric Anholt <eric@anholt.net>
13 years agomodetest: fix build error due to page_flip_handler name change
Jesse Barnes [Fri, 4 Dec 2009 17:09:19 +0000 (09:09 -0800)]
modetest: fix build error due to page_flip_handler name change

Forgot to update this when pushing the pageflip bits.

13 years agoMerge branch 'modesetting-dirty-libdrm'
Jakob Bornecrantz [Wed, 2 Dec 2009 18:40:58 +0000 (19:40 +0100)]
Merge branch 'modesetting-dirty-libdrm'

Conflicts:
include/drm/drm.h

13 years agoAdd RELEASING to document the release process
Kristian Høgsberg [Thu, 3 Dec 2009 22:49:31 +0000 (17:49 -0500)]
Add RELEASING to document the release process

13 years agoBump event context structure version for page flipping
Jesse Barnes [Thu, 3 Dec 2009 22:20:51 +0000 (14:20 -0800)]
Bump event context structure version for page flipping

13 years agoMerge branch 'pageflip' of git://people.freedesktop.org/~jbarnes/drm
Jesse Barnes [Thu, 3 Dec 2009 22:17:26 +0000 (14:17 -0800)]
Merge branch 'pageflip' of git://people.freedesktop.org/~jbarnes/drm

Conflicts:
include/drm/drm.h - RMFB had its signature changed to avoid uint32_t

13 years agoBump to 2.4.16 for release
Kristian Høgsberg [Thu, 3 Dec 2009 16:31:27 +0000 (11:31 -0500)]
Bump to 2.4.16 for release

13 years agoEnable experimental APIs for distcheck
Kristian Høgsberg [Thu, 3 Dec 2009 16:27:16 +0000 (11:27 -0500)]
Enable experimental APIs for distcheck

13 years agoChange the number on the dirty ioctl to match upstream
Jakob Bornecrantz [Wed, 2 Dec 2009 18:39:16 +0000 (19:39 +0100)]
Change the number on the dirty ioctl to match upstream

13 years agointel: Free memory before inserting bo into cache.
Chris Wilson [Wed, 2 Dec 2009 13:36:22 +0000 (13:36 +0000)]
intel: Free memory before inserting bo into cache.

This has the unfortunate behaviour of releasing our malloc cache, but
the alternative is for X to consume a couple of gigabytes of ram and
die during testing. Fortunately the extra mallocs have little impact on
performance whereas avoiding swap and death, lots.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agointel: Check and propagate errors from building reloc-tree
Chris Wilson [Wed, 2 Dec 2009 13:12:39 +0000 (13:12 +0000)]
intel: Check and propagate errors from building reloc-tree

Instead of forcing the caller to check after every emit_reloc(), we can
flag the object as being in error, propagating that error upwards through
the relocation tree, and failing the eventual batch buffer execution.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agointel: Repeat execbuffer after EINTR
Chris Wilson [Wed, 2 Dec 2009 12:58:00 +0000 (12:58 +0000)]
intel: Repeat execbuffer after EINTR

EAGAIN cannot be raised by the current code, but the system call maybe
interrupted and so return EINTR.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agointel: Review use of errno.
Chris Wilson [Wed, 2 Dec 2009 12:40:26 +0000 (12:40 +0000)]
intel: Review use of errno.

Hitting this error lead to a segfault:

  intel_bufmgr_gem.c:919: Error mapping buffer 48607 (pixmap):
                          Cannot allocate memory.

because the errno was reused as the function return value after being
reset by the fprintf(), so caller thought the mapping had succeeded. The
convention established by libdrm is that the return value is the
negative errno and that uses of libdrm cannot trust the value of errno
afterwards, but must use the return code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agointel: Make bo_reference() inline for internal use.
Chris Wilson [Wed, 2 Dec 2009 10:42:51 +0000 (10:42 +0000)]
intel: Make bo_reference() inline for internal use.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agointel: Remove the extra reference while validating the reloc tree
Chris Wilson [Wed, 2 Dec 2009 10:41:39 +0000 (10:41 +0000)]
intel: Remove the extra reference while validating the reloc tree

Buffers on the relocation tree are guarded by the reference to the batch
object and so do not need an extra reference whilst constructing the
list of execution buffer objects.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agointel: Wrap a few more syscalls with EINTR protection
Chris Wilson [Tue, 1 Dec 2009 13:08:04 +0000 (13:08 +0000)]
intel: Wrap a few more syscalls with EINTR protection

Having been bitten by a missing EINTR check during mmap_gtt(), I thought
it prudent to add some more protection around the ioctls.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agointel: Clear bo->used_as_reloc_target flag on destroy
Chris Wilson [Mon, 30 Nov 2009 23:07:19 +0000 (23:07 +0000)]
intel: Clear bo->used_as_reloc_target flag on destroy

This allows us to keep the assert added in the previous commit that we do
not modify the tree_reloc_size after inserting the buffer into a relocation
tree, which was being hit here:

  #0  0xb78c2424 in __kernel_vsyscall ()
  #1  0xb74f6401 in raise () from /lib/libc.so.6
  #2  0xb74f7b42 in abort () from /lib/libc.so.6
  #3  0xb74ef5a8 in __assert_fail () from /lib/libc.so.6
  #4  0xb737e78b in drm_intel_bo_gem_set_in_aperture_size (bufmgr_gem=<value optimized out>, bo_gem=0x6) at intel_bufmgr_gem.c:373
  #5  0xb737f519 in drm_intel_gem_bo_set_tiling (bo=0xa1030a0, tiling_mode=0xbff6c85c, stride=0) at intel_bufmgr_gem.c:1386
  #6  0xb737f67f in drm_intel_gem_bo_unreference_final (bo=0xa1030a0, time=<value optimized out>) at intel_bufmgr_gem.c:768
  #7  0xb737f5e3 in drm_intel_gem_bo_unreference_locked_timed (bo=0xa1e50d0, time=<value optimized out>) at intel_bufmgr_gem.c:805
  #8  drm_intel_gem_bo_unreference_final (bo=0xa1e50d0, time=<value optimized out>) at intel_bufmgr_gem.c:756
  #9  0xb737fcbb in drm_intel_gem_bo_unreference (bo=0xa1e50d0) at intel_bufmgr_gem.c:821
  #10 0xb737b4e6 in drm_intel_bo_unreference (bo=0x0) at intel_bufmgr.c:80
  #11 0xb7325625 in intel_batch_flush (scrn=0x9d91f78, flush=1) at i830_batchbuffer.c:200

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agointel: Apply pessimistic alignment to in-aperture buffer size
Chris Wilson [Mon, 30 Nov 2009 22:14:30 +0000 (22:14 +0000)]
intel: Apply pessimistic alignment to in-aperture buffer size

For the older chipsets, i.e. pre-i965, which have severe alignment
restrictions for tiled buffers we need to pessimistically assume that we
will waste the size of buffer to meet those alignment constraints.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agointel: Only store a buffer in the cache if it is retained.
Chris Wilson [Mon, 30 Nov 2009 20:02:05 +0000 (20:02 +0000)]
intel: Only store a buffer in the cache if it is retained.

If the kernel immediately frees the backing store for a buffer when
marking it purgeable, then there is not point adding to the cache. Free
it immediately, instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
13 years agoChange the dirty ioctl a bit and comment it
Jakob Bornecrantz [Mon, 30 Nov 2009 00:40:51 +0000 (00:40 +0000)]
Change the dirty ioctl a bit and comment it

13 years agoBring dirty code from old branch
Jakob Bornecrantz [Tue, 24 Nov 2009 17:00:12 +0000 (18:00 +0100)]
Bring dirty code from old branch

13 years agoCorrectly set DRM_MAX_MINOR for all platforms.
Robert Noland [Wed, 25 Nov 2009 21:09:24 +0000 (15:09 -0600)]
Correctly set DRM_MAX_MINOR for all platforms.

DRM_MAJOR is platform specific, but not used outside of xf86drm.c
that I can find.

13 years agoAdd missing DRM_MAX_MINOR define
Alex Deucher [Tue, 24 Nov 2009 20:03:32 +0000 (15:03 -0500)]
Add missing DRM_MAX_MINOR define

lost in 500f5b524000ed5930301f4303744cb4c0a19b75

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agoMore fixups to allow mesa to build
Robert Noland [Tue, 24 Nov 2009 16:31:41 +0000 (10:31 -0600)]
More fixups to allow mesa to build

13 years agoFinish fixing the build on FreeBSD
Robert Noland [Tue, 24 Nov 2009 15:27:29 +0000 (09:27 -0600)]
Finish fixing the build on FreeBSD

13 years agoAdd drmGetDeviceNameFromFd function
Kristian Høgsberg [Tue, 24 Nov 2009 01:51:34 +0000 (20:51 -0500)]
Add drmGetDeviceNameFromFd function

Determines the /dev filename of the drm fd argument.

13 years agoFix build on *BSD
Kristian Høgsberg [Mon, 23 Nov 2009 23:25:08 +0000 (18:25 -0500)]
Fix build on *BSD

This adds a minimal #ifdef clause to drm.h that we'll push upstream.
Once that goes in we can share drm.h between linux, libdrm, and
the bsd's.

13 years agoDon't hardcore 'yes', use in configure.ac output
Kristian Høgsberg [Mon, 23 Nov 2009 17:38:40 +0000 (12:38 -0500)]
Don't hardcore 'yes', use  in configure.ac output

Oops, I assumed intel was always enable, but it just defaults to on.

13 years agoOutput summary of enabled features at the end of configure.ac
Kristian Høgsberg [Mon, 23 Nov 2009 16:41:15 +0000 (11:41 -0500)]
Output summary of enabled features at the end of configure.ac

13 years agoDrop duplicated radeon_*.h files in include/drm
Kristian Høgsberg [Mon, 23 Nov 2009 16:25:46 +0000 (11:25 -0500)]
Drop duplicated radeon_*.h files in include/drm

These files are userspace headers and live in radeon/

13 years agoPut mach64_drm.h back in to avoid breaking mesa build
Kristian Høgsberg [Sat, 21 Nov 2009 01:17:26 +0000 (20:17 -0500)]
Put mach64_drm.h back in to avoid breaking mesa build

We may want to drop mach64 from mesa instead, but that's a different
discussion.

13 years agoInstall kernel headers in ${includedir}/drm
Kristian Høgsberg [Sat, 21 Nov 2009 00:42:59 +0000 (19:42 -0500)]
Install kernel headers in ${includedir}/drm

13 years agonouveau: fix DRM headers
Pekka Paalanen [Fri, 20 Nov 2009 23:00:36 +0000 (01:00 +0200)]
nouveau: fix DRM headers

The nouveau_drmif.h is not the Nouveau DRM kernel ABI file, but purely
user space stuff. Remove it, it does not belong in include/drm/.

Copy the right header from Nouveau kernel v2.6.31-rc9-757-gaca551c.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
13 years agoBump libdrm version to 2.4.16 for page flipping
Jesse Barnes [Tue, 17 Nov 2009 21:39:17 +0000 (21:39 +0000)]
Bump libdrm version to 2.4.16 for page flipping

13 years agomodetest: add pageflip test case to modetest
Kristian Høgsberg [Tue, 17 Nov 2009 20:32:23 +0000 (15:32 -0500)]
modetest: add pageflip test case to modetest

13 years agolibdrm: add libdrm support for page flip ioctl
Kristian Høgsberg [Thu, 12 Nov 2009 19:06:45 +0000 (14:06 -0500)]
libdrm: add libdrm support for page flip ioctl

13 years agoMerge remote branch 'origin/master' into libdrm
Kristian Høgsberg [Fri, 20 Nov 2009 22:09:03 +0000 (17:09 -0500)]
Merge remote branch 'origin/master' into libdrm

13 years agoUpdate README
Kristian Høgsberg [Fri, 20 Nov 2009 22:08:28 +0000 (17:08 -0500)]
Update README

13 years agolibdrm_radeon: add radeon_bo_is_referenced_by_cs function
Maciej Cencora [Wed, 18 Nov 2009 21:07:13 +0000 (16:07 -0500)]
libdrm_radeon: add radeon_bo_is_referenced_by_cs function

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
13 years agodrm/i915: add GETPARAM request for page flipping
Jesse Barnes [Tue, 17 Nov 2009 20:07:48 +0000 (20:07 +0000)]
drm/i915: add GETPARAM request for page flipping

13 years agoDrop stale TODO and unused ChangeLog
Kristian Høgsberg [Tue, 17 Nov 2009 16:15:56 +0000 (11:15 -0500)]
Drop stale TODO and unused ChangeLog

13 years agoMove libdrm/ up one level
Kristian Høgsberg [Tue, 17 Nov 2009 16:14:54 +0000 (11:14 -0500)]
Move libdrm/ up one level

13 years agoDrop shared-core, bsd-core, linux-core and scripts subdirs
Kristian Høgsberg [Tue, 17 Nov 2009 14:46:56 +0000 (09:46 -0500)]
Drop shared-core, bsd-core, linux-core and scripts subdirs

13 years agoUse headers copied from kernel instead of shared-core
Kristian Høgsberg [Tue, 17 Nov 2009 14:46:39 +0000 (09:46 -0500)]
Use headers copied from kernel instead of shared-core

13 years agoFix typo in i915 pipe_from_crtc_id ioctl struct name
Kristian Høgsberg [Tue, 17 Nov 2009 14:39:23 +0000 (09:39 -0500)]
Fix typo in i915 pipe_from_crtc_id ioctl struct name

13 years agoCopy headers from kernel v2.6.32-rc6-130-g5b8f0be
Kristian Høgsberg [Tue, 17 Nov 2009 14:23:59 +0000 (09:23 -0500)]
Copy headers from kernel v2.6.32-rc6-130-g5b8f0be

13 years agoAdd makefile rule to copy headers from kernel tree
Kristian Høgsberg [Tue, 17 Nov 2009 14:23:52 +0000 (09:23 -0500)]
Add makefile rule to copy headers from kernel tree

13 years agonouveau: Update some nouveau_class.h definitions from renouveau.xml.
Francisco Jerez [Sun, 15 Nov 2009 03:10:02 +0000 (04:10 +0100)]
nouveau: Update some nouveau_class.h definitions from renouveau.xml.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
13 years agointel: Export madvise
Chris Wilson [Wed, 11 Nov 2009 13:04:38 +0000 (13:04 +0000)]
intel: Export madvise

Wrap the madvise ioctl for use in APPLE_object_purgeable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
13 years agoOnly install libdrm_intel.pc if we build libdrm_intel
Julien Cristau [Sat, 31 Oct 2009 01:25:44 +0000 (02:25 +0100)]
Only install libdrm_intel.pc if we build libdrm_intel

13 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)>
13 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)>
13 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>
13 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>
13 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>
13 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>
13 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.

13 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

13 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

13 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>
13 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>
13 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

13 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.

13 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>
13 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>
13 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>
13 years agoBump to 2.4.15 for release.
Eric Anholt [Thu, 8 Oct 2009 23:59:17 +0000 (16:59 -0700)]
Bump to 2.4.15 for release.

13 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.

13 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]

13 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.

13 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.

13 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.

13 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>
13 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>
13 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>
13 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.

13 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>
13 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>
13 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>