summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin E Martin <kem@kem.org>2000-05-11 15:08:46 +0000
committerKevin E Martin <kem@kem.org>2000-05-11 15:08:46 +0000
commit3f84bbb3c1d3721f95f248634d1871be3ffa005e (patch)
tree1ea68e63e54a0aca44596554a37a9ce7f282aed9
parentb093c88f3884301348c2f5934d4a59e7b61b6905 (diff)
downloaddrm-3f84bbb3c1d3721f95f248634d1871be3ffa005e.tar.gz
- Merge trunk into ati branchvideo-1-0-0-branch
- Fix texture allocation to use both AGP and local textures (still need to fix LRU algorithm to choose from both local and AGP heaps for texture swapping)
-rw-r--r--libdrm/xf86drm.c18
-rw-r--r--linux/drm.h2
-rw-r--r--shared-core/drm.h2
-rw-r--r--shared/drm.h2
4 files changed, 19 insertions, 5 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 6529d2b6..2e3c9b43 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -218,6 +218,20 @@ static int drmOpenByName(const char *name)
group = xf86ConfigDRI.group ? xf86ConfigDRI.group : DRM_DEV_GID;
#endif
+#if defined(XFree86Server)
+ if (!drmAvailable()) {
+ /* try to load the kernel module now */
+ if (!xf86LoadKernelModule(name)) {
+ ErrorF("[drm] failed to load kernel module \"%s\"\n",
+ name);
+ return -1;
+ }
+ }
+#else
+ if (!drmAvailable())
+ return -1;
+#endif
+
if (!geteuid()) {
dirmode = mode;
if (dirmode & S_IRUSR) dirmode |= S_IXUSR;
@@ -773,13 +787,13 @@ int drmAgpAlloc(int fd, unsigned long size, unsigned long type,
unsigned long *address, unsigned long *handle)
{
drm_agp_buffer_t b;
- *handle = 0;
+ *handle = 0;
b.size = size;
b.handle = 0;
b.type = type;
if (ioctl(fd, DRM_IOCTL_AGP_ALLOC, &b)) return -errno;
if (address != 0UL) *address = b.physical;
- *handle = b.handle;
+ *handle = b.handle;
return 0;
}
diff --git a/linux/drm.h b/linux/drm.h
index ce07bb61..5b53df8c 100644
--- a/linux/drm.h
+++ b/linux/drm.h
@@ -71,7 +71,7 @@ typedef struct drm_clip_rect {
unsigned short y2;
} drm_clip_rect_t;
-/* Seperate include files for the i810/mga specific structures */
+/* Seperate include files for the i810/mga/r128 specific structures */
#include "mga_drm.h"
#include "i810_drm.h"
#include "r128_drm.h"
diff --git a/shared-core/drm.h b/shared-core/drm.h
index ce07bb61..5b53df8c 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -71,7 +71,7 @@ typedef struct drm_clip_rect {
unsigned short y2;
} drm_clip_rect_t;
-/* Seperate include files for the i810/mga specific structures */
+/* Seperate include files for the i810/mga/r128 specific structures */
#include "mga_drm.h"
#include "i810_drm.h"
#include "r128_drm.h"
diff --git a/shared/drm.h b/shared/drm.h
index ce07bb61..5b53df8c 100644
--- a/shared/drm.h
+++ b/shared/drm.h
@@ -71,7 +71,7 @@ typedef struct drm_clip_rect {
unsigned short y2;
} drm_clip_rect_t;
-/* Seperate include files for the i810/mga specific structures */
+/* Seperate include files for the i810/mga/r128 specific structures */
#include "mga_drm.h"
#include "i810_drm.h"
#include "r128_drm.h"