- rebase onto git snapshot - remove radeon patch in master now
This commit is contained in:
parent
dc4df2c0b9
commit
2ec7ef4744
@ -1 +1 @@
|
||||
libdrm-2.4.11.tar.bz2
|
||||
libdrm-20090622.tar.bz2
|
||||
|
@ -1,73 +0,0 @@
|
||||
commit e0265401be3c35f668d56a1b6b11084b708e2afa
|
||||
Author: Dave Airlie <airlied@linux.ie>
|
||||
Date: Sat Apr 11 08:16:44 2009 +1000
|
||||
|
||||
Revert "libdrm: speed up connector & mode fetching"
|
||||
|
||||
This reverts commit cd5c66c659168cbe2e3229ebf8be79f764ed0ee1.
|
||||
|
||||
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
|
||||
index e2aba81..872604f 100644
|
||||
--- a/libdrm/xf86drmMode.c
|
||||
+++ b/libdrm/xf86drmMode.c
|
||||
@@ -357,45 +357,21 @@ drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connector_id)
|
||||
{
|
||||
struct drm_mode_get_connector conn;
|
||||
drmModeConnectorPtr r = NULL;
|
||||
- int pre_props = 8, pre_modes = 16, pre_encoders = 4;
|
||||
|
||||
conn.connector_id = connector_id;
|
||||
conn.connector_type_id = 0;
|
||||
conn.connector_type = 0;
|
||||
- conn.count_modes = pre_modes;
|
||||
- conn.count_props = pre_props;
|
||||
- conn.count_encoders = pre_encoders;
|
||||
-
|
||||
- /*
|
||||
- * Pre-allocate space for some modes, properties, and encoders. If
|
||||
- * we're lucky we won't need to call into the kernel twice.
|
||||
- */
|
||||
- conn.props_ptr = VOID2U64(drmMalloc(pre_props * sizeof(uint32_t)));
|
||||
- conn.prop_values_ptr = VOID2U64(drmMalloc(pre_props *
|
||||
- sizeof(uint64_t)));
|
||||
- conn.modes_ptr = VOID2U64(drmMalloc(pre_modes *
|
||||
- sizeof(struct drm_mode_modeinfo)));
|
||||
- conn.encoders_ptr = VOID2U64(drmMalloc(pre_encoders *
|
||||
- sizeof(uint32_t)));
|
||||
+ conn.count_modes = 0;
|
||||
+ conn.modes_ptr = 0;
|
||||
+ conn.count_props = 0;
|
||||
+ conn.props_ptr = 0;
|
||||
+ conn.prop_values_ptr = 0;
|
||||
+ conn.count_encoders = 0;
|
||||
+ conn.encoders_ptr = 0;
|
||||
|
||||
if (drmIoctl(fd, DRM_IOCTL_MODE_GETCONNECTOR, &conn))
|
||||
return 0;
|
||||
|
||||
- if (conn.count_props <= pre_props &&
|
||||
- conn.count_modes <= pre_modes &&
|
||||
- conn.count_encoders <= pre_encoders)
|
||||
- goto done;
|
||||
-
|
||||
- /* Oh well, free & reallocate everything and ask again... */
|
||||
- drmFree(U642VOID(conn.prop_values_ptr));
|
||||
- drmFree(U642VOID(conn.props_ptr));
|
||||
- drmFree(U642VOID(conn.modes_ptr));
|
||||
- drmFree(U642VOID(conn.encoders_ptr));
|
||||
- conn.prop_values_ptr = 0;
|
||||
- conn.props_ptr = 0;
|
||||
- conn.modes_ptr = 0;
|
||||
- conn.encoders_ptr = 0;
|
||||
-
|
||||
if (conn.count_props) {
|
||||
conn.props_ptr = VOID2U64(drmMalloc(conn.count_props*sizeof(uint32_t)));
|
||||
conn.prop_values_ptr = VOID2U64(drmMalloc(conn.count_props*sizeof(uint64_t)));
|
||||
@@ -410,7 +386,6 @@ drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connector_id)
|
||||
if (drmIoctl(fd, DRM_IOCTL_MODE_GETCONNECTOR, &conn))
|
||||
goto err_allocs;
|
||||
|
||||
-done:
|
||||
if(!(r = drmMalloc(sizeof(*r)))) {
|
||||
goto err_allocs;
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
diff -up libdrm-2.4.5/libdrm/intel/intel_bufmgr_gem.c.jx libdrm-2.4.5/libdrm/intel/intel_bufmgr_gem.c
|
||||
--- libdrm-2.4.5/libdrm/intel/intel_bufmgr_gem.c.jx 2009-02-21 12:56:29.000000000 -0500
|
||||
+++ libdrm-2.4.5/libdrm/intel/intel_bufmgr_gem.c 2009-03-26 16:38:02.000000000 -0400
|
||||
@@ -145,7 +145,9 @@ struct _drm_intel_bo_gem {
|
||||
/** Number of entries in relocs */
|
||||
int reloc_count;
|
||||
/** Mapped address for the buffer, saved across map/unmap cycles */
|
||||
- void *virtual;
|
||||
+ void *mem_virtual;
|
||||
+ /** GTT virtual address for the buffer, saved across map/unmap cycles */
|
||||
+ void *gtt_virtual;
|
||||
|
||||
/** BO cache list */
|
||||
drmMMListHead head;
|
||||
@@ -524,8 +526,10 @@ drm_intel_gem_bo_free(drm_intel_bo *bo)
|
||||
struct drm_gem_close close;
|
||||
int ret;
|
||||
|
||||
- if (bo_gem->virtual)
|
||||
- munmap (bo_gem->virtual, bo_gem->bo.size);
|
||||
+ if (bo_gem->mem_virtual)
|
||||
+ munmap (bo_gem->mem_virtual, bo_gem->bo.size);
|
||||
+ if (bo_gem->gtt_virtual)
|
||||
+ munmap (bo_gem->gtt_virtual, bo_gem->bo.size);
|
||||
|
||||
/* Close this object */
|
||||
memset(&close, 0, sizeof(close));
|
||||
@@ -609,7 +613,7 @@ drm_intel_gem_bo_map(drm_intel_bo *bo, i
|
||||
/* Allow recursive mapping. Mesa may recursively map buffers with
|
||||
* nested display loops.
|
||||
*/
|
||||
- if (!bo_gem->virtual) {
|
||||
+ if (!bo_gem->mem_virtual) {
|
||||
struct drm_i915_gem_mmap mmap_arg;
|
||||
|
||||
DBG("bo_map: %d (%s)\n", bo_gem->gem_handle, bo_gem->name);
|
||||
@@ -626,12 +630,12 @@ drm_intel_gem_bo_map(drm_intel_bo *bo, i
|
||||
pthread_mutex_unlock(&bufmgr_gem->lock);
|
||||
return ret;
|
||||
}
|
||||
- bo_gem->virtual = (void *)(uintptr_t)mmap_arg.addr_ptr;
|
||||
+ bo_gem->mem_virtual = (void *)(uintptr_t)mmap_arg.addr_ptr;
|
||||
bo_gem->swrast = 0;
|
||||
}
|
||||
DBG("bo_map: %d (%s) -> %p\n", bo_gem->gem_handle, bo_gem->name,
|
||||
- bo_gem->virtual);
|
||||
- bo->virtual = bo_gem->virtual;
|
||||
+ bo_gem->mem_virtual);
|
||||
+ bo->virtual = bo_gem->mem_virtual;
|
||||
|
||||
if (bo_gem->global_name != 0 || !bo_gem->swrast) {
|
||||
set_domain.handle = bo_gem->gem_handle;
|
||||
@@ -669,7 +673,7 @@ drm_intel_gem_bo_map_gtt(drm_intel_bo *b
|
||||
pthread_mutex_lock(&bufmgr_gem->lock);
|
||||
|
||||
/* Get a mapping of the buffer if we haven't before. */
|
||||
- if (bo_gem->virtual == NULL) {
|
||||
+ if (bo_gem->gtt_virtual == NULL) {
|
||||
struct drm_i915_gem_mmap_gtt mmap_arg;
|
||||
|
||||
DBG("bo_map_gtt: %d (%s)\n", bo_gem->gem_handle, bo_gem->name);
|
||||
@@ -690,10 +694,10 @@ drm_intel_gem_bo_map_gtt(drm_intel_bo *b
|
||||
}
|
||||
|
||||
/* and mmap it */
|
||||
- bo_gem->virtual = mmap(0, bo->size, PROT_READ | PROT_WRITE,
|
||||
- MAP_SHARED, bufmgr_gem->fd,
|
||||
- mmap_arg.offset);
|
||||
- if (bo_gem->virtual == MAP_FAILED) {
|
||||
+ bo_gem->gtt_virtual = mmap(0, bo->size, PROT_READ | PROT_WRITE,
|
||||
+ MAP_SHARED, bufmgr_gem->fd,
|
||||
+ mmap_arg.offset);
|
||||
+ if (bo_gem->gtt_virtual == MAP_FAILED) {
|
||||
fprintf(stderr,
|
||||
"%s:%d: Error mapping buffer %d (%s): %s .\n",
|
||||
__FILE__, __LINE__,
|
||||
@@ -704,10 +708,10 @@ drm_intel_gem_bo_map_gtt(drm_intel_bo *b
|
||||
}
|
||||
}
|
||||
|
||||
- bo->virtual = bo_gem->virtual;
|
||||
+ bo->virtual = bo_gem->gtt_virtual;
|
||||
|
||||
DBG("bo_map: %d (%s) -> %p\n", bo_gem->gem_handle, bo_gem->name,
|
||||
- bo_gem->virtual);
|
||||
+ bo_gem->gtt_virtual);
|
||||
|
||||
/* Now move it to the GTT domain so that the CPU caches are flushed */
|
||||
set_domain.handle = bo_gem->gem_handle;
|
||||
@@ -719,7 +723,7 @@ drm_intel_gem_bo_map_gtt(drm_intel_bo *b
|
||||
} while (ret == -1 && errno == EINTR);
|
||||
|
||||
if (ret != 0) {
|
||||
- fprintf (stderr, "%s:%d: Error setting swrast %d: %s\n",
|
||||
+ fprintf (stderr, "%s:%d: Error setting domain %d: %s\n",
|
||||
__FILE__, __LINE__, bo_gem->gem_handle, strerror (errno));
|
||||
}
|
||||
|
||||
@@ -728,6 +732,26 @@ drm_intel_gem_bo_map_gtt(drm_intel_bo *b
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int
|
||||
+drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo)
|
||||
+{
|
||||
+ drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bo->bufmgr;
|
||||
+ drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo;
|
||||
+ struct drm_i915_gem_sw_finish sw_finish;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (bo == NULL)
|
||||
+ return 0;
|
||||
+
|
||||
+ assert(bo_gem->gtt_virtual != NULL);
|
||||
+
|
||||
+ pthread_mutex_lock(&bufmgr_gem->lock);
|
||||
+ bo->virtual = NULL;
|
||||
+ pthread_mutex_unlock(&bufmgr_gem->lock);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
drm_intel_gem_bo_unmap(drm_intel_bo *bo)
|
||||
{
|
||||
@@ -739,7 +763,7 @@ drm_intel_gem_bo_unmap(drm_intel_bo *bo)
|
||||
if (bo == NULL)
|
||||
return 0;
|
||||
|
||||
- assert(bo_gem->virtual != NULL);
|
||||
+ assert(bo_gem->mem_virtual != NULL);
|
||||
|
||||
pthread_mutex_lock(&bufmgr_gem->lock);
|
||||
if (bo_gem->swrast) {
|
||||
@@ -750,6 +774,7 @@ drm_intel_gem_bo_unmap(drm_intel_bo *bo)
|
||||
} while (ret == -1 && errno == EINTR);
|
||||
bo_gem->swrast = 0;
|
||||
}
|
||||
+ bo->virtual = NULL;
|
||||
pthread_mutex_unlock(&bufmgr_gem->lock);
|
||||
return 0;
|
||||
}
|
||||
diff -up libdrm-2.4.5/libdrm/intel/intel_bufmgr.h.jx libdrm-2.4.5/libdrm/intel/intel_bufmgr.h
|
||||
--- libdrm-2.4.5/libdrm/intel/intel_bufmgr.h.jx 2009-02-21 12:54:48.000000000 -0500
|
||||
+++ libdrm-2.4.5/libdrm/intel/intel_bufmgr.h 2009-03-26 16:38:02.000000000 -0400
|
||||
@@ -115,6 +115,7 @@ drm_intel_bo *drm_intel_bo_gem_create_fr
|
||||
unsigned int handle);
|
||||
void drm_intel_bufmgr_gem_enable_reuse(drm_intel_bufmgr *bufmgr);
|
||||
int drm_intel_gem_bo_map_gtt(drm_intel_bo *bo);
|
||||
+int drm_intel_gem_bo_unmap_gtt(drm_intel_bo *bo);
|
||||
void drm_intel_gem_bo_start_gtt_access(drm_intel_bo *bo, int write_enable);
|
||||
|
||||
/* drm_intel_bufmgr_fake.c */
|
1769
libdrm-radeon.patch
1769
libdrm-radeon.patch
File diff suppressed because it is too large
Load Diff
20
libdrm.spec
20
libdrm.spec
@ -1,14 +1,14 @@
|
||||
%define gitdate 20080930
|
||||
%define gitdate 20090622
|
||||
|
||||
Summary: Direct Rendering Manager runtime library
|
||||
Name: libdrm
|
||||
Version: 2.4.11
|
||||
Release: 0%{?dist}
|
||||
Version: 2.4.12
|
||||
Release: 0.1%{?dist}
|
||||
License: MIT
|
||||
Group: System Environment/Libraries
|
||||
URL: http://dri.sourceforge.net
|
||||
Source0: http://dri.freedesktop.org/libdrm/%{name}-%{version}.tar.bz2
|
||||
#Source0: %{name}-%{gitdate}.tar.bz2
|
||||
#Source0: http://dri.freedesktop.org/libdrm/%{name}-%{version}.tar.bz2
|
||||
Source0: %{name}-%{gitdate}.tar.bz2
|
||||
Source1: make-git-snapshot.sh
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
@ -26,8 +26,6 @@ Source2: 91-drm-modeset.rules
|
||||
Patch3: libdrm-make-dri-perms-okay.patch
|
||||
# remove backwards compat not needed on Fedora
|
||||
Patch4: libdrm-2.4.0-no-bc.patch
|
||||
# radeon libdrm patches from modesetting-gem branch of upstream
|
||||
Patch8: libdrm-radeon.patch
|
||||
|
||||
%description
|
||||
Direct Rendering Manager runtime library
|
||||
@ -43,14 +41,13 @@ Requires: pkgconfig
|
||||
Direct Rendering Manager development package
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%setup -q -n %{name}-%{gitdate}
|
||||
%patch3 -p1 -b .forceperms
|
||||
%patch4 -p1 -b .no-bc
|
||||
%patch8 -p1 -b .radeon
|
||||
|
||||
%build
|
||||
autoreconf -v --install || exit 1
|
||||
%configure --enable-udev --enable-nouveau-experimental-api
|
||||
%configure --enable-udev --enable-nouveau-experimental-api --enable-radeon-experimental-api
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
@ -106,6 +103,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_libdir}/pkgconfig/libdrm_nouveau.pc
|
||||
|
||||
%changelog
|
||||
* Mon Jun 22 2009 Dave Airlie <airlied@redhat.com> 2.4.12-0.1
|
||||
- rebase onto git snapshot - remove radeon patch in master now
|
||||
|
||||
* Mon Jun 8 2009 Kristian Høgsberg <krh@redhat.com> - 2.4.11-0
|
||||
- Bump to 2.4.11.
|
||||
|
||||
|
@ -16,10 +16,6 @@ rm -rf $DIRNAME
|
||||
git clone ${REF:+--reference $REF} \
|
||||
git://git.freedesktop.org/git/mesa/drm $DIRNAME
|
||||
|
||||
cd $DIRNAME
|
||||
git checkout -f origin/modesetting-gem
|
||||
cd -
|
||||
|
||||
GIT_DIR=$DIRNAME/.git git archive --format=tar --prefix=$DIRNAME/ ${1:-HEAD} \
|
||||
| bzip2 > $DIRNAME.tar.bz2
|
||||
|
||||
|
@ -1,24 +0,0 @@
|
||||
diff --git a/libdrm/radeon/radeon_bo_gem.c b/libdrm/radeon/radeon_bo_gem.c
|
||||
index 932afeb..6d2fc61 100644
|
||||
--- a/libdrm/radeon/radeon_bo_gem.c
|
||||
+++ b/libdrm/radeon/radeon_bo_gem.c
|
||||
@@ -221,3 +221,9 @@ void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom)
|
||||
}
|
||||
free(bomg);
|
||||
}
|
||||
+
|
||||
+uint32_t radeon_gem_name_bo(struct radeon_bo *bo)
|
||||
+{
|
||||
+ struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo;
|
||||
+ return bo_gem->name;
|
||||
+}
|
||||
diff --git a/libdrm/radeon/radeon_bo_gem.h b/libdrm/radeon/radeon_bo_gem.h
|
||||
index c0f68e6..980a6a4 100644
|
||||
--- a/libdrm/radeon/radeon_bo_gem.h
|
||||
+++ b/libdrm/radeon/radeon_bo_gem.h
|
||||
@@ -37,4 +37,5 @@
|
||||
struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd);
|
||||
void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom);
|
||||
|
||||
+uint32_t radeon_gem_name_bo(struct radeon_bo *bo);
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user