ChangeLog | 245 +++++++++++++++++++++++++++++++++++++++ configure.ac | 2 debian/changelog | 6 include/drm/drm.h | 4 include/drm/drm_mode.h | 4 include/drm/i915_drm.h | 4 include/drm/nouveau_drm.h | 1 include/drm/radeon_drm.h | 4 include/drm/vmwgfx_drm.h | 69 +++++++++++ intel/intel_bufmgr.h | 6 intel/intel_bufmgr_gem.c | 282 ++++++++++++++++++++++++---------------------- nouveau/nouveau_device.c | 21 +-- tests/modetest/modetest.c | 96 ++++++--------- xf86drm.c | 30 ++++ xf86drmMode.c | 44 +++---- 15 files changed, 588 insertions(+), 230 deletions(-)
New commits: commit 55eca8de3790c3d67f6e05da3001c2aa0da5aca7 Author: Sven Joachim <svenj...@gmx.de> Date: Wed Sep 29 08:59:48 2010 +0200 Bump changelogs diff --git a/ChangeLog b/ChangeLog index d5a1664..3ae6795 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,248 @@ +commit 624e58e3e43c0b2c6803cb9263863444abeb3acb +Author: Carl Worth <cwo...@cworth.org> +Date: Tue Sep 28 20:40:37 2010 -0700 + + Increment version to 2.4.22 + + For the upcoming 2.4.22 release. + +commit 6299722c478234a759b1ce748436197ca1a17ebf +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Sat Sep 25 21:32:59 2010 +0100 + + intel: Replace open-coded drmIoctl with calls to drmIoctl() + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit 81fa7a9f56b1efb04658db921e5228c102548921 +Author: Ben Skeggs <bske...@redhat.com> +Date: Tue Sep 21 13:02:07 2010 +1000 + + nouveau: fix drm version check some more + + ... and make a mental note to not push commits before having coffee + + Signed-off-by: Ben Skeggs <bske...@redhat.com> + +commit d1cec6d2a9d63411c70c6c37509129ea4afe07d8 +Author: Ben Skeggs <bske...@redhat.com> +Date: Mon Sep 20 08:07:28 2010 +1000 + + nouveau: fix thinko in drm version check + + Signed-off-by: Ben Skeggs <bske...@redhat.com> + +commit 7ec9a1effa4f551897f91f3b017723a8adf011d9 +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Thu Sep 9 18:52:28 2010 +0100 + + modetest: Fix drawing routines to use stride. + +commit 0da84f89c2cb25416bd3bdecae24f287b08cdb76 +Author: Jesse Barnes <jbar...@virtuousgeek.org> +Date: Thu Sep 9 10:27:22 2010 -0700 + + modetest: align fb pitch to 64 bytes + + Docs say this is necessary, and the kernel now enforces this. + +commit b8abe6139e5c6779ee87d983346f0f65bf67462e +Author: Jesse Barnes <jbar...@virtuousgeek.org> +Date: Tue Sep 7 13:10:15 2010 -0700 + + modetest: add edp and TV connector names to the connector name array + +commit 23287f05cf2443ddf9e028e29beb5bd30979c6cf +Author: Eric Anholt <e...@anholt.net> +Date: Thu Aug 26 15:39:28 2010 -0700 + + Avoid use of c++ reserved keyword "virtual" when using a C++ compiler. + + Avoids requiring nasty hacks around libdrm headers in the new C++ + parts of Mesa drivers. + +commit 8a76244a0fd09d0e3298fe68af812d7eaa4dbcb5 +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Tue Aug 24 21:29:31 2010 +0100 + + Free the property blob along the error path. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit b61e81a191d3a5c269c5f7c40199aebc9ebc034c +Author: Ben Skeggs <bske...@redhat.com> +Date: Wed Aug 18 12:06:48 2010 +1000 + + nouveau: accept both 0.0.16 and 1.x.x + + Signed-off-by: Ben Skeggs <bske...@redhat.com> + +commit b04515c5d6c95f573457a94267b855cceb639105 +Author: Benjamin Herrenschmidt <b...@kernel.crashing.org> +Date: Fri Aug 6 13:55:11 2010 +1000 + + libdrm: Fix PCI domain domain support + + This works in conjunction with newer kernels. If we succeed in requesting + interface 1.4, the we know the kernel provides proper domain numbers. If + not, ignore the domain number as it's bogus (except on Alpha). + + Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> + Signed-off-by: Adam Jackson <a...@redhat.com> + +commit 431f7f00db844534dbcf9a63da0d2832a3d91bff +Author: Dave Airlie <airl...@redhat.com> +Date: Wed Aug 4 08:41:23 2010 +1000 + + Copy headers from kernel drm-core-next + +commit b803918f3f77c62edf22e78cb2095be399753423 +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Thu Jul 1 22:38:54 2010 +0100 + + drm mode: Return -errno on drmIoctl() failure + + The high layers expect to receive a status code on error (on the + pessimistic assumption that the errno value will have been overwritten + by the time the failure is propagated all the way up), so convert + xf86drmMode.c to return -errno on an ioctl error and be consistent with + the rest of the libdrm API. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit c570b4b97b8ff71da9294aaf8242ed665f0c09c3 +Author: Fernando Carrijo <fcarr...@yahoo.com.br> +Date: Thu Jul 1 09:28:29 2010 -0700 + + Purge macro NEED_REPLIES + + Signed-off-by: Fernando Carrijo <fcarr...@yahoo.com.br> + Signed-off-by: Brian Paul <bri...@vmware.com> + +commit c3ddfea1a64b7aaaebfb429243c71feb0801da9d +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Tue Jun 29 20:12:44 2010 +0100 + + intel: Suppress the error return from setting domains after mapping. + + If the mapping succeeds we have a valid pointer. If setting the domain + failures we may incur cache corruption. However the usual failure mode + is because of a hung GPU, in which case it is preferable to ignore the + minor error from setting the domain and continue on oblivious. If + these errors persist, we should rate limit the warning [or even just + remove it]. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit 726210f87d558d558022f35bc8c839e798a19f0c +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Thu Jun 24 11:38:00 2010 +0100 + + intel: Limit tiled pitches to 8192 on pre-i965. + + Fixes: + + Bug 28515 - Failed to allocate framebuffer when exceed 2048 width + https://bugs.freedesktop.org/show_bug.cgi?id=28515 + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit 6ea2bda5f5ec8f27359760ce580fdad3df0464df +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Tue Jun 22 13:03:52 2010 +0100 + + intel: Only adjust the local stride used for SET_TILING in tiled alloc + + Mesa uses the returned pitch from alloc_tiled, so make sure that we set + it correctly before modifying the stride used for the SET_TILING call. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit aba3502190a5bd2203e71ae2b1b7dd5aeb223905 +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Tue Jun 22 13:00:22 2010 +0100 + + intel: Restore SET_TILING for non-flinked bo. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit c7bbaca6a376f40d914d1ed33e119f2330701c9a +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Tue Jun 22 11:15:56 2010 +0100 + + intel: '===' != '==' + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit cd34cbeb9f5c65b25d241700f27c16b36e1ecce6 +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Tue Jun 22 11:07:26 2010 +0100 + + intel: Sanitise strides for linear buffers and SET_TILING + + Ensure that the user doesn't attempt to specify a stride to use with a + linear buffer by forcing such to be zero. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit 13e8270504cffa96bd067dc5c792a79555e8b2d4 +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Mon Jun 21 15:38:06 2010 +0100 + + intel: Print out debugging message following ENOSPC + + execbuffer() returns ENOSPC if it cannot fit the batch buffer into the + aperture which is the error we want to diagnose here. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit f16b4164d686893949daa3217a011d21c5bd7f95 +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Mon Jun 21 15:21:48 2010 +0100 + + intel: Scan the cache for old bo once every second. + + Rearrange the cache cleanup so that we always scan following a final + unreference, and guard against multiple scans in a single second. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit 5eec286838118501dd79178c152000ad4cbd70e1 +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Mon Jun 21 14:20:56 2010 +0100 + + intel: Force stride to be 0 for I915_TILING_NONE. + + When allocating a tiled buffer, if we remove the desired tiling mode due + to it being beyond hardware limits, also remove the stride. This ensures + that we only ever use stride 0 with I915_TILING_NONE. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit 1db22ff741f92b84450ec13093e070a6ad5fc857 +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Mon Jun 21 14:27:23 2010 +0100 + + intel: Defer tiling change to allocation. + + As we now expose a method to allocate tiled buffers, it makes more sense + to defer the SET_TILING until required. Besides the slim chance that it + will be a no-op, by delaying the change we are less likely to stall on + waiting for a bound buffer to release a fence register. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + +commit 056aa9be04e923a45ca00924caa587d6dbf8821d +Author: Chris Wilson <ch...@chris-wilson.co.uk> +Date: Mon Jun 21 14:31:29 2010 +0100 + + intel: Track tiling stride + + We need to inform the kernel if the tiling stride changes and not only + for changes of the tiling mode. + + Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> + commit 65ec8d7699267cc59777d531f545a82a14341480 Author: Eric Anholt <e...@anholt.net> Date: Thu Jun 10 08:59:05 2010 -0700 diff --git a/debian/changelog b/debian/changelog index a9a9d1f..1f4f3c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libdrm (2.4.22-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Sven Joachim <svenj...@gmx.de> Wed, 29 Sep 2010 08:57:51 +0200 + libdrm (2.4.21-2) experimental; urgency=low [ Sven Joachim ] commit 624e58e3e43c0b2c6803cb9263863444abeb3acb Author: Carl Worth <cwo...@cworth.org> Date: Tue Sep 28 20:40:37 2010 -0700 Increment version to 2.4.22 For the upcoming 2.4.22 release. diff --git a/configure.ac b/configure.ac index 62db817..179f29f 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. AC_PREREQ(2.60) -AC_INIT([libdrm], 2.4.21, [dri-de...@lists.sourceforge.net], libdrm) +AC_INIT([libdrm], 2.4.22, [dri-de...@lists.sourceforge.net], libdrm) AC_USE_SYSTEM_EXTENSIONS AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([dist-bzip2]) commit 6299722c478234a759b1ce748436197ca1a17ebf Author: Chris Wilson <ch...@chris-wilson.co.uk> Date: Sat Sep 25 21:32:59 2010 +0100 intel: Replace open-coded drmIoctl with calls to drmIoctl() Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 3446390..968cb78 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -507,9 +507,7 @@ drm_intel_gem_bo_busy(drm_intel_bo *bo) memset(&busy, 0, sizeof(busy)); busy.handle = bo_gem->gem_handle; - do { - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_BUSY, &busy); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_BUSY, &busy); return (ret == 0 && busy.busy); } @@ -523,7 +521,7 @@ drm_intel_gem_bo_madvise_internal(drm_intel_bufmgr_gem *bufmgr_gem, madv.handle = bo_gem->gem_handle; madv.madv = state; madv.retained = 1; - ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_MADVISE, &madv); + drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_MADVISE, &madv); return madv.retained; } @@ -650,11 +648,9 @@ retry: memset(&create, 0, sizeof(create)); create.size = bo_size; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_CREATE, - &create); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_CREATE, + &create); bo_gem->gem_handle = create.handle; bo_gem->bo.handle = bo_gem->gem_handle; if (ret != 0) { @@ -782,11 +778,9 @@ drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr, memset(&open_arg, 0, sizeof(open_arg)); open_arg.name = handle; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_GEM_OPEN, - &open_arg); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_GEM_OPEN, + &open_arg); if (ret != 0) { fprintf(stderr, "Couldn't reference %s handle 0x%08x: %s\n", name, handle, strerror(errno)); @@ -806,7 +800,9 @@ drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr, memset(&get_tiling, 0, sizeof(get_tiling)); get_tiling.handle = bo_gem->gem_handle; - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_GET_TILING, + &get_tiling); if (ret != 0) { drm_intel_gem_bo_unreference(&bo_gem->bo); return NULL; @@ -837,7 +833,7 @@ drm_intel_gem_bo_free(drm_intel_bo *bo) /* Close this object */ memset(&close, 0, sizeof(close)); close.handle = bo_gem->gem_handle; - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close); + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close); if (ret != 0) { fprintf(stderr, "DRM_IOCTL_GEM_CLOSE %d failed (%s): %s\n", @@ -974,11 +970,9 @@ static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable) mmap_arg.handle = bo_gem->gem_handle; mmap_arg.offset = 0; mmap_arg.size = bo->size; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_MMAP, - &mmap_arg); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_MMAP, + &mmap_arg); if (ret != 0) { ret = -errno; fprintf(stderr, @@ -1000,11 +994,9 @@ static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable) set_domain.write_domain = I915_GEM_DOMAIN_CPU; else set_domain.write_domain = 0; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_SET_DOMAIN, - &set_domain); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_SET_DOMAIN, + &set_domain); if (ret != 0) { fprintf(stderr, "%s:%d: Error setting to CPU domain %d: %s\n", __FILE__, __LINE__, bo_gem->gem_handle, @@ -1036,11 +1028,9 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) mmap_arg.handle = bo_gem->gem_handle; /* Get the fake offset back... */ - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_MMAP_GTT, - &mmap_arg); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_MMAP_GTT, + &mmap_arg); if (ret != 0) { ret = -errno; fprintf(stderr, @@ -1078,11 +1068,9 @@ int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo) set_domain.handle = bo_gem->gem_handle; set_domain.read_domains = I915_GEM_DOMAIN_GTT; set_domain.write_domain = I915_GEM_DOMAIN_GTT; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_SET_DOMAIN, - &set_domain); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_SET_DOMAIN, + &set_domain); if (ret != 0) { fprintf(stderr, "%s:%d: Error setting domain %d: %s\n", __FILE__, __LINE__, bo_gem->gem_handle, @@ -1130,11 +1118,9 @@ static int drm_intel_gem_bo_unmap(drm_intel_bo *bo) * results show up in a timely manner. */ sw_finish.handle = bo_gem->gem_handle; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_SW_FINISH, - &sw_finish); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_SW_FINISH, + &sw_finish); ret = ret == -1 ? -errno : 0; bo->virtual = NULL; @@ -1157,11 +1143,9 @@ drm_intel_gem_bo_subdata(drm_intel_bo *bo, unsigned long offset, pwrite.offset = offset; pwrite.size = size; pwrite.data_ptr = (uint64_t) (uintptr_t) data; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_PWRITE, - &pwrite); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_PWRITE, + &pwrite); if (ret != 0) { ret = -errno; fprintf(stderr, @@ -1181,8 +1165,9 @@ drm_intel_gem_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, int crtc_id) int ret; get_pipe_from_crtc_id.crtc_id = crtc_id; - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, - &get_pipe_from_crtc_id); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, + &get_pipe_from_crtc_id); if (ret != 0) { /* We return -1 here to signal that we don't * know which pipe is associated with this crtc. @@ -1210,11 +1195,9 @@ drm_intel_gem_bo_get_subdata(drm_intel_bo *bo, unsigned long offset, pread.offset = offset; pread.size = size; pread.data_ptr = (uint64_t) (uintptr_t) data; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_PREAD, - &pread); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_PREAD, + &pread); if (ret != 0) { ret = -errno; fprintf(stderr, @@ -1251,11 +1234,9 @@ drm_intel_gem_bo_start_gtt_access(drm_intel_bo *bo, int write_enable) set_domain.handle = bo_gem->gem_handle; set_domain.read_domains = I915_GEM_DOMAIN_GTT; set_domain.write_domain = write_enable ? I915_GEM_DOMAIN_GTT : 0; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_SET_DOMAIN, - &set_domain); - } while (ret == -1 && errno == EINTR); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_SET_DOMAIN, + &set_domain); if (ret != 0) { fprintf(stderr, "%s:%d: Error setting memory domains %d (%08x %08x): %s .\n", @@ -1526,12 +1507,9 @@ drm_intel_gem_bo_exec(drm_intel_bo *bo, int used, execbuf.DR1 = 0; execbuf.DR4 = DR4; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_EXECBUFFER, - &execbuf); - } while (ret != 0 && errno == EINTR); - + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_EXECBUFFER, + &execbuf); if (ret != 0) { ret = -errno; if (errno == ENOSPC) { @@ -1599,11 +1577,9 @@ drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used, execbuf.rsvd1 = 0; execbuf.rsvd2 = 0; - do { - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, - &execbuf); - } while (ret != 0 && errno == EINTR); - + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_EXECBUFFER2, + &execbuf); if (ret != 0) { ret = -errno; if (ret == -ENOSPC) { @@ -1658,12 +1634,9 @@ drm_intel_gem_bo_pin(drm_intel_bo *bo, uint32_t alignment) pin.handle = bo_gem->gem_handle; pin.alignment = alignment; - do { - ret = ioctl(bufmgr_gem->fd, - DRM_IOCTL_I915_GEM_PIN, - &pin); - } while (ret == -1 && errno == EINTR); - + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_PIN, + &pin); if (ret != 0) return -errno; @@ -1682,7 +1655,7 @@ drm_intel_gem_bo_unpin(drm_intel_bo *bo) memset(&unpin, 0, sizeof(unpin)); unpin.handle = bo_gem->gem_handle; - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_UNPIN, &unpin); + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_UNPIN, &unpin); if (ret != 0) return -errno; @@ -1706,6 +1679,10 @@ drm_intel_gem_bo_set_tiling_internal(drm_intel_bo *bo, memset(&set_tiling, 0, sizeof(set_tiling)); do { + /* set_tiling is slightly broken and overwrites the + * input on the error path, so we have to open code + * rmIoctl. + */ set_tiling.handle = bo_gem->gem_handle; set_tiling.tiling_mode = tiling_mode; set_tiling.stride = stride; @@ -1713,7 +1690,7 @@ drm_intel_gem_bo_set_tiling_internal(drm_intel_bo *bo, ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling); - } while (ret == -1 && errno == EINTR); + } while (ret == -1 && (errno == EINTR || errno == EAGAIN)); if (ret == -1) return -errno; @@ -1768,7 +1745,7 @@ drm_intel_gem_bo_flink(drm_intel_bo *bo, uint32_t * name) memset(&flink, 0, sizeof(flink)); flink.handle = bo_gem->gem_handle; - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_GEM_FLINK, &flink); + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_FLINK, &flink); if (ret != 0) return -errno; bo_gem->global_name = flink.name; @@ -2099,7 +2076,9 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size) return NULL; } - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture); + ret = drmIoctl(bufmgr_gem->fd, + DRM_IOCTL_I915_GEM_GET_APERTURE, + &aperture); if (ret == 0) bufmgr_gem->gtt_size = aperture.aper_available_size; @@ -2115,7 +2094,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size) gp.param = I915_PARAM_CHIPSET_ID; gp.value = &bufmgr_gem->pci_device; - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); if (ret) { fprintf(stderr, "get chip id failed: %d [%d]\n", ret, errno); fprintf(stderr, "param: %d, val: %d\n", gp.param, *gp.value); @@ -2131,19 +2110,19 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size) bufmgr_gem->gen = 6; gp.param = I915_PARAM_HAS_EXECBUF2; - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); if (!ret) exec2 = 1; gp.param = I915_PARAM_HAS_BSD; - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); if (!ret) has_bsd = 1; if (bufmgr_gem->gen < 4) { gp.param = I915_PARAM_NUM_FENCES_AVAIL; gp.value = &bufmgr_gem->available_fences; - ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); if (ret) { fprintf(stderr, "get fences failed: %d [%d]\n", ret, errno); commit 81fa7a9f56b1efb04658db921e5228c102548921 Author: Ben Skeggs <bske...@redhat.com> Date: Tue Sep 21 13:02:07 2010 +1000 nouveau: fix drm version check some more ... and make a mental note to not push commits before having coffee Signed-off-by: Ben Skeggs <bske...@redhat.com> diff --git a/nouveau/nouveau_device.c b/nouveau/nouveau_device.c index 91f9a27..9a091fb 100644 --- a/nouveau/nouveau_device.c +++ b/nouveau/nouveau_device.c @@ -49,7 +49,7 @@ nouveau_device_open_existing(struct nouveau_device **dev, int close, if (!ver) return -EINVAL; - if ((ver->version_major == 0 && ver->version_patchlevel != 16) && + if ((ver->version_major == 0 && ver->version_patchlevel != 16) || ver->version_major > 1) { nouveau_device_close((void *)&nvdev); return -EINVAL; commit d1cec6d2a9d63411c70c6c37509129ea4afe07d8 Author: Ben Skeggs <bske...@redhat.com> Date: Mon Sep 20 08:07:28 2010 +1000 nouveau: fix thinko in drm version check Signed-off-by: Ben Skeggs <bske...@redhat.com> diff --git a/nouveau/nouveau_device.c b/nouveau/nouveau_device.c index f450e30..91f9a27 100644 --- a/nouveau/nouveau_device.c +++ b/nouveau/nouveau_device.c @@ -50,7 +50,7 @@ nouveau_device_open_existing(struct nouveau_device **dev, int close, return -EINVAL; if ((ver->version_major == 0 && ver->version_patchlevel != 16) && - ver->version_major != 1) { + ver->version_major > 1) { nouveau_device_close((void *)&nvdev); return -EINVAL; } commit 7ec9a1effa4f551897f91f3b017723a8adf011d9 Author: Chris Wilson <ch...@chris-wilson.co.uk> Date: Thu Sep 9 18:52:28 2010 +0100 modetest: Fix drawing routines to use stride. diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 820f8a5..f3a04d0 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -354,37 +354,40 @@ connector_find_mode(struct connector *c) c->crtc = c->encoder->crtc_id; } -#ifdef HAVE_CAIRO +static drm_intel_bo * +allocate_buffer(drm_intel_bufmgr *bufmgr, + int width, int height, int *stride) +{ + int size; -static int -create_test_buffer(drm_intel_bufmgr *bufmgr, - int width, int height, int *stride_out, drm_intel_bo **bo_out) + /* Scan-out has a 64 byte alignment restriction */ + size = (width + 63) & -64; + *stride = size; + size *= height; + + return drm_intel_bo_alloc(bufmgr, "frontbuffer", size, 0); +} + +static void +make_pwetty(drm_intel_bo *bo, int width, int height, int stride) { - drm_intel_bo *bo; - unsigned int *fb_ptr; - int size, i, stride; - div_t d; +#ifdef HAVE_CAIRO cairo_surface_t *surface; cairo_t *cr; - char buf[64]; int x, y; - surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); - stride = cairo_image_surface_get_stride(surface); - size = stride * height; - fb_ptr = (unsigned int *) cairo_image_surface_get_data(surface); - - /* paint the buffer with colored tiles */ - for (i = 0; i < width * height; i++) { - d = div(i, width); - fb_ptr[i] = 0x00130502 * (d.quot >> 6) + 0x000a1120 * (d.rem >> 6); - } - + surface = cairo_image_surface_create_for_data(bo->virtual, + CAIRO_FORMAT_ARGB32, + width, height, + stride); cr = cairo_create(surface); + cairo_surface_destroy(surface); + cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE); for (x = 0; x < width; x += 250) for (y = 0; y < height; y += 250) { - cairo_set_operator(cr, CAIRO_OPERATOR_OVER); + char buf[64]; + cairo_move_to(cr, x, y - 20); cairo_line_to(cr, x, y + 20); cairo_move_to(cr, x - 20, y); @@ -397,6 +400,7 @@ create_test_buffer(drm_intel_bufmgr *bufmgr, cairo_set_source_rgb(cr, 1, 1, 1); cairo_set_line_width(cr, 2); cairo_stroke(cr); + snprintf(buf, sizeof buf, "%d, %d", x, y); cairo_move_to(cr, x + 20, y + 20); cairo_text_path(cr, buf); @@ -407,41 +411,17 @@ create_test_buffer(drm_intel_bufmgr *bufmgr, } cairo_destroy(cr); - - bo = drm_intel_bo_alloc(bufmgr, "frontbuffer", size, 4096); - if (!bo) { - fprintf(stderr, "failed to alloc buffer: %s\n", - strerror(errno)); - return -1; - } - - drm_intel_bo_subdata(bo, 0, size, fb_ptr); - - cairo_surface_destroy(surface); - - *bo_out = bo; - *stride_out = stride; - - return 0; +#endif } -#else - static int create_test_buffer(drm_intel_bufmgr *bufmgr, int width, int height, int *stride_out, drm_intel_bo **bo_out) { drm_intel_bo *bo; - unsigned int *fb_ptr; - int size, ret, i, stride; - div_t d; + int ret, i, j, stride; - /* Mode size at 32 bpp */ - stride = width * 4; - stride = (stride + 63) & ~63; - size = stride * height; - - bo = drm_intel_bo_alloc(bufmgr, "frontbuffer", size, 4096); + bo = allocate_buffer(bufmgr, width, height, &stride); if (!bo) { fprintf(stderr, "failed to alloc buffer: %s\n", strerror(errno)); @@ -455,23 +435,26 @@ create_test_buffer(drm_intel_bufmgr *bufmgr, return -1; } - fb_ptr = bo->virtual; - /* paint the buffer with colored tiles */ - for (i = 0; i < width * height; i++) { - d = div(i, width); - fb_ptr[i] = 0x00130502 * (d.quot >> 6) + 0x000a1120 * (d.rem >> 6); + for (j = 0; j < height; j++) { + uint32_t *fb_ptr = (uint32_t*)((char*)bo->virtual + j * stride); + for (i = 0; i < width; i++) { + div_t d = div(i, width); + fb_ptr[i] = + 0x00130502 * (d.quot >> 6) + + 0x000a1120 * (d.rem >> 6); + } } + + make_pwetty(bo, width, height, stride); + drm_intel_gem_bo_unmap_gtt(bo); *bo_out = bo; *stride_out = stride; - return 0; } -#endif - static int create_grey_buffer(drm_intel_bufmgr *bufmgr, int width, int height, int *stride_out, drm_intel_bo **bo_out) commit 0da84f89c2cb25416bd3bdecae24f287b08cdb76 Author: Jesse Barnes <jbar...@virtuousgeek.org> Date: Thu Sep 9 10:27:22 2010 -0700 modetest: align fb pitch to 64 bytes Docs say this is necessary, and the kernel now enforces this. diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 177b9c0..820f8a5 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -438,6 +438,7 @@ create_test_buffer(drm_intel_bufmgr *bufmgr, /* Mode size at 32 bpp */ stride = width * 4; + stride = (stride + 63) & ~63; size = stride * height; bo = drm_intel_bo_alloc(bufmgr, "frontbuffer", size, 4096); commit b8abe6139e5c6779ee87d983346f0f65bf67462e Author: Jesse Barnes <jbar...@virtuousgeek.org> Date: Tue Sep 7 13:10:15 2010 -0700 modetest: add edp and TV connector names to the connector name array diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 0a60c89..177b9c0 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -111,6 +111,8 @@ struct type_name connector_type_names[] = { { DRM_MODE_CONNECTOR_DisplayPort, "displayport" }, { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" }, { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" }, + { DRM_MODE_CONNECTOR_TV, "TV" }, + { DRM_MODE_CONNECTOR_eDP, "embedded displayport" }, }; type_name_fn(connector_type) commit 23287f05cf2443ddf9e028e29beb5bd30979c6cf Author: Eric Anholt <e...@anholt.net> Date: Thu Aug 26 15:39:28 2010 -0700 Avoid use of c++ reserved keyword "virtual" when using a C++ compiler. Avoids requiring nasty hacks around libdrm headers in the new C++ parts of Mesa drivers. diff --git a/include/drm/drm.h b/include/drm/drm.h index a0559eb..2ba7136 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h @@ -373,7 +373,11 @@ struct drm_buf_pub { */ struct drm_buf_map { int count; /**< Length of the buffer list */ +#ifdef __cplusplus + void *virt; +#else void *virtual; /**< Mmap'd area in user-virtual */ +#endif struct drm_buf_pub *list; /**< Buffer information */ }; diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index 65fd603..9df5168 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -66,7 +66,11 @@ struct _drm_intel_bo { * Virtual address for accessing the buffer data. Only valid while * mapped. */ +#ifdef __cplusplus + void *virt; +#else void *virtual; +#endif /** Buffer manager context associated with this buffer object */ drm_intel_bufmgr *bufmgr; @@ -168,7 +172,7 @@ void drm_intel_bufmgr_fake_set_fence_callback(drm_intel_bufmgr *bufmgr, drm_intel_bo *drm_intel_bo_fake_alloc_static(drm_intel_bufmgr *bufmgr, const char *name, unsigned long offset, - unsigned long size, void *virtual); + unsigned long size, void *virt); void drm_intel_bo_fake_disable_backing_store(drm_intel_bo *bo, void (*invalidate_cb) (drm_intel_bo * bo, commit 8a76244a0fd09d0e3298fe68af812d7eaa4dbcb5 Author: Chris Wilson <ch...@chris-wilson.co.uk> Date: Tue Aug 24 21:29:31 2010 +0100 Free the property blob along the error path. Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> diff --git a/xf86drmMode.c b/xf86drmMode.c index ecb1fd5..0d268fc 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -619,7 +619,7 @@ drmModePropertyBlobPtr drmModeGetPropertyBlob(int fd, uint32_t blob_id) } if (!(r = drmMalloc(sizeof(*r)))) - return NULL; + goto err_allocs; r->id = blob.blob_id; r->length = blob.length; commit b61e81a191d3a5c269c5f7c40199aebc9ebc034c Author: Ben Skeggs <bske...@redhat.com> Date: Wed Aug 18 12:06:48 2010 +1000 nouveau: accept both 0.0.16 and 1.x.x Signed-off-by: Ben Skeggs <bske...@redhat.com> diff --git a/nouveau/nouveau_device.c b/nouveau/nouveau_device.c index c525391..f450e30 100644 --- a/nouveau/nouveau_device.c +++ b/nouveau/nouveau_device.c @@ -26,10 +26,6 @@ #include "nouveau_private.h" -#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 16 -#error nouveau_drm.h does not match expected patchlevel, update libdrm. -#endif - int nouveau_device_open_existing(struct nouveau_device **dev, int close, -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1p0ypa-0000nu...@alioth.debian.org