rpms/kernel/devel kernel.spec, 1.461, 1.462 nouveau-drm.patch, 1.8, 1.9
Dave Airlie (airlied)
fedora-extras-commits at redhat.com
Fri Feb 29 06:02:27 UTC 2008
Author: airlied
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16230
Modified Files:
kernel.spec nouveau-drm.patch
Log Message:
* Fri Feb 29 2008 Dave Airlie <airlied at redhat.com>
- update nouveau bits to the latest drm tree
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.461
retrieving revision 1.462
diff -u -r1.461 -r1.462
--- kernel.spec 29 Feb 2008 02:17:01 -0000 1.461
+++ kernel.spec 29 Feb 2008 06:01:55 -0000 1.462
@@ -1735,6 +1735,9 @@
%kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL} -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.conf %{with_xen} xen
%changelog
+* Fri Feb 29 2008 Dave Airlie <airlied at redhat.com>
+- update nouveau bits to the latest drm tree
+
* Wed Feb 27 2008 Dave Airlie <airlied at redhat.com>
- oops committed some bits wrong
nouveau-drm.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.8 -r 1.9 nouveau-drm.patch
Index: nouveau-drm.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/nouveau-drm.patch,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- nouveau-drm.patch 28 Feb 2008 23:42:01 -0000 1.8
+++ nouveau-drm.patch 29 Feb 2008 06:01:55 -0000 1.9
@@ -1,3 +1,90 @@
+From 97feb40c0d41369a3235a192b3db7d472e65bea8 Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied at redhat.com>
+Date: Fri, 29 Feb 2008 15:58:37 +1000
+Subject: [PATCH] nouveau: rebased master from git
+
+---
+ drivers/char/drm/Kconfig | 7 +
+ drivers/char/drm/Makefile | 12 +
+ drivers/char/drm/drmP.h | 4 +-
+ drivers/char/drm/drm_bufs.c | 5 +-
+ drivers/char/drm/drm_drv.c | 4 +
+ drivers/char/drm/drm_irq.c | 3 +-
+ drivers/char/drm/drm_pciids.h | 262 ++++
+ drivers/char/drm/nouveau_buffer.c | 293 +++++
+ drivers/char/drm/nouveau_dma.c | 172 +++
+ drivers/char/drm/nouveau_dma.h | 96 ++
+ drivers/char/drm/nouveau_drm.h | 166 +++
+ drivers/char/drm/nouveau_drv.c | 108 ++
+ drivers/char/drm/nouveau_drv.h | 602 ++++++++++
+ drivers/char/drm/nouveau_fence.c | 120 ++
+ drivers/char/drm/nouveau_fifo.c | 590 ++++++++++
+ drivers/char/drm/nouveau_ioc32.c | 72 ++
+ drivers/char/drm/nouveau_irq.c | 477 ++++++++
+ drivers/char/drm/nouveau_mem.c | 674 +++++++++++
+ drivers/char/drm/nouveau_notifier.c | 165 +++
+ drivers/char/drm/nouveau_object.c | 1148 ++++++++++++++++++
+ drivers/char/drm/nouveau_reg.h | 586 +++++++++
+ drivers/char/drm/nouveau_sgdma.c | 341 ++++++
+ drivers/char/drm/nouveau_state.c | 694 +++++++++++
+ drivers/char/drm/nouveau_swmthd.c | 191 +++
+ drivers/char/drm/nouveau_swmthd.h | 33 +
+ drivers/char/drm/nv04_fb.c | 23 +
+ drivers/char/drm/nv04_fifo.c | 138 +++
+ drivers/char/drm/nv04_graph.c | 516 ++++++++
+ drivers/char/drm/nv04_instmem.c | 159 +++
+ drivers/char/drm/nv04_mc.c | 35 +
+ drivers/char/drm/nv04_timer.c | 44 +
+ drivers/char/drm/nv10_fb.c | 25 +
+ drivers/char/drm/nv10_fifo.c | 169 +++
+ drivers/char/drm/nv10_graph.c | 871 ++++++++++++++
+ drivers/char/drm/nv20_graph.c | 889 ++++++++++++++
+ drivers/char/drm/nv40_fb.c | 62 +
+ drivers/char/drm/nv40_fifo.c | 199 ++++
+ drivers/char/drm/nv40_graph.c | 2225 +++++++++++++++++++++++++++++++++++
+ drivers/char/drm/nv40_mc.c | 38 +
+ drivers/char/drm/nv50_fifo.c | 339 ++++++
+ drivers/char/drm/nv50_graph.c | 363 ++++++
+ drivers/char/drm/nv50_instmem.c | 323 +++++
+ drivers/char/drm/nv50_mc.c | 43 +
+ 43 files changed, 13282 insertions(+), 4 deletions(-)
+ create mode 100644 drivers/char/drm/nouveau_buffer.c
+ create mode 100644 drivers/char/drm/nouveau_dma.c
+ create mode 100644 drivers/char/drm/nouveau_dma.h
+ create mode 100644 drivers/char/drm/nouveau_drm.h
+ create mode 100644 drivers/char/drm/nouveau_drv.c
+ create mode 100644 drivers/char/drm/nouveau_drv.h
+ create mode 100644 drivers/char/drm/nouveau_fence.c
+ create mode 100644 drivers/char/drm/nouveau_fifo.c
+ create mode 100644 drivers/char/drm/nouveau_ioc32.c
+ create mode 100644 drivers/char/drm/nouveau_irq.c
+ create mode 100644 drivers/char/drm/nouveau_mem.c
+ create mode 100644 drivers/char/drm/nouveau_notifier.c
+ create mode 100644 drivers/char/drm/nouveau_object.c
+ create mode 100644 drivers/char/drm/nouveau_reg.h
+ create mode 100644 drivers/char/drm/nouveau_sgdma.c
+ create mode 100644 drivers/char/drm/nouveau_state.c
+ create mode 100644 drivers/char/drm/nouveau_swmthd.c
+ create mode 100644 drivers/char/drm/nouveau_swmthd.h
+ create mode 100644 drivers/char/drm/nv04_fb.c
+ create mode 100644 drivers/char/drm/nv04_fifo.c
+ create mode 100644 drivers/char/drm/nv04_graph.c
+ create mode 100644 drivers/char/drm/nv04_instmem.c
+ create mode 100644 drivers/char/drm/nv04_mc.c
+ create mode 100644 drivers/char/drm/nv04_timer.c
+ create mode 100644 drivers/char/drm/nv10_fb.c
+ create mode 100644 drivers/char/drm/nv10_fifo.c
+ create mode 100644 drivers/char/drm/nv10_graph.c
+ create mode 100644 drivers/char/drm/nv20_graph.c
+ create mode 100644 drivers/char/drm/nv40_fb.c
+ create mode 100644 drivers/char/drm/nv40_fifo.c
+ create mode 100644 drivers/char/drm/nv40_graph.c
+ create mode 100644 drivers/char/drm/nv40_mc.c
+ create mode 100644 drivers/char/drm/nv50_fifo.c
+ create mode 100644 drivers/char/drm/nv50_graph.c
+ create mode 100644 drivers/char/drm/nv50_instmem.c
+ create mode 100644 drivers/char/drm/nv50_mc.c
+
diff --git a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig
index 610d6fd..6b98529 100644
--- a/drivers/char/drm/Kconfig
@@ -14,27 +101,27 @@
+ Choose this for nvidia open source 3d driver
+
diff --git a/drivers/char/drm/Makefile b/drivers/char/drm/Makefile
-index 1283ded..7b372eb 100644
+index 85c4f9e..721548c 100644
--- a/drivers/char/drm/Makefile
+++ b/drivers/char/drm/Makefile
-@@ -14,6 +14,16 @@ mga-objs := mga_drv.o mga_dma.o mga_state.o mga_warp.o mga_irq.o
+@@ -15,6 +15,16 @@ mga-objs := mga_drv.o mga_dma.o mga_state.o mga_warp.o mga_irq.o
i810-objs := i810_drv.o i810_dma.o
i830-objs := i830_drv.o i830_dma.o i830_irq.o
i915-objs := i915_drv.o i915_dma.o i915_irq.o i915_mem.o i915_fence.o i915_buffer.o
+nouveau-objs := nouveau_drv.o nouveau_state.o nouveau_fifo.o nouveau_mem.o \
-+ nouveau_object.o nouveau_irq.o nouveau_notifier.o \
-+ nouveau_sgdma.o nouveau_dma.o \
++ nouveau_object.o nouveau_irq.o nouveau_notifier.o nouveau_swmthd.o \
++ nouveau_sgdma.o nouveau_dma.o nouveau_buffer.o nouveau_fence.o \
+ nv04_timer.o \
+ nv04_mc.o nv40_mc.o nv50_mc.o \
+ nv04_fb.o nv10_fb.o nv40_fb.o \
+ nv04_fifo.o nv10_fifo.o nv40_fifo.o nv50_fifo.o \
-+ nv04_graph.o nv10_graph.o nv20_graph.o nv30_graph.o \
++ nv04_graph.o nv10_graph.o nv20_graph.o \
+ nv40_graph.o nv50_graph.o \
+ nv04_instmem.o nv50_instmem.o
radeon-objs := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o radeon_irq.o r300_cmdbuf.o
sis-objs := sis_drv.o sis_mm.o
savage-objs := savage_drv.o savage_bci.o savage_state.o
-@@ -25,6 +35,7 @@ radeon-objs += radeon_ioc32.o
+@@ -26,6 +36,7 @@ radeon-objs += radeon_ioc32.o
mga-objs += mga_ioc32.o
r128-objs += r128_ioc32.o
i915-objs += i915_ioc32.o
@@ -42,7 +129,7 @@
endif
obj-$(CONFIG_DRM) += drm.o
-@@ -35,6 +46,7 @@ obj-$(CONFIG_DRM_MGA) += mga.o
+@@ -36,6 +47,7 @@ obj-$(CONFIG_DRM_MGA) += mga.o
obj-$(CONFIG_DRM_I810) += i810.o
obj-$(CONFIG_DRM_I830) += i830.o
obj-$(CONFIG_DRM_I915) += i915.o
@@ -51,10 +138,10 @@
obj-$(CONFIG_DRM_SAVAGE)+= savage.o
obj-$(CONFIG_DRM_VIA) +=via.o
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
-index 19d3be5..31c733d 100644
+index bd41621..a437ac2 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
-@@ -970,7 +970,8 @@ extern unsigned long drm_get_resource_start(struct drm_device *dev,
+@@ -1030,7 +1030,8 @@ extern unsigned long drm_get_resource_start(struct drm_device *dev,
unsigned int resource);
extern unsigned long drm_get_resource_len(struct drm_device *dev,
unsigned int resource);
@@ -64,7 +151,7 @@
/* DMA support (drm_dma.h) */
extern int drm_dma_setup(struct drm_device *dev);
extern void drm_dma_takedown(struct drm_device *dev);
-@@ -982,6 +983,7 @@ extern void drm_core_reclaim_buffers(struct drm_device *dev,
+@@ -1042,6 +1043,7 @@ extern void drm_core_reclaim_buffers(struct drm_device *dev,
extern int drm_control(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern irqreturn_t drm_irq_handler(DRM_IRQ_ARGS);
@@ -73,11 +160,11 @@
extern void drm_driver_irq_preinstall(struct drm_device *dev);
extern void drm_driver_irq_postinstall(struct drm_device *dev);
diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
-index bde64b8..9134fae 100644
+index 6da493f..f3aac97 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
-@@ -49,8 +49,8 @@ unsigned long drm_get_resource_len(struct drm_device *dev, unsigned int resource
-
+@@ -48,8 +48,8 @@ unsigned long drm_get_resource_len(struct drm_device *dev, unsigned int resource
+ }
EXPORT_SYMBOL(drm_get_resource_len);
-static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
@@ -87,7 +174,7 @@
{
struct drm_map_list *entry;
list_for_each_entry(entry, &dev->maplist, head) {
-@@ -63,6 +63,7 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
+@@ -62,6 +62,7 @@ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
return NULL;
}
@@ -95,8 +182,23 @@
static int drm_map_handle(struct drm_device *dev, struct drm_hash_item *hash,
unsigned long user_token, int hashed_handle)
+diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c
+index 5fa7d39..3ac117f 100644
+--- a/drivers/char/drm/drm_drv.c
++++ b/drivers/char/drm/drm_drv.c
+@@ -296,6 +296,10 @@ int drm_init(struct drm_driver *driver)
+ while ((pdev =
+ pci_get_subsys(pid->vendor, pid->device, pid->subvendor,
+ pid->subdevice, pdev)) != NULL) {
[...9300 lines suppressed...]
-+static void
++static int
+nv50_graph_init_ctxctl(struct drm_device *dev)
+{
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
-+ uint32_t *voodoo;
++ uint32_t *voodoo = NULL;
+
+ DRM_DEBUG("\n");
+
@@ -13723,34 +13153,42 @@
+ case 0x84:
+ voodoo = nv84_ctx_voodoo;
+ break;
++ case 0x86:
++ voodoo = nv86_ctx_voodoo;
++ break;
+ default:
+ DRM_ERROR("no voodoo for chipset NV%02x\n", dev_priv->chipset);
-+ break;
++ return -EINVAL;
+ }
+
-+ if (voodoo) {
-+ NV_WRITE(NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
-+ while (*voodoo != ~0) {
-+ NV_WRITE(NV40_PGRAPH_CTXCTL_UCODE_DATA, *voodoo);
-+ voodoo++;
-+ }
++ NV_WRITE(NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
++ while (*voodoo != ~0) {
++ NV_WRITE(NV40_PGRAPH_CTXCTL_UCODE_DATA, *voodoo);
++ voodoo++;
+ }
+
+ NV_WRITE(0x400320, 4);
+ NV_WRITE(NV40_PGRAPH_CTXCTL_CUR, 0);
+ NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, 0);
++
++ return 0;
+}
+
-+int
++int
+nv50_graph_init(struct drm_device *dev)
+{
++ int ret;
++
+ DRM_DEBUG("\n");
+
+ nv50_graph_init_reset(dev);
+ nv50_graph_init_intr(dev);
+ nv50_graph_init_regs__nv(dev);
+ nv50_graph_init_regs(dev);
-+ nv50_graph_init_ctxctl(dev);
++
++ ret = nv50_graph_init_ctxctl(dev);
++ if (ret)
++ return ret;
+
+ return 0;
+}
@@ -13773,11 +13211,10 @@
+
+ DRM_DEBUG("ch%d\n", chan->id);
+
-+ if ((ret = nouveau_gpuobj_new_ref(dev, chan, NULL, 0,
-+ grctx_size, 0x1000,
-+ NVOBJ_FLAG_ZERO_ALLOC |
-+ NVOBJ_FLAG_ZERO_FREE,
-+ &chan->ramin_grctx)))
++ ret = nouveau_gpuobj_new_ref(dev, chan, NULL, 0, grctx_size, 0x1000,
++ NVOBJ_FLAG_ZERO_ALLOC |
++ NVOBJ_FLAG_ZERO_FREE, &chan->ramin_grctx);
++ if (ret)
+ return ret;
+
+ hdr = IS_G80 ? 0x200 : 0x20;
@@ -13789,11 +13226,16 @@
+ INSTANCE_WR(ramin, (hdr + 0x10)/4, 0);
+ INSTANCE_WR(ramin, (hdr + 0x14)/4, 0x00010000);
+
-+ if ((ret = engine->graph.load_context(chan))) {
++ ret = engine->graph.load_context(chan);
++ if (ret) {
+ DRM_ERROR("Error hacking up initial context: %d\n", ret);
+ return ret;
+ }
+
++ INSTANCE_WR(chan->ramin_grctx->gpuobj, 0x00000/4,
++ chan->ramin->instance >> 12);
++ INSTANCE_WR(chan->ramin_grctx->gpuobj, 0x0011c/4, 0x00000002);
++
+ return 0;
+}
+
@@ -13823,10 +13265,10 @@
+ DRM_DEBUG("inst=0x%08x, save=%d\n", inst, save);
+
+ old_cp = NV_READ(NV20_PGRAPH_CHANNEL_CTX_POINTER);
-+ NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, inst | (1<<31));
++ NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, inst);
+ NV_WRITE(0x400824, NV_READ(0x400824) |
+ (save ? NV40_PGRAPH_CTXCTL_0310_XFER_SAVE :
-+ NV40_PGRAPH_CTXCTL_0310_XFER_LOAD));
++ NV40_PGRAPH_CTXCTL_0310_XFER_LOAD));
+ NV_WRITE(NV40_PGRAPH_CTXCTL_0304, NV40_PGRAPH_CTXCTL_0304_XFER_CTX);
+
+ for (i = 0; i < tv; i++) {
@@ -13850,19 +13292,15 @@
+{
+ struct drm_device *dev = chan->dev;
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
-+ uint32_t inst = ((chan->ramin->instance >> 12) | (1<<31));
++ uint32_t inst = chan->ramin->instance >> 12;
+ int ret; (void)ret;
+
+ DRM_DEBUG("ch%d\n", chan->id);
+
-+#if 0
-+ if ((ret = nv50_graph_transfer_context(dev, inst, 0)))
-+ return ret;
-+#endif
+
+ NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_POINTER, inst);
+ NV_WRITE(0x400320, 4);
-+ NV_WRITE(NV40_PGRAPH_CTXCTL_CUR, inst);
++ NV_WRITE(NV40_PGRAPH_CTXCTL_CUR, inst | (1<<31));
+
+ return 0;
+}
@@ -13871,19 +13309,18 @@
+nv50_graph_save_context(struct nouveau_channel *chan)
+{
+ struct drm_device *dev = chan->dev;
-+ uint32_t inst = ((chan->ramin->instance >> 12) | (1<<31));
++ uint32_t inst = chan->ramin->instance >> 12;
+
+ DRM_DEBUG("ch%d\n", chan->id);
+
+ return nv50_graph_transfer_context(dev, inst, 1);
+}
-+
diff --git a/drivers/char/drm/nv50_instmem.c b/drivers/char/drm/nv50_instmem.c
new file mode 100644
-index 0000000..1eeb54d
+index 0000000..9687ecb
--- /dev/null
+++ b/drivers/char/drm/nv50_instmem.c
-@@ -0,0 +1,320 @@
+@@ -0,0 +1,323 @@
+/*
+ * Copyright (C) 2007 Ben Skeggs.
+ *
@@ -13955,7 +13392,11 @@
+ return -ENOMEM;
+ dev_priv->Engine.instmem.priv = priv;
+
-+ /* Reserve the last MiB of VRAM, we should probably try to avoid
++ /* Save state, will restore at takedown. */
++ for (i = 0x1700; i <= 0x1710; i+=4)
++ priv->save1700[(i-0x1700)/4] = NV_READ(i);
++
++ /* Reserve the last MiB of VRAM, we should probably try to avoid
+ * setting up the below tables over the top of the VBIOS image at
+ * some point.
+ */
@@ -14030,7 +13471,7 @@
+ BAR0_WI32(priv->pramin_pt->gpuobj, i + 0, v | 1);
+ else
+ BAR0_WI32(priv->pramin_pt->gpuobj, i + 0, 0x00000009);
-+ BAR0_WI32(priv->pramin_pt->gpuobj, i + 4, 0x00000000);
++ BAR0_WI32(priv->pramin_pt->gpuobj, i + 4, 0x00000000);
+ }
+
+ BAR0_WI32(chan->vm_pd, 0x00, priv->pramin_pt->instance | 0x63);
@@ -14145,7 +13586,7 @@
+ dev_priv->Engine.instmem.unbind(dev, gpuobj);
+ nouveau_mem_free(dev, gpuobj->im_backing);
+ gpuobj->im_backing = NULL;
-+ }
++ }
+}
+
+int
@@ -14203,7 +13644,6 @@
+ gpuobj->im_bound = 0;
+ return 0;
+}
-+
diff --git a/drivers/char/drm/nv50_mc.c b/drivers/char/drm/nv50_mc.c
new file mode 100644
index 0000000..b111826
@@ -14253,3 +13693,6 @@
+void nv50_mc_takedown(struct drm_device *dev)
+{
+}
+--
+1.5.3.7
+
More information about the fedora-extras-commits
mailing list