Commit Graph

4966 Commits (8c75703df0fdf65b3851f8eb5822705638decff3)

Author SHA1 Message Date
Dave Airlie 125994ab30 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>
2009-12-21 08:05:16 +10:00
Ben Skeggs f1660c2491 nouveau: remove delayed kernel bo creation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-17 13:07:18 +10:00
Kristian Høgsberg fbc8b2d95f Be less chatty in drmSetMaster/drmDropMaster 2009-12-15 08:44:40 -05:00
Kristian Høgsberg 59d97e7d68 modetest: Error out if pageflipping is requested but not available 2009-12-15 08:44:40 -05:00
Jakob Bornecrantz 77ddc78566 vmwgfx: Fetch the latest header 2009-12-14 22:53:10 +01:00
Ben Skeggs edc77dd291 nouveau: Use drmIoctl so we restart ioctl on EINTR or EAGAIN
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-09 14:51:00 +10:00
Ben Skeggs 7c82527b4f nouveau: move reloc code down, nothing to see here
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-09 14:51:00 +10:00
Chris Wilson 08371bc290 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>
2009-12-08 22:35:24 +00:00
Jakob Bornecrantz 201f5795a2 libkms: Change destroy api a bit 2009-12-04 16:11:56 +01:00
Jakob Bornecrantz 8c0571a733 libkms: Add libkms 2009-12-04 16:11:55 +01:00
Jakob Bornecrantz 28eae30689 Ignore config.h.in 2009-12-04 16:07:51 +01:00
Jerome Glisse b84314a86e 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>
2009-12-07 18:30:52 +01:00
Chris Wilson 9707733a13 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>
2009-12-05 11:03:05 +00:00
Jesse Barnes 6f1eba0548 modetest: fix build error due to page_flip_handler name change
Forgot to update this when pushing the pageflip bits.
2009-12-04 09:09:19 -08:00
Jakob Bornecrantz 3bd834a217 Merge branch 'modesetting-dirty-libdrm'
Conflicts:
	include/drm/drm.h
2009-12-02 19:40:58 +01:00
Kristian Høgsberg be957cc219 Add RELEASING to document the release process 2009-12-03 17:50:37 -05:00
Jesse Barnes 14f5958f7f Bump event context structure version for page flipping 2009-12-03 14:27:08 -08:00
Jesse Barnes 53addc5d6e Merge branch 'pageflip' of git://people.freedesktop.org/~jbarnes/drm
Conflicts:
	include/drm/drm.h - RMFB had its signature changed to avoid uint32_t
2009-12-03 14:17:26 -08:00
Kristian Høgsberg db50f51274 Bump to 2.4.16 for release 2009-12-03 11:31:27 -05:00
Kristian Høgsberg bef7f88de9 Enable experimental APIs for distcheck 2009-12-03 11:27:16 -05:00
Jakob Bornecrantz ac5595abc1 Change the number on the dirty ioctl to match upstream 2009-12-02 19:39:16 +01:00
Chris Wilson 57473c7f52 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>
2009-12-02 14:29:23 +00:00
Chris Wilson 792fed1e24 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>
2009-12-02 14:18:31 +00:00
Chris Wilson b73612e4fd 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>
2009-12-02 14:17:15 +00:00
Chris Wilson acb4aa6715 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>
2009-12-02 14:17:04 +00:00
Chris Wilson 9fec2a8cb2 intel: Make bo_reference() inline for internal use.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-12-02 14:16:32 +00:00
Chris Wilson 9c8ad05e8b 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>
2009-12-02 14:16:32 +00:00
Chris Wilson 8ffd2e142e 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>
2009-12-01 13:09:20 +00:00
Chris Wilson b666f4151a 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>
2009-11-30 23:07:19 +00:00
Chris Wilson e22fb79772 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>
2009-11-30 22:18:15 +00:00
Chris Wilson 60aa803dc7 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>
2009-11-30 20:02:05 +00:00
Jakob Bornecrantz 019a408a69 Change the dirty ioctl a bit and comment it 2009-11-30 00:40:51 +00:00
Jakob Bornecrantz 3e48613b48 Bring dirty code from old branch 2009-11-26 16:47:54 +01:00
Robert Noland 6f66de982a Correctly set DRM_MAX_MINOR for all platforms.
DRM_MAJOR is platform specific, but not used outside of xf86drm.c
that I can find.
2009-11-25 15:09:24 -06:00
Alex Deucher 9558f6377f Add missing DRM_MAX_MINOR define
lost in 500f5b5240

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2009-11-24 15:03:32 -05:00
Robert Noland 82bf52fbcd More fixups to allow mesa to build 2009-11-24 10:31:41 -06:00
Robert Noland 170674a606 Finish fixing the build on FreeBSD 2009-11-24 09:27:29 -06:00
Kristian Høgsberg 22d4666904 Add drmGetDeviceNameFromFd function
Determines the /dev filename of the drm fd argument.
2009-11-23 20:51:34 -05:00
Kristian Høgsberg 500f5b5240 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.
2009-11-23 18:25:11 -05:00
Kristian Høgsberg 863e39b56e Don't hardcore 'yes', use in configure.ac output
Oops, I assumed intel was always enable, but it just defaults to on.
2009-11-23 12:42:36 -05:00
Kristian Høgsberg 696fdb11f4 Output summary of enabled features at the end of configure.ac 2009-11-23 11:41:27 -05:00
Kristian Høgsberg dd6cbe7acb Drop duplicated radeon_*.h files in include/drm
These files are userspace headers and live in radeon/
2009-11-23 11:26:26 -05:00
Kristian Høgsberg 6b3cbe7655 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.
2009-11-20 20:17:26 -05:00
Kristian Høgsberg 4f070d593c Install kernel headers in ${includedir}/drm 2009-11-20 19:46:34 -05:00
Pekka Paalanen 3a87b1f497 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>
2009-11-21 01:00:36 +02:00
Jesse Barnes ee746a83ce Bump libdrm version to 2.4.16 for page flipping 2009-11-20 14:53:47 -08:00
Kristian Høgsberg 1e1b3c0a93 modetest: add pageflip test case to modetest 2009-11-20 14:53:38 -08:00
Kristian Høgsberg b80bcffba6 libdrm: add libdrm support for page flip ioctl 2009-11-20 14:53:27 -08:00
Kristian Høgsberg 10ce0ec188 Merge remote branch 'origin/master' into libdrm 2009-11-20 17:09:03 -05:00
Kristian Høgsberg 1b064cc428 Update README 2009-11-20 17:08:28 -05:00