From ee0de6fe36a0c4869a5fd079e0812b493ff3c5e2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Jun 12 2008 04:01:31 +0000 Subject: - add r500 support patch - resync to F9 version --- diff --git a/libdrm-2.4.0-no-bc.patch b/libdrm-2.4.0-no-bc.patch new file mode 100644 index 0000000..9fa43bd --- /dev/null +++ b/libdrm-2.4.0-no-bc.patch @@ -0,0 +1,54 @@ +diff -up libdrm-20080303/libdrm/xf86drm.c.jx libdrm-20080303/libdrm/xf86drm.c +--- libdrm-20080303/libdrm/xf86drm.c.jx 2008-04-29 10:07:13.000000000 -0400 ++++ libdrm-20080303/libdrm/xf86drm.c 2008-04-29 10:07:25.000000000 -0400 +@@ -383,11 +383,6 @@ int drmAvailable(void) + int fd; + + if ((fd = drmOpenMinor(0, 1, DRM_NODE_RENDER)) < 0) { +-#ifdef __linux__ +- /* Try proc for backward Linux compatibility */ +- if (!access("/proc/dri/0", R_OK)) +- return 1; +-#endif + return 0; + } + +@@ -506,38 +501,6 @@ static int drmOpenByName(const char *nam + } + } + +-#ifdef __linux__ +- /* Backward-compatibility /proc support */ +- for (i = 0; i < 8; i++) { +- char proc_name[64], buf[512]; +- char *driver, *pt, *devstring; +- int retcode; +- +- sprintf(proc_name, "/proc/dri/%d/name", i); +- if ((fd = open(proc_name, 0, 0)) >= 0) { +- retcode = read(fd, buf, sizeof(buf)-1); +- close(fd); +- if (retcode) { +- buf[retcode-1] = '\0'; +- for (driver = pt = buf; *pt && *pt != ' '; ++pt) +- ; +- if (*pt) { /* Device is next */ +- *pt = '\0'; +- if (!strcmp(driver, name)) { /* Match */ +- for (devstring = ++pt; *pt && *pt != ' '; ++pt) +- ; +- if (*pt) { /* Found busid */ +- return drmOpenByBusid(++pt); +- } else { /* No busid */ +- return drmOpenDevice(strtol(devstring, NULL, 0),i, DRM_NODE_RENDER); +- } +- } +- } +- } +- } +- } +-#endif +- + return -1; + } + diff --git a/libdrm-radeon-r500.patch b/libdrm-radeon-r500.patch new file mode 100644 index 0000000..a6d0316 --- /dev/null +++ b/libdrm-radeon-r500.patch @@ -0,0 +1,55 @@ +diff --git a/shared-core/radeon_drm.h b/shared-core/radeon_drm.h +index 0971f97..ffaa46e 100644 +--- a/shared-core/radeon_drm.h ++++ b/shared-core/radeon_drm.h +@@ -225,9 +225,22 @@ typedef union { + #define R300_CMD_WAIT 7 + # define R300_WAIT_2D 0x1 + # define R300_WAIT_3D 0x2 ++/* these two defines are DOING IT WRONG - however ++ * we have userspace which relies on using these. ++ * The wait interface is backwards compat new ++ * code should use the NEW_WAIT defines below ++ * THESE ARE NOT BIT FIELDS ++ */ + # define R300_WAIT_2D_CLEAN 0x3 + # define R300_WAIT_3D_CLEAN 0x4 ++ ++# define R300_NEW_WAIT_2D_3D 0x3 ++# define R300_NEW_WAIT_2D_2D_CLEAN 0x4 ++# define R300_NEW_WAIT_3D_3D_CLEAN 0x6 ++# define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8 ++ + #define R300_CMD_SCRATCH 8 ++#define R300_CMD_R500FP 9 + + typedef union { + unsigned int u; +@@ -256,6 +269,9 @@ typedef union { + struct { + unsigned char cmd_type, reg, n_bufs, flags; + } scratch; ++ struct { ++ unsigned char cmd_type, count, adrlo, adrhi_flags; ++ } r500fp; + } drm_r300_cmd_header_t; + + #define RADEON_FRONT 0x1 +@@ -266,6 +282,9 @@ typedef union { + #define RADEON_USE_HIERZ 0x40000000 + #define RADEON_USE_COMP_ZBUF 0x20000000 + ++#define R500FP_CONSTANT_TYPE (1 << 1) ++#define R500FP_CONSTANT_CLAMP (1 << 2) ++ + /* Primitive types + */ + #define RADEON_POINTS 0x1 +@@ -657,6 +676,7 @@ typedef struct drm_radeon_indirect { + #define RADEON_PARAM_CARD_TYPE 12 + #define RADEON_PARAM_VBLANK_CRTC 13 /* VBLANK CRTC */ + #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ ++#define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ + + typedef struct drm_radeon_getparam { + int param; diff --git a/libdrm.spec b/libdrm.spec index 4642b3c..bad6c94 100644 --- a/libdrm.spec +++ b/libdrm.spec @@ -3,7 +3,7 @@ Summary: Direct Rendering Manager runtime library Name: libdrm Version: 2.4.0 -Release: 0.10%{?dist} +Release: 0.12%{?dist} License: MIT Group: System Environment/Libraries URL: http://dri.sourceforge.net @@ -22,6 +22,8 @@ Patch2: libdrm-2.4.0-no-freaking-mknod.patch # udev vs pam.console vs hal vs xml vs ConsoleKit # - funk that just bash it direct for now - Patch3: libdrm-make-dri-perms-okay.patch +Patch4: libdrm-2.4.0-no-bc.patch +Patch5: libdrm-radeon-r500.patch %description Direct Rendering Manager runtime library @@ -39,6 +41,8 @@ Direct Rendering Manager development package %patch1 -p1 -b .modesetting #patch2 -p1 -b .mknod %patch3 -p1 -b .forceperms +%patch4 -p1 -b .no-bc +%patch5 -p1 -b .r500 %build autoreconf -v --install || exit 1 @@ -96,6 +100,14 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/libdrm.pc %changelog +* Wed May 28 2008 Dave Airlie 2.4.0-0.12 +- add r500 support patch + +* Tue Apr 29 2008 Adam Jackson 2.4.0-0.11 +- libdrm-2.4.0-no-bc.patch: Delete the /proc/dri BC code. It's not needed, + and the kernel implementation is sufficiently broken that we should avoid + ever touching it. + * Wed Mar 19 2008 Dave Airlie 2.4.0-0.10 - force libdrm to make the node perms useful to everyone