rpms/libdrm/devel libdrm-nouveau.patch, NONE, 1.1 libdrm.spec, 1.58, 1.59
Ben Skeggs
bskeggs at fedoraproject.org
Sat Feb 7 00:29:09 UTC 2009
- Previous message (by thread): [pkgdb] libdrm had acl change status
- Next message (by thread): rpms/kernel/F-9 patch-2.6.27.15.bz2.sign, NONE, 1.1.2.1 .cvsignore, 1.837.2.6, 1.837.2.7 kernel.spec, 1.891.2.20, 1.891.2.21 sources, 1.798.2.6, 1.798.2.7 upstream, 1.717.2.6, 1.717.2.7 linux-2.6-input-atkbd-broaden-dell-signatures.patch, 1.1.2.1, NONE linux-2.6-input-atkbd-samsung-nc10-key-repeat-fix.patch, 1.1.2.1, NONE patch-2.6.27.14.bz2.sign, 1.1.2.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: bskeggs
Update of /cvs/pkgs/rpms/libdrm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22986/devel
Modified Files:
libdrm.spec
Added Files:
libdrm-nouveau.patch
Log Message:
bring in latest nouveau code from drm.git
libdrm-nouveau.patch:
--- NEW FILE libdrm-nouveau.patch ---
diff -Nur libdrm-2.4.4.orig/configure.ac libdrm-2.4.4/configure.ac
--- libdrm-2.4.4.orig/configure.ac 2009-02-05 15:18:37.000000000 +1000
+++ libdrm-2.4.4/configure.ac 2009-02-05 15:19:56.000000000 +1000
@@ -125,6 +125,8 @@
libdrm/Makefile
libdrm/intel/Makefile
libdrm/radeon/Makefile
+ libdrm/nouveau/Makefile
+ libdrm/nouveau/libdrm_nouveau.pc
shared-core/Makefile
tests/Makefile
tests/modeprint/Makefile
diff -Nur libdrm-2.4.4.orig/libdrm/Makefile.am libdrm-2.4.4/libdrm/Makefile.am
--- libdrm-2.4.4.orig/libdrm/Makefile.am 2009-02-05 15:18:37.000000000 +1000
+++ libdrm-2.4.4/libdrm/Makefile.am 2009-02-05 15:19:56.000000000 +1000
@@ -18,7 +18,7 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-SUBDIRS = . intel radeon
+SUBDIRS = . intel radeon nouveau
libdrm_la_LTLIBRARIES = libdrm.la
libdrm_ladir = $(libdir)
diff -Nur libdrm-2.4.4.orig/libdrm/nouveau/libdrm_nouveau.pc.in libdrm-2.4.4/libdrm/nouveau/libdrm_nouveau.pc.in
--- libdrm-2.4.4.orig/libdrm/nouveau/libdrm_nouveau.pc.in 1970-01-01 10:00:00.000000000 +1000
+++ libdrm-2.4.4/libdrm/nouveau/libdrm_nouveau.pc.in 2009-02-05 15:19:56.000000000 +1000
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libdrm_nouveau
+Description: Userspace interface to nouveau kernel DRM services
+Version: 0.5
+Libs: -L${libdir} -ldrm_nouveau
+Cflags: -I${includedir} -I${includedir}/drm -I${includedir}/nouveau
diff -Nur libdrm-2.4.4.orig/libdrm/nouveau/Makefile.am libdrm-2.4.4/libdrm/nouveau/Makefile.am
--- libdrm-2.4.4.orig/libdrm/nouveau/Makefile.am 1970-01-01 10:00:00.000000000 +1000
+++ libdrm-2.4.4/libdrm/nouveau/Makefile.am 2009-02-05 15:19:56.000000000 +1000
@@ -0,0 +1,40 @@
+AM_CFLAGS = \
+ $(WARN_CFLAGS) \
+ -I$(top_srcdir)/libdrm \
+ -I$(top_srcdir)/libdrm/nouveau \
+ $(PTHREADSTUBS_CFLAGS) \
+ -I$(top_srcdir)/shared-core
+
+libdrm_nouveau_la_LTLIBRARIES = libdrm_nouveau.la
+libdrm_nouveau_ladir = $(libdir)
+libdrm_nouveau_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
+
+libdrm_nouveau_la_SOURCES = \
+ nouveau_device.c \
+ nouveau_channel.c \
+ nouveau_pushbuf.c \
+ nouveau_grobj.c \
+ nouveau_notifier.c \
+ nouveau_bo.c \
+ nouveau_resource.c \
+ nouveau_dma.c \
+ nouveau_fence.c
+
+libdrm_nouveaucommonincludedir = ${includedir}/nouveau
+libdrm_nouveaucommoninclude_HEADERS = \
+ nouveau_device.h \
+ nouveau_channel.h \
+ nouveau_grobj.h \
+ nouveau_notifier.h \
+ nouveau_pushbuf.h \
+ nouveau_bo.h \
+ nouveau_resource.h \
+ nouveau_class.h
+
+libdrm_nouveauincludedir = ${includedir}/drm
+libdrm_nouveauinclude_HEADERS = \
+ nouveau_drmif.h
+
+pkgconfigdir = @pkgconfigdir@
+pkgconfig_DATA = libdrm_nouveau.pc
diff -Nur libdrm-2.4.4.orig/libdrm/nouveau/nouveau_bo.c libdrm-2.4.4/libdrm/nouveau/nouveau_bo.c
--- libdrm-2.4.4.orig/libdrm/nouveau/nouveau_bo.c 1970-01-01 10:00:00.000000000 +1000
+++ libdrm-2.4.4/libdrm/nouveau/nouveau_bo.c 2009-02-05 15:19:56.000000000 +1000
@@ -0,0 +1,838 @@
+/*
+ * Copyright 2007 Nouveau Project
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <assert.h>
+
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+
+#include "nouveau_private.h"
+
+int
+nouveau_bo_init(struct nouveau_device *dev)
+{
+ return 0;
+}
+
+void
+nouveau_bo_takedown(struct nouveau_device *dev)
+{
+}
+
+static int
+nouveau_bo_allocated(struct nouveau_bo_priv *nvbo)
+{
+ if (nvbo->sysmem || nvbo->handle || (nvbo->flags & NOUVEAU_BO_PIN))
+ return 1;
+ return 0;
+}
+
+static int
+nouveau_bo_ualloc(struct nouveau_bo_priv *nvbo)
+{
+ if (nvbo->user || nvbo->sysmem) {
+ assert(nvbo->sysmem);
+ return 0;
+ }
+
+ nvbo->sysmem = malloc(nvbo->size);
+ if (!nvbo->sysmem)
+ return -ENOMEM;
+
+ return 0;
+}
+
+static void
+nouveau_bo_ufree(struct nouveau_bo_priv *nvbo)
+{
+ if (nvbo->sysmem) {
+ if (!nvbo->user)
+ free(nvbo->sysmem);
+ nvbo->sysmem = NULL;
+ }
+}
+
+static void
+nouveau_bo_kfree_nomm(struct nouveau_bo_priv *nvbo)
+{
+ struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device);
+ struct drm_nouveau_mem_free req;
+
+ if (nvbo->map) {
+ drmUnmap(nvbo->map, nvbo->size);
+ nvbo->map = NULL;
+ }
+
+ req.offset = nvbo->offset;
+ if (nvbo->domain & NOUVEAU_BO_GART)
+ req.flags = NOUVEAU_MEM_AGP | NOUVEAU_MEM_PCI;
+ else
+ if (nvbo->domain & NOUVEAU_BO_VRAM)
+ req.flags = NOUVEAU_MEM_FB;
+ drmCommandWrite(nvdev->fd, DRM_NOUVEAU_MEM_FREE, &req, sizeof(req));
+
+ nvbo->handle = 0;
+}
+
+static void
+nouveau_bo_kfree(struct nouveau_bo_priv *nvbo)
+{
+ struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device);
+ struct drm_gem_close req;
+
+ if (!nvbo->handle)
+ return;
+
+ if (!nvdev->mm_enabled) {
+ nouveau_bo_kfree_nomm(nvbo);
+ return;
+ }
+
+ if (nvbo->map) {
[...11183 lines suppressed...]
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef __NOUVEAU_RESOURCE_H__
+#define __NOUVEAU_RESOURCE_H__
+
+struct nouveau_resource {
+ struct nouveau_resource *prev;
+ struct nouveau_resource *next;
+
+ int in_use;
+ void *priv;
+
+ unsigned int start;
+ unsigned int size;
+};
+
+int
+nouveau_resource_init(struct nouveau_resource **heap, unsigned start,
+ unsigned size);
+
+int
+nouveau_resource_alloc(struct nouveau_resource *heap, int size, void *priv,
+ struct nouveau_resource **);
+
+void
+nouveau_resource_free(struct nouveau_resource **);
+
+#endif
diff -Nur libdrm-2.4.4.orig/shared-core/nouveau_drm.h libdrm-2.4.4/shared-core/nouveau_drm.h
--- libdrm-2.4.4.orig/shared-core/nouveau_drm.h 2008-10-10 05:02:11.000000000 +1000
+++ libdrm-2.4.4/shared-core/nouveau_drm.h 2009-02-05 15:19:39.000000000 +1000
@@ -25,13 +25,26 @@
#ifndef __NOUVEAU_DRM_H__
#define __NOUVEAU_DRM_H__
-#define NOUVEAU_DRM_HEADER_PATCHLEVEL 11
+#define NOUVEAU_DRM_HEADER_PATCHLEVEL 12
struct drm_nouveau_channel_alloc {
uint32_t fb_ctxdma_handle;
uint32_t tt_ctxdma_handle;
int channel;
+
+ /* Notifier memory */
+ drm_handle_t notifier;
+ int notifier_size;
+
+ /* DRM-enforced subchannel assignments */
+ struct {
+ uint32_t handle;
+ uint32_t grclass;
+ } subchan[8];
+ uint32_t nr_subchan;
+
+/* !MM_ENABLED ONLY */
uint32_t put_base;
/* FIFO control regs */
drm_handle_t ctrl;
@@ -39,9 +52,6 @@
/* DMA command buffer */
drm_handle_t cmdbuf;
int cmdbuf_size;
- /* Notifier memory */
- drm_handle_t notifier;
- int notifier_size;
};
struct drm_nouveau_channel_free {
@@ -126,6 +136,8 @@
#define NOUVEAU_GETPARAM_AGP_SIZE 9
#define NOUVEAU_GETPARAM_PCI_PHYSICAL 10
#define NOUVEAU_GETPARAM_CHIPSET_ID 11
+#define NOUVEAU_GETPARAM_MM_ENABLED 12
+#define NOUVEAU_GETPARAM_VM_VRAM_BASE 13
struct drm_nouveau_getparam {
uint64_t param;
uint64_t value;
@@ -138,6 +150,100 @@
uint64_t value;
};
+#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
+#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
+#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
+#define NOUVEAU_GEM_DOMAIN_NOMAP (1 << 3)
+#define NOUVEAU_GEM_DOMAIN_TILE (1 << 30)
+#define NOUVEAU_GEM_DOMAIN_TILE_ZETA (1 << 31)
+
+struct drm_nouveau_gem_new {
+ uint64_t size;
+ uint32_t channel_hint;
+ uint32_t align;
+ uint32_t handle;
+ uint32_t domain;
+ uint32_t offset;
+};
+
+struct drm_nouveau_gem_pushbuf_bo {
+ uint64_t user_priv;
+ uint32_t handle;
+ uint32_t read_domains;
+ uint32_t write_domains;
+ uint32_t valid_domains;
+ uint32_t presumed_ok;
+ uint32_t presumed_domain;
+ uint64_t presumed_offset;
+};
+
+#define NOUVEAU_GEM_RELOC_LOW (1 << 0)
+#define NOUVEAU_GEM_RELOC_HIGH (1 << 1)
+#define NOUVEAU_GEM_RELOC_OR (1 << 2)
+struct drm_nouveau_gem_pushbuf_reloc {
+ uint32_t bo_index;
+ uint32_t reloc_index;
+ uint32_t flags;
+ uint32_t data;
+ uint32_t vor;
+ uint32_t tor;
+};
+
+#define NOUVEAU_GEM_MAX_BUFFERS 1024
+#define NOUVEAU_GEM_MAX_RELOCS 1024
+
+struct drm_nouveau_gem_pushbuf {
+ uint32_t channel;
+ uint32_t nr_dwords;
+ uint32_t nr_buffers;
+ uint32_t nr_relocs;
+ uint64_t dwords;
+ uint64_t buffers;
+ uint64_t relocs;
+};
+
+struct drm_nouveau_gem_pushbuf_call {
+ uint32_t channel;
+ uint32_t handle;
+ uint32_t offset;
+ uint32_t nr_buffers;
+ uint32_t nr_relocs;
+ uint32_t pad0;
+ uint64_t buffers;
+ uint64_t relocs;
+};
+
+struct drm_nouveau_gem_pin {
+ uint32_t handle;
+ uint32_t domain;
+ uint64_t offset;
+};
+
+struct drm_nouveau_gem_unpin {
+ uint32_t handle;
+};
+
+struct drm_nouveau_gem_mmap {
+ uint32_t handle;
+ uint32_t pad;
+ uint64_t vaddr;
+};
+
+struct drm_nouveau_gem_cpu_prep {
+ uint32_t handle;
+};
+
+struct drm_nouveau_gem_cpu_fini {
+ uint32_t handle;
+};
+
+struct drm_nouveau_gem_tile {
+ uint32_t handle;
+ uint32_t delta;
+ uint32_t size;
+ uint32_t flags;
+};
+
enum nouveau_card_type {
NV_UNKNOWN =0,
NV_04 =4,
@@ -180,5 +286,14 @@
#define DRM_NOUVEAU_MEM_TILE 0x0a
#define DRM_NOUVEAU_SUSPEND 0x0b
#define DRM_NOUVEAU_RESUME 0x0c
+#define DRM_NOUVEAU_GEM_NEW 0x40
+#define DRM_NOUVEAU_GEM_PUSHBUF 0x41
+#define DRM_NOUVEAU_GEM_PUSHBUF_CALL 0x42
+#define DRM_NOUVEAU_GEM_PIN 0x43
+#define DRM_NOUVEAU_GEM_UNPIN 0x44
+#define DRM_NOUVEAU_GEM_MMAP 0x45
+#define DRM_NOUVEAU_GEM_CPU_PREP 0x46
+#define DRM_NOUVEAU_GEM_CPU_FINI 0x47
+#define DRM_NOUVEAU_GEM_TILE 0x48
#endif /* __NOUVEAU_DRM_H__ */
Index: libdrm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libdrm/devel/libdrm.spec,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- libdrm.spec 5 Feb 2009 00:52:26 -0000 1.58
+++ libdrm.spec 7 Feb 2009 00:28:39 -0000 1.59
@@ -3,7 +3,7 @@
Summary: Direct Rendering Manager runtime library
Name: libdrm
Version: 2.4.4
-Release: 3%{?dist}
+Release: 4%{?dist}
License: MIT
Group: System Environment/Libraries
URL: http://dri.sourceforge.net
@@ -28,6 +28,8 @@
Patch4: libdrm-2.4.0-no-bc.patch
# radeon libdrm patches from modesetting-gem branch of upstream
Patch8: libdrm-radeon.patch
+# nouveau libdrm patches
+Patch9: libdrm-nouveau.patch
%description
Direct Rendering Manager runtime library
@@ -47,6 +49,7 @@
%patch3 -p1 -b .forceperms
%patch4 -p1 -b .no-bc
%patch8 -p1 -b .radeon
+%patch9 -p1 -b .nouveau
%build
autoreconf -v --install || exit 1
@@ -83,6 +86,8 @@
%{_libdir}/libdrm_intel.so.1.0.0
%{_libdir}/libdrm_radeon.so.1
%{_libdir}/libdrm_radeon.so.1.0.0
+%{_libdir}/libdrm_nouveau.so.1
+%{_libdir}/libdrm_nouveau.so.1.0.0
%config %{_sysconfdir}/udev/rules.d/91-drm-modeset.rules
%files devel
@@ -92,12 +97,19 @@
%{_includedir}/xf86drmMode.h
%{_includedir}/intel_bufmgr.h
%{_includedir}/drm/radeon*.h
+%{_includedir}/drm/nouveau_drmif.h
+%{_includedir}/nouveau/nouveau_*.h
%{_libdir}/libdrm.so
%{_libdir}/libdrm_intel.so
%{_libdir}/libdrm_radeon.so
+%{_libdir}/libdrm_nouveau.so
%{_libdir}/pkgconfig/libdrm.pc
+%{_libdir}/pkgconfig/libdrm_nouveau.pc
%changelog
+* Thu Feb 05 2009 Ben Skeggs <bskeggs at redhat.com> 2.4.4-4
+- nouveau: pull in updates from upstream
+
* Thu Feb 05 2009 Dave Airlie <airlied at redhat.com> 2.4.4-3
- update with more libdrm/radeon upstream fixes
- Previous message (by thread): [pkgdb] libdrm had acl change status
- Next message (by thread): rpms/kernel/F-9 patch-2.6.27.15.bz2.sign, NONE, 1.1.2.1 .cvsignore, 1.837.2.6, 1.837.2.7 kernel.spec, 1.891.2.20, 1.891.2.21 sources, 1.798.2.6, 1.798.2.7 upstream, 1.717.2.6, 1.717.2.7 linux-2.6-input-atkbd-broaden-dell-signatures.patch, 1.1.2.1, NONE linux-2.6-input-atkbd-samsung-nc10-key-repeat-fix.patch, 1.1.2.1, NONE patch-2.6.27.14.bz2.sign, 1.1.2.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list