From af12ef4f6b4ca111d9a2ef45263ad89610498724 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 13 Aug 2008 10:04:21 +0200 Subject: Don't call the vblank tasklet with irqs disabled. If a specific tasklet shares data with irq context, it needs to take a private irq-blocking spinlock within the tasklet itself. --- linux-core/drm_irq.c | 20 ++++++++++++-------- linux-core/drm_lock.c | 12 +++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c index 5b9f474b..57419ca1 100644 --- a/linux-core/drm_irq.c +++ b/linux-core/drm_irq.c @@ -705,27 +705,31 @@ static void drm_locked_tasklet_func(unsigned long data) { struct drm_device *dev = (struct drm_device *)data; unsigned long irqflags; - + void (*tasklet_func)(struct drm_device *); + spin_lock_irqsave(&dev->tasklet_lock, irqflags); + tasklet_func = dev->locked_tasklet_func; + spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); - if (!dev->locked_tasklet_func || + if (!tasklet_func || !drm_lock_take(&dev->lock, DRM_KERNEL_CONTEXT)) { - spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); return; } dev->lock.lock_time = jiffies; atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); - dev->locked_tasklet_func(dev); + spin_lock_irqsave(&dev->tasklet_lock, irqflags); + tasklet_func = dev->locked_tasklet_func; + dev->locked_tasklet_func = NULL; + spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); + + if (tasklet_func != NULL) + tasklet_func(dev); drm_lock_free(&dev->lock, DRM_KERNEL_CONTEXT); - - dev->locked_tasklet_func = NULL; - - spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); } /** diff --git a/linux-core/drm_lock.c b/linux-core/drm_lock.c index a2966efb..cad2e44d 100644 --- a/linux-core/drm_lock.c +++ b/linux-core/drm_lock.c @@ -155,6 +155,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_lock *lock = data; unsigned long irqflags; + void (*tasklet_func)(struct drm_device *); if (lock->context == DRM_KERNEL_CONTEXT) { DRM_ERROR("Process %d using kernel context %d\n", @@ -163,14 +164,11 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) } spin_lock_irqsave(&dev->tasklet_lock, irqflags); - - if (dev->locked_tasklet_func) { - dev->locked_tasklet_func(dev); - - dev->locked_tasklet_func = NULL; - } - + tasklet_func = dev->locked_tasklet_func; + dev->locked_tasklet_func = NULL; spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); + if (tasklet_func != NULL) + tasklet_func(dev); atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]); -- cgit v1.2.3 From ba840fca19077d352277519c5fa032e3b107ae27 Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Thu, 14 Aug 2008 19:35:55 +0200 Subject: linux: on_each_cpu has 3 args on 2.6.27 --- linux-core/drm_ttm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c index 80a8ff5d..054a7ce8 100644 --- a/linux-core/drm_ttm.c +++ b/linux-core/drm_ttm.c @@ -72,7 +72,11 @@ void drm_ttm_cache_flush(struct page *pages[], unsigned long num_pages) return; } #endif - if (on_each_cpu(drm_ttm_ipi_handler, NULL, 1, 1) != 0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + if (on_each_cpu(drm_ttm_ipi_handler, NULL, 1)) +#else + if (on_each_cpu(drm_ttm_ipi_handler, NULL, 1, 1) != 0) +#endif DRM_ERROR("Timed out waiting for drm cache flush.\n"); } EXPORT_SYMBOL(drm_ttm_cache_flush); -- cgit v1.2.3 From a5381cac55e54a535acf752970886b659948563c Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Sun, 17 Aug 2008 00:41:50 +0200 Subject: nouveau: make it compile under 2.6.27 --- linux-core/nouveau_sgdma.c | 8 ++++++++ shared-core/nouveau_object.c | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/linux-core/nouveau_sgdma.c b/linux-core/nouveau_sgdma.c index cc4d5a92..739e0252 100644 --- a/linux-core/nouveau_sgdma.c +++ b/linux-core/nouveau_sgdma.c @@ -48,7 +48,11 @@ nouveau_sgdma_populate(struct drm_ttm_backend *be, unsigned long num_pages, page, o, NV_CTXDMA_PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + if (pci_dma_mapping_error(nvbe->dev->pdev, nvbe->pagelist[d])) { +#else if (pci_dma_mapping_error(nvbe->pagelist[d])) { +#endif be->func->clear(be); DRM_ERROR("pci_map_page failed\n"); return -EINVAL; @@ -223,7 +227,11 @@ nouveau_sgdma_init(struct drm_device *dev) dev_priv->gart_info.sg_dummy_page = alloc_page(GFP_KERNEL|__GFP_DMA32); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + set_page_locked(dev_priv->gart_info.sg_dummy_page); +#else SetPageLocked(dev_priv->gart_info.sg_dummy_page); +#endif dev_priv->gart_info.sg_dummy_bus = pci_map_page(dev->pdev, dev_priv->gart_info.sg_dummy_page, 0, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); diff --git a/shared-core/nouveau_object.c b/shared-core/nouveau_object.c index 894e7336..07b5a397 100644 --- a/shared-core/nouveau_object.c +++ b/shared-core/nouveau_object.c @@ -739,7 +739,12 @@ nouveau_gpuobj_dma_new(struct nouveau_channel *chan, int class, PAGE_SIZE, DMA_BIDIRECTIONAL); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) + /* Not a 100% sure this is the right kdev in all cases. */ + if (dma_mapping_error(&dev->primary->kdev, dev->sg->busaddr[idx])) { +#else if (dma_mapping_error(dev->sg->busaddr[idx])) { +#endif return -ENOMEM; } } -- cgit v1.2.3 From 41b83a99583486ad4f8760a6537d34783769bfc3 Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Mon, 18 Aug 2008 17:08:21 -0400 Subject: Change prototype of drmIoctl to unsigned long request. This resolves and issue on amd64 FreeBSD and it looks like the linux ioctl syscall should be unsigned long as well. Signed-off-by: Robert Noland --- libdrm/xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 150dd5f8..7202c8d7 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -175,7 +175,7 @@ static char *drmStrdup(const char *s) * Call ioctl, restarting if it is interupted */ static int -drmIoctl(int fd, int request, void *arg) +drmIoctl(int fd, unsigned long request, void *arg) { int ret; -- cgit v1.2.3 From 0da66c27fa2aabdbaf4c003ba3712a61253d7ffe Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 May 2008 23:04:55 +0100 Subject: nouveau: fifo and graphics engine suspend and resume for nv04-nv4x Corresponding DDX patch at http://people.freedesktop.org/~stuart/nv0x-nv4x_suspend/ --- shared-core/nouveau_drm.h | 2 + shared-core/nouveau_drv.h | 13 ++++ shared-core/nouveau_fifo.c | 4 +- shared-core/nouveau_state.c | 170 ++++++++++++++++++++++++++++++++++++++++++++ shared-core/nv20_graph.c | 32 +++++---- 5 files changed, 206 insertions(+), 15 deletions(-) diff --git a/shared-core/nouveau_drm.h b/shared-core/nouveau_drm.h index 4b5869ad..a99c6156 100644 --- a/shared-core/nouveau_drm.h +++ b/shared-core/nouveau_drm.h @@ -178,5 +178,7 @@ struct drm_nouveau_sarea { #define DRM_NOUVEAU_MEM_ALLOC 0x08 #define DRM_NOUVEAU_MEM_FREE 0x09 #define DRM_NOUVEAU_MEM_TILE 0x0a +#define DRM_NOUVEAU_SUSPEND 0x0b +#define DRM_NOUVEAU_RESUME 0x0c #endif /* __NOUVEAU_DRM_H__ */ diff --git a/shared-core/nouveau_drv.h b/shared-core/nouveau_drv.h index cd5f9cf8..a97e3e99 100644 --- a/shared-core/nouveau_drv.h +++ b/shared-core/nouveau_drv.h @@ -310,6 +310,14 @@ struct drm_nouveau_private { struct nouveau_config config; struct list_head gpuobj_list; + + struct nouveau_suspend_resume { + uint32_t fifo_mode; + uint32_t graph_ctx_control; + uint32_t graph_state; + uint32_t *ramin_copy; + uint64_t ramin_size; + } susres; }; #define NOUVEAU_CHECK_INITIALISED_WITH_RETURN do { \ @@ -344,6 +352,10 @@ extern void nouveau_wait_for_idle(struct drm_device *); extern int nouveau_card_init(struct drm_device *); extern int nouveau_ioctl_card_init(struct drm_device *, void *data, struct drm_file *); +extern int nouveau_ioctl_suspend(struct drm_device *, void *data, + struct drm_file *); +extern int nouveau_ioctl_resume(struct drm_device *, void *data, + struct drm_file *); /* nouveau_mem.c */ extern int nouveau_mem_init_heap(struct mem_block **, uint64_t start, @@ -391,6 +403,7 @@ extern int nouveau_fifo_alloc(struct drm_device *dev, struct mem_block *pushbuf, uint32_t fb_ctxdma, uint32_t tt_ctxdma); extern void nouveau_fifo_free(struct nouveau_channel *); +extern int nouveau_channel_idle(struct nouveau_channel *chan); /* nouveau_object.c */ extern int nouveau_gpuobj_early_init(struct drm_device *); diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c index 5ec2bc3e..92ea8fc2 100644 --- a/shared-core/nouveau_fifo.c +++ b/shared-core/nouveau_fifo.c @@ -390,7 +390,7 @@ nouveau_fifo_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret, return 0; } -static int +int nouveau_channel_idle(struct nouveau_channel *chan) { struct drm_device *dev = chan->dev; @@ -594,6 +594,8 @@ struct drm_ioctl_desc nouveau_ioctls[] = { DRM_IOCTL_DEF(DRM_NOUVEAU_MEM_ALLOC, nouveau_ioctl_mem_alloc, DRM_AUTH), DRM_IOCTL_DEF(DRM_NOUVEAU_MEM_FREE, nouveau_ioctl_mem_free, DRM_AUTH), DRM_IOCTL_DEF(DRM_NOUVEAU_MEM_TILE, nouveau_ioctl_mem_tile, DRM_AUTH), + DRM_IOCTL_DEF(DRM_NOUVEAU_SUSPEND, nouveau_ioctl_suspend, DRM_AUTH), + DRM_IOCTL_DEF(DRM_NOUVEAU_RESUME, nouveau_ioctl_resume, DRM_AUTH), }; int nouveau_max_ioctl = DRM_ARRAY_SIZE(nouveau_ioctls); diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index d9c6efe7..85220e6e 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -1,5 +1,6 @@ /* * Copyright 2005 Stephane Marchesin + * Copyright 2008 Stuart Bennett * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -698,3 +699,172 @@ void nouveau_wait_for_idle(struct drm_device *dev) } } } + +static int nouveau_suspend(struct drm_device *dev) +{ + struct mem_block *p; + struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_suspend_resume *susres = &dev_priv->susres; + struct nouveau_engine *engine = &dev_priv->Engine; + int i; + + drm_free(susres->ramin_copy, susres->ramin_size, DRM_MEM_DRIVER); + susres->ramin_size = 0; + list_for_each(p, dev_priv->ramin_heap) + if (p->file_priv && (p->start + p->size) > susres->ramin_size) + susres->ramin_size = p->start + p->size; + if (!(susres->ramin_copy = drm_alloc(susres->ramin_size, DRM_MEM_DRIVER))) { + DRM_ERROR("Couldn't alloc RAMIN backing for suspend\n"); + return -ENOMEM; + } + + for (i = 0; i < engine->fifo.channels; i++) { + uint64_t t_start = engine->timer.read(dev); + + if (dev_priv->fifos[i] == NULL) + continue; + + /* Give the channel a chance to idle, wait 2s (hopefully) */ + while (!nouveau_channel_idle(dev_priv->fifos[i])) + if (engine->timer.read(dev) - t_start > 2000000000ULL) { + DRM_ERROR("Failed to idle channel %d before" + "suspend.", dev_priv->fifos[i]->id); + return -EBUSY; + } + } + nouveau_wait_for_idle(dev); + + NV_WRITE(NV04_PGRAPH_FIFO, 0); + /* disable the fifo caches */ + NV_WRITE(NV03_PFIFO_CACHES, 0x00000000); + NV_WRITE(NV04_PFIFO_CACHE1_DMA_PUSH, + NV_READ(NV04_PFIFO_CACHE1_DMA_PUSH) & ~1); + NV_WRITE(NV03_PFIFO_CACHE1_PUSH0, 0x00000000); + NV_WRITE(NV04_PFIFO_CACHE1_PULL0, 0x00000000); + + susres->fifo_mode = NV_READ(NV04_PFIFO_MODE); + + if (dev_priv->card_type >= NV_10) { + susres->graph_state = NV_READ(NV10_PGRAPH_STATE); + susres->graph_ctx_control = NV_READ(NV10_PGRAPH_CTX_CONTROL); + } else { + susres->graph_state = NV_READ(NV04_PGRAPH_STATE); + susres->graph_ctx_control = NV_READ(NV04_PGRAPH_CTX_CONTROL); + } + + engine->fifo.save_context(dev_priv->fifos[engine->fifo.channel_id(dev)]); + engine->graph.save_context(dev_priv->fifos[engine->fifo.channel_id(dev)]); + nouveau_wait_for_idle(dev); + + for (i = 0; i < susres->ramin_size / 4; i++) + susres->ramin_copy[i] = NV_RI32(i << 2); + + /* reenable the fifo caches */ + NV_WRITE(NV04_PFIFO_CACHE1_DMA_PUSH, + NV_READ(NV04_PFIFO_CACHE1_DMA_PUSH) | 1); + NV_WRITE(NV03_PFIFO_CACHE1_PUSH0, 0x00000001); + NV_WRITE(NV04_PFIFO_CACHE1_PULL0, 0x00000001); + NV_WRITE(NV03_PFIFO_CACHES, 0x00000001); + NV_WRITE(NV04_PGRAPH_FIFO, 1); + + return 0; +} + +static int nouveau_resume(struct drm_device *dev) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_suspend_resume *susres = &dev_priv->susres; + struct nouveau_engine *engine = &dev_priv->Engine; + int i; + + if (!susres->ramin_copy) + return -EINVAL; + + DRM_DEBUG("Doing resume\n"); + + if (dev_priv->gart_info.type == NOUVEAU_GART_AGP) { + struct drm_agp_info info; + struct drm_agp_mode mode; + + /* agp bridge drivers don't re-enable agp on resume. lame. */ + if ((i = drm_agp_info(dev, &info))) { + DRM_ERROR("Unable to get AGP info: %d\n", i); + return i; + } + mode.mode = info.mode; + if ((i = drm_agp_enable(dev, mode))) { + DRM_ERROR("Unable to enable AGP: %d\n", i); + return i; + } + } + + for (i = 0; i < susres->ramin_size / 4; i++) + NV_WI32(i << 2, susres->ramin_copy[i]); + + engine->mc.init(dev); + engine->timer.init(dev); + engine->fb.init(dev); + engine->graph.init(dev); + engine->fifo.init(dev); + + NV_WRITE(NV04_PGRAPH_FIFO, 0); + /* disable the fifo caches */ + NV_WRITE(NV03_PFIFO_CACHES, 0x00000000); + NV_WRITE(NV04_PFIFO_CACHE1_DMA_PUSH, + NV_READ(NV04_PFIFO_CACHE1_DMA_PUSH) & ~1); + NV_WRITE(NV03_PFIFO_CACHE1_PUSH0, 0x00000000); + NV_WRITE(NV04_PFIFO_CACHE1_PULL0, 0x00000000); + + /* PMC power cycling PFIFO in init clobbers some of the stuff stored in + * PRAMIN (such as NV04_PFIFO_CACHE1_DMA_INSTANCE). this is unhelpful + */ + for (i = 0; i < susres->ramin_size / 4; i++) + NV_WI32(i << 2, susres->ramin_copy[i]); + + engine->fifo.load_context(dev_priv->fifos[0]); + NV_WRITE(NV04_PFIFO_MODE, susres->fifo_mode); + + engine->graph.load_context(dev_priv->fifos[0]); + nouveau_wait_for_idle(dev); + + if (dev_priv->card_type >= NV_10) { + NV_WRITE(NV10_PGRAPH_STATE, susres->graph_state); + NV_WRITE(NV10_PGRAPH_CTX_CONTROL, susres->graph_ctx_control); + } else { + NV_WRITE(NV04_PGRAPH_STATE, susres->graph_state); + NV_WRITE(NV04_PGRAPH_CTX_CONTROL, susres->graph_ctx_control); + } + + /* reenable the fifo caches */ + NV_WRITE(NV04_PFIFO_CACHE1_DMA_PUSH, + NV_READ(NV04_PFIFO_CACHE1_DMA_PUSH) | 1); + NV_WRITE(NV03_PFIFO_CACHE1_PUSH0, 0x00000001); + NV_WRITE(NV04_PFIFO_CACHE1_PULL0, 0x00000001); + NV_WRITE(NV03_PFIFO_CACHES, 0x00000001); + NV_WRITE(NV04_PGRAPH_FIFO, 0x1); + + if (dev->irq_enabled) + nouveau_irq_postinstall(dev); + + drm_free(susres->ramin_copy, susres->ramin_size, DRM_MEM_DRIVER); + susres->ramin_copy = NULL; + susres->ramin_size = 0; + + return 0; +} + +int nouveau_ioctl_suspend(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + NOUVEAU_CHECK_INITIALISED_WITH_RETURN; + + return nouveau_suspend(dev); +} + +int nouveau_ioctl_resume(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + NOUVEAU_CHECK_INITIALISED_WITH_RETURN; + + return nouveau_resume(dev); +} diff --git a/shared-core/nv20_graph.c b/shared-core/nv20_graph.c index ad73ea91..d862debb 100644 --- a/shared-core/nv20_graph.c +++ b/shared-core/nv20_graph.c @@ -694,13 +694,15 @@ int nv20_graph_init(struct drm_device *dev) { NV_WRITE(NV03_PMC_ENABLE, NV_READ(NV03_PMC_ENABLE) | NV_PMC_ENABLE_PGRAPH); - /* Create Context Pointer Table */ - dev_priv->ctx_table_size = 32 * 4; - if ((ret = nouveau_gpuobj_new_ref(dev, NULL, NULL, 0, - dev_priv->ctx_table_size, 16, - NVOBJ_FLAG_ZERO_ALLOC, - &dev_priv->ctx_table))) - return ret; + if (!dev_priv->ctx_table) { + /* Create Context Pointer Table */ + dev_priv->ctx_table_size = 32 * 4; + if ((ret = nouveau_gpuobj_new_ref(dev, NULL, NULL, 0, + dev_priv->ctx_table_size, 16, + NVOBJ_FLAG_ZERO_ALLOC, + &dev_priv->ctx_table))) + return ret; + } NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_TABLE, dev_priv->ctx_table->instance >> 4); @@ -812,13 +814,15 @@ int nv30_graph_init(struct drm_device *dev) NV_WRITE(NV03_PMC_ENABLE, NV_READ(NV03_PMC_ENABLE) | NV_PMC_ENABLE_PGRAPH); - /* Create Context Pointer Table */ - dev_priv->ctx_table_size = 32 * 4; - if ((ret = nouveau_gpuobj_new_ref(dev, NULL, NULL, 0, - dev_priv->ctx_table_size, 16, - NVOBJ_FLAG_ZERO_ALLOC, - &dev_priv->ctx_table))) - return ret; + if (!dev_priv->ctx_table) { + /* Create Context Pointer Table */ + dev_priv->ctx_table_size = 32 * 4; + if ((ret = nouveau_gpuobj_new_ref(dev, NULL, NULL, 0, + dev_priv->ctx_table_size, 16, + NVOBJ_FLAG_ZERO_ALLOC, + &dev_priv->ctx_table))) + return ret; + } NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_TABLE, dev_priv->ctx_table->instance >> 4); -- cgit v1.2.3 From 9101a0205c897fea28e6a3d875111a83ad7f7732 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 24 Aug 2008 16:54:43 +1000 Subject: libdrm: add udev support. This patch allows you to --enable-udev, and will avoid having libdrm make device nodes. If you are using udev, you should really --enable-udev your libdrm. --- configure.ac | 7 +++++++ libdrm/xf86drm.c | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/configure.ac b/configure.ac index 1cf877d5..0cf09744 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,9 @@ AC_SYS_LARGEFILE pkgconfigdir=${libdir}/pkgconfig AC_SUBST(pkgconfigdir) +AC_ARG_ENABLE(udev, AS_HELP_STRING([--enable-udev], + [Enable support for using udev instead of mknod (default: disabled)]), + [UDEV=$enableval], [UDEV=no]) dnl =========================================================================== @@ -101,6 +104,10 @@ AC_CACHE_CHECK([for supported warning flags], libdrm_cv_warn_cflags, [ AC_MSG_CHECKING([which warning flags were supported])]) WARN_CFLAGS="$libdrm_cv_warn_cflags" +if test "x$UDEV" = xyes; then + AC_DEFINE(UDEV, 1, [Have UDEV support]) +fi + AC_SUBST(WARN_CFLAGS) AC_OUTPUT([ Makefile diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 7202c8d7..c36f1964 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -297,6 +297,7 @@ static int drmOpenDevice(long dev, int minor) group = (serv_group >= 0) ? serv_group : DRM_DEV_GID; } +#if !defined(UDEV) if (stat(DRM_DIR_NAME, &st)) { if (!isroot) return DRM_ERR_NOT_ROOT; @@ -317,6 +318,30 @@ static int drmOpenDevice(long dev, int minor) chown(buf, user, group); chmod(buf, devmode); } +#else + /* if we modprobed then wait for udev */ + { + int udev_count = 0; +wait_for_udev: + if (stat(DRM_DIR_NAME, &st)) { + usleep(20); + udev_count++; + + if (udev_count == 50) + return -1; + goto wait_for_udev; + } + + if (stat(buf, &st)) { + usleep(20); + udev_count++; + + if (udev_count == 50) + return -1; + goto wait_for_udev; + } + } +#endif fd = open(buf, O_RDWR, 0); drmMsg("drmOpenDevice: open result is %d, (%s)\n", -- cgit v1.2.3 From 16c1a87580af89be02e7e6c1898f18b36829e007 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 13 Aug 2008 17:05:59 -0400 Subject: i915: Move spinlock init / destroy to load / unload time. This resolves the panic on FreeBSD during VT switch, without attempting any of the more lofty goals for the time being. --- shared-core/i915_dma.c | 6 ++++++ shared-core/i915_irq.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 5811fa3c..34d9355d 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -1073,6 +1073,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) i915_gem_load(dev); + DRM_SPININIT(&dev_priv->swaps_lock, "swap"); + DRM_SPININIT(&dev_priv->user_irq_lock, "userirq"); + #ifdef __linux__ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) intel_init_chipset_flush_compat(dev); @@ -1100,6 +1103,9 @@ int i915_driver_unload(struct drm_device *dev) drm_rmmap(dev, dev_priv->mmio_map); + DRM_SPINUNINIT(&dev_priv->swaps_lock); + DRM_SPINUNINIT(&dev_priv->user_irq_lock); + #ifdef __linux__ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) intel_opregion_free(dev); diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index 418e0ae9..89264ae2 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -948,11 +948,9 @@ int i915_driver_irq_postinstall(struct drm_device * dev) drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int ret, num_pipes = 2; - DRM_SPININIT(&dev_priv->swaps_lock, "swap"); INIT_LIST_HEAD(&dev_priv->vbl_swaps.head); dev_priv->swaps_pending = 0; - DRM_SPININIT(&dev_priv->user_irq_lock, "userirq"); dev_priv->user_irq_refcount = 0; dev_priv->irq_mask_reg = ~0; -- cgit v1.2.3 From e6010778a8edf96dbfb4bc1f7cf0ce5706eee733 Mon Sep 17 00:00:00 2001 From: vehemens Date: Wed, 13 Aug 2008 17:17:05 -0400 Subject: [FreeBSD] Fix lock leak. Signed-off-by: Robert Noland --- bsd-core/drm_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 771e5554..d369af4c 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -600,9 +600,10 @@ error: #ifdef __FreeBSD__ destroy_dev(dev->devnode); #if __FreeBSD_version >= 500000 + mtx_destroy(&dev->tsk_lock); mtx_destroy(&dev->drw_lock); - mtx_destroy(&dev->irq_lock); mtx_destroy(&dev->vbl_lock); + mtx_destroy(&dev->irq_lock); mtx_destroy(&dev->dev_lock); #endif #endif @@ -663,9 +664,10 @@ static void drm_unload(struct drm_device *dev) DRM_ERROR("Request to disable bus-master failed.\n"); #if defined(__FreeBSD__) && __FreeBSD_version >= 500000 + mtx_destroy(&dev->tsk_lock); mtx_destroy(&dev->drw_lock); - mtx_destroy(&dev->irq_lock); mtx_destroy(&dev->vbl_lock); + mtx_destroy(&dev->irq_lock); mtx_destroy(&dev->dev_lock); #endif } -- cgit v1.2.3 From 3e9541230d7b7c32ecb36c1edc5124b6991222be Mon Sep 17 00:00:00 2001 From: vehemens Date: Wed, 13 Aug 2008 17:19:35 -0400 Subject: [FreeBSD] Move vblank bits into their own structure. Signed-off-by: Robert Noland --- bsd-core/drmP.h | 27 ++++++++------ bsd-core/drm_irq.c | 101 ++++++++++++++++------------------------------------- 2 files changed, 46 insertions(+), 82 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 326b2202..473427f3 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -608,6 +608,19 @@ typedef struct drm_vbl_sig { int pid; } drm_vbl_sig_t; +struct drm_vblank_info { + wait_queue_head_t queue; /* vblank wait queue */ + atomic_t count; /* number of VBLANK interrupts */ + /* (driver must alloc the right number of counters) */ + struct drm_vbl_sig_list sigs; /* signal list to send on VBLANK */ + atomic_t refcount; /* number of users of vblank interrupts */ + u32 last; /* protected by dev->vbl_lock, used */ + /* for wraparound handling */ + int enabled; /* so we don't call enable more than */ + /* once per disable */ + int inmodeset; /* Display driver is setting mode */ +}; + /* location of GART table */ #define DRM_ATI_GART_MAIN 1 #define DRM_ATI_GART_FB 2 @@ -787,20 +800,12 @@ struct drm_device { atomic_t context_flag; /* Context swapping flag */ int last_context; /* Last current context */ + int vblank_disable_allowed; - wait_queue_head_t *vbl_queue; /* vblank wait queue */ - atomic_t *_vblank_count; /* number of VBLANK interrupts */ - /* (driver must alloc the right number of counters) */ - struct drm_vbl_sig_list *vbl_sigs; /* signal list to send on VBLANK */ - atomic_t vbl_signal_pending; /* number of signals pending on all crtcs*/ - atomic_t *vblank_refcount; /* number of users of vblank interrupts per crtc */ - u32 *last_vblank; /* protected by dev->vbl_lock, used */ - /* for wraparound handling */ - int *vblank_enabled; /* so we don't call enable more than */ - /* once per disable */ - int *vblank_inmodeset; /* Display driver is setting mode */ + atomic_t vbl_signal_pending; /* number of signals pending on all crtcs */ struct callout vblank_disable_timer; u32 max_vblank_count; /* size of vblank counter register */ + struct drm_vblank_info *vblank; /* per crtc vblank info */ int num_crtcs; #ifdef __FreeBSD__ diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index 6e21d41c..0f0d0fc8 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -85,13 +85,13 @@ static void vblank_disable_fn(void *arg) return; for (i = 0; i < dev->num_crtcs; i++) { - if (atomic_read(&dev->vblank_refcount[i]) == 0 && - dev->vblank_enabled[i]) { + if (atomic_read(&dev->vblank[i].refcount) == 0 && + dev->vblank[i].enabled) { DRM_DEBUG("disabling vblank on crtc %d\n", i); - dev->last_vblank[i] = + dev->vblank[i].last = dev->driver.get_vblank_counter(dev, i); dev->driver.disable_vblank(dev, i); - dev->vblank_enabled[i] = 0; + dev->vblank[i].enabled = 0; } } } @@ -112,20 +112,8 @@ static void drm_vblank_cleanup(struct drm_device *dev) vblank_disable_fn((void *)dev); - drm_free(dev->vbl_queue, sizeof(*dev->vbl_queue) * dev->num_crtcs, + drm_free(dev->vblank, sizeof(struct drm_vblank_info) * dev->num_crtcs, DRM_MEM_DRIVER); - drm_free(dev->vbl_sigs, sizeof(*dev->vbl_sigs) * dev->num_crtcs, - DRM_MEM_DRIVER); - drm_free(dev->_vblank_count, sizeof(*dev->_vblank_count) * - dev->num_crtcs, DRM_MEM_DRIVER); - drm_free(dev->vblank_refcount, sizeof(*dev->vblank_refcount) * - dev->num_crtcs, DRM_MEM_DRIVER); - drm_free(dev->vblank_enabled, sizeof(*dev->vblank_enabled) * - dev->num_crtcs, DRM_MEM_DRIVER); - drm_free(dev->last_vblank, sizeof(*dev->last_vblank) * dev->num_crtcs, - DRM_MEM_DRIVER); - drm_free(dev->vblank_inmodeset, sizeof(*dev->vblank_inmodeset) * - dev->num_crtcs, DRM_MEM_DRIVER); dev->num_crtcs = 0; } @@ -138,46 +126,17 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs) atomic_set(&dev->vbl_signal_pending, 0); dev->num_crtcs = num_crtcs; - dev->vbl_queue = drm_alloc(sizeof(wait_queue_head_t) * num_crtcs, - DRM_MEM_DRIVER); - if (!dev->vbl_queue) - goto err; - - dev->vbl_sigs = drm_alloc(sizeof(struct drm_vbl_sig) * num_crtcs, - DRM_MEM_DRIVER); - if (!dev->vbl_sigs) - goto err; - - dev->_vblank_count = drm_alloc(sizeof(atomic_t) * num_crtcs, - DRM_MEM_DRIVER); - if (!dev->_vblank_count) - goto err; - - dev->vblank_refcount = drm_alloc(sizeof(atomic_t) * num_crtcs, - DRM_MEM_DRIVER); - if (!dev->vblank_refcount) - goto err; - - dev->vblank_enabled = drm_calloc(num_crtcs, sizeof(int), - DRM_MEM_DRIVER); - if (!dev->vblank_enabled) - goto err; - - dev->last_vblank = drm_calloc(num_crtcs, sizeof(u32), DRM_MEM_DRIVER); - if (!dev->last_vblank) - goto err; - - dev->vblank_inmodeset = drm_calloc(num_crtcs, sizeof(int), + dev->vblank = drm_calloc(num_crtcs, sizeof(struct drm_vblank_info), DRM_MEM_DRIVER); - if (!dev->vblank_inmodeset) + if (!dev->vblank) goto err; /* Zero per-crtc vblank stuff */ for (i = 0; i < num_crtcs; i++) { - DRM_INIT_WAITQUEUE(&dev->vbl_queue[i]); - TAILQ_INIT(&dev->vbl_sigs[i]); - atomic_set(&dev->_vblank_count[i], 0); - atomic_set(&dev->vblank_refcount[i], 0); + DRM_INIT_WAITQUEUE(&dev->vblank[i].queue); + TAILQ_INIT(&dev->vblank[i].sigs); + atomic_set(&dev->vblank[i].count, 0); + atomic_set(&dev->vblank[i].refcount, 0); } dev->vblank_disable_allowed = 0; @@ -330,7 +289,7 @@ int drm_control(struct drm_device *dev, void *data, struct drm_file *file_priv) u32 drm_vblank_count(struct drm_device *dev, int crtc) { - return atomic_read(&dev->_vblank_count[crtc]); + return atomic_read(&dev->vblank[crtc].count); } static void drm_update_vblank_count(struct drm_device *dev, int crtc) @@ -345,18 +304,18 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc) * a long time. */ cur_vblank = dev->driver.get_vblank_counter(dev, crtc); - diff = cur_vblank - dev->last_vblank[crtc]; - if (cur_vblank < dev->last_vblank[crtc]) { + diff = cur_vblank - dev->vblank[crtc].last; + if (cur_vblank < dev->vblank[crtc].last) { diff += dev->max_vblank_count; DRM_DEBUG("last_vblank[%d]=0x%x, cur_vblank=0x%x => diff=0x%x\n", - crtc, dev->last_vblank[crtc], cur_vblank, diff); + crtc, dev->vblank[crtc].last, cur_vblank, diff); } DRM_DEBUG("enabling vblank interrupts on crtc %d, missed %d\n", crtc, diff); - atomic_add(diff, &dev->_vblank_count[crtc]); + atomic_add(diff, &dev->vblank[crtc].count); } int drm_vblank_get(struct drm_device *dev, int crtc) @@ -366,14 +325,14 @@ int drm_vblank_get(struct drm_device *dev, int crtc) DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags); /* Going from 0->1 means we have to enable interrupts again */ - atomic_add_acq_int(&dev->vblank_refcount[crtc], 1); - if (dev->vblank_refcount[crtc] == 1 && - !dev->vblank_enabled[crtc]) { + atomic_add_acq_int(&dev->vblank[crtc].refcount, 1); + if (dev->vblank[crtc].refcount == 1 && + !dev->vblank[crtc].enabled) { ret = dev->driver.enable_vblank(dev, crtc); if (ret) - atomic_dec(&dev->vblank_refcount[crtc]); + atomic_dec(&dev->vblank[crtc].refcount); else { - dev->vblank_enabled[crtc] = 1; + dev->vblank[crtc].enabled = 1; drm_update_vblank_count(dev, crtc); } } @@ -388,8 +347,8 @@ void drm_vblank_put(struct drm_device *dev, int crtc) DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags); /* Last user schedules interrupt disable */ - atomic_subtract_acq_int(&dev->vblank_refcount[crtc], 1); - if (dev->vblank_refcount[crtc] == 0) + atomic_subtract_acq_int(&dev->vblank[crtc].refcount, 1); + if (dev->vblank[crtc].refcount == 0) callout_reset(&dev->vblank_disable_timer, 5 * DRM_HZ, (timeout_t *)vblank_disable_fn, (void *)dev); DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags); @@ -421,16 +380,16 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, */ switch (modeset->cmd) { case _DRM_PRE_MODESET: - if (!dev->vblank_inmodeset[crtc]) { - dev->vblank_inmodeset[crtc] = 1; + if (!dev->vblank[crtc].inmodeset) { + dev->vblank[crtc].inmodeset = 1; drm_vblank_get(dev, crtc); } break; case _DRM_POST_MODESET: - if (dev->vblank_inmodeset[crtc]) { + if (dev->vblank[crtc].inmodeset) { DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags); dev->vblank_disable_allowed = 1; - dev->vblank_inmodeset[crtc] = 0; + dev->vblank[crtc].inmodeset = 0; DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags); drm_vblank_put(dev, crtc); } @@ -511,7 +470,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_pr DRM_LOCK(); /* shared code returns -errno */ - DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ, + DRM_WAIT_ON(ret, dev->vblank[crtc].queue, 3 * DRM_HZ, ((drm_vblank_count(dev, crtc) - vblwait->request.sequence) <= (1 << 23))); DRM_UNLOCK(); @@ -561,8 +520,8 @@ void drm_vbl_send_signals(struct drm_device *dev, int crtc ) void drm_handle_vblank(struct drm_device *dev, int crtc) { - atomic_inc(&dev->_vblank_count[crtc]); - DRM_WAKEUP(&dev->vbl_queue[crtc]); + atomic_inc(&dev->vblank[crtc].count); + DRM_WAKEUP(&dev->vblank[crtc].queue); drm_vbl_send_signals(dev, crtc); } -- cgit v1.2.3 From 1f3c4dd938a1710d762bac37dfb1b17c90af4732 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 20 Aug 2008 17:15:46 -0400 Subject: i915: Free dev->dev_private on unload. --- shared-core/i915_dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 34d9355d..84aafaae 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -1114,6 +1114,8 @@ int i915_driver_unload(struct drm_device *dev) drm_free(dev->dev_private, sizeof(drm_i915_private_t), DRM_MEM_DRIVER); + dev->dev_private = NULL; + #ifdef __linux__ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) intel_fini_chipset_flush_compat(dev); -- cgit v1.2.3 From 739b01dde43c40398d9b0d177e9d330e06cdc2ae Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 20 Aug 2008 17:20:31 -0400 Subject: i915: Clear sarea_priv during lastclose. sarea_priv needs to be NULL before i915_initialized is called to properly reset it. The stale value produces a panic any time something opens/closes drm without calling initialize. i.e. version checking --- shared-core/i915_dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 84aafaae..77b4181c 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -1142,6 +1142,8 @@ void i915_driver_lastclose(struct drm_device * dev) if (drm_getsarea(dev) && dev_priv->sarea_priv) i915_do_cleanup_pageflip(dev); + if (dev_priv->sarea_priv) + dev_priv->sarea_priv = NULL; if (dev_priv->agp_heap) i915_mem_takedown(&(dev_priv->agp_heap)); #if defined(I915_HAVE_BUFFER) -- cgit v1.2.3 From d0acbe4553d27df3fdc217c956c609c54ebb51e6 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Fri, 22 Aug 2008 21:32:37 -0400 Subject: i915: Convert vblank on disabled pipe DRM_ERROR to DRM_DEBUG. --- shared-core/i915_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index 89264ae2..8bd2804f 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -402,7 +402,7 @@ u32 i915_get_vblank_counter(struct drm_device *dev, int plane) low_frame = pipe ? PIPEBFRAMEPIXEL : PIPEAFRAMEPIXEL; if (!i915_pipe_enabled(dev, pipe)) { - DRM_ERROR("trying to get vblank count for disabled pipe %d\n", pipe); + DRM_DEBUG("trying to get vblank count for disabled pipe %d\n", pipe); return 0; } -- cgit v1.2.3 From 0687c0a4ec78730f752cee04a5b0862f47dbf026 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Fri, 22 Aug 2008 21:34:25 -0400 Subject: [FreeBSD] Fix long standing memory leak in drm_remove_magic. We shuffled all the links around to disconnect the entry, but never free it. We would incorrectly free the last entry in the hash chain if nothing matched. --- bsd-core/drm_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-core/drm_auth.c b/bsd-core/drm_auth.c index f3aafe44..60af16cb 100644 --- a/bsd-core/drm_auth.c +++ b/bsd-core/drm_auth.c @@ -117,11 +117,11 @@ static int drm_remove_magic(struct drm_device *dev, drm_magic_t magic) if (prev) { prev->next = pt->next; } + free(pt, M_DRM); return 0; } } - free(pt, M_DRM); return EINVAL; } -- cgit v1.2.3 From bfea578352aaaed08555e86c9951b3932f39d122 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Fri, 22 Aug 2008 21:45:41 -0400 Subject: [FreeBSD] Add drm_drawable_free_all() --- bsd-core/drmP.h | 3 +++ bsd-core/drm_drawable.c | 19 +++++++++++++++++++ bsd-core/drm_drv.c | 2 ++ 3 files changed, 24 insertions(+) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 473427f3..74487e55 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -1031,6 +1031,9 @@ int drm_update_draw(struct drm_device *dev, void *data, struct drm_drawable_info *drm_get_drawable_info(struct drm_device *dev, int handle); +/* Drawable support (drm_drawable.c) */ +void drm_drawable_free_all(struct drm_device *dev); + /* Authentication IOCTL support (drm_auth.c) */ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv); diff --git a/bsd-core/drm_drawable.c b/bsd-core/drm_drawable.c index 268b956c..1d85cb45 100644 --- a/bsd-core/drm_drawable.c +++ b/bsd-core/drm_drawable.c @@ -151,3 +151,22 @@ int drm_update_draw(struct drm_device *dev, void *data, return EINVAL; } } + +void drm_drawable_free_all(struct drm_device *dev) +{ + struct bsd_drm_drawable_info *info, *next; + + DRM_SPINLOCK(&dev->drw_lock); + for (info = RB_MIN(drawable_tree, &dev->drw_head); + info != NULL ; info = next) { + next = RB_NEXT(drawable_tree, &dev->drw_head, info); + RB_REMOVE(drawable_tree, &dev->drw_head, + (struct bsd_drm_drawable_info *)info); + DRM_SPINUNLOCK(&dev->drw_lock); + free_unr(dev->drw_unrhdr, info->handle); + drm_free(info, sizeof(struct bsd_drm_drawable_info), + DRM_MEM_DRAWABLE); + DRM_SPINLOCK(&dev->drw_lock); + } + DRM_SPINUNLOCK(&dev->drw_lock); +} diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index d369af4c..32b284e1 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -460,6 +460,8 @@ static int drm_lastclose(struct drm_device *dev) dev->magiclist[i].head = dev->magiclist[i].tail = NULL; } + drm_drawable_free_all(dev); + /* Clear AGP information */ if ( dev->agp ) { drm_agp_mem_t *entry; -- cgit v1.2.3 From c8fd8d3a0d37dc09165ac77c7d38938ef9942011 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Sun, 24 Aug 2008 15:53:17 -0400 Subject: i915: Fix i915 build on FreeBSD ifdef out all the gem stuff for now. Also, the msi stuff isn't portable the way it is... I'll try and fix that up sometime soon. --- shared-core/i915_dma.c | 13 +++++++++---- shared-core/i915_drv.h | 12 +++++++----- shared-core/i915_irq.c | 11 ++++++++++- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 77b4181c..5a69b1f3 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -63,7 +63,7 @@ int i915_wait_ring(struct drm_device * dev, int n, const char *caller) last_head = ring->head; last_acthd = acthd; - msleep_interruptible (10); + DRM_UDELAY(10 * 1000); } return -EBUSY; @@ -126,7 +126,9 @@ void i915_ring_validate(struct drm_device *dev, const char *func, int line) DRM_ERROR("%s:%d head sw %x, hw %x. tail sw %x hw %x\n", func, line, ring->head, head, ring->tail, tail); +#ifdef __linux__ BUG_ON(1); +#endif } } #endif @@ -1070,9 +1072,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ret = drm_addmap(dev, base, size, _DRM_REGISTERS, _DRM_KERNEL | _DRM_DRIVER, &dev_priv->mmio_map); - +#ifdef I915_HAVE_GEM i915_gem_load(dev); - +#endif DRM_SPININIT(&dev_priv->swaps_lock, "swap"); DRM_SPININIT(&dev_priv->user_irq_lock, "userirq"); @@ -1138,8 +1140,9 @@ void i915_driver_lastclose(struct drm_device * dev) dev_priv->val_bufs = NULL; } #endif +#ifdef I915_HAVE_GEM i915_gem_lastclose(dev); - +#endif if (drm_getsarea(dev) && dev_priv->sarea_priv) i915_do_cleanup_pageflip(dev); if (dev_priv->sarea_priv) @@ -1218,6 +1221,7 @@ struct drm_ioctl_desc i915_ioctls[] = { #ifdef I915_HAVE_BUFFER DRM_IOCTL_DEF(DRM_I915_EXECBUFFER, i915_execbuffer, DRM_AUTH), #endif +#ifdef I915_HAVE_GEM DRM_IOCTL_DEF(DRM_I915_GEM_INIT, i915_gem_init_ioctl, DRM_AUTH), DRM_IOCTL_DEF(DRM_I915_GEM_EXECBUFFER, i915_gem_execbuffer, DRM_AUTH), DRM_IOCTL_DEF(DRM_I915_GEM_PIN, i915_gem_pin_ioctl, DRM_AUTH|DRM_ROOT_ONLY), @@ -1234,6 +1238,7 @@ struct drm_ioctl_desc i915_ioctls[] = { DRM_IOCTL_DEF(DRM_I915_GEM_SW_FINISH, i915_gem_sw_finish_ioctl, 0), DRM_IOCTL_DEF(DRM_I915_GEM_SET_TILING, i915_gem_set_tiling, 0), DRM_IOCTL_DEF(DRM_I915_GEM_GET_TILING, i915_gem_get_tiling, 0), +#endif }; int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h index f84dcc25..48fd30d7 100644 --- a/shared-core/i915_drv.h +++ b/shared-core/i915_drv.h @@ -42,6 +42,7 @@ #if defined(__linux__) #define I915_HAVE_FENCE #define I915_HAVE_BUFFER +#define I915_HAVE_GEM #endif /* Interface history: @@ -277,8 +278,9 @@ typedef struct drm_i915_private { u8 saveCR[37]; struct { +#ifdef __linux__ struct drm_mm gtt_space; - +#endif /** * List of objects currently involved in rendering from the * ringbuffer. @@ -311,7 +313,7 @@ typedef struct drm_i915_private { * outstanding. */ struct list_head request_list; - +#ifdef __linux__ /** * We leave the user IRQ off as much as possible, * but this means that requests will finish and never @@ -320,7 +322,7 @@ typedef struct drm_i915_private { * fires, go retire requests. */ struct delayed_work retire_work; - +#endif uint32_t next_gem_seqno; /** @@ -473,6 +475,8 @@ extern int i915_driver_firstopen(struct drm_device *dev); extern int i915_dispatch_batchbuffer(struct drm_device * dev, drm_i915_batchbuffer_t * batch); extern int i915_quiescent(struct drm_device *dev); +extern int i915_init_hardware_status(struct drm_device *dev); +extern void i915_free_hardware_status(struct drm_device *dev); int i915_emit_box(struct drm_device * dev, struct drm_clip_rect __user * boxes, @@ -593,8 +597,6 @@ void i915_gem_clflush_object(struct drm_gem_object *obj); void i915_gem_detect_bit_6_swizzle(struct drm_device *dev); /* i915_gem_debug.c */ -void i915_gem_dump_object(struct drm_gem_object *obj, int len, - const char *where, uint32_t mark); #if WATCH_INACTIVE void i915_verify_inactive(struct drm_device *dev, char *file, int line); #else diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index 8bd2804f..693e9429 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -432,19 +432,22 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) u32 iir; u32 pipea_stats = 0, pipeb_stats = 0; int vblank = 0; - +#ifdef __linux__ if (dev->pdev->msi_enabled) I915_WRITE(IMR, ~0); +#endif iir = I915_READ(IIR); #if 0 DRM_DEBUG("flag=%08x\n", iir); #endif atomic_inc(&dev_priv->irq_received); if (iir == 0) { +#ifdef __linux__ if (dev->pdev->msi_enabled) { I915_WRITE(IMR, dev_priv->irq_mask_reg); (void) I915_READ(IMR); } +#endif return IRQ_NONE; } @@ -499,12 +502,16 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); I915_WRITE(IIR, iir); +#ifdef __linux__ if (dev->pdev->msi_enabled) I915_WRITE(IMR, dev_priv->irq_mask_reg); +#endif (void) I915_READ(IIR); /* Flush posted writes */ if (iir & I915_USER_INTERRUPT) { +#ifdef I915_HAVE_GEM dev_priv->mm.irq_gem_seqno = i915_get_gem_seqno(dev); +#endif DRM_WAKEUP(&dev_priv->irq_queue); #ifdef I915_HAVE_FENCE i915_fence_handler(dev); @@ -549,7 +556,9 @@ void i915_user_irq_on(drm_i915_private_t *dev_priv) void i915_user_irq_off(drm_i915_private_t *dev_priv) { DRM_SPINLOCK(&dev_priv->user_irq_lock); +#ifdef __linux__ BUG_ON(dev_priv->irq_enabled && dev_priv->user_irq_refcount <= 0); +#endif if (dev_priv->irq_enabled && (--dev_priv->user_irq_refcount == 0)) i915_disable_irq(dev_priv, I915_USER_INTERRUPT); DRM_SPINUNLOCK(&dev_priv->user_irq_lock); -- cgit v1.2.3 From 0239594fc318c2b55bbfbea27f23218f6d7a4b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 26 Aug 2008 14:28:08 -0400 Subject: [intel_bufmgr_gem] Remember global name when creating buffer from name. --- libdrm/intel/intel_bufmgr_gem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c index 48a47701..8634fdf8 100644 --- a/libdrm/intel/intel_bufmgr_gem.c +++ b/libdrm/intel/intel_bufmgr_gem.c @@ -369,6 +369,7 @@ intel_bo_gem_create_from_name(dri_bufmgr *bufmgr, const char *name, bo_gem->refcount = 1; bo_gem->validate_index = -1; bo_gem->gem_handle = open_arg.handle; + bo_gem->global_name = handle; DBG("bo_create_from_handle: %d (%s)\n", handle, bo_gem->name); -- cgit v1.2.3 From bffbb497e2502b0aa6fd24804251d6a21d8fa034 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Wed, 27 Aug 2008 02:27:10 +0200 Subject: Change git-describe into git describe. --- linux-core/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-core/Makefile b/linux-core/Makefile index 4edec312..157664ef 100644 --- a/linux-core/Makefile +++ b/linux-core/Makefile @@ -341,7 +341,7 @@ CONFIG_DRM_I915 := m endif endif -GIT_REVISION := $(shell cd "$(DRMSRCDIR)" && git-describe --abbrev=17) +GIT_REVISION := $(shell cd "$(DRMSRCDIR)" && git describe --abbrev=17) ifneq ($(GIT_REVISION),) EXTRA_CFLAGS+=-D"GIT_REVISION=\"$(GIT_REVISION)\"" endif -- cgit v1.2.3 From b460aeec3ea817540e43c8215f2cdf432c957289 Mon Sep 17 00:00:00 2001 From: Tomas Carnecky Date: Fri, 29 Aug 2008 00:43:19 +0200 Subject: Fix drm_realloc when you're reallocing into something smaller. --- bsd-core/drm_memory.c | 2 +- linux-core/drm_memory.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-core/drm_memory.c b/bsd-core/drm_memory.c index 05343f3f..80891402 100644 --- a/bsd-core/drm_memory.c +++ b/bsd-core/drm_memory.c @@ -69,7 +69,7 @@ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area) if (pt == NULL) return NULL; if (oldpt && oldsize) { - memcpy(pt, oldpt, oldsize); + memcpy(pt, oldpt, DRM_MIN(oldsize,size)); free(oldpt, M_DRM); } return pt; diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c index b90fc020..d1a88c88 100644 --- a/linux-core/drm_memory.c +++ b/linux-core/drm_memory.c @@ -183,7 +183,7 @@ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area) if (!(pt = kmalloc(size, GFP_KERNEL))) return NULL; if (oldpt && oldsize) { - memcpy(pt, oldpt, oldsize); + memcpy(pt, oldpt, DRM_MIN(oldsize,size)); kfree(oldpt); } return pt; -- cgit v1.2.3 From f8a14b1f9556919617208a8eb88ff88d6c77f08d Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Fri, 29 Aug 2008 12:23:35 -0400 Subject: [FreeBSD] Increase debugging output for vblank code. Doing my part to make DRM_DEBUG more chatty... --- bsd-core/drm_irq.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index 0f0d0fc8..79e1c643 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -81,6 +81,7 @@ static void vblank_disable_fn(void *arg) } callout_deactivate(&dev->vblank_disable_timer); + DRM_DEBUG("vblank_disable_allowed=%d\n", dev->vblank_disable_allowed); if (!dev->vblank_disable_allowed) return; @@ -131,6 +132,8 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs) if (!dev->vblank) goto err; + DRM_DEBUG("\n"); + /* Zero per-crtc vblank stuff */ for (i = 0; i < num_crtcs; i++) { DRM_INIT_WAITQUEUE(&dev->vblank[i].queue); @@ -361,11 +364,13 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, unsigned long irqflags; int crtc, ret = 0; + DRM_DEBUG("num_crtcs=%d\n", dev->num_crtcs); /* If drm_vblank_init() hasn't been called yet, just no-op */ if (!dev->num_crtcs) goto out; crtc = modeset->crtc; + DRM_DEBUG("crtc=%d\n", crtc); if (crtc >= dev->num_crtcs) { ret = EINVAL; goto out; @@ -380,12 +385,14 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, */ switch (modeset->cmd) { case _DRM_PRE_MODESET: + DRM_DEBUG("pre-modeset\n"); if (!dev->vblank[crtc].inmodeset) { dev->vblank[crtc].inmodeset = 1; drm_vblank_get(dev, crtc); } break; case _DRM_POST_MODESET: + DRM_DEBUG("post-modeset\n"); if (dev->vblank[crtc].inmodeset) { DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags); dev->vblank_disable_allowed = 1; -- cgit v1.2.3 From c7f7b6d7e2f46753381de51e4b0b00211a1a6b5f Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Fri, 29 Aug 2008 12:29:50 -0400 Subject: [FreeBSD] Fix a couple of locking problems. --- bsd-core/drm_drv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 32b284e1..47c212e2 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -460,7 +460,9 @@ static int drm_lastclose(struct drm_device *dev) dev->magiclist[i].head = dev->magiclist[i].tail = NULL; } + DRM_UNLOCK(); drm_drawable_free_all(dev); + DRM_LOCK(); /* Clear AGP information */ if ( dev->agp ) { @@ -655,8 +657,11 @@ static void drm_unload(struct drm_device *dev) dev->agp = NULL; } - if (dev->driver.unload != NULL) + if (dev->driver.unload != NULL) { + DRM_LOCK(); dev->driver.unload(dev); + DRM_UNLOCK(); + } delete_unrhdr(dev->drw_unrhdr); -- cgit v1.2.3 From 043ad591b55ee8d4ac3ff65038705219d1893b12 Mon Sep 17 00:00:00 2001 From: vehemens Date: Fri, 29 Aug 2008 12:37:29 -0400 Subject: [FreeBSD] Correct debug message Signed-off-by: Robert Noland --- bsd-core/drm_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index 79e1c643..e1c50bb6 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -311,7 +311,7 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc) if (cur_vblank < dev->vblank[crtc].last) { diff += dev->max_vblank_count; - DRM_DEBUG("last_vblank[%d]=0x%x, cur_vblank=0x%x => diff=0x%x\n", + DRM_DEBUG("vblank[%d].last=0x%x, cur_vblank=0x%x => diff=0x%x\n", crtc, dev->vblank[crtc].last, cur_vblank, diff); } -- cgit v1.2.3 From b92f5577670f99ded76e201a71aaa23cce8f7577 Mon Sep 17 00:00:00 2001 From: vehemens Date: Fri, 29 Aug 2008 12:40:30 -0400 Subject: [FreeBSD] Catch up to vblank rework for via. (No, we don't build via right now.) Signed-off-by: Robert Noland --- bsd-core/via_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bsd-core/via_drv.c b/bsd-core/via_drv.c index 1d784eed..36b820a9 100644 --- a/bsd-core/via_drv.c +++ b/bsd-core/via_drv.c @@ -46,7 +46,9 @@ static void via_configure(struct drm_device *dev) dev->driver.unload = via_driver_unload; dev->driver.context_ctor = via_init_context; dev->driver.context_dtor = via_final_context; - dev->driver.vblank_wait = via_driver_vblank_wait; + dev->driver.get_vblank_counter = via_get_vblank_counter; + dev->driver.enable_vblank = via_enable_vblank; + dev->driver.disable_vblank = via_disable_vblank; dev->driver.irq_preinstall = via_driver_irq_preinstall; dev->driver.irq_postinstall = via_driver_irq_postinstall; dev->driver.irq_uninstall = via_driver_irq_uninstall; -- cgit v1.2.3 From 71f0a3e389efb6c92a84299d05beb2a1bfa53469 Mon Sep 17 00:00:00 2001 From: vehemens Date: Fri, 29 Aug 2008 12:47:00 -0400 Subject: [FreeBSD] Replace typedefs on bsd. Signed-off-by: Robert Noland --- bsd-core/drmP.h | 34 +++++++++++++++++----------------- bsd-core/drm_agpsupport.c | 38 +++++++++++++++++++------------------- bsd-core/drm_auth.c | 4 ++-- bsd-core/drm_bufs.c | 32 ++++++++++++++++---------------- bsd-core/drm_context.c | 18 +++++++++--------- bsd-core/drm_drawable.c | 4 ++-- bsd-core/drm_drv.c | 2 +- bsd-core/drm_ioctl.c | 16 ++++++++-------- bsd-core/drm_irq.c | 6 +++--- bsd-core/drm_lock.c | 4 ++-- bsd-core/drm_scatter.c | 6 +++--- bsd-core/drm_vm.c | 2 +- shared-core/drm.h | 2 +- 13 files changed, 84 insertions(+), 84 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 74487e55..25f71f03 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -523,7 +523,7 @@ struct drm_file { }; typedef struct drm_lock_data { - drm_hw_lock_t *hw_lock; /* Hardware lock */ + struct drm_hw_lock *hw_lock; /* Hardware lock */ struct drm_file *file_priv; /* Unique identifier of holding process (NULL is kernel)*/ int lock_queue; /* Queue of blocked processes */ unsigned long lock_time; /* Time of last lock in jiffies */ @@ -586,8 +586,8 @@ typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t; typedef struct drm_local_map { unsigned long offset; /* Physical address (0 for SAREA)*/ unsigned long size; /* Physical size (bytes) */ - drm_map_type_t type; /* Type of memory mapped */ - drm_map_flags_t flags; /* Flags */ + enum drm_map_type type; /* Type of memory mapped */ + enum drm_map_flags flags; /* Flags */ void *handle; /* User-space: "Handle" to pass to mmap */ /* Kernel-space: kernel-virtual address */ int mtrr; /* Boolean: MTRR used */ @@ -662,9 +662,9 @@ struct drm_driver_info { void (*dma_ready)(struct drm_device *); int (*dma_quiescent)(struct drm_device *); int (*dma_flush_block_and_flush)(struct drm_device *, int context, - drm_lock_flags_t flags); + enum drm_lock_flags flags); int (*dma_flush_unblock)(struct drm_device *, int context, - drm_lock_flags_t flags); + enum drm_lock_flags flags); int (*context_ctor)(struct drm_device *dev, int context); int (*context_dtor)(struct drm_device *dev, int context); int (*kernel_context_switch)(struct drm_device *dev, int old, @@ -760,7 +760,7 @@ struct drm_device { /* Performance counters */ unsigned long counters; - drm_stat_type_t types[15]; + enum drm_stat_type types[15]; atomic_t counts[15]; /* Authentication */ @@ -912,11 +912,11 @@ void drm_rmmap(struct drm_device *dev, drm_local_map_t *map); int drm_order(unsigned long size); int drm_addmap(struct drm_device *dev, unsigned long offset, unsigned long size, - drm_map_type_t type, drm_map_flags_t flags, + enum drm_map_type type, enum drm_map_flags flags, drm_local_map_t **map_ptr); -int drm_addbufs_pci(struct drm_device *dev, drm_buf_desc_t *request); -int drm_addbufs_sg(struct drm_device *dev, drm_buf_desc_t *request); -int drm_addbufs_agp(struct drm_device *dev, drm_buf_desc_t *request); +int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request); +int drm_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *request); +int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *request); /* DMA support (drm_dma.c) */ int drm_dma_setup(struct drm_device *dev); @@ -948,20 +948,20 @@ int drm_device_is_pcie(struct drm_device *dev); drm_agp_head_t *drm_agp_init(void); int drm_agp_acquire(struct drm_device *dev); int drm_agp_release(struct drm_device *dev); -int drm_agp_info(struct drm_device * dev, drm_agp_info_t *info); -int drm_agp_enable(struct drm_device *dev, drm_agp_mode_t mode); +int drm_agp_info(struct drm_device * dev, struct drm_agp_info *info); +int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode); void *drm_agp_allocate_memory(size_t pages, u32 type); int drm_agp_free_memory(void *handle); int drm_agp_bind_memory(void *handle, off_t start); int drm_agp_unbind_memory(void *handle); -int drm_agp_alloc(struct drm_device *dev, drm_agp_buffer_t *request); -int drm_agp_free(struct drm_device *dev, drm_agp_buffer_t *request); -int drm_agp_bind(struct drm_device *dev, drm_agp_binding_t *request); -int drm_agp_unbind(struct drm_device *dev, drm_agp_binding_t *request); +int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request); +int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request); +int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request); +int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request); /* Scatter Gather Support (drm_scatter.c) */ void drm_sg_cleanup(drm_sg_mem_t *entry); -int drm_sg_alloc(struct drm_device *dev, drm_scatter_gather_t * request); +int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request); #ifdef __FreeBSD__ /* sysctl support (drm_sysctl.h) */ diff --git a/bsd-core/drm_agpsupport.c b/bsd-core/drm_agpsupport.c index 97613d21..927e5ee8 100644 --- a/bsd-core/drm_agpsupport.c +++ b/bsd-core/drm_agpsupport.c @@ -109,7 +109,7 @@ int drm_device_is_pcie(struct drm_device *dev) return (drm_device_find_capability(dev, PCIY_EXPRESS)); } -int drm_agp_info(struct drm_device * dev, drm_agp_info_t *info) +int drm_agp_info(struct drm_device * dev, struct drm_agp_info *info) { struct agp_info *kern; @@ -135,13 +135,13 @@ int drm_agp_info_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { int err; - drm_agp_info_t info; + struct drm_agp_info info; err = drm_agp_info(dev, &info); if (err != 0) return err; - *(drm_agp_info_t *) data = info; + *(struct drm_agp_info *) data = info; return 0; } @@ -183,7 +183,7 @@ int drm_agp_release(struct drm_device * dev) return 0; } -int drm_agp_enable(struct drm_device *dev, drm_agp_mode_t mode) +int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode) { if (!dev->agp || !dev->agp->acquired) @@ -198,14 +198,14 @@ int drm_agp_enable(struct drm_device *dev, drm_agp_mode_t mode) int drm_agp_enable_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_mode_t mode; + struct drm_agp_mode mode; - mode = *(drm_agp_mode_t *) data; + mode = *(struct drm_agp_mode *) data; return drm_agp_enable(dev, mode); } -int drm_agp_alloc(struct drm_device *dev, drm_agp_buffer_t *request) +int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request) { drm_agp_mem_t *entry; void *handle; @@ -251,16 +251,16 @@ int drm_agp_alloc(struct drm_device *dev, drm_agp_buffer_t *request) int drm_agp_alloc_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_buffer_t request; + struct drm_agp_buffer request; int retcode; - request = *(drm_agp_buffer_t *) data; + request = *(struct drm_agp_buffer *) data; DRM_LOCK(); retcode = drm_agp_alloc(dev, &request); DRM_UNLOCK(); - *(drm_agp_buffer_t *) data = request; + *(struct drm_agp_buffer *) data = request; return retcode; } @@ -276,7 +276,7 @@ static drm_agp_mem_t * drm_agp_lookup_entry(struct drm_device *dev, return NULL; } -int drm_agp_unbind(struct drm_device *dev, drm_agp_binding_t *request) +int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request) { drm_agp_mem_t *entry; int retcode; @@ -301,10 +301,10 @@ int drm_agp_unbind(struct drm_device *dev, drm_agp_binding_t *request) int drm_agp_unbind_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_binding_t request; + struct drm_agp_binding request; int retcode; - request = *(drm_agp_binding_t *) data; + request = *(struct drm_agp_binding *) data; DRM_LOCK(); retcode = drm_agp_unbind(dev, &request); @@ -313,7 +313,7 @@ int drm_agp_unbind_ioctl(struct drm_device *dev, void *data, return retcode; } -int drm_agp_bind(struct drm_device *dev, drm_agp_binding_t *request) +int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request) { drm_agp_mem_t *entry; int retcode; @@ -342,10 +342,10 @@ int drm_agp_bind(struct drm_device *dev, drm_agp_binding_t *request) int drm_agp_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_binding_t request; + struct drm_agp_binding request; int retcode; - request = *(drm_agp_binding_t *) data; + request = *(struct drm_agp_binding *) data; DRM_LOCK(); retcode = drm_agp_bind(dev, &request); @@ -354,7 +354,7 @@ int drm_agp_bind_ioctl(struct drm_device *dev, void *data, return retcode; } -int drm_agp_free(struct drm_device *dev, drm_agp_buffer_t *request) +int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request) { drm_agp_mem_t *entry; @@ -387,10 +387,10 @@ int drm_agp_free(struct drm_device *dev, drm_agp_buffer_t *request) int drm_agp_free_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_buffer_t request; + struct drm_agp_buffer request; int retcode; - request = *(drm_agp_buffer_t *) data; + request = *(struct drm_agp_buffer *) data; DRM_LOCK(); retcode = drm_agp_free(dev, &request); diff --git a/bsd-core/drm_auth.c b/bsd-core/drm_auth.c index 60af16cb..c11c887a 100644 --- a/bsd-core/drm_auth.c +++ b/bsd-core/drm_auth.c @@ -136,7 +136,7 @@ static int drm_remove_magic(struct drm_device *dev, drm_magic_t magic) int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv) { static drm_magic_t sequence = 0; - drm_auth_t *auth = data; + struct drm_auth *auth = data; /* Find unique magic */ if (file_priv->magic) { @@ -167,7 +167,7 @@ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_authmagic(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_auth_t *auth = data; + struct drm_auth *auth = data; drm_file_t *priv; DRM_DEBUG("%u\n", auth->magic); diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index c793634b..2d13087a 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -102,7 +102,7 @@ unsigned long drm_get_resource_len(struct drm_device *dev, int drm_addmap(struct drm_device * dev, unsigned long offset, unsigned long size, - drm_map_type_t type, drm_map_flags_t flags, drm_local_map_t **map_ptr) + enum drm_map_type type, enum drm_map_flags flags, drm_local_map_t **map_ptr) { drm_local_map_t *map; int align; @@ -274,7 +274,7 @@ done: int drm_addmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_map_t *request = data; + struct drm_map *request = data; drm_local_map_t *map; int err; @@ -355,7 +355,7 @@ int drm_rmmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_local_map_t *map; - drm_map_t *request = data; + struct drm_map *request = data; DRM_LOCK(); TAILQ_FOREACH(map, &dev->maplist, link) { @@ -402,7 +402,7 @@ static void drm_cleanup_buf_error(struct drm_device *dev, } } -static int drm_do_addbufs_agp(struct drm_device *dev, drm_buf_desc_t *request) +static int drm_do_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *request) { drm_device_dma_t *dma = dev->dma; drm_buf_entry_t *entry; @@ -533,7 +533,7 @@ static int drm_do_addbufs_agp(struct drm_device *dev, drm_buf_desc_t *request) return 0; } -static int drm_do_addbufs_pci(struct drm_device *dev, drm_buf_desc_t *request) +static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request) { drm_device_dma_t *dma = dev->dma; int count; @@ -680,7 +680,7 @@ static int drm_do_addbufs_pci(struct drm_device *dev, drm_buf_desc_t *request) } -static int drm_do_addbufs_sg(struct drm_device *dev, drm_buf_desc_t *request) +static int drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *request) { drm_device_dma_t *dma = dev->dma; drm_buf_entry_t *entry; @@ -791,7 +791,7 @@ static int drm_do_addbufs_sg(struct drm_device *dev, drm_buf_desc_t *request) return 0; } -int drm_addbufs_agp(struct drm_device *dev, drm_buf_desc_t *request) +int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *request) { int order, ret; @@ -822,7 +822,7 @@ int drm_addbufs_agp(struct drm_device *dev, drm_buf_desc_t *request) return ret; } -int drm_addbufs_sg(struct drm_device *dev, drm_buf_desc_t *request) +int drm_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *request) { int order, ret; @@ -856,7 +856,7 @@ int drm_addbufs_sg(struct drm_device *dev, drm_buf_desc_t *request) return ret; } -int drm_addbufs_pci(struct drm_device *dev, drm_buf_desc_t *request) +int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request) { int order, ret; @@ -893,7 +893,7 @@ int drm_addbufs_pci(struct drm_device *dev, drm_buf_desc_t *request) int drm_addbufs_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_buf_desc_t *request = data; + struct drm_buf_desc *request = data; int err; if (request->flags & _DRM_AGP_BUFFER) @@ -909,7 +909,7 @@ int drm_addbufs_ioctl(struct drm_device *dev, void *data, int drm_infobufs(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_device_dma_t *dma = dev->dma; - drm_buf_info_t *request = data; + struct drm_buf_info *request = data; int i; int count; int retcode = 0; @@ -927,7 +927,7 @@ int drm_infobufs(struct drm_device *dev, void *data, struct drm_file *file_priv) if ( request->count >= count ) { for ( i = 0, count = 0 ; i < DRM_MAX_ORDER + 1 ; i++ ) { if ( dma->bufs[i].buf_count ) { - drm_buf_desc_t from; + struct drm_buf_desc from; from.count = dma->bufs[i].buf_count; from.size = dma->bufs[i].buf_size; @@ -935,7 +935,7 @@ int drm_infobufs(struct drm_device *dev, void *data, struct drm_file *file_priv) from.high_mark = dma->bufs[i].freelist.high_mark; if (DRM_COPY_TO_USER(&request->list[count], &from, - sizeof(drm_buf_desc_t)) != 0) { + sizeof(struct drm_buf_desc)) != 0) { retcode = EFAULT; break; } @@ -958,7 +958,7 @@ int drm_infobufs(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_markbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_device_dma_t *dma = dev->dma; - drm_buf_desc_t *request = data; + struct drm_buf_desc *request = data; int order; DRM_DEBUG( "%d, %d, %d\n", @@ -988,7 +988,7 @@ int drm_markbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_freebufs(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_device_dma_t *dma = dev->dma; - drm_buf_free_t *request = data; + struct drm_buf_free *request = data; int i; int idx; drm_buf_t *buf; @@ -1040,7 +1040,7 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) vaddr_t vaddr; #endif /* __NetBSD__ || __OpenBSD__ */ - drm_buf_map_t *request = data; + struct drm_buf_map *request = data; int i; #if defined(__NetBSD__) || defined(__OpenBSD__) diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index 6d44fbec..a621ca52 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -140,7 +140,7 @@ void drm_ctxbitmap_cleanup(struct drm_device *dev) int drm_getsareactx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_priv_map_t *request = data; + struct drm_ctx_priv_map *request = data; drm_local_map_t *map; DRM_LOCK(); @@ -161,7 +161,7 @@ int drm_getsareactx(struct drm_device *dev, void *data, int drm_setsareactx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_priv_map_t *request = data; + struct drm_ctx_priv_map *request = data; drm_local_map_t *map = NULL; DRM_LOCK(); @@ -221,8 +221,8 @@ int drm_context_switch_complete(struct drm_device *dev, int new) int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_res_t *res = data; - drm_ctx_t ctx; + struct drm_ctx_res *res = data; + struct drm_ctx ctx; int i; if ( res->count >= DRM_RESERVED_CONTEXTS ) { @@ -241,7 +241,7 @@ int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_addctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; ctx->handle = drm_ctxbitmap_next(dev); if ( ctx->handle == DRM_KERNEL_CONTEXT ) { @@ -272,7 +272,7 @@ int drm_modctx(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_getctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; /* This is 0, because we don't handle any context flags */ ctx->flags = 0; @@ -283,7 +283,7 @@ int drm_getctx(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_switchctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; DRM_DEBUG( "%d\n", ctx->handle ); return drm_context_switch(dev, dev->last_context, ctx->handle); @@ -291,7 +291,7 @@ int drm_switchctx(struct drm_device *dev, void *data, int drm_newctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; DRM_DEBUG( "%d\n", ctx->handle ); drm_context_switch_complete(dev, ctx->handle); @@ -301,7 +301,7 @@ int drm_newctx(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_rmctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_ctx_t *ctx = data; + struct drm_ctx *ctx = data; DRM_DEBUG( "%d\n", ctx->handle ); if ( ctx->handle != DRM_KERNEL_CONTEXT ) { diff --git a/bsd-core/drm_drawable.c b/bsd-core/drm_drawable.c index 1d85cb45..018db57d 100644 --- a/bsd-core/drm_drawable.c +++ b/bsd-core/drm_drawable.c @@ -68,7 +68,7 @@ drm_get_drawable_info(struct drm_device *dev, int handle) int drm_adddraw(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_draw_t *draw = data; + struct drm_draw *draw = data; struct bsd_drm_drawable_info *info; info = drm_calloc(1, sizeof(struct bsd_drm_drawable_info), @@ -89,7 +89,7 @@ int drm_adddraw(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_rmdraw(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_draw_t *draw = (drm_draw_t *)data; + struct drm_draw *draw = (struct drm_draw *)data; struct drm_drawable_info *info; DRM_SPINLOCK(&dev->drw_lock); diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 47c212e2..4c03b01d 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -682,7 +682,7 @@ static void drm_unload(struct drm_device *dev) int drm_version(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_version_t *version = data; + struct drm_version *version = data; int len; #define DRM_COPY( name, value ) \ diff --git a/bsd-core/drm_ioctl.c b/bsd-core/drm_ioctl.c index c00e63c2..5784be9f 100644 --- a/bsd-core/drm_ioctl.c +++ b/bsd-core/drm_ioctl.c @@ -44,7 +44,7 @@ int drm_getunique(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_unique_t *u = data; + struct drm_unique *u = data; if (u->unique_len >= dev->unique_len) { if (DRM_COPY_TO_USER(u->unique, dev->unique, dev->unique_len)) @@ -61,7 +61,7 @@ int drm_getunique(struct drm_device *dev, void *data, int drm_setunique(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_unique_t *u = data; + struct drm_unique *u = data; int domain, bus, slot, func, ret; char *busid; @@ -141,7 +141,7 @@ drm_set_busid(struct drm_device *dev) int drm_getmap(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_map_t *map = data; + struct drm_map *map = data; drm_local_map_t *mapinlist; int idx; int i = 0; @@ -178,7 +178,7 @@ int drm_getmap(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_getclient(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_client_t *client = data; + struct drm_client *client = data; drm_file_t *pt; int idx; int i = 0; @@ -205,10 +205,10 @@ int drm_getclient(struct drm_device *dev, void *data, int drm_getstats(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_stats_t *stats = data; + struct drm_stats *stats = data; int i; - memset(stats, 0, sizeof(drm_stats_t)); + memset(stats, 0, sizeof(struct drm_stats)); DRM_LOCK(); @@ -235,8 +235,8 @@ int drm_getstats(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_setversion(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_set_version_t *sv = data; - drm_set_version_t ver; + struct drm_set_version *sv = data; + struct drm_set_version ver; int if_version; /* Save the incoming data, and set the response before continuing diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index e1c50bb6..3d0cfeff 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -38,7 +38,7 @@ static void drm_locked_task(void *context, int pending __unused); int drm_irq_by_busid(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_irq_busid_t *irq = data; + struct drm_irq_busid *irq = data; if ((irq->busnum >> 8) != dev->pci_domain || (irq->busnum & 0xff) != dev->pci_bus || @@ -264,7 +264,7 @@ int drm_irq_uninstall(struct drm_device *dev) int drm_control(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_control_t *ctl = data; + struct drm_control *ctl = data; int err; switch ( ctl->func ) { @@ -412,7 +412,7 @@ out: int drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_wait_vblank_t *vblwait = data; + union drm_wait_vblank *vblwait = data; int ret = 0; int flags, seq, crtc; diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index 80ebb71d..0302ca0c 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -113,7 +113,7 @@ int drm_lock_free(struct drm_device *dev, int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_lock_t *lock = data; + struct drm_lock *lock = data; int ret = 0; if (lock->context == DRM_KERNEL_CONTEXT) { @@ -166,7 +166,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_lock_t *lock = data; + struct drm_lock *lock = data; if (lock->context == DRM_KERNEL_CONTEXT) { DRM_ERROR("Process %d using kernel context %d\n", diff --git a/bsd-core/drm_scatter.c b/bsd-core/drm_scatter.c index 3ebd4628..e26befc1 100644 --- a/bsd-core/drm_scatter.c +++ b/bsd-core/drm_scatter.c @@ -45,7 +45,7 @@ void drm_sg_cleanup(drm_sg_mem_t *entry) free(entry, M_DRM); } -int drm_sg_alloc(struct drm_device * dev, drm_scatter_gather_t * request) +int drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather * request) { drm_sg_mem_t *entry; unsigned long pages; @@ -101,7 +101,7 @@ int drm_sg_alloc(struct drm_device * dev, drm_scatter_gather_t * request) int drm_sg_alloc_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_scatter_gather_t *request = data; + struct drm_scatter_gather *request = data; int ret; DRM_DEBUG( "%s\n", __FUNCTION__ ); @@ -112,7 +112,7 @@ int drm_sg_alloc_ioctl(struct drm_device *dev, void *data, int drm_sg_free(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_scatter_gather_t *request = data; + struct drm_scatter_gather *request = data; drm_sg_mem_t *entry; DRM_LOCK(); diff --git a/bsd-core/drm_vm.c b/bsd-core/drm_vm.c index 9950c37e..e9c8702e 100644 --- a/bsd-core/drm_vm.c +++ b/bsd-core/drm_vm.c @@ -40,7 +40,7 @@ paddr_t drm_mmap(dev_t kdev, off_t offset, int prot) struct drm_device *dev = drm_get_device_from_kdev(kdev); drm_local_map_t *map; drm_file_t *priv; - drm_map_type_t type; + enum drm_map_type type; #ifdef __FreeBSD__ vm_paddr_t phys; #else diff --git a/shared-core/drm.h b/shared-core/drm.h index 94755e4b..bb332829 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -1095,7 +1095,7 @@ struct drm_gem_open { #define DRM_COMMAND_END 0xA0 /* typedef area */ -#if !defined(__KERNEL__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) +#ifndef __KERNEL__ typedef struct drm_clip_rect drm_clip_rect_t; typedef struct drm_tex_region drm_tex_region_t; typedef struct drm_hw_lock drm_hw_lock_t; -- cgit v1.2.3 From 2649103bf9c4eb471a10800f4a3161dca6249086 Mon Sep 17 00:00:00 2001 From: vehemens Date: Fri, 29 Aug 2008 13:18:54 -0400 Subject: [FreeBSD] Convert drm_driver to a pointer like linux. Signed-off-by: Robert Noland --- bsd-core/drmP.h | 2 +- bsd-core/drm_agpsupport.c | 4 +-- bsd-core/drm_bufs.c | 10 +++--- bsd-core/drm_context.c | 8 ++--- bsd-core/drm_dma.c | 4 +-- bsd-core/drm_drv.c | 70 +++++++++++++++++++------------------- bsd-core/drm_fops.c | 4 +-- bsd-core/drm_ioctl.c | 8 ++--- bsd-core/drm_irq.c | 20 +++++------ bsd-core/drm_lock.c | 6 ++-- bsd-core/drm_sysctl.c | 2 +- bsd-core/i915_drv.c | 77 ++++++++++++++++++++++++------------------ bsd-core/mach64_drv.c | 69 ++++++++++++++++++++++---------------- bsd-core/mga_drv.c | 77 ++++++++++++++++++++++++------------------ bsd-core/r128_drv.c | 73 +++++++++++++++++++++++----------------- bsd-core/radeon_drv.c | 85 +++++++++++++++++++++++++++-------------------- bsd-core/savage_drv.c | 59 +++++++++++++++++++------------- bsd-core/sis_drv.c | 47 ++++++++++++++++---------- bsd-core/tdfx_drv.c | 33 ++++++++++++------ bsd-core/via_drv.c | 71 +++++++++++++++++++++++---------------- 20 files changed, 423 insertions(+), 306 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 25f71f03..9d797d79 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -728,7 +728,7 @@ struct drm_device { struct device device; /* softc is an extension of struct device */ #endif - struct drm_driver_info driver; + struct drm_driver_info *driver; drm_pci_id_list_t *id_entry; /* PCI ID, name, and chipset private */ u_int16_t pci_device; /* PCI device id */ diff --git a/bsd-core/drm_agpsupport.c b/bsd-core/drm_agpsupport.c index 927e5ee8..62fa5d27 100644 --- a/bsd-core/drm_agpsupport.c +++ b/bsd-core/drm_agpsupport.c @@ -90,13 +90,13 @@ drm_device_find_capability(struct drm_device *dev, int cap) int drm_device_is_agp(struct drm_device *dev) { - if (dev->driver.device_is_agp != NULL) { + if (dev->driver->device_is_agp != NULL) { int ret; /* device_is_agp returns a tristate, 0 = not AGP, 1 = definitely * AGP, 2 = fall back to PCI capability */ - ret = (*dev->driver.device_is_agp)(dev); + ret = (*dev->driver->device_is_agp)(dev); if (ret != DRM_MIGHT_BE_AGP) return ret; } diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index 2d13087a..2b248e47 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -488,7 +488,7 @@ static int drm_do_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *reque buf->pending = 0; buf->file_priv = NULL; - buf->dev_priv_size = dev->driver.buf_priv_size; + buf->dev_priv_size = dev->driver->buf_priv_size; buf->dev_private = malloc(buf->dev_priv_size, M_DRM, M_NOWAIT | M_ZERO); if (buf->dev_private == NULL) { @@ -629,7 +629,7 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque buf->pending = 0; buf->file_priv = NULL; - buf->dev_priv_size = dev->driver.buf_priv_size; + buf->dev_priv_size = dev->driver->buf_priv_size; buf->dev_private = malloc(buf->dev_priv_size, M_DRM, M_NOWAIT | M_ZERO); if (buf->dev_private == NULL) { @@ -743,7 +743,7 @@ static int drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *reques buf->pending = 0; buf->file_priv = NULL; - buf->dev_priv_size = dev->driver.buf_priv_size; + buf->dev_priv_size = dev->driver->buf_priv_size; buf->dev_private = malloc(buf->dev_priv_size, M_DRM, M_NOWAIT | M_ZERO); if (buf->dev_private == NULL) { @@ -1061,8 +1061,8 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) if (request->count < dma->buf_count) goto done; - if ((dev->driver.use_agp && (dma->flags & _DRM_DMA_USE_AGP)) || - (dev->driver.use_sg && (dma->flags & _DRM_DMA_USE_SG))) { + if ((dev->driver->use_agp && (dma->flags & _DRM_DMA_USE_AGP)) || + (dev->driver->use_sg && (dma->flags & _DRM_DMA_USE_SG))) { drm_local_map_t *map = dev->agp_buffer_map; if (map == NULL) { diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index a621ca52..b85922e1 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -255,9 +255,9 @@ int drm_addctx(struct drm_device *dev, void *data, struct drm_file *file_priv) return ENOMEM; } - if (dev->driver.context_ctor && ctx->handle != DRM_KERNEL_CONTEXT) { + if (dev->driver->context_ctor && ctx->handle != DRM_KERNEL_CONTEXT) { DRM_LOCK(); - dev->driver.context_ctor(dev, ctx->handle); + dev->driver->context_ctor(dev, ctx->handle); DRM_UNLOCK(); } @@ -305,9 +305,9 @@ int drm_rmctx(struct drm_device *dev, void *data, struct drm_file *file_priv) DRM_DEBUG( "%d\n", ctx->handle ); if ( ctx->handle != DRM_KERNEL_CONTEXT ) { - if (dev->driver.context_dtor) { + if (dev->driver->context_dtor) { DRM_LOCK(); - dev->driver.context_dtor(dev, ctx->handle); + dev->driver->context_dtor(dev, ctx->handle); DRM_UNLOCK(); } diff --git a/bsd-core/drm_dma.c b/bsd-core/drm_dma.c index c2586fa0..cdfb986c 100644 --- a/bsd-core/drm_dma.c +++ b/bsd-core/drm_dma.c @@ -125,9 +125,9 @@ void drm_reclaim_buffers(struct drm_device *dev, struct drm_file *file_priv) int drm_dma(struct drm_device *dev, void *data, struct drm_file *file_priv) { - if (dev->driver.dma_ioctl) { + if (dev->driver->dma_ioctl) { /* shared code returns -errno */ - return -dev->driver.dma_ioctl(dev, data, file_priv); + return -dev->driver->dma_ioctl(dev, data, file_priv); } else { DRM_DEBUG("DMA ioctl on driver with no dma handler\n"); return EINVAL; diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 4c03b01d..2ad54b9a 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -343,7 +343,7 @@ void drm_attach(struct pci_attach_args *pa, dev_t kdev, id_entry = drm_find_description(PCI_VENDOR(pa->pa_id), PCI_PRODUCT(pa->pa_id), idlist); - dev->driver.pci_id_entry = id_entry; + dev->driver->pci_id_entry = id_entry; DRM_INFO("%s", id_entry->name); drm_load(dev); @@ -397,12 +397,12 @@ static int drm_firstopen(struct drm_device *dev) if (i != 0) return i; - if (dev->driver.firstopen) - dev->driver.firstopen(dev); + if (dev->driver->firstopen) + dev->driver->firstopen(dev); dev->buf_use = 0; - if (dev->driver.use_dma) { + if (dev->driver->use_dma) { i = drm_dma_setup(dev); if (i != 0) return i; @@ -440,8 +440,8 @@ static int drm_lastclose(struct drm_device *dev) DRM_DEBUG( "\n" ); - if (dev->driver.lastclose != NULL) - dev->driver.lastclose(dev); + if (dev->driver->lastclose != NULL) + dev->driver->lastclose(dev); if (dev->irq_enabled) drm_irq_uninstall(dev); @@ -545,10 +545,10 @@ static int drm_load(struct drm_device *dev) for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ ) atomic_set( &dev->counts[i], 0 ); - if (dev->driver.load != NULL) { + if (dev->driver->load != NULL) { DRM_LOCK(); /* Shared code returns -errno. */ - retcode = -dev->driver.load(dev, + retcode = -dev->driver->load(dev, dev->id_entry->driver_private); if (pci_enable_busmaster(dev->device)) DRM_ERROR("Request to enable bus-master failed.\n"); @@ -557,10 +557,10 @@ static int drm_load(struct drm_device *dev) goto error; } - if (dev->driver.use_agp) { + if (dev->driver->use_agp) { if (drm_device_is_agp(dev)) dev->agp = drm_agp_init(); - if (dev->driver.require_agp && dev->agp == NULL) { + if (dev->driver->require_agp && dev->agp == NULL) { DRM_ERROR("Card isn't AGP, or couldn't initialize " "AGP.\n"); retcode = ENOMEM; @@ -586,11 +586,11 @@ static int drm_load(struct drm_device *dev) } DRM_INFO("Initialized %s %d.%d.%d %s\n", - dev->driver.name, - dev->driver.major, - dev->driver.minor, - dev->driver.patchlevel, - dev->driver.date); + dev->driver->name, + dev->driver->major, + dev->driver->minor, + dev->driver->patchlevel, + dev->driver->date); return 0; @@ -657,9 +657,9 @@ static void drm_unload(struct drm_device *dev) dev->agp = NULL; } - if (dev->driver.unload != NULL) { + if (dev->driver->unload != NULL) { DRM_LOCK(); - dev->driver.unload(dev); + dev->driver->unload(dev); DRM_UNLOCK(); } @@ -694,13 +694,13 @@ int drm_version(struct drm_device *dev, void *data, struct drm_file *file_priv) return EFAULT; \ } - version->version_major = dev->driver.major; - version->version_minor = dev->driver.minor; - version->version_patchlevel = dev->driver.patchlevel; + version->version_major = dev->driver->major; + version->version_minor = dev->driver->minor; + version->version_patchlevel = dev->driver->patchlevel; - DRM_COPY(version->name, dev->driver.name); - DRM_COPY(version->date, dev->driver.date); - DRM_COPY(version->desc, dev->driver.desc); + DRM_COPY(version->name, dev->driver->name); + DRM_COPY(version->date, dev->driver->date); + DRM_COPY(version->desc, dev->driver->desc); return 0; } @@ -750,8 +750,8 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) if (--file_priv->refs != 0) goto done; - if (dev->driver.preclose != NULL) - dev->driver.preclose(dev, file_priv); + if (dev->driver->preclose != NULL) + dev->driver->preclose(dev, file_priv); /* ======================================================== * Begin inline drm_release @@ -770,8 +770,8 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) DRM_DEBUG("Process %d dead, freeing lock for context %d\n", DRM_CURRENTPID, _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock)); - if (dev->driver.reclaim_buffers_locked != NULL) - dev->driver.reclaim_buffers_locked(dev, file_priv); + if (dev->driver->reclaim_buffers_locked != NULL) + dev->driver->reclaim_buffers_locked(dev, file_priv); drm_lock_free(dev, &dev->lock.hw_lock->lock, _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock)); @@ -780,7 +780,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) hardware at this point, possibly processed via a callback to the X server. */ - } else if (dev->driver.reclaim_buffers_locked != NULL && + } else if (dev->driver->reclaim_buffers_locked != NULL && dev->lock.hw_lock != NULL) { /* The lock is required to reclaim buffers */ for (;;) { @@ -808,13 +808,13 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) break; } if (retcode == 0) { - dev->driver.reclaim_buffers_locked(dev, file_priv); + dev->driver->reclaim_buffers_locked(dev, file_priv); drm_lock_free(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT); } } - if (dev->driver.use_dma && !dev->driver.reclaim_buffers_locked) + if (dev->driver->use_dma && !dev->driver->reclaim_buffers_locked) drm_reclaim_buffers(dev, file_priv); #if defined (__FreeBSD__) && (__FreeBSD_version >= 500000) @@ -825,8 +825,8 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) dev->buf_pgid = 0; #endif /* __NetBSD__ || __OpenBSD__ */ - if (dev->driver.postclose != NULL) - dev->driver.postclose(dev, file_priv); + if (dev->driver->postclose != NULL) + dev->driver->postclose(dev, file_priv); TAILQ_REMOVE(&dev->files, file_priv, link); free(file_priv, M_DRM); @@ -920,12 +920,12 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, if (ioctl->func == NULL && nr >= DRM_COMMAND_BASE) { /* The array entries begin at DRM_COMMAND_BASE ioctl nr */ nr -= DRM_COMMAND_BASE; - if (nr > dev->driver.max_ioctl) { + if (nr > dev->driver->max_ioctl) { DRM_DEBUG("Bad driver ioctl number, 0x%x (of 0x%x)\n", - nr, dev->driver.max_ioctl); + nr, dev->driver->max_ioctl); return EINVAL; } - ioctl = &dev->driver.ioctls[nr]; + ioctl = &dev->driver->ioctls[nr]; is_driver_ioctl = 1; } func = ioctl->func; diff --git a/bsd-core/drm_fops.c b/bsd-core/drm_fops.c index 062b1d59..248e7937 100644 --- a/bsd-core/drm_fops.c +++ b/bsd-core/drm_fops.c @@ -94,9 +94,9 @@ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p, /* for compatibility root is always authenticated */ priv->authenticated = DRM_SUSER(p); - if (dev->driver.open) { + if (dev->driver->open) { /* shared code returns -errno */ - retcode = -dev->driver.open(dev, priv); + retcode = -dev->driver->open(dev, priv); if (retcode != 0) { free(priv, M_DRM); DRM_UNLOCK(); diff --git a/bsd-core/drm_ioctl.c b/bsd-core/drm_ioctl.c index 5784be9f..26919982 100644 --- a/bsd-core/drm_ioctl.c +++ b/bsd-core/drm_ioctl.c @@ -245,8 +245,8 @@ int drm_setversion(struct drm_device *dev, void *data, ver = *sv; sv->drm_di_major = DRM_IF_MAJOR; sv->drm_di_minor = DRM_IF_MINOR; - sv->drm_dd_major = dev->driver.major; - sv->drm_dd_minor = dev->driver.minor; + sv->drm_dd_major = dev->driver->major; + sv->drm_dd_minor = dev->driver->minor; if (ver.drm_di_major != -1) { if (ver.drm_di_major != DRM_IF_MAJOR || @@ -265,9 +265,9 @@ int drm_setversion(struct drm_device *dev, void *data, } if (ver.drm_dd_major != -1) { - if (ver.drm_dd_major != dev->driver.major || + if (ver.drm_dd_major != dev->driver->major || ver.drm_dd_minor < 0 || - ver.drm_dd_minor > dev->driver.minor) + ver.drm_dd_minor > dev->driver->minor) { return EINVAL; } diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index 3d0cfeff..6d7d1265 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -61,7 +61,7 @@ drm_irq_handler_wrap(DRM_IRQ_ARGS) struct drm_device *dev = arg; DRM_SPINLOCK(&dev->irq_lock); - dev->driver.irq_handler(arg); + dev->driver->irq_handler(arg); DRM_SPINUNLOCK(&dev->irq_lock); } #endif @@ -90,8 +90,8 @@ static void vblank_disable_fn(void *arg) dev->vblank[i].enabled) { DRM_DEBUG("disabling vblank on crtc %d\n", i); dev->vblank[i].last = - dev->driver.get_vblank_counter(dev, i); - dev->driver.disable_vblank(dev, i); + dev->driver->get_vblank_counter(dev, i); + dev->driver->disable_vblank(dev, i); dev->vblank[i].enabled = 0; } } @@ -173,7 +173,7 @@ int drm_irq_install(struct drm_device *dev) dev->context_flag = 0; /* Before installing handler */ - dev->driver.irq_preinstall(dev); + dev->driver->irq_preinstall(dev); DRM_UNLOCK(); /* Install handler */ @@ -211,7 +211,7 @@ int drm_irq_install(struct drm_device *dev) /* After installing handler */ DRM_LOCK(); - dev->driver.irq_postinstall(dev); + dev->driver->irq_postinstall(dev); DRM_UNLOCK(); TASK_INIT(&dev->locked_task, 0, drm_locked_task, dev); @@ -247,7 +247,7 @@ int drm_irq_uninstall(struct drm_device *dev) DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, dev->irq ); - dev->driver.irq_uninstall(dev); + dev->driver->irq_uninstall(dev); #ifdef __FreeBSD__ DRM_UNLOCK(); @@ -272,14 +272,14 @@ int drm_control(struct drm_device *dev, void *data, struct drm_file *file_priv) /* Handle drivers whose DRM used to require IRQ setup but the * no longer does. */ - if (!dev->driver.use_irq) + if (!dev->driver->use_irq) return 0; if (dev->if_version < DRM_IF_VERSION(1, 2) && ctl->irq != dev->irq) return EINVAL; return drm_irq_install(dev); case DRM_UNINST_HANDLER: - if (!dev->driver.use_irq) + if (!dev->driver->use_irq) return 0; DRM_LOCK(); err = drm_irq_uninstall(dev); @@ -306,7 +306,7 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc) * here if the register is small or we had vblank interrupts off for * a long time. */ - cur_vblank = dev->driver.get_vblank_counter(dev, crtc); + cur_vblank = dev->driver->get_vblank_counter(dev, crtc); diff = cur_vblank - dev->vblank[crtc].last; if (cur_vblank < dev->vblank[crtc].last) { diff += dev->max_vblank_count; @@ -331,7 +331,7 @@ int drm_vblank_get(struct drm_device *dev, int crtc) atomic_add_acq_int(&dev->vblank[crtc].refcount, 1); if (dev->vblank[crtc].refcount == 1 && !dev->vblank[crtc].enabled) { - ret = dev->driver.enable_vblank(dev, crtc); + ret = dev->driver->enable_vblank(dev, crtc); if (ret) atomic_dec(&dev->vblank[crtc].refcount); else { diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index 0302ca0c..cb8875b8 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -126,7 +126,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) lock->context, DRM_CURRENTPID, dev->lock.hw_lock->lock, lock->flags); - if (dev->driver.use_dma_queue && lock->context < 0) + if (dev->driver->use_dma_queue && lock->context < 0) return EINVAL; DRM_LOCK(); @@ -157,9 +157,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) /* XXX: Add signal blocking here */ - if (dev->driver.dma_quiescent != NULL && + if (dev->driver->dma_quiescent != NULL && (lock->flags & _DRM_LOCK_QUIESCENT)) - dev->driver.dma_quiescent(dev); + dev->driver->dma_quiescent(dev); return 0; } diff --git a/bsd-core/drm_sysctl.c b/bsd-core/drm_sysctl.c index a6adf0fc..4c281fe3 100644 --- a/bsd-core/drm_sysctl.c +++ b/bsd-core/drm_sysctl.c @@ -132,7 +132,7 @@ static int drm_name_info DRM_SYSCTL_HANDLER_ARGS int retcode; int hasunique = 0; - DRM_SYSCTL_PRINT("%s 0x%x", dev->driver.name, dev2udev(dev->devnode)); + DRM_SYSCTL_PRINT("%s 0x%x", dev->driver->name, dev2udev(dev->devnode)); DRM_LOCK(); if (dev->unique) { diff --git a/bsd-core/i915_drv.c b/bsd-core/i915_drv.c index c19ef5db..d2301ddd 100644 --- a/bsd-core/i915_drv.c +++ b/bsd-core/i915_drv.c @@ -68,37 +68,37 @@ static int i915_resume(device_t nbdev) static void i915_configure(struct drm_device *dev) { - dev->driver.buf_priv_size = sizeof(drm_i915_private_t); - dev->driver.load = i915_driver_load; - dev->driver.unload = i915_driver_unload; - dev->driver.firstopen = i915_driver_firstopen; - dev->driver.preclose = i915_driver_preclose; - dev->driver.lastclose = i915_driver_lastclose; - dev->driver.device_is_agp = i915_driver_device_is_agp; - dev->driver.get_vblank_counter = i915_get_vblank_counter; - dev->driver.enable_vblank = i915_enable_vblank; - dev->driver.disable_vblank = i915_disable_vblank; - dev->driver.irq_preinstall = i915_driver_irq_preinstall; - dev->driver.irq_postinstall = i915_driver_irq_postinstall; - dev->driver.irq_uninstall = i915_driver_irq_uninstall; - dev->driver.irq_handler = i915_driver_irq_handler; - - dev->driver.ioctls = i915_ioctls; - dev->driver.max_ioctl = i915_max_ioctl; - - dev->driver.name = DRIVER_NAME; - dev->driver.desc = DRIVER_DESC; - dev->driver.date = DRIVER_DATE; - dev->driver.major = DRIVER_MAJOR; - dev->driver.minor = DRIVER_MINOR; - dev->driver.patchlevel = DRIVER_PATCHLEVEL; - - dev->driver.use_agp = 1; - dev->driver.require_agp = 1; - dev->driver.use_mtrr = 1; - dev->driver.use_irq = 1; - dev->driver.use_vbl_irq = 1; - dev->driver.use_vbl_irq2 = 1; + dev->driver->buf_priv_size = sizeof(drm_i915_private_t); + dev->driver->load = i915_driver_load; + dev->driver->unload = i915_driver_unload; + dev->driver->firstopen = i915_driver_firstopen; + dev->driver->preclose = i915_driver_preclose; + dev->driver->lastclose = i915_driver_lastclose; + dev->driver->device_is_agp = i915_driver_device_is_agp; + dev->driver->get_vblank_counter = i915_get_vblank_counter; + dev->driver->enable_vblank = i915_enable_vblank; + dev->driver->disable_vblank = i915_disable_vblank; + dev->driver->irq_preinstall = i915_driver_irq_preinstall; + dev->driver->irq_postinstall = i915_driver_irq_postinstall; + dev->driver->irq_uninstall = i915_driver_irq_uninstall; + dev->driver->irq_handler = i915_driver_irq_handler; + + dev->driver->ioctls = i915_ioctls; + dev->driver->max_ioctl = i915_max_ioctl; + + dev->driver->name = DRIVER_NAME; + dev->driver->desc = DRIVER_DESC; + dev->driver->date = DRIVER_DATE; + dev->driver->major = DRIVER_MAJOR; + dev->driver->minor = DRIVER_MINOR; + dev->driver->patchlevel = DRIVER_PATCHLEVEL; + + dev->driver->use_agp = 1; + dev->driver->require_agp = 1; + dev->driver->use_mtrr = 1; + dev->driver->use_irq = 1; + dev->driver->use_vbl_irq = 1; + dev->driver->use_vbl_irq2 = 1; } #ifdef __FreeBSD__ @@ -114,17 +114,30 @@ i915_attach(device_t nbdev) struct drm_device *dev = device_get_softc(nbdev); bzero(dev, sizeof(struct drm_device)); + + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); i915_configure(dev); + return drm_attach(nbdev, i915_pciidlist); } +static int +i915_detach(device_t nbdev) +{ + struct drm_device *dev = device_get_softc(nbdev); + + free(dev->driver, M_DRM); + + return drm_detach(nbdev); +} + static device_method_t i915_methods[] = { /* Device interface */ DEVMETHOD(device_probe, i915_probe), DEVMETHOD(device_attach, i915_attach), DEVMETHOD(device_suspend, i915_suspend), DEVMETHOD(device_resume, i915_resume), - DEVMETHOD(device_detach, drm_detach), + DEVMETHOD(device_detach, i915_detach), { 0, 0 } }; diff --git a/bsd-core/mach64_drv.c b/bsd-core/mach64_drv.c index 06e0133d..726b7d24 100644 --- a/bsd-core/mach64_drv.c +++ b/bsd-core/mach64_drv.c @@ -46,33 +46,33 @@ static drm_pci_id_list_t mach64_pciidlist[] = { static void mach64_configure(struct drm_device *dev) { - dev->driver.buf_priv_size = 1; /* No dev_priv */ - dev->driver.lastclose = mach64_driver_lastclose; - dev->driver.get_vblank_counter = mach64_get_vblank_counter; - dev->driver.enable_vblank = mach64_enable_vblank; - dev->driver.disable_vblank = mach64_disable_vblank; - dev->driver.irq_preinstall = mach64_driver_irq_preinstall; - dev->driver.irq_postinstall = mach64_driver_irq_postinstall; - dev->driver.irq_uninstall = mach64_driver_irq_uninstall; - dev->driver.irq_handler = mach64_driver_irq_handler; - dev->driver.dma_ioctl = mach64_dma_buffers; - - dev->driver.ioctls = mach64_ioctls; - dev->driver.max_ioctl = mach64_max_ioctl; - - dev->driver.name = DRIVER_NAME; - dev->driver.desc = DRIVER_DESC; - dev->driver.date = DRIVER_DATE; - dev->driver.major = DRIVER_MAJOR; - dev->driver.minor = DRIVER_MINOR; - dev->driver.patchlevel = DRIVER_PATCHLEVEL; - - dev->driver.use_agp = 1; - dev->driver.use_mtrr = 1; - dev->driver.use_pci_dma = 1; - dev->driver.use_dma = 1; - dev->driver.use_irq = 1; - dev->driver.use_vbl_irq = 1; + dev->driver->buf_priv_size = 1; /* No dev_priv */ + dev->driver->lastclose = mach64_driver_lastclose; + dev->driver->get_vblank_counter = mach64_get_vblank_counter; + dev->driver->enable_vblank = mach64_enable_vblank; + dev->driver->disable_vblank = mach64_disable_vblank; + dev->driver->irq_preinstall = mach64_driver_irq_preinstall; + dev->driver->irq_postinstall = mach64_driver_irq_postinstall; + dev->driver->irq_uninstall = mach64_driver_irq_uninstall; + dev->driver->irq_handler = mach64_driver_irq_handler; + dev->driver->dma_ioctl = mach64_dma_buffers; + + dev->driver->ioctls = mach64_ioctls; + dev->driver->max_ioctl = mach64_max_ioctl; + + dev->driver->name = DRIVER_NAME; + dev->driver->desc = DRIVER_DESC; + dev->driver->date = DRIVER_DATE; + dev->driver->major = DRIVER_MAJOR; + dev->driver->minor = DRIVER_MINOR; + dev->driver->patchlevel = DRIVER_PATCHLEVEL; + + dev->driver->use_agp = 1; + dev->driver->use_mtrr = 1; + dev->driver->use_pci_dma = 1; + dev->driver->use_dma = 1; + dev->driver->use_irq = 1; + dev->driver->use_vbl_irq = 1; } #ifdef __FreeBSD__ @@ -88,15 +88,28 @@ mach64_attach(device_t nbdev) struct drm_device *dev = device_get_softc(nbdev); bzero(dev, sizeof(struct drm_device)); + + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); mach64_configure(dev); + return drm_attach(nbdev, mach64_pciidlist); } +static int +mach64_detach(device_t nbdev) +{ + struct drm_device *dev = device_get_softc(nbdev); + + free(dev->driver, M_DRM); + + return drm_detach(nbdev); +} + static device_method_t mach64_methods[] = { /* Device interface */ DEVMETHOD(device_probe, mach64_probe), DEVMETHOD(device_attach, mach64_attach), - DEVMETHOD(device_detach, drm_detach), + DEVMETHOD(device_detach, mach64_detach), { 0, 0 } }; diff --git a/bsd-core/mga_drv.c b/bsd-core/mga_drv.c index 15d8175c..0e434b56 100644 --- a/bsd-core/mga_drv.c +++ b/bsd-core/mga_drv.c @@ -86,37 +86,37 @@ static int mga_driver_device_is_agp(struct drm_device * dev) static void mga_configure(struct drm_device *dev) { - dev->driver.buf_priv_size = sizeof(drm_mga_buf_priv_t); - dev->driver.load = mga_driver_load; - dev->driver.unload = mga_driver_unload; - dev->driver.lastclose = mga_driver_lastclose; - dev->driver.get_vblank_counter = mga_get_vblank_counter; - dev->driver.enable_vblank = mga_enable_vblank; - dev->driver.disable_vblank = mga_disable_vblank; - dev->driver.irq_preinstall = mga_driver_irq_preinstall; - dev->driver.irq_postinstall = mga_driver_irq_postinstall; - dev->driver.irq_uninstall = mga_driver_irq_uninstall; - dev->driver.irq_handler = mga_driver_irq_handler; - dev->driver.dma_ioctl = mga_dma_buffers; - dev->driver.dma_quiescent = mga_driver_dma_quiescent; - dev->driver.device_is_agp = mga_driver_device_is_agp; - - dev->driver.ioctls = mga_ioctls; - dev->driver.max_ioctl = mga_max_ioctl; - - dev->driver.name = DRIVER_NAME; - dev->driver.desc = DRIVER_DESC; - dev->driver.date = DRIVER_DATE; - dev->driver.major = DRIVER_MAJOR; - dev->driver.minor = DRIVER_MINOR; - dev->driver.patchlevel = DRIVER_PATCHLEVEL; - - dev->driver.use_agp = 1; - dev->driver.require_agp = 1; - dev->driver.use_mtrr = 1; - dev->driver.use_dma = 1; - dev->driver.use_irq = 1; - dev->driver.use_vbl_irq = 1; + dev->driver->buf_priv_size = sizeof(drm_mga_buf_priv_t); + dev->driver->load = mga_driver_load; + dev->driver->unload = mga_driver_unload; + dev->driver->lastclose = mga_driver_lastclose; + dev->driver->get_vblank_counter = mga_get_vblank_counter; + dev->driver->enable_vblank = mga_enable_vblank; + dev->driver->disable_vblank = mga_disable_vblank; + dev->driver->irq_preinstall = mga_driver_irq_preinstall; + dev->driver->irq_postinstall = mga_driver_irq_postinstall; + dev->driver->irq_uninstall = mga_driver_irq_uninstall; + dev->driver->irq_handler = mga_driver_irq_handler; + dev->driver->dma_ioctl = mga_dma_buffers; + dev->driver->dma_quiescent = mga_driver_dma_quiescent; + dev->driver->device_is_agp = mga_driver_device_is_agp; + + dev->driver->ioctls = mga_ioctls; + dev->driver->max_ioctl = mga_max_ioctl; + + dev->driver->name = DRIVER_NAME; + dev->driver->desc = DRIVER_DESC; + dev->driver->date = DRIVER_DATE; + dev->driver->major = DRIVER_MAJOR; + dev->driver->minor = DRIVER_MINOR; + dev->driver->patchlevel = DRIVER_PATCHLEVEL; + + dev->driver->use_agp = 1; + dev->driver->require_agp = 1; + dev->driver->use_mtrr = 1; + dev->driver->use_dma = 1; + dev->driver->use_irq = 1; + dev->driver->use_vbl_irq = 1; } @@ -134,15 +134,28 @@ mga_attach(device_t nbdev) struct drm_device *dev = device_get_softc(nbdev); bzero(dev, sizeof(struct drm_device)); + + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); mga_configure(dev); + return drm_attach(nbdev, mga_pciidlist); } +static int +mga_detach(device_t nbdev) +{ + struct drm_device *dev = device_get_softc(nbdev); + + free(dev->driver, M_DRM); + + return drm_detach(nbdev); +} + static device_method_t mga_methods[] = { /* Device interface */ DEVMETHOD(device_probe, mga_probe), DEVMETHOD(device_attach, mga_attach), - DEVMETHOD(device_detach, drm_detach), + DEVMETHOD(device_detach, mga_detach), { 0, 0 } }; diff --git a/bsd-core/r128_drv.c b/bsd-core/r128_drv.c index b149d512..d93c746d 100644 --- a/bsd-core/r128_drv.c +++ b/bsd-core/r128_drv.c @@ -44,35 +44,35 @@ static drm_pci_id_list_t r128_pciidlist[] = { static void r128_configure(struct drm_device *dev) { - dev->driver.buf_priv_size = sizeof(drm_r128_buf_priv_t); - dev->driver.preclose = r128_driver_preclose; - dev->driver.lastclose = r128_driver_lastclose; - dev->driver.get_vblank_counter = r128_get_vblank_counter; - dev->driver.enable_vblank = r128_enable_vblank; - dev->driver.disable_vblank = r128_disable_vblank; - dev->driver.irq_preinstall = r128_driver_irq_preinstall; - dev->driver.irq_postinstall = r128_driver_irq_postinstall; - dev->driver.irq_uninstall = r128_driver_irq_uninstall; - dev->driver.irq_handler = r128_driver_irq_handler; - dev->driver.dma_ioctl = r128_cce_buffers; - - dev->driver.ioctls = r128_ioctls; - dev->driver.max_ioctl = r128_max_ioctl; - - dev->driver.name = DRIVER_NAME; - dev->driver.desc = DRIVER_DESC; - dev->driver.date = DRIVER_DATE; - dev->driver.major = DRIVER_MAJOR; - dev->driver.minor = DRIVER_MINOR; - dev->driver.patchlevel = DRIVER_PATCHLEVEL; - - dev->driver.use_agp = 1; - dev->driver.use_mtrr = 1; - dev->driver.use_pci_dma = 1; - dev->driver.use_sg = 1; - dev->driver.use_dma = 1; - dev->driver.use_irq = 1; - dev->driver.use_vbl_irq = 1; + dev->driver->buf_priv_size = sizeof(drm_r128_buf_priv_t); + dev->driver->preclose = r128_driver_preclose; + dev->driver->lastclose = r128_driver_lastclose; + dev->driver->get_vblank_counter = r128_get_vblank_counter; + dev->driver->enable_vblank = r128_enable_vblank; + dev->driver->disable_vblank = r128_disable_vblank; + dev->driver->irq_preinstall = r128_driver_irq_preinstall; + dev->driver->irq_postinstall = r128_driver_irq_postinstall; + dev->driver->irq_uninstall = r128_driver_irq_uninstall; + dev->driver->irq_handler = r128_driver_irq_handler; + dev->driver->dma_ioctl = r128_cce_buffers; + + dev->driver->ioctls = r128_ioctls; + dev->driver->max_ioctl = r128_max_ioctl; + + dev->driver->name = DRIVER_NAME; + dev->driver->desc = DRIVER_DESC; + dev->driver->date = DRIVER_DATE; + dev->driver->major = DRIVER_MAJOR; + dev->driver->minor = DRIVER_MINOR; + dev->driver->patchlevel = DRIVER_PATCHLEVEL; + + dev->driver->use_agp = 1; + dev->driver->use_mtrr = 1; + dev->driver->use_pci_dma = 1; + dev->driver->use_sg = 1; + dev->driver->use_dma = 1; + dev->driver->use_irq = 1; + dev->driver->use_vbl_irq = 1; } #ifdef __FreeBSD__ @@ -88,15 +88,28 @@ r128_attach(device_t nbdev) struct drm_device *dev = device_get_softc(nbdev); bzero(dev, sizeof(struct drm_device)); + + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); r128_configure(dev); + return drm_attach(nbdev, r128_pciidlist); } +static int +r128_detach(device_t nbdev) +{ + struct drm_device *dev = device_get_softc(nbdev); + + free(dev->driver, M_DRM); + + return drm_detach(nbdev); +} + static device_method_t r128_methods[] = { /* Device interface */ DEVMETHOD(device_probe, r128_probe), DEVMETHOD(device_attach, r128_attach), - DEVMETHOD(device_detach, drm_detach), + DEVMETHOD(device_detach, r128_detach), { 0, 0 } }; diff --git a/bsd-core/radeon_drv.c b/bsd-core/radeon_drv.c index 0b4dba18..eea04ff9 100644 --- a/bsd-core/radeon_drv.c +++ b/bsd-core/radeon_drv.c @@ -44,41 +44,41 @@ static drm_pci_id_list_t radeon_pciidlist[] = { static void radeon_configure(struct drm_device *dev) { - dev->driver.buf_priv_size = sizeof(drm_radeon_buf_priv_t); - dev->driver.load = radeon_driver_load; - dev->driver.unload = radeon_driver_unload; - dev->driver.firstopen = radeon_driver_firstopen; - dev->driver.open = radeon_driver_open; - dev->driver.preclose = radeon_driver_preclose; - dev->driver.postclose = radeon_driver_postclose; - dev->driver.lastclose = radeon_driver_lastclose; - dev->driver.get_vblank_counter = radeon_get_vblank_counter; - dev->driver.enable_vblank = radeon_enable_vblank; - dev->driver.disable_vblank = radeon_disable_vblank; - dev->driver.irq_preinstall = radeon_driver_irq_preinstall; - dev->driver.irq_postinstall = radeon_driver_irq_postinstall; - dev->driver.irq_uninstall = radeon_driver_irq_uninstall; - dev->driver.irq_handler = radeon_driver_irq_handler; - dev->driver.dma_ioctl = radeon_cp_buffers; - - dev->driver.ioctls = radeon_ioctls; - dev->driver.max_ioctl = radeon_max_ioctl; - - dev->driver.name = DRIVER_NAME; - dev->driver.desc = DRIVER_DESC; - dev->driver.date = DRIVER_DATE; - dev->driver.major = DRIVER_MAJOR; - dev->driver.minor = DRIVER_MINOR; - dev->driver.patchlevel = DRIVER_PATCHLEVEL; - - dev->driver.use_agp = 1; - dev->driver.use_mtrr = 1; - dev->driver.use_pci_dma = 1; - dev->driver.use_sg = 1; - dev->driver.use_dma = 1; - dev->driver.use_irq = 1; - dev->driver.use_vbl_irq = 1; - dev->driver.use_vbl_irq2 = 1; + dev->driver->buf_priv_size = sizeof(drm_radeon_buf_priv_t); + dev->driver->load = radeon_driver_load; + dev->driver->unload = radeon_driver_unload; + dev->driver->firstopen = radeon_driver_firstopen; + dev->driver->open = radeon_driver_open; + dev->driver->preclose = radeon_driver_preclose; + dev->driver->postclose = radeon_driver_postclose; + dev->driver->lastclose = radeon_driver_lastclose; + dev->driver->get_vblank_counter = radeon_get_vblank_counter; + dev->driver->enable_vblank = radeon_enable_vblank; + dev->driver->disable_vblank = radeon_disable_vblank; + dev->driver->irq_preinstall = radeon_driver_irq_preinstall; + dev->driver->irq_postinstall = radeon_driver_irq_postinstall; + dev->driver->irq_uninstall = radeon_driver_irq_uninstall; + dev->driver->irq_handler = radeon_driver_irq_handler; + dev->driver->dma_ioctl = radeon_cp_buffers; + + dev->driver->ioctls = radeon_ioctls; + dev->driver->max_ioctl = radeon_max_ioctl; + + dev->driver->name = DRIVER_NAME; + dev->driver->desc = DRIVER_DESC; + dev->driver->date = DRIVER_DATE; + dev->driver->major = DRIVER_MAJOR; + dev->driver->minor = DRIVER_MINOR; + dev->driver->patchlevel = DRIVER_PATCHLEVEL; + + dev->driver->use_agp = 1; + dev->driver->use_mtrr = 1; + dev->driver->use_pci_dma = 1; + dev->driver->use_sg = 1; + dev->driver->use_dma = 1; + dev->driver->use_irq = 1; + dev->driver->use_vbl_irq = 1; + dev->driver->use_vbl_irq2 = 1; } #ifdef __FreeBSD__ @@ -94,15 +94,28 @@ radeon_attach(device_t nbdev) struct drm_device *dev = device_get_softc(nbdev); bzero(dev, sizeof(struct drm_device)); + + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); radeon_configure(dev); + return drm_attach(nbdev, radeon_pciidlist); } +static int +radeon_detach(device_t nbdev) +{ + struct drm_device *dev = device_get_softc(nbdev); + + free(dev->driver, M_DRM); + + return drm_detach(nbdev); +} + static device_method_t radeon_methods[] = { /* Device interface */ DEVMETHOD(device_probe, radeon_probe), DEVMETHOD(device_attach, radeon_attach), - DEVMETHOD(device_detach, drm_detach), + DEVMETHOD(device_detach, radeon_detach), { 0, 0 } }; diff --git a/bsd-core/savage_drv.c b/bsd-core/savage_drv.c index 6235bcd1..ee5166a3 100644 --- a/bsd-core/savage_drv.c +++ b/bsd-core/savage_drv.c @@ -39,28 +39,28 @@ static drm_pci_id_list_t savage_pciidlist[] = { static void savage_configure(struct drm_device *dev) { - dev->driver.buf_priv_size = sizeof(drm_savage_buf_priv_t); - dev->driver.load = savage_driver_load; - dev->driver.firstopen = savage_driver_firstopen; - dev->driver.lastclose = savage_driver_lastclose; - dev->driver.unload = savage_driver_unload; - dev->driver.reclaim_buffers_locked = savage_reclaim_buffers; - dev->driver.dma_ioctl = savage_bci_buffers; - - dev->driver.ioctls = savage_ioctls; - dev->driver.max_ioctl = savage_max_ioctl; - - dev->driver.name = DRIVER_NAME; - dev->driver.desc = DRIVER_DESC; - dev->driver.date = DRIVER_DATE; - dev->driver.major = DRIVER_MAJOR; - dev->driver.minor = DRIVER_MINOR; - dev->driver.patchlevel = DRIVER_PATCHLEVEL; - - dev->driver.use_agp = 1; - dev->driver.use_mtrr = 1; - dev->driver.use_pci_dma = 1; - dev->driver.use_dma = 1; + dev->driver->buf_priv_size = sizeof(drm_savage_buf_priv_t); + dev->driver->load = savage_driver_load; + dev->driver->firstopen = savage_driver_firstopen; + dev->driver->lastclose = savage_driver_lastclose; + dev->driver->unload = savage_driver_unload; + dev->driver->reclaim_buffers_locked = savage_reclaim_buffers; + dev->driver->dma_ioctl = savage_bci_buffers; + + dev->driver->ioctls = savage_ioctls; + dev->driver->max_ioctl = savage_max_ioctl; + + dev->driver->name = DRIVER_NAME; + dev->driver->desc = DRIVER_DESC; + dev->driver->date = DRIVER_DATE; + dev->driver->major = DRIVER_MAJOR; + dev->driver->minor = DRIVER_MINOR; + dev->driver->patchlevel = DRIVER_PATCHLEVEL; + + dev->driver->use_agp = 1; + dev->driver->use_mtrr = 1; + dev->driver->use_pci_dma = 1; + dev->driver->use_dma = 1; } #ifdef __FreeBSD__ @@ -76,15 +76,28 @@ savage_attach(device_t nbdev) struct drm_device *dev = device_get_softc(nbdev); bzero(dev, sizeof(struct drm_device)); + + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); savage_configure(dev); + return drm_attach(nbdev, savage_pciidlist); } +static int +savage_detach(device_t nbdev) +{ + struct drm_device *dev = device_get_softc(nbdev); + + free(dev->driver, M_DRM); + + return drm_detach(nbdev); +} + static device_method_t savage_methods[] = { /* Device interface */ DEVMETHOD(device_probe, savage_probe), DEVMETHOD(device_attach, savage_attach), - DEVMETHOD(device_detach, drm_detach), + DEVMETHOD(device_detach, savage_detach), { 0, 0 } }; diff --git a/bsd-core/sis_drv.c b/bsd-core/sis_drv.c index 9f76a689..a9637763 100644 --- a/bsd-core/sis_drv.c +++ b/bsd-core/sis_drv.c @@ -38,22 +38,22 @@ static drm_pci_id_list_t sis_pciidlist[] = { static void sis_configure(struct drm_device *dev) { - dev->driver.buf_priv_size = 1; /* No dev_priv */ - dev->driver.context_ctor = sis_init_context; - dev->driver.context_dtor = sis_final_context; - - dev->driver.ioctls = sis_ioctls; - dev->driver.max_ioctl = sis_max_ioctl; - - dev->driver.name = DRIVER_NAME; - dev->driver.desc = DRIVER_DESC; - dev->driver.date = DRIVER_DATE; - dev->driver.major = DRIVER_MAJOR; - dev->driver.minor = DRIVER_MINOR; - dev->driver.patchlevel = DRIVER_PATCHLEVEL; - - dev->driver.use_agp = 1; - dev->driver.use_mtrr = 1; + dev->driver->buf_priv_size = 1; /* No dev_priv */ + dev->driver->context_ctor = sis_init_context; + dev->driver->context_dtor = sis_final_context; + + dev->driver->ioctls = sis_ioctls; + dev->driver->max_ioctl = sis_max_ioctl; + + dev->driver->name = DRIVER_NAME; + dev->driver->desc = DRIVER_DESC; + dev->driver->date = DRIVER_DATE; + dev->driver->major = DRIVER_MAJOR; + dev->driver->minor = DRIVER_MINOR; + dev->driver->patchlevel = DRIVER_PATCHLEVEL; + + dev->driver->use_agp = 1; + dev->driver->use_mtrr = 1; } #ifdef __FreeBSD__ @@ -69,15 +69,28 @@ sis_attach(device_t nbdev) struct drm_device *dev = device_get_softc(nbdev); bzero(dev, sizeof(struct drm_device)); + + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); sis_configure(dev); + return drm_attach(nbdev, sis_pciidlist); } +static int +sis_detach(device_t nbdev) +{ + struct drm_device *dev = device_get_softc(nbdev); + + free(dev->driver, M_DRM); + + return drm_detach(nbdev); +} + static device_method_t sis_methods[] = { /* Device interface */ DEVMETHOD(device_probe, sis_probe), DEVMETHOD(device_attach, sis_attach), - DEVMETHOD(device_detach, drm_detach), + DEVMETHOD(device_detach, sis_detach), { 0, 0 } }; diff --git a/bsd-core/tdfx_drv.c b/bsd-core/tdfx_drv.c index 6d4e74b0..e5559999 100644 --- a/bsd-core/tdfx_drv.c +++ b/bsd-core/tdfx_drv.c @@ -43,18 +43,18 @@ static drm_pci_id_list_t tdfx_pciidlist[] = { static void tdfx_configure(struct drm_device *dev) { - dev->driver.buf_priv_size = 1; /* No dev_priv */ + dev->driver->buf_priv_size = 1; /* No dev_priv */ - dev->driver.max_ioctl = 0; + dev->driver->max_ioctl = 0; - dev->driver.name = DRIVER_NAME; - dev->driver.desc = DRIVER_DESC; - dev->driver.date = DRIVER_DATE; - dev->driver.major = DRIVER_MAJOR; - dev->driver.minor = DRIVER_MINOR; - dev->driver.patchlevel = DRIVER_PATCHLEVEL; + dev->driver->name = DRIVER_NAME; + dev->driver->desc = DRIVER_DESC; + dev->driver->date = DRIVER_DATE; + dev->driver->major = DRIVER_MAJOR; + dev->driver->minor = DRIVER_MINOR; + dev->driver->patchlevel = DRIVER_PATCHLEVEL; - dev->driver.use_mtrr = 1; + dev->driver->use_mtrr = 1; } #ifdef __FreeBSD__ @@ -70,15 +70,28 @@ tdfx_attach(device_t nbdev) struct drm_device *dev = device_get_softc(nbdev); bzero(dev, sizeof(struct drm_device)); + + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); tdfx_configure(dev); + return drm_attach(nbdev, tdfx_pciidlist); } +static int +tdfx_detach(device_t nbdev) +{ + struct drm_device *dev = device_get_softc(nbdev); + + free(dev->driver, M_DRM); + + return drm_detach(nbdev); +} + static device_method_t tdfx_methods[] = { /* Device interface */ DEVMETHOD(device_probe, tdfx_probe), DEVMETHOD(device_attach, tdfx_attach), - DEVMETHOD(device_detach, drm_detach), + DEVMETHOD(device_detach, tdfx_detach), { 0, 0 } }; diff --git a/bsd-core/via_drv.c b/bsd-core/via_drv.c index 36b820a9..539e3ef3 100644 --- a/bsd-core/via_drv.c +++ b/bsd-core/via_drv.c @@ -41,34 +41,34 @@ static drm_pci_id_list_t via_pciidlist[] = { static void via_configure(struct drm_device *dev) { - dev->driver.buf_priv_size = 1; - dev->driver.load = via_driver_load; - dev->driver.unload = via_driver_unload; - dev->driver.context_ctor = via_init_context; - dev->driver.context_dtor = via_final_context; - dev->driver.get_vblank_counter = via_get_vblank_counter; - dev->driver.enable_vblank = via_enable_vblank; - dev->driver.disable_vblank = via_disable_vblank; - dev->driver.irq_preinstall = via_driver_irq_preinstall; - dev->driver.irq_postinstall = via_driver_irq_postinstall; - dev->driver.irq_uninstall = via_driver_irq_uninstall; - dev->driver.irq_handler = via_driver_irq_handler; - dev->driver.dma_quiescent = via_driver_dma_quiescent; - - dev->driver.ioctls = via_ioctls; - dev->driver.max_ioctl = via_max_ioctl; - - dev->driver.name = DRIVER_NAME; - dev->driver.desc = DRIVER_DESC; - dev->driver.date = DRIVER_DATE; - dev->driver.major = DRIVER_MAJOR; - dev->driver.minor = DRIVER_MINOR; - dev->driver.patchlevel = DRIVER_PATCHLEVEL; - - dev->driver.use_agp = 1; - dev->driver.use_mtrr = 1; - dev->driver.use_irq = 1; - dev->driver.use_vbl_irq = 1; + dev->driver->buf_priv_size = 1; + dev->driver->load = via_driver_load; + dev->driver->unload = via_driver_unload; + dev->driver->context_ctor = via_init_context; + dev->driver->context_dtor = via_final_context; + dev->driver->get_vblank_counter = via_get_vblank_counter; + dev->driver->enable_vblank = via_enable_vblank; + dev->driver->disable_vblank = via_disable_vblank; + dev->driver->irq_preinstall = via_driver_irq_preinstall; + dev->driver->irq_postinstall = via_driver_irq_postinstall; + dev->driver->irq_uninstall = via_driver_irq_uninstall; + dev->driver->irq_handler = via_driver_irq_handler; + dev->driver->dma_quiescent = via_driver_dma_quiescent; + + dev->driver->ioctls = via_ioctls; + dev->driver->max_ioctl = via_max_ioctl; + + dev->driver->name = DRIVER_NAME; + dev->driver->desc = DRIVER_DESC; + dev->driver->date = DRIVER_DATE; + dev->driver->major = DRIVER_MAJOR; + dev->driver->minor = DRIVER_MINOR; + dev->driver->patchlevel = DRIVER_PATCHLEVEL; + + dev->driver->use_agp = 1; + dev->driver->use_mtrr = 1; + dev->driver->use_irq = 1; + dev->driver->use_vbl_irq = 1; } #ifdef __FreeBSD__ @@ -84,15 +84,28 @@ via_attach(device_t nbdev) struct drm_device *dev = device_get_softc(nbdev); bzero(dev, sizeof(struct drm_device)); + + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); via_configure(dev); + return drm_attach(nbdev, via_pciidlist); } +static int +via_detach(device_t nbdev) +{ + struct drm_device *dev = device_get_softc(nbdev); + + free(dev->driver, M_DRM); + + return drm_detach(nbdev); +} + static device_method_t via_methods[] = { /* Device interface */ DEVMETHOD(device_probe, via_probe), DEVMETHOD(device_attach, via_attach), - DEVMETHOD(device_detach, drm_detach), + DEVMETHOD(device_detach, via_detach), { 0, 0 } }; -- cgit v1.2.3 From 2b278047153df729caf9e516a432b2e76398cd3a Mon Sep 17 00:00:00 2001 From: vehemens Date: Wed, 27 Aug 2008 19:11:04 -0700 Subject: [FreeBSD] Use driver features macros and flags Signed-off-by: Robert Noland --- bsd-core/drmP.h | 37 +++++++++++++++++++++++++++---------- bsd-core/drm_bufs.c | 5 +++-- bsd-core/drm_drv.c | 10 ++++++---- bsd-core/drm_irq.c | 4 ++-- bsd-core/drm_lock.c | 3 ++- bsd-core/i915_drv.c | 11 ++++------- bsd-core/mach64_drv.c | 11 ++++------- bsd-core/mga_drv.c | 11 ++++------- bsd-core/r128_drv.c | 12 ++++-------- bsd-core/radeon_drv.c | 13 ++++--------- bsd-core/savage_drv.c | 9 ++++----- bsd-core/sis_drv.c | 6 +++--- bsd-core/tdfx_drv.c | 5 +++-- bsd-core/via_drv.c | 8 +++----- 14 files changed, 73 insertions(+), 72 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 9d797d79..7244b353 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -135,6 +135,17 @@ typedef struct drm_file drm_file_t; #define DRM_LINUX 0 #endif +/* driver capabilities and requirements mask */ +#define DRIVER_USE_AGP 0x1 +#define DRIVER_REQUIRE_AGP 0x2 +#define DRIVER_USE_MTRR 0x4 +#define DRIVER_PCI_DMA 0x8 +#define DRIVER_SG 0x10 +#define DRIVER_HAVE_DMA 0x20 +#define DRIVER_HAVE_IRQ 0x40 +#define DRIVER_DMA_QUEUE 0x100 + + #define DRM_HASH_SIZE 16 /* Size of key hash table */ #define DRM_KERNEL_CONTEXT 0 /* Change drm_resctx if changed */ #define DRM_RESERVED_CONTEXTS 1 /* Change drm_resctx if changed */ @@ -705,16 +716,7 @@ struct drm_driver_info { const char *desc; /* Longer driver name */ const char *date; /* Date of last major changes. */ - unsigned use_agp :1; - unsigned require_agp :1; - unsigned use_sg :1; - unsigned use_dma :1; - unsigned use_pci_dma :1; - unsigned use_dma_queue :1; - unsigned use_irq :1; - unsigned use_vbl_irq :1; - unsigned use_vbl_irq2 :1; - unsigned use_mtrr :1; + u32 driver_features; }; /* Length for the array of resource pointers for drm_get_resource_*. */ @@ -832,6 +834,21 @@ struct drm_device { void (*locked_task_call)(struct drm_device *dev); }; +static __inline__ int drm_core_check_feature(struct drm_device *dev, + int feature) +{ + return ((dev->driver->driver_features & feature) ? 1 : 0); +} + +#if __OS_HAS_AGP +static inline int drm_core_has_AGP(struct drm_device *dev) +{ + return drm_core_check_feature(dev, DRIVER_USE_AGP); +} +#else +#define drm_core_has_AGP(dev) (0) +#endif + extern int drm_debug_flag; /* Device setup support (drm_drv.c) */ diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index 2b248e47..ed13f02f 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -1061,8 +1061,9 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) if (request->count < dma->buf_count) goto done; - if ((dev->driver->use_agp && (dma->flags & _DRM_DMA_USE_AGP)) || - (dev->driver->use_sg && (dma->flags & _DRM_DMA_USE_SG))) { + if ((drm_core_has_AGP(dev) && (dma->flags & _DRM_DMA_USE_AGP)) || + (drm_core_check_feature(dev, DRIVER_SG) && + (dma->flags & _DRM_DMA_USE_SG))) { drm_local_map_t *map = dev->agp_buffer_map; if (map == NULL) { diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 2ad54b9a..e5762cc4 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -402,7 +402,7 @@ static int drm_firstopen(struct drm_device *dev) dev->buf_use = 0; - if (dev->driver->use_dma) { + if (drm_core_check_feature(dev, DRIVER_HAVE_DMA)) { i = drm_dma_setup(dev); if (i != 0) return i; @@ -557,10 +557,11 @@ static int drm_load(struct drm_device *dev) goto error; } - if (dev->driver->use_agp) { + if (drm_core_has_AGP(dev)) { if (drm_device_is_agp(dev)) dev->agp = drm_agp_init(); - if (dev->driver->require_agp && dev->agp == NULL) { + if (drm_core_check_feature(dev, DRIVER_REQUIRE_AGP) && + dev->agp == NULL) { DRM_ERROR("Card isn't AGP, or couldn't initialize " "AGP.\n"); retcode = ENOMEM; @@ -814,7 +815,8 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) } } - if (dev->driver->use_dma && !dev->driver->reclaim_buffers_locked) + if (drm_core_check_feature(dev, DRIVER_HAVE_DMA) && + !dev->driver->reclaim_buffers_locked) drm_reclaim_buffers(dev, file_priv); #if defined (__FreeBSD__) && (__FreeBSD_version >= 500000) diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index 6d7d1265..92861036 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -272,14 +272,14 @@ int drm_control(struct drm_device *dev, void *data, struct drm_file *file_priv) /* Handle drivers whose DRM used to require IRQ setup but the * no longer does. */ - if (!dev->driver->use_irq) + if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) return 0; if (dev->if_version < DRM_IF_VERSION(1, 2) && ctl->irq != dev->irq) return EINVAL; return drm_irq_install(dev); case DRM_UNINST_HANDLER: - if (!dev->driver->use_irq) + if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) return 0; DRM_LOCK(); err = drm_irq_uninstall(dev); diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index cb8875b8..870874bb 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -126,7 +126,8 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) lock->context, DRM_CURRENTPID, dev->lock.hw_lock->lock, lock->flags); - if (dev->driver->use_dma_queue && lock->context < 0) + if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE) && + lock->context < 0) return EINVAL; DRM_LOCK(); diff --git a/bsd-core/i915_drv.c b/bsd-core/i915_drv.c index d2301ddd..8f21075d 100644 --- a/bsd-core/i915_drv.c +++ b/bsd-core/i915_drv.c @@ -68,6 +68,10 @@ static int i915_resume(device_t nbdev) static void i915_configure(struct drm_device *dev) { + dev->driver->driver_features = + DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | + DRIVER_HAVE_IRQ; + dev->driver->buf_priv_size = sizeof(drm_i915_private_t); dev->driver->load = i915_driver_load; dev->driver->unload = i915_driver_unload; @@ -92,13 +96,6 @@ static void i915_configure(struct drm_device *dev) dev->driver->major = DRIVER_MAJOR; dev->driver->minor = DRIVER_MINOR; dev->driver->patchlevel = DRIVER_PATCHLEVEL; - - dev->driver->use_agp = 1; - dev->driver->require_agp = 1; - dev->driver->use_mtrr = 1; - dev->driver->use_irq = 1; - dev->driver->use_vbl_irq = 1; - dev->driver->use_vbl_irq2 = 1; } #ifdef __FreeBSD__ diff --git a/bsd-core/mach64_drv.c b/bsd-core/mach64_drv.c index 726b7d24..235a925f 100644 --- a/bsd-core/mach64_drv.c +++ b/bsd-core/mach64_drv.c @@ -46,6 +46,10 @@ static drm_pci_id_list_t mach64_pciidlist[] = { static void mach64_configure(struct drm_device *dev) { + dev->driver->driver_features = + DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | + DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ; + dev->driver->buf_priv_size = 1; /* No dev_priv */ dev->driver->lastclose = mach64_driver_lastclose; dev->driver->get_vblank_counter = mach64_get_vblank_counter; @@ -66,13 +70,6 @@ static void mach64_configure(struct drm_device *dev) dev->driver->major = DRIVER_MAJOR; dev->driver->minor = DRIVER_MINOR; dev->driver->patchlevel = DRIVER_PATCHLEVEL; - - dev->driver->use_agp = 1; - dev->driver->use_mtrr = 1; - dev->driver->use_pci_dma = 1; - dev->driver->use_dma = 1; - dev->driver->use_irq = 1; - dev->driver->use_vbl_irq = 1; } #ifdef __FreeBSD__ diff --git a/bsd-core/mga_drv.c b/bsd-core/mga_drv.c index 0e434b56..1a3ab578 100644 --- a/bsd-core/mga_drv.c +++ b/bsd-core/mga_drv.c @@ -86,6 +86,10 @@ static int mga_driver_device_is_agp(struct drm_device * dev) static void mga_configure(struct drm_device *dev) { + dev->driver->driver_features = + DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | + DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ; + dev->driver->buf_priv_size = sizeof(drm_mga_buf_priv_t); dev->driver->load = mga_driver_load; dev->driver->unload = mga_driver_unload; @@ -110,13 +114,6 @@ static void mga_configure(struct drm_device *dev) dev->driver->major = DRIVER_MAJOR; dev->driver->minor = DRIVER_MINOR; dev->driver->patchlevel = DRIVER_PATCHLEVEL; - - dev->driver->use_agp = 1; - dev->driver->require_agp = 1; - dev->driver->use_mtrr = 1; - dev->driver->use_dma = 1; - dev->driver->use_irq = 1; - dev->driver->use_vbl_irq = 1; } diff --git a/bsd-core/r128_drv.c b/bsd-core/r128_drv.c index d93c746d..4e76ca51 100644 --- a/bsd-core/r128_drv.c +++ b/bsd-core/r128_drv.c @@ -44,6 +44,10 @@ static drm_pci_id_list_t r128_pciidlist[] = { static void r128_configure(struct drm_device *dev) { + dev->driver->driver_features = + DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | + DRIVER_SG | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ; + dev->driver->buf_priv_size = sizeof(drm_r128_buf_priv_t); dev->driver->preclose = r128_driver_preclose; dev->driver->lastclose = r128_driver_lastclose; @@ -65,14 +69,6 @@ static void r128_configure(struct drm_device *dev) dev->driver->major = DRIVER_MAJOR; dev->driver->minor = DRIVER_MINOR; dev->driver->patchlevel = DRIVER_PATCHLEVEL; - - dev->driver->use_agp = 1; - dev->driver->use_mtrr = 1; - dev->driver->use_pci_dma = 1; - dev->driver->use_sg = 1; - dev->driver->use_dma = 1; - dev->driver->use_irq = 1; - dev->driver->use_vbl_irq = 1; } #ifdef __FreeBSD__ diff --git a/bsd-core/radeon_drv.c b/bsd-core/radeon_drv.c index eea04ff9..fc29d37b 100644 --- a/bsd-core/radeon_drv.c +++ b/bsd-core/radeon_drv.c @@ -44,6 +44,10 @@ static drm_pci_id_list_t radeon_pciidlist[] = { static void radeon_configure(struct drm_device *dev) { + dev->driver->driver_features = + DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | + DRIVER_SG | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ; + dev->driver->buf_priv_size = sizeof(drm_radeon_buf_priv_t); dev->driver->load = radeon_driver_load; dev->driver->unload = radeon_driver_unload; @@ -70,15 +74,6 @@ static void radeon_configure(struct drm_device *dev) dev->driver->major = DRIVER_MAJOR; dev->driver->minor = DRIVER_MINOR; dev->driver->patchlevel = DRIVER_PATCHLEVEL; - - dev->driver->use_agp = 1; - dev->driver->use_mtrr = 1; - dev->driver->use_pci_dma = 1; - dev->driver->use_sg = 1; - dev->driver->use_dma = 1; - dev->driver->use_irq = 1; - dev->driver->use_vbl_irq = 1; - dev->driver->use_vbl_irq2 = 1; } #ifdef __FreeBSD__ diff --git a/bsd-core/savage_drv.c b/bsd-core/savage_drv.c index ee5166a3..8f2fa321 100644 --- a/bsd-core/savage_drv.c +++ b/bsd-core/savage_drv.c @@ -39,6 +39,10 @@ static drm_pci_id_list_t savage_pciidlist[] = { static void savage_configure(struct drm_device *dev) { + dev->driver->driver_features = + DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | + DRIVER_HAVE_DMA; + dev->driver->buf_priv_size = sizeof(drm_savage_buf_priv_t); dev->driver->load = savage_driver_load; dev->driver->firstopen = savage_driver_firstopen; @@ -56,11 +60,6 @@ static void savage_configure(struct drm_device *dev) dev->driver->major = DRIVER_MAJOR; dev->driver->minor = DRIVER_MINOR; dev->driver->patchlevel = DRIVER_PATCHLEVEL; - - dev->driver->use_agp = 1; - dev->driver->use_mtrr = 1; - dev->driver->use_pci_dma = 1; - dev->driver->use_dma = 1; } #ifdef __FreeBSD__ diff --git a/bsd-core/sis_drv.c b/bsd-core/sis_drv.c index a9637763..00a24300 100644 --- a/bsd-core/sis_drv.c +++ b/bsd-core/sis_drv.c @@ -38,6 +38,9 @@ static drm_pci_id_list_t sis_pciidlist[] = { static void sis_configure(struct drm_device *dev) { + dev->driver->driver_features = + DRIVER_USE_AGP | DRIVER_USE_MTRR; + dev->driver->buf_priv_size = 1; /* No dev_priv */ dev->driver->context_ctor = sis_init_context; dev->driver->context_dtor = sis_final_context; @@ -51,9 +54,6 @@ static void sis_configure(struct drm_device *dev) dev->driver->major = DRIVER_MAJOR; dev->driver->minor = DRIVER_MINOR; dev->driver->patchlevel = DRIVER_PATCHLEVEL; - - dev->driver->use_agp = 1; - dev->driver->use_mtrr = 1; } #ifdef __FreeBSD__ diff --git a/bsd-core/tdfx_drv.c b/bsd-core/tdfx_drv.c index e5559999..eb263fcb 100644 --- a/bsd-core/tdfx_drv.c +++ b/bsd-core/tdfx_drv.c @@ -43,6 +43,9 @@ static drm_pci_id_list_t tdfx_pciidlist[] = { static void tdfx_configure(struct drm_device *dev) { + dev->driver->driver_features = + DRIVER_USE_MTRR; + dev->driver->buf_priv_size = 1; /* No dev_priv */ dev->driver->max_ioctl = 0; @@ -53,8 +56,6 @@ static void tdfx_configure(struct drm_device *dev) dev->driver->major = DRIVER_MAJOR; dev->driver->minor = DRIVER_MINOR; dev->driver->patchlevel = DRIVER_PATCHLEVEL; - - dev->driver->use_mtrr = 1; } #ifdef __FreeBSD__ diff --git a/bsd-core/via_drv.c b/bsd-core/via_drv.c index 539e3ef3..3b931e28 100644 --- a/bsd-core/via_drv.c +++ b/bsd-core/via_drv.c @@ -41,6 +41,9 @@ static drm_pci_id_list_t via_pciidlist[] = { static void via_configure(struct drm_device *dev) { + dev->driver->driver_features = + DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_IRQ; + dev->driver->buf_priv_size = 1; dev->driver->load = via_driver_load; dev->driver->unload = via_driver_unload; @@ -64,11 +67,6 @@ static void via_configure(struct drm_device *dev) dev->driver->major = DRIVER_MAJOR; dev->driver->minor = DRIVER_MINOR; dev->driver->patchlevel = DRIVER_PATCHLEVEL; - - dev->driver->use_agp = 1; - dev->driver->use_mtrr = 1; - dev->driver->use_irq = 1; - dev->driver->use_vbl_irq = 1; } #ifdef __FreeBSD__ -- cgit v1.2.3 From cd7d71f19cf2a16521c9da1815421c6a5f12a58e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 31 Aug 2008 07:27:26 +1000 Subject: radeon: make writeback work after suspend/resume. While re-writing this for modesetting, I find we disable writeback on resume. --- shared-core/radeon_cp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c index ae31e969..a0fa2a06 100644 --- a/shared-core/radeon_cp.c +++ b/shared-core/radeon_cp.c @@ -628,9 +628,6 @@ static void radeon_cp_init_ring_buffer(struct drm_device * dev, dev_priv->ring.size_l2qw); #endif - /* Start with assuming that writeback doesn't work */ - dev_priv->writeback_works = 0; - /* Initialize the scratch register pointer. This will cause * the scratch register values to be written out to memory * whenever they are updated. @@ -1187,6 +1184,9 @@ static int radeon_do_init_cp(struct drm_device * dev, drm_radeon_init_t * init) radeon_set_pcigart(dev_priv, 1); } + /* Start with assuming that writeback doesn't work */ + dev_priv->writeback_works = 0; + radeon_cp_load_microcode(dev_priv); radeon_cp_init_ring_buffer(dev, dev_priv); -- cgit v1.2.3 From 99f8cce3eae79c9cf5e9897ef1af8eac24b38c09 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 2 Sep 2008 10:07:14 +1000 Subject: drm: fix sysfs error path. Pointed out by Roel Kluin on dri-devel. Signed-off-by: Dave Airlie --- linux-core/drm_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-core/drm_sysfs.c b/linux-core/drm_sysfs.c index 32759424..6de93679 100644 --- a/linux-core/drm_sysfs.c +++ b/linux-core/drm_sysfs.c @@ -188,7 +188,7 @@ int drm_sysfs_device_add(struct drm_minor *minor) err_out_files: if (i > 0) for (j = 0; j < i; j++) - device_remove_file(&minor->kdev, &device_attrs[i]); + device_remove_file(&minor->kdev, &device_attrs[j]); device_unregister(&minor->kdev); err_out: -- cgit v1.2.3 From ce84511f4d647d5ce9fd52b838ee944e23050954 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Fri, 5 Sep 2008 00:17:52 +0200 Subject: nouveau: 8200 cards are 0xA0 family. --- shared-core/nouveau_state.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 85220e6e..afddca0a 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -245,6 +245,7 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) case 0x50: case 0x80: /* gotta love NVIDIA's consistency.. */ case 0x90: + case 0xA0: engine->instmem.init = nv50_instmem_init; engine->instmem.takedown= nv50_instmem_takedown; engine->instmem.populate = nv50_instmem_populate; -- cgit v1.2.3 From 3f915f68e8f68fe0fc3d0e1eb8a18a16f8f397da Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Fri, 5 Sep 2008 11:52:53 -0400 Subject: i915: fix i915_ring_validate() --- shared-core/i915_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 5a69b1f3..c874ce28 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -119,8 +119,8 @@ void i915_ring_validate(struct drm_device *dev, const char *func, int line) { drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_ring_buffer_t *ring = &(dev_priv->ring); - u32 tail = I915_READ(LP_RING+RING_TAIL) & HEAD_ADDR; - u32 head = I915_READ(LP_RING+RING_HEAD) & HEAD_ADDR; + u32 tail = I915_READ(PRB0_TAIL) & HEAD_ADDR; + u32 head = I915_READ(PRB0_HEAD) & HEAD_ADDR; if (tail != ring->tail) { DRM_ERROR("%s:%d head sw %x, hw %x. tail sw %x hw %x\n", -- cgit v1.2.3 From ed6dd03818f2fa4dd0f2ba34dee58b09c7ff253e Mon Sep 17 00:00:00 2001 From: vehemens Date: Tue, 2 Sep 2008 02:43:19 -0700 Subject: Need M_NOWAIT for malloc. Signed-off-by: Robert Noland --- bsd-core/i915_drv.c | 2 +- bsd-core/mach64_drv.c | 2 +- bsd-core/mga_drv.c | 2 +- bsd-core/r128_drv.c | 2 +- bsd-core/radeon_drv.c | 2 +- bsd-core/savage_drv.c | 2 +- bsd-core/sis_drv.c | 2 +- bsd-core/tdfx_drv.c | 2 +- bsd-core/via_drv.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bsd-core/i915_drv.c b/bsd-core/i915_drv.c index 8f21075d..71a8d64d 100644 --- a/bsd-core/i915_drv.c +++ b/bsd-core/i915_drv.c @@ -112,7 +112,7 @@ i915_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); i915_configure(dev); return drm_attach(nbdev, i915_pciidlist); diff --git a/bsd-core/mach64_drv.c b/bsd-core/mach64_drv.c index 235a925f..f940e90f 100644 --- a/bsd-core/mach64_drv.c +++ b/bsd-core/mach64_drv.c @@ -86,7 +86,7 @@ mach64_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); mach64_configure(dev); return drm_attach(nbdev, mach64_pciidlist); diff --git a/bsd-core/mga_drv.c b/bsd-core/mga_drv.c index 1a3ab578..7abf2b03 100644 --- a/bsd-core/mga_drv.c +++ b/bsd-core/mga_drv.c @@ -132,7 +132,7 @@ mga_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); mga_configure(dev); return drm_attach(nbdev, mga_pciidlist); diff --git a/bsd-core/r128_drv.c b/bsd-core/r128_drv.c index 4e76ca51..03a97da0 100644 --- a/bsd-core/r128_drv.c +++ b/bsd-core/r128_drv.c @@ -85,7 +85,7 @@ r128_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); r128_configure(dev); return drm_attach(nbdev, r128_pciidlist); diff --git a/bsd-core/radeon_drv.c b/bsd-core/radeon_drv.c index fc29d37b..019f705c 100644 --- a/bsd-core/radeon_drv.c +++ b/bsd-core/radeon_drv.c @@ -90,7 +90,7 @@ radeon_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); radeon_configure(dev); return drm_attach(nbdev, radeon_pciidlist); diff --git a/bsd-core/savage_drv.c b/bsd-core/savage_drv.c index 8f2fa321..f0c6c06e 100644 --- a/bsd-core/savage_drv.c +++ b/bsd-core/savage_drv.c @@ -76,7 +76,7 @@ savage_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); savage_configure(dev); return drm_attach(nbdev, savage_pciidlist); diff --git a/bsd-core/sis_drv.c b/bsd-core/sis_drv.c index 00a24300..8ad6414d 100644 --- a/bsd-core/sis_drv.c +++ b/bsd-core/sis_drv.c @@ -70,7 +70,7 @@ sis_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); sis_configure(dev); return drm_attach(nbdev, sis_pciidlist); diff --git a/bsd-core/tdfx_drv.c b/bsd-core/tdfx_drv.c index eb263fcb..8fafe0fe 100644 --- a/bsd-core/tdfx_drv.c +++ b/bsd-core/tdfx_drv.c @@ -72,7 +72,7 @@ tdfx_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); tdfx_configure(dev); return drm_attach(nbdev, tdfx_pciidlist); diff --git a/bsd-core/via_drv.c b/bsd-core/via_drv.c index 3b931e28..cdd78d19 100644 --- a/bsd-core/via_drv.c +++ b/bsd-core/via_drv.c @@ -83,7 +83,7 @@ via_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); via_configure(dev); return drm_attach(nbdev, via_pciidlist); -- cgit v1.2.3 From 76dd74c64ef9b92025e76dd256e0641ff6fce0f4 Mon Sep 17 00:00:00 2001 From: vehemens Date: Tue, 2 Sep 2008 04:57:36 -0700 Subject: Style white space cleanup. Signed-off-by: Robert Noland --- bsd-core/drm_auth.c | 2 +- bsd-core/drm_bufs.c | 154 ++++++++++++++++++++++++------------------------- bsd-core/drm_context.c | 70 +++++++++++----------- bsd-core/drm_dma.c | 15 ++--- bsd-core/drm_drv.c | 66 ++++++++++----------- bsd-core/drm_ioctl.c | 5 +- bsd-core/drm_irq.c | 20 +++---- bsd-core/drm_lock.c | 34 ++++++----- bsd-core/drm_scatter.c | 16 ++--- 9 files changed, 192 insertions(+), 190 deletions(-) diff --git a/bsd-core/drm_auth.c b/bsd-core/drm_auth.c index c11c887a..2f836189 100644 --- a/bsd-core/drm_auth.c +++ b/bsd-core/drm_auth.c @@ -138,7 +138,7 @@ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv) static drm_magic_t sequence = 0; struct drm_auth *auth = data; - /* Find unique magic */ + /* Find unique magic */ if (file_priv->magic) { auth->magic = file_priv->magic; } else { diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index ed13f02f..45e01470 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -44,9 +44,9 @@ int drm_order(unsigned long size) int order; unsigned long tmp; - for ( order = 0, tmp = size ; tmp >>= 1 ; ++order ); + for (order = 0, tmp = size; tmp >>= 1; ++order); - if ( size & ~(1 << order) ) + if (size & ~(1 << order)) ++order; return order; @@ -152,7 +152,7 @@ int drm_addmap(struct drm_device * dev, unsigned long offset, * initialization necessary. */ map = malloc(sizeof(*map), M_DRM, M_ZERO | M_NOWAIT); - if ( !map ) { + if (!map) { DRM_LOCK(); return ENOMEM; } @@ -162,7 +162,7 @@ int drm_addmap(struct drm_device * dev, unsigned long offset, map->type = type; map->flags = flags; - switch ( map->type ) { + switch (map->type) { case _DRM_REGISTERS: map->handle = drm_ioremap(dev, map); if (!(map->flags & _DRM_WRITE_COMBINING)) @@ -174,15 +174,15 @@ int drm_addmap(struct drm_device * dev, unsigned long offset, break; case _DRM_SHM: map->handle = malloc(map->size, M_DRM, M_NOWAIT); - DRM_DEBUG( "%lu %d %p\n", - map->size, drm_order(map->size), map->handle ); - if ( !map->handle ) { + DRM_DEBUG("%lu %d %p\n", + map->size, drm_order(map->size), map->handle); + if (!map->handle) { free(map, M_DRM); DRM_LOCK(); return ENOMEM; } map->offset = (unsigned long)map->handle; - if ( map->flags & _DRM_CONTAINS_LOCK ) { + if (map->flags & _DRM_CONTAINS_LOCK) { /* Prevent a 2nd X Server from creating a 2nd lock */ DRM_LOCK(); if (dev->lock.hw_lock != NULL) { @@ -426,20 +426,20 @@ static int drm_do_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *reque size = 1 << order; alignment = (request->flags & _DRM_PAGE_ALIGN) - ? round_page(size) : size; + ? round_page(size) : size; page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0; total = PAGE_SIZE << page_order; byte_count = 0; agp_offset = dev->agp->base + request->agp_start; - DRM_DEBUG( "count: %d\n", count ); - DRM_DEBUG( "order: %d\n", order ); - DRM_DEBUG( "size: %d\n", size ); - DRM_DEBUG( "agp_offset: 0x%lx\n", agp_offset ); - DRM_DEBUG( "alignment: %d\n", alignment ); - DRM_DEBUG( "page_order: %d\n", page_order ); - DRM_DEBUG( "total: %d\n", total ); + DRM_DEBUG("count: %d\n", count); + DRM_DEBUG("order: %d\n", order); + DRM_DEBUG("size: %d\n", size); + DRM_DEBUG("agp_offset: 0x%lx\n", agp_offset); + DRM_DEBUG("alignment: %d\n", alignment); + DRM_DEBUG("page_order: %d\n", page_order); + DRM_DEBUG("total: %d\n", total); /* Make sure buffers are located in AGP memory that we own */ /* Breaks MGA due to drm_alloc_agp not setting up entries for the @@ -465,7 +465,7 @@ static int drm_do_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *reque entry->buflist = malloc(count * sizeof(*entry->buflist), M_DRM, M_NOWAIT | M_ZERO); - if ( !entry->buflist ) { + if (!entry->buflist) { return ENOMEM; } @@ -474,7 +474,7 @@ static int drm_do_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *reque offset = 0; - while ( entry->buf_count < count ) { + while (entry->buf_count < count) { buf = &entry->buflist[entry->buf_count]; buf->idx = dma->buf_count + entry->buf_count; buf->total = alignment; @@ -503,7 +503,7 @@ static int drm_do_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *reque byte_count += PAGE_SIZE << page_order; } - DRM_DEBUG( "byte_count: %d\n", byte_count ); + DRM_DEBUG("byte_count: %d\n", byte_count); temp_buflist = realloc(dma->buflist, (dma->buf_count + entry->buf_count) * sizeof(*dma->buflist), M_DRM, @@ -515,15 +515,15 @@ static int drm_do_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *reque } dma->buflist = temp_buflist; - for ( i = 0 ; i < entry->buf_count ; i++ ) { + for (i = 0; i < entry->buf_count; i++) { dma->buflist[i + dma->buf_count] = &entry->buflist[i]; } dma->buf_count += entry->buf_count; dma->byte_count += byte_count; - DRM_DEBUG( "dma->buf_count : %d\n", dma->buf_count ); - DRM_DEBUG( "entry->buf_count : %d\n", entry->buf_count ); + DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count); + DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count); request->count = entry->buf_count; request->size = size; @@ -555,11 +555,11 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque order = drm_order(request->size); size = 1 << order; - DRM_DEBUG( "count=%d, size=%d (%d), order=%d\n", - request->count, request->size, size, order ); + DRM_DEBUG("count=%d, size=%d (%d), order=%d\n", + request->count, request->size, size, order); alignment = (request->flags & _DRM_PAGE_ALIGN) - ? round_page(size) : size; + ? round_page(size) : size; page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0; total = PAGE_SIZE << page_order; @@ -582,19 +582,19 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque free(entry->seglist, M_DRM); return ENOMEM; } - + memcpy(temp_pagelist, dma->pagelist, dma->page_count * sizeof(*dma->pagelist)); - DRM_DEBUG( "pagelist: %d entries\n", - dma->page_count + (count << page_order) ); + DRM_DEBUG("pagelist: %d entries\n", + dma->page_count + (count << page_order)); entry->buf_size = size; entry->page_order = page_order; byte_count = 0; page_count = 0; - while ( entry->buf_count < count ) { + while (entry->buf_count < count) { drm_dma_handle_t *dmah = drm_pci_alloc(dev, size, alignment, 0xfffffffful); if (dmah == NULL) { @@ -607,16 +607,16 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque } entry->seglist[entry->seg_count++] = dmah; - for ( i = 0 ; i < (1 << page_order) ; i++ ) { - DRM_DEBUG( "page %d @ %p\n", - dma->page_count + page_count, - (char *)dmah->vaddr + PAGE_SIZE * i ); + for (i = 0; i < (1 << page_order); i++) { + DRM_DEBUG("page %d @ %p\n", + dma->page_count + page_count, + (char *)dmah->vaddr + PAGE_SIZE * i); temp_pagelist[dma->page_count + page_count++] = (long)dmah->vaddr + PAGE_SIZE * i; } - for ( offset = 0 ; - offset + size <= total && entry->buf_count < count ; - offset += alignment, ++entry->buf_count ) { + for (offset = 0; + offset + size <= total && entry->buf_count < count; + offset += alignment, ++entry->buf_count) { buf = &entry->buflist[entry->buf_count]; buf->idx = dma->buf_count + entry->buf_count; buf->total = alignment; @@ -641,8 +641,8 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque return ENOMEM; } - DRM_DEBUG( "buffer %d @ %p\n", - entry->buf_count, buf->address ); + DRM_DEBUG("buffer %d @ %p\n", + entry->buf_count, buf->address); } byte_count += PAGE_SIZE << page_order; } @@ -658,7 +658,7 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque } dma->buflist = temp_buflist; - for ( i = 0 ; i < entry->buf_count ; i++ ) { + for (i = 0; i < entry->buf_count; i++) { dma->buflist[i + dma->buf_count] = &entry->buflist[i]; } @@ -702,20 +702,20 @@ static int drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *reques size = 1 << order; alignment = (request->flags & _DRM_PAGE_ALIGN) - ? round_page(size) : size; + ? round_page(size) : size; page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0; total = PAGE_SIZE << page_order; byte_count = 0; agp_offset = request->agp_start; - DRM_DEBUG( "count: %d\n", count ); - DRM_DEBUG( "order: %d\n", order ); - DRM_DEBUG( "size: %d\n", size ); - DRM_DEBUG( "agp_offset: %ld\n", agp_offset ); - DRM_DEBUG( "alignment: %d\n", alignment ); - DRM_DEBUG( "page_order: %d\n", page_order ); - DRM_DEBUG( "total: %d\n", total ); + DRM_DEBUG("count: %d\n", count); + DRM_DEBUG("order: %d\n", order); + DRM_DEBUG("size: %d\n", size); + DRM_DEBUG("agp_offset: %ld\n", agp_offset); + DRM_DEBUG("alignment: %d\n", alignment); + DRM_DEBUG("page_order: %d\n", page_order); + DRM_DEBUG("total: %d\n", total); entry = &dma->bufs[order]; @@ -729,7 +729,7 @@ static int drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *reques offset = 0; - while ( entry->buf_count < count ) { + while (entry->buf_count < count) { buf = &entry->buflist[entry->buf_count]; buf->idx = dma->buf_count + entry->buf_count; buf->total = alignment; @@ -753,15 +753,15 @@ static int drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *reques return ENOMEM; } - DRM_DEBUG( "buffer %d @ %p\n", - entry->buf_count, buf->address ); + DRM_DEBUG("buffer %d @ %p\n", + entry->buf_count, buf->address); offset += alignment; entry->buf_count++; byte_count += PAGE_SIZE << page_order; } - DRM_DEBUG( "byte_count: %d\n", byte_count ); + DRM_DEBUG("byte_count: %d\n", byte_count); temp_buflist = realloc(dma->buflist, (dma->buf_count + entry->buf_count) * sizeof(*dma->buflist), M_DRM, @@ -773,15 +773,15 @@ static int drm_do_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *reques } dma->buflist = temp_buflist; - for ( i = 0 ; i < entry->buf_count ; i++ ) { + for (i = 0; i < entry->buf_count; i++) { dma->buflist[i + dma->buf_count] = &entry->buflist[i]; } dma->buf_count += entry->buf_count; dma->byte_count += byte_count; - DRM_DEBUG( "dma->buf_count : %d\n", dma->buf_count ); - DRM_DEBUG( "entry->buf_count : %d\n", entry->buf_count ); + DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count); + DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count); request->count = entry->buf_count; request->size = size; @@ -918,15 +918,16 @@ int drm_infobufs(struct drm_device *dev, void *data, struct drm_file *file_priv) ++dev->buf_use; /* Can't allocate more after this call */ DRM_SPINUNLOCK(&dev->dma_lock); - for ( i = 0, count = 0 ; i < DRM_MAX_ORDER + 1 ; i++ ) { - if ( dma->bufs[i].buf_count ) ++count; + for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) { + if (dma->bufs[i].buf_count) + ++count; } - DRM_DEBUG( "count = %d\n", count ); + DRM_DEBUG("count = %d\n", count); - if ( request->count >= count ) { - for ( i = 0, count = 0 ; i < DRM_MAX_ORDER + 1 ; i++ ) { - if ( dma->bufs[i].buf_count ) { + if (request->count >= count) { + for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) { + if (dma->bufs[i].buf_count) { struct drm_buf_desc from; from.count = dma->bufs[i].buf_count; @@ -940,12 +941,11 @@ int drm_infobufs(struct drm_device *dev, void *data, struct drm_file *file_priv) break; } - DRM_DEBUG( "%d %d %d %d %d\n", - i, - dma->bufs[i].buf_count, - dma->bufs[i].buf_size, - dma->bufs[i].freelist.low_mark, - dma->bufs[i].freelist.high_mark ); + DRM_DEBUG("%d %d %d %d %d\n", + i, dma->bufs[i].buf_count, + dma->bufs[i].buf_size, + dma->bufs[i].freelist.low_mark, + dma->bufs[i].freelist.high_mark); ++count; } } @@ -961,8 +961,8 @@ int drm_markbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) struct drm_buf_desc *request = data; int order; - DRM_DEBUG( "%d, %d, %d\n", - request->size, request->low_mark, request->high_mark ); + DRM_DEBUG("%d, %d, %d\n", + request->size, request->low_mark, request->high_mark); order = drm_order(request->size); @@ -994,24 +994,24 @@ int drm_freebufs(struct drm_device *dev, void *data, struct drm_file *file_priv) drm_buf_t *buf; int retcode = 0; - DRM_DEBUG( "%d\n", request->count ); + DRM_DEBUG("%d\n", request->count); DRM_SPINLOCK(&dev->dma_lock); - for ( i = 0 ; i < request->count ; i++ ) { + for (i = 0; i < request->count; i++) { if (DRM_COPY_FROM_USER(&idx, &request->list[i], sizeof(idx))) { retcode = EFAULT; break; } - if ( idx < 0 || idx >= dma->buf_count ) { - DRM_ERROR( "Index %d (of %d max)\n", - idx, dma->buf_count - 1 ); + if (idx < 0 || idx >= dma->buf_count) { + DRM_ERROR("Index %d (of %d max)\n", + idx, dma->buf_count - 1); retcode = EINVAL; break; } buf = dma->buflist[idx]; - if ( buf->file_priv != file_priv ) { + if (buf->file_priv != file_priv) { DRM_ERROR("Process %d freeing buffer not owned\n", - DRM_CURRENTPID); + DRM_CURRENTPID); retcode = EINVAL; break; } @@ -1098,7 +1098,7 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) request->virtual = (void *)vaddr; - for ( i = 0 ; i < dma->buf_count ; i++ ) { + for (i = 0; i < dma->buf_count; i++) { if (DRM_COPY_TO_USER(&request->list[i].idx, &dma->buflist[i]->idx, sizeof(request->list[0].idx))) { retcode = EFAULT; @@ -1125,7 +1125,7 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) done: request->count = dma->buf_count; - DRM_DEBUG( "%d buffers, retcode = %d\n", request->count, retcode ); + DRM_DEBUG("%d buffers, retcode = %d\n", request->count, retcode); return retcode; } diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index b85922e1..24f34fdd 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -62,7 +62,7 @@ int drm_ctxbitmap_next(struct drm_device *dev) return -1; DRM_LOCK(); - bit = find_first_zero_bit( dev->ctx_bitmap, DRM_MAX_CTXBITMAP ); + bit = find_first_zero_bit(dev->ctx_bitmap, DRM_MAX_CTXBITMAP); if (bit >= DRM_MAX_CTXBITMAP) { DRM_UNLOCK(); return -1; @@ -116,9 +116,9 @@ int drm_ctxbitmap_init(struct drm_device *dev) dev->max_context = -1; DRM_UNLOCK(); - for ( i = 0 ; i < DRM_RESERVED_CONTEXTS ; i++ ) { + for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { temp = drm_ctxbitmap_next(dev); - DRM_DEBUG( "drm_ctxbitmap_init : %d\n", temp ); + DRM_DEBUG("drm_ctxbitmap_init : %d\n", temp); } return 0; @@ -188,33 +188,33 @@ bad: int drm_context_switch(struct drm_device *dev, int old, int new) { - if ( test_and_set_bit( 0, &dev->context_flag ) ) { - DRM_ERROR( "Reentering -- FIXME\n" ); - return EBUSY; - } + if (test_and_set_bit(0, &dev->context_flag)) { + DRM_ERROR("Reentering -- FIXME\n"); + return EBUSY; + } - DRM_DEBUG( "Context switch from %d to %d\n", old, new ); + DRM_DEBUG("Context switch from %d to %d\n", old, new); - if ( new == dev->last_context ) { - clear_bit( 0, &dev->context_flag ); - return 0; - } + if (new == dev->last_context) { + clear_bit(0, &dev->context_flag); + return 0; + } - return 0; + return 0; } int drm_context_switch_complete(struct drm_device *dev, int new) { - dev->last_context = new; /* PRE/POST: This is the _only_ writer. */ + dev->last_context = new; /* PRE/POST: This is the _only_ writer. */ - if ( !_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) ) { - DRM_ERROR( "Lock isn't held after context switch\n" ); - } + if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { + DRM_ERROR("Lock isn't held after context switch\n"); + } - /* If a context switch is ever initiated - when the kernel holds the lock, release - that lock here. */ - clear_bit( 0, &dev->context_flag ); + /* If a context switch is ever initiated + when the kernel holds the lock, release + that lock here. */ + clear_bit(0, &dev->context_flag); return 0; } @@ -225,12 +225,12 @@ int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) struct drm_ctx ctx; int i; - if ( res->count >= DRM_RESERVED_CONTEXTS ) { + if (res->count >= DRM_RESERVED_CONTEXTS) { bzero(&ctx, sizeof(ctx)); - for ( i = 0 ; i < DRM_RESERVED_CONTEXTS ; i++ ) { + for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { ctx.handle = i; - if ( DRM_COPY_TO_USER( &res->contexts[i], - &ctx, sizeof(ctx) ) ) + if (DRM_COPY_TO_USER( &res->contexts[i], + &ctx, sizeof(ctx))) return EFAULT; } } @@ -244,14 +244,14 @@ int drm_addctx(struct drm_device *dev, void *data, struct drm_file *file_priv) struct drm_ctx *ctx = data; ctx->handle = drm_ctxbitmap_next(dev); - if ( ctx->handle == DRM_KERNEL_CONTEXT ) { - /* Skip kernel's context and get a new one. */ + if (ctx->handle == DRM_KERNEL_CONTEXT) { + /* Skip kernel's context and get a new one. */ ctx->handle = drm_ctxbitmap_next(dev); } - DRM_DEBUG( "%d\n", ctx->handle ); - if ( ctx->handle == -1 ) { - DRM_DEBUG( "Not enough free contexts.\n" ); - /* Should this return -EBUSY instead? */ + DRM_DEBUG("%d\n", ctx->handle); + if (ctx->handle == -1) { + DRM_DEBUG("Not enough free contexts.\n"); + /* Should this return -EBUSY instead? */ return ENOMEM; } @@ -285,7 +285,7 @@ int drm_switchctx(struct drm_device *dev, void *data, { struct drm_ctx *ctx = data; - DRM_DEBUG( "%d\n", ctx->handle ); + DRM_DEBUG("%d\n", ctx->handle); return drm_context_switch(dev, dev->last_context, ctx->handle); } @@ -293,7 +293,7 @@ int drm_newctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_ctx *ctx = data; - DRM_DEBUG( "%d\n", ctx->handle ); + DRM_DEBUG("%d\n", ctx->handle); drm_context_switch_complete(dev, ctx->handle); return 0; @@ -303,8 +303,8 @@ int drm_rmctx(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_ctx *ctx = data; - DRM_DEBUG( "%d\n", ctx->handle ); - if ( ctx->handle != DRM_KERNEL_CONTEXT ) { + DRM_DEBUG("%d\n", ctx->handle); + if (ctx->handle != DRM_KERNEL_CONTEXT) { if (dev->driver->context_dtor) { DRM_LOCK(); dev->driver->context_dtor(dev, ctx->handle); diff --git a/bsd-core/drm_dma.c b/bsd-core/drm_dma.c index cdfb986c..51f60683 100644 --- a/bsd-core/drm_dma.c +++ b/bsd-core/drm_dma.c @@ -58,14 +58,12 @@ void drm_dma_takedown(struct drm_device *dev) if (dma == NULL) return; - /* Clear dma buffers */ + /* Clear dma buffers */ for (i = 0; i <= DRM_MAX_ORDER; i++) { if (dma->bufs[i].seg_count) { DRM_DEBUG("order %d: buf_count = %d," - " seg_count = %d\n", - i, - dma->bufs[i].buf_count, - dma->bufs[i].seg_count); + " seg_count = %d\n", i, dma->bufs[i].buf_count, + dma->bufs[i].seg_count); for (j = 0; j < dma->bufs[i].seg_count; j++) { drm_pci_free(dev, dma->bufs[i].seglist[j]); } @@ -91,7 +89,8 @@ void drm_dma_takedown(struct drm_device *dev) void drm_free_buffer(struct drm_device *dev, drm_buf_t *buf) { - if (!buf) return; + if (!buf) + return; buf->pending = 0; buf->file_priv= NULL; @@ -103,7 +102,9 @@ void drm_reclaim_buffers(struct drm_device *dev, struct drm_file *file_priv) drm_device_dma_t *dma = dev->dma; int i; - if (!dma) return; + if (!dma) + return; + for (i = 0; i < dma->buf_count; i++) { if (dma->buflist[i]->file_priv == file_priv) { switch (dma->buflist[i]->list) { diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index e5762cc4..9056c76c 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -393,7 +393,7 @@ static int drm_firstopen(struct drm_device *dev) /* prebuild the SAREA */ i = drm_addmap(dev, 0, SAREA_MAX, _DRM_SHM, - _DRM_CONTAINS_LOCK, &map); + _DRM_CONTAINS_LOCK, &map); if (i != 0) return i; @@ -425,7 +425,7 @@ static int drm_firstopen(struct drm_device *dev) dev->buf_pgid = 0; #endif - DRM_DEBUG( "\n" ); + DRM_DEBUG("\n"); return 0; } @@ -438,7 +438,7 @@ static int drm_lastclose(struct drm_device *dev) DRM_SPINLOCK_ASSERT(&dev->dev_lock); - DRM_DEBUG( "\n" ); + DRM_DEBUG("\n"); if (dev->driver->lastclose != NULL) dev->driver->lastclose(dev); @@ -446,14 +446,14 @@ static int drm_lastclose(struct drm_device *dev) if (dev->irq_enabled) drm_irq_uninstall(dev); - if ( dev->unique ) { + if (dev->unique) { free(dev->unique, M_DRM); dev->unique = NULL; dev->unique_len = 0; } /* Clear pid list */ - for ( i = 0 ; i < DRM_HASH_SIZE ; i++ ) { - for ( pt = dev->magiclist[i].head ; pt ; pt = next ) { + for (i = 0; i < DRM_HASH_SIZE; i++) { + for (pt = dev->magiclist[i].head; pt; pt = next) { next = pt->next; free(pt, M_DRM); } @@ -464,15 +464,15 @@ static int drm_lastclose(struct drm_device *dev) drm_drawable_free_all(dev); DRM_LOCK(); - /* Clear AGP information */ - if ( dev->agp ) { + /* Clear AGP information */ + if (dev->agp) { drm_agp_mem_t *entry; drm_agp_mem_t *nexte; /* Remove AGP resources, but leave dev->agp intact until * drm_unload is called. */ - for ( entry = dev->agp->memory ; entry ; entry = nexte ) { + for (entry = dev->agp->memory; entry; entry = nexte) { nexte = entry->next; if ( entry->bound ) drm_agp_unbind_memory(entry->handle); @@ -498,7 +498,7 @@ static int drm_lastclose(struct drm_device *dev) } drm_dma_takedown(dev); - if ( dev->lock.hw_lock ) { + if (dev->lock.hw_lock) { dev->lock.hw_lock = NULL; /* SHM removed */ dev->lock.file_priv = NULL; DRM_WAKEUP_INT((void *)&dev->lock.lock_queue); @@ -511,7 +511,7 @@ static int drm_load(struct drm_device *dev) { int i, retcode; - DRM_DEBUG( "\n" ); + DRM_DEBUG("\n"); dev->irq = pci_get_irq(dev->device); #if defined(__FreeBSD__) && __FreeBSD_version >= 700053 @@ -542,7 +542,7 @@ static int drm_load(struct drm_device *dev) dev->types[4] = _DRM_STAT_LOCKS; dev->types[5] = _DRM_STAT_UNLOCKS; - for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ ) + for (i = 0; i < DRM_ARRAY_SIZE(dev->counts); i++) atomic_set( &dev->counts[i], 0 ); if (dev->driver->load != NULL) { @@ -587,11 +587,11 @@ static int drm_load(struct drm_device *dev) } DRM_INFO("Initialized %s %d.%d.%d %s\n", - dev->driver->name, - dev->driver->major, - dev->driver->minor, - dev->driver->patchlevel, - dev->driver->date); + dev->driver->name, + dev->driver->major, + dev->driver->minor, + dev->driver->patchlevel, + dev->driver->date); return 0; @@ -619,7 +619,7 @@ static void drm_unload(struct drm_device *dev) { int i; - DRM_DEBUG( "\n" ); + DRM_DEBUG("\n"); #ifdef __FreeBSD__ drm_sysctl_cleanup(dev); @@ -653,7 +653,7 @@ static void drm_unload(struct drm_device *dev) dev->pcir[i] = NULL; } - if ( dev->agp ) { + if (dev->agp) { free(dev->agp, M_DRM); dev->agp = NULL; } @@ -713,17 +713,17 @@ int drm_open(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) dev = DRIVER_SOFTC(minor(kdev)); - DRM_DEBUG( "open_count = %d\n", dev->open_count ); + DRM_DEBUG("open_count = %d\n", dev->open_count); retcode = drm_open_helper(kdev, flags, fmt, p, dev); - if ( !retcode ) { + if (!retcode) { atomic_inc( &dev->counts[_DRM_STAT_OPENS] ); DRM_LOCK(); #ifdef __FreeBSD__ device_busy(dev->device); #endif - if ( !dev->open_count++ ) + if (!dev->open_count++) retcode = drm_firstopen(dev); DRM_UNLOCK(); } @@ -737,7 +737,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) drm_file_t *file_priv; int retcode = 0; - DRM_DEBUG( "open_count = %d\n", dev->open_count ); + DRM_DEBUG("open_count = %d\n", dev->open_count); DRM_LOCK(); @@ -759,11 +759,11 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) */ #ifdef __FreeBSD__ - DRM_DEBUG( "pid = %d, device = 0x%lx, open_count = %d\n", - DRM_CURRENTPID, (long)dev->device, dev->open_count ); + DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n", + DRM_CURRENTPID, (long)dev->device, dev->open_count); #elif defined(__NetBSD__) || defined(__OpenBSD__) - DRM_DEBUG( "pid = %d, device = 0x%lx, open_count = %d\n", - DRM_CURRENTPID, (long)&dev->device, dev->open_count); + DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n", + DRM_CURRENTPID, (long)&dev->device, dev->open_count); #endif if (dev->lock.hw_lock && _DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) @@ -785,7 +785,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) dev->lock.hw_lock != NULL) { /* The lock is required to reclaim buffers */ for (;;) { - if ( !dev->lock.hw_lock ) { + if (!dev->lock.hw_lock) { /* Device has been unregistered */ retcode = EINTR; break; @@ -875,13 +875,13 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, ++file_priv->ioctl_count; #ifdef __FreeBSD__ - DRM_DEBUG( "pid=%d, cmd=0x%02lx, nr=0x%02x, dev 0x%lx, auth=%d\n", + DRM_DEBUG("pid=%d, cmd=0x%02lx, nr=0x%02x, dev 0x%lx, auth=%d\n", DRM_CURRENTPID, cmd, nr, (long)dev->device, - file_priv->authenticated ); + file_priv->authenticated); #elif defined(__NetBSD__) || defined(__OpenBSD__) - DRM_DEBUG( "pid=%d, cmd=0x%02lx, nr=0x%02x, dev 0x%lx, auth=%d\n", + DRM_DEBUG("pid=%d, cmd=0x%02lx, nr=0x%02x, dev 0x%lx, auth=%d\n", DRM_CURRENTPID, cmd, nr, (long)&dev->device, - file_priv->authenticated ); + file_priv->authenticated); #endif switch (cmd) { @@ -933,7 +933,7 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, func = ioctl->func; if (func == NULL) { - DRM_DEBUG( "no function\n" ); + DRM_DEBUG("no function\n"); return EINVAL; } diff --git a/bsd-core/drm_ioctl.c b/bsd-core/drm_ioctl.c index 26919982..0e996618 100644 --- a/bsd-core/drm_ioctl.c +++ b/bsd-core/drm_ioctl.c @@ -155,7 +155,7 @@ int drm_getmap(struct drm_device *dev, void *data, struct drm_file *file_priv) } TAILQ_FOREACH(mapinlist, &dev->maplist, link) { - if (i==idx) { + if (i == idx) { map->offset = mapinlist->offset; map->size = mapinlist->size; map->type = mapinlist->type; @@ -186,8 +186,7 @@ int drm_getclient(struct drm_device *dev, void *data, idx = client->idx; DRM_LOCK(); TAILQ_FOREACH(pt, &dev->files, link) { - if (i==idx) - { + if (i == idx) { client->auth = pt->authenticated; client->pid = pt->pid; client->uid = pt->uid; diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index 92861036..241908c7 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -49,7 +49,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data, irq->irq = dev->irq; DRM_DEBUG("%d:%d:%d => IRQ %d\n", - irq->busnum, irq->devnum, irq->funcnum, irq->irq); + irq->busnum, irq->devnum, irq->funcnum, irq->irq); return 0; } @@ -161,7 +161,7 @@ int drm_irq_install(struct drm_device *dev) if (dev->irq == 0 || dev->dev_private == NULL) return EINVAL; - DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, dev->irq ); + DRM_DEBUG("irq=%d\n", dev->irq); DRM_LOCK(); if (dev->irq_enabled) { @@ -172,11 +172,11 @@ int drm_irq_install(struct drm_device *dev) dev->context_flag = 0; - /* Before installing handler */ + /* Before installing handler */ dev->driver->irq_preinstall(dev); DRM_UNLOCK(); - /* Install handler */ + /* Install handler */ #ifdef __FreeBSD__ dev->irqrid = 0; dev->irqr = bus_alloc_resource_any(dev->device, SYS_RES_IRQ, @@ -209,7 +209,7 @@ int drm_irq_install(struct drm_device *dev) } #endif - /* After installing handler */ + /* After installing handler */ DRM_LOCK(); dev->driver->irq_postinstall(dev); DRM_UNLOCK(); @@ -245,7 +245,7 @@ int drm_irq_uninstall(struct drm_device *dev) dev->irqrid = 0; #endif - DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, dev->irq ); + DRM_DEBUG("irq=%d\n", dev->irq); dev->driver->irq_uninstall(dev); @@ -267,7 +267,7 @@ int drm_control(struct drm_device *dev, void *data, struct drm_file *file_priv) struct drm_control *ctl = data; int err; - switch ( ctl->func ) { + switch (ctl->func) { case DRM_INST_HANDLER: /* Handle drivers whose DRM used to require IRQ setup but the * no longer does. @@ -367,7 +367,7 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, DRM_DEBUG("num_crtcs=%d\n", dev->num_crtcs); /* If drm_vblank_init() hasn't been called yet, just no-op */ if (!dev->num_crtcs) - goto out; + goto out; crtc = modeset->crtc; DRM_DEBUG("crtc=%d\n", crtc); @@ -435,7 +435,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_pr ret = drm_vblank_get(dev, crtc); if (ret) - return ret; + return ret; seq = drm_vblank_count(dev, crtc); switch (vblwait->request.type & _DRM_VBLANK_TYPES_MASK) { @@ -512,7 +512,7 @@ void drm_vbl_send_signals(struct drm_device *dev, int crtc ) while (vbl_sig != NULL) { drm_vbl_sig_t *next = TAILQ_NEXT(vbl_sig, link); - if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) { + if ((vbl_seq - vbl_sig->sequence) <= (1 << 23)) { p = pfind(vbl_sig->pid); if (p != NULL) psignal(p, vbl_sig->signo); diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index 870874bb..523d0409 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -55,21 +55,23 @@ int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context) do { old = *lock; - if (old & _DRM_LOCK_HELD) new = old | _DRM_LOCK_CONT; - else new = context | _DRM_LOCK_HELD; + if (old & _DRM_LOCK_HELD) + new = old | _DRM_LOCK_CONT; + else + new = context | _DRM_LOCK_HELD; } while (!atomic_cmpset_int(lock, old, new)); if (_DRM_LOCKING_CONTEXT(old) == context) { if (old & _DRM_LOCK_HELD) { if (context != DRM_KERNEL_CONTEXT) { DRM_ERROR("%d holds heavyweight lock\n", - context); + context); } return 0; } } if (new == (context | _DRM_LOCK_HELD)) { - /* Have lock */ + /* Have lock */ return 1; } return 0; @@ -84,8 +86,8 @@ int drm_lock_transfer(struct drm_device *dev, dev->lock.file_priv = NULL; do { - old = *lock; - new = context | _DRM_LOCK_HELD; + old = *lock; + new = context | _DRM_LOCK_HELD; } while (!atomic_cmpset_int(lock, old, new)); return 1; @@ -98,8 +100,8 @@ int drm_lock_free(struct drm_device *dev, dev->lock.file_priv = NULL; do { - old = *lock; - new = 0; + old = *lock; + new = 0; } while (!atomic_cmpset_int(lock, old, new)); if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) { @@ -113,22 +115,22 @@ int drm_lock_free(struct drm_device *dev, int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_lock *lock = data; - int ret = 0; + struct drm_lock *lock = data; + int ret = 0; - if (lock->context == DRM_KERNEL_CONTEXT) { - DRM_ERROR("Process %d using kernel context %d\n", + if (lock->context == DRM_KERNEL_CONTEXT) { + DRM_ERROR("Process %d using kernel context %d\n", DRM_CURRENTPID, lock->context); - return EINVAL; - } + return EINVAL; + } - DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n", + DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n", lock->context, DRM_CURRENTPID, dev->lock.hw_lock->lock, lock->flags); if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE) && lock->context < 0) - return EINVAL; + return EINVAL; DRM_LOCK(); for (;;) { diff --git a/bsd-core/drm_scatter.c b/bsd-core/drm_scatter.c index e26befc1..60d098c1 100644 --- a/bsd-core/drm_scatter.c +++ b/bsd-core/drm_scatter.c @@ -51,21 +51,21 @@ int drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather * request) unsigned long pages; int i; - if ( dev->sg ) + if (dev->sg) return EINVAL; entry = malloc(sizeof(*entry), M_DRM, M_WAITOK | M_ZERO); - if ( !entry ) + if (!entry) return ENOMEM; pages = round_page(request->size) / PAGE_SIZE; - DRM_DEBUG( "sg size=%ld pages=%ld\n", request->size, pages ); + DRM_DEBUG("sg size=%ld pages=%ld\n", request->size, pages); entry->pages = pages; entry->busaddr = malloc(pages * sizeof(*entry->busaddr), M_DRM, M_WAITOK | M_ZERO); - if ( !entry->busaddr ) { + if (!entry->busaddr) { drm_sg_cleanup(entry); return ENOMEM; } @@ -81,7 +81,7 @@ int drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather * request) entry->busaddr[i] = vtophys(entry->handle + i * PAGE_SIZE); } - DRM_DEBUG( "sg alloc handle = %08lx\n", entry->handle ); + DRM_DEBUG("sg alloc handle = %08lx\n", entry->handle); entry->virtual = (void *)entry->handle; request->handle = entry->handle; @@ -104,7 +104,7 @@ int drm_sg_alloc_ioctl(struct drm_device *dev, void *data, struct drm_scatter_gather *request = data; int ret; - DRM_DEBUG( "%s\n", __FUNCTION__ ); + DRM_DEBUG("%s\n", __FUNCTION__); ret = drm_sg_alloc(dev, request); return ret; @@ -120,10 +120,10 @@ int drm_sg_free(struct drm_device *dev, void *data, struct drm_file *file_priv) dev->sg = NULL; DRM_UNLOCK(); - if ( !entry || entry->handle != request->handle ) + if (!entry || entry->handle != request->handle) return EINVAL; - DRM_DEBUG( "sg free virtual = 0x%lx\n", entry->handle ); + DRM_DEBUG("sg free virtual = 0x%lx\n", entry->handle); drm_sg_cleanup(entry); -- cgit v1.2.3 From 31709aa2be54877c45ca382bf370b41dbaf5c2ec Mon Sep 17 00:00:00 2001 From: vehemens Date: Tue, 2 Sep 2008 13:56:35 -0700 Subject: Reorder lock functions like linux. Signed-off-by: Robert Noland --- bsd-core/drm_lock.c | 128 ++++++++++++++++++++++++++-------------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index 523d0409..fe66eca0 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -49,70 +49,6 @@ #include "drmP.h" -int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context) -{ - unsigned int old, new; - - do { - old = *lock; - if (old & _DRM_LOCK_HELD) - new = old | _DRM_LOCK_CONT; - else - new = context | _DRM_LOCK_HELD; - } while (!atomic_cmpset_int(lock, old, new)); - - if (_DRM_LOCKING_CONTEXT(old) == context) { - if (old & _DRM_LOCK_HELD) { - if (context != DRM_KERNEL_CONTEXT) { - DRM_ERROR("%d holds heavyweight lock\n", - context); - } - return 0; - } - } - if (new == (context | _DRM_LOCK_HELD)) { - /* Have lock */ - return 1; - } - return 0; -} - -/* This takes a lock forcibly and hands it to context. Should ONLY be used - inside *_unlock to give lock to kernel before calling *_dma_schedule. */ -int drm_lock_transfer(struct drm_device *dev, - __volatile__ unsigned int *lock, unsigned int context) -{ - unsigned int old, new; - - dev->lock.file_priv = NULL; - do { - old = *lock; - new = context | _DRM_LOCK_HELD; - } while (!atomic_cmpset_int(lock, old, new)); - - return 1; -} - -int drm_lock_free(struct drm_device *dev, - __volatile__ unsigned int *lock, unsigned int context) -{ - unsigned int old, new; - - dev->lock.file_priv = NULL; - do { - old = *lock; - new = 0; - } while (!atomic_cmpset_int(lock, old, new)); - - if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) { - DRM_ERROR("%d freed heavyweight lock held by %d\n", - context, _DRM_LOCKING_CONTEXT(old)); - return 1; - } - DRM_WAKEUP_INT((void *)&dev->lock.lock_queue); - return 0; -} - int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_lock *lock = data; @@ -202,3 +138,67 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) return 0; } + +int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context) +{ + unsigned int old, new; + + do { + old = *lock; + if (old & _DRM_LOCK_HELD) + new = old | _DRM_LOCK_CONT; + else + new = context | _DRM_LOCK_HELD; + } while (!atomic_cmpset_int(lock, old, new)); + + if (_DRM_LOCKING_CONTEXT(old) == context) { + if (old & _DRM_LOCK_HELD) { + if (context != DRM_KERNEL_CONTEXT) { + DRM_ERROR("%d holds heavyweight lock\n", + context); + } + return 0; + } + } + if (new == (context | _DRM_LOCK_HELD)) { + /* Have lock */ + return 1; + } + return 0; +} + +/* This takes a lock forcibly and hands it to context. Should ONLY be used + inside *_unlock to give lock to kernel before calling *_dma_schedule. */ +int drm_lock_transfer(struct drm_device *dev, + __volatile__ unsigned int *lock, unsigned int context) +{ + unsigned int old, new; + + dev->lock.file_priv = NULL; + do { + old = *lock; + new = context | _DRM_LOCK_HELD; + } while (!atomic_cmpset_int(lock, old, new)); + + return 1; +} + +int drm_lock_free(struct drm_device *dev, + __volatile__ unsigned int *lock, unsigned int context) +{ + unsigned int old, new; + + dev->lock.file_priv = NULL; + do { + old = *lock; + new = 0; + } while (!atomic_cmpset_int(lock, old, new)); + + if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) { + DRM_ERROR("%d freed heavyweight lock held by %d\n", + context, _DRM_LOCKING_CONTEXT(old)); + return 1; + } + DRM_WAKEUP_INT((void *)&dev->lock.lock_queue); + return 0; +} -- cgit v1.2.3 From 6f2479c67432f764bfc4e248689f1737c1935237 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Sat, 6 Sep 2008 18:37:06 -0400 Subject: [FreeBSD] Ensure that drm_pci_alloc is never called while locks are held. --- bsd-core/ati_pcigart.c | 13 +++++++++---- bsd-core/drm_bufs.c | 2 ++ bsd-core/drm_pci.c | 13 +++++++++---- shared-core/i915_dma.c | 20 ++++++++++++++------ shared-core/mach64_dma.c | 6 ++++++ 5 files changed, 40 insertions(+), 14 deletions(-) diff --git a/bsd-core/ati_pcigart.c b/bsd-core/ati_pcigart.c index f8d3f18d..c4453ed5 100644 --- a/bsd-core/ati_pcigart.c +++ b/bsd-core/ati_pcigart.c @@ -42,12 +42,17 @@ static int drm_ati_alloc_pcigart_table(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info) { - dev->sg->dmah = drm_pci_alloc(dev, gart_info->table_size, - PAGE_SIZE, - gart_info->table_mask); - if (dev->sg->dmah == NULL) + drm_dma_handle_t *dmah; + + DRM_UNLOCK(); + dmah = drm_pci_alloc(dev, gart_info->table_size, PAGE_SIZE, + gart_info->table_mask); + DRM_LOCK(); + if (dmah == NULL) return ENOMEM; + dev->sg->dmah = dmah; + return 0; } diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index 45e01470..94f51386 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -595,8 +595,10 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque page_count = 0; while (entry->buf_count < count) { + DRM_SPINUNLOCK(&dev->dma_lock); drm_dma_handle_t *dmah = drm_pci_alloc(dev, size, alignment, 0xfffffffful); + DRM_SPINLOCK(&dev->dma_lock); if (dmah == NULL) { /* Set count correctly so we free the proper amount. */ entry->buf_count = count; diff --git a/bsd-core/drm_pci.c b/bsd-core/drm_pci.c index f23b2a5b..16c830ec 100644 --- a/bsd-core/drm_pci.c +++ b/bsd-core/drm_pci.c @@ -71,7 +71,14 @@ drm_pci_alloc(struct drm_device *dev, size_t size, return NULL; #ifdef __FreeBSD__ - DRM_UNLOCK(); + /* Make sure we aren't holding locks here */ + mtx_assert(&dev->dev_lock, MA_NOTOWNED); + if (mtx_owned(&dev->dev_lock)) + DRM_ERROR("called while holding dev_lock\n"); + mtx_assert(&dev->dma_lock, MA_NOTOWNED); + if (mtx_owned(&dev->dma_lock)) + DRM_ERROR("called while holding dma_lock\n"); + ret = bus_dma_tag_create(NULL, align, 0, /* tag, align, boundary */ maxaddr, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ NULL, NULL, /* filtfunc, filtfuncargs */ @@ -80,7 +87,6 @@ drm_pci_alloc(struct drm_device *dev, size_t size, &dmah->tag); if (ret != 0) { free(dmah, M_DRM); - DRM_LOCK(); return NULL; } @@ -89,10 +95,9 @@ drm_pci_alloc(struct drm_device *dev, size_t size, if (ret != 0) { bus_dma_tag_destroy(dmah->tag); free(dmah, M_DRM); - DRM_LOCK(); return NULL; } - DRM_LOCK(); + ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, size, drm_pci_busdma_callback, dmah, 0); if (ret != 0) { diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index c874ce28..619e6ac2 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -72,16 +72,24 @@ int i915_wait_ring(struct drm_device * dev, int n, const char *caller) int i915_init_hardware_status(struct drm_device *dev) { drm_i915_private_t *dev_priv = dev->dev_private; - /* Program Hardware Status Page */ - dev_priv->status_page_dmah = - drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff); + drm_dma_handle_t *dmah; - if (!dev_priv->status_page_dmah) { + /* Program Hardware Status Page */ +#ifdef __FreeBSD__ + DRM_UNLOCK(); +#endif + dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff); +#ifdef __FreeBSD__ + DRM_LOCK(); +#endif + if (!dmah) { DRM_ERROR("Can not allocate hardware status page\n"); return -ENOMEM; } - dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr; - dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; + + dev_priv->status_page_dmah = dmah; + dev_priv->hw_status_page = dmah->vaddr; + dev_priv->dma_status_page = dmah->busaddr; memset(dev_priv->hw_status_page, 0, PAGE_SIZE); diff --git a/shared-core/mach64_dma.c b/shared-core/mach64_dma.c index 339234fa..3f2367ba 100644 --- a/shared-core/mach64_dma.c +++ b/shared-core/mach64_dma.c @@ -834,8 +834,14 @@ static int mach64_bm_dma_test(struct drm_device * dev) /* FIXME: get a dma buffer from the freelist here */ DRM_DEBUG("Allocating data memory ...\n"); +#ifdef __FreeBSD__ + DRM_UNLOCK(); +#endif cpu_addr_dmah = drm_pci_alloc(dev, 0x1000, 0x1000, 0xfffffffful); +#ifdef __FreeBSD__ + DRM_LOCK(); +#endif if (!cpu_addr_dmah) { DRM_INFO("data-memory allocation failed!\n"); return -ENOMEM; -- cgit v1.2.3 From 0808cf923d4a851b100d9b7022cb82f5e1f52e28 Mon Sep 17 00:00:00 2001 From: vehemens Date: Sat, 6 Sep 2008 14:16:51 -0700 Subject: Style white space cleanup part 2. Signed-off-by: Robert Noland --- bsd-core/drm_auth.c | 3 ++- bsd-core/drm_bufs.c | 8 ++++---- bsd-core/drm_context.c | 8 ++++---- bsd-core/drm_drv.c | 14 +++++++------- bsd-core/drm_ioctl.c | 7 +++---- bsd-core/drm_irq.c | 2 +- bsd-core/drm_lock.c | 2 +- bsd-core/drm_scatter.c | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/bsd-core/drm_auth.c b/bsd-core/drm_auth.c index 2f836189..455a7164 100644 --- a/bsd-core/drm_auth.c +++ b/bsd-core/drm_auth.c @@ -75,7 +75,8 @@ static int drm_add_magic(struct drm_device *dev, drm_file_t *priv, hash = drm_hash_magic(magic); entry = malloc(sizeof(*entry), M_DRM, M_ZERO | M_NOWAIT); - if (!entry) return ENOMEM; + if (!entry) + return ENOMEM; entry->magic = magic; entry->priv = priv; entry->next = NULL; diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index 94f51386..9d2b52de 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -611,14 +611,14 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque entry->seglist[entry->seg_count++] = dmah; for (i = 0; i < (1 << page_order); i++) { DRM_DEBUG("page %d @ %p\n", - dma->page_count + page_count, - (char *)dmah->vaddr + PAGE_SIZE * i); + dma->page_count + page_count, + (char *)dmah->vaddr + PAGE_SIZE * i); temp_pagelist[dma->page_count + page_count++] = (long)dmah->vaddr + PAGE_SIZE * i; } for (offset = 0; - offset + size <= total && entry->buf_count < count; - offset += alignment, ++entry->buf_count) { + offset + size <= total && entry->buf_count < count; + offset += alignment, ++entry->buf_count) { buf = &entry->buflist[entry->buf_count]; buf->idx = dma->buf_count + entry->buf_count; buf->total = alignment; diff --git a/bsd-core/drm_context.c b/bsd-core/drm_context.c index 24f34fdd..bca899cb 100644 --- a/bsd-core/drm_context.c +++ b/bsd-core/drm_context.c @@ -108,7 +108,7 @@ int drm_ctxbitmap_init(struct drm_device *dev) DRM_LOCK(); dev->ctx_bitmap = malloc(PAGE_SIZE, M_DRM, M_NOWAIT | M_ZERO); - if ( dev->ctx_bitmap == NULL ) { + if (dev->ctx_bitmap == NULL) { DRM_UNLOCK(); return ENOMEM; } @@ -214,9 +214,9 @@ int drm_context_switch_complete(struct drm_device *dev, int new) /* If a context switch is ever initiated when the kernel holds the lock, release that lock here. */ - clear_bit(0, &dev->context_flag); + clear_bit(0, &dev->context_flag); - return 0; + return 0; } int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) @@ -229,7 +229,7 @@ int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv) bzero(&ctx, sizeof(ctx)); for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { ctx.handle = i; - if (DRM_COPY_TO_USER( &res->contexts[i], + if (DRM_COPY_TO_USER(&res->contexts[i], &ctx, sizeof(ctx))) return EFAULT; } diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 9056c76c..860b8282 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -408,7 +408,7 @@ static int drm_firstopen(struct drm_device *dev) return i; } - for ( i = 0 ; i < DRM_HASH_SIZE ; i++ ) { + for (i = 0; i < DRM_HASH_SIZE; i++) { dev->magiclist[i].head = NULL; dev->magiclist[i].tail = NULL; } @@ -474,7 +474,7 @@ static int drm_lastclose(struct drm_device *dev) */ for (entry = dev->agp->memory; entry; entry = nexte) { nexte = entry->next; - if ( entry->bound ) + if (entry->bound) drm_agp_unbind_memory(entry->handle); drm_agp_free_memory(entry->handle); free(entry, M_DRM); @@ -543,7 +543,7 @@ static int drm_load(struct drm_device *dev) dev->types[5] = _DRM_STAT_UNLOCKS; for (i = 0; i < DRM_ARRAY_SIZE(dev->counts); i++) - atomic_set( &dev->counts[i], 0 ); + atomic_set(&dev->counts[i], 0); if (dev->driver->load != NULL) { DRM_LOCK(); @@ -718,7 +718,7 @@ int drm_open(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) retcode = drm_open_helper(kdev, flags, fmt, p, dev); if (!retcode) { - atomic_inc( &dev->counts[_DRM_STAT_OPENS] ); + atomic_inc(&dev->counts[_DRM_STAT_OPENS]); DRM_LOCK(); #ifdef __FreeBSD__ device_busy(dev->device); @@ -794,7 +794,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) DRM_KERNEL_CONTEXT)) { dev->lock.file_priv = file_priv; dev->lock.lock_time = jiffies; - atomic_inc( &dev->counts[_DRM_STAT_LOCKS] ); + atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); break; /* Got lock */ } /* Contention */ @@ -837,7 +837,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) */ done: - atomic_inc( &dev->counts[_DRM_STAT_CLOSES] ); + atomic_inc(&dev->counts[_DRM_STAT_CLOSES]); #ifdef __FreeBSD__ device_unbusy(dev->device); #endif @@ -871,7 +871,7 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, return EINVAL; } - atomic_inc( &dev->counts[_DRM_STAT_IOCTLS] ); + atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]); ++file_priv->ioctl_count; #ifdef __FreeBSD__ diff --git a/bsd-core/drm_ioctl.c b/bsd-core/drm_ioctl.c index 0e996618..ad6bd819 100644 --- a/bsd-core/drm_ioctl.c +++ b/bsd-core/drm_ioctl.c @@ -213,12 +213,11 @@ int drm_getstats(struct drm_device *dev, void *data, struct drm_file *file_priv) for (i = 0; i < dev->counters; i++) { if (dev->types[i] == _DRM_STAT_LOCK) - stats->data[i].value - = (dev->lock.hw_lock - ? dev->lock.hw_lock->lock : 0); + stats->data[i].value = + (dev->lock.hw_lock ? dev->lock.hw_lock->lock : 0); else stats->data[i].value = atomic_read(&dev->counts[i]); - stats->data[i].type = dev->types[i]; + stats->data[i].type = dev->types[i]; } stats->count = dev->counters; diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index 241908c7..08a0dbc4 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -103,7 +103,7 @@ static void drm_vblank_cleanup(struct drm_device *dev) /* Bail if the driver didn't call drm_vblank_init() */ if (dev->num_crtcs == 0) - return; + return; DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags); callout_stop(&dev->vblank_disable_timer); diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index fe66eca0..631df8e1 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -196,7 +196,7 @@ int drm_lock_free(struct drm_device *dev, if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) { DRM_ERROR("%d freed heavyweight lock held by %d\n", - context, _DRM_LOCKING_CONTEXT(old)); + context, _DRM_LOCKING_CONTEXT(old)); return 1; } DRM_WAKEUP_INT((void *)&dev->lock.lock_queue); diff --git a/bsd-core/drm_scatter.c b/bsd-core/drm_scatter.c index 60d098c1..550e6f88 100644 --- a/bsd-core/drm_scatter.c +++ b/bsd-core/drm_scatter.c @@ -123,7 +123,7 @@ int drm_sg_free(struct drm_device *dev, void *data, struct drm_file *file_priv) if (!entry || entry->handle != request->handle) return EINVAL; - DRM_DEBUG("sg free virtual = 0x%lx\n", entry->handle); + DRM_DEBUG("sg free virtual = 0x%lx\n", entry->handle); drm_sg_cleanup(entry); -- cgit v1.2.3 From b8a9cebddc7063bc0dae889dac43359c0cb9bfa5 Mon Sep 17 00:00:00 2001 From: vehemens Date: Sat, 6 Sep 2008 14:19:32 -0700 Subject: Move order to end like linux. Signed-off-by: Robert Noland --- bsd-core/drm_bufs.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index 9d2b52de..2570641d 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -36,22 +36,6 @@ #include "drmP.h" -/* - * Compute order. Can be made faster. - */ -int drm_order(unsigned long size) -{ - int order; - unsigned long tmp; - - for (order = 0, tmp = size; tmp >>= 1; ++order); - - if (size & ~(1 << order)) - ++order; - - return order; -} - /* Allocation of PCI memory resources (framebuffer, registers, etc.) for * drm_get_resource_*. Note that they are not RF_ACTIVE, so there's no virtual * address for accessing them. Cleaned up at unload. @@ -1131,3 +1115,19 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) return retcode; } + +/* + * Compute order. Can be made faster. + */ +int drm_order(unsigned long size) +{ + int order; + unsigned long tmp; + + for (order = 0, tmp = size; tmp >>= 1; ++order); + + if (size & ~(1 << order)) + ++order; + + return order; +} -- cgit v1.2.3 From 9ad5a6d0d73ba58ec7c2f66d0c5355185f2f68c6 Mon Sep 17 00:00:00 2001 From: vehemens Date: Sat, 6 Sep 2008 15:33:47 -0700 Subject: Pass lock data like linux and open. Signed-off-by: Robert Noland --- bsd-core/drmP.h | 10 ++++------ bsd-core/drm_drv.c | 8 +++----- bsd-core/drm_irq.c | 4 ++-- bsd-core/drm_lock.c | 23 ++++++++++++----------- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 7244b353..f8705e36 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -911,13 +911,11 @@ void drm_ctxbitmap_free(struct drm_device *dev, int ctx_handle); int drm_ctxbitmap_next(struct drm_device *dev); /* Locking IOCTL support (drm_lock.c) */ -int drm_lock_take(__volatile__ unsigned int *lock, - unsigned int context); -int drm_lock_transfer(struct drm_device *dev, - __volatile__ unsigned int *lock, +int drm_lock_take(struct drm_lock_data *lock_data, + unsigned int context); +int drm_lock_transfer(struct drm_lock_data *lock_data, unsigned int context); -int drm_lock_free(struct drm_device *dev, - __volatile__ unsigned int *lock, +int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context); /* Buffer management support (drm_bufs.c) */ diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 860b8282..b40d1da4 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -774,7 +774,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) if (dev->driver->reclaim_buffers_locked != NULL) dev->driver->reclaim_buffers_locked(dev, file_priv); - drm_lock_free(dev, &dev->lock.hw_lock->lock, + drm_lock_free(&dev->lock, _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock)); /* FIXME: may require heavy-handed reset of @@ -790,8 +790,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) retcode = EINTR; break; } - if (drm_lock_take(&dev->lock.hw_lock->lock, - DRM_KERNEL_CONTEXT)) { + if (drm_lock_take(&dev->lock, DRM_KERNEL_CONTEXT)) { dev->lock.file_priv = file_priv; dev->lock.lock_time = jiffies; atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); @@ -810,8 +809,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) } if (retcode == 0) { dev->driver->reclaim_buffers_locked(dev, file_priv); - drm_lock_free(dev, &dev->lock.hw_lock->lock, - DRM_KERNEL_CONTEXT); + drm_lock_free(&dev->lock, DRM_KERNEL_CONTEXT); } } diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index 08a0dbc4..e3a4cb6a 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -540,7 +540,7 @@ static void drm_locked_task(void *context, int pending __unused) DRM_LOCK(); /* XXX drm_lock_take() should do it's own locking */ if (dev->locked_task_call == NULL || - drm_lock_take(&dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT) == 0) { + drm_lock_take(&dev->lock, DRM_KERNEL_CONTEXT) == 0) { DRM_UNLOCK(); DRM_SPINUNLOCK(&dev->tsk_lock); return; @@ -554,7 +554,7 @@ static void drm_locked_task(void *context, int pending __unused) dev->locked_task_call(dev); - drm_lock_free(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT); + drm_lock_free(&dev->lock, DRM_KERNEL_CONTEXT); dev->locked_task_call = NULL; diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index 631df8e1..31badd34 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -70,7 +70,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) DRM_LOCK(); for (;;) { - if (drm_lock_take(&dev->lock.hw_lock->lock, lock->context)) { + if (drm_lock_take(&dev->lock, lock->context)) { dev->lock.file_priv = file_priv; dev->lock.lock_time = jiffies; atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); @@ -129,9 +129,9 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]); DRM_LOCK(); - drm_lock_transfer(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT); + drm_lock_transfer(&dev->lock, DRM_KERNEL_CONTEXT); - if (drm_lock_free(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT)) { + if (drm_lock_free(&dev->lock, DRM_KERNEL_CONTEXT)) { DRM_ERROR("\n"); } DRM_UNLOCK(); @@ -139,8 +139,9 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) return 0; } -int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context) +int drm_lock_take(struct drm_lock_data *lock_data, unsigned int context) { + volatile unsigned int *lock = &lock_data->hw_lock->lock; unsigned int old, new; do { @@ -169,12 +170,12 @@ int drm_lock_take(__volatile__ unsigned int *lock, unsigned int context) /* This takes a lock forcibly and hands it to context. Should ONLY be used inside *_unlock to give lock to kernel before calling *_dma_schedule. */ -int drm_lock_transfer(struct drm_device *dev, - __volatile__ unsigned int *lock, unsigned int context) +int drm_lock_transfer(struct drm_lock_data *lock_data, unsigned int context) { + volatile unsigned int *lock = &lock_data->hw_lock->lock; unsigned int old, new; - dev->lock.file_priv = NULL; + lock_data->file_priv = NULL; do { old = *lock; new = context | _DRM_LOCK_HELD; @@ -183,12 +184,12 @@ int drm_lock_transfer(struct drm_device *dev, return 1; } -int drm_lock_free(struct drm_device *dev, - __volatile__ unsigned int *lock, unsigned int context) +int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context) { + volatile unsigned int *lock = &lock_data->hw_lock->lock; unsigned int old, new; - dev->lock.file_priv = NULL; + lock_data->file_priv = NULL; do { old = *lock; new = 0; @@ -199,6 +200,6 @@ int drm_lock_free(struct drm_device *dev, context, _DRM_LOCKING_CONTEXT(old)); return 1; } - DRM_WAKEUP_INT((void *)&dev->lock.lock_queue); + DRM_WAKEUP_INT((void *)&lock_data->lock_queue); return 0; } -- cgit v1.2.3 From be5fad45ee4e81997784f258fcdfaf0a303dd666 Mon Sep 17 00:00:00 2001 From: vehemens Date: Sat, 6 Sep 2008 18:02:31 -0700 Subject: Free temp_pagelist on error. Free in reverse order. Noticed by open. Signed-off-by: Robert Noland --- bsd-core/drm_bufs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index 2570641d..6b31ad65 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -562,8 +562,9 @@ static int drm_do_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *reque if (entry->buflist == NULL || entry->seglist == NULL || temp_pagelist == NULL) { - free(entry->buflist, M_DRM); + free(temp_pagelist, M_DRM); free(entry->seglist, M_DRM); + free(entry->buflist, M_DRM); return ENOMEM; } -- cgit v1.2.3 From 740f09bffde20d9207497bd107d50941ca21278a Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Sat, 6 Sep 2008 21:08:33 -0400 Subject: [FreeBSD] IGP gart needs to be un-cached. Airlied inadvertently discovered that the IGP gart needs to be un-cached for radeon rs485 and rs690 to work. Initial tests by placing a wbinvd() after allocating the gart were successful. This is an attempt at a more appropriate method of achieving success. --- bsd-core/ati_pcigart.c | 91 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 18 deletions(-) diff --git a/bsd-core/ati_pcigart.c b/bsd-core/ati_pcigart.c index c4453ed5..5feeeba8 100644 --- a/bsd-core/ati_pcigart.c +++ b/bsd-core/ati_pcigart.c @@ -39,31 +39,86 @@ #define ATI_PCIE_WRITE 0x4 #define ATI_PCIE_READ 0x8 -static int drm_ati_alloc_pcigart_table(struct drm_device *dev, - struct drm_ati_pcigart_info *gart_info) +static void +drm_ati_alloc_pcigart_table_cb(void *arg, bus_dma_segment_t *segs, + int nsegs, int error) { - drm_dma_handle_t *dmah; + struct drm_dma_handle *dmah = arg; + + if (error != 0) + return; + + KASSERT(nsegs == 1, + ("drm_ati_alloc_pcigart_table_cb: bad dma segment count")); + + dmah->busaddr = segs[0].ds_addr; +} + +static int +drm_ati_alloc_pcigart_table(struct drm_device *dev, + struct drm_ati_pcigart_info *gart_info) +{ + struct drm_dma_handle *dmah; + int flags, ret; + + dmah = malloc(sizeof(struct drm_dma_handle), M_DRM, M_ZERO | M_NOWAIT); + if (dmah == NULL) + return ENOMEM; DRM_UNLOCK(); - dmah = drm_pci_alloc(dev, gart_info->table_size, PAGE_SIZE, - gart_info->table_mask); + ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */ + gart_info->table_mask, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */ + NULL, NULL, /* filtfunc, filtfuncargs */ + gart_info->table_size, 1, /* maxsize, nsegs */ + gart_info->table_size, /* maxsegsize */ + BUS_DMA_ALLOCNOW, NULL, NULL, /* flags, lockfunc, lockfuncargs */ + &dmah->tag); + if (ret != 0) { + free(dmah, M_DRM); + return ENOMEM; + } + + flags = BUS_DMA_NOWAIT | BUS_DMA_ZERO; + if (gart_info->gart_reg_if == DRM_ATI_GART_IGP) + flags |= BUS_DMA_NOCACHE; + + ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, flags, &dmah->map); + if (ret != 0) { + bus_dma_tag_destroy(dmah->tag); + free(dmah, M_DRM); + return ENOMEM; + } DRM_LOCK(); - if (dmah == NULL) + + ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, + gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah, 0); + if (ret != 0) { + bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); + bus_dma_tag_destroy(dmah->tag); + free(dmah, M_DRM); return ENOMEM; + } dev->sg->dmah = dmah; return 0; } -static void drm_ati_free_pcigart_table(struct drm_device *dev, - struct drm_ati_pcigart_info *gart_info) +static void +drm_ati_free_pcigart_table(struct drm_device *dev, + struct drm_ati_pcigart_info *gart_info) { - drm_pci_free(dev, dev->sg->dmah); + struct drm_dma_handle *dmah = dev->sg->dmah; + + bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); + bus_dma_tag_destroy(dmah->tag); + free(dmah, M_DRM); dev->sg->dmah = NULL; } -int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info) +int +drm_ati_pcigart_cleanup(struct drm_device *dev, + struct drm_ati_pcigart_info *gart_info) { /* we need to support large memory configurations */ if (dev->sg == NULL) { @@ -82,17 +137,17 @@ int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info return 1; } -int drm_ati_pcigart_init(struct drm_device *dev, - struct drm_ati_pcigart_info *gart_info) +int +drm_ati_pcigart_init(struct drm_device *dev, + struct drm_ati_pcigart_info *gart_info) { - void *address = NULL; unsigned long pages; u32 *pci_gart, page_base; dma_addr_t bus_address = 0; + dma_addr_t entry_addr; int i, j, ret = 0; int max_pages; - dma_addr_t entry_addr; /* we need to support large memory configurations */ if (dev->sg == NULL) { @@ -134,12 +189,14 @@ int drm_ati_pcigart_init(struct drm_device *dev, page_base = (u32) entry_addr & ATI_PCIGART_PAGE_MASK; switch(gart_info->gart_reg_if) { case DRM_ATI_GART_IGP: - page_base |= (upper_32_bits(entry_addr) & 0xff) << 4; + page_base |= + (upper_32_bits(entry_addr) & 0xff) << 4; page_base |= 0xc; break; case DRM_ATI_GART_PCIE: page_base >>= 8; - page_base |= (upper_32_bits(entry_addr) & 0xff) << 24; + page_base |= + (upper_32_bits(entry_addr) & 0xff) << 24; page_base |= ATI_PCIE_READ | ATI_PCIE_WRITE; break; default: @@ -152,8 +209,6 @@ int drm_ati_pcigart_init(struct drm_device *dev, } } - DRM_MEMORYBARRIER(); - ret = 1; done: -- cgit v1.2.3 From 2880c86eb246aceeb5c750e27259a7b6d8897328 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Sun, 7 Sep 2008 12:44:02 -0400 Subject: [FreeBSD] Implement drm_ioremap_wc() to set a range of mem to write-combining --- bsd-core/drmP.h | 9 +++++++-- bsd-core/drm_memory.c | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index f8705e36..de59f426 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -70,6 +70,7 @@ typedef struct drm_file drm_file_t; #include #include #include +#include #include #include #include @@ -897,6 +898,7 @@ void *drm_calloc(size_t nmemb, size_t size, int area); void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area); void drm_free(void *pt, size_t size, int area); +void *drm_ioremap_wc(struct drm_device *dev, drm_local_map_t *map); void *drm_ioremap(struct drm_device *dev, drm_local_map_t *map); void drm_ioremapfree(drm_local_map_t *map); int drm_mtrr_add(unsigned long offset, size_t size, int flags); @@ -1110,10 +1112,13 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, size_t align, dma_addr_t maxaddr); void drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah); -#define drm_core_ioremap_wc drm_core_ioremap - /* Inline replacements for DRM_IOREMAP macros */ static __inline__ void +drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev) +{ + map->handle = drm_ioremap_wc(dev, map); +} +static __inline__ void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev) { map->handle = drm_ioremap(dev, map); diff --git a/bsd-core/drm_memory.c b/bsd-core/drm_memory.c index 80891402..272c0874 100644 --- a/bsd-core/drm_memory.c +++ b/bsd-core/drm_memory.c @@ -80,6 +80,11 @@ void drm_free(void *pt, size_t size, int area) free(pt, M_DRM); } +void *drm_ioremap_wc(struct drm_device *dev, drm_local_map_t *map) +{ + return pmap_mapdev_attr(map->offset, map->size, PAT_WRITE_COMBINING); +} + void *drm_ioremap(struct drm_device *dev, drm_local_map_t *map) { #ifdef __FreeBSD__ -- cgit v1.2.3 From 828ae3f6b88b5a69a56b2961307e40ed95edea29 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Mon, 8 Sep 2008 16:40:52 -0400 Subject: [FreeBSD] We need to call drm_detach before we free dev->driver. The driver is in control of the show, so when you try and unload a module the driver detach routine is called first. It is what drives the whole unload process and so lots of panics occur if dev->driver is already free. --- bsd-core/i915_drv.c | 5 ++++- bsd-core/mach64_drv.c | 5 ++++- bsd-core/mga_drv.c | 5 ++++- bsd-core/r128_drv.c | 5 ++++- bsd-core/radeon_drv.c | 5 ++++- bsd-core/savage_drv.c | 5 ++++- bsd-core/sis_drv.c | 5 ++++- bsd-core/tdfx_drv.c | 5 ++++- bsd-core/via_drv.c | 5 ++++- 9 files changed, 36 insertions(+), 9 deletions(-) diff --git a/bsd-core/i915_drv.c b/bsd-core/i915_drv.c index 71a8d64d..7e745190 100644 --- a/bsd-core/i915_drv.c +++ b/bsd-core/i915_drv.c @@ -122,10 +122,13 @@ static int i915_detach(device_t nbdev) { struct drm_device *dev = device_get_softc(nbdev); + int ret; + + ret = drm_detach(nbdev); free(dev->driver, M_DRM); - return drm_detach(nbdev); + return ret; } static device_method_t i915_methods[] = { diff --git a/bsd-core/mach64_drv.c b/bsd-core/mach64_drv.c index f940e90f..36f3cec7 100644 --- a/bsd-core/mach64_drv.c +++ b/bsd-core/mach64_drv.c @@ -96,10 +96,13 @@ static int mach64_detach(device_t nbdev) { struct drm_device *dev = device_get_softc(nbdev); + int ret; + + ret = drm_detach(nbdev); free(dev->driver, M_DRM); - return drm_detach(nbdev); + return ret; } static device_method_t mach64_methods[] = { diff --git a/bsd-core/mga_drv.c b/bsd-core/mga_drv.c index 7abf2b03..85809609 100644 --- a/bsd-core/mga_drv.c +++ b/bsd-core/mga_drv.c @@ -142,10 +142,13 @@ static int mga_detach(device_t nbdev) { struct drm_device *dev = device_get_softc(nbdev); + int ret; + + ret = drm_detach(nbdev); free(dev->driver, M_DRM); - return drm_detach(nbdev); + return ret; } static device_method_t mga_methods[] = { diff --git a/bsd-core/r128_drv.c b/bsd-core/r128_drv.c index 03a97da0..5d4dfed9 100644 --- a/bsd-core/r128_drv.c +++ b/bsd-core/r128_drv.c @@ -95,10 +95,13 @@ static int r128_detach(device_t nbdev) { struct drm_device *dev = device_get_softc(nbdev); + int ret; + + ret = drm_detach(nbdev); free(dev->driver, M_DRM); - return drm_detach(nbdev); + return ret; } static device_method_t r128_methods[] = { diff --git a/bsd-core/radeon_drv.c b/bsd-core/radeon_drv.c index 019f705c..50a2f6b5 100644 --- a/bsd-core/radeon_drv.c +++ b/bsd-core/radeon_drv.c @@ -100,10 +100,13 @@ static int radeon_detach(device_t nbdev) { struct drm_device *dev = device_get_softc(nbdev); + int ret; + + ret = drm_detach(nbdev); free(dev->driver, M_DRM); - return drm_detach(nbdev); + return ret; } static device_method_t radeon_methods[] = { diff --git a/bsd-core/savage_drv.c b/bsd-core/savage_drv.c index f0c6c06e..36dd34a7 100644 --- a/bsd-core/savage_drv.c +++ b/bsd-core/savage_drv.c @@ -86,10 +86,13 @@ static int savage_detach(device_t nbdev) { struct drm_device *dev = device_get_softc(nbdev); + int ret; + + ret = drm_detach(nbdev); free(dev->driver, M_DRM); - return drm_detach(nbdev); + return ret; } static device_method_t savage_methods[] = { diff --git a/bsd-core/sis_drv.c b/bsd-core/sis_drv.c index 8ad6414d..bcf4ffd6 100644 --- a/bsd-core/sis_drv.c +++ b/bsd-core/sis_drv.c @@ -80,10 +80,13 @@ static int sis_detach(device_t nbdev) { struct drm_device *dev = device_get_softc(nbdev); + int ret; + + ret = drm_detach(nbdev); free(dev->driver, M_DRM); - return drm_detach(nbdev); + return ret; } static device_method_t sis_methods[] = { diff --git a/bsd-core/tdfx_drv.c b/bsd-core/tdfx_drv.c index 8fafe0fe..8d9e272f 100644 --- a/bsd-core/tdfx_drv.c +++ b/bsd-core/tdfx_drv.c @@ -82,10 +82,13 @@ static int tdfx_detach(device_t nbdev) { struct drm_device *dev = device_get_softc(nbdev); + int ret; + + ret = drm_detach(nbdev); free(dev->driver, M_DRM); - return drm_detach(nbdev); + return ret; } static device_method_t tdfx_methods[] = { diff --git a/bsd-core/via_drv.c b/bsd-core/via_drv.c index cdd78d19..402b374b 100644 --- a/bsd-core/via_drv.c +++ b/bsd-core/via_drv.c @@ -93,10 +93,13 @@ static int via_detach(device_t nbdev) { struct drm_device *dev = device_get_softc(nbdev); + int ret; + + ret = drm_detach(nbdev); free(dev->driver, M_DRM); - return drm_detach(nbdev); + return ret; } static device_method_t via_methods[] = { -- cgit v1.2.3 From 09cf0f0213652609d09154ce2859c03cf97ab11e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 3 Sep 2008 23:05:16 +0100 Subject: drm: Add tests for GEM_FLINK ioctl. --- .gitignore | 1 + tests/Makefile.am | 1 + tests/gem_flink.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 tests/gem_flink.c diff --git a/.gitignore b/.gitignore index c8a22ea3..05b2e7d8 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ tests/getstats tests/getversion tests/lock tests/gem_basic +tests/gem_flink tests/gem_mmap tests/gem_readwrite tests/openclose diff --git a/tests/Makefile.am b/tests/Makefile.am index 718cc436..95f0f22e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,6 +24,7 @@ TESTS = auth \ setversion \ updatedraw \ gem_basic \ + gem_flink \ gem_readwrite \ gem_mmap diff --git a/tests/gem_flink.c b/tests/gem_flink.c new file mode 100644 index 00000000..d2e062fd --- /dev/null +++ b/tests/gem_flink.c @@ -0,0 +1,128 @@ +/* + * Copyright © 2008 Intel Corporation + * + * 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 (including the next + * paragraph) 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 OR COPYRIGHT HOLDERS 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. + * + * Authors: + * Eric Anholt + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" +#include "i915_drm.h" + +static void +test_flink(int fd) +{ + struct drm_i915_gem_create create; + struct drm_gem_flink flink; + struct drm_gem_open open; + int ret; + + printf("Testing flink and open.\n"); + + memset(&create, 0, sizeof(create)); + create.size = 16 * 1024; + ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); + assert(ret == 0); + + flink.handle = create.handle; + ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); + assert(ret == 0); + + open.name = flink.name; + ret = ioctl(fd, DRM_IOCTL_GEM_OPEN, &open); + assert(ret == 0); + assert(open.handle != 0); +} + +static void +test_double_flink(int fd) +{ + struct drm_i915_gem_create create; + struct drm_gem_flink flink; + struct drm_gem_flink flink2; + int ret; + + printf("Testing repeated flink.\n"); + + memset(&create, 0, sizeof(create)); + create.size = 16 * 1024; + ret = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); + assert(ret == 0); + + flink.handle = create.handle; + ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); + assert(ret == 0); + + flink2.handle = create.handle; + ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink2); + assert(ret == 0); + assert(flink2.name == flink.name); +} + +static void +test_bad_flink(int fd) +{ + struct drm_gem_flink flink; + int ret; + + printf("Testing error return on bad flink ioctl.\n"); + + flink.handle = 0x10101010; + ret = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); + assert(ret == -1 && errno == EBADF); +} + +static void +test_bad_open(int fd) +{ + struct drm_gem_open open; + int ret; + + printf("Testing error return on bad open ioctl.\n"); + + open.name = 0x10101010; + ret = ioctl(fd, DRM_IOCTL_GEM_OPEN, &open); + + assert(ret == -1 && errno == ENOENT); +} + +int main(int argc, char **argv) +{ + int fd; + + fd = drm_open_any(); + + test_flink(fd); + test_double_flink(fd); + test_bad_flink(fd); + test_bad_open(fd); + + return 0; +} -- cgit v1.2.3 From 738e36acbce24df0ccadb499c5cf62ccb74f56df Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Sep 2008 10:35:32 +0100 Subject: Move intel libdrm stuff to libdrm_intel.so dri_bufmgr.h is replaced by intel_bufmgr.h, and several functions are renamed, though the structures and many functions remain dri_bufmgr_* and dri_bo_* --- libdrm/Makefile.am | 7 +- libdrm/dri_bufmgr.c | 141 --------------------------- libdrm/dri_bufmgr.h | 174 ---------------------------------- libdrm/intel/Makefile.am | 7 +- libdrm/intel/intel_bufmgr.c | 192 +++++++++++++++++++++++++++++++++++++ libdrm/intel/intel_bufmgr.h | 114 ++++++++++------------ libdrm/intel/intel_bufmgr_fake.c | 6 +- libdrm/intel/intel_bufmgr_gem.c | 90 +++--------------- libdrm/intel/intel_bufmgr_priv.h | 200 +++++++++++++++++++++++++++++++++++++++ 9 files changed, 467 insertions(+), 464 deletions(-) delete mode 100644 libdrm/dri_bufmgr.c delete mode 100644 libdrm/dri_bufmgr.h create mode 100644 libdrm/intel/intel_bufmgr.c create mode 100644 libdrm/intel/intel_bufmgr_priv.h diff --git a/libdrm/Makefile.am b/libdrm/Makefile.am index b73cb673..b69fcfee 100644 --- a/libdrm/Makefile.am +++ b/libdrm/Makefile.am @@ -25,11 +25,10 @@ libdrm_ladir = $(libdir) libdrm_la_LDFLAGS = -version-number 2:3:0 -no-undefined AM_CFLAGS = -I$(top_srcdir)/shared-core -libdrm_la_SOURCES = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c \ - dri_bufmgr.c libdrm_lists.h -libdrm_la_LIBADD = intel/libdrm_intel.la +libdrm_la_SOURCES = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c + libdrm_lists.h libdrmincludedir = ${includedir} -libdrminclude_HEADERS = xf86drm.h dri_bufmgr.h +libdrminclude_HEADERS = xf86drm.h EXTRA_DIST = ChangeLog TODO diff --git a/libdrm/dri_bufmgr.c b/libdrm/dri_bufmgr.c deleted file mode 100644 index a6eda3bd..00000000 --- a/libdrm/dri_bufmgr.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright © 2007 Intel Corporation - * - * 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 (including the next - * paragraph) 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 OR COPYRIGHT HOLDERS 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. - * - * Authors: - * Eric Anholt - * - */ - -#include -#include -#include -#include "dri_bufmgr.h" - -/** @file dri_bufmgr.c - * - * Convenience functions for buffer management methods. - */ - -dri_bo * -dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size, - unsigned int alignment) -{ - return bufmgr->bo_alloc(bufmgr, name, size, alignment); -} - -void -dri_bo_reference(dri_bo *bo) -{ - bo->bufmgr->bo_reference(bo); -} - -void -dri_bo_unreference(dri_bo *bo) -{ - if (bo == NULL) - return; - - bo->bufmgr->bo_unreference(bo); -} - -int -dri_bo_map(dri_bo *buf, int write_enable) -{ - return buf->bufmgr->bo_map(buf, write_enable); -} - -int -dri_bo_unmap(dri_bo *buf) -{ - return buf->bufmgr->bo_unmap(buf); -} - -int -dri_bo_subdata(dri_bo *bo, unsigned long offset, - unsigned long size, const void *data) -{ - int ret; - if (bo->bufmgr->bo_subdata) - return bo->bufmgr->bo_subdata(bo, offset, size, data); - if (size == 0 || data == NULL) - return 0; - - ret = dri_bo_map(bo, 1); - if (ret) - return ret; - memcpy((unsigned char *)bo->virtual + offset, data, size); - dri_bo_unmap(bo); - return 0; -} - -int -dri_bo_get_subdata(dri_bo *bo, unsigned long offset, - unsigned long size, void *data) -{ - int ret; - if (bo->bufmgr->bo_subdata) - return bo->bufmgr->bo_get_subdata(bo, offset, size, data); - - if (size == 0 || data == NULL) - return 0; - - ret = dri_bo_map(bo, 0); - if (ret) - return ret; - memcpy(data, (unsigned char *)bo->virtual + offset, size); - dri_bo_unmap(bo); - return 0; -} - -void -dri_bo_wait_rendering(dri_bo *bo) -{ - bo->bufmgr->bo_wait_rendering(bo); -} - -void -dri_bufmgr_destroy(dri_bufmgr *bufmgr) -{ - bufmgr->destroy(bufmgr); -} - -void *dri_process_relocs(dri_bo *batch_buf) -{ - return batch_buf->bufmgr->process_relocs(batch_buf); -} - -void dri_post_submit(dri_bo *batch_buf) -{ - batch_buf->bufmgr->post_submit(batch_buf); -} - -void -dri_bufmgr_set_debug(dri_bufmgr *bufmgr, int enable_debug) -{ - bufmgr->debug = enable_debug; -} - -int -dri_bufmgr_check_aperture_space(dri_bo **bo_array, int count) -{ - return bo_array[0]->bufmgr->check_aperture_space(bo_array, count); -} diff --git a/libdrm/dri_bufmgr.h b/libdrm/dri_bufmgr.h deleted file mode 100644 index e67756bb..00000000 --- a/libdrm/dri_bufmgr.h +++ /dev/null @@ -1,174 +0,0 @@ -/************************************************************************** - * - * Copyright © 2007 Intel Corporation - * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Thomas Hellström - * Keith Whitwell - * Eric Anholt - */ - -#ifndef _DRI_BUFMGR_H_ -#define _DRI_BUFMGR_H_ -#include - -typedef struct _dri_bufmgr dri_bufmgr; -typedef struct _dri_bo dri_bo; - -struct _dri_bo { - /** - * Size in bytes of the buffer object. - * - * The size may be larger than the size originally requested for the - * allocation, such as being aligned to page size. - */ - unsigned long size; - /** - * Card virtual address (offset from the beginning of the aperture) for the - * object. Only valid while validated. - */ - unsigned long offset; - /** - * Virtual address for accessing the buffer data. Only valid while mapped. - */ - void *virtual; - /** Buffer manager context associated with this buffer object */ - dri_bufmgr *bufmgr; -}; - -/** - * Context for a buffer manager instance. - * - * Contains public methods followed by private storage for the buffer manager. - */ -struct _dri_bufmgr { - /** - * Allocate a buffer object. - * - * Buffer objects are not necessarily initially mapped into CPU virtual - * address space or graphics device aperture. They must be mapped using - * bo_map() to be used by the CPU, and validated for use using bo_validate() - * to be used from the graphics device. - */ - dri_bo *(*bo_alloc)(dri_bufmgr *bufmgr_ctx, const char *name, - unsigned long size, unsigned int alignment); - - /** Takes a reference on a buffer object */ - void (*bo_reference)(dri_bo *bo); - - /** - * Releases a reference on a buffer object, freeing the data if - * rerefences remain. - */ - void (*bo_unreference)(dri_bo *bo); - - /** - * Maps the buffer into userspace. - * - * This function will block waiting for any existing execution on the - * buffer to complete, first. The resulting mapping is available at - * buf->virtual. - */ - int (*bo_map)(dri_bo *buf, int write_enable); - - /** Reduces the refcount on the userspace mapping of the buffer object. */ - int (*bo_unmap)(dri_bo *buf); - - /** - * Write data into an object. - * - * This is an optional function, if missing, - * dri_bo will map/memcpy/unmap. - */ - int (*bo_subdata) (dri_bo *buf, unsigned long offset, - unsigned long size, const void *data); - - /** - * Read data from an object - * - * This is an optional function, if missing, - * dri_bo will map/memcpy/unmap. - */ - int (*bo_get_subdata) (dri_bo *bo, unsigned long offset, - unsigned long size, void *data); - - /** - * Waits for rendering to an object by the GPU to have completed. - * - * This is not required for any access to the BO by bo_map, bo_subdata, etc. - * It is merely a way for the driver to implement glFinish. - */ - void (*bo_wait_rendering) (dri_bo *bo); - - /** - * Tears down the buffer manager instance. - */ - void (*destroy)(dri_bufmgr *bufmgr); - - /** - * Processes the relocations, either in userland or by converting the list - * for use in batchbuffer submission. - * - * Kernel-based implementations will return a pointer to the arguments - * to be handed with batchbuffer submission to the kernel. The userland - * implementation performs the buffer validation and emits relocations - * into them the appopriate order. - * - * \param batch_buf buffer at the root of the tree of relocations - * \return argument to be completed and passed to the execbuffers ioctl - * (if any). - */ - void *(*process_relocs)(dri_bo *batch_buf); - - void (*post_submit)(dri_bo *batch_buf); - - int (*check_aperture_space)(dri_bo **bo_array, int count); - int debug; /**< Enables verbose debugging printouts */ -}; - -dri_bo *dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size, - unsigned int alignment); -void dri_bo_reference(dri_bo *bo); -void dri_bo_unreference(dri_bo *bo); -int dri_bo_map(dri_bo *buf, int write_enable); -int dri_bo_unmap(dri_bo *buf); - -int dri_bo_subdata(dri_bo *bo, unsigned long offset, - unsigned long size, const void *data); -int dri_bo_get_subdata(dri_bo *bo, unsigned long offset, - unsigned long size, void *data); -void dri_bo_wait_rendering(dri_bo *bo); - -void dri_bufmgr_set_debug(dri_bufmgr *bufmgr, int enable_debug); -void dri_bufmgr_destroy(dri_bufmgr *bufmgr); - -void *dri_process_relocs(dri_bo *batch_buf); -void dri_post_process_relocs(dri_bo *batch_buf); -void dri_post_submit(dri_bo *batch_buf); -int dri_bufmgr_check_aperture_space(dri_bo **bo_array, int count); - -#endif diff --git a/libdrm/intel/Makefile.am b/libdrm/intel/Makefile.am index 31a8512a..607c4765 100644 --- a/libdrm/intel/Makefile.am +++ b/libdrm/intel/Makefile.am @@ -25,11 +25,16 @@ AM_CFLAGS = \ $(WARN_CFLAGS) \ -I$(top_srcdir)/libdrm \ + -I$(top_srcdir)/libdrm/intel \ -I$(top_srcdir)/shared-core -noinst_LTLIBRARIES = libdrm_intel.la +libdrm_intel_la_LTLIBRARIES = libdrm_intel.la +libdrm_intel_ladir = $(libdir) +libdrm_intel_la_LDFLAGS = -version-number 1:0:0 -no-undefined libdrm_intel_la_SOURCES = \ + intel_bufmgr.c \ + intel_bufmgr_priv.h \ intel_bufmgr_fake.c \ intel_bufmgr_gem.c \ mm.c \ diff --git a/libdrm/intel/intel_bufmgr.c b/libdrm/intel/intel_bufmgr.c new file mode 100644 index 00000000..5a9cdbe6 --- /dev/null +++ b/libdrm/intel/intel_bufmgr.c @@ -0,0 +1,192 @@ +/* + * Copyright © 2007 Intel Corporation + * + * 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 (including the next + * paragraph) 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 OR COPYRIGHT HOLDERS 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. + * + * Authors: + * Eric Anholt + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include "intel_bufmgr.h" +#include "intel_bufmgr_priv.h" + +/** @file dri_bufmgr.c + * + * Convenience functions for buffer management methods. + */ + +dri_bo * +dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size, + unsigned int alignment) +{ + return bufmgr->bo_alloc(bufmgr, name, size, alignment); +} + +void +dri_bo_reference(dri_bo *bo) +{ + bo->bufmgr->bo_reference(bo); +} + +void +dri_bo_unreference(dri_bo *bo) +{ + if (bo == NULL) + return; + + bo->bufmgr->bo_unreference(bo); +} + +int +dri_bo_map(dri_bo *buf, int write_enable) +{ + return buf->bufmgr->bo_map(buf, write_enable); +} + +int +dri_bo_unmap(dri_bo *buf) +{ + return buf->bufmgr->bo_unmap(buf); +} + +int +dri_bo_subdata(dri_bo *bo, unsigned long offset, + unsigned long size, const void *data) +{ + int ret; + if (bo->bufmgr->bo_subdata) + return bo->bufmgr->bo_subdata(bo, offset, size, data); + if (size == 0 || data == NULL) + return 0; + + ret = dri_bo_map(bo, 1); + if (ret) + return ret; + memcpy((unsigned char *)bo->virtual + offset, data, size); + dri_bo_unmap(bo); + return 0; +} + +int +dri_bo_get_subdata(dri_bo *bo, unsigned long offset, + unsigned long size, void *data) +{ + int ret; + if (bo->bufmgr->bo_subdata) + return bo->bufmgr->bo_get_subdata(bo, offset, size, data); + + if (size == 0 || data == NULL) + return 0; + + ret = dri_bo_map(bo, 0); + if (ret) + return ret; + memcpy(data, (unsigned char *)bo->virtual + offset, size); + dri_bo_unmap(bo); + return 0; +} + +void +dri_bo_wait_rendering(dri_bo *bo) +{ + bo->bufmgr->bo_wait_rendering(bo); +} + +void +dri_bufmgr_destroy(dri_bufmgr *bufmgr) +{ + bufmgr->destroy(bufmgr); +} + +void *dri_process_relocs(dri_bo *batch_buf) +{ + return batch_buf->bufmgr->process_relocs(batch_buf); +} + +void dri_post_submit(dri_bo *batch_buf) +{ + batch_buf->bufmgr->post_submit(batch_buf); +} + +void +dri_bufmgr_set_debug(dri_bufmgr *bufmgr, int enable_debug) +{ + bufmgr->debug = enable_debug; +} + +int +dri_bufmgr_check_aperture_space(dri_bo **bo_array, int count) +{ + return bo_array[0]->bufmgr->check_aperture_space(bo_array, count); +} + +int +dri_bo_flink(dri_bo *bo, uint32_t *name) +{ + if (bo->bufmgr->bo_flink) + return bo->bufmgr->bo_flink(bo, name); + + return -ENODEV; +} + +int +dri_bo_emit_reloc(dri_bo *reloc_buf, + uint32_t read_domains, uint32_t write_domain, + uint32_t delta, uint32_t offset, dri_bo *target_buf) +{ + return reloc_buf->bufmgr->bo_emit_reloc(reloc_buf, + read_domains, write_domain, + delta, offset, target_buf); +} + +int +dri_bo_pin(dri_bo *bo, uint32_t alignment) +{ + if (bo->bufmgr->bo_pin) + return bo->bufmgr->bo_pin(bo, alignment); + + return -ENODEV; +} + +int +dri_bo_unpin(dri_bo *bo) +{ + if (bo->bufmgr->bo_unpin) + return bo->bufmgr->bo_unpin(bo); + + return -ENODEV; +} + +int dri_bo_set_tiling(dri_bo *bo, uint32_t *tiling_mode) +{ + if (bo->bufmgr->bo_set_tiling) + return bo->bufmgr->bo_set_tiling(bo, tiling_mode); + + *tiling_mode = I915_TILING_NONE; + return 0; +} diff --git a/libdrm/intel/intel_bufmgr.h b/libdrm/intel/intel_bufmgr.h index 4d335210..0b473f3b 100644 --- a/libdrm/intel/intel_bufmgr.h +++ b/libdrm/intel/intel_bufmgr.h @@ -31,65 +31,65 @@ * Public definitions of Intel-specific bufmgr functions. */ -#ifndef INTEL_BUFMGR_GEM_H -#define INTEL_BUFMGR_GEM_H +#ifndef INTEL_BUFMGR_H +#define INTEL_BUFMGR_H -#include "dri_bufmgr.h" +#include -/** - * Intel-specific bufmgr bits that follow immediately after the - * generic bufmgr structure. - */ -struct intel_bufmgr { - /** - * Add relocation entry in reloc_buf, which will be updated with the - * target buffer's real offset on on command submission. - * - * Relocations remain in place for the lifetime of the buffer object. - * - * \param reloc_buf Buffer to write the relocation into. - * \param read_domains GEM read domains which the buffer will be read into - * by the command that this relocation is part of. - * \param write_domains GEM read domains which the buffer will be dirtied - * in by the command that this relocation is part of. - * \param delta Constant value to be added to the relocation target's - * offset. - * \param offset Byte offset within batch_buf of the relocated pointer. - * \param target Buffer whose offset should be written into the relocation - * entry. - */ - int (*emit_reloc)(dri_bo *reloc_buf, - uint32_t read_domains, uint32_t write_domain, - uint32_t delta, uint32_t offset, dri_bo *target); - /** - * Pin a buffer to the aperture and fix the offset until unpinned - * - * \param buf Buffer to pin - * \param alignment Required alignment for aperture, in bytes - */ - int (*pin) (dri_bo *buf, uint32_t alignment); +typedef struct _dri_bufmgr dri_bufmgr; +typedef struct _dri_bo dri_bo; + +struct _dri_bo { /** - * Unpin a buffer from the aperture, allowing it to be removed + * Size in bytes of the buffer object. * - * \param buf Buffer to unpin + * The size may be larger than the size originally requested for the + * allocation, such as being aligned to page size. */ - int (*unpin) (dri_bo *buf); + unsigned long size; /** - * Ask that the buffer be placed in tiling mode - * - * \param buf Buffer to set tiling mode for - * \param tiling_mode desired, and returned tiling mode + * Card virtual address (offset from the beginning of the aperture) for the + * object. Only valid while validated. */ - int (*set_tiling) (dri_bo *bo, uint32_t *tiling_mode); + unsigned long offset; /** - * Create a visible name for a buffer which can be used by other apps - * - * \param buf Buffer to create a name for - * \param name Returned name + * Virtual address for accessing the buffer data. Only valid while mapped. */ - int (*flink) (dri_bo *buf, uint32_t *name); + void *virtual; + + /** Buffer manager context associated with this buffer object */ + dri_bufmgr *bufmgr; }; +dri_bo *dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size, + unsigned int alignment); +void dri_bo_reference(dri_bo *bo); +void dri_bo_unreference(dri_bo *bo); +int dri_bo_map(dri_bo *buf, int write_enable); +int dri_bo_unmap(dri_bo *buf); + +int dri_bo_subdata(dri_bo *bo, unsigned long offset, + unsigned long size, const void *data); +int dri_bo_get_subdata(dri_bo *bo, unsigned long offset, + unsigned long size, void *data); +void dri_bo_wait_rendering(dri_bo *bo); + +void dri_bufmgr_set_debug(dri_bufmgr *bufmgr, int enable_debug); +void dri_bufmgr_destroy(dri_bufmgr *bufmgr); + +void *dri_process_relocs(dri_bo *batch_buf); +void dri_post_process_relocs(dri_bo *batch_buf); +void dri_post_submit(dri_bo *batch_buf); +int dri_bufmgr_check_aperture_space(dri_bo **bo_array, int count); + +int dri_bo_emit_reloc(dri_bo *reloc_buf, + uint32_t read_domains, uint32_t write_domain, + uint32_t delta, uint32_t offset, dri_bo *target_buf); +int dri_bo_pin(dri_bo *buf, uint32_t alignment); +int dri_bo_unpin(dri_bo *buf); +int dri_bo_set_tiling(dri_bo *buf, uint32_t *tiling_mode); +int dri_bo_flink(dri_bo *buf, uint32_t *name); + /* intel_bufmgr_gem.c */ dri_bufmgr *intel_bufmgr_gem_init(int fd, int batch_size); dri_bo *intel_bo_gem_create_from_name(dri_bufmgr *bufmgr, const char *name, @@ -106,25 +106,13 @@ dri_bufmgr *intel_bufmgr_fake_init(unsigned long low_offset, void *low_virtual, dri_bo *intel_bo_fake_alloc_static(dri_bufmgr *bufmgr, const char *name, unsigned long offset, unsigned long size, void *virtual); - -void intel_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr); void intel_bo_fake_disable_backing_store(dri_bo *bo, void (*invalidate_cb)(dri_bo *bo, void *ptr), void *ptr); -void intel_bufmgr_fake_evict_all(dri_bufmgr *bufmgr); - -int intel_bo_emit_reloc(dri_bo *reloc_buf, - uint32_t read_domains, uint32_t write_domain, - uint32_t delta, uint32_t offset, dri_bo *target_buf); - -int intel_bo_pin(dri_bo *buf, uint32_t alignment); - -int intel_bo_unpin(dri_bo *buf); -int intel_bo_set_tiling(dri_bo *buf, uint32_t *tiling_mode); - -int intel_bo_flink(dri_bo *buf, uint32_t *name); +void intel_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr); +void intel_bufmgr_fake_evict_all(dri_bufmgr *bufmgr); -#endif /* INTEL_BUFMGR_GEM_H */ +#endif /* INTEL_BUFMGR_H */ diff --git a/libdrm/intel/intel_bufmgr_fake.c b/libdrm/intel/intel_bufmgr_fake.c index e2dd9dc7..8e581aed 100644 --- a/libdrm/intel/intel_bufmgr_fake.c +++ b/libdrm/intel/intel_bufmgr_fake.c @@ -37,8 +37,9 @@ #include #include #include -#include "dri_bufmgr.h" +#include #include "intel_bufmgr.h" +#include "intel_bufmgr_priv.h" #include "drm.h" #include "i915_drm.h" #include "mm.h" @@ -105,7 +106,6 @@ struct block { typedef struct _bufmgr_fake { dri_bufmgr bufmgr; - struct intel_bufmgr intel_bufmgr; unsigned long low_offset; unsigned long size; @@ -1216,12 +1216,12 @@ intel_bufmgr_fake_init(unsigned long low_offset, void *low_virtual, bufmgr_fake->bufmgr.bo_map = dri_fake_bo_map; bufmgr_fake->bufmgr.bo_unmap = dri_fake_bo_unmap; bufmgr_fake->bufmgr.bo_wait_rendering = dri_fake_bo_wait_rendering; + bufmgr_fake->bufmgr.bo_emit_reloc = dri_fake_emit_reloc; bufmgr_fake->bufmgr.destroy = dri_fake_destroy; bufmgr_fake->bufmgr.process_relocs = dri_fake_process_relocs; bufmgr_fake->bufmgr.post_submit = dri_fake_post_submit; bufmgr_fake->bufmgr.check_aperture_space = dri_fake_check_aperture_space; bufmgr_fake->bufmgr.debug = 0; - bufmgr_fake->intel_bufmgr.emit_reloc = dri_fake_emit_reloc; bufmgr_fake->fence_emit = fence_emit; bufmgr_fake->fence_wait = fence_wait; diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c index 8634fdf8..43d2d986 100644 --- a/libdrm/intel/intel_bufmgr_gem.c +++ b/libdrm/intel/intel_bufmgr_gem.c @@ -44,8 +44,8 @@ #include #include "errno.h" -#include "dri_bufmgr.h" #include "intel_bufmgr.h" +#include "intel_bufmgr_priv.h" #include "string.h" #include "i915_drm.h" @@ -76,8 +76,6 @@ struct dri_gem_bo_bucket { typedef struct _dri_bufmgr_gem { dri_bufmgr bufmgr; - struct intel_bufmgr intel_bufmgr; - int fd; int max_relocs; @@ -650,8 +648,8 @@ dri_bufmgr_gem_destroy(dri_bufmgr *bufmgr) * last known offset in target_bo. */ static int -dri_gem_emit_reloc(dri_bo *bo, uint32_t read_domains, uint32_t write_domain, - uint32_t delta, uint32_t offset, dri_bo *target_bo) +dri_gem_bo_emit_reloc(dri_bo *bo, uint32_t read_domains, uint32_t write_domain, + uint32_t delta, uint32_t offset, dri_bo *target_bo) { dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)bo->bufmgr; dri_bo_gem *bo_gem = (dri_bo_gem *)bo; @@ -775,7 +773,7 @@ dri_gem_post_submit(dri_bo *batch_buf) } static int -dri_gem_pin(dri_bo *bo, uint32_t alignment) +dri_gem_bo_pin(dri_bo *bo, uint32_t alignment) { dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)bo->bufmgr; dri_bo_gem *bo_gem = (dri_bo_gem *)bo; @@ -794,7 +792,7 @@ dri_gem_pin(dri_bo *bo, uint32_t alignment) } static int -dri_gem_unpin(dri_bo *bo) +dri_gem_bo_unpin(dri_bo *bo) { dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)bo->bufmgr; dri_bo_gem *bo_gem = (dri_bo_gem *)bo; @@ -811,7 +809,7 @@ dri_gem_unpin(dri_bo *bo) } static int -dri_gem_set_tiling(dri_bo *bo, uint32_t *tiling_mode) +dri_gem_bo_set_tiling(dri_bo *bo, uint32_t *tiling_mode) { dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)bo->bufmgr; dri_bo_gem *bo_gem = (dri_bo_gem *)bo; @@ -832,7 +830,7 @@ dri_gem_set_tiling(dri_bo *bo, uint32_t *tiling_mode) } static int -dri_gem_flink(dri_bo *bo, uint32_t *name) +dri_gem_bo_flink(dri_bo *bo, uint32_t *name) { dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)bo->bufmgr; dri_bo_gem *bo_gem = (dri_bo_gem *)bo; @@ -910,16 +908,16 @@ intel_bufmgr_gem_init(int fd, int batch_size) bufmgr_gem->bufmgr.bo_subdata = dri_gem_bo_subdata; bufmgr_gem->bufmgr.bo_get_subdata = dri_gem_bo_get_subdata; bufmgr_gem->bufmgr.bo_wait_rendering = dri_gem_bo_wait_rendering; + bufmgr_gem->bufmgr.bo_emit_reloc = dri_gem_bo_emit_reloc; + bufmgr_gem->bufmgr.bo_pin = dri_gem_bo_pin; + bufmgr_gem->bufmgr.bo_unpin = dri_gem_bo_unpin; + bufmgr_gem->bufmgr.bo_set_tiling = dri_gem_bo_set_tiling; + bufmgr_gem->bufmgr.bo_flink = dri_gem_bo_flink; bufmgr_gem->bufmgr.destroy = dri_bufmgr_gem_destroy; bufmgr_gem->bufmgr.process_relocs = dri_gem_process_reloc; bufmgr_gem->bufmgr.post_submit = dri_gem_post_submit; bufmgr_gem->bufmgr.debug = 0; bufmgr_gem->bufmgr.check_aperture_space = dri_gem_check_aperture_space; - bufmgr_gem->intel_bufmgr.emit_reloc = dri_gem_emit_reloc; - bufmgr_gem->intel_bufmgr.pin = dri_gem_pin; - bufmgr_gem->intel_bufmgr.unpin = dri_gem_unpin; - bufmgr_gem->intel_bufmgr.set_tiling = dri_gem_set_tiling; - bufmgr_gem->intel_bufmgr.flink = dri_gem_flink; /* Initialize the linked lists for BO reuse cache. */ for (i = 0; i < INTEL_GEM_BO_BUCKETS; i++) bufmgr_gem->cache_bucket[i].tail = &bufmgr_gem->cache_bucket[i].head; @@ -927,67 +925,3 @@ intel_bufmgr_gem_init(int fd, int batch_size) return &bufmgr_gem->bufmgr; } -int -intel_bo_emit_reloc(dri_bo *reloc_buf, - uint32_t read_domains, uint32_t write_domain, - uint32_t delta, uint32_t offset, dri_bo *target_buf) -{ - struct intel_bufmgr *intel_bufmgr; - - intel_bufmgr = (struct intel_bufmgr *)(reloc_buf->bufmgr + 1); - - return intel_bufmgr->emit_reloc(reloc_buf, read_domains, write_domain, - delta, offset, target_buf); -} - -int -intel_bo_pin(dri_bo *bo, uint32_t alignment) -{ - struct intel_bufmgr *intel_bufmgr; - - intel_bufmgr = (struct intel_bufmgr *)(bo->bufmgr + 1); - - if (intel_bufmgr->pin) - return intel_bufmgr->pin(bo, alignment); - - return 0; -} - -int -intel_bo_unpin(dri_bo *bo) -{ - struct intel_bufmgr *intel_bufmgr; - - intel_bufmgr = (struct intel_bufmgr *)(bo->bufmgr + 1); - - if (intel_bufmgr->unpin) - return intel_bufmgr->unpin(bo); - - return 0; -} - -int intel_bo_set_tiling(dri_bo *bo, uint32_t *tiling_mode) -{ - struct intel_bufmgr *intel_bufmgr; - - intel_bufmgr = (struct intel_bufmgr *)(bo->bufmgr + 1); - - if (intel_bufmgr->set_tiling) - return intel_bufmgr->set_tiling (bo, tiling_mode); - - *tiling_mode = I915_TILING_NONE; - return 0; -} - -int intel_bo_flink(dri_bo *bo, uint32_t *name) -{ - struct intel_bufmgr *intel_bufmgr; - - intel_bufmgr = (struct intel_bufmgr *)(bo->bufmgr + 1); - - if (intel_bufmgr->flink) - return intel_bufmgr->flink (bo, name); - - return -ENODEV; -} - diff --git a/libdrm/intel/intel_bufmgr_priv.h b/libdrm/intel/intel_bufmgr_priv.h new file mode 100644 index 00000000..92476aec --- /dev/null +++ b/libdrm/intel/intel_bufmgr_priv.h @@ -0,0 +1,200 @@ +/* + * Copyright © 2008 Intel Corporation + * + * 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 (including the next + * paragraph) 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 OR COPYRIGHT HOLDERS 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. + * + * Authors: + * Eric Anholt + * + */ + +/** + * @file intel_bufmgr_priv.h + * + * Private definitions of Intel-specific bufmgr functions and structures. + */ + +#ifndef INTEL_BUFMGR_PRIV_H +#define INTEL_BUFMGR_PRIV_H + +/** + * Context for a buffer manager instance. + * + * Contains public methods followed by private storage for the buffer manager. + */ +struct _dri_bufmgr { + /** + * Allocate a buffer object. + * + * Buffer objects are not necessarily initially mapped into CPU virtual + * address space or graphics device aperture. They must be mapped using + * bo_map() to be used by the CPU, and validated for use using bo_validate() + * to be used from the graphics device. + */ + dri_bo *(*bo_alloc)(dri_bufmgr *bufmgr_ctx, const char *name, + unsigned long size, unsigned int alignment); + + /** Takes a reference on a buffer object */ + void (*bo_reference)(dri_bo *bo); + + /** + * Releases a reference on a buffer object, freeing the data if + * rerefences remain. + */ + void (*bo_unreference)(dri_bo *bo); + + /** + * Maps the buffer into userspace. + * + * This function will block waiting for any existing execution on the + * buffer to complete, first. The resulting mapping is available at + * buf->virtual. + */ + int (*bo_map)(dri_bo *buf, int write_enable); + + /** Reduces the refcount on the userspace mapping of the buffer object. */ + int (*bo_unmap)(dri_bo *buf); + + /** + * Write data into an object. + * + * This is an optional function, if missing, + * dri_bo will map/memcpy/unmap. + */ + int (*bo_subdata) (dri_bo *buf, unsigned long offset, + unsigned long size, const void *data); + + /** + * Read data from an object + * + * This is an optional function, if missing, + * dri_bo will map/memcpy/unmap. + */ + int (*bo_get_subdata) (dri_bo *bo, unsigned long offset, + unsigned long size, void *data); + + /** + * Waits for rendering to an object by the GPU to have completed. + * + * This is not required for any access to the BO by bo_map, bo_subdata, etc. + * It is merely a way for the driver to implement glFinish. + */ + void (*bo_wait_rendering) (dri_bo *bo); + + /** + * Tears down the buffer manager instance. + */ + void (*destroy)(dri_bufmgr *bufmgr); + + /** + * Processes the relocations, either in userland or by converting the list + * for use in batchbuffer submission. + * + * Kernel-based implementations will return a pointer to the arguments + * to be handed with batchbuffer submission to the kernel. The userland + * implementation performs the buffer validation and emits relocations + * into them the appopriate order. + * + * \param batch_buf buffer at the root of the tree of relocations + * \return argument to be completed and passed to the execbuffers ioctl + * (if any). + */ + void *(*process_relocs)(dri_bo *batch_buf); + + void (*post_submit)(dri_bo *batch_buf); + + /** + * Add relocation entry in reloc_buf, which will be updated with the + * target buffer's real offset on on command submission. + * + * Relocations remain in place for the lifetime of the buffer object. + * + * \param reloc_buf Buffer to write the relocation into. + * \param read_domains GEM read domains which the buffer will be read into + * by the command that this relocation is part of. + * \param write_domains GEM read domains which the buffer will be dirtied + * in by the command that this relocation is part of. + * \param delta Constant value to be added to the relocation target's + * offset. + * \param offset Byte offset within batch_buf of the relocated pointer. + * \param target Buffer whose offset should be written into the relocation + * entry. + */ + int (*bo_emit_reloc)(dri_bo *reloc_buf, + uint32_t read_domains, uint32_t write_domain, + uint32_t delta, uint32_t offset, dri_bo *target); + /** + * Pin a buffer to the aperture and fix the offset until unpinned + * + * \param buf Buffer to pin + * \param alignment Required alignment for aperture, in bytes + */ + int (*bo_pin) (dri_bo *buf, uint32_t alignment); + /** + * Unpin a buffer from the aperture, allowing it to be removed + * + * \param buf Buffer to unpin + */ + int (*bo_unpin) (dri_bo *buf); + /** + * Ask that the buffer be placed in tiling mode + * + * \param buf Buffer to set tiling mode for + * \param tiling_mode desired, and returned tiling mode + */ + int (*bo_set_tiling) (dri_bo *bo, uint32_t *tiling_mode); + /** + * Create a visible name for a buffer which can be used by other apps + * + * \param buf Buffer to create a name for + * \param name Returned name + */ + int (*bo_flink) (dri_bo *buf, uint32_t *name); + + int (*check_aperture_space)(dri_bo **bo_array, int count); + int debug; /**< Enables verbose debugging printouts */ +}; + +/* intel_bufmgr_gem.c */ +dri_bufmgr *intel_bufmgr_gem_init(int fd, int batch_size); +dri_bo *intel_bo_gem_create_from_name(dri_bufmgr *bufmgr, const char *name, + unsigned int handle); +void intel_bufmgr_gem_enable_reuse(dri_bufmgr *bufmgr); + +/* intel_bufmgr_fake.c */ +dri_bufmgr *intel_bufmgr_fake_init(unsigned long low_offset, void *low_virtual, + unsigned long size, + unsigned int (*fence_emit)(void *private), + int (*fence_wait)(void *private, + unsigned int cookie), + void *driver_priv); +dri_bo *intel_bo_fake_alloc_static(dri_bufmgr *bufmgr, const char *name, + unsigned long offset, unsigned long size, + void *virtual); + +void intel_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr); +void intel_bo_fake_disable_backing_store(dri_bo *bo, + void (*invalidate_cb)(dri_bo *bo, + void *ptr), + void *ptr); +void intel_bufmgr_fake_evict_all(dri_bufmgr *bufmgr); + +#endif /* INTEL_BUFMGR_PRIV_H */ + -- cgit v1.2.3 From 869d8bebedddf2075c59d6bffea8ee640cb80353 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 6 Sep 2008 03:07:41 +0100 Subject: intel: Move IRQ emit/wait from callbacks into the bufmgr. In the process, work around the glaring bugs of the kernel irq wait function. --- libdrm/intel/intel_bufmgr.h | 10 ++--- libdrm/intel/intel_bufmgr_fake.c | 89 ++++++++++++++++++++++++++++++---------- libdrm/intel/intel_bufmgr_priv.h | 24 ----------- 3 files changed, 72 insertions(+), 51 deletions(-) diff --git a/libdrm/intel/intel_bufmgr.h b/libdrm/intel/intel_bufmgr.h index 0b473f3b..57a9e33a 100644 --- a/libdrm/intel/intel_bufmgr.h +++ b/libdrm/intel/intel_bufmgr.h @@ -97,12 +97,12 @@ dri_bo *intel_bo_gem_create_from_name(dri_bufmgr *bufmgr, const char *name, void intel_bufmgr_gem_enable_reuse(dri_bufmgr *bufmgr); /* intel_bufmgr_fake.c */ -dri_bufmgr *intel_bufmgr_fake_init(unsigned long low_offset, void *low_virtual, +dri_bufmgr *intel_bufmgr_fake_init(int fd, + unsigned long low_offset, void *low_virtual, unsigned long size, - unsigned int (*fence_emit)(void *private), - int (*fence_wait)(void *private, - unsigned int cookie), - void *driver_priv); + volatile unsigned int *last_dispatch); +void intel_bufmgr_fake_set_last_dispatch(dri_bufmgr *bufmgr, + volatile unsigned int *last_dispatch); dri_bo *intel_bo_fake_alloc_static(dri_bufmgr *bufmgr, const char *name, unsigned long offset, unsigned long size, void *virtual); diff --git a/libdrm/intel/intel_bufmgr_fake.c b/libdrm/intel/intel_bufmgr_fake.c index 8e581aed..47629033 100644 --- a/libdrm/intel/intel_bufmgr_fake.c +++ b/libdrm/intel/intel_bufmgr_fake.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include "intel_bufmgr.h" #include "intel_bufmgr_priv.h" @@ -135,17 +136,10 @@ typedef struct _bufmgr_fake { unsigned need_fence:1; int thrashing; - /** - * Driver callback to emit a fence, returning the cookie. - * - * Currently, this also requires that a write flush be emitted before - * emitting the fence, but this should change. - */ - unsigned int (*fence_emit)(void *private); - /** Driver callback to wait for a fence cookie to have passed. */ - int (*fence_wait)(void *private, unsigned int fence_cookie); - /** Driver-supplied argument to driver callbacks */ - void *driver_priv; + /* Pointer to kernel-updated sarea data for the last completed user irq */ + volatile unsigned int *last_dispatch; + + int fd; int debug; @@ -214,18 +208,64 @@ static int FENCE_LTE( unsigned a, unsigned b ) static unsigned int _fence_emit_internal(dri_bufmgr_fake *bufmgr_fake) { - bufmgr_fake->last_fence = bufmgr_fake->fence_emit(bufmgr_fake->driver_priv); + struct drm_i915_irq_emit ie; + int ret, seq = 1; + + ie.irq_seq = &seq; + ret = drmCommandWriteRead(bufmgr_fake->fd, DRM_I915_IRQ_EMIT, + &ie, sizeof(ie)); + if (ret) { + drmMsg("%s: drm_i915_irq_emit: %d\n", __FUNCTION__, ret); + abort(); + } + + /* The kernel implementation of IRQ_WAIT is broken for wraparound, and has + * been since it was first introduced. It only checks for + * completed_seq >= seq, and thus returns success early for wrapped irq + * values if the CPU wins a race. + * + * We have to do it up front at emit when we discover wrap, so that another + * client can't race (after we drop the lock) to emit and wait and fail. + */ + if (seq == 0 || seq == 1) { + drmCommandWriteRead(bufmgr_fake->fd, DRM_I915_FLUSH, &ie, sizeof(ie)); + } + + DBG("emit 0x%08x\n", seq); + bufmgr_fake->last_fence = seq; return bufmgr_fake->last_fence; } static void _fence_wait_internal(dri_bufmgr_fake *bufmgr_fake, unsigned int cookie) { + struct drm_i915_irq_wait iw; + unsigned int last_dispatch; int ret; - ret = bufmgr_fake->fence_wait(bufmgr_fake->driver_priv, cookie); + DBG("wait 0x%08x\n", iw.irq_seq); + + /* The kernel implementation of IRQ_WAIT is broken for wraparound, and has + * been since it was first introduced. It only checks for + * completed_seq >= seq, and thus never returns for pre-wrapped irq values + * if the GPU wins the race. + * + * So, check if it looks like a pre-wrapped value and just return success. + */ + if (*bufmgr_fake->last_dispatch - cookie > 0x4000000) + return; + + iw.irq_seq = cookie; + + do { + last_dispatch = *bufmgr_fake->last_dispatch; + ret = drmCommandWrite(bufmgr_fake->fd, DRM_I915_IRQ_WAIT, + &iw, sizeof(iw)); + } while (ret == -EAGAIN || ret == -EINTR || + (ret == -EBUSY && last_dispatch != *bufmgr_fake->last_dispatch)); + if (ret != 0) { - drmMsg("%s:%d: Error %d waiting for fence.\n", __FILE__, __LINE__); + drmMsg("%s:%d: Error %d waiting for fence.\n", __FILE__, __LINE__, ret); abort(); } clear_fenced(bufmgr_fake, cookie); @@ -540,7 +580,7 @@ dri_bufmgr_fake_wait_idle(dri_bufmgr_fake *bufmgr_fake) { unsigned int cookie; - cookie = bufmgr_fake->fence_emit(bufmgr_fake->driver_priv); + cookie = _fence_emit_internal(bufmgr_fake); _fence_wait_internal(bufmgr_fake, cookie); } @@ -1187,13 +1227,19 @@ intel_bufmgr_fake_evict_all(dri_bufmgr *bufmgr) free_block(bufmgr_fake, block); } } +void intel_bufmgr_fake_set_last_dispatch(dri_bufmgr *bufmgr, + volatile unsigned int *last_dispatch) +{ + dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bufmgr; + + bufmgr_fake->last_dispatch = last_dispatch; +} dri_bufmgr * -intel_bufmgr_fake_init(unsigned long low_offset, void *low_virtual, +intel_bufmgr_fake_init(int fd, + unsigned long low_offset, void *low_virtual, unsigned long size, - unsigned int (*fence_emit)(void *private), - int (*fence_wait)(void *private, unsigned int cookie), - void *driver_priv) + volatile unsigned int *last_dispatch) { dri_bufmgr_fake *bufmgr_fake; @@ -1223,9 +1269,8 @@ intel_bufmgr_fake_init(unsigned long low_offset, void *low_virtual, bufmgr_fake->bufmgr.check_aperture_space = dri_fake_check_aperture_space; bufmgr_fake->bufmgr.debug = 0; - bufmgr_fake->fence_emit = fence_emit; - bufmgr_fake->fence_wait = fence_wait; - bufmgr_fake->driver_priv = driver_priv; + bufmgr_fake->fd = fd; + bufmgr_fake->last_dispatch = last_dispatch; return &bufmgr_fake->bufmgr; } diff --git a/libdrm/intel/intel_bufmgr_priv.h b/libdrm/intel/intel_bufmgr_priv.h index 92476aec..8a5741fa 100644 --- a/libdrm/intel/intel_bufmgr_priv.h +++ b/libdrm/intel/intel_bufmgr_priv.h @@ -172,29 +172,5 @@ struct _dri_bufmgr { int debug; /**< Enables verbose debugging printouts */ }; -/* intel_bufmgr_gem.c */ -dri_bufmgr *intel_bufmgr_gem_init(int fd, int batch_size); -dri_bo *intel_bo_gem_create_from_name(dri_bufmgr *bufmgr, const char *name, - unsigned int handle); -void intel_bufmgr_gem_enable_reuse(dri_bufmgr *bufmgr); - -/* intel_bufmgr_fake.c */ -dri_bufmgr *intel_bufmgr_fake_init(unsigned long low_offset, void *low_virtual, - unsigned long size, - unsigned int (*fence_emit)(void *private), - int (*fence_wait)(void *private, - unsigned int cookie), - void *driver_priv); -dri_bo *intel_bo_fake_alloc_static(dri_bufmgr *bufmgr, const char *name, - unsigned long offset, unsigned long size, - void *virtual); - -void intel_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr); -void intel_bo_fake_disable_backing_store(dri_bo *bo, - void (*invalidate_cb)(dri_bo *bo, - void *ptr), - void *ptr); -void intel_bufmgr_fake_evict_all(dri_bufmgr *bufmgr); - #endif /* INTEL_BUFMGR_PRIV_H */ -- cgit v1.2.3 From f9d98beefc9e7b8d06a29f5b69a19f10fd3c435f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 8 Sep 2008 08:51:40 -0700 Subject: intel: move drm calls to exec buffers to libdrm_intel. This avoids duplicating the effort in 3 places. Also, added emit/wait fence callbacks back in bufmgr_fake since we need it for non-drm 2d. Sigh. --- libdrm/intel/intel_bufmgr.c | 12 ++-- libdrm/intel/intel_bufmgr.h | 17 +++-- libdrm/intel/intel_bufmgr_fake.c | 151 +++++++++++++++++++++++++++++---------- libdrm/intel/intel_bufmgr_gem.c | 60 ++++++++-------- libdrm/intel/intel_bufmgr_priv.h | 23 ++---- 5 files changed, 168 insertions(+), 95 deletions(-) diff --git a/libdrm/intel/intel_bufmgr.c b/libdrm/intel/intel_bufmgr.c index 5a9cdbe6..45b691d6 100644 --- a/libdrm/intel/intel_bufmgr.c +++ b/libdrm/intel/intel_bufmgr.c @@ -123,14 +123,12 @@ dri_bufmgr_destroy(dri_bufmgr *bufmgr) bufmgr->destroy(bufmgr); } -void *dri_process_relocs(dri_bo *batch_buf) -{ - return batch_buf->bufmgr->process_relocs(batch_buf); -} - -void dri_post_submit(dri_bo *batch_buf) +int +dri_bo_exec(dri_bo *bo, int used, + drm_clip_rect_t *cliprects, int num_cliprects, + int DR4) { - batch_buf->bufmgr->post_submit(batch_buf); + return bo->bufmgr->bo_exec(bo, used, cliprects, num_cliprects, DR4); } void diff --git a/libdrm/intel/intel_bufmgr.h b/libdrm/intel/intel_bufmgr.h index 57a9e33a..c44d596b 100644 --- a/libdrm/intel/intel_bufmgr.h +++ b/libdrm/intel/intel_bufmgr.h @@ -76,10 +76,9 @@ void dri_bo_wait_rendering(dri_bo *bo); void dri_bufmgr_set_debug(dri_bufmgr *bufmgr, int enable_debug); void dri_bufmgr_destroy(dri_bufmgr *bufmgr); - -void *dri_process_relocs(dri_bo *batch_buf); -void dri_post_process_relocs(dri_bo *batch_buf); -void dri_post_submit(dri_bo *batch_buf); +int dri_bo_exec(dri_bo *bo, int used, + drm_clip_rect_t *cliprects, int num_cliprects, + int DR4); int dri_bufmgr_check_aperture_space(dri_bo **bo_array, int count); int dri_bo_emit_reloc(dri_bo *reloc_buf, @@ -103,6 +102,16 @@ dri_bufmgr *intel_bufmgr_fake_init(int fd, volatile unsigned int *last_dispatch); void intel_bufmgr_fake_set_last_dispatch(dri_bufmgr *bufmgr, volatile unsigned int *last_dispatch); +void intel_bufmgr_fake_set_exec_callback(dri_bufmgr *bufmgr, + int (*exec)(dri_bo *bo, + unsigned int used, + void *priv), + void *priv); +void intel_bufmgr_fake_set_fence_callback(dri_bufmgr *bufmgr, + unsigned int (*emit)(void *priv), + void (*wait)(unsigned int fence, + void *priv), + void *priv); dri_bo *intel_bo_fake_alloc_static(dri_bufmgr *bufmgr, const char *name, unsigned long offset, unsigned long size, void *virtual); diff --git a/libdrm/intel/intel_bufmgr_fake.c b/libdrm/intel/intel_bufmgr_fake.c index 47629033..f9e1cd12 100644 --- a/libdrm/intel/intel_bufmgr_fake.c +++ b/libdrm/intel/intel_bufmgr_fake.c @@ -136,6 +136,31 @@ typedef struct _bufmgr_fake { unsigned need_fence:1; int thrashing; + /** + * Driver callback to emit a fence, returning the cookie. + * + * This allows the driver to hook in a replacement for the DRM usage in + * bufmgr_fake. + * + * Currently, this also requires that a write flush be emitted before + * emitting the fence, but this should change. + */ + unsigned int (*fence_emit)(void *private); + /** Driver callback to wait for a fence cookie to have passed. */ + void (*fence_wait)(unsigned int fence, void *private); + void *fence_priv; + + /** + * Driver callback to execute a buffer. + * + * This allows the driver to hook in a replacement for the DRM usage in + * bufmgr_fake. + */ + int (*exec)(dri_bo *bo, unsigned int used, void *priv); + void *exec_priv; + + /** Driver-supplied argument to driver callbacks */ + void *driver_priv; /* Pointer to kernel-updated sarea data for the last completed user irq */ volatile unsigned int *last_dispatch; @@ -205,12 +230,28 @@ static int FENCE_LTE( unsigned a, unsigned b ) return 0; } +void intel_bufmgr_fake_set_fence_callback(dri_bufmgr *bufmgr, + unsigned int (*emit)(void *priv), + void (*wait)(unsigned int fence, + void *priv), + void *priv) +{ + dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bufmgr; + + bufmgr_fake->fence_emit = emit; + bufmgr_fake->fence_wait = wait; + bufmgr_fake->fence_priv = priv; +} + static unsigned int _fence_emit_internal(dri_bufmgr_fake *bufmgr_fake) { struct drm_i915_irq_emit ie; int ret, seq = 1; + if (bufmgr_fake->fence_emit != NULL) + return bufmgr_fake->fence_emit(bufmgr_fake->fence_priv); + ie.irq_seq = &seq; ret = drmCommandWriteRead(bufmgr_fake->fd, DRM_I915_IRQ_EMIT, &ie, sizeof(ie)); @@ -243,6 +284,11 @@ _fence_wait_internal(dri_bufmgr_fake *bufmgr_fake, unsigned int cookie) unsigned int last_dispatch; int ret; + if (bufmgr_fake->fence_wait != NULL) { + bufmgr_fake->fence_wait(cookie, bufmgr_fake->fence_priv); + return; + } + DBG("wait 0x%08x\n", iw.irq_seq); /* The kernel implementation of IRQ_WAIT is broken for wraparound, and has @@ -1092,38 +1138,6 @@ dri_fake_reloc_and_validate_buffer(dri_bo *bo) return dri_fake_bo_validate(bo); } -static void * -dri_fake_process_relocs(dri_bo *batch_buf) -{ - dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)batch_buf->bufmgr; - dri_bo_fake *batch_fake = (dri_bo_fake *)batch_buf; - int ret; - int retry_count = 0; - - bufmgr_fake->performed_rendering = 0; - - dri_fake_calculate_domains(batch_buf); - - batch_fake->read_domains = I915_GEM_DOMAIN_COMMAND; - - /* we've ran out of RAM so blow the whole lot away and retry */ - restart: - ret = dri_fake_reloc_and_validate_buffer(batch_buf); - if (bufmgr_fake->fail == 1) { - if (retry_count == 0) { - retry_count++; - dri_fake_kick_all(bufmgr_fake); - bufmgr_fake->fail = 0; - goto restart; - } else /* dump out the memory here */ - mmDumpMemInfo(bufmgr_fake->heap); - } - - assert(ret == 0); - - return NULL; -} - static void dri_bo_fake_post_submit(dri_bo *bo) { @@ -1150,12 +1164,74 @@ dri_bo_fake_post_submit(dri_bo *bo) } -static void -dri_fake_post_submit(dri_bo *batch_buf) +void intel_bufmgr_fake_set_exec_callback(dri_bufmgr *bufmgr, + int (*exec)(dri_bo *bo, + unsigned int used, + void *priv), + void *priv) +{ + dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bufmgr; + + bufmgr_fake->exec = exec; + bufmgr_fake->exec_priv = exec; +} + +static int +dri_fake_bo_exec(dri_bo *bo, int used, + drm_clip_rect_t *cliprects, int num_cliprects, + int DR4) { - dri_fake_fence_validated(batch_buf->bufmgr); + dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bo->bufmgr; + dri_bo_fake *batch_fake = (dri_bo_fake *)bo; + struct drm_i915_batchbuffer batch; + int ret; + int retry_count = 0; + + bufmgr_fake->performed_rendering = 0; + + dri_fake_calculate_domains(bo); - dri_bo_fake_post_submit(batch_buf); + batch_fake->read_domains = I915_GEM_DOMAIN_COMMAND; + + /* we've ran out of RAM so blow the whole lot away and retry */ + restart: + ret = dri_fake_reloc_and_validate_buffer(bo); + if (bufmgr_fake->fail == 1) { + if (retry_count == 0) { + retry_count++; + dri_fake_kick_all(bufmgr_fake); + bufmgr_fake->fail = 0; + goto restart; + } else /* dump out the memory here */ + mmDumpMemInfo(bufmgr_fake->heap); + } + + assert(ret == 0); + + if (bufmgr_fake->exec != NULL) { + int ret = bufmgr_fake->exec(bo, used, bufmgr_fake->exec_priv); + if (ret != 0) + return ret; + } else { + batch.start = bo->offset; + batch.used = used; + batch.cliprects = cliprects; + batch.num_cliprects = num_cliprects; + batch.DR1 = 0; + batch.DR4 = DR4; + + if (drmCommandWrite(bufmgr_fake->fd, DRM_I915_BATCHBUFFER, &batch, + sizeof(batch))) { + drmMsg("DRM_I915_BATCHBUFFER: %d\n", -errno); + return -errno; + } + } + + dri_fake_fence_validated(bo->bufmgr); + + dri_bo_fake_post_submit(bo); + + return 0; } /** @@ -1264,8 +1340,7 @@ intel_bufmgr_fake_init(int fd, bufmgr_fake->bufmgr.bo_wait_rendering = dri_fake_bo_wait_rendering; bufmgr_fake->bufmgr.bo_emit_reloc = dri_fake_emit_reloc; bufmgr_fake->bufmgr.destroy = dri_fake_destroy; - bufmgr_fake->bufmgr.process_relocs = dri_fake_process_relocs; - bufmgr_fake->bufmgr.post_submit = dri_fake_post_submit; + bufmgr_fake->bufmgr.bo_exec = dri_fake_bo_exec; bufmgr_fake->bufmgr.check_aperture_space = dri_fake_check_aperture_space; bufmgr_fake->bufmgr.debug = 0; diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c index 43d2d986..44152728 100644 --- a/libdrm/intel/intel_bufmgr_gem.c +++ b/libdrm/intel/intel_bufmgr_gem.c @@ -87,8 +87,6 @@ typedef struct _dri_bufmgr_gem { /** Array of lists of cached gem objects of power-of-two sizes */ struct dri_gem_bo_bucket cache_bucket[INTEL_GEM_BO_BUCKETS]; - - struct drm_i915_gem_execbuffer exec_arg; } dri_bufmgr_gem; struct _dri_bo_gem { @@ -706,27 +704,6 @@ dri_gem_bo_process_reloc(dri_bo *bo) } } -static void * -dri_gem_process_reloc(dri_bo *batch_buf) -{ - dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *) batch_buf->bufmgr; - - /* Update indices and set up the validate list. */ - dri_gem_bo_process_reloc(batch_buf); - - /* Add the batch buffer to the validation list. There are no relocations - * pointing to it. - */ - intel_add_validate_buffer(batch_buf); - - bufmgr_gem->exec_arg.buffers_ptr = (uintptr_t)bufmgr_gem->exec_objects; - bufmgr_gem->exec_arg.buffer_count = bufmgr_gem->exec_count; - bufmgr_gem->exec_arg.batch_start_offset = 0; - bufmgr_gem->exec_arg.batch_len = 0; /* written in intel_exec_ioctl */ - - return &bufmgr_gem->exec_arg; -} - static void intel_update_buffer_offsets (dri_bufmgr_gem *bufmgr_gem) { @@ -746,11 +723,35 @@ intel_update_buffer_offsets (dri_bufmgr_gem *bufmgr_gem) } } -static void -dri_gem_post_submit(dri_bo *batch_buf) +static int +dri_gem_bo_exec(dri_bo *bo, int used, + drm_clip_rect_t *cliprects, int num_cliprects, + int DR4) { - dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)batch_buf->bufmgr; - int i; + dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)bo->bufmgr; + struct drm_i915_gem_execbuffer execbuf; + int ret, i; + + /* Update indices and set up the validate list. */ + dri_gem_bo_process_reloc(bo); + + /* Add the batch buffer to the validation list. There are no relocations + * pointing to it. + */ + intel_add_validate_buffer(bo); + + execbuf.buffers_ptr = (uintptr_t)bufmgr_gem->exec_objects; + execbuf.buffer_count = bufmgr_gem->exec_count; + execbuf.batch_start_offset = 0; + execbuf.batch_len = used; + execbuf.cliprects_ptr = (uintptr_t)cliprects; + execbuf.num_cliprects = num_cliprects; + execbuf.DR1 = 0; + execbuf.DR4 = DR4; + + do { + ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER, &execbuf); + } while (ret == -EAGAIN); intel_update_buffer_offsets (bufmgr_gem); @@ -770,6 +771,8 @@ dri_gem_post_submit(dri_bo *batch_buf) bufmgr_gem->exec_bos[i] = NULL; } bufmgr_gem->exec_count = 0; + + return 0; } static int @@ -913,9 +916,8 @@ intel_bufmgr_gem_init(int fd, int batch_size) bufmgr_gem->bufmgr.bo_unpin = dri_gem_bo_unpin; bufmgr_gem->bufmgr.bo_set_tiling = dri_gem_bo_set_tiling; bufmgr_gem->bufmgr.bo_flink = dri_gem_bo_flink; + bufmgr_gem->bufmgr.bo_exec = dri_gem_bo_exec; bufmgr_gem->bufmgr.destroy = dri_bufmgr_gem_destroy; - bufmgr_gem->bufmgr.process_relocs = dri_gem_process_reloc; - bufmgr_gem->bufmgr.post_submit = dri_gem_post_submit; bufmgr_gem->bufmgr.debug = 0; bufmgr_gem->bufmgr.check_aperture_space = dri_gem_check_aperture_space; /* Initialize the linked lists for BO reuse cache. */ diff --git a/libdrm/intel/intel_bufmgr_priv.h b/libdrm/intel/intel_bufmgr_priv.h index 8a5741fa..7f39bfc2 100644 --- a/libdrm/intel/intel_bufmgr_priv.h +++ b/libdrm/intel/intel_bufmgr_priv.h @@ -103,23 +103,6 @@ struct _dri_bufmgr { */ void (*destroy)(dri_bufmgr *bufmgr); - /** - * Processes the relocations, either in userland or by converting the list - * for use in batchbuffer submission. - * - * Kernel-based implementations will return a pointer to the arguments - * to be handed with batchbuffer submission to the kernel. The userland - * implementation performs the buffer validation and emits relocations - * into them the appopriate order. - * - * \param batch_buf buffer at the root of the tree of relocations - * \return argument to be completed and passed to the execbuffers ioctl - * (if any). - */ - void *(*process_relocs)(dri_bo *batch_buf); - - void (*post_submit)(dri_bo *batch_buf); - /** * Add relocation entry in reloc_buf, which will be updated with the * target buffer's real offset on on command submission. @@ -140,6 +123,12 @@ struct _dri_bufmgr { int (*bo_emit_reloc)(dri_bo *reloc_buf, uint32_t read_domains, uint32_t write_domain, uint32_t delta, uint32_t offset, dri_bo *target); + + /** Executes the command buffer pointed to by bo. */ + int (*bo_exec)(dri_bo *bo, int used, + drm_clip_rect_t *cliprects, int num_cliprects, + int DR4); + /** * Pin a buffer to the aperture and fix the offset until unpinned * -- cgit v1.2.3 From 368b392e6dcd19cb75675c0c18d02f70257af1df Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Sep 2008 13:54:34 -0700 Subject: intel: don't forget to include config.h in bufmgr code. Thanks to airlied for catching this. --- libdrm/intel/intel_bufmgr.c | 4 ++++ libdrm/intel/intel_bufmgr_fake.c | 4 ++++ libdrm/intel/intel_bufmgr_gem.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/libdrm/intel/intel_bufmgr.c b/libdrm/intel/intel_bufmgr.c index 45b691d6..fc7284b5 100644 --- a/libdrm/intel/intel_bufmgr.c +++ b/libdrm/intel/intel_bufmgr.c @@ -25,6 +25,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/libdrm/intel/intel_bufmgr_fake.c b/libdrm/intel/intel_bufmgr_fake.c index f9e1cd12..4b4c2a1b 100644 --- a/libdrm/intel/intel_bufmgr_fake.c +++ b/libdrm/intel/intel_bufmgr_fake.c @@ -34,6 +34,10 @@ * the bugs in the old texture manager. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c index 44152728..97e387f5 100644 --- a/libdrm/intel/intel_bufmgr_gem.c +++ b/libdrm/intel/intel_bufmgr_gem.c @@ -34,6 +34,10 @@ * Dave Airlie */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include -- cgit v1.2.3 From b54d15d8fd252df5f0914ab245431e66b9a4e8ab Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Sep 2008 20:04:42 -0700 Subject: Add missing \ to libdrm_la_SOURCES Reported by jcristau. --- libdrm/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdrm/Makefile.am b/libdrm/Makefile.am index b69fcfee..f82d1917 100644 --- a/libdrm/Makefile.am +++ b/libdrm/Makefile.am @@ -25,7 +25,7 @@ libdrm_ladir = $(libdir) libdrm_la_LDFLAGS = -version-number 2:3:0 -no-undefined AM_CFLAGS = -I$(top_srcdir)/shared-core -libdrm_la_SOURCES = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c +libdrm_la_SOURCES = xf86drm.c xf86drmHash.c xf86drmRandom.c xf86drmSL.c \ libdrm_lists.h libdrmincludedir = ${includedir} -- cgit v1.2.3 From 973c634eaa54ee4085a72102c690bc643cb2d7a8 Mon Sep 17 00:00:00 2001 From: vehemens Date: Mon, 8 Sep 2008 22:06:09 -0700 Subject: Remove incomplete and obsolete free/net/open code. Signed-off-by: Robert Noland --- bsd-core/drmP.h | 148 ----------------------------- bsd-core/drm_agpsupport.c | 7 -- bsd-core/drm_atomic.h | 53 ----------- bsd-core/drm_bufs.c | 24 ----- bsd-core/drm_drv.c | 231 ++-------------------------------------------- bsd-core/drm_fops.c | 13 --- bsd-core/drm_irq.c | 29 +----- bsd-core/drm_lock.c | 5 - bsd-core/drm_memory.c | 43 --------- bsd-core/drm_pci.c | 25 ----- bsd-core/drm_vm.c | 18 ---- bsd-core/i915_drv.c | 5 - bsd-core/mach64_drv.c | 5 - bsd-core/mga_drv.c | 12 --- bsd-core/r128_drv.c | 10 -- bsd-core/radeon_drv.c | 10 -- bsd-core/savage_drv.c | 5 - bsd-core/sis_drv.c | 10 -- bsd-core/tdfx_drv.c | 10 -- bsd-core/via_drv.c | 10 -- 20 files changed, 8 insertions(+), 665 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index de59f426..8404df74 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -74,7 +74,6 @@ typedef struct drm_file drm_file_t; #include #include #include -#if defined(__FreeBSD__) #include #include #if __FreeBSD_version >= 800004 @@ -83,31 +82,9 @@ typedef struct drm_file drm_file_t; #include #endif /* __FreeBSD_version >= 800004 */ #include -#if __FreeBSD_version >= 500000 #include #include #include -#else /* __FreeBSD_version >= 500000 */ -#include -#include -#endif /* __FreeBSD_version < 500000 */ -#elif defined(__NetBSD__) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#elif defined(__OpenBSD__) -#include -#include -#endif #include #include "drm.h" @@ -115,13 +92,11 @@ typedef struct drm_file drm_file_t; #include "drm_atomic.h" #include "drm_internal.h" -#ifdef __FreeBSD__ #include #ifdef DRM_DEBUG #undef DRM_DEBUG #define DRM_DEBUG_DEFAULT_ON 1 #endif /* DRM_DEBUG */ -#endif #if defined(DRM_LINUX) && DRM_LINUX && !defined(__amd64__) #include @@ -195,12 +170,6 @@ MALLOC_DECLARE(M_DRM); #define DRM_WAKEUP_INT(w) wakeup(w) #define DRM_INIT_WAITQUEUE(queue) do {(void)(queue);} while (0) -#if defined(__FreeBSD__) && __FreeBSD_version < 502109 -#define bus_alloc_resource_any(dev, type, rid, flags) \ - bus_alloc_resource(dev, type, rid, 0ul, ~0ul, 1, flags) -#endif - -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 #define DRM_CURPROC curthread #define DRM_STRUCTPROC struct thread #define DRM_SPINTYPE struct mtx @@ -218,21 +187,6 @@ MALLOC_DECLARE(M_DRM); #define DRM_LOCK() mtx_lock(&dev->dev_lock) #define DRM_UNLOCK() mtx_unlock(&dev->dev_lock) #define DRM_SYSCTL_HANDLER_ARGS (SYSCTL_HANDLER_ARGS) -#else /* __FreeBSD__ && __FreeBSD_version >= 500000 */ -#define DRM_CURPROC curproc -#define DRM_STRUCTPROC struct proc -#define DRM_SPINTYPE struct simplelock -#define DRM_SPININIT(l,name) -#define DRM_SPINUNINIT(l) -#define DRM_SPINLOCK(l) -#define DRM_SPINUNLOCK(u) -#define DRM_SPINLOCK_ASSERT(l) -#define DRM_CURRENTPID curproc->p_pid -#define DRM_LOCK() -#define DRM_UNLOCK() -#define DRM_SYSCTL_HANDLER_ARGS SYSCTL_HANDLER_ARGS -#define spldrm() spltty() -#endif /* __NetBSD__ || __OpenBSD__ */ #define DRM_IRQ_ARGS void *arg typedef void irqreturn_t; @@ -246,16 +200,8 @@ enum { }; #define DRM_AGP_MEM struct agp_memory_info -#if defined(__FreeBSD__) #define drm_get_device_from_kdev(_kdev) (_kdev->si_drv1) -#elif defined(__NetBSD__) -#define drm_get_device_from_kdev(_kdev) device_lookup(&drm_cd, minor(_kdev)) -#elif defined(__OpenBSD__) -#define drm_get_device_from_kdev(_kdev) device_lookup(&drm_cd, \ - minor(_kdev)))->dv_cfdata->cf_driver->cd_devs[minor(_kdev)] -#endif -#if defined(__FreeBSD__) #define PAGE_ALIGN(addr) round_page(addr) /* DRM_SUSER returns true if the user is superuser */ #if __FreeBSD_version >= 700000 @@ -267,20 +213,6 @@ enum { #define DRM_MTRR_WC MDF_WRITECOMBINE #define jiffies ticks -#else /* __FreeBSD__ */ - -#define CDEV_MAJOR 34 -#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) -/* DRM_SUSER returns true if the user is superuser */ -#define DRM_SUSER(p) (suser(p->p_ucred, &p->p_acflag) == 0) -#define DRM_AGP_FIND_DEVICE() agp_find_device(0) -#define DRM_MTRR_WC MTRR_TYPE_WC -#define jiffies hardclock_ticks - -typedef struct drm_device *device_t; -extern struct cfdriver drm_cd; -#endif /* !__FreeBSD__ */ - /* Capabilities taken from src/sys/dev/pci/pcireg.h. */ #ifndef PCIY_AGP #define PCIY_AGP 0x02 @@ -318,7 +250,6 @@ typedef u_int8_t u8; "lock; addl $0,0(%%rsp)" : : : "memory"); #endif -#ifdef __FreeBSD__ #define DRM_READ8(map, offset) \ *(volatile u_int8_t *) (((unsigned long)(map)->handle) + (offset)) #define DRM_READ16(map, offset) \ @@ -335,27 +266,6 @@ typedef u_int8_t u8; #define DRM_VERIFYAREA_READ( uaddr, size ) \ (!useracc(__DECONST(caddr_t, uaddr), size, VM_PROT_READ)) -#else /* __FreeBSD__ */ - -typedef vaddr_t vm_offset_t; - -#define DRM_READ8(map, offset) \ - bus_space_read_1( (map)->bst, (map)->bsh, (offset)) -#define DRM_READ16(map, offset) \ - bus_space_read_2( (map)->bst, (map)->bsh, (offset)) -#define DRM_READ32(map, offset) \ - bus_space_read_4( (map)->bst, (map)->bsh, (offset)) -#define DRM_WRITE8(map, offset, val) \ - bus_space_write_1((map)->bst, (map)->bsh, (offset), (val)) -#define DRM_WRITE16(map, offset, val) \ - bus_space_write_2((map)->bst, (map)->bsh, (offset), (val)) -#define DRM_WRITE32(map, offset, val) \ - bus_space_write_4((map)->bst, (map)->bsh, (offset), (val)) - -#define DRM_VERIFYAREA_READ( uaddr, size ) \ - (!uvm_useracc((caddr_t)uaddr, size, VM_PROT_READ)) -#endif /* !__FreeBSD__ */ - #define DRM_COPY_TO_USER(user, kern, size) \ copyout(kern, user, size) #define DRM_COPY_FROM_USER(kern, user, size) \ @@ -364,13 +274,8 @@ typedef vaddr_t vm_offset_t; copyin(arg2, arg1, arg3) #define DRM_COPY_TO_USER_UNCHECKED(arg1, arg2, arg3) \ copyout(arg2, arg1, arg3) -#if __FreeBSD_version > 500000 #define DRM_GET_USER_UNCHECKED(val, uaddr) \ ((val) = fuword32(uaddr), 0) -#else -#define DRM_GET_USER_UNCHECKED(val, uaddr) \ - ((val) = fuword(uaddr), 0) -#endif #define cpu_to_le32(x) htole32(x) #define le32_to_cpu(x) le32toh(x) @@ -393,7 +298,6 @@ do { \ } \ } while (0) -#if defined(__FreeBSD__) && __FreeBSD_version > 500000 /* Returns -errno to shared code */ #define DRM_WAIT_ON( ret, queue, timeout, condition ) \ for ( ret = 0 ; !ret && !(condition) ; ) { \ @@ -405,17 +309,6 @@ for ( ret = 0 ; !ret && !(condition) ; ) { \ mtx_unlock(&dev->irq_lock); \ DRM_LOCK(); \ } -#else -/* Returns -errno to shared code */ -#define DRM_WAIT_ON( ret, queue, timeout, condition ) \ -for ( ret = 0 ; !ret && !(condition) ; ) { \ - int s = spldrm(); \ - if (!(condition)) \ - ret = -tsleep( &(queue), PZERO | PCATCH, \ - "drmwtq", (timeout) ); \ - splx(s); \ -} -#endif #define DRM_ERROR(fmt, arg...) \ printf("error: [" DRM_NAME ":pid%d:%s] *ERROR* " fmt, \ @@ -501,12 +394,8 @@ typedef struct drm_freelist { typedef struct drm_dma_handle { void *vaddr; bus_addr_t busaddr; -#if defined(__FreeBSD__) bus_dma_tag_t tag; bus_dmamap_t map; -#elif defined(__NetBSD__) - bus_dma_segment_t seg; -#endif } drm_dma_handle_t; typedef struct drm_buf_entry { @@ -727,10 +616,6 @@ struct drm_driver_info { * DRM device functions structure */ struct drm_device { -#if defined(__NetBSD__) || defined(__OpenBSD__) - struct device device; /* softc is an extension of struct device */ -#endif - struct drm_driver_info *driver; drm_pci_id_list_t *id_entry; /* PCI ID, name, and chipset private */ @@ -739,21 +624,17 @@ struct drm_device { char *unique; /* Unique identifier: e.g., busid */ int unique_len; /* Length of unique field */ -#ifdef __FreeBSD__ device_t device; /* Device instance from newbus */ -#endif struct cdev *devnode; /* Device number for mknod */ int if_version; /* Highest interface version set */ int flags; /* Flags to open(2) */ /* Locks */ -#if defined(__FreeBSD__) && __FreeBSD_version > 500000 struct mtx vbl_lock; /* protects vblank operations */ struct mtx dma_lock; /* protects dev->dma */ struct mtx irq_lock; /* protects irq condition checks */ struct mtx dev_lock; /* protects everything else */ -#endif DRM_SPINTYPE drw_lock; DRM_SPINTYPE tsk_lock; @@ -784,12 +665,8 @@ struct drm_device { /* Context support */ int irq; /* Interrupt used by board */ int irq_enabled; /* True if the irq handler is enabled */ -#ifdef __FreeBSD__ int irqrid; /* Interrupt used by board */ struct resource *irqr; /* Resource for interrupt used by board */ -#elif defined(__NetBSD__) || defined(__OpenBSD__) - struct pci_attach_args pa; -#endif void *irqh; /* Handle from bus_setup_intr */ /* Storage of resource pointers for drm_get_resource_* */ @@ -811,11 +688,7 @@ struct drm_device { struct drm_vblank_info *vblank; /* per crtc vblank info */ int num_crtcs; -#ifdef __FreeBSD__ struct sigio *buf_sigio; /* Processes waiting for SIGIO */ -#elif defined(__NetBSD__) - pid_t buf_pgid; -#endif /* Sysctl support */ struct drm_sysctl_info *sysctl; @@ -853,7 +726,6 @@ static inline int drm_core_has_AGP(struct drm_device *dev) extern int drm_debug_flag; /* Device setup support (drm_drv.c) */ -#ifdef __FreeBSD__ int drm_probe(device_t nbdev, drm_pci_id_list_t *idlist); int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist); int drm_detach(device_t nbdev); @@ -863,32 +735,14 @@ d_close_t drm_close; d_read_t drm_read; d_poll_t drm_poll; d_mmap_t drm_mmap; -#elif defined(__NetBSD__) || defined(__OpenBSD__) -int drm_probe(struct pci_attach_args *pa, drm_pci_id_list_t *idlist); -int drm_attach(struct pci_attach_args *pa, dev_t kdev, drm_pci_id_list_t *idlist); -dev_type_ioctl(drm_ioctl); -dev_type_open(drm_open); -dev_type_close(drm_close); -dev_type_read(drm_read); -dev_type_poll(drm_poll); -dev_type_mmap(drm_mmap); -#endif extern drm_local_map_t *drm_getsarea(struct drm_device *dev); /* File operations helpers (drm_fops.c) */ -#ifdef __FreeBSD__ extern int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p, struct drm_device *dev); extern drm_file_t *drm_find_file_by_proc(struct drm_device *dev, DRM_STRUCTPROC *p); -#elif defined(__NetBSD__) || defined(__OpenBSD__) -extern int drm_open_helper(dev_t kdev, int flags, int fmt, - DRM_STRUCTPROC *p, - struct drm_device *dev); -extern drm_file_t *drm_find_file_by_proc(struct drm_device *dev, - DRM_STRUCTPROC *p); -#endif /* __NetBSD__ || __OpenBSD__ */ /* Memory management support (drm_memory.c) */ void drm_mem_init(void); @@ -980,11 +834,9 @@ int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request); void drm_sg_cleanup(drm_sg_mem_t *entry); int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request); -#ifdef __FreeBSD__ /* sysctl support (drm_sysctl.h) */ extern int drm_sysctl_init(struct drm_device *dev); extern int drm_sysctl_cleanup(struct drm_device *dev); -#endif /* __FreeBSD__ */ /* ATI PCIGART support (ati_pcigart.c) */ int drm_ati_pcigart_init(struct drm_device *dev, diff --git a/bsd-core/drm_agpsupport.c b/bsd-core/drm_agpsupport.c index 62fa5d27..a568c5a5 100644 --- a/bsd-core/drm_agpsupport.c +++ b/bsd-core/drm_agpsupport.c @@ -35,20 +35,17 @@ #include "drmP.h" -#ifdef __FreeBSD__ #if __FreeBSD_version >= 800004 #include #else /* __FreeBSD_version >= 800004 */ #include #endif /* __FreeBSD_version >= 800004 */ #include -#endif /* Returns 1 if AGP or 0 if not. */ static int drm_device_find_capability(struct drm_device *dev, int cap) { -#ifdef __FreeBSD__ #if __FreeBSD_version >= 602102 return (pci_find_extcap(dev->device, cap, NULL) == 0); @@ -82,10 +79,6 @@ drm_device_find_capability(struct drm_device *dev, int cap) return 0; #endif -#else - /* XXX: fill me in for non-FreeBSD */ - return 1; -#endif } int drm_device_is_agp(struct drm_device *dev) diff --git a/bsd-core/drm_atomic.h b/bsd-core/drm_atomic.h index b499fc96..76de7a2f 100644 --- a/bsd-core/drm_atomic.h +++ b/bsd-core/drm_atomic.h @@ -33,65 +33,12 @@ typedef u_int32_t atomic_t; -#ifdef __FreeBSD__ #define atomic_set(p, v) (*(p) = (v)) #define atomic_read(p) (*(p)) #define atomic_inc(p) atomic_add_int(p, 1) #define atomic_dec(p) atomic_subtract_int(p, 1) #define atomic_add(n, p) atomic_add_int(p, n) #define atomic_sub(n, p) atomic_subtract_int(p, n) -#else /* __FreeBSD__ */ -/* FIXME */ -#define atomic_set(p, v) (*(p) = (v)) -#define atomic_read(p) (*(p)) -#define atomic_inc(p) (*(p) += 1) -#define atomic_dec(p) (*(p) -= 1) -#define atomic_add(n, p) (*(p) += (n)) -#define atomic_sub(n, p) (*(p) -= (n)) -/* FIXME */ -#define atomic_add_int(p, v) *(p) += v -#define atomic_subtract_int(p, v) *(p) -= v -#define atomic_set_int(p, bits) *(p) |= (bits) -#define atomic_clear_int(p, bits) *(p) &= ~(bits) -#endif /* !__FreeBSD__ */ - -#if !defined(__FreeBSD_version) || (__FreeBSD_version < 500000) -#if defined(__i386__) -/* The extra atomic functions from 5.0 haven't been merged to 4.x */ -static __inline int -atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src) -{ - int res = exp; - - __asm __volatile ( - " lock ; " - " cmpxchgl %1,%2 ; " - " setz %%al ; " - " movzbl %%al,%0 ; " - "1: " - "# atomic_cmpset_int" - : "+a" (res) /* 0 (result) */ - : "r" (src), /* 1 */ - "m" (*(dst)) /* 2 */ - : "memory"); - - return (res); -} -#else /* __i386__ */ -static __inline int -atomic_cmpset_int(__volatile__ int *dst, int old, int new) -{ - int s = splhigh(); - if (*dst==old) { - *dst = new; - splx(s); - return 1; - } - splx(s); - return 0; -} -#endif /* !__i386__ */ -#endif /* !__FreeBSD_version || __FreeBSD_version < 500000 */ static __inline atomic_t test_and_set_bit(int b, volatile void *p) diff --git a/bsd-core/drm_bufs.c b/bsd-core/drm_bufs.c index 6b31ad65..c9b5dc4e 100644 --- a/bsd-core/drm_bufs.c +++ b/bsd-core/drm_bufs.c @@ -1016,30 +1016,13 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) const int zero = 0; vm_offset_t address; struct vmspace *vms; -#ifdef __FreeBSD__ vm_ooffset_t foff; vm_size_t size; vm_offset_t vaddr; -#elif defined(__NetBSD__) || defined(__OpenBSD__) - struct vnode *vn; - voff_t foff; - vsize_t size; - vaddr_t vaddr; -#endif /* __NetBSD__ || __OpenBSD__ */ - struct drm_buf_map *request = data; int i; -#if defined(__NetBSD__) || defined(__OpenBSD__) - if (!vfinddev(kdev, VCHR, &vn)) - return 0; /* FIXME: Shouldn't this be EINVAL or something? */ -#endif /* __NetBSD__ || __OpenBSD */ - -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 vms = DRM_CURPROC->td_proc->p_vmspace; -#else - vms = DRM_CURPROC->p_vmspace; -#endif DRM_SPINLOCK(&dev->dma_lock); dev->buf_use++; /* Can't allocate more after this call */ @@ -1064,7 +1047,6 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) foff = 0; } -#ifdef __FreeBSD__ vaddr = round_page((vm_offset_t)vms->vm_daddr + MAXDSIZ); #if __FreeBSD_version >= 600023 retcode = vm_mmap(&vms->vm_map, &vaddr, size, PROT_READ | PROT_WRITE, @@ -1074,12 +1056,6 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_file *file_priv) VM_PROT_ALL, MAP_SHARED, SLIST_FIRST(&dev->devnode->si_hlist), foff); #endif -#elif defined(__NetBSD__) || defined(__OpenBSD__) - vaddr = round_page((vaddr_t)vms->vm_daddr + MAXDSIZ); - retcode = uvm_mmap(&vms->vm_map, &vaddr, size, - UVM_PROT_READ | UVM_PROT_WRITE, UVM_PROT_ALL, MAP_SHARED, - &vn->v_uobj, foff, p->p_rlimit[RLIMIT_MEMLOCK].rlim_cur); -#endif /* __NetBSD__ || __OpenBSD */ if (retcode) goto done; diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index b40d1da4..57a2bbed 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -50,22 +50,13 @@ static void drm_unload(struct drm_device *dev); static drm_pci_id_list_t *drm_find_description(int vendor, int device, drm_pci_id_list_t *idlist); -#ifdef __FreeBSD__ #define DRIVER_SOFTC(unit) \ ((struct drm_device *)devclass_get_softc(drm_devclass, unit)) MODULE_VERSION(drm, 1); MODULE_DEPEND(drm, agp, 1, 1, 1); MODULE_DEPEND(drm, pci, 1, 1, 1); -#if __FreeBSD_version > 502127 MODULE_DEPEND(drm, mem, 1, 1, 1); -#endif -#endif /* __FreeBSD__ */ - -#if defined(__NetBSD__) || defined(__OpenBSD__) -#define DRIVER_SOFTC(unit) \ - ((struct drm_device *)device_lookup(&drm_cd, unit)) -#endif /* __NetBSD__ || __OpenBSD__ */ static drm_ioctl_desc_t drm_ioctls[256] = { DRM_IOCTL_DEF(DRM_IOCTL_VERSION, drm_version, 0), @@ -129,11 +120,8 @@ static drm_ioctl_desc_t drm_ioctls[256] = { DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_update_draw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), }; -#ifdef __FreeBSD__ static struct cdevsw drm_cdevsw = { -#if __FreeBSD_version >= 502103 .d_version = D_VERSION, -#endif .d_open = drm_open, .d_close = drm_close, .d_read = drm_read, @@ -141,15 +129,7 @@ static struct cdevsw drm_cdevsw = { .d_poll = drm_poll, .d_mmap = drm_mmap, .d_name = "drm", -#if __FreeBSD_version >= 502103 - .d_flags = D_TRACKCLOSE | D_NEEDGIANT, -#else - .d_maj = 145, - .d_flags = D_TRACKCLOSE, -#endif -#if __FreeBSD_version < 500000 - .d_bmaj = -1 -#endif + .d_flags = D_TRACKCLOSE | D_NEEDGIANT }; int drm_probe(device_t dev, drm_pci_id_list_t *idlist) @@ -202,13 +182,12 @@ int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist) DRM_DEV_GID, DRM_DEV_MODE, "dri/card%d", unit); -#if __FreeBSD_version >= 500000 + mtx_init(&dev->dev_lock, "drmdev", NULL, MTX_DEF); mtx_init(&dev->irq_lock, "drmirq", NULL, MTX_DEF); mtx_init(&dev->vbl_lock, "drmvbl", NULL, MTX_DEF); mtx_init(&dev->drw_lock, "drmdrw", NULL, MTX_DEF); mtx_init(&dev->tsk_lock, "drmtsk", NULL, MTX_DEF); -#endif id_entry = drm_find_description(pci_get_vendor(dev->device), pci_get_device(dev->device), idlist); @@ -229,147 +208,6 @@ int drm_detach(device_t dev) devclass_t drm_devclass; -#elif defined(__NetBSD__) || defined(__OpenBSD__) - -static struct cdevsw drm_cdevsw = { - drm_open, - drm_close, - drm_read, - nowrite, - drm_ioctl, - nostop, - notty, - drm_poll, - drm_mmap, - nokqfilter, - D_TTY -}; - -int drm_refcnt = 0; - -#if defined(__NetBSD__) && __NetBSD_Version__ >= 106080000 -MOD_DEV("drm", DRIVER_NAME, NULL, -1, &drm_cdevsw, CDEV_MAJOR); -#else -MOD_DEV("drm", LM_DT_CHAR, CDEV_MAJOR, &drm_cdevsw); -#endif - -int drm_lkmentry(struct lkm_table *lkmtp, int cmd, int ver); -static int drm_lkmhandle(struct lkm_table *lkmtp, int cmd); - -int drm_modprobe(void); -int drm_probe(struct pci_attach_args *pa); -void drm_attach(struct pci_attach_args *pa, dev_t kdev); - -int drm_lkmentry(struct lkm_table *lkmtp, int cmd, int ver) { - DISPATCH(lkmtp, cmd, ver, drm_lkmhandle, drm_lkmhandle, drm_lkmhandle); -} - -static int drm_lkmhandle(struct lkm_table *lkmtp, int cmd) -{ - int error = 0; - - switch(cmd) { - case LKM_E_LOAD: - if (lkmexists(lkmtp)) - return EEXIST; - - if(drm_modprobe()) - return 0; - - return 1; - - case LKM_E_UNLOAD: - if (drm_refcnt > 0) - return (EBUSY); - break; - case LKM_E_STAT: - break; - - default: - error = EIO; - break; - } - - return error; -} - -int drm_modprobe(void) -{ - struct pci_attach_args pa; - int error; - - error = pci_find_device(&pa, drm_probe, idlist); - if (error != 0) - drm_attach(&pa, 0); - - return error; -} - -int drm_probe(struct pci_attach_args *pa, drm_pci_id_list_t idlist) -{ - const char *desc; - drm_pci_id_list_t *id_entry; - - id_entry = drm_find_description(PCI_VENDOR(pa->pa_id), - PCI_PRODUCT(pa->pa_id), idlist); - if (id_entry != NULL) { - return 1; - } - - return 0; -} - -void drm_attach(struct pci_attach_args *pa, dev_t kdev, - drm_pci_id_list_t *idlist) -{ - int i; - struct drm_device *dev; - drm_pci_id_list_t *id_entry; - - config_makeroom(kdev, &drm_cd); - drm_cd.cd_devs[(kdev)] = malloc(sizeof(struct drm_device), - M_DRM, M_WAITOK); - dev = DRIVER_SOFTC(kdev); - - memset(dev, 0, sizeof(struct drm_device)); - memcpy(&dev->pa, pa, sizeof(dev->pa)); - - dev->irq = pa->pa_intrline; - dev->pci_domain = 0; - dev->pci_bus = pa->pa_bus; - dev->pci_slot = pa->pa_device; - dev->pci_func = pa->pa_function; - dev->dma_tag = pa->pa_dmat; - - id_entry = drm_find_description(PCI_VENDOR(pa->pa_id), - PCI_PRODUCT(pa->pa_id), idlist); - dev->driver->pci_id_entry = id_entry; - - DRM_INFO("%s", id_entry->name); - drm_load(dev); -} - -int drm_detach(struct device *self, int flags) -{ - drm_unload((struct drm_device *)self); - return 0; -} - -int drm_activate(struct device *self, enum devact act) -{ - switch (act) { - case DVACT_ACTIVATE: - return (EOPNOTSUPP); - break; - - case DVACT_DEACTIVATE: - /* FIXME */ - break; - } - return (0); -} -#endif /* __NetBSD__ || __OpenBSD__ */ - drm_pci_id_list_t *drm_find_description(int vendor, int device, drm_pci_id_list_t *idlist) { @@ -419,11 +257,7 @@ static int drm_firstopen(struct drm_device *dev) dev->last_context = 0; dev->if_version = 0; -#ifdef __FreeBSD__ dev->buf_sigio = NULL; -#elif defined(__NetBSD__) || defined(__OpenBSD__) - dev->buf_pgid = 0; -#endif DRM_DEBUG("\n"); @@ -451,7 +285,7 @@ static int drm_lastclose(struct drm_device *dev) dev->unique = NULL; dev->unique_len = 0; } - /* Clear pid list */ + /* Clear pid list */ for (i = 0; i < DRM_HASH_SIZE; i++) { for (pt = dev->magiclist[i].head; pt; pt = next) { next = pt->next; @@ -514,7 +348,7 @@ static int drm_load(struct drm_device *dev) DRM_DEBUG("\n"); dev->irq = pci_get_irq(dev->device); -#if defined(__FreeBSD__) && __FreeBSD_version >= 700053 +#if __FreeBSD_version >= 700053 dev->pci_domain = pci_get_domain(dev->device); #else dev->pci_domain = 0; @@ -529,9 +363,7 @@ static int drm_load(struct drm_device *dev) TAILQ_INIT(&dev->maplist); drm_mem_init(); -#ifdef __FreeBSD__ drm_sysctl_init(dev); -#endif TAILQ_INIT(&dev->files); dev->counters = 6; @@ -596,22 +428,18 @@ static int drm_load(struct drm_device *dev) return 0; error: -#ifdef __FreeBSD__ drm_sysctl_cleanup(dev); -#endif DRM_LOCK(); drm_lastclose(dev); DRM_UNLOCK(); -#ifdef __FreeBSD__ destroy_dev(dev->devnode); -#if __FreeBSD_version >= 500000 + mtx_destroy(&dev->tsk_lock); mtx_destroy(&dev->drw_lock); mtx_destroy(&dev->vbl_lock); mtx_destroy(&dev->irq_lock); mtx_destroy(&dev->dev_lock); -#endif -#endif + return retcode; } @@ -621,10 +449,8 @@ static void drm_unload(struct drm_device *dev) DRM_DEBUG("\n"); -#ifdef __FreeBSD__ drm_sysctl_cleanup(dev); destroy_dev(dev->devnode); -#endif drm_ctxbitmap_cleanup(dev); @@ -671,13 +497,11 @@ static void drm_unload(struct drm_device *dev) if (pci_disable_busmaster(dev->device)) DRM_ERROR("Request to disable bus-master failed.\n"); -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 mtx_destroy(&dev->tsk_lock); mtx_destroy(&dev->drw_lock); mtx_destroy(&dev->vbl_lock); mtx_destroy(&dev->irq_lock); mtx_destroy(&dev->dev_lock); -#endif } @@ -720,9 +544,7 @@ int drm_open(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) if (!retcode) { atomic_inc(&dev->counts[_DRM_STAT_OPENS]); DRM_LOCK(); -#ifdef __FreeBSD__ device_busy(dev->device); -#endif if (!dev->open_count++) retcode = drm_firstopen(dev); DRM_UNLOCK(); @@ -758,13 +580,8 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) * Begin inline drm_release */ -#ifdef __FreeBSD__ DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n", DRM_CURRENTPID, (long)dev->device, dev->open_count); -#elif defined(__NetBSD__) || defined(__OpenBSD__) - DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n", - DRM_CURRENTPID, (long)&dev->device, dev->open_count); -#endif if (dev->lock.hw_lock && _DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) && dev->lock.file_priv == file_priv) { @@ -796,14 +613,9 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) atomic_inc(&dev->counts[_DRM_STAT_LOCKS]); break; /* Got lock */ } - /* Contention */ -#if defined(__FreeBSD__) && __FreeBSD_version > 500000 + /* Contention */ retcode = mtx_sleep((void *)&dev->lock.lock_queue, &dev->dev_lock, PZERO | PCATCH, "drmlk2", 0); -#else - retcode = tsleep((void *)&dev->lock.lock_queue, - PZERO | PCATCH, "drmlk2", 0); -#endif if (retcode) break; } @@ -817,13 +629,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) !dev->driver->reclaim_buffers_locked) drm_reclaim_buffers(dev, file_priv); -#if defined (__FreeBSD__) && (__FreeBSD_version >= 500000) funsetown(&dev->buf_sigio); -#elif defined(__FreeBSD__) - funsetown(dev->buf_sigio); -#elif defined(__NetBSD__) || defined(__OpenBSD__) - dev->buf_pgid = 0; -#endif /* __NetBSD__ || __OpenBSD__ */ if (dev->driver->postclose != NULL) dev->driver->postclose(dev, file_priv); @@ -836,9 +642,7 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) done: atomic_inc(&dev->counts[_DRM_STAT_CLOSES]); -#ifdef __FreeBSD__ device_unbusy(dev->device); -#endif if (--dev->open_count == 0) { retcode = drm_lastclose(dev); } @@ -872,42 +676,21 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]); ++file_priv->ioctl_count; -#ifdef __FreeBSD__ DRM_DEBUG("pid=%d, cmd=0x%02lx, nr=0x%02x, dev 0x%lx, auth=%d\n", DRM_CURRENTPID, cmd, nr, (long)dev->device, file_priv->authenticated); -#elif defined(__NetBSD__) || defined(__OpenBSD__) - DRM_DEBUG("pid=%d, cmd=0x%02lx, nr=0x%02x, dev 0x%lx, auth=%d\n", - DRM_CURRENTPID, cmd, nr, (long)&dev->device, - file_priv->authenticated); -#endif switch (cmd) { case FIONBIO: case FIOASYNC: return 0; -#ifdef __FreeBSD__ case FIOSETOWN: return fsetown(*(int *)data, &dev->buf_sigio); case FIOGETOWN: -#if (__FreeBSD_version >= 500000) *(int *) data = fgetown(&dev->buf_sigio); -#else - *(int *) data = fgetown(dev->buf_sigio); -#endif - return 0; -#endif /* __FreeBSD__ */ -#if defined(__NetBSD__) || defined(__OpenBSD__) - case TIOCSPGRP: - dev->buf_pgid = *(int *)data; - return 0; - - case TIOCGPGRP: - *(int *)data = dev->buf_pgid; return 0; -#endif /* __NetBSD__ */ } if (IOCGROUP(cmd) != DRM_IOCTL_BASE) { diff --git a/bsd-core/drm_fops.c b/bsd-core/drm_fops.c index 248e7937..a002d259 100644 --- a/bsd-core/drm_fops.c +++ b/bsd-core/drm_fops.c @@ -38,13 +38,8 @@ drm_file_t *drm_find_file_by_proc(struct drm_device *dev, DRM_STRUCTPROC *p) { -#if __FreeBSD_version >= 500021 uid_t uid = p->td_ucred->cr_svuid; pid_t pid = p->td_proc->p_pid; -#else - uid_t uid = p->p_cred->p_svuid; - pid_t pid = p->p_pid; -#endif drm_file_t *priv; DRM_SPINLOCK_ASSERT(&dev->dev_lock); @@ -79,14 +74,8 @@ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p, DRM_UNLOCK(); return ENOMEM; } -#if __FreeBSD_version >= 500000 priv->uid = p->td_ucred->cr_svuid; priv->pid = p->td_proc->p_pid; -#else - priv->uid = p->p_cred->p_svuid; - priv->pid = p->p_pid; -#endif - priv->refs = 1; priv->minor = m; priv->ioctl_count = 0; @@ -110,9 +99,7 @@ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p, TAILQ_INSERT_TAIL(&dev->files, priv, link); } DRM_UNLOCK(); -#ifdef __FreeBSD__ kdev->si_drv1 = dev; -#endif return 0; } diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index e3a4cb6a..00d4b31e 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -54,7 +54,6 @@ int drm_irq_by_busid(struct drm_device *dev, void *data, return 0; } -#if defined(__FreeBSD__) && __FreeBSD_version >= 500000 static irqreturn_t drm_irq_handler_wrap(DRM_IRQ_ARGS) { @@ -64,7 +63,6 @@ drm_irq_handler_wrap(DRM_IRQ_ARGS) dev->driver->irq_handler(arg); DRM_SPINUNLOCK(&dev->irq_lock); } -#endif static void vblank_disable_fn(void *arg) { @@ -154,9 +152,6 @@ err: int drm_irq_install(struct drm_device *dev) { int retcode; -#ifdef __NetBSD__ - pci_intr_handle_t ih; -#endif if (dev->irq == 0 || dev->dev_private == NULL) return EINVAL; @@ -177,7 +172,6 @@ int drm_irq_install(struct drm_device *dev) DRM_UNLOCK(); /* Install handler */ -#ifdef __FreeBSD__ dev->irqrid = 0; dev->irqr = bus_alloc_resource_any(dev->device, SYS_RES_IRQ, &dev->irqrid, RF_SHAREABLE); @@ -196,18 +190,6 @@ int drm_irq_install(struct drm_device *dev) #endif if (retcode != 0) goto err; -#elif defined(__NetBSD__) || defined(__OpenBSD__) - if (pci_intr_map(&dev->pa, &ih) != 0) { - retcode = ENOENT; - goto err; - } - dev->irqh = pci_intr_establish(&dev->pa.pa_pc, ih, IPL_TTY, - (irqreturn_t (*)(void *))dev->irq_handler, dev); - if (!dev->irqh) { - retcode = ENOENT; - goto err; - } -#endif /* After installing handler */ DRM_LOCK(); @@ -219,44 +201,35 @@ int drm_irq_install(struct drm_device *dev) err: DRM_LOCK(); dev->irq_enabled = 0; -#ifdef ___FreeBSD__ if (dev->irqrid != 0) { bus_release_resource(dev->device, SYS_RES_IRQ, dev->irqrid, dev->irqr); dev->irqrid = 0; } -#endif DRM_UNLOCK(); return retcode; } int drm_irq_uninstall(struct drm_device *dev) { -#ifdef __FreeBSD__ int irqrid; -#endif if (!dev->irq_enabled) return EINVAL; dev->irq_enabled = 0; -#ifdef __FreeBSD__ irqrid = dev->irqrid; dev->irqrid = 0; -#endif DRM_DEBUG("irq=%d\n", dev->irq); dev->driver->irq_uninstall(dev); -#ifdef __FreeBSD__ DRM_UNLOCK(); bus_teardown_intr(dev->device, dev->irqr, dev->irqh); bus_release_resource(dev->device, SYS_RES_IRQ, irqrid, dev->irqr); DRM_LOCK(); -#elif defined(__NetBSD__) || defined(__OpenBSD__) - pci_intr_disestablish(&dev->pa.pa_pc, dev->irqh); -#endif + drm_vblank_cleanup(dev); return 0; diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index 31badd34..685b0ea3 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -78,13 +78,8 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) } /* Contention */ -#if defined(__FreeBSD__) && __FreeBSD_version > 500000 ret = mtx_sleep((void *)&dev->lock.lock_queue, &dev->dev_lock, PZERO | PCATCH, "drmlk2", 0); -#else - ret = tsleep((void *)&dev->lock.lock_queue, PZERO | PCATCH, - "drmlk2", 0); -#endif if (ret != 0) break; } diff --git a/bsd-core/drm_memory.c b/bsd-core/drm_memory.c index 272c0874..2dfd2b8e 100644 --- a/bsd-core/drm_memory.c +++ b/bsd-core/drm_memory.c @@ -42,9 +42,6 @@ MALLOC_DEFINE(M_DRM, "drm", "DRM Data Structures"); void drm_mem_init(void) { -#if defined(__NetBSD__) || defined(__OpenBSD__) - malloc_type_attach(M_DRM); -#endif } void drm_mem_uninit(void) @@ -87,27 +84,14 @@ void *drm_ioremap_wc(struct drm_device *dev, drm_local_map_t *map) void *drm_ioremap(struct drm_device *dev, drm_local_map_t *map) { -#ifdef __FreeBSD__ return pmap_mapdev(map->offset, map->size); -#elif defined(__NetBSD__) || defined(__OpenBSD__) - map->bst = dev->pa.pa_memt; - if (bus_space_map(map->bst, map->offset, map->size, - BUS_SPACE_MAP_LINEAR, &map->bsh)) - return NULL; - return bus_space_vaddr(map->bst, map->bsh); -#endif } void drm_ioremapfree(drm_local_map_t *map) { -#ifdef __FreeBSD__ pmap_unmapdev((vm_offset_t) map->handle, map->size); -#elif defined(__NetBSD__) || defined(__OpenBSD__) - bus_space_unmap(map->bst, map->bsh, map->size); -#endif } -#ifdef __FreeBSD__ int drm_mtrr_add(unsigned long offset, size_t size, int flags) { @@ -135,30 +119,3 @@ drm_mtrr_del(int __unused handle, unsigned long offset, size_t size, int flags) strlcpy(mrdesc.mr_owner, "drm", sizeof(mrdesc.mr_owner)); return mem_range_attr_set(&mrdesc, &act); } -#elif defined(__NetBSD__) || defined(__OpenBSD__) -int -drm_mtrr_add(unsigned long offset, size_t size, int flags) -{ - struct mtrr mtrrmap; - int one = 1; - - mtrrmap.base = offset; - mtrrmap.len = size; - mtrrmap.type = flags; - mtrrmap.flags = MTRR_VALID; - return mtrr_set(&mtrrmap, &one, NULL, MTRR_GETSET_KERNEL); -} - -int -drm_mtrr_del(unsigned long offset, size_t size, int flags) -{ - struct mtrr mtrrmap; - int one = 1; - - mtrrmap.base = offset; - mtrrmap.len = size; - mtrrmap.type = flags; - mtrrmap.flags = 0; - return mtrr_set(&mtrrmap, &one, NULL, MTRR_GETSET_KERNEL); -} -#endif diff --git a/bsd-core/drm_pci.c b/bsd-core/drm_pci.c index 16c830ec..e21715b2 100644 --- a/bsd-core/drm_pci.c +++ b/bsd-core/drm_pci.c @@ -34,7 +34,6 @@ /** \name PCI memory */ /*@{*/ -#if defined(__FreeBSD__) static void drm_pci_busdma_callback(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { @@ -46,7 +45,6 @@ drm_pci_busdma_callback(void *arg, bus_dma_segment_t *segs, int nsegs, int error KASSERT(nsegs == 1, ("drm_pci_busdma_callback: bad dma segment count")); dmah->busaddr = segs[0].ds_addr; } -#endif /** * \brief Allocate a physically contiguous DMA-accessible consistent @@ -70,7 +68,6 @@ drm_pci_alloc(struct drm_device *dev, size_t size, if (dmah == NULL) return NULL; -#ifdef __FreeBSD__ /* Make sure we aren't holding locks here */ mtx_assert(&dev->dev_lock, MA_NOTOWNED); if (mtx_owned(&dev->dev_lock)) @@ -106,24 +103,6 @@ drm_pci_alloc(struct drm_device *dev, size_t size, free(dmah, M_DRM); return NULL; } -#elif defined(__NetBSD__) - ret = bus_dmamem_alloc(dev->dma_tag, size, align, PAGE_SIZE, - &dmah->seg, 1, &nsegs, BUS_DMA_NOWAIT); - if ((ret != 0) || (nsegs != 1)) { - free(dmah, M_DRM); - return NULL; - } - - ret = bus_dmamem_map(dev->dma_tag, &dmah->seg, 1, size, &dmah->addr, - BUS_DMA_NOWAIT); - if (ret != 0) { - bus_dmamem_free(dev->dma_tag, &dmah->seg, 1); - free(dmah, M_DRM); - return NULL; - } - - dmah->dmaaddr = h->seg.ds_addr; -#endif return dmah; } @@ -137,12 +116,8 @@ drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah) if (dmah == NULL) return; -#if defined(__FreeBSD__) bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); -#elif defined(__NetBSD__) - bus_dmamem_free(dev->dma_tag, &dmah->seg, 1); -#endif free(dmah, M_DRM); } diff --git a/bsd-core/drm_vm.c b/bsd-core/drm_vm.c index e9c8702e..7fa33c91 100644 --- a/bsd-core/drm_vm.c +++ b/bsd-core/drm_vm.c @@ -28,24 +28,14 @@ #include "drmP.h" #include "drm.h" -#if defined(__FreeBSD__) && __FreeBSD_version >= 500102 int drm_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot) -#elif defined(__FreeBSD__) -int drm_mmap(dev_t kdev, vm_offset_t offset, int prot) -#elif defined(__NetBSD__) || defined(__OpenBSD__) -paddr_t drm_mmap(dev_t kdev, off_t offset, int prot) -#endif { struct drm_device *dev = drm_get_device_from_kdev(kdev); drm_local_map_t *map; drm_file_t *priv; enum drm_map_type type; -#ifdef __FreeBSD__ vm_paddr_t phys; -#else - paddr_t phys; -#endif DRM_LOCK(); priv = drm_find_file_by_proc(dev, DRM_CURPROC); @@ -68,12 +58,8 @@ paddr_t drm_mmap(dev_t kdev, off_t offset, int prot) unsigned long phys = dma->pagelist[page]; DRM_SPINUNLOCK(&dev->dma_lock); -#if defined(__FreeBSD__) && __FreeBSD_version >= 500102 *paddr = phys; return 0; -#else - return atop(phys); -#endif } else { DRM_SPINUNLOCK(&dev->dma_lock); return -1; @@ -124,11 +110,7 @@ paddr_t drm_mmap(dev_t kdev, off_t offset, int prot) return -1; /* This should never happen. */ } -#if defined(__FreeBSD__) && __FreeBSD_version >= 500102 *paddr = phys; return 0; -#else - return atop(phys); -#endif } diff --git a/bsd-core/i915_drv.c b/bsd-core/i915_drv.c index 7e745190..def35f0b 100644 --- a/bsd-core/i915_drv.c +++ b/bsd-core/i915_drv.c @@ -98,7 +98,6 @@ static void i915_configure(struct drm_device *dev) dev->driver->patchlevel = DRIVER_PATCHLEVEL; } -#ifdef __FreeBSD__ static int i915_probe(device_t dev) { @@ -159,7 +158,3 @@ DRIVER_MODULE(i915, vgapci, i915_driver, drm_devclass, 0, 0); DRIVER_MODULE(i915, agp, i915_driver, drm_devclass, 0, 0); #endif MODULE_DEPEND(i915, drm, 1, 1, 1); - -#elif defined(__NetBSD__) || defined(__OpenBSD__) -CFDRIVER_DECL(i915, DV_TTY, NULL); -#endif diff --git a/bsd-core/mach64_drv.c b/bsd-core/mach64_drv.c index 36f3cec7..adb83d3a 100644 --- a/bsd-core/mach64_drv.c +++ b/bsd-core/mach64_drv.c @@ -72,7 +72,6 @@ static void mach64_configure(struct drm_device *dev) dev->driver->patchlevel = DRIVER_PATCHLEVEL; } -#ifdef __FreeBSD__ static int mach64_probe(device_t dev) { @@ -127,7 +126,3 @@ DRIVER_MODULE(mach64, vgapci, mach64_driver, drm_devclass, 0, 0); DRIVER_MODULE(mach64, pci, mach64_driver, drm_devclass, 0, 0); #endif MODULE_DEPEND(mach64, drm, 1, 1, 1); - -#elif defined(__NetBSD__) || defined(__OpenBSD__) -CFDRIVER_DECL(mach64, DV_TTY, NULL); -#endif diff --git a/bsd-core/mga_drv.c b/bsd-core/mga_drv.c index 85809609..5554236a 100644 --- a/bsd-core/mga_drv.c +++ b/bsd-core/mga_drv.c @@ -116,9 +116,6 @@ static void mga_configure(struct drm_device *dev) dev->driver->patchlevel = DRIVER_PATCHLEVEL; } - - -#ifdef __FreeBSD__ static int mga_probe(device_t dev) { @@ -173,12 +170,3 @@ DRIVER_MODULE(mga, vgapci, mga_driver, drm_devclass, 0, 0); DRIVER_MODULE(mga, pci, mga_driver, drm_devclass, 0, 0); #endif MODULE_DEPEND(mga, drm, 1, 1, 1); - -#elif defined(__NetBSD__) || defined(__OpenBSD__) -#ifdef _LKM -CFDRIVER_DECL(mga, DV_TTY, NULL); -#else -CFATTACH_DECL(mga, sizeof(struct drm_device), drm_probe, drm_attach, drm_detach, - drm_activate); -#endif -#endif diff --git a/bsd-core/r128_drv.c b/bsd-core/r128_drv.c index 5d4dfed9..4c20af4d 100644 --- a/bsd-core/r128_drv.c +++ b/bsd-core/r128_drv.c @@ -71,7 +71,6 @@ static void r128_configure(struct drm_device *dev) dev->driver->patchlevel = DRIVER_PATCHLEVEL; } -#ifdef __FreeBSD__ static int r128_probe(device_t dev) { @@ -126,12 +125,3 @@ DRIVER_MODULE(r128, vgapci, r128_driver, drm_devclass, 0, 0); DRIVER_MODULE(r128, pci, r128_driver, drm_devclass, 0, 0); #endif MODULE_DEPEND(r128, drm, 1, 1, 1); - -#elif defined(__NetBSD__) || defined(__OpenBSD__) -#ifdef _LKM -CFDRIVER_DECL(r128, DV_TTY, NULL); -#else -CFATTACH_DECL(r128, sizeof(struct drm_device), drm_probe, drm_attach, - drm_detach, drm_activate); -#endif -#endif diff --git a/bsd-core/radeon_drv.c b/bsd-core/radeon_drv.c index 50a2f6b5..8ab3e995 100644 --- a/bsd-core/radeon_drv.c +++ b/bsd-core/radeon_drv.c @@ -76,7 +76,6 @@ static void radeon_configure(struct drm_device *dev) dev->driver->patchlevel = DRIVER_PATCHLEVEL; } -#ifdef __FreeBSD__ static int radeon_probe(device_t dev) { @@ -131,12 +130,3 @@ DRIVER_MODULE(radeon, vgapci, radeon_driver, drm_devclass, 0, 0); DRIVER_MODULE(radeon, pci, radeon_driver, drm_devclass, 0, 0); #endif MODULE_DEPEND(radeon, drm, 1, 1, 1); - -#elif defined(__NetBSD__) || defined(__OpenBSD__) -#ifdef _LKM -CFDRIVER_DECL(radeon, DV_TTY, NULL); -#else -CFATTACH_DECL(radeon, sizeof(struct drm_device), drm_probe, drm_attach, - drm_detach, drm_activate); -#endif -#endif /* __FreeBSD__ */ diff --git a/bsd-core/savage_drv.c b/bsd-core/savage_drv.c index 36dd34a7..35fcdfa3 100644 --- a/bsd-core/savage_drv.c +++ b/bsd-core/savage_drv.c @@ -62,7 +62,6 @@ static void savage_configure(struct drm_device *dev) dev->driver->patchlevel = DRIVER_PATCHLEVEL; } -#ifdef __FreeBSD__ static int savage_probe(device_t dev) { @@ -117,7 +116,3 @@ DRIVER_MODULE(savage, vgapci, savage_driver, drm_devclass, 0, 0); DRIVER_MODULE(savage, pci, savage_driver, drm_devclass, 0, 0); #endif MODULE_DEPEND(savage, drm, 1, 1, 1); - -#elif defined(__NetBSD__) || defined(__OpenBSD__) -CFDRIVER_DECL(savage, DV_TTY, NULL); -#endif diff --git a/bsd-core/sis_drv.c b/bsd-core/sis_drv.c index bcf4ffd6..2ae1bff0 100644 --- a/bsd-core/sis_drv.c +++ b/bsd-core/sis_drv.c @@ -56,7 +56,6 @@ static void sis_configure(struct drm_device *dev) dev->driver->patchlevel = DRIVER_PATCHLEVEL; } -#ifdef __FreeBSD__ static int sis_probe(device_t dev) { @@ -111,12 +110,3 @@ DRIVER_MODULE(sisdrm, vgapci, sis_driver, drm_devclass, 0, 0); DRIVER_MODULE(sisdrm, pci, sis_driver, drm_devclass, 0, 0); #endif MODULE_DEPEND(sisdrm, drm, 1, 1, 1); - -#elif defined(__NetBSD__) || defined(__OpenBSD__) -#ifdef _LKM -CFDRIVER_DECL(sis, DV_TTY, NULL); -#else -CFATTACH_DECL(sis, sizeof(struct drm_device), drm_probe, drm_attach, drm_detach, - drm_activate); -#endif -#endif diff --git a/bsd-core/tdfx_drv.c b/bsd-core/tdfx_drv.c index 8d9e272f..44948b5c 100644 --- a/bsd-core/tdfx_drv.c +++ b/bsd-core/tdfx_drv.c @@ -58,7 +58,6 @@ static void tdfx_configure(struct drm_device *dev) dev->driver->patchlevel = DRIVER_PATCHLEVEL; } -#ifdef __FreeBSD__ static int tdfx_probe(device_t dev) { @@ -113,12 +112,3 @@ DRIVER_MODULE(tdfx, vgapci, tdfx_driver, drm_devclass, 0, 0); DRIVER_MODULE(tdfx, pci, tdfx_driver, drm_devclass, 0, 0); #endif MODULE_DEPEND(tdfx, drm, 1, 1, 1); - -#elif defined(__NetBSD__) || defined(__OpenBSD__) -#ifdef _LKM -CFDRIVER_DECL(tdfx, DV_TTY, NULL); -#else -CFATTACH_DECL(tdfx, sizeof(struct drm_device), drm_probe, drm_attach, - drm_detach, drm_activate); -#endif -#endif diff --git a/bsd-core/via_drv.c b/bsd-core/via_drv.c index 402b374b..e5f7d493 100644 --- a/bsd-core/via_drv.c +++ b/bsd-core/via_drv.c @@ -69,7 +69,6 @@ static void via_configure(struct drm_device *dev) dev->driver->patchlevel = DRIVER_PATCHLEVEL; } -#ifdef __FreeBSD__ static int via_probe(device_t dev) { @@ -120,12 +119,3 @@ static driver_t via_driver = { extern devclass_t drm_devclass; DRIVER_MODULE(via, pci, via_driver, drm_devclass, 0, 0); MODULE_DEPEND(via, drm, 1, 1, 1); - -#elif defined(__NetBSD__) || defined(__OpenBSD__) -#ifdef _LKM -CFDRIVER_DECL(via, DV_TTY, NULL); -#else -CFATTACH_DECL(via, sizeof(struct drm_device), drm_probe, drm_attach, drm_detach, - drm_activate); -#endif -#endif -- cgit v1.2.3 From f152482bdecaa16db36b20b445a480445d18048c Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 17 Sep 2008 14:49:04 +1000 Subject: nv50: add support for chipset 0x92 --- shared-core/nouveau_object.c | 2 +- shared-core/nv50_graph.c | 2547 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 2547 insertions(+), 2 deletions(-) diff --git a/shared-core/nouveau_object.c b/shared-core/nouveau_object.c index 07b5a397..5a44d41e 100644 --- a/shared-core/nouveau_object.c +++ b/shared-core/nouveau_object.c @@ -942,7 +942,7 @@ nouveau_gpuobj_channel_init_pramin(struct nouveau_channel *chan) /* RAMFC */ size += 0x1000; /* PGRAPH context */ - size += 0x60000; + size += 0x70000; } DRM_DEBUG("ch%d PRAMIN size: 0x%08x bytes, base alloc=0x%08x\n", diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index 1300c83a..1a88f28d 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -187,6 +187,77 @@ static uint32_t nv86_ctx_voodoo[] = { 0x0060000c, ~0 }; +static uint32_t nv92_ctx_voodoo[] = { + 0x0070008E, 0x0070009C, 0x00200020, 0x00600008, 0x0050004C, 0x00400E89, + 0x00200000, 0x00600007, 0x00300000, 0x00C000FF, 0x00200000, 0x008000FF, + 0x00700009, 0x0041924D, 0x00402944, 0x00402905, 0x0040290D, 0x00416E06, + 0x00600005, 0x004015C5, 0x00600011, 0x0040270B, 0x004021C5, 0x00700000, + 0x00700081, 0x00600004, 0x0050004A, 0x00219600, 0x00600007, 0x00C02701, + 0x0020002E, 0x00800001, 0x005000CB, 0x0090FFFF, 0x0091FFFF, 0x00200020, + 0x00600008, 0x0050004C, 0x00600009, 0x00416E45, 0x0041894D, 0x0070009D, + 0x00402DCF, 0x0070009F, 0x0050009F, 0x00402AC0, 0x00200080, 0x00600008, + 0x00402A4F, 0x00402AC0, 0x004030CC, 0x00700081, 0x00200000, 0x00600006, + 0x00700000, 0x00111BFC, 0x00700083, 0x00300000, 0x00219600, 0x00600007, + 0x00C00A01, 0x0020001E, 0x00800001, 0x005000CB, 0x00C000FF, 0x00700080, + 0x00700083, 0x00200047, 0x00600006, 0x0011020A, 0x00200540, 0x00600007, + 0x00300000, 0x00C000FF, 0x00C800FF, 0x00417907, 0x00202DD2, 0x008000FF, + 0x0040508C, 0x005000CB, 0x00A0023F, 0x00200040, 0x00600006, 0x0070000F, + 0x00170202, 0x0011020A, 0x00200032, 0x0010020D, 0x001C0242, 0x00120302, + 0x00140402, 0x00180500, 0x00130509, 0x00150550, 0x00110605, 0x0020000F, + 0x00100607, 0x00110700, 0x00110900, 0x00120902, 0x00110A00, 0x00160B02, + 0x00120B28, 0x00140B2B, 0x00110C01, 0x00111400, 0x00111405, 0x00111407, + 0x00111409, 0x0011140B, 0x002000CB, 0x00101500, 0x0040790F, 0x0040794B, + 0x00217400, 0x00600007, 0x0020043E, 0x008800FF, 0x0070008F, 0x0040798C, + 0x005000CB, 0x00000000, 0x00141A05, 0x00131A0C, 0x00131C00, 0x00121C04, + 0x00141C20, 0x00111C25, 0x00131C40, 0x00121C44, 0x00141C60, 0x00111C65, + 0x00131C80, 0x00121C84, 0x00141CA0, 0x00111CA5, 0x00131CC0, 0x00121CC4, + 0x00141CE0, 0x00111CE5, 0x00131F00, 0x00191F40, 0x0040A1E0, 0x002001C9, + 0x00600006, 0x00200044, 0x00102080, 0x001120C6, 0x001520C9, 0x001920D0, + 0x00122100, 0x00122103, 0x00162200, 0x00122207, 0x00112280, 0x00112300, + 0x00112302, 0x00122380, 0x0011238B, 0x00112394, 0x0011239C, 0x0040BEE1, + 0x00200230, 0x00600006, 0x00200044, 0x00102480, 0x0040AF0F, 0x0040AF4B, + 0x00217400, 0x00600007, 0x0020043E, 0x008800FF, 0x0070008F, 0x0040AF8C, + 0x005000CB, 0x00000000, 0x001124C6, 0x001524C9, 0x001924D0, 0x00122500, + 0x00122503, 0x00162600, 0x00122607, 0x00112680, 0x00112700, 0x00112702, + 0x00122780, 0x0011278B, 0x00112794, 0x0011279C, 0x0040D1E2, 0x00200297, + 0x00600006, 0x00200044, 0x00102880, 0x001128C6, 0x001528C9, 0x001928D0, + 0x00122900, 0x00122903, 0x00162A00, 0x00122A07, 0x00112A80, 0x00112B00, + 0x00112B02, 0x00122B80, 0x00112B8B, 0x00112B94, 0x00112B9C, 0x0040EEE3, + 0x002002FE, 0x00600006, 0x00200044, 0x00102C80, 0x0040DF0F, 0x0040DF4B, + 0x00217400, 0x00600007, 0x0020043E, 0x008800FF, 0x0070008F, 0x0040DF8C, + 0x005000CB, 0x00000000, 0x00112CC6, 0x00152CC9, 0x00192CD0, 0x00122D00, + 0x00122D03, 0x00162E00, 0x00122E07, 0x00112E80, 0x00112F00, 0x00112F02, + 0x00122F80, 0x00112F8B, 0x00112F94, 0x00112F9C, 0x004101E4, 0x00200365, + 0x00600006, 0x00200044, 0x00103080, 0x001130C6, 0x001530C9, 0x001930D0, + 0x00123100, 0x00123103, 0x00163200, 0x00123207, 0x00113280, 0x00113300, + 0x00113302, 0x00123380, 0x0011338B, 0x00113394, 0x0011339C, 0x00411EE5, + 0x002003CC, 0x00600006, 0x00200044, 0x00103480, 0x00410F0F, 0x00410F4B, + 0x00217400, 0x00600007, 0x0020043E, 0x008800FF, 0x0070008F, 0x00410F8C, + 0x005000CB, 0x00000000, 0x001134C6, 0x001534C9, 0x001934D0, 0x00123500, + 0x00123503, 0x00163600, 0x00123607, 0x00113680, 0x00113700, 0x00113702, + 0x00123780, 0x0011378B, 0x00113794, 0x0011379C, 0x004131E6, 0x00200433, + 0x00600006, 0x00200044, 0x00103880, 0x001138C6, 0x001538C9, 0x001938D0, + 0x00123900, 0x00123903, 0x00163A00, 0x00123A07, 0x00113A80, 0x00113B00, + 0x00113B02, 0x00123B80, 0x00113B8B, 0x00113B94, 0x00113B9C, 0x00414EE7, + 0x0020049A, 0x00600006, 0x00200044, 0x00103C80, 0x00413F0F, 0x00413F4B, + 0x00217400, 0x00600007, 0x0020043E, 0x008800FF, 0x0070008F, 0x00413F8C, + 0x005000CB, 0x00000000, 0x00113CC6, 0x00153CC9, 0x00193CD0, 0x00123D00, + 0x00123D03, 0x00163E00, 0x00123E07, 0x00113E80, 0x00113F00, 0x00113F02, + 0x00123F80, 0x00113F8B, 0x00113F94, 0x00113F9C, 0x00000000, 0x0041550F, + 0x005000CB, 0x00217400, 0x00600007, 0x0020043E, 0x008800FF, 0x005000CB, + 0x00415887, 0x0060000A, 0x00000000, 0x00416700, 0x007000A0, 0x00700080, + 0x00200540, 0x00600007, 0x00200004, 0x00C000FF, 0x008000FF, 0x005000CB, + 0x00700000, 0x00200000, 0x00600006, 0x00111BFE, 0x0041894D, 0x00700000, + 0x00200000, 0x00600006, 0x00111BFE, 0x00700080, 0x0070001D, 0x0040114D, + 0x00700081, 0x00600004, 0x0050004A, 0x00417388, 0x0060000B, 0x00200000, + 0x00600006, 0x00700000, 0x0041890B, 0x00111BFD, 0x0040424D, 0x00202DD2, + 0x008000FD, 0x005000CB, 0x00C00002, 0x00200540, 0x00600007, 0x00200160, + 0x00800002, 0x005000CB, 0x00C01802, 0x00202C72, 0x00800002, 0x005000CB, + 0x00404E4D, 0x0060000B, 0x0041874D, 0x00700001, 0x00700003, 0x00418D06, + 0x00418E05, 0x0060000D, 0x00700005, 0x0070000D, 0x00700006, 0x0070000B, + 0x0070000E, 0x0070001C, 0x0060000C, ~0 +}; + static int nv50_graph_init_ctxctl(struct drm_device *dev) { @@ -202,6 +273,9 @@ nv50_graph_init_ctxctl(struct drm_device *dev) case 0x86: voodoo = nv86_ctx_voodoo; break; + case 0x92: + voodoo = nv92_ctx_voodoo; + break; default: DRM_ERROR("no voodoo for chipset NV%02x\n", dev_priv->chipset); return -EINVAL; @@ -2059,6 +2133,2474 @@ nv84_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) INSTANCE_WR(ctx, 0x5b700/4, 0x00000001); } +static void +nv92_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_gpuobj *ctx = ref->gpuobj; + + INSTANCE_WR(ctx, 0x10C/4, 0x30); + INSTANCE_WR(ctx, 0x1D4/4, 0x3); + INSTANCE_WR(ctx, 0x1D8/4, 0x1000); + INSTANCE_WR(ctx, 0x218/4, 0xFE0C); + INSTANCE_WR(ctx, 0x22C/4, 0x1000); + INSTANCE_WR(ctx, 0x258/4, 0x187); + INSTANCE_WR(ctx, 0x26C/4, 0x1018); + INSTANCE_WR(ctx, 0x270/4, 0xFF); + INSTANCE_WR(ctx, 0x2AC/4, 0x4); + INSTANCE_WR(ctx, 0x2B0/4, 0x42500DF); + INSTANCE_WR(ctx, 0x2B8/4, 0x600); + INSTANCE_WR(ctx, 0x2D0/4, 0x1000000); + INSTANCE_WR(ctx, 0x2D4/4, 0xFF); + INSTANCE_WR(ctx, 0x2DC/4, 0x400); + INSTANCE_WR(ctx, 0x2F4/4, 0x1); + INSTANCE_WR(ctx, 0x2F8/4, 0x80); + INSTANCE_WR(ctx, 0x2FC/4, 0x4); + INSTANCE_WR(ctx, 0x318/4, 0x2); + INSTANCE_WR(ctx, 0x31C/4, 0x1); + INSTANCE_WR(ctx, 0x328/4, 0x1); + INSTANCE_WR(ctx, 0x32C/4, 0x100); + INSTANCE_WR(ctx, 0x344/4, 0x2); + INSTANCE_WR(ctx, 0x348/4, 0x1); + INSTANCE_WR(ctx, 0x34C/4, 0x1); + INSTANCE_WR(ctx, 0x35C/4, 0x1); + INSTANCE_WR(ctx, 0x360/4, 0x3FFFFF); + INSTANCE_WR(ctx, 0x364/4, 0x1FFF); + INSTANCE_WR(ctx, 0x36C/4, 0x1); + INSTANCE_WR(ctx, 0x370/4, 0x1); + INSTANCE_WR(ctx, 0x378/4, 0x1); + INSTANCE_WR(ctx, 0x37C/4, 0x1); + INSTANCE_WR(ctx, 0x380/4, 0x1); + INSTANCE_WR(ctx, 0x384/4, 0x4); + INSTANCE_WR(ctx, 0x388/4, 0x1); + INSTANCE_WR(ctx, 0x38C/4, 0x1); + INSTANCE_WR(ctx, 0x390/4, 0x1); + INSTANCE_WR(ctx, 0x394/4, 0x7); + INSTANCE_WR(ctx, 0x398/4, 0x1); + INSTANCE_WR(ctx, 0x39C/4, 0x7); + INSTANCE_WR(ctx, 0x3A0/4, 0x1); + INSTANCE_WR(ctx, 0x3A4/4, 0x1); + INSTANCE_WR(ctx, 0x3A8/4, 0x1); + INSTANCE_WR(ctx, 0x3BC/4, 0x1); + INSTANCE_WR(ctx, 0x3C0/4, 0x100); + INSTANCE_WR(ctx, 0x3C8/4, 0x1); + INSTANCE_WR(ctx, 0x3D4/4, 0x100); + INSTANCE_WR(ctx, 0x3D8/4, 0x1); + INSTANCE_WR(ctx, 0x3DC/4, 0x100); + INSTANCE_WR(ctx, 0x3E4/4, 0x1); + INSTANCE_WR(ctx, 0x3F0/4, 0x100); + INSTANCE_WR(ctx, 0x404/4, 0x4); + INSTANCE_WR(ctx, 0x408/4, 0x70); + INSTANCE_WR(ctx, 0x40C/4, 0x80); + INSTANCE_WR(ctx, 0x420/4, 0xC); + INSTANCE_WR(ctx, 0x428/4, 0x8); + INSTANCE_WR(ctx, 0x42C/4, 0x14); + INSTANCE_WR(ctx, 0x434/4, 0x29); + INSTANCE_WR(ctx, 0x438/4, 0x27); + INSTANCE_WR(ctx, 0x43C/4, 0x26); + INSTANCE_WR(ctx, 0x440/4, 0x8); + INSTANCE_WR(ctx, 0x444/4, 0x4); + INSTANCE_WR(ctx, 0x448/4, 0x27); + INSTANCE_WR(ctx, 0x454/4, 0x1); + INSTANCE_WR(ctx, 0x458/4, 0x2); + INSTANCE_WR(ctx, 0x45C/4, 0x3); + INSTANCE_WR(ctx, 0x460/4, 0x4); + INSTANCE_WR(ctx, 0x464/4, 0x5); + INSTANCE_WR(ctx, 0x468/4, 0x6); + INSTANCE_WR(ctx, 0x46C/4, 0x7); + INSTANCE_WR(ctx, 0x470/4, 0x1); + INSTANCE_WR(ctx, 0x4B4/4, 0xCF); + INSTANCE_WR(ctx, 0x4E4/4, 0x80); + INSTANCE_WR(ctx, 0x4E8/4, 0x4); + INSTANCE_WR(ctx, 0x4EC/4, 0x4); + INSTANCE_WR(ctx, 0x4F0/4, 0x3); + INSTANCE_WR(ctx, 0x4F4/4, 0x1); + INSTANCE_WR(ctx, 0x500/4, 0x12); + INSTANCE_WR(ctx, 0x504/4, 0x10); + INSTANCE_WR(ctx, 0x508/4, 0xC); + INSTANCE_WR(ctx, 0x50C/4, 0x1); + INSTANCE_WR(ctx, 0x51C/4, 0x4); + INSTANCE_WR(ctx, 0x520/4, 0x2); + INSTANCE_WR(ctx, 0x524/4, 0x4); + INSTANCE_WR(ctx, 0x530/4, 0x3FFFFF); + INSTANCE_WR(ctx, 0x534/4, 0x1FFF); + INSTANCE_WR(ctx, 0x55C/4, 0x4); + INSTANCE_WR(ctx, 0x560/4, 0x14); + INSTANCE_WR(ctx, 0x564/4, 0x1); + INSTANCE_WR(ctx, 0x570/4, 0x2); + INSTANCE_WR(ctx, 0x57C/4, 0x1); + INSTANCE_WR(ctx, 0x584/4, 0x2); + INSTANCE_WR(ctx, 0x588/4, 0x1000); + INSTANCE_WR(ctx, 0x58C/4, 0xE00); + INSTANCE_WR(ctx, 0x590/4, 0x1000); + INSTANCE_WR(ctx, 0x594/4, 0x1E00); + INSTANCE_WR(ctx, 0x59C/4, 0x1); + INSTANCE_WR(ctx, 0x5A0/4, 0x1); + INSTANCE_WR(ctx, 0x5A4/4, 0x1); + INSTANCE_WR(ctx, 0x5A8/4, 0x1); + INSTANCE_WR(ctx, 0x5AC/4, 0x1); + INSTANCE_WR(ctx, 0x5BC/4, 0x200); + INSTANCE_WR(ctx, 0x5C4/4, 0x1); + INSTANCE_WR(ctx, 0x5C8/4, 0x70); + INSTANCE_WR(ctx, 0x5CC/4, 0x80); + INSTANCE_WR(ctx, 0x5D8/4, 0x1); + INSTANCE_WR(ctx, 0x5DC/4, 0x70); + INSTANCE_WR(ctx, 0x5E0/4, 0x80); + INSTANCE_WR(ctx, 0x5F0/4, 0x1); + INSTANCE_WR(ctx, 0x5F4/4, 0xCF); + INSTANCE_WR(ctx, 0x5FC/4, 0x1); + INSTANCE_WR(ctx, 0x60C/4, 0xCF); + INSTANCE_WR(ctx, 0x614/4, 0x2); + INSTANCE_WR(ctx, 0x61C/4, 0x1); + INSTANCE_WR(ctx, 0x624/4, 0x1); + INSTANCE_WR(ctx, 0x62C/4, 0xCF); + INSTANCE_WR(ctx, 0x630/4, 0xCF); + INSTANCE_WR(ctx, 0x634/4, 0x1); + INSTANCE_WR(ctx, 0x63C/4, 0x1F80); + INSTANCE_WR(ctx, 0x654/4, 0x3B74F821); + INSTANCE_WR(ctx, 0x658/4, 0x89058001); + INSTANCE_WR(ctx, 0x660/4, 0x1000); + INSTANCE_WR(ctx, 0x664/4, 0x1F); + INSTANCE_WR(ctx, 0x668/4, 0x27C10FA); + INSTANCE_WR(ctx, 0x66C/4, 0x400000C0); + INSTANCE_WR(ctx, 0x670/4, 0xB7892080); + INSTANCE_WR(ctx, 0x67C/4, 0x3B74F821); + INSTANCE_WR(ctx, 0x680/4, 0x89058001); + INSTANCE_WR(ctx, 0x688/4, 0x1000); + INSTANCE_WR(ctx, 0x68C/4, 0x1F); + INSTANCE_WR(ctx, 0x690/4, 0x27C10FA); + INSTANCE_WR(ctx, 0x694/4, 0x400000C0); + INSTANCE_WR(ctx, 0x698/4, 0xB7892080); + INSTANCE_WR(ctx, 0x6A4/4, 0x3B74F821); + INSTANCE_WR(ctx, 0x6A8/4, 0x89058001); + INSTANCE_WR(ctx, 0x6B0/4, 0x1000); + INSTANCE_WR(ctx, 0x6B4/4, 0x1F); + INSTANCE_WR(ctx, 0x6B8/4, 0x27C10FA); + INSTANCE_WR(ctx, 0x6BC/4, 0x400000C0); + INSTANCE_WR(ctx, 0x6C0/4, 0xB7892080); + INSTANCE_WR(ctx, 0x6CC/4, 0x3B74F821); + INSTANCE_WR(ctx, 0x6D0/4, 0x89058001); + INSTANCE_WR(ctx, 0x6D8/4, 0x1000); + INSTANCE_WR(ctx, 0x6DC/4, 0x1F); + INSTANCE_WR(ctx, 0x6E0/4, 0x27C10FA); + INSTANCE_WR(ctx, 0x6E4/4, 0x400000C0); + INSTANCE_WR(ctx, 0x6E8/4, 0xB7892080); + INSTANCE_WR(ctx, 0x6F4/4, 0x390040); + INSTANCE_WR(ctx, 0x6FC/4, 0x22); + INSTANCE_WR(ctx, 0x708/4, 0x390040); + INSTANCE_WR(ctx, 0x70C/4, 0x22); + INSTANCE_WR(ctx, 0x724/4, 0x1800000); + INSTANCE_WR(ctx, 0x728/4, 0x160000); + INSTANCE_WR(ctx, 0x72C/4, 0x1800000); + INSTANCE_WR(ctx, 0x73C/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x740/4, 0x118C0000); + INSTANCE_WR(ctx, 0x764/4, 0x10401); + INSTANCE_WR(ctx, 0x76C/4, 0x78); + INSTANCE_WR(ctx, 0x774/4, 0xBF); + INSTANCE_WR(ctx, 0x77C/4, 0x1210); + INSTANCE_WR(ctx, 0x780/4, 0x8000080); + INSTANCE_WR(ctx, 0x7A4/4, 0x1800000); + INSTANCE_WR(ctx, 0x7A8/4, 0x160000); + INSTANCE_WR(ctx, 0x7AC/4, 0x1800000); + INSTANCE_WR(ctx, 0x7BC/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x7C0/4, 0x118C0000); + INSTANCE_WR(ctx, 0x7E4/4, 0x10401); + INSTANCE_WR(ctx, 0x7EC/4, 0x78); + INSTANCE_WR(ctx, 0x7F4/4, 0xBF); + INSTANCE_WR(ctx, 0x7FC/4, 0x1210); + INSTANCE_WR(ctx, 0x800/4, 0x8000080); + INSTANCE_WR(ctx, 0x828/4, 0x27070); + INSTANCE_WR(ctx, 0x834/4, 0x3FFFFFF); + INSTANCE_WR(ctx, 0x84C/4, 0x120407); + INSTANCE_WR(ctx, 0x850/4, 0x5091507); + INSTANCE_WR(ctx, 0x854/4, 0x5010202); + INSTANCE_WR(ctx, 0x858/4, 0x30201); + INSTANCE_WR(ctx, 0x874/4, 0x40); + INSTANCE_WR(ctx, 0x878/4, 0xD0C0B0A); + INSTANCE_WR(ctx, 0x87C/4, 0x141210); + INSTANCE_WR(ctx, 0x880/4, 0x1F0); + INSTANCE_WR(ctx, 0x884/4, 0x1); + INSTANCE_WR(ctx, 0x888/4, 0x3); + INSTANCE_WR(ctx, 0x894/4, 0x39E00); + INSTANCE_WR(ctx, 0x898/4, 0x100); + INSTANCE_WR(ctx, 0x89C/4, 0x3800); + INSTANCE_WR(ctx, 0x8A0/4, 0x404040); + INSTANCE_WR(ctx, 0x8A4/4, 0xFF0A); + INSTANCE_WR(ctx, 0x8AC/4, 0x77F005); + INSTANCE_WR(ctx, 0x8B0/4, 0x3F7FFF); + INSTANCE_WR(ctx, 0x8C0/4, 0x1800000); + INSTANCE_WR(ctx, 0x8C4/4, 0x160000); + INSTANCE_WR(ctx, 0x8C8/4, 0x1800000); + INSTANCE_WR(ctx, 0x8D8/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x8DC/4, 0x118C0000); + INSTANCE_WR(ctx, 0x900/4, 0x10401); + INSTANCE_WR(ctx, 0x908/4, 0x78); + INSTANCE_WR(ctx, 0x910/4, 0xBF); + INSTANCE_WR(ctx, 0x918/4, 0x1210); + INSTANCE_WR(ctx, 0x91C/4, 0x8000080); + INSTANCE_WR(ctx, 0x940/4, 0x1800000); + INSTANCE_WR(ctx, 0x944/4, 0x160000); + INSTANCE_WR(ctx, 0x948/4, 0x1800000); + INSTANCE_WR(ctx, 0x958/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x95C/4, 0x118C0000); + INSTANCE_WR(ctx, 0x980/4, 0x10401); + INSTANCE_WR(ctx, 0x988/4, 0x78); + INSTANCE_WR(ctx, 0x990/4, 0xBF); + INSTANCE_WR(ctx, 0x998/4, 0x1210); + INSTANCE_WR(ctx, 0x99C/4, 0x8000080); + INSTANCE_WR(ctx, 0x9C4/4, 0x27070); + INSTANCE_WR(ctx, 0x9D0/4, 0x3FFFFFF); + INSTANCE_WR(ctx, 0x9E8/4, 0x120407); + INSTANCE_WR(ctx, 0x9EC/4, 0x5091507); + INSTANCE_WR(ctx, 0x9F0/4, 0x5010202); + INSTANCE_WR(ctx, 0x9F4/4, 0x30201); + INSTANCE_WR(ctx, 0xA10/4, 0x40); + INSTANCE_WR(ctx, 0xA14/4, 0xD0C0B0A); + INSTANCE_WR(ctx, 0xA18/4, 0x141210); + INSTANCE_WR(ctx, 0xA1C/4, 0x1F0); + INSTANCE_WR(ctx, 0xA20/4, 0x1); + INSTANCE_WR(ctx, 0xA24/4, 0x3); + INSTANCE_WR(ctx, 0xA30/4, 0x39E00); + INSTANCE_WR(ctx, 0xA34/4, 0x100); + INSTANCE_WR(ctx, 0xA38/4, 0x3800); + INSTANCE_WR(ctx, 0xA3C/4, 0x404040); + INSTANCE_WR(ctx, 0xA40/4, 0xFF0A); + INSTANCE_WR(ctx, 0xA48/4, 0x77F005); + INSTANCE_WR(ctx, 0xA4C/4, 0x3F7FFF); + INSTANCE_WR(ctx, 0xA5C/4, 0x1800000); + INSTANCE_WR(ctx, 0xA60/4, 0x160000); + INSTANCE_WR(ctx, 0xA64/4, 0x1800000); + INSTANCE_WR(ctx, 0xA74/4, 0x3FFFF); + INSTANCE_WR(ctx, 0xA78/4, 0x118C0000); + INSTANCE_WR(ctx, 0xA9C/4, 0x10401); + INSTANCE_WR(ctx, 0xAA4/4, 0x78); + INSTANCE_WR(ctx, 0xAAC/4, 0xBF); + INSTANCE_WR(ctx, 0xAB4/4, 0x1210); + INSTANCE_WR(ctx, 0xAB8/4, 0x8000080); + INSTANCE_WR(ctx, 0xADC/4, 0x1800000); + INSTANCE_WR(ctx, 0xAE0/4, 0x160000); + INSTANCE_WR(ctx, 0xAE4/4, 0x1800000); + INSTANCE_WR(ctx, 0xAF4/4, 0x3FFFF); + INSTANCE_WR(ctx, 0xAF8/4, 0x118C0000); + INSTANCE_WR(ctx, 0xB1C/4, 0x10401); + INSTANCE_WR(ctx, 0xB24/4, 0x78); + INSTANCE_WR(ctx, 0xB2C/4, 0xBF); + INSTANCE_WR(ctx, 0xB34/4, 0x1210); + INSTANCE_WR(ctx, 0xB38/4, 0x8000080); + INSTANCE_WR(ctx, 0xB60/4, 0x27070); + INSTANCE_WR(ctx, 0xB6C/4, 0x3FFFFFF); + INSTANCE_WR(ctx, 0xB84/4, 0x120407); + INSTANCE_WR(ctx, 0xB88/4, 0x5091507); + INSTANCE_WR(ctx, 0xB8C/4, 0x5010202); + INSTANCE_WR(ctx, 0xB90/4, 0x30201); + INSTANCE_WR(ctx, 0xBAC/4, 0x40); + INSTANCE_WR(ctx, 0xBB0/4, 0xD0C0B0A); + INSTANCE_WR(ctx, 0xBB4/4, 0x141210); + INSTANCE_WR(ctx, 0xBB8/4, 0x1F0); + INSTANCE_WR(ctx, 0xBBC/4, 0x1); + INSTANCE_WR(ctx, 0xBC0/4, 0x3); + INSTANCE_WR(ctx, 0xBCC/4, 0x39E00); + INSTANCE_WR(ctx, 0xBD0/4, 0x100); + INSTANCE_WR(ctx, 0xBD4/4, 0x3800); + INSTANCE_WR(ctx, 0xBD8/4, 0x404040); + INSTANCE_WR(ctx, 0xBDC/4, 0xFF0A); + INSTANCE_WR(ctx, 0xBE4/4, 0x77F005); + INSTANCE_WR(ctx, 0xBE8/4, 0x3F7FFF); + INSTANCE_WR(ctx, 0xBF8/4, 0x1800000); + INSTANCE_WR(ctx, 0xBFC/4, 0x160000); + INSTANCE_WR(ctx, 0xC00/4, 0x1800000); + INSTANCE_WR(ctx, 0xC10/4, 0x3FFFF); + INSTANCE_WR(ctx, 0xC14/4, 0x118C0000); + INSTANCE_WR(ctx, 0xC38/4, 0x10401); + INSTANCE_WR(ctx, 0xC40/4, 0x78); + INSTANCE_WR(ctx, 0xC48/4, 0xBF); + INSTANCE_WR(ctx, 0xC50/4, 0x1210); + INSTANCE_WR(ctx, 0xC54/4, 0x8000080); + INSTANCE_WR(ctx, 0xC78/4, 0x1800000); + INSTANCE_WR(ctx, 0xC7C/4, 0x160000); + INSTANCE_WR(ctx, 0xC80/4, 0x1800000); + INSTANCE_WR(ctx, 0xC90/4, 0x3FFFF); + INSTANCE_WR(ctx, 0xC94/4, 0x118C0000); + INSTANCE_WR(ctx, 0xCB8/4, 0x10401); + INSTANCE_WR(ctx, 0xCC0/4, 0x78); + INSTANCE_WR(ctx, 0xCC8/4, 0xBF); + INSTANCE_WR(ctx, 0xCD0/4, 0x1210); + INSTANCE_WR(ctx, 0xCD4/4, 0x8000080); + INSTANCE_WR(ctx, 0xCFC/4, 0x27070); + INSTANCE_WR(ctx, 0xD08/4, 0x3FFFFFF); + INSTANCE_WR(ctx, 0xD20/4, 0x120407); + INSTANCE_WR(ctx, 0xD24/4, 0x5091507); + INSTANCE_WR(ctx, 0xD28/4, 0x5010202); + INSTANCE_WR(ctx, 0xD2C/4, 0x30201); + INSTANCE_WR(ctx, 0xD48/4, 0x40); + INSTANCE_WR(ctx, 0xD4C/4, 0xD0C0B0A); + INSTANCE_WR(ctx, 0xD50/4, 0x141210); + INSTANCE_WR(ctx, 0xD54/4, 0x1F0); + INSTANCE_WR(ctx, 0xD58/4, 0x1); + INSTANCE_WR(ctx, 0xD5C/4, 0x3); + INSTANCE_WR(ctx, 0xD68/4, 0x39E00); + INSTANCE_WR(ctx, 0xD6C/4, 0x100); + INSTANCE_WR(ctx, 0xD70/4, 0x3800); + INSTANCE_WR(ctx, 0xD74/4, 0x404040); + INSTANCE_WR(ctx, 0xD78/4, 0xFF0A); + INSTANCE_WR(ctx, 0xD80/4, 0x77F005); + INSTANCE_WR(ctx, 0xD84/4, 0x3F7FFF); + INSTANCE_WR(ctx, 0xD94/4, 0x1800000); + INSTANCE_WR(ctx, 0xD98/4, 0x160000); + INSTANCE_WR(ctx, 0xD9C/4, 0x1800000); + INSTANCE_WR(ctx, 0xDAC/4, 0x3FFFF); + INSTANCE_WR(ctx, 0xDB0/4, 0x118C0000); + INSTANCE_WR(ctx, 0xDD4/4, 0x10401); + INSTANCE_WR(ctx, 0xDDC/4, 0x78); + INSTANCE_WR(ctx, 0xDE4/4, 0xBF); + INSTANCE_WR(ctx, 0xDEC/4, 0x1210); + INSTANCE_WR(ctx, 0xDF0/4, 0x8000080); + INSTANCE_WR(ctx, 0xE14/4, 0x1800000); + INSTANCE_WR(ctx, 0xE18/4, 0x160000); + INSTANCE_WR(ctx, 0xE1C/4, 0x1800000); + INSTANCE_WR(ctx, 0xE2C/4, 0x3FFFF); + INSTANCE_WR(ctx, 0xE30/4, 0x118C0000); + INSTANCE_WR(ctx, 0xE54/4, 0x10401); + INSTANCE_WR(ctx, 0xE5C/4, 0x78); + INSTANCE_WR(ctx, 0xE64/4, 0xBF); + INSTANCE_WR(ctx, 0xE6C/4, 0x1210); + INSTANCE_WR(ctx, 0xE70/4, 0x8000080); + INSTANCE_WR(ctx, 0xE98/4, 0x27070); + INSTANCE_WR(ctx, 0xEA4/4, 0x3FFFFFF); + INSTANCE_WR(ctx, 0xEBC/4, 0x120407); + INSTANCE_WR(ctx, 0xEC0/4, 0x5091507); + INSTANCE_WR(ctx, 0xEC4/4, 0x5010202); + INSTANCE_WR(ctx, 0xEC8/4, 0x30201); + INSTANCE_WR(ctx, 0xEE4/4, 0x40); + INSTANCE_WR(ctx, 0xEE8/4, 0xD0C0B0A); + INSTANCE_WR(ctx, 0xEEC/4, 0x141210); + INSTANCE_WR(ctx, 0xEF0/4, 0x1F0); + INSTANCE_WR(ctx, 0xEF4/4, 0x1); + INSTANCE_WR(ctx, 0xEF8/4, 0x3); + INSTANCE_WR(ctx, 0xF04/4, 0x39E00); + INSTANCE_WR(ctx, 0xF08/4, 0x100); + INSTANCE_WR(ctx, 0xF0C/4, 0x3800); + INSTANCE_WR(ctx, 0xF10/4, 0x404040); + INSTANCE_WR(ctx, 0xF14/4, 0xFF0A); + INSTANCE_WR(ctx, 0xF1C/4, 0x77F005); + INSTANCE_WR(ctx, 0xF20/4, 0x3F7FFF); + INSTANCE_WR(ctx, 0xF30/4, 0x1800000); + INSTANCE_WR(ctx, 0xF34/4, 0x160000); + INSTANCE_WR(ctx, 0xF38/4, 0x1800000); + INSTANCE_WR(ctx, 0xF48/4, 0x3FFFF); + INSTANCE_WR(ctx, 0xF4C/4, 0x118C0000); + INSTANCE_WR(ctx, 0xF70/4, 0x10401); + INSTANCE_WR(ctx, 0xF78/4, 0x78); + INSTANCE_WR(ctx, 0xF80/4, 0xBF); + INSTANCE_WR(ctx, 0xF88/4, 0x1210); + INSTANCE_WR(ctx, 0xF8C/4, 0x8000080); + INSTANCE_WR(ctx, 0xFB0/4, 0x1800000); + INSTANCE_WR(ctx, 0xFB4/4, 0x160000); + INSTANCE_WR(ctx, 0xFB8/4, 0x1800000); + INSTANCE_WR(ctx, 0xFC8/4, 0x3FFFF); + INSTANCE_WR(ctx, 0xFCC/4, 0x118C0000); + INSTANCE_WR(ctx, 0xFF0/4, 0x10401); + INSTANCE_WR(ctx, 0xFF8/4, 0x78); + INSTANCE_WR(ctx, 0x1000/4, 0xBF); + INSTANCE_WR(ctx, 0x1008/4, 0x1210); + INSTANCE_WR(ctx, 0x100C/4, 0x8000080); + INSTANCE_WR(ctx, 0x1034/4, 0x27070); + INSTANCE_WR(ctx, 0x1040/4, 0x3FFFFFF); + INSTANCE_WR(ctx, 0x1058/4, 0x120407); + INSTANCE_WR(ctx, 0x105C/4, 0x5091507); + INSTANCE_WR(ctx, 0x1060/4, 0x5010202); + INSTANCE_WR(ctx, 0x1064/4, 0x30201); + INSTANCE_WR(ctx, 0x1080/4, 0x40); + INSTANCE_WR(ctx, 0x1084/4, 0xD0C0B0A); + INSTANCE_WR(ctx, 0x1088/4, 0x141210); + INSTANCE_WR(ctx, 0x108C/4, 0x1F0); + INSTANCE_WR(ctx, 0x1090/4, 0x1); + INSTANCE_WR(ctx, 0x1094/4, 0x3); + INSTANCE_WR(ctx, 0x10A0/4, 0x39E00); + INSTANCE_WR(ctx, 0x10A4/4, 0x100); + INSTANCE_WR(ctx, 0x10A8/4, 0x3800); + INSTANCE_WR(ctx, 0x10AC/4, 0x404040); + INSTANCE_WR(ctx, 0x10B0/4, 0xFF0A); + INSTANCE_WR(ctx, 0x10B8/4, 0x77F005); + INSTANCE_WR(ctx, 0x10BC/4, 0x3F7FFF); + INSTANCE_WR(ctx, 0x10CC/4, 0x1800000); + INSTANCE_WR(ctx, 0x10D0/4, 0x160000); + INSTANCE_WR(ctx, 0x10D4/4, 0x1800000); + INSTANCE_WR(ctx, 0x10E4/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x10E8/4, 0x118C0000); + INSTANCE_WR(ctx, 0x110C/4, 0x10401); + INSTANCE_WR(ctx, 0x1114/4, 0x78); + INSTANCE_WR(ctx, 0x111C/4, 0xBF); + INSTANCE_WR(ctx, 0x1124/4, 0x1210); + INSTANCE_WR(ctx, 0x1128/4, 0x8000080); + INSTANCE_WR(ctx, 0x114C/4, 0x1800000); + INSTANCE_WR(ctx, 0x1150/4, 0x160000); + INSTANCE_WR(ctx, 0x1154/4, 0x1800000); + INSTANCE_WR(ctx, 0x1164/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x1168/4, 0x118C0000); + INSTANCE_WR(ctx, 0x118C/4, 0x10401); + INSTANCE_WR(ctx, 0x1194/4, 0x78); + INSTANCE_WR(ctx, 0x119C/4, 0xBF); + INSTANCE_WR(ctx, 0x11A4/4, 0x1210); + INSTANCE_WR(ctx, 0x11A8/4, 0x8000080); + INSTANCE_WR(ctx, 0x11D0/4, 0x27070); + INSTANCE_WR(ctx, 0x11DC/4, 0x3FFFFFF); + INSTANCE_WR(ctx, 0x11F4/4, 0x120407); + INSTANCE_WR(ctx, 0x11F8/4, 0x5091507); + INSTANCE_WR(ctx, 0x11FC/4, 0x5010202); + INSTANCE_WR(ctx, 0x1200/4, 0x30201); + INSTANCE_WR(ctx, 0x121C/4, 0x40); + INSTANCE_WR(ctx, 0x1220/4, 0xD0C0B0A); + INSTANCE_WR(ctx, 0x1224/4, 0x141210); + INSTANCE_WR(ctx, 0x1228/4, 0x1F0); + INSTANCE_WR(ctx, 0x122C/4, 0x1); + INSTANCE_WR(ctx, 0x1230/4, 0x3); + INSTANCE_WR(ctx, 0x123C/4, 0x39E00); + INSTANCE_WR(ctx, 0x1240/4, 0x100); + INSTANCE_WR(ctx, 0x1244/4, 0x3800); + INSTANCE_WR(ctx, 0x1248/4, 0x404040); + INSTANCE_WR(ctx, 0x124C/4, 0xFF0A); + INSTANCE_WR(ctx, 0x1254/4, 0x77F005); + INSTANCE_WR(ctx, 0x1258/4, 0x3F7FFF); + INSTANCE_WR(ctx, 0x1268/4, 0x1800000); + INSTANCE_WR(ctx, 0x126C/4, 0x160000); + INSTANCE_WR(ctx, 0x1270/4, 0x1800000); + INSTANCE_WR(ctx, 0x1280/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x1284/4, 0x118C0000); + INSTANCE_WR(ctx, 0x12A8/4, 0x10401); + INSTANCE_WR(ctx, 0x12B0/4, 0x78); + INSTANCE_WR(ctx, 0x12B8/4, 0xBF); + INSTANCE_WR(ctx, 0x12C0/4, 0x1210); + INSTANCE_WR(ctx, 0x12C4/4, 0x8000080); + INSTANCE_WR(ctx, 0x12E8/4, 0x1800000); + INSTANCE_WR(ctx, 0x12EC/4, 0x160000); + INSTANCE_WR(ctx, 0x12F0/4, 0x1800000); + INSTANCE_WR(ctx, 0x1300/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x1304/4, 0x118C0000); + INSTANCE_WR(ctx, 0x1328/4, 0x10401); + INSTANCE_WR(ctx, 0x1330/4, 0x78); + INSTANCE_WR(ctx, 0x1338/4, 0xBF); + INSTANCE_WR(ctx, 0x1340/4, 0x1210); + INSTANCE_WR(ctx, 0x1344/4, 0x8000080); + INSTANCE_WR(ctx, 0x136C/4, 0x27070); + INSTANCE_WR(ctx, 0x1378/4, 0x3FFFFFF); + INSTANCE_WR(ctx, 0x1390/4, 0x120407); + INSTANCE_WR(ctx, 0x1394/4, 0x5091507); + INSTANCE_WR(ctx, 0x1398/4, 0x5010202); + INSTANCE_WR(ctx, 0x139C/4, 0x30201); + INSTANCE_WR(ctx, 0x13B8/4, 0x40); + INSTANCE_WR(ctx, 0x13BC/4, 0xD0C0B0A); + INSTANCE_WR(ctx, 0x13C0/4, 0x141210); + INSTANCE_WR(ctx, 0x13C4/4, 0x1F0); + INSTANCE_WR(ctx, 0x13C8/4, 0x1); + INSTANCE_WR(ctx, 0x13CC/4, 0x3); + INSTANCE_WR(ctx, 0x13D8/4, 0x39E00); + INSTANCE_WR(ctx, 0x13DC/4, 0x100); + INSTANCE_WR(ctx, 0x13E0/4, 0x3800); + INSTANCE_WR(ctx, 0x13E4/4, 0x404040); + INSTANCE_WR(ctx, 0x13E8/4, 0xFF0A); + INSTANCE_WR(ctx, 0x13F0/4, 0x77F005); + INSTANCE_WR(ctx, 0x13F4/4, 0x3F7FFF); + INSTANCE_WR(ctx, 0x8620/4, 0x21); + INSTANCE_WR(ctx, 0x8640/4, 0x1); + INSTANCE_WR(ctx, 0x8660/4, 0x2); + INSTANCE_WR(ctx, 0x8680/4, 0x100); + INSTANCE_WR(ctx, 0x86A0/4, 0x100); + INSTANCE_WR(ctx, 0x86C0/4, 0x1); + INSTANCE_WR(ctx, 0x8720/4, 0x1); + INSTANCE_WR(ctx, 0x8740/4, 0x2); + INSTANCE_WR(ctx, 0x8760/4, 0x100); + INSTANCE_WR(ctx, 0x8780/4, 0x100); + INSTANCE_WR(ctx, 0x87A0/4, 0x1); + INSTANCE_WR(ctx, 0x1B8C0/4, 0x4); + INSTANCE_WR(ctx, 0x1B8E0/4, 0x4); + INSTANCE_WR(ctx, 0x54260/4, 0x4); + INSTANCE_WR(ctx, 0x54280/4, 0x4); + INSTANCE_WR(ctx, 0x542A0/4, 0x8100C12); + INSTANCE_WR(ctx, 0x542C0/4, 0x3); + INSTANCE_WR(ctx, 0x54300/4, 0x8100C12); + INSTANCE_WR(ctx, 0x54340/4, 0x80C14); + INSTANCE_WR(ctx, 0x54360/4, 0x1); + INSTANCE_WR(ctx, 0x54380/4, 0x80C14); + INSTANCE_WR(ctx, 0x543E0/4, 0x8100C12); + INSTANCE_WR(ctx, 0x54400/4, 0x27); + INSTANCE_WR(ctx, 0x54460/4, 0x1); + INSTANCE_WR(ctx, 0x5BCA0/4, 0x1); + INSTANCE_WR(ctx, 0x5BF80/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5C120/4, 0x4000000); + INSTANCE_WR(ctx, 0x5C140/4, 0x4000000); + INSTANCE_WR(ctx, 0x5C180/4, 0x80); + INSTANCE_WR(ctx, 0x5C200/4, 0x80); + INSTANCE_WR(ctx, 0x5C240/4, 0x3F); + INSTANCE_WR(ctx, 0x5C3A0/4, 0x2); + INSTANCE_WR(ctx, 0x5C3C0/4, 0x4000000); + INSTANCE_WR(ctx, 0x5C3E0/4, 0x4000000); + INSTANCE_WR(ctx, 0x5C500/4, 0x4); + INSTANCE_WR(ctx, 0x5C580/4, 0x4); + INSTANCE_WR(ctx, 0x5C7C0/4, 0x1); + INSTANCE_WR(ctx, 0x5C7E0/4, 0x1001); + INSTANCE_WR(ctx, 0x5C800/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5C820/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5C840/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5C860/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5CC80/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CCA0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CCC0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CCE0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CD00/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CD20/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CD40/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CD60/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CD80/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CDA0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CDC0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CDE0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CE00/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CE20/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CE40/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CE60/4, 0x3F800000); + INSTANCE_WR(ctx, 0x5CE80/4, 0x10); + INSTANCE_WR(ctx, 0x5CEE0/4, 0x3); + INSTANCE_WR(ctx, 0x1584/4, 0xF); + INSTANCE_WR(ctx, 0x1624/4, 0x20); + INSTANCE_WR(ctx, 0x1804/4, 0x1A); + INSTANCE_WR(ctx, 0x19C4/4, 0x4); + INSTANCE_WR(ctx, 0x19E4/4, 0x4); + INSTANCE_WR(ctx, 0x1A24/4, 0x4); + INSTANCE_WR(ctx, 0x1A44/4, 0x8); + INSTANCE_WR(ctx, 0x1A84/4, 0x7FF); + INSTANCE_WR(ctx, 0x1C24/4, 0xF); + INSTANCE_WR(ctx, 0x4104/4, 0xF); + INSTANCE_WR(ctx, 0x4144/4, 0x1); + INSTANCE_WR(ctx, 0x4CA4/4, 0xF); + INSTANCE_WR(ctx, 0x15344/4, 0xF); + INSTANCE_WR(ctx, 0x155E4/4, 0x1); + INSTANCE_WR(ctx, 0x15604/4, 0x100); + INSTANCE_WR(ctx, 0x15624/4, 0x100); + INSTANCE_WR(ctx, 0x15644/4, 0x11); + INSTANCE_WR(ctx, 0x15684/4, 0x8); + INSTANCE_WR(ctx, 0x15744/4, 0x1); + INSTANCE_WR(ctx, 0x15784/4, 0x1); + INSTANCE_WR(ctx, 0x157A4/4, 0x1); + INSTANCE_WR(ctx, 0x157C4/4, 0x1); + INSTANCE_WR(ctx, 0x157E4/4, 0xCF); + INSTANCE_WR(ctx, 0x15804/4, 0x2); + INSTANCE_WR(ctx, 0x158E4/4, 0x1); + INSTANCE_WR(ctx, 0x15924/4, 0x1); + INSTANCE_WR(ctx, 0x15944/4, 0x1); + INSTANCE_WR(ctx, 0x15964/4, 0x1); + INSTANCE_WR(ctx, 0x15A04/4, 0x4); + INSTANCE_WR(ctx, 0x15A44/4, 0x1); + INSTANCE_WR(ctx, 0x15A64/4, 0x15); + INSTANCE_WR(ctx, 0x15AE4/4, 0x4444480); + INSTANCE_WR(ctx, 0x16264/4, 0x8100C12); + INSTANCE_WR(ctx, 0x16304/4, 0x100); + INSTANCE_WR(ctx, 0x16364/4, 0x10001); + INSTANCE_WR(ctx, 0x163A4/4, 0x10001); + INSTANCE_WR(ctx, 0x163C4/4, 0x1); + INSTANCE_WR(ctx, 0x163E4/4, 0x10001); + INSTANCE_WR(ctx, 0x16404/4, 0x1); + INSTANCE_WR(ctx, 0x16424/4, 0x4); + INSTANCE_WR(ctx, 0x16444/4, 0x2); + INSTANCE_WR(ctx, 0x183C4/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x183E4/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x18484/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x18604/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x18624/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x16508/4, 0x3FFFFF); + INSTANCE_WR(ctx, 0x16568/4, 0x1FFF); + INSTANCE_WR(ctx, 0x16748/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16828/4, 0x4); + INSTANCE_WR(ctx, 0x16848/4, 0x1A); + INSTANCE_WR(ctx, 0x168A8/4, 0x1); + INSTANCE_WR(ctx, 0x16B08/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x16BE8/4, 0xF); + INSTANCE_WR(ctx, 0x16CE8/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x16D08/4, 0x11); + INSTANCE_WR(ctx, 0x16F08/4, 0x4); + INSTANCE_WR(ctx, 0x16FA8/4, 0x2); + INSTANCE_WR(ctx, 0x16FC8/4, 0x4000000); + INSTANCE_WR(ctx, 0x16FE8/4, 0x4000000); + INSTANCE_WR(ctx, 0x17068/4, 0x5); + INSTANCE_WR(ctx, 0x17088/4, 0x52); + INSTANCE_WR(ctx, 0x17128/4, 0x1); + INSTANCE_WR(ctx, 0x17348/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17368/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17388/4, 0x3F800000); + INSTANCE_WR(ctx, 0x173A8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x173C8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x173E8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17408/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17428/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17448/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17468/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17488/4, 0x3F800000); + INSTANCE_WR(ctx, 0x174A8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x174C8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x174E8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17508/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17528/4, 0x3F800000); + INSTANCE_WR(ctx, 0x17548/4, 0x10); + INSTANCE_WR(ctx, 0x17A28/4, 0x8100C12); + INSTANCE_WR(ctx, 0x17A48/4, 0x5); + INSTANCE_WR(ctx, 0x17AA8/4, 0x1); + INSTANCE_WR(ctx, 0x17AE8/4, 0xFFFF); + INSTANCE_WR(ctx, 0x17B08/4, 0xFFFF); + INSTANCE_WR(ctx, 0x17B28/4, 0xFFFF); + INSTANCE_WR(ctx, 0x17B48/4, 0xFFFF); + INSTANCE_WR(ctx, 0x17B68/4, 0x3); + INSTANCE_WR(ctx, 0x17F68/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x17F88/4, 0x1A); + INSTANCE_WR(ctx, 0x17FC8/4, 0x3); + INSTANCE_WR(ctx, 0x184A8/4, 0x102); + INSTANCE_WR(ctx, 0x184E8/4, 0x4); + INSTANCE_WR(ctx, 0x18508/4, 0x4); + INSTANCE_WR(ctx, 0x18528/4, 0x4); + INSTANCE_WR(ctx, 0x18548/4, 0x4); + INSTANCE_WR(ctx, 0x18568/4, 0x4); + INSTANCE_WR(ctx, 0x18588/4, 0x4); + INSTANCE_WR(ctx, 0x185C8/4, 0x7FF); + INSTANCE_WR(ctx, 0x18608/4, 0x102); + INSTANCE_WR(ctx, 0x18748/4, 0x4); + INSTANCE_WR(ctx, 0x18768/4, 0x4); + INSTANCE_WR(ctx, 0x18788/4, 0x4); + INSTANCE_WR(ctx, 0x187A8/4, 0x4); + INSTANCE_WR(ctx, 0x18DE8/4, 0x80C14); + INSTANCE_WR(ctx, 0x18E48/4, 0x804); + INSTANCE_WR(ctx, 0x18E88/4, 0x4); + INSTANCE_WR(ctx, 0x18EA8/4, 0x4); + INSTANCE_WR(ctx, 0x18EC8/4, 0x8100C12); + INSTANCE_WR(ctx, 0x18F08/4, 0x4); + INSTANCE_WR(ctx, 0x18F28/4, 0x4); + INSTANCE_WR(ctx, 0x18F68/4, 0x10); + INSTANCE_WR(ctx, 0x19008/4, 0x804); + INSTANCE_WR(ctx, 0x19028/4, 0x1); + INSTANCE_WR(ctx, 0x19048/4, 0x1A); + INSTANCE_WR(ctx, 0x19068/4, 0x7F); + INSTANCE_WR(ctx, 0x190A8/4, 0x1); + INSTANCE_WR(ctx, 0x190C8/4, 0x80C14); + INSTANCE_WR(ctx, 0x19108/4, 0x8100C12); + INSTANCE_WR(ctx, 0x19128/4, 0x4); + INSTANCE_WR(ctx, 0x19148/4, 0x4); + INSTANCE_WR(ctx, 0x19188/4, 0x10); + INSTANCE_WR(ctx, 0x19208/4, 0x1); + INSTANCE_WR(ctx, 0x19228/4, 0x8100C12); + INSTANCE_WR(ctx, 0x19308/4, 0x7FF); + INSTANCE_WR(ctx, 0x19328/4, 0x80C14); + INSTANCE_WR(ctx, 0x19A48/4, 0x1); + INSTANCE_WR(ctx, 0x19AA8/4, 0x10); + INSTANCE_WR(ctx, 0x1A1C8/4, 0x88); + INSTANCE_WR(ctx, 0x1A1E8/4, 0x88); + INSTANCE_WR(ctx, 0x1A248/4, 0x4); + INSTANCE_WR(ctx, 0x1A528/4, 0x26); + INSTANCE_WR(ctx, 0x1A588/4, 0x3F800000); + INSTANCE_WR(ctx, 0x1A608/4, 0x1A); + INSTANCE_WR(ctx, 0x1A628/4, 0x10); + INSTANCE_WR(ctx, 0x1AB48/4, 0x52); + INSTANCE_WR(ctx, 0x1AB88/4, 0x26); + INSTANCE_WR(ctx, 0x1ABC8/4, 0x4); + INSTANCE_WR(ctx, 0x1ABE8/4, 0x4); + INSTANCE_WR(ctx, 0x1AC28/4, 0x1A); + INSTANCE_WR(ctx, 0x1AC88/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x1ACC8/4, 0x4); + INSTANCE_WR(ctx, 0x1ACE8/4, 0x4); + INSTANCE_WR(ctx, 0x1AD28/4, 0x80); + INSTANCE_WR(ctx, 0x1AD48/4, 0x4); + INSTANCE_WR(ctx, 0x1AD68/4, 0x80C14); + INSTANCE_WR(ctx, 0x1ADA8/4, 0x7FF); + INSTANCE_WR(ctx, 0x2D608/4, 0x4); + INSTANCE_WR(ctx, 0x2D628/4, 0x4); + INSTANCE_WR(ctx, 0x2D668/4, 0x80); + INSTANCE_WR(ctx, 0x2D688/4, 0x4); + INSTANCE_WR(ctx, 0x2D6A8/4, 0x1); + INSTANCE_WR(ctx, 0x2D6E8/4, 0x27); + INSTANCE_WR(ctx, 0x2D728/4, 0x26); + INSTANCE_WR(ctx, 0x2D7A8/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D7C8/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D7E8/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D808/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D828/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D848/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D868/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D888/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D8A8/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D8C8/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D8E8/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D908/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D928/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D948/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D968/4, 0x4000000); + INSTANCE_WR(ctx, 0x2D988/4, 0x4000000); + INSTANCE_WR(ctx, 0x2DE28/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x2DE48/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x2DEA8/4, 0x1FE21); + INSTANCE_WR(ctx, 0x160C/4, 0x2); + INSTANCE_WR(ctx, 0x164C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x17EC/4, 0x1); + INSTANCE_WR(ctx, 0x180C/4, 0x10); + INSTANCE_WR(ctx, 0x186C/4, 0x1); + INSTANCE_WR(ctx, 0x190C/4, 0x4); + INSTANCE_WR(ctx, 0x192C/4, 0x400); + INSTANCE_WR(ctx, 0x194C/4, 0x300); + INSTANCE_WR(ctx, 0x196C/4, 0x1001); + INSTANCE_WR(ctx, 0x198C/4, 0x15); + INSTANCE_WR(ctx, 0x1A4C/4, 0x2); + INSTANCE_WR(ctx, 0x1B6C/4, 0x1); + INSTANCE_WR(ctx, 0x1B8C/4, 0x10); + INSTANCE_WR(ctx, 0x1BCC/4, 0x1); + INSTANCE_WR(ctx, 0x1E4C/4, 0x10); + INSTANCE_WR(ctx, 0x206C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x208C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x20AC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x20CC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x20EC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x210C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x212C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x214C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x216C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x218C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x21AC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x21CC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x21EC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x220C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x222C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x224C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x258C/4, 0x10); + INSTANCE_WR(ctx, 0x25CC/4, 0x3F); + INSTANCE_WR(ctx, 0x26AC/4, 0x1); + INSTANCE_WR(ctx, 0x26EC/4, 0x1); + INSTANCE_WR(ctx, 0x272C/4, 0x1); + INSTANCE_WR(ctx, 0x28CC/4, 0x11); + INSTANCE_WR(ctx, 0x29CC/4, 0xF); + INSTANCE_WR(ctx, 0x2ACC/4, 0x11); + INSTANCE_WR(ctx, 0x2BAC/4, 0x1); + INSTANCE_WR(ctx, 0x2BCC/4, 0x1); + INSTANCE_WR(ctx, 0x2BEC/4, 0x1); + INSTANCE_WR(ctx, 0x2C0C/4, 0x2); + INSTANCE_WR(ctx, 0x2C2C/4, 0x1); + INSTANCE_WR(ctx, 0x2C4C/4, 0x2); + INSTANCE_WR(ctx, 0x2C6C/4, 0x1); + INSTANCE_WR(ctx, 0x2CAC/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x2CEC/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2FAC/4, 0x1); + INSTANCE_WR(ctx, 0x2FCC/4, 0x2); + INSTANCE_WR(ctx, 0x2FEC/4, 0x1); + INSTANCE_WR(ctx, 0x300C/4, 0x1); + INSTANCE_WR(ctx, 0x302C/4, 0x2); + INSTANCE_WR(ctx, 0x304C/4, 0x1); + INSTANCE_WR(ctx, 0x306C/4, 0x1); + INSTANCE_WR(ctx, 0x30EC/4, 0x11); + INSTANCE_WR(ctx, 0x310C/4, 0x1); + INSTANCE_WR(ctx, 0x3D8C/4, 0x2); + INSTANCE_WR(ctx, 0x3DCC/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x3F6C/4, 0x1); + INSTANCE_WR(ctx, 0x3F8C/4, 0x10); + INSTANCE_WR(ctx, 0x3FEC/4, 0x1); + INSTANCE_WR(ctx, 0x408C/4, 0x4); + INSTANCE_WR(ctx, 0x40AC/4, 0x400); + INSTANCE_WR(ctx, 0x40CC/4, 0x300); + INSTANCE_WR(ctx, 0x40EC/4, 0x1001); + INSTANCE_WR(ctx, 0x410C/4, 0x15); + INSTANCE_WR(ctx, 0x41CC/4, 0x2); + INSTANCE_WR(ctx, 0x42EC/4, 0x1); + INSTANCE_WR(ctx, 0x430C/4, 0x10); + INSTANCE_WR(ctx, 0x434C/4, 0x1); + INSTANCE_WR(ctx, 0x45CC/4, 0x10); + INSTANCE_WR(ctx, 0x47EC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x480C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x482C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x484C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x486C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x488C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x48AC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x48CC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x48EC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x490C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x492C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x494C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x496C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x498C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x49AC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x49CC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x4D0C/4, 0x10); + INSTANCE_WR(ctx, 0x4D4C/4, 0x3F); + INSTANCE_WR(ctx, 0x4E2C/4, 0x1); + INSTANCE_WR(ctx, 0x4E6C/4, 0x1); + INSTANCE_WR(ctx, 0x4EAC/4, 0x1); + INSTANCE_WR(ctx, 0x504C/4, 0x11); + INSTANCE_WR(ctx, 0x514C/4, 0xF); + INSTANCE_WR(ctx, 0x524C/4, 0x11); + INSTANCE_WR(ctx, 0x532C/4, 0x1); + INSTANCE_WR(ctx, 0x534C/4, 0x1); + INSTANCE_WR(ctx, 0x536C/4, 0x1); + INSTANCE_WR(ctx, 0x538C/4, 0x2); + INSTANCE_WR(ctx, 0x53AC/4, 0x1); + INSTANCE_WR(ctx, 0x53CC/4, 0x2); + INSTANCE_WR(ctx, 0x53EC/4, 0x1); + INSTANCE_WR(ctx, 0x542C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x546C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x572C/4, 0x1); + INSTANCE_WR(ctx, 0x574C/4, 0x2); + INSTANCE_WR(ctx, 0x576C/4, 0x1); + INSTANCE_WR(ctx, 0x578C/4, 0x1); + INSTANCE_WR(ctx, 0x57AC/4, 0x2); + INSTANCE_WR(ctx, 0x57CC/4, 0x1); + INSTANCE_WR(ctx, 0x57EC/4, 0x1); + INSTANCE_WR(ctx, 0x586C/4, 0x11); + INSTANCE_WR(ctx, 0x588C/4, 0x1); + INSTANCE_WR(ctx, 0x650C/4, 0x2); + INSTANCE_WR(ctx, 0x654C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x66EC/4, 0x1); + INSTANCE_WR(ctx, 0x670C/4, 0x10); + INSTANCE_WR(ctx, 0x676C/4, 0x1); + INSTANCE_WR(ctx, 0x680C/4, 0x4); + INSTANCE_WR(ctx, 0x682C/4, 0x400); + INSTANCE_WR(ctx, 0x684C/4, 0x300); + INSTANCE_WR(ctx, 0x686C/4, 0x1001); + INSTANCE_WR(ctx, 0x688C/4, 0x15); + INSTANCE_WR(ctx, 0x694C/4, 0x2); + INSTANCE_WR(ctx, 0x6A6C/4, 0x1); + INSTANCE_WR(ctx, 0x6A8C/4, 0x10); + INSTANCE_WR(ctx, 0x6ACC/4, 0x1); + INSTANCE_WR(ctx, 0x6D4C/4, 0x10); + INSTANCE_WR(ctx, 0x6F6C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x6F8C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x6FAC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x6FCC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x6FEC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x700C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x702C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x704C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x706C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x708C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x70AC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x70CC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x70EC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x710C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x712C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x714C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x748C/4, 0x10); + INSTANCE_WR(ctx, 0x74CC/4, 0x3F); + INSTANCE_WR(ctx, 0x75AC/4, 0x1); + INSTANCE_WR(ctx, 0x75EC/4, 0x1); + INSTANCE_WR(ctx, 0x762C/4, 0x1); + INSTANCE_WR(ctx, 0x77CC/4, 0x11); + INSTANCE_WR(ctx, 0x78CC/4, 0xF); + INSTANCE_WR(ctx, 0x79CC/4, 0x11); + INSTANCE_WR(ctx, 0x7AAC/4, 0x1); + INSTANCE_WR(ctx, 0x7ACC/4, 0x1); + INSTANCE_WR(ctx, 0x7AEC/4, 0x1); + INSTANCE_WR(ctx, 0x7B0C/4, 0x2); + INSTANCE_WR(ctx, 0x7B2C/4, 0x1); + INSTANCE_WR(ctx, 0x7B4C/4, 0x2); + INSTANCE_WR(ctx, 0x7B6C/4, 0x1); + INSTANCE_WR(ctx, 0x7BAC/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x7BEC/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x7EAC/4, 0x1); + INSTANCE_WR(ctx, 0x7ECC/4, 0x2); + INSTANCE_WR(ctx, 0x7EEC/4, 0x1); + INSTANCE_WR(ctx, 0x7F0C/4, 0x1); + INSTANCE_WR(ctx, 0x7F2C/4, 0x2); + INSTANCE_WR(ctx, 0x7F4C/4, 0x1); + INSTANCE_WR(ctx, 0x7F6C/4, 0x1); + INSTANCE_WR(ctx, 0x7FEC/4, 0x11); + INSTANCE_WR(ctx, 0x800C/4, 0x1); + INSTANCE_WR(ctx, 0x8C8C/4, 0x2); + INSTANCE_WR(ctx, 0x8CCC/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x8E6C/4, 0x1); + INSTANCE_WR(ctx, 0x8E8C/4, 0x10); + INSTANCE_WR(ctx, 0x8EEC/4, 0x1); + INSTANCE_WR(ctx, 0x8F8C/4, 0x4); + INSTANCE_WR(ctx, 0x8FAC/4, 0x400); + INSTANCE_WR(ctx, 0x8FCC/4, 0x300); + INSTANCE_WR(ctx, 0x8FEC/4, 0x1001); + INSTANCE_WR(ctx, 0x900C/4, 0x15); + INSTANCE_WR(ctx, 0x90CC/4, 0x2); + INSTANCE_WR(ctx, 0x91EC/4, 0x1); + INSTANCE_WR(ctx, 0x920C/4, 0x10); + INSTANCE_WR(ctx, 0x924C/4, 0x1); + INSTANCE_WR(ctx, 0x94CC/4, 0x10); + INSTANCE_WR(ctx, 0x96EC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x970C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x972C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x974C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x976C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x978C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x97AC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x97CC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x97EC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x980C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x982C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x984C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x986C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x988C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x98AC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x98CC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x9C0C/4, 0x10); + INSTANCE_WR(ctx, 0x9C4C/4, 0x3F); + INSTANCE_WR(ctx, 0x9D2C/4, 0x1); + INSTANCE_WR(ctx, 0x9D6C/4, 0x1); + INSTANCE_WR(ctx, 0x9DAC/4, 0x1); + INSTANCE_WR(ctx, 0x9F4C/4, 0x11); + INSTANCE_WR(ctx, 0xA04C/4, 0xF); + INSTANCE_WR(ctx, 0xA14C/4, 0x11); + INSTANCE_WR(ctx, 0xA22C/4, 0x1); + INSTANCE_WR(ctx, 0xA24C/4, 0x1); + INSTANCE_WR(ctx, 0xA26C/4, 0x1); + INSTANCE_WR(ctx, 0xA28C/4, 0x2); + INSTANCE_WR(ctx, 0xA2AC/4, 0x1); + INSTANCE_WR(ctx, 0xA2CC/4, 0x2); + INSTANCE_WR(ctx, 0xA2EC/4, 0x1); + INSTANCE_WR(ctx, 0xA32C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0xA36C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0xA62C/4, 0x1); + INSTANCE_WR(ctx, 0xA64C/4, 0x2); + INSTANCE_WR(ctx, 0xA66C/4, 0x1); + INSTANCE_WR(ctx, 0xA68C/4, 0x1); + INSTANCE_WR(ctx, 0xA6AC/4, 0x2); + INSTANCE_WR(ctx, 0xA6CC/4, 0x1); + INSTANCE_WR(ctx, 0xA6EC/4, 0x1); + INSTANCE_WR(ctx, 0xA76C/4, 0x11); + INSTANCE_WR(ctx, 0xA78C/4, 0x1); + INSTANCE_WR(ctx, 0x1530/4, 0x4); + INSTANCE_WR(ctx, 0x17F0/4, 0x4); + INSTANCE_WR(ctx, 0x1810/4, 0x4); + INSTANCE_WR(ctx, 0x1830/4, 0x608080); + INSTANCE_WR(ctx, 0x18D0/4, 0x4); + INSTANCE_WR(ctx, 0x1930/4, 0x4); + INSTANCE_WR(ctx, 0x1950/4, 0x4); + INSTANCE_WR(ctx, 0x1970/4, 0x80); + INSTANCE_WR(ctx, 0x1990/4, 0x4); + INSTANCE_WR(ctx, 0x1E30/4, 0x4); + INSTANCE_WR(ctx, 0x1E50/4, 0x80); + INSTANCE_WR(ctx, 0x1E70/4, 0x4); + INSTANCE_WR(ctx, 0x1E90/4, 0x3020100); + INSTANCE_WR(ctx, 0x1EB0/4, 0x3); + INSTANCE_WR(ctx, 0x1ED0/4, 0x4); + INSTANCE_WR(ctx, 0x1F70/4, 0x4); + INSTANCE_WR(ctx, 0x1F90/4, 0x3); + INSTANCE_WR(ctx, 0x2010/4, 0x4); + INSTANCE_WR(ctx, 0x164B0/4, 0x4); + INSTANCE_WR(ctx, 0x164D0/4, 0x3); + INSTANCE_WR(ctx, 0x16710/4, 0xF); + INSTANCE_WR(ctx, 0x16890/4, 0x4); + INSTANCE_WR(ctx, 0x168B0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x168D0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x168F0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16910/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16A30/4, 0x1); + INSTANCE_WR(ctx, 0x16AB0/4, 0x1); + INSTANCE_WR(ctx, 0x16B70/4, 0x1); + INSTANCE_WR(ctx, 0x16D10/4, 0x1); + INSTANCE_WR(ctx, 0x16D30/4, 0x1); + INSTANCE_WR(ctx, 0x16D50/4, 0x2); + INSTANCE_WR(ctx, 0x16D70/4, 0x1); + INSTANCE_WR(ctx, 0x16D90/4, 0x1); + INSTANCE_WR(ctx, 0x16DB0/4, 0x2); + INSTANCE_WR(ctx, 0x16DD0/4, 0x1); + INSTANCE_WR(ctx, 0x16E10/4, 0x11); + INSTANCE_WR(ctx, 0x16F10/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x16F70/4, 0x4); + INSTANCE_WR(ctx, 0x16FF0/4, 0x11); + INSTANCE_WR(ctx, 0x17010/4, 0x1); + INSTANCE_WR(ctx, 0x17050/4, 0xCF); + INSTANCE_WR(ctx, 0x17070/4, 0xCF); + INSTANCE_WR(ctx, 0x17090/4, 0xCF); + INSTANCE_WR(ctx, 0x171F0/4, 0x1); + INSTANCE_WR(ctx, 0x17210/4, 0x1); + INSTANCE_WR(ctx, 0x17230/4, 0x2); + INSTANCE_WR(ctx, 0x17250/4, 0x1); + INSTANCE_WR(ctx, 0x17270/4, 0x1); + INSTANCE_WR(ctx, 0x17290/4, 0x2); + INSTANCE_WR(ctx, 0x172B0/4, 0x1); + INSTANCE_WR(ctx, 0x172F0/4, 0x1); + INSTANCE_WR(ctx, 0x17310/4, 0x1); + INSTANCE_WR(ctx, 0x17330/4, 0x1); + INSTANCE_WR(ctx, 0x17350/4, 0x1); + INSTANCE_WR(ctx, 0x17370/4, 0x1); + INSTANCE_WR(ctx, 0x17390/4, 0x1); + INSTANCE_WR(ctx, 0x173B0/4, 0x1); + INSTANCE_WR(ctx, 0x173D0/4, 0x1); + INSTANCE_WR(ctx, 0x173F0/4, 0x11); + INSTANCE_WR(ctx, 0x174F0/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x17510/4, 0xF); + INSTANCE_WR(ctx, 0x17610/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x17670/4, 0x11); + INSTANCE_WR(ctx, 0x17690/4, 0x1); + INSTANCE_WR(ctx, 0x17710/4, 0x4); + INSTANCE_WR(ctx, 0x177D0/4, 0x1); + INSTANCE_WR(ctx, 0x17870/4, 0x11); + INSTANCE_WR(ctx, 0x17970/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x179F0/4, 0x11); + INSTANCE_WR(ctx, 0x17A10/4, 0x1); + INSTANCE_WR(ctx, 0x17A50/4, 0x1); + INSTANCE_WR(ctx, 0x17A90/4, 0x1); + INSTANCE_WR(ctx, 0x17AD0/4, 0x7FF); + INSTANCE_WR(ctx, 0x17B10/4, 0x1); + INSTANCE_WR(ctx, 0x17B50/4, 0x1); + INSTANCE_WR(ctx, 0x180B0/4, 0x8); + INSTANCE_WR(ctx, 0x180D0/4, 0x8); + INSTANCE_WR(ctx, 0x180F0/4, 0x8); + INSTANCE_WR(ctx, 0x18110/4, 0x8); + INSTANCE_WR(ctx, 0x18130/4, 0x8); + INSTANCE_WR(ctx, 0x18150/4, 0x8); + INSTANCE_WR(ctx, 0x18170/4, 0x8); + INSTANCE_WR(ctx, 0x18190/4, 0x8); + INSTANCE_WR(ctx, 0x181B0/4, 0x11); + INSTANCE_WR(ctx, 0x182B0/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x182D0/4, 0x400); + INSTANCE_WR(ctx, 0x182F0/4, 0x400); + INSTANCE_WR(ctx, 0x18310/4, 0x400); + INSTANCE_WR(ctx, 0x18330/4, 0x400); + INSTANCE_WR(ctx, 0x18350/4, 0x400); + INSTANCE_WR(ctx, 0x18370/4, 0x400); + INSTANCE_WR(ctx, 0x18390/4, 0x400); + INSTANCE_WR(ctx, 0x183B0/4, 0x400); + INSTANCE_WR(ctx, 0x183D0/4, 0x300); + INSTANCE_WR(ctx, 0x183F0/4, 0x300); + INSTANCE_WR(ctx, 0x18410/4, 0x300); + INSTANCE_WR(ctx, 0x18430/4, 0x300); + INSTANCE_WR(ctx, 0x18450/4, 0x300); + INSTANCE_WR(ctx, 0x18470/4, 0x300); + INSTANCE_WR(ctx, 0x18490/4, 0x300); + INSTANCE_WR(ctx, 0x184B0/4, 0x300); + INSTANCE_WR(ctx, 0x184D0/4, 0x1); + INSTANCE_WR(ctx, 0x184F0/4, 0xF); + INSTANCE_WR(ctx, 0x185F0/4, 0x20); + INSTANCE_WR(ctx, 0x18610/4, 0x11); + INSTANCE_WR(ctx, 0x18630/4, 0x100); + INSTANCE_WR(ctx, 0x18670/4, 0x1); + INSTANCE_WR(ctx, 0x186D0/4, 0x40); + INSTANCE_WR(ctx, 0x186F0/4, 0x100); + INSTANCE_WR(ctx, 0x18730/4, 0x3); + INSTANCE_WR(ctx, 0x187D0/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x18850/4, 0x2); + INSTANCE_WR(ctx, 0x18870/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x189B0/4, 0x1); + INSTANCE_WR(ctx, 0x18A50/4, 0x4); + INSTANCE_WR(ctx, 0x18A90/4, 0x1); + INSTANCE_WR(ctx, 0x18AB0/4, 0x400); + INSTANCE_WR(ctx, 0x18AD0/4, 0x300); + INSTANCE_WR(ctx, 0x18AF0/4, 0x1001); + INSTANCE_WR(ctx, 0x18B70/4, 0x11); + INSTANCE_WR(ctx, 0x18C70/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x18C90/4, 0xF); + INSTANCE_WR(ctx, 0x18F90/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x19010/4, 0x11); + INSTANCE_WR(ctx, 0x19070/4, 0x4); + INSTANCE_WR(ctx, 0x190B0/4, 0x1); + INSTANCE_WR(ctx, 0x190D0/4, 0x1); + INSTANCE_WR(ctx, 0x19150/4, 0x1); + INSTANCE_WR(ctx, 0x191F0/4, 0x1); + INSTANCE_WR(ctx, 0x19230/4, 0x1); + INSTANCE_WR(ctx, 0x192B0/4, 0x2A712488); + INSTANCE_WR(ctx, 0x192F0/4, 0x4085C000); + INSTANCE_WR(ctx, 0x19310/4, 0x40); + INSTANCE_WR(ctx, 0x19330/4, 0x100); + INSTANCE_WR(ctx, 0x19350/4, 0x10100); + INSTANCE_WR(ctx, 0x19370/4, 0x2800000); + INSTANCE_WR(ctx, 0x195D0/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x195F0/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x19610/4, 0x1); + INSTANCE_WR(ctx, 0x19650/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x19670/4, 0x1); + INSTANCE_WR(ctx, 0x196D0/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x197F0/4, 0x1); + INSTANCE_WR(ctx, 0x19830/4, 0x1); + INSTANCE_WR(ctx, 0x19850/4, 0x30201000); + INSTANCE_WR(ctx, 0x19870/4, 0x70605040); + INSTANCE_WR(ctx, 0x19890/4, 0xB8A89888); + INSTANCE_WR(ctx, 0x198B0/4, 0xF8E8D8C8); + INSTANCE_WR(ctx, 0x198F0/4, 0x1A); + INSTANCE_WR(ctx, 0x19930/4, 0x4); + INSTANCE_WR(ctx, 0x19BF0/4, 0x4); + INSTANCE_WR(ctx, 0x19C10/4, 0x4); + INSTANCE_WR(ctx, 0x19C30/4, 0x608080); + INSTANCE_WR(ctx, 0x19CD0/4, 0x4); + INSTANCE_WR(ctx, 0x19D30/4, 0x4); + INSTANCE_WR(ctx, 0x19D50/4, 0x4); + INSTANCE_WR(ctx, 0x19D70/4, 0x80); + INSTANCE_WR(ctx, 0x19D90/4, 0x4); + INSTANCE_WR(ctx, 0x1A230/4, 0x4); + INSTANCE_WR(ctx, 0x1A250/4, 0x80); + INSTANCE_WR(ctx, 0x1A270/4, 0x4); + INSTANCE_WR(ctx, 0x1A290/4, 0x3020100); + INSTANCE_WR(ctx, 0x1A2B0/4, 0x3); + INSTANCE_WR(ctx, 0x1A2D0/4, 0x4); + INSTANCE_WR(ctx, 0x1A370/4, 0x4); + INSTANCE_WR(ctx, 0x1A390/4, 0x3); + INSTANCE_WR(ctx, 0x1A410/4, 0x4); + INSTANCE_WR(ctx, 0x2E8B0/4, 0x4); + INSTANCE_WR(ctx, 0x2E8D0/4, 0x3); + INSTANCE_WR(ctx, 0x2EB10/4, 0xF); + INSTANCE_WR(ctx, 0x2EC90/4, 0x4); + INSTANCE_WR(ctx, 0x2ECB0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ECD0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ECF0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ED10/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2EE30/4, 0x1); + INSTANCE_WR(ctx, 0x2EEB0/4, 0x1); + INSTANCE_WR(ctx, 0x2EF70/4, 0x1); + INSTANCE_WR(ctx, 0x2F110/4, 0x1); + INSTANCE_WR(ctx, 0x2F130/4, 0x1); + INSTANCE_WR(ctx, 0x2F150/4, 0x2); + INSTANCE_WR(ctx, 0x2F170/4, 0x1); + INSTANCE_WR(ctx, 0x2F190/4, 0x1); + INSTANCE_WR(ctx, 0x2F1B0/4, 0x2); + INSTANCE_WR(ctx, 0x2F1D0/4, 0x1); + INSTANCE_WR(ctx, 0x2F210/4, 0x11); + INSTANCE_WR(ctx, 0x2F310/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2F370/4, 0x4); + INSTANCE_WR(ctx, 0x2F3F0/4, 0x11); + INSTANCE_WR(ctx, 0x2F410/4, 0x1); + INSTANCE_WR(ctx, 0x2F450/4, 0xCF); + INSTANCE_WR(ctx, 0x2F470/4, 0xCF); + INSTANCE_WR(ctx, 0x2F490/4, 0xCF); + INSTANCE_WR(ctx, 0x2F5F0/4, 0x1); + INSTANCE_WR(ctx, 0x2F610/4, 0x1); + INSTANCE_WR(ctx, 0x2F630/4, 0x2); + INSTANCE_WR(ctx, 0x2F650/4, 0x1); + INSTANCE_WR(ctx, 0x2F670/4, 0x1); + INSTANCE_WR(ctx, 0x2F690/4, 0x2); + INSTANCE_WR(ctx, 0x2F6B0/4, 0x1); + INSTANCE_WR(ctx, 0x2F6F0/4, 0x1); + INSTANCE_WR(ctx, 0x2F710/4, 0x1); + INSTANCE_WR(ctx, 0x2F730/4, 0x1); + INSTANCE_WR(ctx, 0x2F750/4, 0x1); + INSTANCE_WR(ctx, 0x2F770/4, 0x1); + INSTANCE_WR(ctx, 0x2F790/4, 0x1); + INSTANCE_WR(ctx, 0x2F7B0/4, 0x1); + INSTANCE_WR(ctx, 0x2F7D0/4, 0x1); + INSTANCE_WR(ctx, 0x2F7F0/4, 0x11); + INSTANCE_WR(ctx, 0x2F8F0/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2F910/4, 0xF); + INSTANCE_WR(ctx, 0x2FA10/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x2FA70/4, 0x11); + INSTANCE_WR(ctx, 0x2FA90/4, 0x1); + INSTANCE_WR(ctx, 0x2FB10/4, 0x4); + INSTANCE_WR(ctx, 0x2FBD0/4, 0x1); + INSTANCE_WR(ctx, 0x2FC70/4, 0x11); + INSTANCE_WR(ctx, 0x2FD70/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2FDF0/4, 0x11); + INSTANCE_WR(ctx, 0x2FE10/4, 0x1); + INSTANCE_WR(ctx, 0x2FE50/4, 0x1); + INSTANCE_WR(ctx, 0x2FE90/4, 0x1); + INSTANCE_WR(ctx, 0x2FED0/4, 0x7FF); + INSTANCE_WR(ctx, 0x2FF10/4, 0x1); + INSTANCE_WR(ctx, 0x2FF50/4, 0x1); + INSTANCE_WR(ctx, 0x304B0/4, 0x8); + INSTANCE_WR(ctx, 0x304D0/4, 0x8); + INSTANCE_WR(ctx, 0x304F0/4, 0x8); + INSTANCE_WR(ctx, 0x30510/4, 0x8); + INSTANCE_WR(ctx, 0x30530/4, 0x8); + INSTANCE_WR(ctx, 0x30550/4, 0x8); + INSTANCE_WR(ctx, 0x30570/4, 0x8); + INSTANCE_WR(ctx, 0x30590/4, 0x8); + INSTANCE_WR(ctx, 0x305B0/4, 0x11); + INSTANCE_WR(ctx, 0x306B0/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x306D0/4, 0x400); + INSTANCE_WR(ctx, 0x306F0/4, 0x400); + INSTANCE_WR(ctx, 0x30710/4, 0x400); + INSTANCE_WR(ctx, 0x30730/4, 0x400); + INSTANCE_WR(ctx, 0x30750/4, 0x400); + INSTANCE_WR(ctx, 0x30770/4, 0x400); + INSTANCE_WR(ctx, 0x30790/4, 0x400); + INSTANCE_WR(ctx, 0x307B0/4, 0x400); + INSTANCE_WR(ctx, 0x307D0/4, 0x300); + INSTANCE_WR(ctx, 0x307F0/4, 0x300); + INSTANCE_WR(ctx, 0x30810/4, 0x300); + INSTANCE_WR(ctx, 0x30830/4, 0x300); + INSTANCE_WR(ctx, 0x30850/4, 0x300); + INSTANCE_WR(ctx, 0x30870/4, 0x300); + INSTANCE_WR(ctx, 0x30890/4, 0x300); + INSTANCE_WR(ctx, 0x308B0/4, 0x300); + INSTANCE_WR(ctx, 0x308D0/4, 0x1); + INSTANCE_WR(ctx, 0x308F0/4, 0xF); + INSTANCE_WR(ctx, 0x309F0/4, 0x20); + INSTANCE_WR(ctx, 0x30A10/4, 0x11); + INSTANCE_WR(ctx, 0x30A30/4, 0x100); + INSTANCE_WR(ctx, 0x30A70/4, 0x1); + INSTANCE_WR(ctx, 0x30AD0/4, 0x40); + INSTANCE_WR(ctx, 0x30AF0/4, 0x100); + INSTANCE_WR(ctx, 0x30B30/4, 0x3); + INSTANCE_WR(ctx, 0x30BD0/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x30C50/4, 0x2); + INSTANCE_WR(ctx, 0x30C70/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x30DB0/4, 0x1); + INSTANCE_WR(ctx, 0x30E50/4, 0x4); + INSTANCE_WR(ctx, 0x30E90/4, 0x1); + INSTANCE_WR(ctx, 0x30EB0/4, 0x400); + INSTANCE_WR(ctx, 0x30ED0/4, 0x300); + INSTANCE_WR(ctx, 0x30EF0/4, 0x1001); + INSTANCE_WR(ctx, 0x30F70/4, 0x11); + INSTANCE_WR(ctx, 0x31070/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x31090/4, 0xF); + INSTANCE_WR(ctx, 0x31390/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x31410/4, 0x11); + INSTANCE_WR(ctx, 0x31470/4, 0x4); + INSTANCE_WR(ctx, 0x314B0/4, 0x1); + INSTANCE_WR(ctx, 0x314D0/4, 0x1); + INSTANCE_WR(ctx, 0x31550/4, 0x1); + INSTANCE_WR(ctx, 0x315F0/4, 0x1); + INSTANCE_WR(ctx, 0x31630/4, 0x1); + INSTANCE_WR(ctx, 0x316B0/4, 0x2A712488); + INSTANCE_WR(ctx, 0x316F0/4, 0x4085C000); + INSTANCE_WR(ctx, 0x31710/4, 0x40); + INSTANCE_WR(ctx, 0x31730/4, 0x100); + INSTANCE_WR(ctx, 0x31750/4, 0x10100); + INSTANCE_WR(ctx, 0x31770/4, 0x2800000); + INSTANCE_WR(ctx, 0x319D0/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x319F0/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x31A10/4, 0x1); + INSTANCE_WR(ctx, 0x31A50/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x31A70/4, 0x1); + INSTANCE_WR(ctx, 0x31AD0/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x31BF0/4, 0x1); + INSTANCE_WR(ctx, 0x31C30/4, 0x1); + INSTANCE_WR(ctx, 0x31C50/4, 0x30201000); + INSTANCE_WR(ctx, 0x31C70/4, 0x70605040); + INSTANCE_WR(ctx, 0x31C90/4, 0xB8A89888); + INSTANCE_WR(ctx, 0x31CB0/4, 0xF8E8D8C8); + INSTANCE_WR(ctx, 0x31CF0/4, 0x1A); + INSTANCE_WR(ctx, 0x1534/4, 0x4); + INSTANCE_WR(ctx, 0x17F4/4, 0x4); + INSTANCE_WR(ctx, 0x1814/4, 0x4); + INSTANCE_WR(ctx, 0x1834/4, 0x608080); + INSTANCE_WR(ctx, 0x18D4/4, 0x4); + INSTANCE_WR(ctx, 0x1934/4, 0x4); + INSTANCE_WR(ctx, 0x1954/4, 0x4); + INSTANCE_WR(ctx, 0x1974/4, 0x80); + INSTANCE_WR(ctx, 0x1994/4, 0x4); + INSTANCE_WR(ctx, 0x1E34/4, 0x4); + INSTANCE_WR(ctx, 0x1E54/4, 0x80); + INSTANCE_WR(ctx, 0x1E74/4, 0x4); + INSTANCE_WR(ctx, 0x1E94/4, 0x3020100); + INSTANCE_WR(ctx, 0x1EB4/4, 0x3); + INSTANCE_WR(ctx, 0x1ED4/4, 0x4); + INSTANCE_WR(ctx, 0x1F74/4, 0x4); + INSTANCE_WR(ctx, 0x1F94/4, 0x3); + INSTANCE_WR(ctx, 0x2014/4, 0x4); + INSTANCE_WR(ctx, 0x164B4/4, 0x4); + INSTANCE_WR(ctx, 0x164D4/4, 0x3); + INSTANCE_WR(ctx, 0x16714/4, 0xF); + INSTANCE_WR(ctx, 0x16894/4, 0x4); + INSTANCE_WR(ctx, 0x168B4/4, 0xFFFF); + INSTANCE_WR(ctx, 0x168D4/4, 0xFFFF); + INSTANCE_WR(ctx, 0x168F4/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16914/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16A34/4, 0x1); + INSTANCE_WR(ctx, 0x16AB4/4, 0x1); + INSTANCE_WR(ctx, 0x16B74/4, 0x1); + INSTANCE_WR(ctx, 0x16D14/4, 0x1); + INSTANCE_WR(ctx, 0x16D34/4, 0x1); + INSTANCE_WR(ctx, 0x16D54/4, 0x2); + INSTANCE_WR(ctx, 0x16D74/4, 0x1); + INSTANCE_WR(ctx, 0x16D94/4, 0x1); + INSTANCE_WR(ctx, 0x16DB4/4, 0x2); + INSTANCE_WR(ctx, 0x16DD4/4, 0x1); + INSTANCE_WR(ctx, 0x16E14/4, 0x11); + INSTANCE_WR(ctx, 0x16F14/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x16F74/4, 0x4); + INSTANCE_WR(ctx, 0x16FF4/4, 0x11); + INSTANCE_WR(ctx, 0x17014/4, 0x1); + INSTANCE_WR(ctx, 0x17054/4, 0xCF); + INSTANCE_WR(ctx, 0x17074/4, 0xCF); + INSTANCE_WR(ctx, 0x17094/4, 0xCF); + INSTANCE_WR(ctx, 0x171F4/4, 0x1); + INSTANCE_WR(ctx, 0x17214/4, 0x1); + INSTANCE_WR(ctx, 0x17234/4, 0x2); + INSTANCE_WR(ctx, 0x17254/4, 0x1); + INSTANCE_WR(ctx, 0x17274/4, 0x1); + INSTANCE_WR(ctx, 0x17294/4, 0x2); + INSTANCE_WR(ctx, 0x172B4/4, 0x1); + INSTANCE_WR(ctx, 0x172F4/4, 0x1); + INSTANCE_WR(ctx, 0x17314/4, 0x1); + INSTANCE_WR(ctx, 0x17334/4, 0x1); + INSTANCE_WR(ctx, 0x17354/4, 0x1); + INSTANCE_WR(ctx, 0x17374/4, 0x1); + INSTANCE_WR(ctx, 0x17394/4, 0x1); + INSTANCE_WR(ctx, 0x173B4/4, 0x1); + INSTANCE_WR(ctx, 0x173D4/4, 0x1); + INSTANCE_WR(ctx, 0x173F4/4, 0x11); + INSTANCE_WR(ctx, 0x174F4/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x17514/4, 0xF); + INSTANCE_WR(ctx, 0x17614/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x17674/4, 0x11); + INSTANCE_WR(ctx, 0x17694/4, 0x1); + INSTANCE_WR(ctx, 0x17714/4, 0x4); + INSTANCE_WR(ctx, 0x177D4/4, 0x1); + INSTANCE_WR(ctx, 0x17874/4, 0x11); + INSTANCE_WR(ctx, 0x17974/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x179F4/4, 0x11); + INSTANCE_WR(ctx, 0x17A14/4, 0x1); + INSTANCE_WR(ctx, 0x17A54/4, 0x1); + INSTANCE_WR(ctx, 0x17A94/4, 0x1); + INSTANCE_WR(ctx, 0x17AD4/4, 0x7FF); + INSTANCE_WR(ctx, 0x17B14/4, 0x1); + INSTANCE_WR(ctx, 0x17B54/4, 0x1); + INSTANCE_WR(ctx, 0x180B4/4, 0x8); + INSTANCE_WR(ctx, 0x180D4/4, 0x8); + INSTANCE_WR(ctx, 0x180F4/4, 0x8); + INSTANCE_WR(ctx, 0x18114/4, 0x8); + INSTANCE_WR(ctx, 0x18134/4, 0x8); + INSTANCE_WR(ctx, 0x18154/4, 0x8); + INSTANCE_WR(ctx, 0x18174/4, 0x8); + INSTANCE_WR(ctx, 0x18194/4, 0x8); + INSTANCE_WR(ctx, 0x181B4/4, 0x11); + INSTANCE_WR(ctx, 0x182B4/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x182D4/4, 0x400); + INSTANCE_WR(ctx, 0x182F4/4, 0x400); + INSTANCE_WR(ctx, 0x18314/4, 0x400); + INSTANCE_WR(ctx, 0x18334/4, 0x400); + INSTANCE_WR(ctx, 0x18354/4, 0x400); + INSTANCE_WR(ctx, 0x18374/4, 0x400); + INSTANCE_WR(ctx, 0x18394/4, 0x400); + INSTANCE_WR(ctx, 0x183B4/4, 0x400); + INSTANCE_WR(ctx, 0x183D4/4, 0x300); + INSTANCE_WR(ctx, 0x183F4/4, 0x300); + INSTANCE_WR(ctx, 0x18414/4, 0x300); + INSTANCE_WR(ctx, 0x18434/4, 0x300); + INSTANCE_WR(ctx, 0x18454/4, 0x300); + INSTANCE_WR(ctx, 0x18474/4, 0x300); + INSTANCE_WR(ctx, 0x18494/4, 0x300); + INSTANCE_WR(ctx, 0x184B4/4, 0x300); + INSTANCE_WR(ctx, 0x184D4/4, 0x1); + INSTANCE_WR(ctx, 0x184F4/4, 0xF); + INSTANCE_WR(ctx, 0x185F4/4, 0x20); + INSTANCE_WR(ctx, 0x18614/4, 0x11); + INSTANCE_WR(ctx, 0x18634/4, 0x100); + INSTANCE_WR(ctx, 0x18674/4, 0x1); + INSTANCE_WR(ctx, 0x186D4/4, 0x40); + INSTANCE_WR(ctx, 0x186F4/4, 0x100); + INSTANCE_WR(ctx, 0x18734/4, 0x3); + INSTANCE_WR(ctx, 0x187D4/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x18854/4, 0x2); + INSTANCE_WR(ctx, 0x18874/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x189B4/4, 0x1); + INSTANCE_WR(ctx, 0x18A54/4, 0x4); + INSTANCE_WR(ctx, 0x18A94/4, 0x1); + INSTANCE_WR(ctx, 0x18AB4/4, 0x400); + INSTANCE_WR(ctx, 0x18AD4/4, 0x300); + INSTANCE_WR(ctx, 0x18AF4/4, 0x1001); + INSTANCE_WR(ctx, 0x18B74/4, 0x11); + INSTANCE_WR(ctx, 0x18C74/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x18C94/4, 0xF); + INSTANCE_WR(ctx, 0x18F94/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x19014/4, 0x11); + INSTANCE_WR(ctx, 0x19074/4, 0x4); + INSTANCE_WR(ctx, 0x190B4/4, 0x1); + INSTANCE_WR(ctx, 0x190D4/4, 0x1); + INSTANCE_WR(ctx, 0x19154/4, 0x1); + INSTANCE_WR(ctx, 0x191F4/4, 0x1); + INSTANCE_WR(ctx, 0x19234/4, 0x1); + INSTANCE_WR(ctx, 0x192B4/4, 0x2A712488); + INSTANCE_WR(ctx, 0x192F4/4, 0x4085C000); + INSTANCE_WR(ctx, 0x19314/4, 0x40); + INSTANCE_WR(ctx, 0x19334/4, 0x100); + INSTANCE_WR(ctx, 0x19354/4, 0x10100); + INSTANCE_WR(ctx, 0x19374/4, 0x2800000); + INSTANCE_WR(ctx, 0x195D4/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x195F4/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x19614/4, 0x1); + INSTANCE_WR(ctx, 0x19654/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x19674/4, 0x1); + INSTANCE_WR(ctx, 0x196D4/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x197F4/4, 0x1); + INSTANCE_WR(ctx, 0x19834/4, 0x1); + INSTANCE_WR(ctx, 0x19854/4, 0x30201000); + INSTANCE_WR(ctx, 0x19874/4, 0x70605040); + INSTANCE_WR(ctx, 0x19894/4, 0xB8A89888); + INSTANCE_WR(ctx, 0x198B4/4, 0xF8E8D8C8); + INSTANCE_WR(ctx, 0x198F4/4, 0x1A); + INSTANCE_WR(ctx, 0x19934/4, 0x4); + INSTANCE_WR(ctx, 0x19BF4/4, 0x4); + INSTANCE_WR(ctx, 0x19C14/4, 0x4); + INSTANCE_WR(ctx, 0x19C34/4, 0x608080); + INSTANCE_WR(ctx, 0x19CD4/4, 0x4); + INSTANCE_WR(ctx, 0x19D34/4, 0x4); + INSTANCE_WR(ctx, 0x19D54/4, 0x4); + INSTANCE_WR(ctx, 0x19D74/4, 0x80); + INSTANCE_WR(ctx, 0x19D94/4, 0x4); + INSTANCE_WR(ctx, 0x1A234/4, 0x4); + INSTANCE_WR(ctx, 0x1A254/4, 0x80); + INSTANCE_WR(ctx, 0x1A274/4, 0x4); + INSTANCE_WR(ctx, 0x1A294/4, 0x3020100); + INSTANCE_WR(ctx, 0x1A2B4/4, 0x3); + INSTANCE_WR(ctx, 0x1A2D4/4, 0x4); + INSTANCE_WR(ctx, 0x1A374/4, 0x4); + INSTANCE_WR(ctx, 0x1A394/4, 0x3); + INSTANCE_WR(ctx, 0x1A414/4, 0x4); + INSTANCE_WR(ctx, 0x2E8B4/4, 0x4); + INSTANCE_WR(ctx, 0x2E8D4/4, 0x3); + INSTANCE_WR(ctx, 0x2EB14/4, 0xF); + INSTANCE_WR(ctx, 0x2EC94/4, 0x4); + INSTANCE_WR(ctx, 0x2ECB4/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ECD4/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ECF4/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ED14/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2EE34/4, 0x1); + INSTANCE_WR(ctx, 0x2EEB4/4, 0x1); + INSTANCE_WR(ctx, 0x2EF74/4, 0x1); + INSTANCE_WR(ctx, 0x2F114/4, 0x1); + INSTANCE_WR(ctx, 0x2F134/4, 0x1); + INSTANCE_WR(ctx, 0x2F154/4, 0x2); + INSTANCE_WR(ctx, 0x2F174/4, 0x1); + INSTANCE_WR(ctx, 0x2F194/4, 0x1); + INSTANCE_WR(ctx, 0x2F1B4/4, 0x2); + INSTANCE_WR(ctx, 0x2F1D4/4, 0x1); + INSTANCE_WR(ctx, 0x2F214/4, 0x11); + INSTANCE_WR(ctx, 0x2F314/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2F374/4, 0x4); + INSTANCE_WR(ctx, 0x2F3F4/4, 0x11); + INSTANCE_WR(ctx, 0x2F414/4, 0x1); + INSTANCE_WR(ctx, 0x2F454/4, 0xCF); + INSTANCE_WR(ctx, 0x2F474/4, 0xCF); + INSTANCE_WR(ctx, 0x2F494/4, 0xCF); + INSTANCE_WR(ctx, 0x2F5F4/4, 0x1); + INSTANCE_WR(ctx, 0x2F614/4, 0x1); + INSTANCE_WR(ctx, 0x2F634/4, 0x2); + INSTANCE_WR(ctx, 0x2F654/4, 0x1); + INSTANCE_WR(ctx, 0x2F674/4, 0x1); + INSTANCE_WR(ctx, 0x2F694/4, 0x2); + INSTANCE_WR(ctx, 0x2F6B4/4, 0x1); + INSTANCE_WR(ctx, 0x2F6F4/4, 0x1); + INSTANCE_WR(ctx, 0x2F714/4, 0x1); + INSTANCE_WR(ctx, 0x2F734/4, 0x1); + INSTANCE_WR(ctx, 0x2F754/4, 0x1); + INSTANCE_WR(ctx, 0x2F774/4, 0x1); + INSTANCE_WR(ctx, 0x2F794/4, 0x1); + INSTANCE_WR(ctx, 0x2F7B4/4, 0x1); + INSTANCE_WR(ctx, 0x2F7D4/4, 0x1); + INSTANCE_WR(ctx, 0x2F7F4/4, 0x11); + INSTANCE_WR(ctx, 0x2F8F4/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2F914/4, 0xF); + INSTANCE_WR(ctx, 0x2FA14/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x2FA74/4, 0x11); + INSTANCE_WR(ctx, 0x2FA94/4, 0x1); + INSTANCE_WR(ctx, 0x2FB14/4, 0x4); + INSTANCE_WR(ctx, 0x2FBD4/4, 0x1); + INSTANCE_WR(ctx, 0x2FC74/4, 0x11); + INSTANCE_WR(ctx, 0x2FD74/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2FDF4/4, 0x11); + INSTANCE_WR(ctx, 0x2FE14/4, 0x1); + INSTANCE_WR(ctx, 0x2FE54/4, 0x1); + INSTANCE_WR(ctx, 0x2FE94/4, 0x1); + INSTANCE_WR(ctx, 0x2FED4/4, 0x7FF); + INSTANCE_WR(ctx, 0x2FF14/4, 0x1); + INSTANCE_WR(ctx, 0x2FF54/4, 0x1); + INSTANCE_WR(ctx, 0x304B4/4, 0x8); + INSTANCE_WR(ctx, 0x304D4/4, 0x8); + INSTANCE_WR(ctx, 0x304F4/4, 0x8); + INSTANCE_WR(ctx, 0x30514/4, 0x8); + INSTANCE_WR(ctx, 0x30534/4, 0x8); + INSTANCE_WR(ctx, 0x30554/4, 0x8); + INSTANCE_WR(ctx, 0x30574/4, 0x8); + INSTANCE_WR(ctx, 0x30594/4, 0x8); + INSTANCE_WR(ctx, 0x305B4/4, 0x11); + INSTANCE_WR(ctx, 0x306B4/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x306D4/4, 0x400); + INSTANCE_WR(ctx, 0x306F4/4, 0x400); + INSTANCE_WR(ctx, 0x30714/4, 0x400); + INSTANCE_WR(ctx, 0x30734/4, 0x400); + INSTANCE_WR(ctx, 0x30754/4, 0x400); + INSTANCE_WR(ctx, 0x30774/4, 0x400); + INSTANCE_WR(ctx, 0x30794/4, 0x400); + INSTANCE_WR(ctx, 0x307B4/4, 0x400); + INSTANCE_WR(ctx, 0x307D4/4, 0x300); + INSTANCE_WR(ctx, 0x307F4/4, 0x300); + INSTANCE_WR(ctx, 0x30814/4, 0x300); + INSTANCE_WR(ctx, 0x30834/4, 0x300); + INSTANCE_WR(ctx, 0x30854/4, 0x300); + INSTANCE_WR(ctx, 0x30874/4, 0x300); + INSTANCE_WR(ctx, 0x30894/4, 0x300); + INSTANCE_WR(ctx, 0x308B4/4, 0x300); + INSTANCE_WR(ctx, 0x308D4/4, 0x1); + INSTANCE_WR(ctx, 0x308F4/4, 0xF); + INSTANCE_WR(ctx, 0x309F4/4, 0x20); + INSTANCE_WR(ctx, 0x30A14/4, 0x11); + INSTANCE_WR(ctx, 0x30A34/4, 0x100); + INSTANCE_WR(ctx, 0x30A74/4, 0x1); + INSTANCE_WR(ctx, 0x30AD4/4, 0x40); + INSTANCE_WR(ctx, 0x30AF4/4, 0x100); + INSTANCE_WR(ctx, 0x30B34/4, 0x3); + INSTANCE_WR(ctx, 0x30BD4/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x30C54/4, 0x2); + INSTANCE_WR(ctx, 0x30C74/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x30DB4/4, 0x1); + INSTANCE_WR(ctx, 0x30E54/4, 0x4); + INSTANCE_WR(ctx, 0x30E94/4, 0x1); + INSTANCE_WR(ctx, 0x30EB4/4, 0x400); + INSTANCE_WR(ctx, 0x30ED4/4, 0x300); + INSTANCE_WR(ctx, 0x30EF4/4, 0x1001); + INSTANCE_WR(ctx, 0x30F74/4, 0x11); + INSTANCE_WR(ctx, 0x31074/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x31094/4, 0xF); + INSTANCE_WR(ctx, 0x31394/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x31414/4, 0x11); + INSTANCE_WR(ctx, 0x31474/4, 0x4); + INSTANCE_WR(ctx, 0x314B4/4, 0x1); + INSTANCE_WR(ctx, 0x314D4/4, 0x1); + INSTANCE_WR(ctx, 0x31554/4, 0x1); + INSTANCE_WR(ctx, 0x315F4/4, 0x1); + INSTANCE_WR(ctx, 0x31634/4, 0x1); + INSTANCE_WR(ctx, 0x316B4/4, 0x2A712488); + INSTANCE_WR(ctx, 0x316F4/4, 0x4085C000); + INSTANCE_WR(ctx, 0x31714/4, 0x40); + INSTANCE_WR(ctx, 0x31734/4, 0x100); + INSTANCE_WR(ctx, 0x31754/4, 0x10100); + INSTANCE_WR(ctx, 0x31774/4, 0x2800000); + INSTANCE_WR(ctx, 0x319D4/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x319F4/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x31A14/4, 0x1); + INSTANCE_WR(ctx, 0x31A54/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x31A74/4, 0x1); + INSTANCE_WR(ctx, 0x31AD4/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x31BF4/4, 0x1); + INSTANCE_WR(ctx, 0x31C34/4, 0x1); + INSTANCE_WR(ctx, 0x31C54/4, 0x30201000); + INSTANCE_WR(ctx, 0x31C74/4, 0x70605040); + INSTANCE_WR(ctx, 0x31C94/4, 0xB8A89888); + INSTANCE_WR(ctx, 0x31CB4/4, 0xF8E8D8C8); + INSTANCE_WR(ctx, 0x31CF4/4, 0x1A); + INSTANCE_WR(ctx, 0x1538/4, 0x4); + INSTANCE_WR(ctx, 0x17F8/4, 0x4); + INSTANCE_WR(ctx, 0x1818/4, 0x4); + INSTANCE_WR(ctx, 0x1838/4, 0x608080); + INSTANCE_WR(ctx, 0x18D8/4, 0x4); + INSTANCE_WR(ctx, 0x1938/4, 0x4); + INSTANCE_WR(ctx, 0x1958/4, 0x4); + INSTANCE_WR(ctx, 0x1978/4, 0x80); + INSTANCE_WR(ctx, 0x1998/4, 0x4); + INSTANCE_WR(ctx, 0x1E38/4, 0x4); + INSTANCE_WR(ctx, 0x1E58/4, 0x80); + INSTANCE_WR(ctx, 0x1E78/4, 0x4); + INSTANCE_WR(ctx, 0x1E98/4, 0x3020100); + INSTANCE_WR(ctx, 0x1EB8/4, 0x3); + INSTANCE_WR(ctx, 0x1ED8/4, 0x4); + INSTANCE_WR(ctx, 0x1F78/4, 0x4); + INSTANCE_WR(ctx, 0x1F98/4, 0x3); + INSTANCE_WR(ctx, 0x2018/4, 0x4); + INSTANCE_WR(ctx, 0x164B8/4, 0x4); + INSTANCE_WR(ctx, 0x164D8/4, 0x3); + INSTANCE_WR(ctx, 0x16718/4, 0xF); + INSTANCE_WR(ctx, 0x16898/4, 0x4); + INSTANCE_WR(ctx, 0x168B8/4, 0xFFFF); + INSTANCE_WR(ctx, 0x168D8/4, 0xFFFF); + INSTANCE_WR(ctx, 0x168F8/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16918/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16A38/4, 0x1); + INSTANCE_WR(ctx, 0x16AB8/4, 0x1); + INSTANCE_WR(ctx, 0x16B78/4, 0x1); + INSTANCE_WR(ctx, 0x16D18/4, 0x1); + INSTANCE_WR(ctx, 0x16D38/4, 0x1); + INSTANCE_WR(ctx, 0x16D58/4, 0x2); + INSTANCE_WR(ctx, 0x16D78/4, 0x1); + INSTANCE_WR(ctx, 0x16D98/4, 0x1); + INSTANCE_WR(ctx, 0x16DB8/4, 0x2); + INSTANCE_WR(ctx, 0x16DD8/4, 0x1); + INSTANCE_WR(ctx, 0x16E18/4, 0x11); + INSTANCE_WR(ctx, 0x16F18/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x16F78/4, 0x4); + INSTANCE_WR(ctx, 0x16FF8/4, 0x11); + INSTANCE_WR(ctx, 0x17018/4, 0x1); + INSTANCE_WR(ctx, 0x17058/4, 0xCF); + INSTANCE_WR(ctx, 0x17078/4, 0xCF); + INSTANCE_WR(ctx, 0x17098/4, 0xCF); + INSTANCE_WR(ctx, 0x171F8/4, 0x1); + INSTANCE_WR(ctx, 0x17218/4, 0x1); + INSTANCE_WR(ctx, 0x17238/4, 0x2); + INSTANCE_WR(ctx, 0x17258/4, 0x1); + INSTANCE_WR(ctx, 0x17278/4, 0x1); + INSTANCE_WR(ctx, 0x17298/4, 0x2); + INSTANCE_WR(ctx, 0x172B8/4, 0x1); + INSTANCE_WR(ctx, 0x172F8/4, 0x1); + INSTANCE_WR(ctx, 0x17318/4, 0x1); + INSTANCE_WR(ctx, 0x17338/4, 0x1); + INSTANCE_WR(ctx, 0x17358/4, 0x1); + INSTANCE_WR(ctx, 0x17378/4, 0x1); + INSTANCE_WR(ctx, 0x17398/4, 0x1); + INSTANCE_WR(ctx, 0x173B8/4, 0x1); + INSTANCE_WR(ctx, 0x173D8/4, 0x1); + INSTANCE_WR(ctx, 0x173F8/4, 0x11); + INSTANCE_WR(ctx, 0x174F8/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x17518/4, 0xF); + INSTANCE_WR(ctx, 0x17618/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x17678/4, 0x11); + INSTANCE_WR(ctx, 0x17698/4, 0x1); + INSTANCE_WR(ctx, 0x17718/4, 0x4); + INSTANCE_WR(ctx, 0x177D8/4, 0x1); + INSTANCE_WR(ctx, 0x17878/4, 0x11); + INSTANCE_WR(ctx, 0x17978/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x179F8/4, 0x11); + INSTANCE_WR(ctx, 0x17A18/4, 0x1); + INSTANCE_WR(ctx, 0x17A58/4, 0x1); + INSTANCE_WR(ctx, 0x17A98/4, 0x1); + INSTANCE_WR(ctx, 0x17AD8/4, 0x7FF); + INSTANCE_WR(ctx, 0x17B18/4, 0x1); + INSTANCE_WR(ctx, 0x17B58/4, 0x1); + INSTANCE_WR(ctx, 0x180B8/4, 0x8); + INSTANCE_WR(ctx, 0x180D8/4, 0x8); + INSTANCE_WR(ctx, 0x180F8/4, 0x8); + INSTANCE_WR(ctx, 0x18118/4, 0x8); + INSTANCE_WR(ctx, 0x18138/4, 0x8); + INSTANCE_WR(ctx, 0x18158/4, 0x8); + INSTANCE_WR(ctx, 0x18178/4, 0x8); + INSTANCE_WR(ctx, 0x18198/4, 0x8); + INSTANCE_WR(ctx, 0x181B8/4, 0x11); + INSTANCE_WR(ctx, 0x182B8/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x182D8/4, 0x400); + INSTANCE_WR(ctx, 0x182F8/4, 0x400); + INSTANCE_WR(ctx, 0x18318/4, 0x400); + INSTANCE_WR(ctx, 0x18338/4, 0x400); + INSTANCE_WR(ctx, 0x18358/4, 0x400); + INSTANCE_WR(ctx, 0x18378/4, 0x400); + INSTANCE_WR(ctx, 0x18398/4, 0x400); + INSTANCE_WR(ctx, 0x183B8/4, 0x400); + INSTANCE_WR(ctx, 0x183D8/4, 0x300); + INSTANCE_WR(ctx, 0x183F8/4, 0x300); + INSTANCE_WR(ctx, 0x18418/4, 0x300); + INSTANCE_WR(ctx, 0x18438/4, 0x300); + INSTANCE_WR(ctx, 0x18458/4, 0x300); + INSTANCE_WR(ctx, 0x18478/4, 0x300); + INSTANCE_WR(ctx, 0x18498/4, 0x300); + INSTANCE_WR(ctx, 0x184B8/4, 0x300); + INSTANCE_WR(ctx, 0x184D8/4, 0x1); + INSTANCE_WR(ctx, 0x184F8/4, 0xF); + INSTANCE_WR(ctx, 0x185F8/4, 0x20); + INSTANCE_WR(ctx, 0x18618/4, 0x11); + INSTANCE_WR(ctx, 0x18638/4, 0x100); + INSTANCE_WR(ctx, 0x18678/4, 0x1); + INSTANCE_WR(ctx, 0x186D8/4, 0x40); + INSTANCE_WR(ctx, 0x186F8/4, 0x100); + INSTANCE_WR(ctx, 0x18738/4, 0x3); + INSTANCE_WR(ctx, 0x187D8/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x18858/4, 0x2); + INSTANCE_WR(ctx, 0x18878/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x189B8/4, 0x1); + INSTANCE_WR(ctx, 0x18A58/4, 0x4); + INSTANCE_WR(ctx, 0x18A98/4, 0x1); + INSTANCE_WR(ctx, 0x18AB8/4, 0x400); + INSTANCE_WR(ctx, 0x18AD8/4, 0x300); + INSTANCE_WR(ctx, 0x18AF8/4, 0x1001); + INSTANCE_WR(ctx, 0x18B78/4, 0x11); + INSTANCE_WR(ctx, 0x18C78/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x18C98/4, 0xF); + INSTANCE_WR(ctx, 0x18F98/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x19018/4, 0x11); + INSTANCE_WR(ctx, 0x19078/4, 0x4); + INSTANCE_WR(ctx, 0x190B8/4, 0x1); + INSTANCE_WR(ctx, 0x190D8/4, 0x1); + INSTANCE_WR(ctx, 0x19158/4, 0x1); + INSTANCE_WR(ctx, 0x191F8/4, 0x1); + INSTANCE_WR(ctx, 0x19238/4, 0x1); + INSTANCE_WR(ctx, 0x192B8/4, 0x2A712488); + INSTANCE_WR(ctx, 0x192F8/4, 0x4085C000); + INSTANCE_WR(ctx, 0x19318/4, 0x40); + INSTANCE_WR(ctx, 0x19338/4, 0x100); + INSTANCE_WR(ctx, 0x19358/4, 0x10100); + INSTANCE_WR(ctx, 0x19378/4, 0x2800000); + INSTANCE_WR(ctx, 0x195D8/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x195F8/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x19618/4, 0x1); + INSTANCE_WR(ctx, 0x19658/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x19678/4, 0x1); + INSTANCE_WR(ctx, 0x196D8/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x197F8/4, 0x1); + INSTANCE_WR(ctx, 0x19838/4, 0x1); + INSTANCE_WR(ctx, 0x19858/4, 0x30201000); + INSTANCE_WR(ctx, 0x19878/4, 0x70605040); + INSTANCE_WR(ctx, 0x19898/4, 0xB8A89888); + INSTANCE_WR(ctx, 0x198B8/4, 0xF8E8D8C8); + INSTANCE_WR(ctx, 0x198F8/4, 0x1A); + INSTANCE_WR(ctx, 0x19938/4, 0x4); + INSTANCE_WR(ctx, 0x19BF8/4, 0x4); + INSTANCE_WR(ctx, 0x19C18/4, 0x4); + INSTANCE_WR(ctx, 0x19C38/4, 0x608080); + INSTANCE_WR(ctx, 0x19CD8/4, 0x4); + INSTANCE_WR(ctx, 0x19D38/4, 0x4); + INSTANCE_WR(ctx, 0x19D58/4, 0x4); + INSTANCE_WR(ctx, 0x19D78/4, 0x80); + INSTANCE_WR(ctx, 0x19D98/4, 0x4); + INSTANCE_WR(ctx, 0x1A238/4, 0x4); + INSTANCE_WR(ctx, 0x1A258/4, 0x80); + INSTANCE_WR(ctx, 0x1A278/4, 0x4); + INSTANCE_WR(ctx, 0x1A298/4, 0x3020100); + INSTANCE_WR(ctx, 0x1A2B8/4, 0x3); + INSTANCE_WR(ctx, 0x1A2D8/4, 0x4); + INSTANCE_WR(ctx, 0x1A378/4, 0x4); + INSTANCE_WR(ctx, 0x1A398/4, 0x3); + INSTANCE_WR(ctx, 0x1A418/4, 0x4); + INSTANCE_WR(ctx, 0x2E8B8/4, 0x4); + INSTANCE_WR(ctx, 0x2E8D8/4, 0x3); + INSTANCE_WR(ctx, 0x2EB18/4, 0xF); + INSTANCE_WR(ctx, 0x2EC98/4, 0x4); + INSTANCE_WR(ctx, 0x2ECB8/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ECD8/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ECF8/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ED18/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2EE38/4, 0x1); + INSTANCE_WR(ctx, 0x2EEB8/4, 0x1); + INSTANCE_WR(ctx, 0x2EF78/4, 0x1); + INSTANCE_WR(ctx, 0x2F118/4, 0x1); + INSTANCE_WR(ctx, 0x2F138/4, 0x1); + INSTANCE_WR(ctx, 0x2F158/4, 0x2); + INSTANCE_WR(ctx, 0x2F178/4, 0x1); + INSTANCE_WR(ctx, 0x2F198/4, 0x1); + INSTANCE_WR(ctx, 0x2F1B8/4, 0x2); + INSTANCE_WR(ctx, 0x2F1D8/4, 0x1); + INSTANCE_WR(ctx, 0x2F218/4, 0x11); + INSTANCE_WR(ctx, 0x2F318/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2F378/4, 0x4); + INSTANCE_WR(ctx, 0x2F3F8/4, 0x11); + INSTANCE_WR(ctx, 0x2F418/4, 0x1); + INSTANCE_WR(ctx, 0x2F458/4, 0xCF); + INSTANCE_WR(ctx, 0x2F478/4, 0xCF); + INSTANCE_WR(ctx, 0x2F498/4, 0xCF); + INSTANCE_WR(ctx, 0x2F5F8/4, 0x1); + INSTANCE_WR(ctx, 0x2F618/4, 0x1); + INSTANCE_WR(ctx, 0x2F638/4, 0x2); + INSTANCE_WR(ctx, 0x2F658/4, 0x1); + INSTANCE_WR(ctx, 0x2F678/4, 0x1); + INSTANCE_WR(ctx, 0x2F698/4, 0x2); + INSTANCE_WR(ctx, 0x2F6B8/4, 0x1); + INSTANCE_WR(ctx, 0x2F6F8/4, 0x1); + INSTANCE_WR(ctx, 0x2F718/4, 0x1); + INSTANCE_WR(ctx, 0x2F738/4, 0x1); + INSTANCE_WR(ctx, 0x2F758/4, 0x1); + INSTANCE_WR(ctx, 0x2F778/4, 0x1); + INSTANCE_WR(ctx, 0x2F798/4, 0x1); + INSTANCE_WR(ctx, 0x2F7B8/4, 0x1); + INSTANCE_WR(ctx, 0x2F7D8/4, 0x1); + INSTANCE_WR(ctx, 0x2F7F8/4, 0x11); + INSTANCE_WR(ctx, 0x2F8F8/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2F918/4, 0xF); + INSTANCE_WR(ctx, 0x2FA18/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x2FA78/4, 0x11); + INSTANCE_WR(ctx, 0x2FA98/4, 0x1); + INSTANCE_WR(ctx, 0x2FB18/4, 0x4); + INSTANCE_WR(ctx, 0x2FBD8/4, 0x1); + INSTANCE_WR(ctx, 0x2FC78/4, 0x11); + INSTANCE_WR(ctx, 0x2FD78/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2FDF8/4, 0x11); + INSTANCE_WR(ctx, 0x2FE18/4, 0x1); + INSTANCE_WR(ctx, 0x2FE58/4, 0x1); + INSTANCE_WR(ctx, 0x2FE98/4, 0x1); + INSTANCE_WR(ctx, 0x2FED8/4, 0x7FF); + INSTANCE_WR(ctx, 0x2FF18/4, 0x1); + INSTANCE_WR(ctx, 0x2FF58/4, 0x1); + INSTANCE_WR(ctx, 0x304B8/4, 0x8); + INSTANCE_WR(ctx, 0x304D8/4, 0x8); + INSTANCE_WR(ctx, 0x304F8/4, 0x8); + INSTANCE_WR(ctx, 0x30518/4, 0x8); + INSTANCE_WR(ctx, 0x30538/4, 0x8); + INSTANCE_WR(ctx, 0x30558/4, 0x8); + INSTANCE_WR(ctx, 0x30578/4, 0x8); + INSTANCE_WR(ctx, 0x30598/4, 0x8); + INSTANCE_WR(ctx, 0x305B8/4, 0x11); + INSTANCE_WR(ctx, 0x306B8/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x306D8/4, 0x400); + INSTANCE_WR(ctx, 0x306F8/4, 0x400); + INSTANCE_WR(ctx, 0x30718/4, 0x400); + INSTANCE_WR(ctx, 0x30738/4, 0x400); + INSTANCE_WR(ctx, 0x30758/4, 0x400); + INSTANCE_WR(ctx, 0x30778/4, 0x400); + INSTANCE_WR(ctx, 0x30798/4, 0x400); + INSTANCE_WR(ctx, 0x307B8/4, 0x400); + INSTANCE_WR(ctx, 0x307D8/4, 0x300); + INSTANCE_WR(ctx, 0x307F8/4, 0x300); + INSTANCE_WR(ctx, 0x30818/4, 0x300); + INSTANCE_WR(ctx, 0x30838/4, 0x300); + INSTANCE_WR(ctx, 0x30858/4, 0x300); + INSTANCE_WR(ctx, 0x30878/4, 0x300); + INSTANCE_WR(ctx, 0x30898/4, 0x300); + INSTANCE_WR(ctx, 0x308B8/4, 0x300); + INSTANCE_WR(ctx, 0x308D8/4, 0x1); + INSTANCE_WR(ctx, 0x308F8/4, 0xF); + INSTANCE_WR(ctx, 0x309F8/4, 0x20); + INSTANCE_WR(ctx, 0x30A18/4, 0x11); + INSTANCE_WR(ctx, 0x30A38/4, 0x100); + INSTANCE_WR(ctx, 0x30A78/4, 0x1); + INSTANCE_WR(ctx, 0x30AD8/4, 0x40); + INSTANCE_WR(ctx, 0x30AF8/4, 0x100); + INSTANCE_WR(ctx, 0x30B38/4, 0x3); + INSTANCE_WR(ctx, 0x30BD8/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x30C58/4, 0x2); + INSTANCE_WR(ctx, 0x30C78/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x30DB8/4, 0x1); + INSTANCE_WR(ctx, 0x30E58/4, 0x4); + INSTANCE_WR(ctx, 0x30E98/4, 0x1); + INSTANCE_WR(ctx, 0x30EB8/4, 0x400); + INSTANCE_WR(ctx, 0x30ED8/4, 0x300); + INSTANCE_WR(ctx, 0x30EF8/4, 0x1001); + INSTANCE_WR(ctx, 0x30F78/4, 0x11); + INSTANCE_WR(ctx, 0x31078/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x31098/4, 0xF); + INSTANCE_WR(ctx, 0x31398/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x31418/4, 0x11); + INSTANCE_WR(ctx, 0x31478/4, 0x4); + INSTANCE_WR(ctx, 0x314B8/4, 0x1); + INSTANCE_WR(ctx, 0x314D8/4, 0x1); + INSTANCE_WR(ctx, 0x31558/4, 0x1); + INSTANCE_WR(ctx, 0x315F8/4, 0x1); + INSTANCE_WR(ctx, 0x31638/4, 0x1); + INSTANCE_WR(ctx, 0x316B8/4, 0x2A712488); + INSTANCE_WR(ctx, 0x316F8/4, 0x4085C000); + INSTANCE_WR(ctx, 0x31718/4, 0x40); + INSTANCE_WR(ctx, 0x31738/4, 0x100); + INSTANCE_WR(ctx, 0x31758/4, 0x10100); + INSTANCE_WR(ctx, 0x31778/4, 0x2800000); + INSTANCE_WR(ctx, 0x319D8/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x319F8/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x31A18/4, 0x1); + INSTANCE_WR(ctx, 0x31A58/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x31A78/4, 0x1); + INSTANCE_WR(ctx, 0x31AD8/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x31BF8/4, 0x1); + INSTANCE_WR(ctx, 0x31C38/4, 0x1); + INSTANCE_WR(ctx, 0x31C58/4, 0x30201000); + INSTANCE_WR(ctx, 0x31C78/4, 0x70605040); + INSTANCE_WR(ctx, 0x31C98/4, 0xB8A89888); + INSTANCE_WR(ctx, 0x31CB8/4, 0xF8E8D8C8); + INSTANCE_WR(ctx, 0x31CF8/4, 0x1A); + INSTANCE_WR(ctx, 0x153C/4, 0x4); + INSTANCE_WR(ctx, 0x17FC/4, 0x4); + INSTANCE_WR(ctx, 0x181C/4, 0x4); + INSTANCE_WR(ctx, 0x183C/4, 0x608080); + INSTANCE_WR(ctx, 0x18DC/4, 0x4); + INSTANCE_WR(ctx, 0x193C/4, 0x4); + INSTANCE_WR(ctx, 0x195C/4, 0x4); + INSTANCE_WR(ctx, 0x197C/4, 0x80); + INSTANCE_WR(ctx, 0x199C/4, 0x4); + INSTANCE_WR(ctx, 0x1E3C/4, 0x4); + INSTANCE_WR(ctx, 0x1E5C/4, 0x80); + INSTANCE_WR(ctx, 0x1E7C/4, 0x4); + INSTANCE_WR(ctx, 0x1E9C/4, 0x3020100); + INSTANCE_WR(ctx, 0x1EBC/4, 0x3); + INSTANCE_WR(ctx, 0x1EDC/4, 0x4); + INSTANCE_WR(ctx, 0x1F7C/4, 0x4); + INSTANCE_WR(ctx, 0x1F9C/4, 0x3); + INSTANCE_WR(ctx, 0x201C/4, 0x4); + INSTANCE_WR(ctx, 0x164BC/4, 0x4); + INSTANCE_WR(ctx, 0x164DC/4, 0x3); + INSTANCE_WR(ctx, 0x1671C/4, 0xF); + INSTANCE_WR(ctx, 0x1689C/4, 0x4); + INSTANCE_WR(ctx, 0x168BC/4, 0xFFFF); + INSTANCE_WR(ctx, 0x168DC/4, 0xFFFF); + INSTANCE_WR(ctx, 0x168FC/4, 0xFFFF); + INSTANCE_WR(ctx, 0x1691C/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16A3C/4, 0x1); + INSTANCE_WR(ctx, 0x16ABC/4, 0x1); + INSTANCE_WR(ctx, 0x16B7C/4, 0x1); + INSTANCE_WR(ctx, 0x16D1C/4, 0x1); + INSTANCE_WR(ctx, 0x16D3C/4, 0x1); + INSTANCE_WR(ctx, 0x16D5C/4, 0x2); + INSTANCE_WR(ctx, 0x16D7C/4, 0x1); + INSTANCE_WR(ctx, 0x16D9C/4, 0x1); + INSTANCE_WR(ctx, 0x16DBC/4, 0x2); + INSTANCE_WR(ctx, 0x16DDC/4, 0x1); + INSTANCE_WR(ctx, 0x16E1C/4, 0x11); + INSTANCE_WR(ctx, 0x16F1C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x16F7C/4, 0x4); + INSTANCE_WR(ctx, 0x16FFC/4, 0x11); + INSTANCE_WR(ctx, 0x1701C/4, 0x1); + INSTANCE_WR(ctx, 0x1705C/4, 0xCF); + INSTANCE_WR(ctx, 0x1707C/4, 0xCF); + INSTANCE_WR(ctx, 0x1709C/4, 0xCF); + INSTANCE_WR(ctx, 0x171FC/4, 0x1); + INSTANCE_WR(ctx, 0x1721C/4, 0x1); + INSTANCE_WR(ctx, 0x1723C/4, 0x2); + INSTANCE_WR(ctx, 0x1725C/4, 0x1); + INSTANCE_WR(ctx, 0x1727C/4, 0x1); + INSTANCE_WR(ctx, 0x1729C/4, 0x2); + INSTANCE_WR(ctx, 0x172BC/4, 0x1); + INSTANCE_WR(ctx, 0x172FC/4, 0x1); + INSTANCE_WR(ctx, 0x1731C/4, 0x1); + INSTANCE_WR(ctx, 0x1733C/4, 0x1); + INSTANCE_WR(ctx, 0x1735C/4, 0x1); + INSTANCE_WR(ctx, 0x1737C/4, 0x1); + INSTANCE_WR(ctx, 0x1739C/4, 0x1); + INSTANCE_WR(ctx, 0x173BC/4, 0x1); + INSTANCE_WR(ctx, 0x173DC/4, 0x1); + INSTANCE_WR(ctx, 0x173FC/4, 0x11); + INSTANCE_WR(ctx, 0x174FC/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x1751C/4, 0xF); + INSTANCE_WR(ctx, 0x1761C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x1767C/4, 0x11); + INSTANCE_WR(ctx, 0x1769C/4, 0x1); + INSTANCE_WR(ctx, 0x1771C/4, 0x4); + INSTANCE_WR(ctx, 0x177DC/4, 0x1); + INSTANCE_WR(ctx, 0x1787C/4, 0x11); + INSTANCE_WR(ctx, 0x1797C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x179FC/4, 0x11); + INSTANCE_WR(ctx, 0x17A1C/4, 0x1); + INSTANCE_WR(ctx, 0x17A5C/4, 0x1); + INSTANCE_WR(ctx, 0x17A9C/4, 0x1); + INSTANCE_WR(ctx, 0x17ADC/4, 0x7FF); + INSTANCE_WR(ctx, 0x17B1C/4, 0x1); + INSTANCE_WR(ctx, 0x17B5C/4, 0x1); + INSTANCE_WR(ctx, 0x180BC/4, 0x8); + INSTANCE_WR(ctx, 0x180DC/4, 0x8); + INSTANCE_WR(ctx, 0x180FC/4, 0x8); + INSTANCE_WR(ctx, 0x1811C/4, 0x8); + INSTANCE_WR(ctx, 0x1813C/4, 0x8); + INSTANCE_WR(ctx, 0x1815C/4, 0x8); + INSTANCE_WR(ctx, 0x1817C/4, 0x8); + INSTANCE_WR(ctx, 0x1819C/4, 0x8); + INSTANCE_WR(ctx, 0x181BC/4, 0x11); + INSTANCE_WR(ctx, 0x182BC/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x182DC/4, 0x400); + INSTANCE_WR(ctx, 0x182FC/4, 0x400); + INSTANCE_WR(ctx, 0x1831C/4, 0x400); + INSTANCE_WR(ctx, 0x1833C/4, 0x400); + INSTANCE_WR(ctx, 0x1835C/4, 0x400); + INSTANCE_WR(ctx, 0x1837C/4, 0x400); + INSTANCE_WR(ctx, 0x1839C/4, 0x400); + INSTANCE_WR(ctx, 0x183BC/4, 0x400); + INSTANCE_WR(ctx, 0x183DC/4, 0x300); + INSTANCE_WR(ctx, 0x183FC/4, 0x300); + INSTANCE_WR(ctx, 0x1841C/4, 0x300); + INSTANCE_WR(ctx, 0x1843C/4, 0x300); + INSTANCE_WR(ctx, 0x1845C/4, 0x300); + INSTANCE_WR(ctx, 0x1847C/4, 0x300); + INSTANCE_WR(ctx, 0x1849C/4, 0x300); + INSTANCE_WR(ctx, 0x184BC/4, 0x300); + INSTANCE_WR(ctx, 0x184DC/4, 0x1); + INSTANCE_WR(ctx, 0x184FC/4, 0xF); + INSTANCE_WR(ctx, 0x185FC/4, 0x20); + INSTANCE_WR(ctx, 0x1861C/4, 0x11); + INSTANCE_WR(ctx, 0x1863C/4, 0x100); + INSTANCE_WR(ctx, 0x1867C/4, 0x1); + INSTANCE_WR(ctx, 0x186DC/4, 0x40); + INSTANCE_WR(ctx, 0x186FC/4, 0x100); + INSTANCE_WR(ctx, 0x1873C/4, 0x3); + INSTANCE_WR(ctx, 0x187DC/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x1885C/4, 0x2); + INSTANCE_WR(ctx, 0x1887C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x189BC/4, 0x1); + INSTANCE_WR(ctx, 0x18A5C/4, 0x4); + INSTANCE_WR(ctx, 0x18A9C/4, 0x1); + INSTANCE_WR(ctx, 0x18ABC/4, 0x400); + INSTANCE_WR(ctx, 0x18ADC/4, 0x300); + INSTANCE_WR(ctx, 0x18AFC/4, 0x1001); + INSTANCE_WR(ctx, 0x18B7C/4, 0x11); + INSTANCE_WR(ctx, 0x18C7C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x18C9C/4, 0xF); + INSTANCE_WR(ctx, 0x18F9C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x1901C/4, 0x11); + INSTANCE_WR(ctx, 0x1907C/4, 0x4); + INSTANCE_WR(ctx, 0x190BC/4, 0x1); + INSTANCE_WR(ctx, 0x190DC/4, 0x1); + INSTANCE_WR(ctx, 0x1915C/4, 0x1); + INSTANCE_WR(ctx, 0x191FC/4, 0x1); + INSTANCE_WR(ctx, 0x1923C/4, 0x1); + INSTANCE_WR(ctx, 0x192BC/4, 0x2A712488); + INSTANCE_WR(ctx, 0x192FC/4, 0x4085C000); + INSTANCE_WR(ctx, 0x1931C/4, 0x40); + INSTANCE_WR(ctx, 0x1933C/4, 0x100); + INSTANCE_WR(ctx, 0x1935C/4, 0x10100); + INSTANCE_WR(ctx, 0x1937C/4, 0x2800000); + INSTANCE_WR(ctx, 0x195DC/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x195FC/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x1961C/4, 0x1); + INSTANCE_WR(ctx, 0x1965C/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x1967C/4, 0x1); + INSTANCE_WR(ctx, 0x196DC/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x197FC/4, 0x1); + INSTANCE_WR(ctx, 0x1983C/4, 0x1); + INSTANCE_WR(ctx, 0x1985C/4, 0x30201000); + INSTANCE_WR(ctx, 0x1987C/4, 0x70605040); + INSTANCE_WR(ctx, 0x1989C/4, 0xB8A89888); + INSTANCE_WR(ctx, 0x198BC/4, 0xF8E8D8C8); + INSTANCE_WR(ctx, 0x198FC/4, 0x1A); + INSTANCE_WR(ctx, 0x1993C/4, 0x4); + INSTANCE_WR(ctx, 0x19BFC/4, 0x4); + INSTANCE_WR(ctx, 0x19C1C/4, 0x4); + INSTANCE_WR(ctx, 0x19C3C/4, 0x608080); + INSTANCE_WR(ctx, 0x19CDC/4, 0x4); + INSTANCE_WR(ctx, 0x19D3C/4, 0x4); + INSTANCE_WR(ctx, 0x19D5C/4, 0x4); + INSTANCE_WR(ctx, 0x19D7C/4, 0x80); + INSTANCE_WR(ctx, 0x19D9C/4, 0x4); + INSTANCE_WR(ctx, 0x1A23C/4, 0x4); + INSTANCE_WR(ctx, 0x1A25C/4, 0x80); + INSTANCE_WR(ctx, 0x1A27C/4, 0x4); + INSTANCE_WR(ctx, 0x1A29C/4, 0x3020100); + INSTANCE_WR(ctx, 0x1A2BC/4, 0x3); + INSTANCE_WR(ctx, 0x1A2DC/4, 0x4); + INSTANCE_WR(ctx, 0x1A37C/4, 0x4); + INSTANCE_WR(ctx, 0x1A39C/4, 0x3); + INSTANCE_WR(ctx, 0x1A41C/4, 0x4); + INSTANCE_WR(ctx, 0x2E8BC/4, 0x4); + INSTANCE_WR(ctx, 0x2E8DC/4, 0x3); + INSTANCE_WR(ctx, 0x2EB1C/4, 0xF); + INSTANCE_WR(ctx, 0x2EC9C/4, 0x4); + INSTANCE_WR(ctx, 0x2ECBC/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ECDC/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ECFC/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2ED1C/4, 0xFFFF); + INSTANCE_WR(ctx, 0x2EE3C/4, 0x1); + INSTANCE_WR(ctx, 0x2EEBC/4, 0x1); + INSTANCE_WR(ctx, 0x2EF7C/4, 0x1); + INSTANCE_WR(ctx, 0x2F11C/4, 0x1); + INSTANCE_WR(ctx, 0x2F13C/4, 0x1); + INSTANCE_WR(ctx, 0x2F15C/4, 0x2); + INSTANCE_WR(ctx, 0x2F17C/4, 0x1); + INSTANCE_WR(ctx, 0x2F19C/4, 0x1); + INSTANCE_WR(ctx, 0x2F1BC/4, 0x2); + INSTANCE_WR(ctx, 0x2F1DC/4, 0x1); + INSTANCE_WR(ctx, 0x2F21C/4, 0x11); + INSTANCE_WR(ctx, 0x2F31C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2F37C/4, 0x4); + INSTANCE_WR(ctx, 0x2F3FC/4, 0x11); + INSTANCE_WR(ctx, 0x2F41C/4, 0x1); + INSTANCE_WR(ctx, 0x2F45C/4, 0xCF); + INSTANCE_WR(ctx, 0x2F47C/4, 0xCF); + INSTANCE_WR(ctx, 0x2F49C/4, 0xCF); + INSTANCE_WR(ctx, 0x2F5FC/4, 0x1); + INSTANCE_WR(ctx, 0x2F61C/4, 0x1); + INSTANCE_WR(ctx, 0x2F63C/4, 0x2); + INSTANCE_WR(ctx, 0x2F65C/4, 0x1); + INSTANCE_WR(ctx, 0x2F67C/4, 0x1); + INSTANCE_WR(ctx, 0x2F69C/4, 0x2); + INSTANCE_WR(ctx, 0x2F6BC/4, 0x1); + INSTANCE_WR(ctx, 0x2F6FC/4, 0x1); + INSTANCE_WR(ctx, 0x2F71C/4, 0x1); + INSTANCE_WR(ctx, 0x2F73C/4, 0x1); + INSTANCE_WR(ctx, 0x2F75C/4, 0x1); + INSTANCE_WR(ctx, 0x2F77C/4, 0x1); + INSTANCE_WR(ctx, 0x2F79C/4, 0x1); + INSTANCE_WR(ctx, 0x2F7BC/4, 0x1); + INSTANCE_WR(ctx, 0x2F7DC/4, 0x1); + INSTANCE_WR(ctx, 0x2F7FC/4, 0x11); + INSTANCE_WR(ctx, 0x2F8FC/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2F91C/4, 0xF); + INSTANCE_WR(ctx, 0x2FA1C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x2FA7C/4, 0x11); + INSTANCE_WR(ctx, 0x2FA9C/4, 0x1); + INSTANCE_WR(ctx, 0x2FB1C/4, 0x4); + INSTANCE_WR(ctx, 0x2FBDC/4, 0x1); + INSTANCE_WR(ctx, 0x2FC7C/4, 0x11); + INSTANCE_WR(ctx, 0x2FD7C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x2FDFC/4, 0x11); + INSTANCE_WR(ctx, 0x2FE1C/4, 0x1); + INSTANCE_WR(ctx, 0x2FE5C/4, 0x1); + INSTANCE_WR(ctx, 0x2FE9C/4, 0x1); + INSTANCE_WR(ctx, 0x2FEDC/4, 0x7FF); + INSTANCE_WR(ctx, 0x2FF1C/4, 0x1); + INSTANCE_WR(ctx, 0x2FF5C/4, 0x1); + INSTANCE_WR(ctx, 0x304BC/4, 0x8); + INSTANCE_WR(ctx, 0x304DC/4, 0x8); + INSTANCE_WR(ctx, 0x304FC/4, 0x8); + INSTANCE_WR(ctx, 0x3051C/4, 0x8); + INSTANCE_WR(ctx, 0x3053C/4, 0x8); + INSTANCE_WR(ctx, 0x3055C/4, 0x8); + INSTANCE_WR(ctx, 0x3057C/4, 0x8); + INSTANCE_WR(ctx, 0x3059C/4, 0x8); + INSTANCE_WR(ctx, 0x305BC/4, 0x11); + INSTANCE_WR(ctx, 0x306BC/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x306DC/4, 0x400); + INSTANCE_WR(ctx, 0x306FC/4, 0x400); + INSTANCE_WR(ctx, 0x3071C/4, 0x400); + INSTANCE_WR(ctx, 0x3073C/4, 0x400); + INSTANCE_WR(ctx, 0x3075C/4, 0x400); + INSTANCE_WR(ctx, 0x3077C/4, 0x400); + INSTANCE_WR(ctx, 0x3079C/4, 0x400); + INSTANCE_WR(ctx, 0x307BC/4, 0x400); + INSTANCE_WR(ctx, 0x307DC/4, 0x300); + INSTANCE_WR(ctx, 0x307FC/4, 0x300); + INSTANCE_WR(ctx, 0x3081C/4, 0x300); + INSTANCE_WR(ctx, 0x3083C/4, 0x300); + INSTANCE_WR(ctx, 0x3085C/4, 0x300); + INSTANCE_WR(ctx, 0x3087C/4, 0x300); + INSTANCE_WR(ctx, 0x3089C/4, 0x300); + INSTANCE_WR(ctx, 0x308BC/4, 0x300); + INSTANCE_WR(ctx, 0x308DC/4, 0x1); + INSTANCE_WR(ctx, 0x308FC/4, 0xF); + INSTANCE_WR(ctx, 0x309FC/4, 0x20); + INSTANCE_WR(ctx, 0x30A1C/4, 0x11); + INSTANCE_WR(ctx, 0x30A3C/4, 0x100); + INSTANCE_WR(ctx, 0x30A7C/4, 0x1); + INSTANCE_WR(ctx, 0x30ADC/4, 0x40); + INSTANCE_WR(ctx, 0x30AFC/4, 0x100); + INSTANCE_WR(ctx, 0x30B3C/4, 0x3); + INSTANCE_WR(ctx, 0x30BDC/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x30C5C/4, 0x2); + INSTANCE_WR(ctx, 0x30C7C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x30DBC/4, 0x1); + INSTANCE_WR(ctx, 0x30E5C/4, 0x4); + INSTANCE_WR(ctx, 0x30E9C/4, 0x1); + INSTANCE_WR(ctx, 0x30EBC/4, 0x400); + INSTANCE_WR(ctx, 0x30EDC/4, 0x300); + INSTANCE_WR(ctx, 0x30EFC/4, 0x1001); + INSTANCE_WR(ctx, 0x30F7C/4, 0x11); + INSTANCE_WR(ctx, 0x3107C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x3109C/4, 0xF); + INSTANCE_WR(ctx, 0x3139C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x3141C/4, 0x11); + INSTANCE_WR(ctx, 0x3147C/4, 0x4); + INSTANCE_WR(ctx, 0x314BC/4, 0x1); + INSTANCE_WR(ctx, 0x314DC/4, 0x1); + INSTANCE_WR(ctx, 0x3155C/4, 0x1); + INSTANCE_WR(ctx, 0x315FC/4, 0x1); + INSTANCE_WR(ctx, 0x3163C/4, 0x1); + INSTANCE_WR(ctx, 0x316BC/4, 0x2A712488); + INSTANCE_WR(ctx, 0x316FC/4, 0x4085C000); + INSTANCE_WR(ctx, 0x3171C/4, 0x40); + INSTANCE_WR(ctx, 0x3173C/4, 0x100); + INSTANCE_WR(ctx, 0x3175C/4, 0x10100); + INSTANCE_WR(ctx, 0x3177C/4, 0x2800000); + INSTANCE_WR(ctx, 0x319DC/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x319FC/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x31A1C/4, 0x1); + INSTANCE_WR(ctx, 0x31A5C/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x31A7C/4, 0x1); + INSTANCE_WR(ctx, 0x31ADC/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x31BFC/4, 0x1); + INSTANCE_WR(ctx, 0x31C3C/4, 0x1); + INSTANCE_WR(ctx, 0x31C5C/4, 0x30201000); + INSTANCE_WR(ctx, 0x31C7C/4, 0x70605040); + INSTANCE_WR(ctx, 0x31C9C/4, 0xB8A89888); + INSTANCE_WR(ctx, 0x31CBC/4, 0xF8E8D8C8); + INSTANCE_WR(ctx, 0x31CFC/4, 0x1A); + INSTANCE_WR(ctx, 0x5D000/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D040/4, 0x80); + INSTANCE_WR(ctx, 0x5D060/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D080/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D0A0/4, 0x1000); + INSTANCE_WR(ctx, 0x5D100/4, 0x1); + INSTANCE_WR(ctx, 0x5D160/4, 0x1); + INSTANCE_WR(ctx, 0x5D1A0/4, 0x4); + INSTANCE_WR(ctx, 0x5D1C0/4, 0x2); + INSTANCE_WR(ctx, 0x5D340/4, 0x80); + INSTANCE_WR(ctx, 0x5D360/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D380/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D3A0/4, 0x1000); + INSTANCE_WR(ctx, 0x5D400/4, 0x1); + INSTANCE_WR(ctx, 0x5D460/4, 0x1); + INSTANCE_WR(ctx, 0x5D4A0/4, 0x4); + INSTANCE_WR(ctx, 0x5D4C0/4, 0x2); + INSTANCE_WR(ctx, 0x5D620/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D700/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D720/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D740/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D760/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D780/4, 0x1); + INSTANCE_WR(ctx, 0x5D7A0/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7C0/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7E0/4, 0x1); + INSTANCE_WR(ctx, 0x5D820/4, 0x1FE21); + INSTANCE_WR(ctx, 0x5D8E0/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D900/4, 0x4); + INSTANCE_WR(ctx, 0x5D940/4, 0x2); + INSTANCE_WR(ctx, 0x5D960/4, 0x11); + INSTANCE_WR(ctx, 0x5DA80/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x5DB20/4, 0x4); + INSTANCE_WR(ctx, 0x5DC60/4, 0x2); + INSTANCE_WR(ctx, 0x5DC80/4, 0x1); + INSTANCE_WR(ctx, 0x5DCA0/4, 0x1); + INSTANCE_WR(ctx, 0x5DCC0/4, 0x2); + INSTANCE_WR(ctx, 0x5DCE0/4, 0x1); + INSTANCE_WR(ctx, 0x5DD00/4, 0x1); + INSTANCE_WR(ctx, 0x5DD20/4, 0x1); + INSTANCE_WR(ctx, 0x5DD60/4, 0x4); + INSTANCE_WR(ctx, 0x651C0/4, 0x11); + INSTANCE_WR(ctx, 0x65200/4, 0x1); + INSTANCE_WR(ctx, 0x5D024/4, 0x80); + INSTANCE_WR(ctx, 0x5D044/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D064/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D084/4, 0x1000); + INSTANCE_WR(ctx, 0x5D0E4/4, 0x1); + INSTANCE_WR(ctx, 0x5D144/4, 0x1); + INSTANCE_WR(ctx, 0x5D184/4, 0x4); + INSTANCE_WR(ctx, 0x5D1A4/4, 0x2); + INSTANCE_WR(ctx, 0x5D324/4, 0x80); + INSTANCE_WR(ctx, 0x5D344/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D364/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D384/4, 0x1000); + INSTANCE_WR(ctx, 0x5D3E4/4, 0x1); + INSTANCE_WR(ctx, 0x5D444/4, 0x1); + INSTANCE_WR(ctx, 0x5D484/4, 0x4); + INSTANCE_WR(ctx, 0x5D4A4/4, 0x2); + INSTANCE_WR(ctx, 0x5D604/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D6E4/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D704/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D724/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D744/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D764/4, 0x1); + INSTANCE_WR(ctx, 0x5D784/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7A4/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7C4/4, 0x1); + INSTANCE_WR(ctx, 0x5D804/4, 0x1FE21); + INSTANCE_WR(ctx, 0x5D8C4/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D8E4/4, 0x4); + INSTANCE_WR(ctx, 0x5D924/4, 0x2); + INSTANCE_WR(ctx, 0x5D944/4, 0x11); + INSTANCE_WR(ctx, 0x5DA64/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x5DB04/4, 0x4); + INSTANCE_WR(ctx, 0x5DC44/4, 0x2); + INSTANCE_WR(ctx, 0x5DC64/4, 0x1); + INSTANCE_WR(ctx, 0x5DC84/4, 0x1); + INSTANCE_WR(ctx, 0x5DCA4/4, 0x2); + INSTANCE_WR(ctx, 0x5DCC4/4, 0x1); + INSTANCE_WR(ctx, 0x5DCE4/4, 0x1); + INSTANCE_WR(ctx, 0x5DD04/4, 0x1); + INSTANCE_WR(ctx, 0x5DD44/4, 0x4); + INSTANCE_WR(ctx, 0x651A4/4, 0x11); + INSTANCE_WR(ctx, 0x651E4/4, 0x1); + INSTANCE_WR(ctx, 0x5D028/4, 0x80); + INSTANCE_WR(ctx, 0x5D048/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D068/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D088/4, 0x1000); + INSTANCE_WR(ctx, 0x5D0E8/4, 0x1); + INSTANCE_WR(ctx, 0x5D148/4, 0x1); + INSTANCE_WR(ctx, 0x5D188/4, 0x4); + INSTANCE_WR(ctx, 0x5D1A8/4, 0x2); + INSTANCE_WR(ctx, 0x5D328/4, 0x80); + INSTANCE_WR(ctx, 0x5D348/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D368/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D388/4, 0x1000); + INSTANCE_WR(ctx, 0x5D3E8/4, 0x1); + INSTANCE_WR(ctx, 0x5D448/4, 0x1); + INSTANCE_WR(ctx, 0x5D488/4, 0x4); + INSTANCE_WR(ctx, 0x5D4A8/4, 0x2); + INSTANCE_WR(ctx, 0x5D608/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D6E8/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D708/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D728/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D748/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D768/4, 0x1); + INSTANCE_WR(ctx, 0x5D788/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7A8/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7C8/4, 0x1); + INSTANCE_WR(ctx, 0x5D808/4, 0x1FE21); + INSTANCE_WR(ctx, 0x5D8C8/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D8E8/4, 0x4); + INSTANCE_WR(ctx, 0x5D928/4, 0x2); + INSTANCE_WR(ctx, 0x5D948/4, 0x11); + INSTANCE_WR(ctx, 0x5DA68/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x5DB08/4, 0x4); + INSTANCE_WR(ctx, 0x5DC48/4, 0x2); + INSTANCE_WR(ctx, 0x5DC68/4, 0x1); + INSTANCE_WR(ctx, 0x5DC88/4, 0x1); + INSTANCE_WR(ctx, 0x5DCA8/4, 0x2); + INSTANCE_WR(ctx, 0x5DCC8/4, 0x1); + INSTANCE_WR(ctx, 0x5DCE8/4, 0x1); + INSTANCE_WR(ctx, 0x5DD08/4, 0x1); + INSTANCE_WR(ctx, 0x5DD48/4, 0x4); + INSTANCE_WR(ctx, 0x651A8/4, 0x11); + INSTANCE_WR(ctx, 0x651E8/4, 0x1); + INSTANCE_WR(ctx, 0x5D02C/4, 0x80); + INSTANCE_WR(ctx, 0x5D04C/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D06C/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D08C/4, 0x1000); + INSTANCE_WR(ctx, 0x5D0EC/4, 0x1); + INSTANCE_WR(ctx, 0x5D14C/4, 0x1); + INSTANCE_WR(ctx, 0x5D18C/4, 0x4); + INSTANCE_WR(ctx, 0x5D1AC/4, 0x2); + INSTANCE_WR(ctx, 0x5D32C/4, 0x80); + INSTANCE_WR(ctx, 0x5D34C/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D36C/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D38C/4, 0x1000); + INSTANCE_WR(ctx, 0x5D3EC/4, 0x1); + INSTANCE_WR(ctx, 0x5D44C/4, 0x1); + INSTANCE_WR(ctx, 0x5D48C/4, 0x4); + INSTANCE_WR(ctx, 0x5D4AC/4, 0x2); + INSTANCE_WR(ctx, 0x5D60C/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D6EC/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D70C/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D72C/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D74C/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D76C/4, 0x1); + INSTANCE_WR(ctx, 0x5D78C/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7AC/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7CC/4, 0x1); + INSTANCE_WR(ctx, 0x5D80C/4, 0x1FE21); + INSTANCE_WR(ctx, 0x5D8CC/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D8EC/4, 0x4); + INSTANCE_WR(ctx, 0x5D92C/4, 0x2); + INSTANCE_WR(ctx, 0x5D94C/4, 0x11); + INSTANCE_WR(ctx, 0x5DA6C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x5DB0C/4, 0x4); + INSTANCE_WR(ctx, 0x5DC4C/4, 0x2); + INSTANCE_WR(ctx, 0x5DC6C/4, 0x1); + INSTANCE_WR(ctx, 0x5DC8C/4, 0x1); + INSTANCE_WR(ctx, 0x5DCAC/4, 0x2); + INSTANCE_WR(ctx, 0x5DCCC/4, 0x1); + INSTANCE_WR(ctx, 0x5DCEC/4, 0x1); + INSTANCE_WR(ctx, 0x5DD0C/4, 0x1); + INSTANCE_WR(ctx, 0x5DD4C/4, 0x4); + INSTANCE_WR(ctx, 0x651AC/4, 0x11); + INSTANCE_WR(ctx, 0x651EC/4, 0x1); + INSTANCE_WR(ctx, 0x5D030/4, 0x80); + INSTANCE_WR(ctx, 0x5D050/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D070/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D090/4, 0x1000); + INSTANCE_WR(ctx, 0x5D0F0/4, 0x1); + INSTANCE_WR(ctx, 0x5D150/4, 0x1); + INSTANCE_WR(ctx, 0x5D190/4, 0x4); + INSTANCE_WR(ctx, 0x5D1B0/4, 0x2); + INSTANCE_WR(ctx, 0x5D330/4, 0x80); + INSTANCE_WR(ctx, 0x5D350/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D370/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D390/4, 0x1000); + INSTANCE_WR(ctx, 0x5D3F0/4, 0x1); + INSTANCE_WR(ctx, 0x5D450/4, 0x1); + INSTANCE_WR(ctx, 0x5D490/4, 0x4); + INSTANCE_WR(ctx, 0x5D4B0/4, 0x2); + INSTANCE_WR(ctx, 0x5D610/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D6F0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D710/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D730/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D750/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D770/4, 0x1); + INSTANCE_WR(ctx, 0x5D790/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7B0/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7D0/4, 0x1); + INSTANCE_WR(ctx, 0x5D810/4, 0x1FE21); + INSTANCE_WR(ctx, 0x5D8D0/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D8F0/4, 0x4); + INSTANCE_WR(ctx, 0x5D930/4, 0x2); + INSTANCE_WR(ctx, 0x5D950/4, 0x11); + INSTANCE_WR(ctx, 0x5DA70/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x5DB10/4, 0x4); + INSTANCE_WR(ctx, 0x5DC50/4, 0x2); + INSTANCE_WR(ctx, 0x5DC70/4, 0x1); + INSTANCE_WR(ctx, 0x5DC90/4, 0x1); + INSTANCE_WR(ctx, 0x5DCB0/4, 0x2); + INSTANCE_WR(ctx, 0x5DCD0/4, 0x1); + INSTANCE_WR(ctx, 0x5DCF0/4, 0x1); + INSTANCE_WR(ctx, 0x5DD10/4, 0x1); + INSTANCE_WR(ctx, 0x5DD50/4, 0x4); + INSTANCE_WR(ctx, 0x651B0/4, 0x11); + INSTANCE_WR(ctx, 0x651F0/4, 0x1); + INSTANCE_WR(ctx, 0x5D034/4, 0x80); + INSTANCE_WR(ctx, 0x5D054/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D074/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D094/4, 0x1000); + INSTANCE_WR(ctx, 0x5D0F4/4, 0x1); + INSTANCE_WR(ctx, 0x5D154/4, 0x1); + INSTANCE_WR(ctx, 0x5D194/4, 0x4); + INSTANCE_WR(ctx, 0x5D1B4/4, 0x2); + INSTANCE_WR(ctx, 0x5D334/4, 0x80); + INSTANCE_WR(ctx, 0x5D354/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D374/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D394/4, 0x1000); + INSTANCE_WR(ctx, 0x5D3F4/4, 0x1); + INSTANCE_WR(ctx, 0x5D454/4, 0x1); + INSTANCE_WR(ctx, 0x5D494/4, 0x4); + INSTANCE_WR(ctx, 0x5D4B4/4, 0x2); + INSTANCE_WR(ctx, 0x5D614/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D6F4/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D714/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D734/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D754/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D774/4, 0x1); + INSTANCE_WR(ctx, 0x5D794/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7B4/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7D4/4, 0x1); + INSTANCE_WR(ctx, 0x5D814/4, 0x1FE21); + INSTANCE_WR(ctx, 0x5D8D4/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D8F4/4, 0x4); + INSTANCE_WR(ctx, 0x5D934/4, 0x2); + INSTANCE_WR(ctx, 0x5D954/4, 0x11); + INSTANCE_WR(ctx, 0x5DA74/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x5DB14/4, 0x4); + INSTANCE_WR(ctx, 0x5DC54/4, 0x2); + INSTANCE_WR(ctx, 0x5DC74/4, 0x1); + INSTANCE_WR(ctx, 0x5DC94/4, 0x1); + INSTANCE_WR(ctx, 0x5DCB4/4, 0x2); + INSTANCE_WR(ctx, 0x5DCD4/4, 0x1); + INSTANCE_WR(ctx, 0x5DCF4/4, 0x1); + INSTANCE_WR(ctx, 0x5DD14/4, 0x1); + INSTANCE_WR(ctx, 0x5DD54/4, 0x4); + INSTANCE_WR(ctx, 0x651B4/4, 0x11); + INSTANCE_WR(ctx, 0x651F4/4, 0x1); + INSTANCE_WR(ctx, 0x5D038/4, 0x80); + INSTANCE_WR(ctx, 0x5D058/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D078/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D098/4, 0x1000); + INSTANCE_WR(ctx, 0x5D0F8/4, 0x1); + INSTANCE_WR(ctx, 0x5D158/4, 0x1); + INSTANCE_WR(ctx, 0x5D198/4, 0x4); + INSTANCE_WR(ctx, 0x5D1B8/4, 0x2); + INSTANCE_WR(ctx, 0x5D338/4, 0x80); + INSTANCE_WR(ctx, 0x5D358/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D378/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D398/4, 0x1000); + INSTANCE_WR(ctx, 0x5D3F8/4, 0x1); + INSTANCE_WR(ctx, 0x5D458/4, 0x1); + INSTANCE_WR(ctx, 0x5D498/4, 0x4); + INSTANCE_WR(ctx, 0x5D4B8/4, 0x2); + INSTANCE_WR(ctx, 0x5D618/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D6F8/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D718/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D738/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D758/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D778/4, 0x1); + INSTANCE_WR(ctx, 0x5D798/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7B8/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7D8/4, 0x1); + INSTANCE_WR(ctx, 0x5D818/4, 0x1FE21); + INSTANCE_WR(ctx, 0x5D8D8/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D8F8/4, 0x4); + INSTANCE_WR(ctx, 0x5D938/4, 0x2); + INSTANCE_WR(ctx, 0x5D958/4, 0x11); + INSTANCE_WR(ctx, 0x5DA78/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x5DB18/4, 0x4); + INSTANCE_WR(ctx, 0x5DC58/4, 0x2); + INSTANCE_WR(ctx, 0x5DC78/4, 0x1); + INSTANCE_WR(ctx, 0x5DC98/4, 0x1); + INSTANCE_WR(ctx, 0x5DCB8/4, 0x2); + INSTANCE_WR(ctx, 0x5DCD8/4, 0x1); + INSTANCE_WR(ctx, 0x5DCF8/4, 0x1); + INSTANCE_WR(ctx, 0x5DD18/4, 0x1); + INSTANCE_WR(ctx, 0x5DD58/4, 0x4); + INSTANCE_WR(ctx, 0x651B8/4, 0x11); + INSTANCE_WR(ctx, 0x651F8/4, 0x1); + INSTANCE_WR(ctx, 0x5D03C/4, 0x80); + INSTANCE_WR(ctx, 0x5D05C/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D07C/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D09C/4, 0x1000); + INSTANCE_WR(ctx, 0x5D0FC/4, 0x1); + INSTANCE_WR(ctx, 0x5D15C/4, 0x1); + INSTANCE_WR(ctx, 0x5D19C/4, 0x4); + INSTANCE_WR(ctx, 0x5D1BC/4, 0x2); + INSTANCE_WR(ctx, 0x5D33C/4, 0x80); + INSTANCE_WR(ctx, 0x5D35C/4, 0x80007004); + INSTANCE_WR(ctx, 0x5D37C/4, 0x4000400); + INSTANCE_WR(ctx, 0x5D39C/4, 0x1000); + INSTANCE_WR(ctx, 0x5D3FC/4, 0x1); + INSTANCE_WR(ctx, 0x5D45C/4, 0x1); + INSTANCE_WR(ctx, 0x5D49C/4, 0x4); + INSTANCE_WR(ctx, 0x5D4BC/4, 0x2); + INSTANCE_WR(ctx, 0x5D61C/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D6FC/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D71C/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D73C/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D75C/4, 0xFFFF); + INSTANCE_WR(ctx, 0x5D77C/4, 0x1); + INSTANCE_WR(ctx, 0x5D79C/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7BC/4, 0x10001); + INSTANCE_WR(ctx, 0x5D7DC/4, 0x1); + INSTANCE_WR(ctx, 0x5D81C/4, 0x1FE21); + INSTANCE_WR(ctx, 0x5D8DC/4, 0x8100C12); + INSTANCE_WR(ctx, 0x5D8FC/4, 0x4); + INSTANCE_WR(ctx, 0x5D93C/4, 0x2); + INSTANCE_WR(ctx, 0x5D95C/4, 0x11); + INSTANCE_WR(ctx, 0x5DA7C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x5DB1C/4, 0x4); + INSTANCE_WR(ctx, 0x5DC5C/4, 0x2); + INSTANCE_WR(ctx, 0x5DC7C/4, 0x1); + INSTANCE_WR(ctx, 0x5DC9C/4, 0x1); + INSTANCE_WR(ctx, 0x5DCBC/4, 0x2); + INSTANCE_WR(ctx, 0x5DCDC/4, 0x1); + INSTANCE_WR(ctx, 0x5DCFC/4, 0x1); + INSTANCE_WR(ctx, 0x5DD1C/4, 0x1); + INSTANCE_WR(ctx, 0x5DD5C/4, 0x4); + INSTANCE_WR(ctx, 0x651BC/4, 0x11); + INSTANCE_WR(ctx, 0x651FC/4, 0x1); +} + int nv50_graph_create_context(struct nouveau_channel *chan) { @@ -2066,7 +4608,7 @@ nv50_graph_create_context(struct nouveau_channel *chan) struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_gpuobj *ramin = chan->ramin->gpuobj; struct nouveau_engine *engine = &dev_priv->Engine; - int grctx_size = 0x60000, hdr; + int grctx_size = 0x70000, hdr; int ret; DRM_DEBUG("ch%d\n", chan->id); @@ -2097,6 +4639,9 @@ nv50_graph_create_context(struct nouveau_channel *chan) case 0x86: nv86_graph_init_ctxvals(dev, chan->ramin_grctx); break; + case 0x92: + nv92_graph_init_ctxvals(dev, chan->ramin_grctx); + break; default: /* This is complete crack, it accidently used to make at * least some G8x cards work partially somehow, though there's -- cgit v1.2.3 From 301be1dc9be8a83f5092417573967f35766227bc Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 17 Sep 2008 15:02:54 +1000 Subject: nv50: add ctxprog for chipset 0xaa --- shared-core/nv50_graph.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index 1a88f28d..86274c6b 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -258,6 +258,61 @@ static uint32_t nv92_ctx_voodoo[] = { 0x0070000E, 0x0070001C, 0x0060000C, ~0 }; +static uint32_t nvaa_ctx_voodoo[] = { + 0x0070009c, 0x00300000, 0x0044f109, 0x00402d09, 0x0040e551, 0x00400a44, + 0x00400a05, 0x00400a0d, 0x0070008e, 0x0040124d, 0x0070009d, 0x0045004d, + 0x00700097, 0x00450121, 0x004446a1, 0x0044764d, 0x0044824d, 0x0070001d, + 0x00401806, 0x00600005, 0x00444445, 0x0044308b, 0x00401845, 0x0040234d, + 0x00700081, 0x00401ccf, 0x0070009f, 0x0050009f, 0x0044dc4d, 0x00700017, + 0x0040230b, 0x00447d4d, 0x00450221, 0x004456a1, 0x007000a0, 0x00700001, + 0x00700003, 0x00402706, 0x00402805, 0x0060000d, 0x00700005, 0x0070000d, + 0x00700006, 0x00700002, 0x0070000b, 0x0070000e, 0x0070001c, 0x0060000c, + 0x00000000, 0x0090ffff, 0x0091ffff, 0x0044d44d, 0x00600009, 0x0048004d, + 0x00700096, 0x00403acf, 0x0070009f, 0x0050009f, 0x0040e551, 0x004036c0, + 0x00200080, 0x00600008, 0x0040364f, 0x004036c0, 0x00403ecc, 0x00403651, + 0x00700016, 0x0048004d, 0x00600011, 0x0048004d, 0x0044364d, 0x0070008e, + 0x00700081, 0x0044704d, 0x00447d4d, 0x00700083, 0x00300000, 0x00212740, + 0x00600007, 0x00c00b01, 0x00200022, 0x00800001, 0x005000cb, 0x00c000ff, + 0x00445e4d, 0x0048004d, 0x0044ce08, 0x0044734d, 0x00448b4d, 0x00445e4d, + 0x0044e24d, 0x0044764d, 0x0044824d, 0x0048004d, 0x00700083, 0x0045034d, + 0x00a0023f, 0x00200040, 0x00600006, 0x0044fc4d, 0x00448d4d, 0x002001d0, + 0x0044b860, 0x00200280, 0x0038ffff, 0x0044cc4d, 0x00300000, 0x005000cb, + 0x00451c4d, 0x005000cb, 0x0044d007, 0x0048004d, 0x0044794d, 0x00111bfc, + 0x0048004d, 0x0044794d, 0x00111bfd, 0x0048004d, 0x0044794d, 0x00111bfe, + 0x0048004d, 0x00200000, 0x00700000, 0x00600006, 0x0048004d, 0x00200001, + 0x00600006, 0x0044fc4d, 0x0011020a, 0x0048004d, 0x00300000, 0x00c3ffff, + 0x00200000, 0x00600007, 0x00700000, 0x00200008, 0x008000ff, 0x005000cb, + 0x0048004d, 0x00000000, 0x0048004d, 0x00000000, 0x00170202, 0x00200032, + 0x0010020d, 0x001e0242, 0x001102c0, 0x00120302, 0x00150402, 0x00180500, + 0x00130509, 0x00150550, 0x00110605, 0x00200013, 0x00100607, 0x00110700, + 0x00110900, 0x00120902, 0x00110a00, 0x00160b02, 0x00120b28, 0x00140b2b, + 0x00110c01, 0x00110d01, 0x00111400, 0x00111405, 0x00111407, 0x00111409, + 0x0011140b, 0x002000d4, 0x00101500, 0x00141a05, 0x00131a0c, 0x00131c00, + 0x00131c04, 0x00141c20, 0x00131c25, 0x00131f00, 0x00131f04, 0x00111f08, + 0x00111f0b, 0x00200015, 0x00101f40, 0x0048004d, 0x00600006, 0x00451c4d, + 0x00112020, 0x00112022, 0x00200085, 0x00102040, 0x001120c8, 0x001420ca, + 0x001b20cf, 0x00122100, 0x00122103, 0x00162140, 0x00122147, 0x00122153, + 0x001121a0, 0x001221c0, 0x001121cb, 0x001121d4, 0x001521d8, 0x0048004d, + 0x00000000, 0x0048004d, 0x0060000b, 0x0048004d, 0x0060000a, 0x0048004d, + 0x0060000b, 0x0040d24d, 0x00200020, 0x00600008, 0x0050004c, 0x0048004d, + 0x002003e8, 0x00600008, 0x0050004c, 0x0048004d, 0x00600004, 0x0050004a, + 0x0048004d, 0x00c000ff, 0x00c800ff, 0x0048004d, 0x00c000ff, 0x00c800ff, + 0x0048004d, 0x00700016, 0x0070008e, 0x00700082, 0x00500041, 0x0044d84d, + 0x00700095, 0x005000d1, 0x00600016, 0x00500052, 0x00700002, 0x00700015, + 0x0040284d, 0x0070008e, 0x0044d44d, 0x00200000, 0x00600007, 0x00300000, + 0x00c000ff, 0x00200000, 0x008000ff, 0x00700009, 0x0070000e, 0x0048004d, + 0x00700080, 0x00480017, 0x00700000, 0x0048004d, 0x0048004d, 0x0048004d, + 0x0048004d, 0x0070008e, 0x0044d44d, 0x00700083, 0x0044df4d, 0x00450c4d, + 0x0070000f, 0x00410b8c, 0x005000cb, 0x0048004d, 0x00200280, 0x00600007, + 0x00452307, 0x00451187, 0x0048004d, 0x00000000, 0x00202070, 0x0044fc4d, + 0x008000ff, 0x0048004d, 0x00210600, 0x00600007, 0x00200428, 0x0044fc4d, + 0x008800ff, 0x0048004d, 0x0048000f, 0x0048004b, 0x0045164d, 0x0070008f, + 0x0048008c, 0x005000cb, 0x0048004d, 0x00202070, 0x0044fc4d, 0x008000fd, + 0x005000cb, 0x00c00002, 0x00200280, 0x00600007, 0x00200161, 0x0044fc4d, + 0x00800002, 0x005000cb, 0x00c00002, 0x00201f0e, 0x0044fc4d, 0x00800002, + 0x005000cb, 0x0048004d, ~0 +} + static int nv50_graph_init_ctxctl(struct drm_device *dev) { @@ -276,6 +331,9 @@ nv50_graph_init_ctxctl(struct drm_device *dev) case 0x92: voodoo = nv92_ctx_voodoo; break; + case 0xaa: + voodoo = nvaa_ctx_voodoo; + break; default: DRM_ERROR("no voodoo for chipset NV%02x\n", dev_priv->chipset); return -EINVAL; -- cgit v1.2.3 From 4d2f1257fab84bf66bd1154a1c829317584fd5f7 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 17 Sep 2008 15:13:27 +1000 Subject: nv50: add ctxprog for chipset 0x50 --- shared-core/nv50_graph.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index 86274c6b..d6fa1d0d 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -83,6 +83,74 @@ nv50_graph_init_regs(struct drm_device *dev) NV_WRITE(NV04_PGRAPH_DEBUG_3, (1<<2) /* HW_CONTEXT_SWITCH_ENABLED */); } +static uint32_t nv50_ctx_voodoo[] = { + 0x0070008e, 0x0070009c, 0x00200020, 0x00600008, 0x0050004c, 0x00400e89, + 0x00200000, 0x00600007, 0x00300000, 0x00c000ff, 0x00200000, 0x008000ff, + 0x00700009, 0x00417e4d, 0x00401e44, 0x00401e05, 0x00401e0d, 0x00415a06, + 0x00600005, 0x004015c5, 0x00600011, 0x00401c0b, 0x0090ffff, 0x0091ffff, + 0x00200020, 0x00600008, 0x0050004c, 0x00600009, 0x00415a45, 0x0041754d, + 0x0070009d, 0x004022cf, 0x0070009f, 0x0050009f, 0x00401fc0, 0x00200080, + 0x00600008, 0x00401f4f, 0x00401fc0, 0x004025cc, 0x00700081, 0x00200000, + 0x00600006, 0x00700000, 0x00111bfc, 0x00700080, 0x00700083, 0x00200047, + 0x00600006, 0x0011020a, 0x002005c0, 0x00600007, 0x00300000, 0x00c000ff, + 0x00c800ff, 0x00416507, 0x00202627, 0x008000ff, 0x00403c8c, 0x005000cb, + 0x00a0023f, 0x00200040, 0x00600006, 0x0070000f, 0x00170202, 0x0011020a, + 0x00200032, 0x0010020d, 0x001b0242, 0x00120302, 0x00140402, 0x00180500, + 0x00130509, 0x00150550, 0x00110605, 0x001e0607, 0x00110700, 0x00110900, + 0x00110902, 0x00110a00, 0x00160b02, 0x00110b28, 0x00140b2b, 0x00110c01, + 0x00111400, 0x00111405, 0x00111407, 0x00111409, 0x0011140b, 0x002000ea, + 0x00101500, 0x0040640f, 0x0040644b, 0x00213700, 0x00600007, 0x00200440, + 0x008800ff, 0x0070008f, 0x0040648c, 0x005000cb, 0x00000000, 0x001118f8, + 0x0020002b, 0x00101a05, 0x00131c00, 0x00111c04, 0x00141c20, 0x00111c25, + 0x00131c40, 0x00111c44, 0x00141c60, 0x00111c65, 0x00131c80, 0x00111c84, + 0x00141ca0, 0x00111ca5, 0x00131cc0, 0x00111cc4, 0x00141ce0, 0x00111ce5, + 0x00131d00, 0x00111d04, 0x00141d20, 0x00111d25, 0x00131d40, 0x00111d44, + 0x00141d60, 0x00111d65, 0x00131f00, 0x00191f40, 0x00409ee0, 0x00200217, + 0x00600006, 0x00200044, 0x00102080, 0x001120c6, 0x001520c9, 0x001920d0, + 0x00122100, 0x00122103, 0x00162200, 0x0040960f, 0x0040964b, 0x00213700, + 0x00600007, 0x00200440, 0x008800ff, 0x0070008f, 0x0040968c, 0x005000cb, + 0x00000000, 0x00122207, 0x00112280, 0x00112300, 0x00112302, 0x00122380, + 0x0011238b, 0x00192394, 0x0040b0e1, 0x00200285, 0x00600006, 0x00200044, + 0x00102480, 0x001124c6, 0x001524c9, 0x001924d0, 0x00122500, 0x00122503, + 0x00162600, 0x00122607, 0x00112680, 0x00112700, 0x00112702, 0x00122780, + 0x0011278b, 0x00192794, 0x0040cce2, 0x002002f3, 0x00600006, 0x00200044, + 0x00102880, 0x001128c6, 0x001528c9, 0x0040c00f, 0x0040c04b, 0x00213700, + 0x00600007, 0x00200440, 0x008800ff, 0x0070008f, 0x0040c08c, 0x005000cb, + 0x00000000, 0x001928d0, 0x00122900, 0x00122903, 0x00162a00, 0x00122a07, + 0x00112a80, 0x00112b00, 0x00112b02, 0x00122b80, 0x00112b8b, 0x00192b94, + 0x0040dee3, 0x00200361, 0x00600006, 0x00200044, 0x00102c80, 0x00112cc6, + 0x00152cc9, 0x00192cd0, 0x00122d00, 0x00122d03, 0x00162e00, 0x00122e07, + 0x00112e80, 0x00112f00, 0x00112f02, 0x00122f80, 0x00112f8b, 0x00192f94, + 0x0040fae4, 0x002003cf, 0x00600006, 0x00200044, 0x00103080, 0x0040ec0f, + 0x0040ec4b, 0x00213700, 0x00600007, 0x00200440, 0x008800ff, 0x0070008f, + 0x0040ec8c, 0x005000cb, 0x00000000, 0x001130c6, 0x001530c9, 0x001930d0, + 0x00123100, 0x00123103, 0x00163200, 0x00123207, 0x00113280, 0x00113300, + 0x00113302, 0x00123380, 0x0011338b, 0x00193394, 0x00410ce5, 0x0020043d, + 0x00600006, 0x00200044, 0x00103480, 0x001134c6, 0x001534c9, 0x001934d0, + 0x00123500, 0x00123503, 0x00163600, 0x00123607, 0x00113680, 0x00113700, + 0x00113702, 0x00123780, 0x0011378b, 0x00193794, 0x004128e6, 0x002004ab, + 0x00600006, 0x00200044, 0x00103880, 0x00411a0f, 0x00411a4b, 0x00213700, + 0x00600007, 0x00200440, 0x008800ff, 0x0070008f, 0x00411a8c, 0x005000cb, + 0x00000000, 0x001138c6, 0x001538c9, 0x001938d0, 0x00123900, 0x00123903, + 0x00163a00, 0x00123a07, 0x00113a80, 0x00113b00, 0x00113b02, 0x00123b80, + 0x00113b8b, 0x00193b94, 0x00413ae7, 0x00200519, 0x00600006, 0x00200044, + 0x00103c80, 0x00113cc6, 0x00153cc9, 0x00193cd0, 0x00123d00, 0x00123d03, + 0x00163e00, 0x00123e07, 0x00113e80, 0x00113f00, 0x00113f02, 0x00123f80, + 0x00113f8b, 0x00193f94, 0x00000000, 0x0041410f, 0x005000cb, 0x00213700, + 0x00600007, 0x00200440, 0x008800ff, 0x005000cb, 0x00414487, 0x0060000a, + 0x00000000, 0x00415300, 0x007000a0, 0x00700080, 0x002005c0, 0x00600007, + 0x00200004, 0x00c000ff, 0x008000ff, 0x005000cb, 0x00700000, 0x00200000, + 0x00600006, 0x00111bfe, 0x0041754d, 0x00700000, 0x00200000, 0x00600006, + 0x00111bfe, 0x00700080, 0x0070001d, 0x0040114d, 0x00700081, 0x00600004, + 0x0050004a, 0x00415f88, 0x0060000b, 0x00200000, 0x00600006, 0x00700000, + 0x0041750b, 0x00111bfd, 0x00402e4d, 0x00202627, 0x008000fd, 0x005000cb, + 0x00c00002, 0x002005c0, 0x00600007, 0x0020015f, 0x00800002, 0x005000cb, + 0x00c01802, 0x002024c8, 0x00800002, 0x005000cb, 0x00403a4d, 0x0060000b, + 0x0041734d, 0x00700001, 0x00700003, 0x00417906, 0x00417a05, 0x0060000d, + 0x00700005, 0x0070000d, 0x00700006, 0x0070000b, 0x0070000e, 0x0070001c, + 0x0060000c, ~0 +}; + static uint32_t nv84_ctx_voodoo[] = { 0x0070008e, 0x0070009c, 0x00200020, 0x00600008, 0x0050004c, 0x00400e89, 0x00200000, 0x00600007, 0x00300000, 0x00c000ff, 0x00200000, 0x008000ff, @@ -322,6 +390,9 @@ nv50_graph_init_ctxctl(struct drm_device *dev) DRM_DEBUG("\n"); switch (dev_priv->chipset) { + case 0x50: + voodoo = nv50_ctx_voodoo; + break; case 0x84: voodoo = nv84_ctx_voodoo; break; -- cgit v1.2.3 From d55e8090fa9d0f3bb67eeb8cc61c0ed6345d41b4 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 17 Sep 2008 22:03:38 +1000 Subject: nv50: add initial context to match ctxprog for chipset 0x50 --- shared-core/nv50_graph.c | 4052 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 3373 insertions(+), 679 deletions(-) diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index d6fa1d0d..2fb6f967 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -379,7 +379,7 @@ static uint32_t nvaa_ctx_voodoo[] = { 0x005000cb, 0x00c00002, 0x00200280, 0x00600007, 0x00200161, 0x0044fc4d, 0x00800002, 0x005000cb, 0x00c00002, 0x00201f0e, 0x0044fc4d, 0x00800002, 0x005000cb, 0x0048004d, ~0 -} +}; static int nv50_graph_init_ctxctl(struct drm_device *dev) @@ -449,690 +449,2697 @@ nv50_graph_takedown(struct drm_device *dev) } static void -nv86_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) +nv50_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) { struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_gpuobj *ctx = ref->gpuobj; - INSTANCE_WR(ctx, 0x10C/4, 0x30); - INSTANCE_WR(ctx, 0x1D4/4, 0x3); - INSTANCE_WR(ctx, 0x1D8/4, 0x1000); - INSTANCE_WR(ctx, 0x218/4, 0xFE0C); - INSTANCE_WR(ctx, 0x22C/4, 0x1000); - INSTANCE_WR(ctx, 0x258/4, 0x187); - INSTANCE_WR(ctx, 0x26C/4, 0x1018); - INSTANCE_WR(ctx, 0x270/4, 0xFF); - INSTANCE_WR(ctx, 0x2AC/4, 0x4); - INSTANCE_WR(ctx, 0x2B0/4, 0x44D00DF); - INSTANCE_WR(ctx, 0x2B8/4, 0x600); - INSTANCE_WR(ctx, 0x2D0/4, 0x1000000); - INSTANCE_WR(ctx, 0x2D4/4, 0xFF); - INSTANCE_WR(ctx, 0x2DC/4, 0x400); - INSTANCE_WR(ctx, 0x2F4/4, 0x1); - INSTANCE_WR(ctx, 0x2F8/4, 0x80); - INSTANCE_WR(ctx, 0x2FC/4, 0x4); - INSTANCE_WR(ctx, 0x318/4, 0x2); - INSTANCE_WR(ctx, 0x31C/4, 0x1); - INSTANCE_WR(ctx, 0x328/4, 0x1); - INSTANCE_WR(ctx, 0x32C/4, 0x100); - INSTANCE_WR(ctx, 0x344/4, 0x2); - INSTANCE_WR(ctx, 0x348/4, 0x1); - INSTANCE_WR(ctx, 0x34C/4, 0x1); - INSTANCE_WR(ctx, 0x35C/4, 0x1); - INSTANCE_WR(ctx, 0x360/4, 0x3FFFFF); - INSTANCE_WR(ctx, 0x364/4, 0x1FFF); - INSTANCE_WR(ctx, 0x36C/4, 0x1); - INSTANCE_WR(ctx, 0x370/4, 0x1); - INSTANCE_WR(ctx, 0x378/4, 0x1); - INSTANCE_WR(ctx, 0x37C/4, 0x1); - INSTANCE_WR(ctx, 0x380/4, 0x1); - INSTANCE_WR(ctx, 0x384/4, 0x4); - INSTANCE_WR(ctx, 0x388/4, 0x1); - INSTANCE_WR(ctx, 0x38C/4, 0x1); - INSTANCE_WR(ctx, 0x390/4, 0x1); - INSTANCE_WR(ctx, 0x394/4, 0x7); - INSTANCE_WR(ctx, 0x398/4, 0x1); - INSTANCE_WR(ctx, 0x39C/4, 0x7); - INSTANCE_WR(ctx, 0x3A0/4, 0x1); - INSTANCE_WR(ctx, 0x3A4/4, 0x1); - INSTANCE_WR(ctx, 0x3A8/4, 0x1); - INSTANCE_WR(ctx, 0x3BC/4, 0x1); - INSTANCE_WR(ctx, 0x3C0/4, 0x100); - INSTANCE_WR(ctx, 0x3C8/4, 0x1); - INSTANCE_WR(ctx, 0x3D4/4, 0x100); - INSTANCE_WR(ctx, 0x3D8/4, 0x1); - INSTANCE_WR(ctx, 0x3DC/4, 0x100); - INSTANCE_WR(ctx, 0x3E4/4, 0x1); - INSTANCE_WR(ctx, 0x3F0/4, 0x100); - INSTANCE_WR(ctx, 0x404/4, 0x4); - INSTANCE_WR(ctx, 0x408/4, 0x70); - INSTANCE_WR(ctx, 0x40C/4, 0x80); - INSTANCE_WR(ctx, 0x420/4, 0xC); - INSTANCE_WR(ctx, 0x428/4, 0x8); - INSTANCE_WR(ctx, 0x42C/4, 0x14); - INSTANCE_WR(ctx, 0x434/4, 0x29); - INSTANCE_WR(ctx, 0x438/4, 0x27); - INSTANCE_WR(ctx, 0x43C/4, 0x26); - INSTANCE_WR(ctx, 0x440/4, 0x8); - INSTANCE_WR(ctx, 0x444/4, 0x4); - INSTANCE_WR(ctx, 0x448/4, 0x27); - INSTANCE_WR(ctx, 0x454/4, 0x1); - INSTANCE_WR(ctx, 0x458/4, 0x2); - INSTANCE_WR(ctx, 0x45C/4, 0x3); - INSTANCE_WR(ctx, 0x460/4, 0x4); - INSTANCE_WR(ctx, 0x464/4, 0x5); - INSTANCE_WR(ctx, 0x468/4, 0x6); - INSTANCE_WR(ctx, 0x46C/4, 0x7); - INSTANCE_WR(ctx, 0x470/4, 0x1); - INSTANCE_WR(ctx, 0x4B4/4, 0xCF); - INSTANCE_WR(ctx, 0x4E4/4, 0x80); - INSTANCE_WR(ctx, 0x4E8/4, 0x4); - INSTANCE_WR(ctx, 0x4EC/4, 0x4); - INSTANCE_WR(ctx, 0x4F0/4, 0x3); - INSTANCE_WR(ctx, 0x4F4/4, 0x1); - INSTANCE_WR(ctx, 0x500/4, 0x12); - INSTANCE_WR(ctx, 0x504/4, 0x10); - INSTANCE_WR(ctx, 0x508/4, 0xC); - INSTANCE_WR(ctx, 0x50C/4, 0x1); - INSTANCE_WR(ctx, 0x51C/4, 0x4); - INSTANCE_WR(ctx, 0x520/4, 0x2); - INSTANCE_WR(ctx, 0x524/4, 0x4); - INSTANCE_WR(ctx, 0x530/4, 0x3FFFFF); - INSTANCE_WR(ctx, 0x534/4, 0x1FFF); - INSTANCE_WR(ctx, 0x55C/4, 0x4); - INSTANCE_WR(ctx, 0x560/4, 0x14); - INSTANCE_WR(ctx, 0x564/4, 0x1); - INSTANCE_WR(ctx, 0x570/4, 0x2); - INSTANCE_WR(ctx, 0x57C/4, 0x1); - INSTANCE_WR(ctx, 0x584/4, 0x2); - INSTANCE_WR(ctx, 0x588/4, 0x1000); - INSTANCE_WR(ctx, 0x58C/4, 0xE00); - INSTANCE_WR(ctx, 0x590/4, 0x1000); - INSTANCE_WR(ctx, 0x594/4, 0x1E00); - INSTANCE_WR(ctx, 0x59C/4, 0x1); - INSTANCE_WR(ctx, 0x5A0/4, 0x1); - INSTANCE_WR(ctx, 0x5A4/4, 0x1); - INSTANCE_WR(ctx, 0x5A8/4, 0x1); - INSTANCE_WR(ctx, 0x5AC/4, 0x1); - INSTANCE_WR(ctx, 0x5BC/4, 0x200); - INSTANCE_WR(ctx, 0x5C4/4, 0x1); - INSTANCE_WR(ctx, 0x5C8/4, 0x70); - INSTANCE_WR(ctx, 0x5CC/4, 0x80); - INSTANCE_WR(ctx, 0x5D8/4, 0x1); - INSTANCE_WR(ctx, 0x5DC/4, 0x70); - INSTANCE_WR(ctx, 0x5E0/4, 0x80); - INSTANCE_WR(ctx, 0x5F0/4, 0x1); - INSTANCE_WR(ctx, 0x5F4/4, 0xCF); - INSTANCE_WR(ctx, 0x5FC/4, 0x1); - INSTANCE_WR(ctx, 0x60C/4, 0xCF); - INSTANCE_WR(ctx, 0x614/4, 0x2); - INSTANCE_WR(ctx, 0x61C/4, 0x1); - INSTANCE_WR(ctx, 0x624/4, 0x1); - INSTANCE_WR(ctx, 0x62C/4, 0xCF); - INSTANCE_WR(ctx, 0x630/4, 0xCF); - INSTANCE_WR(ctx, 0x634/4, 0x1); - INSTANCE_WR(ctx, 0x63C/4, 0xF80); - INSTANCE_WR(ctx, 0x684/4, 0x7F0080); - INSTANCE_WR(ctx, 0x6C0/4, 0x7F0080); - INSTANCE_WR(ctx, 0x6E4/4, 0x3B74F821); - INSTANCE_WR(ctx, 0x6E8/4, 0x89058001); - INSTANCE_WR(ctx, 0x6F0/4, 0x1000); - INSTANCE_WR(ctx, 0x6F4/4, 0x1F); - INSTANCE_WR(ctx, 0x6F8/4, 0x27C10FA); - INSTANCE_WR(ctx, 0x6FC/4, 0x400000C0); - INSTANCE_WR(ctx, 0x700/4, 0xB7892080); - INSTANCE_WR(ctx, 0x70C/4, 0x3B74F821); - INSTANCE_WR(ctx, 0x710/4, 0x89058001); - INSTANCE_WR(ctx, 0x718/4, 0x1000); - INSTANCE_WR(ctx, 0x71C/4, 0x1F); - INSTANCE_WR(ctx, 0x720/4, 0x27C10FA); - INSTANCE_WR(ctx, 0x724/4, 0x400000C0); - INSTANCE_WR(ctx, 0x728/4, 0xB7892080); - INSTANCE_WR(ctx, 0x734/4, 0x10040); - INSTANCE_WR(ctx, 0x73C/4, 0x22); - INSTANCE_WR(ctx, 0x748/4, 0x10040); - INSTANCE_WR(ctx, 0x74C/4, 0x22); - INSTANCE_WR(ctx, 0x764/4, 0x1800000); - INSTANCE_WR(ctx, 0x768/4, 0x160000); - INSTANCE_WR(ctx, 0x76C/4, 0x1800000); - INSTANCE_WR(ctx, 0x77C/4, 0x3FFFF); - INSTANCE_WR(ctx, 0x780/4, 0x8C0000); - INSTANCE_WR(ctx, 0x7A4/4, 0x10401); - INSTANCE_WR(ctx, 0x7AC/4, 0x78); - INSTANCE_WR(ctx, 0x7B4/4, 0xBF); - INSTANCE_WR(ctx, 0x7BC/4, 0x1210); - INSTANCE_WR(ctx, 0x7C0/4, 0x8000080); - INSTANCE_WR(ctx, 0x7E4/4, 0x1800000); - INSTANCE_WR(ctx, 0x7E8/4, 0x160000); - INSTANCE_WR(ctx, 0x7EC/4, 0x1800000); - INSTANCE_WR(ctx, 0x7FC/4, 0x3FFFF); - INSTANCE_WR(ctx, 0x800/4, 0x8C0000); - INSTANCE_WR(ctx, 0x824/4, 0x10401); - INSTANCE_WR(ctx, 0x82C/4, 0x78); - INSTANCE_WR(ctx, 0x834/4, 0xBF); - INSTANCE_WR(ctx, 0x83C/4, 0x1210); - INSTANCE_WR(ctx, 0x840/4, 0x8000080); - INSTANCE_WR(ctx, 0x868/4, 0x27070); - INSTANCE_WR(ctx, 0x874/4, 0x3FFFFFF); - INSTANCE_WR(ctx, 0x88C/4, 0x120407); - INSTANCE_WR(ctx, 0x890/4, 0x5091507); - INSTANCE_WR(ctx, 0x894/4, 0x5010202); - INSTANCE_WR(ctx, 0x898/4, 0x30201); - INSTANCE_WR(ctx, 0x8B4/4, 0x40); - INSTANCE_WR(ctx, 0x8B8/4, 0xD0C0B0A); - INSTANCE_WR(ctx, 0x8BC/4, 0x141210); - INSTANCE_WR(ctx, 0x8C0/4, 0x1F0); - INSTANCE_WR(ctx, 0x8C4/4, 0x1); - INSTANCE_WR(ctx, 0x8C8/4, 0x3); - INSTANCE_WR(ctx, 0x8D4/4, 0x39E00); - INSTANCE_WR(ctx, 0x8D8/4, 0x100); - INSTANCE_WR(ctx, 0x8DC/4, 0x3800); - INSTANCE_WR(ctx, 0x8E0/4, 0x404040); - INSTANCE_WR(ctx, 0x8E4/4, 0xFF0A); - INSTANCE_WR(ctx, 0x8EC/4, 0x77F005); - INSTANCE_WR(ctx, 0x8F0/4, 0x3F7FFF); - INSTANCE_WR(ctx, 0x7BA0/4, 0x21); - INSTANCE_WR(ctx, 0x7BC0/4, 0x1); - INSTANCE_WR(ctx, 0x7BE0/4, 0x2); - INSTANCE_WR(ctx, 0x7C00/4, 0x100); - INSTANCE_WR(ctx, 0x7C20/4, 0x100); - INSTANCE_WR(ctx, 0x7C40/4, 0x1); - INSTANCE_WR(ctx, 0x7CA0/4, 0x1); - INSTANCE_WR(ctx, 0x7CC0/4, 0x2); - INSTANCE_WR(ctx, 0x7CE0/4, 0x100); - INSTANCE_WR(ctx, 0x7D00/4, 0x100); - INSTANCE_WR(ctx, 0x7D20/4, 0x1); - INSTANCE_WR(ctx, 0x11640/4, 0x4); - INSTANCE_WR(ctx, 0x11660/4, 0x4); - INSTANCE_WR(ctx, 0x49FE0/4, 0x4); - INSTANCE_WR(ctx, 0x4A000/4, 0x4); - INSTANCE_WR(ctx, 0x4A020/4, 0x8100C12); - INSTANCE_WR(ctx, 0x4A040/4, 0x3); - INSTANCE_WR(ctx, 0x4A080/4, 0x8100C12); - INSTANCE_WR(ctx, 0x4A0C0/4, 0x80C14); - INSTANCE_WR(ctx, 0x4A0E0/4, 0x1); - INSTANCE_WR(ctx, 0x4A100/4, 0x80C14); - INSTANCE_WR(ctx, 0x4A160/4, 0x8100C12); - INSTANCE_WR(ctx, 0x4A180/4, 0x27); - INSTANCE_WR(ctx, 0x4A1E0/4, 0x1); - INSTANCE_WR(ctx, 0x51A20/4, 0x1); - INSTANCE_WR(ctx, 0x51D00/4, 0x8100C12); - INSTANCE_WR(ctx, 0x51EA0/4, 0x4000000); - INSTANCE_WR(ctx, 0x51EC0/4, 0x4000000); - INSTANCE_WR(ctx, 0x51F00/4, 0x80); - INSTANCE_WR(ctx, 0x51F80/4, 0x80); - INSTANCE_WR(ctx, 0x51FC0/4, 0x3F); - INSTANCE_WR(ctx, 0x52120/4, 0x2); - INSTANCE_WR(ctx, 0x52140/4, 0x4000000); - INSTANCE_WR(ctx, 0x52160/4, 0x4000000); - INSTANCE_WR(ctx, 0x52280/4, 0x4); - INSTANCE_WR(ctx, 0x52300/4, 0x4); - INSTANCE_WR(ctx, 0x52540/4, 0x1); - INSTANCE_WR(ctx, 0x52560/4, 0x1001); - INSTANCE_WR(ctx, 0x52580/4, 0xFFFF); - INSTANCE_WR(ctx, 0x525A0/4, 0xFFFF); - INSTANCE_WR(ctx, 0x525C0/4, 0xFFFF); - INSTANCE_WR(ctx, 0x525E0/4, 0xFFFF); - INSTANCE_WR(ctx, 0x52A00/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52A20/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52A40/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52A60/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52A80/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52AA0/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52AC0/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52AE0/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52B00/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52B20/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52B40/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52B60/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52B80/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52BA0/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52BC0/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52BE0/4, 0x3F800000); - INSTANCE_WR(ctx, 0x52C00/4, 0x10); - INSTANCE_WR(ctx, 0x52C60/4, 0x3); - INSTANCE_WR(ctx, 0xA84/4, 0xF); - INSTANCE_WR(ctx, 0xB24/4, 0x20); - INSTANCE_WR(ctx, 0xD04/4, 0x1A); - INSTANCE_WR(ctx, 0xEC4/4, 0x4); - INSTANCE_WR(ctx, 0xEE4/4, 0x4); - INSTANCE_WR(ctx, 0xF24/4, 0x4); - INSTANCE_WR(ctx, 0xF44/4, 0x8); - INSTANCE_WR(ctx, 0xF84/4, 0x7FF); - INSTANCE_WR(ctx, 0x1124/4, 0xF); - INSTANCE_WR(ctx, 0x3604/4, 0xF); - INSTANCE_WR(ctx, 0x3644/4, 0x1); - INSTANCE_WR(ctx, 0x41A4/4, 0xF); - INSTANCE_WR(ctx, 0x14844/4, 0xF); - INSTANCE_WR(ctx, 0x14AE4/4, 0x1); - INSTANCE_WR(ctx, 0x14B04/4, 0x100); - INSTANCE_WR(ctx, 0x14B24/4, 0x100); - INSTANCE_WR(ctx, 0x14B44/4, 0x11); - INSTANCE_WR(ctx, 0x14B84/4, 0x8); - INSTANCE_WR(ctx, 0x14C44/4, 0x1); - INSTANCE_WR(ctx, 0x14C84/4, 0x1); - INSTANCE_WR(ctx, 0x14CA4/4, 0x1); - INSTANCE_WR(ctx, 0x14CC4/4, 0x1); - INSTANCE_WR(ctx, 0x14CE4/4, 0xCF); - INSTANCE_WR(ctx, 0x14D04/4, 0x2); - INSTANCE_WR(ctx, 0x14DE4/4, 0x1); - INSTANCE_WR(ctx, 0x14E24/4, 0x1); - INSTANCE_WR(ctx, 0x14E44/4, 0x1); - INSTANCE_WR(ctx, 0x14E64/4, 0x1); - INSTANCE_WR(ctx, 0x14F04/4, 0x4); - INSTANCE_WR(ctx, 0x14F44/4, 0x1); - INSTANCE_WR(ctx, 0x14F64/4, 0x15); - INSTANCE_WR(ctx, 0x14FE4/4, 0x4444480); - INSTANCE_WR(ctx, 0x15764/4, 0x8100C12); - INSTANCE_WR(ctx, 0x15804/4, 0x100); - INSTANCE_WR(ctx, 0x15864/4, 0x10001); - INSTANCE_WR(ctx, 0x158A4/4, 0x10001); - INSTANCE_WR(ctx, 0x158C4/4, 0x1); - INSTANCE_WR(ctx, 0x158E4/4, 0x10001); - INSTANCE_WR(ctx, 0x15904/4, 0x1); - INSTANCE_WR(ctx, 0x15924/4, 0x4); - INSTANCE_WR(ctx, 0x15944/4, 0x2); - INSTANCE_WR(ctx, 0x166C4/4, 0x4E3BFDF); - INSTANCE_WR(ctx, 0x166E4/4, 0x4E3BFDF); - INSTANCE_WR(ctx, 0x16784/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x16904/4, 0x4E3BFDF); - INSTANCE_WR(ctx, 0x16924/4, 0x4E3BFDF); - INSTANCE_WR(ctx, 0x15948/4, 0x3FFFFF); - INSTANCE_WR(ctx, 0x159A8/4, 0x1FFF); - INSTANCE_WR(ctx, 0x15B88/4, 0x3F800000); - INSTANCE_WR(ctx, 0x15C68/4, 0x4); - INSTANCE_WR(ctx, 0x15C88/4, 0x1A); - INSTANCE_WR(ctx, 0x15CE8/4, 0x1); - INSTANCE_WR(ctx, 0x15F48/4, 0xFFFF00); - INSTANCE_WR(ctx, 0x16028/4, 0xF); - INSTANCE_WR(ctx, 0x16128/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x16148/4, 0x11); - INSTANCE_WR(ctx, 0x16348/4, 0x4); - INSTANCE_WR(ctx, 0x163E8/4, 0x2); - INSTANCE_WR(ctx, 0x16408/4, 0x4000000); - INSTANCE_WR(ctx, 0x16428/4, 0x4000000); - INSTANCE_WR(ctx, 0x164A8/4, 0x5); - INSTANCE_WR(ctx, 0x164C8/4, 0x52); - INSTANCE_WR(ctx, 0x16568/4, 0x1); - INSTANCE_WR(ctx, 0x16788/4, 0x3F800000); - INSTANCE_WR(ctx, 0x167A8/4, 0x3F800000); - INSTANCE_WR(ctx, 0x167C8/4, 0x3F800000); - INSTANCE_WR(ctx, 0x167E8/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16808/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16828/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16848/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16868/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16888/4, 0x3F800000); - INSTANCE_WR(ctx, 0x168A8/4, 0x3F800000); - INSTANCE_WR(ctx, 0x168C8/4, 0x3F800000); - INSTANCE_WR(ctx, 0x168E8/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16908/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16928/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16948/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16968/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16988/4, 0x10); - INSTANCE_WR(ctx, 0x16E68/4, 0x8100C12); - INSTANCE_WR(ctx, 0x16E88/4, 0x5); - INSTANCE_WR(ctx, 0x16EE8/4, 0x1); - INSTANCE_WR(ctx, 0x16F28/4, 0xFFFF); - INSTANCE_WR(ctx, 0x16F48/4, 0xFFFF); - INSTANCE_WR(ctx, 0x16F68/4, 0xFFFF); - INSTANCE_WR(ctx, 0x16F88/4, 0xFFFF); - INSTANCE_WR(ctx, 0x16FA8/4, 0x3); - INSTANCE_WR(ctx, 0x173A8/4, 0xFFFF00); - INSTANCE_WR(ctx, 0x173C8/4, 0x1A); - INSTANCE_WR(ctx, 0x17408/4, 0x3); - INSTANCE_WR(ctx, 0x178E8/4, 0x102); - INSTANCE_WR(ctx, 0x17928/4, 0x4); - INSTANCE_WR(ctx, 0x17948/4, 0x4); - INSTANCE_WR(ctx, 0x17968/4, 0x4); - INSTANCE_WR(ctx, 0x17988/4, 0x4); - INSTANCE_WR(ctx, 0x179A8/4, 0x4); - INSTANCE_WR(ctx, 0x179C8/4, 0x4); - INSTANCE_WR(ctx, 0x17A08/4, 0x7FF); - INSTANCE_WR(ctx, 0x17A48/4, 0x102); - INSTANCE_WR(ctx, 0x17B88/4, 0x4); - INSTANCE_WR(ctx, 0x17BA8/4, 0x4); - INSTANCE_WR(ctx, 0x17BC8/4, 0x4); - INSTANCE_WR(ctx, 0x17BE8/4, 0x4); - INSTANCE_WR(ctx, 0x18228/4, 0x80C14); - INSTANCE_WR(ctx, 0x18288/4, 0x804); - INSTANCE_WR(ctx, 0x182C8/4, 0x4); - INSTANCE_WR(ctx, 0x182E8/4, 0x4); - INSTANCE_WR(ctx, 0x18308/4, 0x8100C12); - INSTANCE_WR(ctx, 0x18348/4, 0x4); - INSTANCE_WR(ctx, 0x18368/4, 0x4); - INSTANCE_WR(ctx, 0x183A8/4, 0x10); - INSTANCE_WR(ctx, 0x18448/4, 0x804); - INSTANCE_WR(ctx, 0x18468/4, 0x1); - INSTANCE_WR(ctx, 0x18488/4, 0x1A); - INSTANCE_WR(ctx, 0x184A8/4, 0x7F); - INSTANCE_WR(ctx, 0x184E8/4, 0x1); - INSTANCE_WR(ctx, 0x18508/4, 0x80C14); - INSTANCE_WR(ctx, 0x18548/4, 0x8100C12); - INSTANCE_WR(ctx, 0x18568/4, 0x4); - INSTANCE_WR(ctx, 0x18588/4, 0x4); - INSTANCE_WR(ctx, 0x185C8/4, 0x10); - INSTANCE_WR(ctx, 0x18648/4, 0x1); - INSTANCE_WR(ctx, 0x18668/4, 0x8100C12); - INSTANCE_WR(ctx, 0x18748/4, 0x7FF); - INSTANCE_WR(ctx, 0x18768/4, 0x80C14); - INSTANCE_WR(ctx, 0x18E88/4, 0x1); - INSTANCE_WR(ctx, 0x18EE8/4, 0x10); - INSTANCE_WR(ctx, 0x19608/4, 0x88); - INSTANCE_WR(ctx, 0x19628/4, 0x88); - INSTANCE_WR(ctx, 0x19688/4, 0x4); - INSTANCE_WR(ctx, 0x19968/4, 0x26); - INSTANCE_WR(ctx, 0x199C8/4, 0x3F800000); - INSTANCE_WR(ctx, 0x19A48/4, 0x1A); - INSTANCE_WR(ctx, 0x19A68/4, 0x10); - INSTANCE_WR(ctx, 0x19F88/4, 0x52); - INSTANCE_WR(ctx, 0x19FC8/4, 0x26); - INSTANCE_WR(ctx, 0x1A008/4, 0x4); - INSTANCE_WR(ctx, 0x1A028/4, 0x4); - INSTANCE_WR(ctx, 0x1A068/4, 0x1A); - INSTANCE_WR(ctx, 0x1A0C8/4, 0xFFFF00); - INSTANCE_WR(ctx, 0x1A108/4, 0x4); - INSTANCE_WR(ctx, 0x1A128/4, 0x4); - INSTANCE_WR(ctx, 0x1A168/4, 0x80); - INSTANCE_WR(ctx, 0x1A188/4, 0x4); - INSTANCE_WR(ctx, 0x1A1A8/4, 0x80C14); - INSTANCE_WR(ctx, 0x1A1E8/4, 0x7FF); - INSTANCE_WR(ctx, 0x24A48/4, 0x4); - INSTANCE_WR(ctx, 0x24A68/4, 0x4); - INSTANCE_WR(ctx, 0x24AA8/4, 0x80); - INSTANCE_WR(ctx, 0x24AC8/4, 0x4); - INSTANCE_WR(ctx, 0x24AE8/4, 0x1); - INSTANCE_WR(ctx, 0x24B28/4, 0x27); - INSTANCE_WR(ctx, 0x24B68/4, 0x26); - INSTANCE_WR(ctx, 0x24BE8/4, 0x4000000); - INSTANCE_WR(ctx, 0x24C08/4, 0x4000000); - INSTANCE_WR(ctx, 0x24C28/4, 0x4000000); - INSTANCE_WR(ctx, 0x24C48/4, 0x4000000); - INSTANCE_WR(ctx, 0x24C68/4, 0x4000000); - INSTANCE_WR(ctx, 0x24C88/4, 0x4000000); - INSTANCE_WR(ctx, 0x24CA8/4, 0x4000000); - INSTANCE_WR(ctx, 0x24CC8/4, 0x4000000); - INSTANCE_WR(ctx, 0x24CE8/4, 0x4000000); - INSTANCE_WR(ctx, 0x24D08/4, 0x4000000); - INSTANCE_WR(ctx, 0x24D28/4, 0x4000000); - INSTANCE_WR(ctx, 0x24D48/4, 0x4000000); - INSTANCE_WR(ctx, 0x24D68/4, 0x4000000); - INSTANCE_WR(ctx, 0x24D88/4, 0x4000000); - INSTANCE_WR(ctx, 0x24DA8/4, 0x4000000); - INSTANCE_WR(ctx, 0x24DC8/4, 0x4000000); - INSTANCE_WR(ctx, 0x25268/4, 0x4E3BFDF); - INSTANCE_WR(ctx, 0x25288/4, 0x4E3BFDF); - INSTANCE_WR(ctx, 0x252E8/4, 0x1FE21); - INSTANCE_WR(ctx, 0xB0C/4, 0x2); - INSTANCE_WR(ctx, 0xB4C/4, 0x1FFE67); - INSTANCE_WR(ctx, 0xCEC/4, 0x1); - INSTANCE_WR(ctx, 0xD0C/4, 0x10); - INSTANCE_WR(ctx, 0xD6C/4, 0x1); - INSTANCE_WR(ctx, 0xE0C/4, 0x4); - INSTANCE_WR(ctx, 0xE2C/4, 0x400); - INSTANCE_WR(ctx, 0xE4C/4, 0x300); - INSTANCE_WR(ctx, 0xE6C/4, 0x1001); - INSTANCE_WR(ctx, 0xE8C/4, 0x15); - INSTANCE_WR(ctx, 0xF4C/4, 0x2); - INSTANCE_WR(ctx, 0x106C/4, 0x1); - INSTANCE_WR(ctx, 0x108C/4, 0x10); - INSTANCE_WR(ctx, 0x10CC/4, 0x1); - INSTANCE_WR(ctx, 0x134C/4, 0x10); - INSTANCE_WR(ctx, 0x156C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x158C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x15AC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x15CC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x15EC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x160C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x162C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x164C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x166C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x168C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16AC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16CC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x16EC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x170C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x172C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x174C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x1A8C/4, 0x10); - INSTANCE_WR(ctx, 0x1ACC/4, 0x3F); - INSTANCE_WR(ctx, 0x1BAC/4, 0x1); - INSTANCE_WR(ctx, 0x1BEC/4, 0x1); - INSTANCE_WR(ctx, 0x1C2C/4, 0x1); - INSTANCE_WR(ctx, 0x1DCC/4, 0x11); - INSTANCE_WR(ctx, 0x1ECC/4, 0xF); - INSTANCE_WR(ctx, 0x1FCC/4, 0x11); - INSTANCE_WR(ctx, 0x20AC/4, 0x1); - INSTANCE_WR(ctx, 0x20CC/4, 0x1); - INSTANCE_WR(ctx, 0x20EC/4, 0x1); - INSTANCE_WR(ctx, 0x210C/4, 0x2); - INSTANCE_WR(ctx, 0x212C/4, 0x1); - INSTANCE_WR(ctx, 0x214C/4, 0x2); - INSTANCE_WR(ctx, 0x216C/4, 0x1); - INSTANCE_WR(ctx, 0x21AC/4, 0x1FFE67); - INSTANCE_WR(ctx, 0x21EC/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x24AC/4, 0x1); - INSTANCE_WR(ctx, 0x24CC/4, 0x2); - INSTANCE_WR(ctx, 0x24EC/4, 0x1); - INSTANCE_WR(ctx, 0x250C/4, 0x1); - INSTANCE_WR(ctx, 0x252C/4, 0x2); - INSTANCE_WR(ctx, 0x254C/4, 0x1); - INSTANCE_WR(ctx, 0x256C/4, 0x1); - INSTANCE_WR(ctx, 0x25EC/4, 0x11); - INSTANCE_WR(ctx, 0x260C/4, 0x1); - INSTANCE_WR(ctx, 0x328C/4, 0x2); - INSTANCE_WR(ctx, 0x32CC/4, 0x1FFE67); - INSTANCE_WR(ctx, 0x346C/4, 0x1); - INSTANCE_WR(ctx, 0x348C/4, 0x10); - INSTANCE_WR(ctx, 0x34EC/4, 0x1); - INSTANCE_WR(ctx, 0x358C/4, 0x4); - INSTANCE_WR(ctx, 0x35AC/4, 0x400); - INSTANCE_WR(ctx, 0x35CC/4, 0x300); - INSTANCE_WR(ctx, 0x35EC/4, 0x1001); - INSTANCE_WR(ctx, 0x360C/4, 0x15); - INSTANCE_WR(ctx, 0x36CC/4, 0x2); - INSTANCE_WR(ctx, 0x37EC/4, 0x1); - INSTANCE_WR(ctx, 0x380C/4, 0x10); - INSTANCE_WR(ctx, 0x384C/4, 0x1); - INSTANCE_WR(ctx, 0x3ACC/4, 0x10); - INSTANCE_WR(ctx, 0x3CEC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3D0C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3D2C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3D4C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3D6C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3D8C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3DAC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3DCC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3DEC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3E0C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3E2C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3E4C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3E6C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3E8C/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3EAC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x3ECC/4, 0x3F800000); - INSTANCE_WR(ctx, 0x420C/4, 0x10); - INSTANCE_WR(ctx, 0x424C/4, 0x3F); - INSTANCE_WR(ctx, 0x432C/4, 0x1); - INSTANCE_WR(ctx, 0x436C/4, 0x1); - INSTANCE_WR(ctx, 0x43AC/4, 0x1); - INSTANCE_WR(ctx, 0x454C/4, 0x11); - INSTANCE_WR(ctx, 0x464C/4, 0xF); - INSTANCE_WR(ctx, 0x474C/4, 0x11); - INSTANCE_WR(ctx, 0x482C/4, 0x1); - INSTANCE_WR(ctx, 0x484C/4, 0x1); - INSTANCE_WR(ctx, 0x486C/4, 0x1); - INSTANCE_WR(ctx, 0x488C/4, 0x2); - INSTANCE_WR(ctx, 0x48AC/4, 0x1); - INSTANCE_WR(ctx, 0x48CC/4, 0x2); - INSTANCE_WR(ctx, 0x48EC/4, 0x1); - INSTANCE_WR(ctx, 0x492C/4, 0x1FFE67); - INSTANCE_WR(ctx, 0x496C/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x4C2C/4, 0x1); - INSTANCE_WR(ctx, 0x4C4C/4, 0x2); - INSTANCE_WR(ctx, 0x4C6C/4, 0x1); - INSTANCE_WR(ctx, 0x4C8C/4, 0x1); - INSTANCE_WR(ctx, 0x4CAC/4, 0x2); - INSTANCE_WR(ctx, 0x4CCC/4, 0x1); - INSTANCE_WR(ctx, 0x4CEC/4, 0x1); - INSTANCE_WR(ctx, 0x4D6C/4, 0x11); - INSTANCE_WR(ctx, 0x4D8C/4, 0x1); - INSTANCE_WR(ctx, 0xA30/4, 0x4); - INSTANCE_WR(ctx, 0xCF0/4, 0x4); - INSTANCE_WR(ctx, 0xD10/4, 0x4); - INSTANCE_WR(ctx, 0xD30/4, 0x608080); - INSTANCE_WR(ctx, 0xDD0/4, 0x4); - INSTANCE_WR(ctx, 0xE30/4, 0x4); - INSTANCE_WR(ctx, 0xE50/4, 0x4); - INSTANCE_WR(ctx, 0xE70/4, 0x80); - INSTANCE_WR(ctx, 0xE90/4, 0x1E00); - INSTANCE_WR(ctx, 0xEB0/4, 0x4); - INSTANCE_WR(ctx, 0x1350/4, 0x4); - INSTANCE_WR(ctx, 0x1370/4, 0x80); - INSTANCE_WR(ctx, 0x1390/4, 0x4); - INSTANCE_WR(ctx, 0x13B0/4, 0x3020100); - INSTANCE_WR(ctx, 0x13D0/4, 0x3); - INSTANCE_WR(ctx, 0x13F0/4, 0x1E00); - INSTANCE_WR(ctx, 0x1410/4, 0x4); - INSTANCE_WR(ctx, 0x14B0/4, 0x4); - INSTANCE_WR(ctx, 0x14D0/4, 0x3); - INSTANCE_WR(ctx, 0x1550/4, 0x4); - INSTANCE_WR(ctx, 0x159F0/4, 0x4); - INSTANCE_WR(ctx, 0x15A10/4, 0x3); - INSTANCE_WR(ctx, 0x15C50/4, 0xF); - INSTANCE_WR(ctx, 0x15DD0/4, 0x4); - INSTANCE_WR(ctx, 0x15DF0/4, 0xFFFF); - INSTANCE_WR(ctx, 0x15E10/4, 0xFFFF); - INSTANCE_WR(ctx, 0x15E30/4, 0xFFFF); - INSTANCE_WR(ctx, 0x15E50/4, 0xFFFF); - INSTANCE_WR(ctx, 0x15F70/4, 0x1); - INSTANCE_WR(ctx, 0x15FF0/4, 0x1); - INSTANCE_WR(ctx, 0x160B0/4, 0x1); - INSTANCE_WR(ctx, 0x16250/4, 0x1); - INSTANCE_WR(ctx, 0x16270/4, 0x1); - INSTANCE_WR(ctx, 0x16290/4, 0x2); - INSTANCE_WR(ctx, 0x162B0/4, 0x1); - INSTANCE_WR(ctx, 0x162D0/4, 0x1); - INSTANCE_WR(ctx, 0x162F0/4, 0x2); - INSTANCE_WR(ctx, 0x16310/4, 0x1); - INSTANCE_WR(ctx, 0x16350/4, 0x11); - INSTANCE_WR(ctx, 0x16450/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x164B0/4, 0x4); - INSTANCE_WR(ctx, 0x16530/4, 0x11); - INSTANCE_WR(ctx, 0x16550/4, 0x1); - INSTANCE_WR(ctx, 0x16590/4, 0xCF); - INSTANCE_WR(ctx, 0x165B0/4, 0xCF); - INSTANCE_WR(ctx, 0x165D0/4, 0xCF); - INSTANCE_WR(ctx, 0x16730/4, 0x1); - INSTANCE_WR(ctx, 0x16750/4, 0x1); - INSTANCE_WR(ctx, 0x16770/4, 0x2); - INSTANCE_WR(ctx, 0x16790/4, 0x1); - INSTANCE_WR(ctx, 0x167B0/4, 0x1); - INSTANCE_WR(ctx, 0x167D0/4, 0x2); - INSTANCE_WR(ctx, 0x167F0/4, 0x1); - INSTANCE_WR(ctx, 0x16830/4, 0x1); - INSTANCE_WR(ctx, 0x16850/4, 0x1); - INSTANCE_WR(ctx, 0x16870/4, 0x1); - INSTANCE_WR(ctx, 0x16890/4, 0x1); - INSTANCE_WR(ctx, 0x168B0/4, 0x1); - INSTANCE_WR(ctx, 0x168D0/4, 0x1); - INSTANCE_WR(ctx, 0x168F0/4, 0x1); - INSTANCE_WR(ctx, 0x16910/4, 0x1); - INSTANCE_WR(ctx, 0x16930/4, 0x11); - INSTANCE_WR(ctx, 0x16A30/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x16A50/4, 0xF); - INSTANCE_WR(ctx, 0x16B50/4, 0x1FFE67); - INSTANCE_WR(ctx, 0x16BB0/4, 0x11); - INSTANCE_WR(ctx, 0x16BD0/4, 0x1); - INSTANCE_WR(ctx, 0x16C50/4, 0x4); - INSTANCE_WR(ctx, 0x16D10/4, 0x1); - INSTANCE_WR(ctx, 0x16DB0/4, 0x11); - INSTANCE_WR(ctx, 0x16EB0/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x16F30/4, 0x11); - INSTANCE_WR(ctx, 0x16F50/4, 0x1); - INSTANCE_WR(ctx, 0x16F90/4, 0x1); - INSTANCE_WR(ctx, 0x16FD0/4, 0x1); - INSTANCE_WR(ctx, 0x17010/4, 0x7FF); - INSTANCE_WR(ctx, 0x17050/4, 0x1); - INSTANCE_WR(ctx, 0x17090/4, 0x1); - INSTANCE_WR(ctx, 0x175F0/4, 0x8); - INSTANCE_WR(ctx, 0x17610/4, 0x8); - INSTANCE_WR(ctx, 0x17630/4, 0x8); - INSTANCE_WR(ctx, 0x17650/4, 0x8); - INSTANCE_WR(ctx, 0x17670/4, 0x8); - INSTANCE_WR(ctx, 0x17690/4, 0x8); - INSTANCE_WR(ctx, 0x176B0/4, 0x8); - INSTANCE_WR(ctx, 0x176D0/4, 0x8); - INSTANCE_WR(ctx, 0x176F0/4, 0x11); - INSTANCE_WR(ctx, 0x177F0/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x17810/4, 0x400); - INSTANCE_WR(ctx, 0x17830/4, 0x400); - INSTANCE_WR(ctx, 0x17850/4, 0x400); - INSTANCE_WR(ctx, 0x17870/4, 0x400); - INSTANCE_WR(ctx, 0x17890/4, 0x400); - INSTANCE_WR(ctx, 0x178B0/4, 0x400); - INSTANCE_WR(ctx, 0x178D0/4, 0x400); - INSTANCE_WR(ctx, 0x178F0/4, 0x400); - INSTANCE_WR(ctx, 0x17910/4, 0x300); - INSTANCE_WR(ctx, 0x17930/4, 0x300); - INSTANCE_WR(ctx, 0x17950/4, 0x300); - INSTANCE_WR(ctx, 0x17970/4, 0x300); - INSTANCE_WR(ctx, 0x17990/4, 0x300); - INSTANCE_WR(ctx, 0x179B0/4, 0x300); - INSTANCE_WR(ctx, 0x179D0/4, 0x300); - INSTANCE_WR(ctx, 0x179F0/4, 0x300); - INSTANCE_WR(ctx, 0x17A10/4, 0x1); - INSTANCE_WR(ctx, 0x17A30/4, 0xF); - INSTANCE_WR(ctx, 0x17B30/4, 0x20); - INSTANCE_WR(ctx, 0x17B50/4, 0x11); - INSTANCE_WR(ctx, 0x17B70/4, 0x100); - INSTANCE_WR(ctx, 0x17BB0/4, 0x1); - INSTANCE_WR(ctx, 0x17C10/4, 0x40); - INSTANCE_WR(ctx, 0x17C30/4, 0x100); - INSTANCE_WR(ctx, 0x17C70/4, 0x3); - INSTANCE_WR(ctx, 0x17D10/4, 0x1FFE67); - INSTANCE_WR(ctx, 0x17D90/4, 0x2); - INSTANCE_WR(ctx, 0x17DB0/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x17EF0/4, 0x1); - INSTANCE_WR(ctx, 0x17F90/4, 0x4); - INSTANCE_WR(ctx, 0x17FD0/4, 0x1); - INSTANCE_WR(ctx, 0x17FF0/4, 0x400); - INSTANCE_WR(ctx, 0x18010/4, 0x300); - INSTANCE_WR(ctx, 0x18030/4, 0x1001); - INSTANCE_WR(ctx, 0x180B0/4, 0x11); - INSTANCE_WR(ctx, 0x181B0/4, 0xFAC6881); - INSTANCE_WR(ctx, 0x181D0/4, 0xF); - INSTANCE_WR(ctx, 0x184D0/4, 0x1FFE67); - INSTANCE_WR(ctx, 0x18550/4, 0x11); - INSTANCE_WR(ctx, 0x185B0/4, 0x4); - INSTANCE_WR(ctx, 0x185F0/4, 0x1); - INSTANCE_WR(ctx, 0x18610/4, 0x1); - INSTANCE_WR(ctx, 0x18690/4, 0x1); - INSTANCE_WR(ctx, 0x18730/4, 0x1); - INSTANCE_WR(ctx, 0x18770/4, 0x1); - INSTANCE_WR(ctx, 0x187F0/4, 0x2A712488); - INSTANCE_WR(ctx, 0x18830/4, 0x4085C000); - INSTANCE_WR(ctx, 0x18850/4, 0x40); - INSTANCE_WR(ctx, 0x18870/4, 0x100); - INSTANCE_WR(ctx, 0x18890/4, 0x10100); - INSTANCE_WR(ctx, 0x188B0/4, 0x2800000); - INSTANCE_WR(ctx, 0x18B10/4, 0x4E3BFDF); - INSTANCE_WR(ctx, 0x18B30/4, 0x4E3BFDF); - INSTANCE_WR(ctx, 0x18B50/4, 0x1); - INSTANCE_WR(ctx, 0x18B90/4, 0xFFFF00); - INSTANCE_WR(ctx, 0x18BB0/4, 0x1); - INSTANCE_WR(ctx, 0x18C10/4, 0xFFFF00); - INSTANCE_WR(ctx, 0x18D30/4, 0x1); - INSTANCE_WR(ctx, 0x18D70/4, 0x1); - INSTANCE_WR(ctx, 0x18D90/4, 0x30201000); - INSTANCE_WR(ctx, 0x18DB0/4, 0x70605040); - INSTANCE_WR(ctx, 0x18DD0/4, 0xB8A89888); - INSTANCE_WR(ctx, 0x18DF0/4, 0xF8E8D8C8); - INSTANCE_WR(ctx, 0x18E30/4, 0x1A); + INSTANCE_WR(ctx, 0x0010c/4, 0x00000030); + INSTANCE_WR(ctx, 0x00120/4, 0xff400040); + INSTANCE_WR(ctx, 0x00124/4, 0xfff00080); + INSTANCE_WR(ctx, 0x00128/4, 0xfff70090); + INSTANCE_WR(ctx, 0x0012c/4, 0xffe806a8); + INSTANCE_WR(ctx, 0x001d4/4, 0x00000003); + INSTANCE_WR(ctx, 0x001d8/4, 0x00001000); + INSTANCE_WR(ctx, 0x00214/4, 0x0000fe0c); + INSTANCE_WR(ctx, 0x00228/4, 0x00001000); + INSTANCE_WR(ctx, 0x00254/4, 0x0001fd87); + INSTANCE_WR(ctx, 0x00268/4, 0x00001018); + INSTANCE_WR(ctx, 0x0026c/4, 0x000000ff); + INSTANCE_WR(ctx, 0x002a4/4, 0x00000004); + INSTANCE_WR(ctx, 0x002a8/4, 0x0001005f); + INSTANCE_WR(ctx, 0x002b0/4, 0x00000600); + INSTANCE_WR(ctx, 0x002b4/4, 0x00000006); + INSTANCE_WR(ctx, 0x002c8/4, 0x000000ff); + INSTANCE_WR(ctx, 0x002d0/4, 0x00000400); + INSTANCE_WR(ctx, 0x002e4/4, 0x00000001); + INSTANCE_WR(ctx, 0x002e8/4, 0x00300080); + INSTANCE_WR(ctx, 0x002ec/4, 0x00000004); + INSTANCE_WR(ctx, 0x00308/4, 0x00000002); + INSTANCE_WR(ctx, 0x0030c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00318/4, 0x00000001); + INSTANCE_WR(ctx, 0x0031c/4, 0x00000100); + INSTANCE_WR(ctx, 0x00334/4, 0x00000002); + INSTANCE_WR(ctx, 0x00338/4, 0x00000001); + INSTANCE_WR(ctx, 0x0033c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0034c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00350/4, 0x003fffff); + INSTANCE_WR(ctx, 0x00354/4, 0x00001fff); + INSTANCE_WR(ctx, 0x0035c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00360/4, 0x00000001); + INSTANCE_WR(ctx, 0x00368/4, 0x00000001); + INSTANCE_WR(ctx, 0x00368/4, 0x00000001); + INSTANCE_WR(ctx, 0x00368/4, 0x00000001); + INSTANCE_WR(ctx, 0x00368/4, 0x00000004); + INSTANCE_WR(ctx, 0x00368/4, 0x00000001); + INSTANCE_WR(ctx, 0x00368/4, 0x00000001); + INSTANCE_WR(ctx, 0x00368/4, 0x00000001); + INSTANCE_WR(ctx, 0x00368/4, 0x00000007); + INSTANCE_WR(ctx, 0x00388/4, 0x00000001); + INSTANCE_WR(ctx, 0x00388/4, 0x00000007); + INSTANCE_WR(ctx, 0x00388/4, 0x00000001); + INSTANCE_WR(ctx, 0x00388/4, 0x00000001); + INSTANCE_WR(ctx, 0x00388/4, 0x00000001); + INSTANCE_WR(ctx, 0x003ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x003b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x003b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x003bc/4, 0x0000000a); + INSTANCE_WR(ctx, 0x003cc/4, 0x00000040); + INSTANCE_WR(ctx, 0x003d4/4, 0x00000002); + INSTANCE_WR(ctx, 0x003d4/4, 0x00000100); + INSTANCE_WR(ctx, 0x003d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x003d4/4, 0x00000100); + INSTANCE_WR(ctx, 0x003fc/4, 0x00000001); + INSTANCE_WR(ctx, 0x00420/4, 0x00000004); + INSTANCE_WR(ctx, 0x00438/4, 0x00000001); + INSTANCE_WR(ctx, 0x0043c/4, 0x00000100); + INSTANCE_WR(ctx, 0x00444/4, 0x00000001); + INSTANCE_WR(ctx, 0x00450/4, 0x00000100); + INSTANCE_WR(ctx, 0x00454/4, 0x00000001); + INSTANCE_WR(ctx, 0x00458/4, 0x00000100); + INSTANCE_WR(ctx, 0x00460/4, 0x00000001); + INSTANCE_WR(ctx, 0x0046c/4, 0x00000100); + INSTANCE_WR(ctx, 0x00470/4, 0x00000001); + INSTANCE_WR(ctx, 0x00478/4, 0x00000001); + INSTANCE_WR(ctx, 0x00484/4, 0x00000002); + INSTANCE_WR(ctx, 0x0048c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00494/4, 0x00000001); + INSTANCE_WR(ctx, 0x004a8/4, 0x00000003); + INSTANCE_WR(ctx, 0x004c4/4, 0x00000004); + INSTANCE_WR(ctx, 0x004c8/4, 0x00000070); + INSTANCE_WR(ctx, 0x004cc/4, 0x00000080); + INSTANCE_WR(ctx, 0x004e0/4, 0x0000000c); + INSTANCE_WR(ctx, 0x004e0/4, 0x00000008); + INSTANCE_WR(ctx, 0x004e0/4, 0x00000014); + INSTANCE_WR(ctx, 0x004e0/4, 0x00000026); + INSTANCE_WR(ctx, 0x004f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x004f8/4, 0x00000002); + INSTANCE_WR(ctx, 0x004f8/4, 0x00000003); + INSTANCE_WR(ctx, 0x004f8/4, 0x00000004); + INSTANCE_WR(ctx, 0x004f8/4, 0x00000005); + INSTANCE_WR(ctx, 0x004f8/4, 0x00000006); + INSTANCE_WR(ctx, 0x004f8/4, 0x00000007); + INSTANCE_WR(ctx, 0x004f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x00558/4, 0x000000cf); + INSTANCE_WR(ctx, 0x00584/4, 0x00000080); + INSTANCE_WR(ctx, 0x00584/4, 0x00000004); + INSTANCE_WR(ctx, 0x00584/4, 0x00000004); + INSTANCE_WR(ctx, 0x00584/4, 0x00000001); + INSTANCE_WR(ctx, 0x00598/4, 0x00000012); + INSTANCE_WR(ctx, 0x00598/4, 0x00000010); + INSTANCE_WR(ctx, 0x00598/4, 0x0000000c); + INSTANCE_WR(ctx, 0x00598/4, 0x00000001); + INSTANCE_WR(ctx, 0x005b4/4, 0x00000004); + INSTANCE_WR(ctx, 0x005b8/4, 0x00000002); + INSTANCE_WR(ctx, 0x005bc/4, 0x00000004); + INSTANCE_WR(ctx, 0x005c8/4, 0x003fffff); + INSTANCE_WR(ctx, 0x005cc/4, 0x00001fff); + INSTANCE_WR(ctx, 0x005d4/4, 0x00000004); + INSTANCE_WR(ctx, 0x005d8/4, 0x00000014); + INSTANCE_WR(ctx, 0x005dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x005e8/4, 0x00000002); + INSTANCE_WR(ctx, 0x005f4/4, 0x00000001); + INSTANCE_WR(ctx, 0x005fc/4, 0x00000002); + INSTANCE_WR(ctx, 0x00600/4, 0x00001000); + INSTANCE_WR(ctx, 0x00608/4, 0x00000001); + INSTANCE_WR(ctx, 0x00608/4, 0x00000001); + INSTANCE_WR(ctx, 0x00608/4, 0x00000001); + INSTANCE_WR(ctx, 0x00608/4, 0x00000001); + INSTANCE_WR(ctx, 0x00608/4, 0x00000001); + INSTANCE_WR(ctx, 0x00628/4, 0x00000200); + INSTANCE_WR(ctx, 0x00630/4, 0x00000001); + INSTANCE_WR(ctx, 0x00634/4, 0x00000070); + INSTANCE_WR(ctx, 0x00638/4, 0x00000080); + INSTANCE_WR(ctx, 0x00644/4, 0x00000001); + INSTANCE_WR(ctx, 0x00648/4, 0x00000070); + INSTANCE_WR(ctx, 0x0064c/4, 0x00000080); + INSTANCE_WR(ctx, 0x0065c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00660/4, 0x000000cf); + INSTANCE_WR(ctx, 0x00668/4, 0x00000001); + INSTANCE_WR(ctx, 0x00678/4, 0x000000cf); + INSTANCE_WR(ctx, 0x00680/4, 0x00000002); + INSTANCE_WR(ctx, 0x00688/4, 0x00000001); + INSTANCE_WR(ctx, 0x00690/4, 0x00000001); + INSTANCE_WR(ctx, 0x00698/4, 0x000000cf); + INSTANCE_WR(ctx, 0x0069c/4, 0x000000cf); + INSTANCE_WR(ctx, 0x006a0/4, 0x00000001); + INSTANCE_WR(ctx, 0x006ac/4, 0x00000f80); + INSTANCE_WR(ctx, 0x006f4/4, 0x007f0080); + INSTANCE_WR(ctx, 0x00730/4, 0x007f0080); + INSTANCE_WR(ctx, 0x00754/4, 0x1b74f820); + INSTANCE_WR(ctx, 0x00758/4, 0x89058001); + INSTANCE_WR(ctx, 0x00760/4, 0x00001000); + INSTANCE_WR(ctx, 0x00760/4, 0x027c10fa); + INSTANCE_WR(ctx, 0x00760/4, 0x000000c0); + INSTANCE_WR(ctx, 0x00760/4, 0xb7892080); + INSTANCE_WR(ctx, 0x00778/4, 0x1b74f820); + INSTANCE_WR(ctx, 0x0077c/4, 0x89058001); + INSTANCE_WR(ctx, 0x00784/4, 0x00001000); + INSTANCE_WR(ctx, 0x00784/4, 0x027c10fa); + INSTANCE_WR(ctx, 0x00784/4, 0x000000c0); + INSTANCE_WR(ctx, 0x00784/4, 0xb7892080); + INSTANCE_WR(ctx, 0x0079c/4, 0x1b74f820); + INSTANCE_WR(ctx, 0x007a0/4, 0x89058001); + INSTANCE_WR(ctx, 0x007a8/4, 0x00001000); + INSTANCE_WR(ctx, 0x007a8/4, 0x027c10fa); + INSTANCE_WR(ctx, 0x007a8/4, 0x000000c0); + INSTANCE_WR(ctx, 0x007a8/4, 0xb7892080); + INSTANCE_WR(ctx, 0x007c0/4, 0x1b74f820); + INSTANCE_WR(ctx, 0x007c4/4, 0x89058001); + INSTANCE_WR(ctx, 0x007cc/4, 0x00001000); + INSTANCE_WR(ctx, 0x007cc/4, 0x027c10fa); + INSTANCE_WR(ctx, 0x007cc/4, 0x000000c0); + INSTANCE_WR(ctx, 0x007cc/4, 0xb7892080); + INSTANCE_WR(ctx, 0x007e4/4, 0x1b74f820); + INSTANCE_WR(ctx, 0x007e8/4, 0x89058001); + INSTANCE_WR(ctx, 0x007f0/4, 0x00001000); + INSTANCE_WR(ctx, 0x007f0/4, 0x027c10fa); + INSTANCE_WR(ctx, 0x007f0/4, 0x000000c0); + INSTANCE_WR(ctx, 0x007f0/4, 0xb7892080); + INSTANCE_WR(ctx, 0x00808/4, 0x1b74f820); + INSTANCE_WR(ctx, 0x0080c/4, 0x89058001); + INSTANCE_WR(ctx, 0x00814/4, 0x00001000); + INSTANCE_WR(ctx, 0x00814/4, 0x027c10fa); + INSTANCE_WR(ctx, 0x00814/4, 0x000000c0); + INSTANCE_WR(ctx, 0x00814/4, 0xb7892080); + INSTANCE_WR(ctx, 0x0082c/4, 0x00010040); + INSTANCE_WR(ctx, 0x00834/4, 0x00000022); + INSTANCE_WR(ctx, 0x00840/4, 0x00010040); + INSTANCE_WR(ctx, 0x00844/4, 0x00000022); + INSTANCE_WR(ctx, 0x0085c/4, 0x01800000); + INSTANCE_WR(ctx, 0x00860/4, 0x00160000); + INSTANCE_WR(ctx, 0x00864/4, 0x01800000); + INSTANCE_WR(ctx, 0x00874/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00878/4, 0x000c0000); + INSTANCE_WR(ctx, 0x0089c/4, 0x00010401); + INSTANCE_WR(ctx, 0x008a4/4, 0x00000040); + INSTANCE_WR(ctx, 0x008ac/4, 0x000000bf); + INSTANCE_WR(ctx, 0x008b4/4, 0x00001210); + INSTANCE_WR(ctx, 0x008b8/4, 0x00000080); + INSTANCE_WR(ctx, 0x008dc/4, 0x01800000); + INSTANCE_WR(ctx, 0x008e0/4, 0x00160000); + INSTANCE_WR(ctx, 0x008e4/4, 0x01800000); + INSTANCE_WR(ctx, 0x008f4/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x008f8/4, 0x000c0000); + INSTANCE_WR(ctx, 0x0091c/4, 0x00010401); + INSTANCE_WR(ctx, 0x00924/4, 0x00000040); + INSTANCE_WR(ctx, 0x0092c/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00934/4, 0x00001210); + INSTANCE_WR(ctx, 0x00938/4, 0x00000080); + INSTANCE_WR(ctx, 0x00960/4, 0x00007070); + INSTANCE_WR(ctx, 0x0096c/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00984/4, 0x00120407); + INSTANCE_WR(ctx, 0x00984/4, 0x05091507); + INSTANCE_WR(ctx, 0x00984/4, 0x05010202); + INSTANCE_WR(ctx, 0x00984/4, 0x00030201); + INSTANCE_WR(ctx, 0x009ac/4, 0x00000040); + INSTANCE_WR(ctx, 0x009ac/4, 0x0d0c0b0a); + INSTANCE_WR(ctx, 0x009ac/4, 0x00141210); + INSTANCE_WR(ctx, 0x009ac/4, 0x000001f0); + INSTANCE_WR(ctx, 0x009ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x009ac/4, 0x00000003); + INSTANCE_WR(ctx, 0x009ac/4, 0x00008000); + INSTANCE_WR(ctx, 0x009cc/4, 0x00039e00); + INSTANCE_WR(ctx, 0x009cc/4, 0x00000040); + INSTANCE_WR(ctx, 0x009cc/4, 0x00003800); + INSTANCE_WR(ctx, 0x009cc/4, 0x00404040); + INSTANCE_WR(ctx, 0x009cc/4, 0x0000ff0a); + INSTANCE_WR(ctx, 0x009e4/4, 0x0077f005); + INSTANCE_WR(ctx, 0x009e8/4, 0x00007fff); + INSTANCE_WR(ctx, 0x009f4/4, 0x000003ff); + INSTANCE_WR(ctx, 0x009f4/4, 0x00000003); + INSTANCE_WR(ctx, 0x009f4/4, 0x00000003); + INSTANCE_WR(ctx, 0x009f4/4, 0x000001ff); + INSTANCE_WR(ctx, 0x009f4/4, 0x0000001f); + INSTANCE_WR(ctx, 0x009f4/4, 0x0000000f); + INSTANCE_WR(ctx, 0x009f4/4, 0x0000000f); + INSTANCE_WR(ctx, 0x00a14/4, 0x01800000); + INSTANCE_WR(ctx, 0x00a18/4, 0x00160000); + INSTANCE_WR(ctx, 0x00a1c/4, 0x01800000); + INSTANCE_WR(ctx, 0x00a2c/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00a30/4, 0x000c0000); + INSTANCE_WR(ctx, 0x00a54/4, 0x00010401); + INSTANCE_WR(ctx, 0x00a5c/4, 0x00000040); + INSTANCE_WR(ctx, 0x00a64/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00a6c/4, 0x00001210); + INSTANCE_WR(ctx, 0x00a70/4, 0x00000080); + INSTANCE_WR(ctx, 0x00a94/4, 0x01800000); + INSTANCE_WR(ctx, 0x00a98/4, 0x00160000); + INSTANCE_WR(ctx, 0x00a9c/4, 0x01800000); + INSTANCE_WR(ctx, 0x00aac/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00ab0/4, 0x000c0000); + INSTANCE_WR(ctx, 0x00ad4/4, 0x00010401); + INSTANCE_WR(ctx, 0x00adc/4, 0x00000040); + INSTANCE_WR(ctx, 0x00ae4/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00aec/4, 0x00001210); + INSTANCE_WR(ctx, 0x00af0/4, 0x00000080); + INSTANCE_WR(ctx, 0x00b18/4, 0x00007070); + INSTANCE_WR(ctx, 0x00b24/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00b3c/4, 0x00120407); + INSTANCE_WR(ctx, 0x00b3c/4, 0x05091507); + INSTANCE_WR(ctx, 0x00b3c/4, 0x05010202); + INSTANCE_WR(ctx, 0x00b3c/4, 0x00030201); + INSTANCE_WR(ctx, 0x00b64/4, 0x00000040); + INSTANCE_WR(ctx, 0x00b64/4, 0x0d0c0b0a); + INSTANCE_WR(ctx, 0x00b64/4, 0x00141210); + INSTANCE_WR(ctx, 0x00b64/4, 0x000001f0); + INSTANCE_WR(ctx, 0x00b64/4, 0x00000001); + INSTANCE_WR(ctx, 0x00b64/4, 0x00000003); + INSTANCE_WR(ctx, 0x00b64/4, 0x00008000); + INSTANCE_WR(ctx, 0x00b84/4, 0x00039e00); + INSTANCE_WR(ctx, 0x00b84/4, 0x00000040); + INSTANCE_WR(ctx, 0x00b84/4, 0x00003800); + INSTANCE_WR(ctx, 0x00b84/4, 0x00404040); + INSTANCE_WR(ctx, 0x00b84/4, 0x0000ff0a); + INSTANCE_WR(ctx, 0x00b9c/4, 0x0077f005); + INSTANCE_WR(ctx, 0x00ba0/4, 0x00007fff); + INSTANCE_WR(ctx, 0x00bac/4, 0x000003ff); + INSTANCE_WR(ctx, 0x00bac/4, 0x00000003); + INSTANCE_WR(ctx, 0x00bac/4, 0x00000003); + INSTANCE_WR(ctx, 0x00bac/4, 0x000001ff); + INSTANCE_WR(ctx, 0x00bac/4, 0x0000001f); + INSTANCE_WR(ctx, 0x00bac/4, 0x0000000f); + INSTANCE_WR(ctx, 0x00bac/4, 0x0000000f); + INSTANCE_WR(ctx, 0x00bcc/4, 0x01800000); + INSTANCE_WR(ctx, 0x00bd0/4, 0x00160000); + INSTANCE_WR(ctx, 0x00bd4/4, 0x01800000); + INSTANCE_WR(ctx, 0x00be4/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00be8/4, 0x000c0000); + INSTANCE_WR(ctx, 0x00c0c/4, 0x00010401); + INSTANCE_WR(ctx, 0x00c14/4, 0x00000040); + INSTANCE_WR(ctx, 0x00c1c/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00c24/4, 0x00001210); + INSTANCE_WR(ctx, 0x00c28/4, 0x00000080); + INSTANCE_WR(ctx, 0x00c4c/4, 0x01800000); + INSTANCE_WR(ctx, 0x00c50/4, 0x00160000); + INSTANCE_WR(ctx, 0x00c54/4, 0x01800000); + INSTANCE_WR(ctx, 0x00c64/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00c68/4, 0x000c0000); + INSTANCE_WR(ctx, 0x00c8c/4, 0x00010401); + INSTANCE_WR(ctx, 0x00c94/4, 0x00000040); + INSTANCE_WR(ctx, 0x00c9c/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00ca4/4, 0x00001210); + INSTANCE_WR(ctx, 0x00ca8/4, 0x00000080); + INSTANCE_WR(ctx, 0x00cd0/4, 0x00007070); + INSTANCE_WR(ctx, 0x00cdc/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00cf4/4, 0x00120407); + INSTANCE_WR(ctx, 0x00cf4/4, 0x05091507); + INSTANCE_WR(ctx, 0x00cf4/4, 0x05010202); + INSTANCE_WR(ctx, 0x00cf4/4, 0x00030201); + INSTANCE_WR(ctx, 0x00d1c/4, 0x00000040); + INSTANCE_WR(ctx, 0x00d1c/4, 0x0d0c0b0a); + INSTANCE_WR(ctx, 0x00d1c/4, 0x00141210); + INSTANCE_WR(ctx, 0x00d1c/4, 0x000001f0); + INSTANCE_WR(ctx, 0x00d1c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00d1c/4, 0x00000003); + INSTANCE_WR(ctx, 0x00d1c/4, 0x00008000); + INSTANCE_WR(ctx, 0x00d3c/4, 0x00039e00); + INSTANCE_WR(ctx, 0x00d3c/4, 0x00000040); + INSTANCE_WR(ctx, 0x00d3c/4, 0x00003800); + INSTANCE_WR(ctx, 0x00d3c/4, 0x00404040); + INSTANCE_WR(ctx, 0x00d3c/4, 0x0000ff0a); + INSTANCE_WR(ctx, 0x00d54/4, 0x0077f005); + INSTANCE_WR(ctx, 0x00d58/4, 0x00007fff); + INSTANCE_WR(ctx, 0x00d64/4, 0x000003ff); + INSTANCE_WR(ctx, 0x00d64/4, 0x00000003); + INSTANCE_WR(ctx, 0x00d64/4, 0x00000003); + INSTANCE_WR(ctx, 0x00d64/4, 0x000001ff); + INSTANCE_WR(ctx, 0x00d64/4, 0x0000001f); + INSTANCE_WR(ctx, 0x00d64/4, 0x0000000f); + INSTANCE_WR(ctx, 0x00d64/4, 0x0000000f); + INSTANCE_WR(ctx, 0x00d84/4, 0x01800000); + INSTANCE_WR(ctx, 0x00d88/4, 0x00160000); + INSTANCE_WR(ctx, 0x00d8c/4, 0x01800000); + INSTANCE_WR(ctx, 0x00d9c/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00da0/4, 0x000c0000); + INSTANCE_WR(ctx, 0x00dc4/4, 0x00010401); + INSTANCE_WR(ctx, 0x00dcc/4, 0x00000040); + INSTANCE_WR(ctx, 0x00dd4/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00ddc/4, 0x00001210); + INSTANCE_WR(ctx, 0x00de0/4, 0x00000080); + INSTANCE_WR(ctx, 0x00e04/4, 0x01800000); + INSTANCE_WR(ctx, 0x00e08/4, 0x00160000); + INSTANCE_WR(ctx, 0x00e0c/4, 0x01800000); + INSTANCE_WR(ctx, 0x00e1c/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00e20/4, 0x000c0000); + INSTANCE_WR(ctx, 0x00e44/4, 0x00010401); + INSTANCE_WR(ctx, 0x00e4c/4, 0x00000040); + INSTANCE_WR(ctx, 0x00e54/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00e5c/4, 0x00001210); + INSTANCE_WR(ctx, 0x00e60/4, 0x00000080); + INSTANCE_WR(ctx, 0x00e88/4, 0x00007070); + INSTANCE_WR(ctx, 0x00e94/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00eac/4, 0x00120407); + INSTANCE_WR(ctx, 0x00eac/4, 0x05091507); + INSTANCE_WR(ctx, 0x00eac/4, 0x05010202); + INSTANCE_WR(ctx, 0x00eac/4, 0x00030201); + INSTANCE_WR(ctx, 0x00ed4/4, 0x00000040); + INSTANCE_WR(ctx, 0x00ed4/4, 0x0d0c0b0a); + INSTANCE_WR(ctx, 0x00ed4/4, 0x00141210); + INSTANCE_WR(ctx, 0x00ed4/4, 0x000001f0); + INSTANCE_WR(ctx, 0x00ed4/4, 0x00000001); + INSTANCE_WR(ctx, 0x00ed4/4, 0x00000003); + INSTANCE_WR(ctx, 0x00ed4/4, 0x00008000); + INSTANCE_WR(ctx, 0x00ef4/4, 0x00039e00); + INSTANCE_WR(ctx, 0x00ef4/4, 0x00000040); + INSTANCE_WR(ctx, 0x00ef4/4, 0x00003800); + INSTANCE_WR(ctx, 0x00ef4/4, 0x00404040); + INSTANCE_WR(ctx, 0x00ef4/4, 0x0000ff0a); + INSTANCE_WR(ctx, 0x00f0c/4, 0x0077f005); + INSTANCE_WR(ctx, 0x00f10/4, 0x00007fff); + INSTANCE_WR(ctx, 0x00f1c/4, 0x000003ff); + INSTANCE_WR(ctx, 0x00f1c/4, 0x00000003); + INSTANCE_WR(ctx, 0x00f1c/4, 0x00000003); + INSTANCE_WR(ctx, 0x00f1c/4, 0x000001ff); + INSTANCE_WR(ctx, 0x00f1c/4, 0x0000001f); + INSTANCE_WR(ctx, 0x00f1c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x00f1c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x00f3c/4, 0x01800000); + INSTANCE_WR(ctx, 0x00f40/4, 0x00160000); + INSTANCE_WR(ctx, 0x00f44/4, 0x01800000); + INSTANCE_WR(ctx, 0x00f54/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00f58/4, 0x000c0000); + INSTANCE_WR(ctx, 0x00f7c/4, 0x00010401); + INSTANCE_WR(ctx, 0x00f84/4, 0x00000040); + INSTANCE_WR(ctx, 0x00f8c/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00f94/4, 0x00001210); + INSTANCE_WR(ctx, 0x00f98/4, 0x00000080); + INSTANCE_WR(ctx, 0x00fbc/4, 0x01800000); + INSTANCE_WR(ctx, 0x00fc0/4, 0x00160000); + INSTANCE_WR(ctx, 0x00fc4/4, 0x01800000); + INSTANCE_WR(ctx, 0x00fd4/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00fd8/4, 0x000c0000); + INSTANCE_WR(ctx, 0x00ffc/4, 0x00010401); + INSTANCE_WR(ctx, 0x01004/4, 0x00000040); + INSTANCE_WR(ctx, 0x0100c/4, 0x000000bf); + INSTANCE_WR(ctx, 0x01014/4, 0x00001210); + INSTANCE_WR(ctx, 0x01018/4, 0x00000080); + INSTANCE_WR(ctx, 0x01040/4, 0x00007070); + INSTANCE_WR(ctx, 0x0104c/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x01064/4, 0x00120407); + INSTANCE_WR(ctx, 0x01064/4, 0x05091507); + INSTANCE_WR(ctx, 0x01064/4, 0x05010202); + INSTANCE_WR(ctx, 0x01064/4, 0x00030201); + INSTANCE_WR(ctx, 0x0108c/4, 0x00000040); + INSTANCE_WR(ctx, 0x0108c/4, 0x0d0c0b0a); + INSTANCE_WR(ctx, 0x0108c/4, 0x00141210); + INSTANCE_WR(ctx, 0x0108c/4, 0x000001f0); + INSTANCE_WR(ctx, 0x0108c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0108c/4, 0x00000003); + INSTANCE_WR(ctx, 0x0108c/4, 0x00008000); + INSTANCE_WR(ctx, 0x010ac/4, 0x00039e00); + INSTANCE_WR(ctx, 0x010ac/4, 0x00000040); + INSTANCE_WR(ctx, 0x010ac/4, 0x00003800); + INSTANCE_WR(ctx, 0x010ac/4, 0x00404040); + INSTANCE_WR(ctx, 0x010ac/4, 0x0000ff0a); + INSTANCE_WR(ctx, 0x010c4/4, 0x0077f005); + INSTANCE_WR(ctx, 0x010c8/4, 0x00007fff); + INSTANCE_WR(ctx, 0x010d4/4, 0x000003ff); + INSTANCE_WR(ctx, 0x010d4/4, 0x00000003); + INSTANCE_WR(ctx, 0x010d4/4, 0x00000003); + INSTANCE_WR(ctx, 0x010d4/4, 0x000001ff); + INSTANCE_WR(ctx, 0x010d4/4, 0x0000001f); + INSTANCE_WR(ctx, 0x010d4/4, 0x0000000f); + INSTANCE_WR(ctx, 0x010d4/4, 0x0000000f); + INSTANCE_WR(ctx, 0x010f4/4, 0x01800000); + INSTANCE_WR(ctx, 0x010f8/4, 0x00160000); + INSTANCE_WR(ctx, 0x010fc/4, 0x01800000); + INSTANCE_WR(ctx, 0x0110c/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x01110/4, 0x000c0000); + INSTANCE_WR(ctx, 0x01134/4, 0x00010401); + INSTANCE_WR(ctx, 0x0113c/4, 0x00000040); + INSTANCE_WR(ctx, 0x01144/4, 0x000000bf); + INSTANCE_WR(ctx, 0x0114c/4, 0x00001210); + INSTANCE_WR(ctx, 0x01150/4, 0x00000080); + INSTANCE_WR(ctx, 0x01174/4, 0x01800000); + INSTANCE_WR(ctx, 0x01178/4, 0x00160000); + INSTANCE_WR(ctx, 0x0117c/4, 0x01800000); + INSTANCE_WR(ctx, 0x0118c/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x01190/4, 0x000c0000); + INSTANCE_WR(ctx, 0x011b4/4, 0x00010401); + INSTANCE_WR(ctx, 0x011bc/4, 0x00000040); + INSTANCE_WR(ctx, 0x011c4/4, 0x000000bf); + INSTANCE_WR(ctx, 0x011cc/4, 0x00001210); + INSTANCE_WR(ctx, 0x011d0/4, 0x00000080); + INSTANCE_WR(ctx, 0x011f8/4, 0x00007070); + INSTANCE_WR(ctx, 0x01204/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x0121c/4, 0x00120407); + INSTANCE_WR(ctx, 0x0121c/4, 0x05091507); + INSTANCE_WR(ctx, 0x0121c/4, 0x05010202); + INSTANCE_WR(ctx, 0x0121c/4, 0x00030201); + INSTANCE_WR(ctx, 0x01244/4, 0x00000040); + INSTANCE_WR(ctx, 0x01244/4, 0x0d0c0b0a); + INSTANCE_WR(ctx, 0x01244/4, 0x00141210); + INSTANCE_WR(ctx, 0x01244/4, 0x000001f0); + INSTANCE_WR(ctx, 0x01244/4, 0x00000001); + INSTANCE_WR(ctx, 0x01244/4, 0x00000003); + INSTANCE_WR(ctx, 0x01244/4, 0x00008000); + INSTANCE_WR(ctx, 0x01264/4, 0x00039e00); + INSTANCE_WR(ctx, 0x01264/4, 0x00000040); + INSTANCE_WR(ctx, 0x01264/4, 0x00003800); + INSTANCE_WR(ctx, 0x01264/4, 0x00404040); + INSTANCE_WR(ctx, 0x01264/4, 0x0000ff0a); + INSTANCE_WR(ctx, 0x0127c/4, 0x0077f005); + INSTANCE_WR(ctx, 0x01280/4, 0x00007fff); + INSTANCE_WR(ctx, 0x0128c/4, 0x000003ff); + INSTANCE_WR(ctx, 0x0128c/4, 0x00000003); + INSTANCE_WR(ctx, 0x0128c/4, 0x00000003); + INSTANCE_WR(ctx, 0x0128c/4, 0x000001ff); + INSTANCE_WR(ctx, 0x0128c/4, 0x0000001f); + INSTANCE_WR(ctx, 0x0128c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x0128c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x012ac/4, 0x01800000); + INSTANCE_WR(ctx, 0x012b0/4, 0x00160000); + INSTANCE_WR(ctx, 0x012b4/4, 0x01800000); + INSTANCE_WR(ctx, 0x012c4/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x012c8/4, 0x000c0000); + INSTANCE_WR(ctx, 0x012ec/4, 0x00010401); + INSTANCE_WR(ctx, 0x012f4/4, 0x00000040); + INSTANCE_WR(ctx, 0x012fc/4, 0x000000bf); + INSTANCE_WR(ctx, 0x01304/4, 0x00001210); + INSTANCE_WR(ctx, 0x01308/4, 0x00000080); + INSTANCE_WR(ctx, 0x0132c/4, 0x01800000); + INSTANCE_WR(ctx, 0x01330/4, 0x00160000); + INSTANCE_WR(ctx, 0x01334/4, 0x01800000); + INSTANCE_WR(ctx, 0x01344/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x01348/4, 0x000c0000); + INSTANCE_WR(ctx, 0x0136c/4, 0x00010401); + INSTANCE_WR(ctx, 0x01374/4, 0x00000040); + INSTANCE_WR(ctx, 0x0137c/4, 0x000000bf); + INSTANCE_WR(ctx, 0x01384/4, 0x00001210); + INSTANCE_WR(ctx, 0x01388/4, 0x00000080); + INSTANCE_WR(ctx, 0x013b0/4, 0x00007070); + INSTANCE_WR(ctx, 0x013bc/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x013d4/4, 0x00120407); + INSTANCE_WR(ctx, 0x013d4/4, 0x05091507); + INSTANCE_WR(ctx, 0x013d4/4, 0x05010202); + INSTANCE_WR(ctx, 0x013d4/4, 0x00030201); + INSTANCE_WR(ctx, 0x013fc/4, 0x00000040); + INSTANCE_WR(ctx, 0x013fc/4, 0x0d0c0b0a); + INSTANCE_WR(ctx, 0x013fc/4, 0x00141210); + INSTANCE_WR(ctx, 0x013fc/4, 0x000001f0); + INSTANCE_WR(ctx, 0x013fc/4, 0x00000001); + INSTANCE_WR(ctx, 0x013fc/4, 0x00000003); + INSTANCE_WR(ctx, 0x013fc/4, 0x00008000); + INSTANCE_WR(ctx, 0x0141c/4, 0x00039e00); + INSTANCE_WR(ctx, 0x0141c/4, 0x00000040); + INSTANCE_WR(ctx, 0x0141c/4, 0x00003800); + INSTANCE_WR(ctx, 0x0141c/4, 0x00404040); + INSTANCE_WR(ctx, 0x0141c/4, 0x0000ff0a); + INSTANCE_WR(ctx, 0x01434/4, 0x0077f005); + INSTANCE_WR(ctx, 0x01438/4, 0x00007fff); + INSTANCE_WR(ctx, 0x01444/4, 0x000003ff); + INSTANCE_WR(ctx, 0x01444/4, 0x00000003); + INSTANCE_WR(ctx, 0x01444/4, 0x00000003); + INSTANCE_WR(ctx, 0x01444/4, 0x000001ff); + INSTANCE_WR(ctx, 0x01444/4, 0x0000001f); + INSTANCE_WR(ctx, 0x01444/4, 0x0000000f); + INSTANCE_WR(ctx, 0x01444/4, 0x0000000f); + INSTANCE_WR(ctx, 0x01464/4, 0x01800000); + INSTANCE_WR(ctx, 0x01468/4, 0x00160000); + INSTANCE_WR(ctx, 0x0146c/4, 0x01800000); + INSTANCE_WR(ctx, 0x0147c/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x01480/4, 0x000c0000); + INSTANCE_WR(ctx, 0x014a4/4, 0x00010401); + INSTANCE_WR(ctx, 0x014ac/4, 0x00000040); + INSTANCE_WR(ctx, 0x014b4/4, 0x000000bf); + INSTANCE_WR(ctx, 0x014bc/4, 0x00001210); + INSTANCE_WR(ctx, 0x014c0/4, 0x00000080); + INSTANCE_WR(ctx, 0x014e4/4, 0x01800000); + INSTANCE_WR(ctx, 0x014e8/4, 0x00160000); + INSTANCE_WR(ctx, 0x014ec/4, 0x01800000); + INSTANCE_WR(ctx, 0x014fc/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x01500/4, 0x000c0000); + INSTANCE_WR(ctx, 0x01524/4, 0x00010401); + INSTANCE_WR(ctx, 0x0152c/4, 0x00000040); + INSTANCE_WR(ctx, 0x01534/4, 0x000000bf); + INSTANCE_WR(ctx, 0x0153c/4, 0x00001210); + INSTANCE_WR(ctx, 0x01540/4, 0x00000080); + INSTANCE_WR(ctx, 0x01568/4, 0x00007070); + INSTANCE_WR(ctx, 0x01574/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x0158c/4, 0x00120407); + INSTANCE_WR(ctx, 0x0158c/4, 0x05091507); + INSTANCE_WR(ctx, 0x0158c/4, 0x05010202); + INSTANCE_WR(ctx, 0x0158c/4, 0x00030201); + INSTANCE_WR(ctx, 0x015b4/4, 0x00000040); + INSTANCE_WR(ctx, 0x015b4/4, 0x0d0c0b0a); + INSTANCE_WR(ctx, 0x015b4/4, 0x00141210); + INSTANCE_WR(ctx, 0x015b4/4, 0x000001f0); + INSTANCE_WR(ctx, 0x015b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x015b4/4, 0x00000003); + INSTANCE_WR(ctx, 0x015b4/4, 0x00008000); + INSTANCE_WR(ctx, 0x015d4/4, 0x00039e00); + INSTANCE_WR(ctx, 0x015d4/4, 0x00000040); + INSTANCE_WR(ctx, 0x015d4/4, 0x00003800); + INSTANCE_WR(ctx, 0x015d4/4, 0x00404040); + INSTANCE_WR(ctx, 0x015d4/4, 0x0000ff0a); + INSTANCE_WR(ctx, 0x015ec/4, 0x0077f005); + INSTANCE_WR(ctx, 0x015f0/4, 0x00007fff); + INSTANCE_WR(ctx, 0x015fc/4, 0x000003ff); + INSTANCE_WR(ctx, 0x015fc/4, 0x00000003); + INSTANCE_WR(ctx, 0x015fc/4, 0x00000003); + INSTANCE_WR(ctx, 0x015fc/4, 0x000001ff); + INSTANCE_WR(ctx, 0x015fc/4, 0x0000001f); + INSTANCE_WR(ctx, 0x015fc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x015fc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x02b40/4, 0x00000021); + INSTANCE_WR(ctx, 0x02b60/4, 0x00000001); + INSTANCE_WR(ctx, 0x02b80/4, 0x00000002); + INSTANCE_WR(ctx, 0x02ba0/4, 0x00000100); + INSTANCE_WR(ctx, 0x02bc0/4, 0x00000100); + INSTANCE_WR(ctx, 0x02be0/4, 0x00000001); + INSTANCE_WR(ctx, 0x02c40/4, 0x00000001); + INSTANCE_WR(ctx, 0x02c60/4, 0x00000002); + INSTANCE_WR(ctx, 0x02c80/4, 0x00000100); + INSTANCE_WR(ctx, 0x02ca0/4, 0x00000100); + INSTANCE_WR(ctx, 0x02cc0/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c5e0/4, 0x00000004); + INSTANCE_WR(ctx, 0x0c600/4, 0x00000004); + INSTANCE_WR(ctx, 0x44f80/4, 0x00000004); + INSTANCE_WR(ctx, 0x44fa0/4, 0x00000004); + INSTANCE_WR(ctx, 0x44fc0/4, 0x08100c12); + INSTANCE_WR(ctx, 0x45000/4, 0x08100c12); + INSTANCE_WR(ctx, 0x45040/4, 0x00080c14); + INSTANCE_WR(ctx, 0x45060/4, 0x00000001); + INSTANCE_WR(ctx, 0x45080/4, 0x00080c14); + INSTANCE_WR(ctx, 0x450e0/4, 0x08100c12); + INSTANCE_WR(ctx, 0x45100/4, 0x00000027); + INSTANCE_WR(ctx, 0x45160/4, 0x00000001); + INSTANCE_WR(ctx, 0x4c9a0/4, 0x00000001); + INSTANCE_WR(ctx, 0x4cc80/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4ce00/4, 0x04000000); + INSTANCE_WR(ctx, 0x4ce20/4, 0x04000000); + INSTANCE_WR(ctx, 0x4ce60/4, 0x00000080); + INSTANCE_WR(ctx, 0x4cee0/4, 0x00000080); + INSTANCE_WR(ctx, 0x4cf20/4, 0x0000003f); + INSTANCE_WR(ctx, 0x4d080/4, 0x00000002); + INSTANCE_WR(ctx, 0x4d0a0/4, 0x04000000); + INSTANCE_WR(ctx, 0x4d0c0/4, 0x04000000); + INSTANCE_WR(ctx, 0x4d1e0/4, 0x00000004); + INSTANCE_WR(ctx, 0x4d260/4, 0x00000004); + INSTANCE_WR(ctx, 0x4d480/4, 0x00000001); + INSTANCE_WR(ctx, 0x4d4a0/4, 0x00001001); + INSTANCE_WR(ctx, 0x4d4c0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4d4e0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4d500/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4d520/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4d940/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4d960/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4d980/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4d9a0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4d9c0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4d9e0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4da00/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4da20/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4da40/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4da60/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4da80/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4daa0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4dac0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4dae0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4db00/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4db20/4, 0x3f800000); + INSTANCE_WR(ctx, 0x4db40/4, 0x00000010); + INSTANCE_WR(ctx, 0x4db80/4, 0x00000003); + INSTANCE_WR(ctx, 0x01784/4, 0x0000000f); + INSTANCE_WR(ctx, 0x01824/4, 0x00000020); + INSTANCE_WR(ctx, 0x01a04/4, 0x0000001a); + INSTANCE_WR(ctx, 0x01bc4/4, 0x00000004); + INSTANCE_WR(ctx, 0x01be4/4, 0x00000004); + INSTANCE_WR(ctx, 0x01c24/4, 0x00000004); + INSTANCE_WR(ctx, 0x01c44/4, 0x00000008); + INSTANCE_WR(ctx, 0x01c84/4, 0x000003ff); + INSTANCE_WR(ctx, 0x01e24/4, 0x0000000f); + INSTANCE_WR(ctx, 0x042e4/4, 0x0000000f); + INSTANCE_WR(ctx, 0x04324/4, 0x00000001); + INSTANCE_WR(ctx, 0x04e84/4, 0x0000000f); + INSTANCE_WR(ctx, 0x15524/4, 0x0000000f); + INSTANCE_WR(ctx, 0x15764/4, 0x00000001); + INSTANCE_WR(ctx, 0x15784/4, 0x00000001); + INSTANCE_WR(ctx, 0x157c4/4, 0x00000001); + INSTANCE_WR(ctx, 0x157e4/4, 0x00000100); + INSTANCE_WR(ctx, 0x15804/4, 0x00000100); + INSTANCE_WR(ctx, 0x15824/4, 0x00000011); + INSTANCE_WR(ctx, 0x15864/4, 0x00000008); + INSTANCE_WR(ctx, 0x15924/4, 0x00000001); + INSTANCE_WR(ctx, 0x15964/4, 0x00000001); + INSTANCE_WR(ctx, 0x15984/4, 0x00000001); + INSTANCE_WR(ctx, 0x159a4/4, 0x00000001); + INSTANCE_WR(ctx, 0x159c4/4, 0x000000cf); + INSTANCE_WR(ctx, 0x159e4/4, 0x00000002); + INSTANCE_WR(ctx, 0x15ac4/4, 0x00000001); + INSTANCE_WR(ctx, 0x15b04/4, 0x00000001); + INSTANCE_WR(ctx, 0x15b24/4, 0x00000001); + INSTANCE_WR(ctx, 0x15b44/4, 0x00000001); + INSTANCE_WR(ctx, 0x15be4/4, 0x00000004); + INSTANCE_WR(ctx, 0x15c24/4, 0x00000001); + INSTANCE_WR(ctx, 0x15c44/4, 0x00000015); + INSTANCE_WR(ctx, 0x15cc4/4, 0x04444480); + INSTANCE_WR(ctx, 0x16444/4, 0x08100c12); + INSTANCE_WR(ctx, 0x164e4/4, 0x00000100); + INSTANCE_WR(ctx, 0x16544/4, 0x00010001); + INSTANCE_WR(ctx, 0x16584/4, 0x00010001); + INSTANCE_WR(ctx, 0x165a4/4, 0x00000001); + INSTANCE_WR(ctx, 0x165c4/4, 0x00010001); + INSTANCE_WR(ctx, 0x165e4/4, 0x00000001); + INSTANCE_WR(ctx, 0x16604/4, 0x00000004); + INSTANCE_WR(ctx, 0x16624/4, 0x00000002); + INSTANCE_WR(ctx, 0x185a4/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x185c4/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x18664/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x187e4/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x18804/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x16708/4, 0x003fffff); + INSTANCE_WR(ctx, 0x16768/4, 0x00001fff); + INSTANCE_WR(ctx, 0x16948/4, 0x3f800000); + INSTANCE_WR(ctx, 0x16a28/4, 0x00000004); + INSTANCE_WR(ctx, 0x16a48/4, 0x0000001a); + INSTANCE_WR(ctx, 0x16aa8/4, 0x00000001); + INSTANCE_WR(ctx, 0x16d08/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x16de8/4, 0x0000000f); + INSTANCE_WR(ctx, 0x16ee8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x16f08/4, 0x00000011); + INSTANCE_WR(ctx, 0x17108/4, 0x00000004); + INSTANCE_WR(ctx, 0x171a8/4, 0x00000002); + INSTANCE_WR(ctx, 0x171c8/4, 0x04000000); + INSTANCE_WR(ctx, 0x171e8/4, 0x04000000); + INSTANCE_WR(ctx, 0x17268/4, 0x00000005); + INSTANCE_WR(ctx, 0x17288/4, 0x00000052); + INSTANCE_WR(ctx, 0x17508/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17528/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17548/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17568/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17588/4, 0x3f800000); + INSTANCE_WR(ctx, 0x175a8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x175c8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x175e8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17608/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17628/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17648/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17668/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17688/4, 0x3f800000); + INSTANCE_WR(ctx, 0x176a8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x176c8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x176e8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x17708/4, 0x00000010); + INSTANCE_WR(ctx, 0x17be8/4, 0x08100c12); + INSTANCE_WR(ctx, 0x17c08/4, 0x00000005); + INSTANCE_WR(ctx, 0x17c68/4, 0x00000001); + INSTANCE_WR(ctx, 0x17ca8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x17cc8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x17ce8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x17d08/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x18108/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x18128/4, 0x0000001a); + INSTANCE_WR(ctx, 0x18608/4, 0x00000102); + INSTANCE_WR(ctx, 0x18648/4, 0x00000004); + INSTANCE_WR(ctx, 0x18668/4, 0x00000004); + INSTANCE_WR(ctx, 0x18688/4, 0x00000004); + INSTANCE_WR(ctx, 0x186a8/4, 0x00000004); + INSTANCE_WR(ctx, 0x186c8/4, 0x00000004); + INSTANCE_WR(ctx, 0x186e8/4, 0x00000004); + INSTANCE_WR(ctx, 0x18728/4, 0x000003ff); + INSTANCE_WR(ctx, 0x18768/4, 0x00000102); + INSTANCE_WR(ctx, 0x188a8/4, 0x00000004); + INSTANCE_WR(ctx, 0x188c8/4, 0x00000004); + INSTANCE_WR(ctx, 0x188e8/4, 0x00000004); + INSTANCE_WR(ctx, 0x18908/4, 0x00000004); + INSTANCE_WR(ctx, 0x18ec8/4, 0x00000004); + INSTANCE_WR(ctx, 0x18ee8/4, 0x00000004); + INSTANCE_WR(ctx, 0x18f28/4, 0x00000010); + INSTANCE_WR(ctx, 0x18fa8/4, 0x00000804); + INSTANCE_WR(ctx, 0x18fc8/4, 0x00000001); + INSTANCE_WR(ctx, 0x18fe8/4, 0x0000001a); + INSTANCE_WR(ctx, 0x19028/4, 0x00000001); + INSTANCE_WR(ctx, 0x19048/4, 0x00080c14); + INSTANCE_WR(ctx, 0x19088/4, 0x08100c12); + INSTANCE_WR(ctx, 0x190a8/4, 0x00000004); + INSTANCE_WR(ctx, 0x190c8/4, 0x00000004); + INSTANCE_WR(ctx, 0x19108/4, 0x00000010); + INSTANCE_WR(ctx, 0x19188/4, 0x00000001); + INSTANCE_WR(ctx, 0x191a8/4, 0x08100c12); + INSTANCE_WR(ctx, 0x19288/4, 0x000003ff); + INSTANCE_WR(ctx, 0x192a8/4, 0x00080c14); + INSTANCE_WR(ctx, 0x199c8/4, 0x00000001); + INSTANCE_WR(ctx, 0x19a28/4, 0x00000010); + INSTANCE_WR(ctx, 0x1a148/4, 0x00000088); + INSTANCE_WR(ctx, 0x1a168/4, 0x00000088); + INSTANCE_WR(ctx, 0x1a1c8/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a4a8/4, 0x00000026); + INSTANCE_WR(ctx, 0x1a508/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1a588/4, 0x0000001a); + INSTANCE_WR(ctx, 0x1a5a8/4, 0x00000010); + INSTANCE_WR(ctx, 0x1aa68/4, 0x00000052); + INSTANCE_WR(ctx, 0x1aaa8/4, 0x00000026); + INSTANCE_WR(ctx, 0x1aae8/4, 0x00000004); + INSTANCE_WR(ctx, 0x1ab08/4, 0x00000004); + INSTANCE_WR(ctx, 0x1ab48/4, 0x0000001a); + INSTANCE_WR(ctx, 0x1aba8/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x1abe8/4, 0x00000004); + INSTANCE_WR(ctx, 0x1ac08/4, 0x00000004); + INSTANCE_WR(ctx, 0x1ac48/4, 0x00000080); + INSTANCE_WR(ctx, 0x1ac68/4, 0x00000004); + INSTANCE_WR(ctx, 0x1ac88/4, 0x00080c14); + INSTANCE_WR(ctx, 0x1acc8/4, 0x000003ff); + INSTANCE_WR(ctx, 0x25528/4, 0x00000004); + INSTANCE_WR(ctx, 0x25548/4, 0x00000004); + INSTANCE_WR(ctx, 0x25588/4, 0x00000080); + INSTANCE_WR(ctx, 0x255a8/4, 0x00000004); + INSTANCE_WR(ctx, 0x255c8/4, 0x00000001); + INSTANCE_WR(ctx, 0x25608/4, 0x00000027); + INSTANCE_WR(ctx, 0x25648/4, 0x00000026); + INSTANCE_WR(ctx, 0x256c8/4, 0x04000000); + INSTANCE_WR(ctx, 0x256e8/4, 0x04000000); + INSTANCE_WR(ctx, 0x25708/4, 0x04000000); + INSTANCE_WR(ctx, 0x25728/4, 0x04000000); + INSTANCE_WR(ctx, 0x25748/4, 0x04000000); + INSTANCE_WR(ctx, 0x25768/4, 0x04000000); + INSTANCE_WR(ctx, 0x25788/4, 0x04000000); + INSTANCE_WR(ctx, 0x257a8/4, 0x04000000); + INSTANCE_WR(ctx, 0x257c8/4, 0x04000000); + INSTANCE_WR(ctx, 0x257e8/4, 0x04000000); + INSTANCE_WR(ctx, 0x25808/4, 0x04000000); + INSTANCE_WR(ctx, 0x25828/4, 0x04000000); + INSTANCE_WR(ctx, 0x25848/4, 0x04000000); + INSTANCE_WR(ctx, 0x25868/4, 0x04000000); + INSTANCE_WR(ctx, 0x25888/4, 0x04000000); + INSTANCE_WR(ctx, 0x258a8/4, 0x04000000); + INSTANCE_WR(ctx, 0x25d48/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x25d68/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x25dc8/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x0180c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0184c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x019ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x01a0c/4, 0x00000010); + INSTANCE_WR(ctx, 0x01a6c/4, 0x00000001); + INSTANCE_WR(ctx, 0x01b4c/4, 0x00000002); + INSTANCE_WR(ctx, 0x01c6c/4, 0x00000001); + INSTANCE_WR(ctx, 0x01c8c/4, 0x00000010); + INSTANCE_WR(ctx, 0x01ccc/4, 0x00000001); + INSTANCE_WR(ctx, 0x01f4c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0216c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0218c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x021ac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x021cc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x021ec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0220c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0222c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0224c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0226c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0228c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x022ac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x022cc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x022ec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0230c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0232c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0234c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0268c/4, 0x00000010); + INSTANCE_WR(ctx, 0x026cc/4, 0x0000003f); + INSTANCE_WR(ctx, 0x027ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x027ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0282c/4, 0x00000001); + INSTANCE_WR(ctx, 0x029cc/4, 0x00000011); + INSTANCE_WR(ctx, 0x02acc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x02bcc/4, 0x00000011); + INSTANCE_WR(ctx, 0x02c6c/4, 0x00000001); + INSTANCE_WR(ctx, 0x02c8c/4, 0x00000001); + INSTANCE_WR(ctx, 0x02cac/4, 0x00000001); + INSTANCE_WR(ctx, 0x02ccc/4, 0x00000002); + INSTANCE_WR(ctx, 0x02cec/4, 0x00000001); + INSTANCE_WR(ctx, 0x02d0c/4, 0x00000002); + INSTANCE_WR(ctx, 0x02d2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x02d6c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x02dac/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x0306c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0308c/4, 0x00000002); + INSTANCE_WR(ctx, 0x030ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x030cc/4, 0x00000001); + INSTANCE_WR(ctx, 0x030ec/4, 0x00000002); + INSTANCE_WR(ctx, 0x0310c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0312c/4, 0x00000001); + INSTANCE_WR(ctx, 0x031ac/4, 0x00000011); + INSTANCE_WR(ctx, 0x031cc/4, 0x00000001); + INSTANCE_WR(ctx, 0x03e4c/4, 0x00000002); + INSTANCE_WR(ctx, 0x03e8c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x0402c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0404c/4, 0x00000010); + INSTANCE_WR(ctx, 0x040ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x0418c/4, 0x00000002); + INSTANCE_WR(ctx, 0x042ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x042cc/4, 0x00000010); + INSTANCE_WR(ctx, 0x0430c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0458c/4, 0x00000010); + INSTANCE_WR(ctx, 0x047ac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x047cc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x047ec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0480c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0482c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0484c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0486c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0488c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x048ac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x048cc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x048ec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0490c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0492c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0494c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0496c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0498c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x04ccc/4, 0x00000010); + INSTANCE_WR(ctx, 0x04d0c/4, 0x0000003f); + INSTANCE_WR(ctx, 0x04dec/4, 0x00000001); + INSTANCE_WR(ctx, 0x04e2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x04e6c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0500c/4, 0x00000011); + INSTANCE_WR(ctx, 0x0510c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x0520c/4, 0x00000011); + INSTANCE_WR(ctx, 0x052ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x052cc/4, 0x00000001); + INSTANCE_WR(ctx, 0x052ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0530c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0532c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0534c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0536c/4, 0x00000001); + INSTANCE_WR(ctx, 0x053ac/4, 0x00003e60); + INSTANCE_WR(ctx, 0x053ec/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x056ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x056cc/4, 0x00000002); + INSTANCE_WR(ctx, 0x056ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0570c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0572c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0574c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0576c/4, 0x00000001); + INSTANCE_WR(ctx, 0x057ec/4, 0x00000011); + INSTANCE_WR(ctx, 0x0580c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0648c/4, 0x00000002); + INSTANCE_WR(ctx, 0x064cc/4, 0x00003e60); + INSTANCE_WR(ctx, 0x0666c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0668c/4, 0x00000010); + INSTANCE_WR(ctx, 0x066ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x067cc/4, 0x00000002); + INSTANCE_WR(ctx, 0x068ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0690c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0694c/4, 0x00000001); + INSTANCE_WR(ctx, 0x06bcc/4, 0x00000010); + INSTANCE_WR(ctx, 0x06dec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06e0c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06e2c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06e4c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06e6c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06e8c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06eac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06ecc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06eec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06f0c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06f2c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06f4c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06f6c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06f8c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06fac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x06fcc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0730c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0734c/4, 0x0000003f); + INSTANCE_WR(ctx, 0x0742c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0746c/4, 0x00000001); + INSTANCE_WR(ctx, 0x074ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x0764c/4, 0x00000011); + INSTANCE_WR(ctx, 0x0774c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x0784c/4, 0x00000011); + INSTANCE_WR(ctx, 0x078ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0790c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0792c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0794c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0796c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0798c/4, 0x00000002); + INSTANCE_WR(ctx, 0x079ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x079ec/4, 0x00003e60); + INSTANCE_WR(ctx, 0x07a2c/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x07cec/4, 0x00000001); + INSTANCE_WR(ctx, 0x07d0c/4, 0x00000002); + INSTANCE_WR(ctx, 0x07d2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x07d4c/4, 0x00000001); + INSTANCE_WR(ctx, 0x07d6c/4, 0x00000002); + INSTANCE_WR(ctx, 0x07d8c/4, 0x00000001); + INSTANCE_WR(ctx, 0x07dac/4, 0x00000001); + INSTANCE_WR(ctx, 0x07e2c/4, 0x00000011); + INSTANCE_WR(ctx, 0x07e4c/4, 0x00000001); + INSTANCE_WR(ctx, 0x08acc/4, 0x00000002); + INSTANCE_WR(ctx, 0x08b0c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x08cac/4, 0x00000001); + INSTANCE_WR(ctx, 0x08ccc/4, 0x00000010); + INSTANCE_WR(ctx, 0x08d2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x08e0c/4, 0x00000002); + INSTANCE_WR(ctx, 0x08f2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x08f4c/4, 0x00000010); + INSTANCE_WR(ctx, 0x08f8c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0920c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0942c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0944c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0946c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0948c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x094ac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x094cc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x094ec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0950c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0952c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0954c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0956c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0958c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x095ac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x095cc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x095ec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0960c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0994c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0998c/4, 0x0000003f); + INSTANCE_WR(ctx, 0x09a6c/4, 0x00000001); + INSTANCE_WR(ctx, 0x09aac/4, 0x00000001); + INSTANCE_WR(ctx, 0x09aec/4, 0x00000001); + INSTANCE_WR(ctx, 0x09c8c/4, 0x00000011); + INSTANCE_WR(ctx, 0x09d8c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x09e8c/4, 0x00000011); + INSTANCE_WR(ctx, 0x09f2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x09f4c/4, 0x00000001); + INSTANCE_WR(ctx, 0x09f6c/4, 0x00000001); + INSTANCE_WR(ctx, 0x09f8c/4, 0x00000002); + INSTANCE_WR(ctx, 0x09fac/4, 0x00000001); + INSTANCE_WR(ctx, 0x09fcc/4, 0x00000002); + INSTANCE_WR(ctx, 0x09fec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0a02c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x0a06c/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x0a32c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0a34c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0a36c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0a38c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0a3ac/4, 0x00000002); + INSTANCE_WR(ctx, 0x0a3cc/4, 0x00000001); + INSTANCE_WR(ctx, 0x0a3ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0a46c/4, 0x00000011); + INSTANCE_WR(ctx, 0x0a48c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0b10c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0b14c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x0b2ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0b30c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0b36c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0b44c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0b56c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0b58c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0b5cc/4, 0x00000001); + INSTANCE_WR(ctx, 0x0b84c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0ba6c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0ba8c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0baac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bacc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0baec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bb0c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bb2c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bb4c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bb6c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bb8c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bbac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bbcc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bbec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bc0c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bc2c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bc4c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0bf8c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0bfcc/4, 0x0000003f); + INSTANCE_WR(ctx, 0x0c0ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c0ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c12c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c2cc/4, 0x00000011); + INSTANCE_WR(ctx, 0x0c3cc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x0c4cc/4, 0x00000011); + INSTANCE_WR(ctx, 0x0c56c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c58c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c5ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c5cc/4, 0x00000002); + INSTANCE_WR(ctx, 0x0c5ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c60c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0c62c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c66c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x0c6ac/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x0c96c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c98c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0c9ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c9cc/4, 0x00000001); + INSTANCE_WR(ctx, 0x0c9ec/4, 0x00000002); + INSTANCE_WR(ctx, 0x0ca0c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0ca2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0caac/4, 0x00000011); + INSTANCE_WR(ctx, 0x0cacc/4, 0x00000001); + INSTANCE_WR(ctx, 0x0d74c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0d78c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x0d92c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0d94c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0d9ac/4, 0x00000001); + INSTANCE_WR(ctx, 0x0da8c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0dbac/4, 0x00000001); + INSTANCE_WR(ctx, 0x0dbcc/4, 0x00000010); + INSTANCE_WR(ctx, 0x0dc0c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0de8c/4, 0x00000010); + INSTANCE_WR(ctx, 0x0e0ac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e0cc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e0ec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e10c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e12c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e14c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e16c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e18c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e1ac/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e1cc/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e1ec/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e20c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e22c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e24c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e26c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e28c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x0e5cc/4, 0x00000010); + INSTANCE_WR(ctx, 0x0e60c/4, 0x0000003f); + INSTANCE_WR(ctx, 0x0e6ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0e72c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0e76c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0e90c/4, 0x00000011); + INSTANCE_WR(ctx, 0x0ea0c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x0eb0c/4, 0x00000011); + INSTANCE_WR(ctx, 0x0ebac/4, 0x00000001); + INSTANCE_WR(ctx, 0x0ebcc/4, 0x00000001); + INSTANCE_WR(ctx, 0x0ebec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0ec0c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0ec2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0ec4c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0ec6c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0ecac/4, 0x00003e60); + INSTANCE_WR(ctx, 0x0ecec/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x0efac/4, 0x00000001); + INSTANCE_WR(ctx, 0x0efcc/4, 0x00000002); + INSTANCE_WR(ctx, 0x0efec/4, 0x00000001); + INSTANCE_WR(ctx, 0x0f00c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0f02c/4, 0x00000002); + INSTANCE_WR(ctx, 0x0f04c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0f06c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0f0ec/4, 0x00000011); + INSTANCE_WR(ctx, 0x0f10c/4, 0x00000001); + INSTANCE_WR(ctx, 0x01730/4, 0x00000004); + INSTANCE_WR(ctx, 0x019f0/4, 0x00000004); + INSTANCE_WR(ctx, 0x01a10/4, 0x00000004); + INSTANCE_WR(ctx, 0x01a30/4, 0x00608080); + INSTANCE_WR(ctx, 0x01ad0/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b30/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b50/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b70/4, 0x00000080); + INSTANCE_WR(ctx, 0x01b90/4, 0x00001000); + INSTANCE_WR(ctx, 0x01bb0/4, 0x00000004); + INSTANCE_WR(ctx, 0x02050/4, 0x00000004); + INSTANCE_WR(ctx, 0x02070/4, 0x00000080); + INSTANCE_WR(ctx, 0x02090/4, 0x00000004); + INSTANCE_WR(ctx, 0x020b0/4, 0x03020100); + INSTANCE_WR(ctx, 0x020d0/4, 0x00000003); + INSTANCE_WR(ctx, 0x020f0/4, 0x00001000); + INSTANCE_WR(ctx, 0x02110/4, 0x00000004); + INSTANCE_WR(ctx, 0x021b0/4, 0x00000004); + INSTANCE_WR(ctx, 0x021d0/4, 0x00000003); + INSTANCE_WR(ctx, 0x02250/4, 0x00000004); + INSTANCE_WR(ctx, 0x166f0/4, 0x00000004); + INSTANCE_WR(ctx, 0x16710/4, 0x00000003); + INSTANCE_WR(ctx, 0x16950/4, 0x0000000f); + INSTANCE_WR(ctx, 0x16ad0/4, 0x00000004); + INSTANCE_WR(ctx, 0x16af0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b10/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b30/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b50/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16c70/4, 0x00000001); + INSTANCE_WR(ctx, 0x16cf0/4, 0x00000001); + INSTANCE_WR(ctx, 0x16db0/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f50/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f70/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f90/4, 0x00000002); + INSTANCE_WR(ctx, 0x16fb0/4, 0x00000001); + INSTANCE_WR(ctx, 0x16fd0/4, 0x00000001); + INSTANCE_WR(ctx, 0x16ff0/4, 0x00000002); + INSTANCE_WR(ctx, 0x17010/4, 0x00000001); + INSTANCE_WR(ctx, 0x17050/4, 0x00000011); + INSTANCE_WR(ctx, 0x17150/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x171b0/4, 0x00000004); + INSTANCE_WR(ctx, 0x17230/4, 0x00000011); + INSTANCE_WR(ctx, 0x17250/4, 0x00000001); + INSTANCE_WR(ctx, 0x17290/4, 0x000000cf); + INSTANCE_WR(ctx, 0x172b0/4, 0x000000cf); + INSTANCE_WR(ctx, 0x172d0/4, 0x000000cf); + INSTANCE_WR(ctx, 0x17430/4, 0x00000001); + INSTANCE_WR(ctx, 0x17450/4, 0x00000001); + INSTANCE_WR(ctx, 0x17470/4, 0x00000002); + INSTANCE_WR(ctx, 0x17490/4, 0x00000001); + INSTANCE_WR(ctx, 0x174b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x174d0/4, 0x00000002); + INSTANCE_WR(ctx, 0x174f0/4, 0x00000001); + INSTANCE_WR(ctx, 0x17530/4, 0x00000001); + INSTANCE_WR(ctx, 0x17550/4, 0x00000001); + INSTANCE_WR(ctx, 0x17570/4, 0x00000001); + INSTANCE_WR(ctx, 0x17590/4, 0x00000001); + INSTANCE_WR(ctx, 0x175b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x175d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x175f0/4, 0x00000001); + INSTANCE_WR(ctx, 0x17610/4, 0x00000001); + INSTANCE_WR(ctx, 0x17630/4, 0x00000011); + INSTANCE_WR(ctx, 0x17730/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x17750/4, 0x0000000f); + INSTANCE_WR(ctx, 0x17850/4, 0x00003e60); + INSTANCE_WR(ctx, 0x178b0/4, 0x00000011); + INSTANCE_WR(ctx, 0x178d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x17910/4, 0x00000004); + INSTANCE_WR(ctx, 0x179d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x17a70/4, 0x00000011); + INSTANCE_WR(ctx, 0x17b70/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x17bf0/4, 0x00000011); + INSTANCE_WR(ctx, 0x17c10/4, 0x00000001); + INSTANCE_WR(ctx, 0x17c50/4, 0x00000001); + INSTANCE_WR(ctx, 0x17c90/4, 0x00000001); + INSTANCE_WR(ctx, 0x17cd0/4, 0x000003ff); + INSTANCE_WR(ctx, 0x17d10/4, 0x00000001); + INSTANCE_WR(ctx, 0x17d50/4, 0x00000001); + INSTANCE_WR(ctx, 0x182b0/4, 0x00000008); + INSTANCE_WR(ctx, 0x182d0/4, 0x00000008); + INSTANCE_WR(ctx, 0x182f0/4, 0x00000008); + INSTANCE_WR(ctx, 0x18310/4, 0x00000008); + INSTANCE_WR(ctx, 0x18330/4, 0x00000008); + INSTANCE_WR(ctx, 0x18350/4, 0x00000008); + INSTANCE_WR(ctx, 0x18370/4, 0x00000008); + INSTANCE_WR(ctx, 0x18390/4, 0x00000008); + INSTANCE_WR(ctx, 0x183b0/4, 0x00000011); + INSTANCE_WR(ctx, 0x184b0/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x184d0/4, 0x00000400); + INSTANCE_WR(ctx, 0x184f0/4, 0x00000400); + INSTANCE_WR(ctx, 0x18510/4, 0x00000400); + INSTANCE_WR(ctx, 0x18530/4, 0x00000400); + INSTANCE_WR(ctx, 0x18550/4, 0x00000400); + INSTANCE_WR(ctx, 0x18570/4, 0x00000400); + INSTANCE_WR(ctx, 0x18590/4, 0x00000400); + INSTANCE_WR(ctx, 0x185b0/4, 0x00000400); + INSTANCE_WR(ctx, 0x185d0/4, 0x00000300); + INSTANCE_WR(ctx, 0x185f0/4, 0x00000300); + INSTANCE_WR(ctx, 0x18610/4, 0x00000300); + INSTANCE_WR(ctx, 0x18630/4, 0x00000300); + INSTANCE_WR(ctx, 0x18650/4, 0x00000300); + INSTANCE_WR(ctx, 0x18670/4, 0x00000300); + INSTANCE_WR(ctx, 0x18690/4, 0x00000300); + INSTANCE_WR(ctx, 0x186b0/4, 0x00000300); + INSTANCE_WR(ctx, 0x186d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x186f0/4, 0x0000000f); + INSTANCE_WR(ctx, 0x187f0/4, 0x00000020); + INSTANCE_WR(ctx, 0x18810/4, 0x00000011); + INSTANCE_WR(ctx, 0x18830/4, 0x00000100); + INSTANCE_WR(ctx, 0x18870/4, 0x00000001); + INSTANCE_WR(ctx, 0x188d0/4, 0x00000040); + INSTANCE_WR(ctx, 0x188f0/4, 0x00000100); + INSTANCE_WR(ctx, 0x18930/4, 0x00000003); + INSTANCE_WR(ctx, 0x189d0/4, 0x00003e60); + INSTANCE_WR(ctx, 0x18a50/4, 0x00000002); + INSTANCE_WR(ctx, 0x18a70/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x18bb0/4, 0x00000001); + INSTANCE_WR(ctx, 0x18c50/4, 0x00000004); + INSTANCE_WR(ctx, 0x18c90/4, 0x00000001); + INSTANCE_WR(ctx, 0x18cb0/4, 0x00000400); + INSTANCE_WR(ctx, 0x18cd0/4, 0x00000300); + INSTANCE_WR(ctx, 0x18cf0/4, 0x00001001); + INSTANCE_WR(ctx, 0x18d70/4, 0x00000011); + INSTANCE_WR(ctx, 0x18e70/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x18e90/4, 0x0000000f); + INSTANCE_WR(ctx, 0x19190/4, 0x00003e60); + INSTANCE_WR(ctx, 0x19210/4, 0x00000011); + INSTANCE_WR(ctx, 0x19270/4, 0x00000004); + INSTANCE_WR(ctx, 0x192b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x192d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x19350/4, 0x00000001); + INSTANCE_WR(ctx, 0x193d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x19410/4, 0x00000001); + INSTANCE_WR(ctx, 0x19470/4, 0x2a712488); + INSTANCE_WR(ctx, 0x194b0/4, 0x4085c000); + INSTANCE_WR(ctx, 0x194d0/4, 0x00000040); + INSTANCE_WR(ctx, 0x194f0/4, 0x00000100); + INSTANCE_WR(ctx, 0x19510/4, 0x00010100); + INSTANCE_WR(ctx, 0x19530/4, 0x02800000); + INSTANCE_WR(ctx, 0x19730/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x19750/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x19770/4, 0x00000001); + INSTANCE_WR(ctx, 0x197b0/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x197d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x19830/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x19950/4, 0x00000001); + INSTANCE_WR(ctx, 0x19990/4, 0x00000001); + INSTANCE_WR(ctx, 0x199b0/4, 0x30201000); + INSTANCE_WR(ctx, 0x199d0/4, 0x70605040); + INSTANCE_WR(ctx, 0x199f0/4, 0xb8a89888); + INSTANCE_WR(ctx, 0x19a10/4, 0xf8e8d8c8); + INSTANCE_WR(ctx, 0x19a50/4, 0x0000001a); + INSTANCE_WR(ctx, 0x19a90/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d50/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d70/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d90/4, 0x00608080); + INSTANCE_WR(ctx, 0x19e30/4, 0x00000004); + INSTANCE_WR(ctx, 0x19e90/4, 0x00000004); + INSTANCE_WR(ctx, 0x19eb0/4, 0x00000004); + INSTANCE_WR(ctx, 0x19ed0/4, 0x00000080); + INSTANCE_WR(ctx, 0x19ef0/4, 0x00001000); + INSTANCE_WR(ctx, 0x19f10/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a3b0/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a3d0/4, 0x00000080); + INSTANCE_WR(ctx, 0x1a3f0/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a410/4, 0x03020100); + INSTANCE_WR(ctx, 0x1a430/4, 0x00000003); + INSTANCE_WR(ctx, 0x1a450/4, 0x00001000); + INSTANCE_WR(ctx, 0x1a470/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a510/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a530/4, 0x00000003); + INSTANCE_WR(ctx, 0x1a5b0/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ea50/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ea70/4, 0x00000003); + INSTANCE_WR(ctx, 0x2ecb0/4, 0x0000000f); + INSTANCE_WR(ctx, 0x2ee30/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ee50/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2ee70/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2ee90/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2eeb0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2efd0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f050/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f110/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2f0/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f310/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f330/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f350/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f370/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f3b0/4, 0x00000011); + INSTANCE_WR(ctx, 0x2f4b0/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2f510/4, 0x00000004); + INSTANCE_WR(ctx, 0x2f590/4, 0x00000011); + INSTANCE_WR(ctx, 0x2f5b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f5f0/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f610/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f630/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f790/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f7b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f7d0/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f7f0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f810/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f830/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f850/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f890/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8f0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f910/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f930/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f950/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f970/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f990/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fa90/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2fab0/4, 0x0000000f); + INSTANCE_WR(ctx, 0x2fbb0/4, 0x00003e60); + INSTANCE_WR(ctx, 0x2fc10/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fc30/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fc70/4, 0x00000004); + INSTANCE_WR(ctx, 0x2fd30/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fdd0/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fed0/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2ff50/4, 0x00000011); + INSTANCE_WR(ctx, 0x2ff70/4, 0x00000001); + INSTANCE_WR(ctx, 0x2ffb0/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fff0/4, 0x00000001); + INSTANCE_WR(ctx, 0x30030/4, 0x000003ff); + INSTANCE_WR(ctx, 0x30070/4, 0x00000001); + INSTANCE_WR(ctx, 0x300b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x30610/4, 0x00000008); + INSTANCE_WR(ctx, 0x30630/4, 0x00000008); + INSTANCE_WR(ctx, 0x30650/4, 0x00000008); + INSTANCE_WR(ctx, 0x30670/4, 0x00000008); + INSTANCE_WR(ctx, 0x30690/4, 0x00000008); + INSTANCE_WR(ctx, 0x306b0/4, 0x00000008); + INSTANCE_WR(ctx, 0x306d0/4, 0x00000008); + INSTANCE_WR(ctx, 0x306f0/4, 0x00000008); + INSTANCE_WR(ctx, 0x30710/4, 0x00000011); + INSTANCE_WR(ctx, 0x30810/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x30830/4, 0x00000400); + INSTANCE_WR(ctx, 0x30850/4, 0x00000400); + INSTANCE_WR(ctx, 0x30870/4, 0x00000400); + INSTANCE_WR(ctx, 0x30890/4, 0x00000400); + INSTANCE_WR(ctx, 0x308b0/4, 0x00000400); + INSTANCE_WR(ctx, 0x308d0/4, 0x00000400); + INSTANCE_WR(ctx, 0x308f0/4, 0x00000400); + INSTANCE_WR(ctx, 0x30910/4, 0x00000400); + INSTANCE_WR(ctx, 0x30930/4, 0x00000300); + INSTANCE_WR(ctx, 0x30950/4, 0x00000300); + INSTANCE_WR(ctx, 0x30970/4, 0x00000300); + INSTANCE_WR(ctx, 0x30990/4, 0x00000300); + INSTANCE_WR(ctx, 0x309b0/4, 0x00000300); + INSTANCE_WR(ctx, 0x309d0/4, 0x00000300); + INSTANCE_WR(ctx, 0x309f0/4, 0x00000300); + INSTANCE_WR(ctx, 0x30a10/4, 0x00000300); + INSTANCE_WR(ctx, 0x30a30/4, 0x00000001); + INSTANCE_WR(ctx, 0x30a50/4, 0x0000000f); + INSTANCE_WR(ctx, 0x30b50/4, 0x00000020); + INSTANCE_WR(ctx, 0x30b70/4, 0x00000011); + INSTANCE_WR(ctx, 0x30b90/4, 0x00000100); + INSTANCE_WR(ctx, 0x30bd0/4, 0x00000001); + INSTANCE_WR(ctx, 0x30c30/4, 0x00000040); + INSTANCE_WR(ctx, 0x30c50/4, 0x00000100); + INSTANCE_WR(ctx, 0x30c90/4, 0x00000003); + INSTANCE_WR(ctx, 0x30d30/4, 0x00003e60); + INSTANCE_WR(ctx, 0x30db0/4, 0x00000002); + INSTANCE_WR(ctx, 0x30dd0/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x30f10/4, 0x00000001); + INSTANCE_WR(ctx, 0x30fb0/4, 0x00000004); + INSTANCE_WR(ctx, 0x30ff0/4, 0x00000001); + INSTANCE_WR(ctx, 0x31010/4, 0x00000400); + INSTANCE_WR(ctx, 0x31030/4, 0x00000300); + INSTANCE_WR(ctx, 0x31050/4, 0x00001001); + INSTANCE_WR(ctx, 0x310d0/4, 0x00000011); + INSTANCE_WR(ctx, 0x311d0/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x311f0/4, 0x0000000f); + INSTANCE_WR(ctx, 0x314f0/4, 0x00003e60); + INSTANCE_WR(ctx, 0x31570/4, 0x00000011); + INSTANCE_WR(ctx, 0x315d0/4, 0x00000004); + INSTANCE_WR(ctx, 0x31610/4, 0x00000001); + INSTANCE_WR(ctx, 0x31630/4, 0x00000001); + INSTANCE_WR(ctx, 0x316b0/4, 0x00000001); + INSTANCE_WR(ctx, 0x31730/4, 0x00000001); + INSTANCE_WR(ctx, 0x31770/4, 0x00000001); + INSTANCE_WR(ctx, 0x317d0/4, 0x2a712488); + INSTANCE_WR(ctx, 0x31810/4, 0x4085c000); + INSTANCE_WR(ctx, 0x31830/4, 0x00000040); + INSTANCE_WR(ctx, 0x31850/4, 0x00000100); + INSTANCE_WR(ctx, 0x31870/4, 0x00010100); + INSTANCE_WR(ctx, 0x31890/4, 0x02800000); + INSTANCE_WR(ctx, 0x31a90/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x31ab0/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x31ad0/4, 0x00000001); + INSTANCE_WR(ctx, 0x31b10/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x31b30/4, 0x00000001); + INSTANCE_WR(ctx, 0x31b90/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x31cb0/4, 0x00000001); + INSTANCE_WR(ctx, 0x31cf0/4, 0x00000001); + INSTANCE_WR(ctx, 0x31d10/4, 0x30201000); + INSTANCE_WR(ctx, 0x31d30/4, 0x70605040); + INSTANCE_WR(ctx, 0x31d50/4, 0xb8a89888); + INSTANCE_WR(ctx, 0x31d70/4, 0xf8e8d8c8); + INSTANCE_WR(ctx, 0x31db0/4, 0x0000001a); + INSTANCE_WR(ctx, 0x01734/4, 0x00000004); + INSTANCE_WR(ctx, 0x019f4/4, 0x00000004); + INSTANCE_WR(ctx, 0x01a14/4, 0x00000004); + INSTANCE_WR(ctx, 0x01a34/4, 0x00608080); + INSTANCE_WR(ctx, 0x01ad4/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b34/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b54/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b74/4, 0x00000080); + INSTANCE_WR(ctx, 0x01b94/4, 0x00001000); + INSTANCE_WR(ctx, 0x01bb4/4, 0x00000004); + INSTANCE_WR(ctx, 0x02054/4, 0x00000004); + INSTANCE_WR(ctx, 0x02074/4, 0x00000080); + INSTANCE_WR(ctx, 0x02094/4, 0x00000004); + INSTANCE_WR(ctx, 0x020b4/4, 0x03020100); + INSTANCE_WR(ctx, 0x020d4/4, 0x00000003); + INSTANCE_WR(ctx, 0x020f4/4, 0x00001000); + INSTANCE_WR(ctx, 0x02114/4, 0x00000004); + INSTANCE_WR(ctx, 0x021b4/4, 0x00000004); + INSTANCE_WR(ctx, 0x021d4/4, 0x00000003); + INSTANCE_WR(ctx, 0x02254/4, 0x00000004); + INSTANCE_WR(ctx, 0x166f4/4, 0x00000004); + INSTANCE_WR(ctx, 0x16714/4, 0x00000003); + INSTANCE_WR(ctx, 0x16954/4, 0x0000000f); + INSTANCE_WR(ctx, 0x16ad4/4, 0x00000004); + INSTANCE_WR(ctx, 0x16af4/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b14/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b34/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b54/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16c74/4, 0x00000001); + INSTANCE_WR(ctx, 0x16cf4/4, 0x00000001); + INSTANCE_WR(ctx, 0x16db4/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f54/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f74/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f94/4, 0x00000002); + INSTANCE_WR(ctx, 0x16fb4/4, 0x00000001); + INSTANCE_WR(ctx, 0x16fd4/4, 0x00000001); + INSTANCE_WR(ctx, 0x16ff4/4, 0x00000002); + INSTANCE_WR(ctx, 0x17014/4, 0x00000001); + INSTANCE_WR(ctx, 0x17054/4, 0x00000011); + INSTANCE_WR(ctx, 0x17154/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x171b4/4, 0x00000004); + INSTANCE_WR(ctx, 0x17234/4, 0x00000011); + INSTANCE_WR(ctx, 0x17254/4, 0x00000001); + INSTANCE_WR(ctx, 0x17294/4, 0x000000cf); + INSTANCE_WR(ctx, 0x172b4/4, 0x000000cf); + INSTANCE_WR(ctx, 0x172d4/4, 0x000000cf); + INSTANCE_WR(ctx, 0x17434/4, 0x00000001); + INSTANCE_WR(ctx, 0x17454/4, 0x00000001); + INSTANCE_WR(ctx, 0x17474/4, 0x00000002); + INSTANCE_WR(ctx, 0x17494/4, 0x00000001); + INSTANCE_WR(ctx, 0x174b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x174d4/4, 0x00000002); + INSTANCE_WR(ctx, 0x174f4/4, 0x00000001); + INSTANCE_WR(ctx, 0x17534/4, 0x00000001); + INSTANCE_WR(ctx, 0x17554/4, 0x00000001); + INSTANCE_WR(ctx, 0x17574/4, 0x00000001); + INSTANCE_WR(ctx, 0x17594/4, 0x00000001); + INSTANCE_WR(ctx, 0x175b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x175d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x175f4/4, 0x00000001); + INSTANCE_WR(ctx, 0x17614/4, 0x00000001); + INSTANCE_WR(ctx, 0x17634/4, 0x00000011); + INSTANCE_WR(ctx, 0x17734/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x17754/4, 0x0000000f); + INSTANCE_WR(ctx, 0x17854/4, 0x00003e60); + INSTANCE_WR(ctx, 0x178b4/4, 0x00000011); + INSTANCE_WR(ctx, 0x178d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x17914/4, 0x00000004); + INSTANCE_WR(ctx, 0x179d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x17a74/4, 0x00000011); + INSTANCE_WR(ctx, 0x17b74/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x17bf4/4, 0x00000011); + INSTANCE_WR(ctx, 0x17c14/4, 0x00000001); + INSTANCE_WR(ctx, 0x17c54/4, 0x00000001); + INSTANCE_WR(ctx, 0x17c94/4, 0x00000001); + INSTANCE_WR(ctx, 0x17cd4/4, 0x000003ff); + INSTANCE_WR(ctx, 0x17d14/4, 0x00000001); + INSTANCE_WR(ctx, 0x17d54/4, 0x00000001); + INSTANCE_WR(ctx, 0x182b4/4, 0x00000008); + INSTANCE_WR(ctx, 0x182d4/4, 0x00000008); + INSTANCE_WR(ctx, 0x182f4/4, 0x00000008); + INSTANCE_WR(ctx, 0x18314/4, 0x00000008); + INSTANCE_WR(ctx, 0x18334/4, 0x00000008); + INSTANCE_WR(ctx, 0x18354/4, 0x00000008); + INSTANCE_WR(ctx, 0x18374/4, 0x00000008); + INSTANCE_WR(ctx, 0x18394/4, 0x00000008); + INSTANCE_WR(ctx, 0x183b4/4, 0x00000011); + INSTANCE_WR(ctx, 0x184b4/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x184d4/4, 0x00000400); + INSTANCE_WR(ctx, 0x184f4/4, 0x00000400); + INSTANCE_WR(ctx, 0x18514/4, 0x00000400); + INSTANCE_WR(ctx, 0x18534/4, 0x00000400); + INSTANCE_WR(ctx, 0x18554/4, 0x00000400); + INSTANCE_WR(ctx, 0x18574/4, 0x00000400); + INSTANCE_WR(ctx, 0x18594/4, 0x00000400); + INSTANCE_WR(ctx, 0x185b4/4, 0x00000400); + INSTANCE_WR(ctx, 0x185d4/4, 0x00000300); + INSTANCE_WR(ctx, 0x185f4/4, 0x00000300); + INSTANCE_WR(ctx, 0x18614/4, 0x00000300); + INSTANCE_WR(ctx, 0x18634/4, 0x00000300); + INSTANCE_WR(ctx, 0x18654/4, 0x00000300); + INSTANCE_WR(ctx, 0x18674/4, 0x00000300); + INSTANCE_WR(ctx, 0x18694/4, 0x00000300); + INSTANCE_WR(ctx, 0x186b4/4, 0x00000300); + INSTANCE_WR(ctx, 0x186d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x186f4/4, 0x0000000f); + INSTANCE_WR(ctx, 0x187f4/4, 0x00000020); + INSTANCE_WR(ctx, 0x18814/4, 0x00000011); + INSTANCE_WR(ctx, 0x18834/4, 0x00000100); + INSTANCE_WR(ctx, 0x18874/4, 0x00000001); + INSTANCE_WR(ctx, 0x188d4/4, 0x00000040); + INSTANCE_WR(ctx, 0x188f4/4, 0x00000100); + INSTANCE_WR(ctx, 0x18934/4, 0x00000003); + INSTANCE_WR(ctx, 0x189d4/4, 0x00003e60); + INSTANCE_WR(ctx, 0x18a54/4, 0x00000002); + INSTANCE_WR(ctx, 0x18a74/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x18bb4/4, 0x00000001); + INSTANCE_WR(ctx, 0x18c54/4, 0x00000004); + INSTANCE_WR(ctx, 0x18c94/4, 0x00000001); + INSTANCE_WR(ctx, 0x18cb4/4, 0x00000400); + INSTANCE_WR(ctx, 0x18cd4/4, 0x00000300); + INSTANCE_WR(ctx, 0x18cf4/4, 0x00001001); + INSTANCE_WR(ctx, 0x18d74/4, 0x00000011); + INSTANCE_WR(ctx, 0x18e74/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x18e94/4, 0x0000000f); + INSTANCE_WR(ctx, 0x19194/4, 0x00003e60); + INSTANCE_WR(ctx, 0x19214/4, 0x00000011); + INSTANCE_WR(ctx, 0x19274/4, 0x00000004); + INSTANCE_WR(ctx, 0x192b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x192d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x19354/4, 0x00000001); + INSTANCE_WR(ctx, 0x193d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x19414/4, 0x00000001); + INSTANCE_WR(ctx, 0x19474/4, 0x2a712488); + INSTANCE_WR(ctx, 0x194b4/4, 0x4085c000); + INSTANCE_WR(ctx, 0x194d4/4, 0x00000040); + INSTANCE_WR(ctx, 0x194f4/4, 0x00000100); + INSTANCE_WR(ctx, 0x19514/4, 0x00010100); + INSTANCE_WR(ctx, 0x19534/4, 0x02800000); + INSTANCE_WR(ctx, 0x19734/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x19754/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x19774/4, 0x00000001); + INSTANCE_WR(ctx, 0x197b4/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x197d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x19834/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x19954/4, 0x00000001); + INSTANCE_WR(ctx, 0x19994/4, 0x00000001); + INSTANCE_WR(ctx, 0x199b4/4, 0x30201000); + INSTANCE_WR(ctx, 0x199d4/4, 0x70605040); + INSTANCE_WR(ctx, 0x199f4/4, 0xb8a89888); + INSTANCE_WR(ctx, 0x19a14/4, 0xf8e8d8c8); + INSTANCE_WR(ctx, 0x19a54/4, 0x0000001a); + INSTANCE_WR(ctx, 0x19a94/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d54/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d74/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d94/4, 0x00608080); + INSTANCE_WR(ctx, 0x19e34/4, 0x00000004); + INSTANCE_WR(ctx, 0x19e94/4, 0x00000004); + INSTANCE_WR(ctx, 0x19eb4/4, 0x00000004); + INSTANCE_WR(ctx, 0x19ed4/4, 0x00000080); + INSTANCE_WR(ctx, 0x19ef4/4, 0x00001000); + INSTANCE_WR(ctx, 0x19f14/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a3b4/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a3d4/4, 0x00000080); + INSTANCE_WR(ctx, 0x1a3f4/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a414/4, 0x03020100); + INSTANCE_WR(ctx, 0x1a434/4, 0x00000003); + INSTANCE_WR(ctx, 0x1a454/4, 0x00001000); + INSTANCE_WR(ctx, 0x1a474/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a514/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a534/4, 0x00000003); + INSTANCE_WR(ctx, 0x1a5b4/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ea54/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ea74/4, 0x00000003); + INSTANCE_WR(ctx, 0x2ecb4/4, 0x0000000f); + INSTANCE_WR(ctx, 0x2ee34/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ee54/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2ee74/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2ee94/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2eeb4/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2efd4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f054/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f114/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2f4/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f314/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f334/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f354/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f374/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f3b4/4, 0x00000011); + INSTANCE_WR(ctx, 0x2f4b4/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2f514/4, 0x00000004); + INSTANCE_WR(ctx, 0x2f594/4, 0x00000011); + INSTANCE_WR(ctx, 0x2f5b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f5f4/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f614/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f634/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f794/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f7b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f7d4/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f7f4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f814/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f834/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f854/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f894/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8f4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f914/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f934/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f954/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f974/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f994/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fa94/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2fab4/4, 0x0000000f); + INSTANCE_WR(ctx, 0x2fbb4/4, 0x00003e60); + INSTANCE_WR(ctx, 0x2fc14/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fc34/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fc74/4, 0x00000004); + INSTANCE_WR(ctx, 0x2fd34/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fdd4/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fed4/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2ff54/4, 0x00000011); + INSTANCE_WR(ctx, 0x2ff74/4, 0x00000001); + INSTANCE_WR(ctx, 0x2ffb4/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fff4/4, 0x00000001); + INSTANCE_WR(ctx, 0x30034/4, 0x000003ff); + INSTANCE_WR(ctx, 0x30074/4, 0x00000001); + INSTANCE_WR(ctx, 0x300b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x30614/4, 0x00000008); + INSTANCE_WR(ctx, 0x30634/4, 0x00000008); + INSTANCE_WR(ctx, 0x30654/4, 0x00000008); + INSTANCE_WR(ctx, 0x30674/4, 0x00000008); + INSTANCE_WR(ctx, 0x30694/4, 0x00000008); + INSTANCE_WR(ctx, 0x306b4/4, 0x00000008); + INSTANCE_WR(ctx, 0x306d4/4, 0x00000008); + INSTANCE_WR(ctx, 0x306f4/4, 0x00000008); + INSTANCE_WR(ctx, 0x30714/4, 0x00000011); + INSTANCE_WR(ctx, 0x30814/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x30834/4, 0x00000400); + INSTANCE_WR(ctx, 0x30854/4, 0x00000400); + INSTANCE_WR(ctx, 0x30874/4, 0x00000400); + INSTANCE_WR(ctx, 0x30894/4, 0x00000400); + INSTANCE_WR(ctx, 0x308b4/4, 0x00000400); + INSTANCE_WR(ctx, 0x308d4/4, 0x00000400); + INSTANCE_WR(ctx, 0x308f4/4, 0x00000400); + INSTANCE_WR(ctx, 0x30914/4, 0x00000400); + INSTANCE_WR(ctx, 0x30934/4, 0x00000300); + INSTANCE_WR(ctx, 0x30954/4, 0x00000300); + INSTANCE_WR(ctx, 0x30974/4, 0x00000300); + INSTANCE_WR(ctx, 0x30994/4, 0x00000300); + INSTANCE_WR(ctx, 0x309b4/4, 0x00000300); + INSTANCE_WR(ctx, 0x309d4/4, 0x00000300); + INSTANCE_WR(ctx, 0x309f4/4, 0x00000300); + INSTANCE_WR(ctx, 0x30a14/4, 0x00000300); + INSTANCE_WR(ctx, 0x30a34/4, 0x00000001); + INSTANCE_WR(ctx, 0x30a54/4, 0x0000000f); + INSTANCE_WR(ctx, 0x30b54/4, 0x00000020); + INSTANCE_WR(ctx, 0x30b74/4, 0x00000011); + INSTANCE_WR(ctx, 0x30b94/4, 0x00000100); + INSTANCE_WR(ctx, 0x30bd4/4, 0x00000001); + INSTANCE_WR(ctx, 0x30c34/4, 0x00000040); + INSTANCE_WR(ctx, 0x30c54/4, 0x00000100); + INSTANCE_WR(ctx, 0x30c94/4, 0x00000003); + INSTANCE_WR(ctx, 0x30d34/4, 0x00003e60); + INSTANCE_WR(ctx, 0x30db4/4, 0x00000002); + INSTANCE_WR(ctx, 0x30dd4/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x30f14/4, 0x00000001); + INSTANCE_WR(ctx, 0x30fb4/4, 0x00000004); + INSTANCE_WR(ctx, 0x30ff4/4, 0x00000001); + INSTANCE_WR(ctx, 0x31014/4, 0x00000400); + INSTANCE_WR(ctx, 0x31034/4, 0x00000300); + INSTANCE_WR(ctx, 0x31054/4, 0x00001001); + INSTANCE_WR(ctx, 0x310d4/4, 0x00000011); + INSTANCE_WR(ctx, 0x311d4/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x311f4/4, 0x0000000f); + INSTANCE_WR(ctx, 0x314f4/4, 0x00003e60); + INSTANCE_WR(ctx, 0x31574/4, 0x00000011); + INSTANCE_WR(ctx, 0x315d4/4, 0x00000004); + INSTANCE_WR(ctx, 0x31614/4, 0x00000001); + INSTANCE_WR(ctx, 0x31634/4, 0x00000001); + INSTANCE_WR(ctx, 0x316b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x31734/4, 0x00000001); + INSTANCE_WR(ctx, 0x31774/4, 0x00000001); + INSTANCE_WR(ctx, 0x317d4/4, 0x2a712488); + INSTANCE_WR(ctx, 0x31814/4, 0x4085c000); + INSTANCE_WR(ctx, 0x31834/4, 0x00000040); + INSTANCE_WR(ctx, 0x31854/4, 0x00000100); + INSTANCE_WR(ctx, 0x31874/4, 0x00010100); + INSTANCE_WR(ctx, 0x31894/4, 0x02800000); + INSTANCE_WR(ctx, 0x31a94/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x31ab4/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x31ad4/4, 0x00000001); + INSTANCE_WR(ctx, 0x31b14/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x31b34/4, 0x00000001); + INSTANCE_WR(ctx, 0x31b94/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x31cb4/4, 0x00000001); + INSTANCE_WR(ctx, 0x31cf4/4, 0x00000001); + INSTANCE_WR(ctx, 0x31d14/4, 0x30201000); + INSTANCE_WR(ctx, 0x31d34/4, 0x70605040); + INSTANCE_WR(ctx, 0x31d54/4, 0xb8a89888); + INSTANCE_WR(ctx, 0x31d74/4, 0xf8e8d8c8); + INSTANCE_WR(ctx, 0x31db4/4, 0x0000001a); + INSTANCE_WR(ctx, 0x01738/4, 0x00000004); + INSTANCE_WR(ctx, 0x019f8/4, 0x00000004); + INSTANCE_WR(ctx, 0x01a18/4, 0x00000004); + INSTANCE_WR(ctx, 0x01a38/4, 0x00608080); + INSTANCE_WR(ctx, 0x01ad8/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b38/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b58/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b78/4, 0x00000080); + INSTANCE_WR(ctx, 0x01b98/4, 0x00001000); + INSTANCE_WR(ctx, 0x01bb8/4, 0x00000004); + INSTANCE_WR(ctx, 0x02058/4, 0x00000004); + INSTANCE_WR(ctx, 0x02078/4, 0x00000080); + INSTANCE_WR(ctx, 0x02098/4, 0x00000004); + INSTANCE_WR(ctx, 0x020b8/4, 0x03020100); + INSTANCE_WR(ctx, 0x020d8/4, 0x00000003); + INSTANCE_WR(ctx, 0x020f8/4, 0x00001000); + INSTANCE_WR(ctx, 0x02118/4, 0x00000004); + INSTANCE_WR(ctx, 0x021b8/4, 0x00000004); + INSTANCE_WR(ctx, 0x021d8/4, 0x00000003); + INSTANCE_WR(ctx, 0x02258/4, 0x00000004); + INSTANCE_WR(ctx, 0x166f8/4, 0x00000004); + INSTANCE_WR(ctx, 0x16718/4, 0x00000003); + INSTANCE_WR(ctx, 0x16958/4, 0x0000000f); + INSTANCE_WR(ctx, 0x16ad8/4, 0x00000004); + INSTANCE_WR(ctx, 0x16af8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b18/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b38/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b58/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16c78/4, 0x00000001); + INSTANCE_WR(ctx, 0x16cf8/4, 0x00000001); + INSTANCE_WR(ctx, 0x16db8/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f58/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f78/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f98/4, 0x00000002); + INSTANCE_WR(ctx, 0x16fb8/4, 0x00000001); + INSTANCE_WR(ctx, 0x16fd8/4, 0x00000001); + INSTANCE_WR(ctx, 0x16ff8/4, 0x00000002); + INSTANCE_WR(ctx, 0x17018/4, 0x00000001); + INSTANCE_WR(ctx, 0x17058/4, 0x00000011); + INSTANCE_WR(ctx, 0x17158/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x171b8/4, 0x00000004); + INSTANCE_WR(ctx, 0x17238/4, 0x00000011); + INSTANCE_WR(ctx, 0x17258/4, 0x00000001); + INSTANCE_WR(ctx, 0x17298/4, 0x000000cf); + INSTANCE_WR(ctx, 0x172b8/4, 0x000000cf); + INSTANCE_WR(ctx, 0x172d8/4, 0x000000cf); + INSTANCE_WR(ctx, 0x17438/4, 0x00000001); + INSTANCE_WR(ctx, 0x17458/4, 0x00000001); + INSTANCE_WR(ctx, 0x17478/4, 0x00000002); + INSTANCE_WR(ctx, 0x17498/4, 0x00000001); + INSTANCE_WR(ctx, 0x174b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x174d8/4, 0x00000002); + INSTANCE_WR(ctx, 0x174f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x17538/4, 0x00000001); + INSTANCE_WR(ctx, 0x17558/4, 0x00000001); + INSTANCE_WR(ctx, 0x17578/4, 0x00000001); + INSTANCE_WR(ctx, 0x17598/4, 0x00000001); + INSTANCE_WR(ctx, 0x175b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x175d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x175f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x17618/4, 0x00000001); + INSTANCE_WR(ctx, 0x17638/4, 0x00000011); + INSTANCE_WR(ctx, 0x17738/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x17758/4, 0x0000000f); + INSTANCE_WR(ctx, 0x17858/4, 0x00003e60); + INSTANCE_WR(ctx, 0x178b8/4, 0x00000011); + INSTANCE_WR(ctx, 0x178d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x17918/4, 0x00000004); + INSTANCE_WR(ctx, 0x179d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x17a78/4, 0x00000011); + INSTANCE_WR(ctx, 0x17b78/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x17bf8/4, 0x00000011); + INSTANCE_WR(ctx, 0x17c18/4, 0x00000001); + INSTANCE_WR(ctx, 0x17c58/4, 0x00000001); + INSTANCE_WR(ctx, 0x17c98/4, 0x00000001); + INSTANCE_WR(ctx, 0x17cd8/4, 0x000003ff); + INSTANCE_WR(ctx, 0x17d18/4, 0x00000001); + INSTANCE_WR(ctx, 0x17d58/4, 0x00000001); + INSTANCE_WR(ctx, 0x182b8/4, 0x00000008); + INSTANCE_WR(ctx, 0x182d8/4, 0x00000008); + INSTANCE_WR(ctx, 0x182f8/4, 0x00000008); + INSTANCE_WR(ctx, 0x18318/4, 0x00000008); + INSTANCE_WR(ctx, 0x18338/4, 0x00000008); + INSTANCE_WR(ctx, 0x18358/4, 0x00000008); + INSTANCE_WR(ctx, 0x18378/4, 0x00000008); + INSTANCE_WR(ctx, 0x18398/4, 0x00000008); + INSTANCE_WR(ctx, 0x183b8/4, 0x00000011); + INSTANCE_WR(ctx, 0x184b8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x184d8/4, 0x00000400); + INSTANCE_WR(ctx, 0x184f8/4, 0x00000400); + INSTANCE_WR(ctx, 0x18518/4, 0x00000400); + INSTANCE_WR(ctx, 0x18538/4, 0x00000400); + INSTANCE_WR(ctx, 0x18558/4, 0x00000400); + INSTANCE_WR(ctx, 0x18578/4, 0x00000400); + INSTANCE_WR(ctx, 0x18598/4, 0x00000400); + INSTANCE_WR(ctx, 0x185b8/4, 0x00000400); + INSTANCE_WR(ctx, 0x185d8/4, 0x00000300); + INSTANCE_WR(ctx, 0x185f8/4, 0x00000300); + INSTANCE_WR(ctx, 0x18618/4, 0x00000300); + INSTANCE_WR(ctx, 0x18638/4, 0x00000300); + INSTANCE_WR(ctx, 0x18658/4, 0x00000300); + INSTANCE_WR(ctx, 0x18678/4, 0x00000300); + INSTANCE_WR(ctx, 0x18698/4, 0x00000300); + INSTANCE_WR(ctx, 0x186b8/4, 0x00000300); + INSTANCE_WR(ctx, 0x186d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x186f8/4, 0x0000000f); + INSTANCE_WR(ctx, 0x187f8/4, 0x00000020); + INSTANCE_WR(ctx, 0x18818/4, 0x00000011); + INSTANCE_WR(ctx, 0x18838/4, 0x00000100); + INSTANCE_WR(ctx, 0x18878/4, 0x00000001); + INSTANCE_WR(ctx, 0x188d8/4, 0x00000040); + INSTANCE_WR(ctx, 0x188f8/4, 0x00000100); + INSTANCE_WR(ctx, 0x18938/4, 0x00000003); + INSTANCE_WR(ctx, 0x189d8/4, 0x00003e60); + INSTANCE_WR(ctx, 0x18a58/4, 0x00000002); + INSTANCE_WR(ctx, 0x18a78/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x18bb8/4, 0x00000001); + INSTANCE_WR(ctx, 0x18c58/4, 0x00000004); + INSTANCE_WR(ctx, 0x18c98/4, 0x00000001); + INSTANCE_WR(ctx, 0x18cb8/4, 0x00000400); + INSTANCE_WR(ctx, 0x18cd8/4, 0x00000300); + INSTANCE_WR(ctx, 0x18cf8/4, 0x00001001); + INSTANCE_WR(ctx, 0x18d78/4, 0x00000011); + INSTANCE_WR(ctx, 0x18e78/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x18e98/4, 0x0000000f); + INSTANCE_WR(ctx, 0x19198/4, 0x00003e60); + INSTANCE_WR(ctx, 0x19218/4, 0x00000011); + INSTANCE_WR(ctx, 0x19278/4, 0x00000004); + INSTANCE_WR(ctx, 0x192b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x192d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x19358/4, 0x00000001); + INSTANCE_WR(ctx, 0x193d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x19418/4, 0x00000001); + INSTANCE_WR(ctx, 0x19478/4, 0x2a712488); + INSTANCE_WR(ctx, 0x194b8/4, 0x4085c000); + INSTANCE_WR(ctx, 0x194d8/4, 0x00000040); + INSTANCE_WR(ctx, 0x194f8/4, 0x00000100); + INSTANCE_WR(ctx, 0x19518/4, 0x00010100); + INSTANCE_WR(ctx, 0x19538/4, 0x02800000); + INSTANCE_WR(ctx, 0x19738/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x19758/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x19778/4, 0x00000001); + INSTANCE_WR(ctx, 0x197b8/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x197d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x19838/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x19958/4, 0x00000001); + INSTANCE_WR(ctx, 0x19998/4, 0x00000001); + INSTANCE_WR(ctx, 0x199b8/4, 0x30201000); + INSTANCE_WR(ctx, 0x199d8/4, 0x70605040); + INSTANCE_WR(ctx, 0x199f8/4, 0xb8a89888); + INSTANCE_WR(ctx, 0x19a18/4, 0xf8e8d8c8); + INSTANCE_WR(ctx, 0x19a58/4, 0x0000001a); + INSTANCE_WR(ctx, 0x19a98/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d58/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d78/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d98/4, 0x00608080); + INSTANCE_WR(ctx, 0x19e38/4, 0x00000004); + INSTANCE_WR(ctx, 0x19e98/4, 0x00000004); + INSTANCE_WR(ctx, 0x19eb8/4, 0x00000004); + INSTANCE_WR(ctx, 0x19ed8/4, 0x00000080); + INSTANCE_WR(ctx, 0x19ef8/4, 0x00001000); + INSTANCE_WR(ctx, 0x19f18/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a3b8/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a3d8/4, 0x00000080); + INSTANCE_WR(ctx, 0x1a3f8/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a418/4, 0x03020100); + INSTANCE_WR(ctx, 0x1a438/4, 0x00000003); + INSTANCE_WR(ctx, 0x1a458/4, 0x00001000); + INSTANCE_WR(ctx, 0x1a478/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a518/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a538/4, 0x00000003); + INSTANCE_WR(ctx, 0x1a5b8/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ea58/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ea78/4, 0x00000003); + INSTANCE_WR(ctx, 0x2ecb8/4, 0x0000000f); + INSTANCE_WR(ctx, 0x2ee38/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ee58/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2ee78/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2ee98/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2eeb8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2efd8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f058/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f118/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2f8/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f318/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f338/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f358/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f378/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f3b8/4, 0x00000011); + INSTANCE_WR(ctx, 0x2f4b8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2f518/4, 0x00000004); + INSTANCE_WR(ctx, 0x2f598/4, 0x00000011); + INSTANCE_WR(ctx, 0x2f5b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f5f8/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f618/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f638/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f798/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f7b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f7d8/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f7f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f818/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f838/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f858/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f898/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f918/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f938/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f958/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f978/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f998/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fa98/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2fab8/4, 0x0000000f); + INSTANCE_WR(ctx, 0x2fbb8/4, 0x00003e60); + INSTANCE_WR(ctx, 0x2fc18/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fc38/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fc78/4, 0x00000004); + INSTANCE_WR(ctx, 0x2fd38/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fdd8/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fed8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2ff58/4, 0x00000011); + INSTANCE_WR(ctx, 0x2ff78/4, 0x00000001); + INSTANCE_WR(ctx, 0x2ffb8/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fff8/4, 0x00000001); + INSTANCE_WR(ctx, 0x30038/4, 0x000003ff); + INSTANCE_WR(ctx, 0x30078/4, 0x00000001); + INSTANCE_WR(ctx, 0x300b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x30618/4, 0x00000008); + INSTANCE_WR(ctx, 0x30638/4, 0x00000008); + INSTANCE_WR(ctx, 0x30658/4, 0x00000008); + INSTANCE_WR(ctx, 0x30678/4, 0x00000008); + INSTANCE_WR(ctx, 0x30698/4, 0x00000008); + INSTANCE_WR(ctx, 0x306b8/4, 0x00000008); + INSTANCE_WR(ctx, 0x306d8/4, 0x00000008); + INSTANCE_WR(ctx, 0x306f8/4, 0x00000008); + INSTANCE_WR(ctx, 0x30718/4, 0x00000011); + INSTANCE_WR(ctx, 0x30818/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x30838/4, 0x00000400); + INSTANCE_WR(ctx, 0x30858/4, 0x00000400); + INSTANCE_WR(ctx, 0x30878/4, 0x00000400); + INSTANCE_WR(ctx, 0x30898/4, 0x00000400); + INSTANCE_WR(ctx, 0x308b8/4, 0x00000400); + INSTANCE_WR(ctx, 0x308d8/4, 0x00000400); + INSTANCE_WR(ctx, 0x308f8/4, 0x00000400); + INSTANCE_WR(ctx, 0x30918/4, 0x00000400); + INSTANCE_WR(ctx, 0x30938/4, 0x00000300); + INSTANCE_WR(ctx, 0x30958/4, 0x00000300); + INSTANCE_WR(ctx, 0x30978/4, 0x00000300); + INSTANCE_WR(ctx, 0x30998/4, 0x00000300); + INSTANCE_WR(ctx, 0x309b8/4, 0x00000300); + INSTANCE_WR(ctx, 0x309d8/4, 0x00000300); + INSTANCE_WR(ctx, 0x309f8/4, 0x00000300); + INSTANCE_WR(ctx, 0x30a18/4, 0x00000300); + INSTANCE_WR(ctx, 0x30a38/4, 0x00000001); + INSTANCE_WR(ctx, 0x30a58/4, 0x0000000f); + INSTANCE_WR(ctx, 0x30b58/4, 0x00000020); + INSTANCE_WR(ctx, 0x30b78/4, 0x00000011); + INSTANCE_WR(ctx, 0x30b98/4, 0x00000100); + INSTANCE_WR(ctx, 0x30bd8/4, 0x00000001); + INSTANCE_WR(ctx, 0x30c38/4, 0x00000040); + INSTANCE_WR(ctx, 0x30c58/4, 0x00000100); + INSTANCE_WR(ctx, 0x30c98/4, 0x00000003); + INSTANCE_WR(ctx, 0x30d38/4, 0x00003e60); + INSTANCE_WR(ctx, 0x30db8/4, 0x00000002); + INSTANCE_WR(ctx, 0x30dd8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x30f18/4, 0x00000001); + INSTANCE_WR(ctx, 0x30fb8/4, 0x00000004); + INSTANCE_WR(ctx, 0x30ff8/4, 0x00000001); + INSTANCE_WR(ctx, 0x31018/4, 0x00000400); + INSTANCE_WR(ctx, 0x31038/4, 0x00000300); + INSTANCE_WR(ctx, 0x31058/4, 0x00001001); + INSTANCE_WR(ctx, 0x310d8/4, 0x00000011); + INSTANCE_WR(ctx, 0x311d8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x311f8/4, 0x0000000f); + INSTANCE_WR(ctx, 0x314f8/4, 0x00003e60); + INSTANCE_WR(ctx, 0x31578/4, 0x00000011); + INSTANCE_WR(ctx, 0x315d8/4, 0x00000004); + INSTANCE_WR(ctx, 0x31618/4, 0x00000001); + INSTANCE_WR(ctx, 0x31638/4, 0x00000001); + INSTANCE_WR(ctx, 0x316b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x31738/4, 0x00000001); + INSTANCE_WR(ctx, 0x31778/4, 0x00000001); + INSTANCE_WR(ctx, 0x317d8/4, 0x2a712488); + INSTANCE_WR(ctx, 0x31818/4, 0x4085c000); + INSTANCE_WR(ctx, 0x31838/4, 0x00000040); + INSTANCE_WR(ctx, 0x31858/4, 0x00000100); + INSTANCE_WR(ctx, 0x31878/4, 0x00010100); + INSTANCE_WR(ctx, 0x31898/4, 0x02800000); + INSTANCE_WR(ctx, 0x31a98/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x31ab8/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x31ad8/4, 0x00000001); + INSTANCE_WR(ctx, 0x31b18/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x31b38/4, 0x00000001); + INSTANCE_WR(ctx, 0x31b98/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x31cb8/4, 0x00000001); + INSTANCE_WR(ctx, 0x31cf8/4, 0x00000001); + INSTANCE_WR(ctx, 0x31d18/4, 0x30201000); + INSTANCE_WR(ctx, 0x31d38/4, 0x70605040); + INSTANCE_WR(ctx, 0x31d58/4, 0xb8a89888); + INSTANCE_WR(ctx, 0x31d78/4, 0xf8e8d8c8); + INSTANCE_WR(ctx, 0x31db8/4, 0x0000001a); + INSTANCE_WR(ctx, 0x0173c/4, 0x00000004); + INSTANCE_WR(ctx, 0x019fc/4, 0x00000004); + INSTANCE_WR(ctx, 0x01a1c/4, 0x00000004); + INSTANCE_WR(ctx, 0x01a3c/4, 0x00608080); + INSTANCE_WR(ctx, 0x01adc/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b3c/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b5c/4, 0x00000004); + INSTANCE_WR(ctx, 0x01b7c/4, 0x00000080); + INSTANCE_WR(ctx, 0x01b9c/4, 0x00001000); + INSTANCE_WR(ctx, 0x01bbc/4, 0x00000004); + INSTANCE_WR(ctx, 0x0205c/4, 0x00000004); + INSTANCE_WR(ctx, 0x0207c/4, 0x00000080); + INSTANCE_WR(ctx, 0x0209c/4, 0x00000004); + INSTANCE_WR(ctx, 0x020bc/4, 0x03020100); + INSTANCE_WR(ctx, 0x020dc/4, 0x00000003); + INSTANCE_WR(ctx, 0x020fc/4, 0x00001000); + INSTANCE_WR(ctx, 0x0211c/4, 0x00000004); + INSTANCE_WR(ctx, 0x021bc/4, 0x00000004); + INSTANCE_WR(ctx, 0x021dc/4, 0x00000003); + INSTANCE_WR(ctx, 0x0225c/4, 0x00000004); + INSTANCE_WR(ctx, 0x166fc/4, 0x00000004); + INSTANCE_WR(ctx, 0x1671c/4, 0x00000003); + INSTANCE_WR(ctx, 0x1695c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x16adc/4, 0x00000004); + INSTANCE_WR(ctx, 0x16afc/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b1c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b3c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16b5c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x16c7c/4, 0x00000001); + INSTANCE_WR(ctx, 0x16cfc/4, 0x00000001); + INSTANCE_WR(ctx, 0x16dbc/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f5c/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f7c/4, 0x00000001); + INSTANCE_WR(ctx, 0x16f9c/4, 0x00000002); + INSTANCE_WR(ctx, 0x16fbc/4, 0x00000001); + INSTANCE_WR(ctx, 0x16fdc/4, 0x00000001); + INSTANCE_WR(ctx, 0x16ffc/4, 0x00000002); + INSTANCE_WR(ctx, 0x1701c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1705c/4, 0x00000011); + INSTANCE_WR(ctx, 0x1715c/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x171bc/4, 0x00000004); + INSTANCE_WR(ctx, 0x1723c/4, 0x00000011); + INSTANCE_WR(ctx, 0x1725c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1729c/4, 0x000000cf); + INSTANCE_WR(ctx, 0x172bc/4, 0x000000cf); + INSTANCE_WR(ctx, 0x172dc/4, 0x000000cf); + INSTANCE_WR(ctx, 0x1743c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1745c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1747c/4, 0x00000002); + INSTANCE_WR(ctx, 0x1749c/4, 0x00000001); + INSTANCE_WR(ctx, 0x174bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x174dc/4, 0x00000002); + INSTANCE_WR(ctx, 0x174fc/4, 0x00000001); + INSTANCE_WR(ctx, 0x1753c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1755c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1757c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1759c/4, 0x00000001); + INSTANCE_WR(ctx, 0x175bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x175dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x175fc/4, 0x00000001); + INSTANCE_WR(ctx, 0x1761c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1763c/4, 0x00000011); + INSTANCE_WR(ctx, 0x1773c/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x1775c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x1785c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x178bc/4, 0x00000011); + INSTANCE_WR(ctx, 0x178dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x1791c/4, 0x00000004); + INSTANCE_WR(ctx, 0x179dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x17a7c/4, 0x00000011); + INSTANCE_WR(ctx, 0x17b7c/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x17bfc/4, 0x00000011); + INSTANCE_WR(ctx, 0x17c1c/4, 0x00000001); + INSTANCE_WR(ctx, 0x17c5c/4, 0x00000001); + INSTANCE_WR(ctx, 0x17c9c/4, 0x00000001); + INSTANCE_WR(ctx, 0x17cdc/4, 0x000003ff); + INSTANCE_WR(ctx, 0x17d1c/4, 0x00000001); + INSTANCE_WR(ctx, 0x17d5c/4, 0x00000001); + INSTANCE_WR(ctx, 0x182bc/4, 0x00000008); + INSTANCE_WR(ctx, 0x182dc/4, 0x00000008); + INSTANCE_WR(ctx, 0x182fc/4, 0x00000008); + INSTANCE_WR(ctx, 0x1831c/4, 0x00000008); + INSTANCE_WR(ctx, 0x1833c/4, 0x00000008); + INSTANCE_WR(ctx, 0x1835c/4, 0x00000008); + INSTANCE_WR(ctx, 0x1837c/4, 0x00000008); + INSTANCE_WR(ctx, 0x1839c/4, 0x00000008); + INSTANCE_WR(ctx, 0x183bc/4, 0x00000011); + INSTANCE_WR(ctx, 0x184bc/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x184dc/4, 0x00000400); + INSTANCE_WR(ctx, 0x184fc/4, 0x00000400); + INSTANCE_WR(ctx, 0x1851c/4, 0x00000400); + INSTANCE_WR(ctx, 0x1853c/4, 0x00000400); + INSTANCE_WR(ctx, 0x1855c/4, 0x00000400); + INSTANCE_WR(ctx, 0x1857c/4, 0x00000400); + INSTANCE_WR(ctx, 0x1859c/4, 0x00000400); + INSTANCE_WR(ctx, 0x185bc/4, 0x00000400); + INSTANCE_WR(ctx, 0x185dc/4, 0x00000300); + INSTANCE_WR(ctx, 0x185fc/4, 0x00000300); + INSTANCE_WR(ctx, 0x1861c/4, 0x00000300); + INSTANCE_WR(ctx, 0x1863c/4, 0x00000300); + INSTANCE_WR(ctx, 0x1865c/4, 0x00000300); + INSTANCE_WR(ctx, 0x1867c/4, 0x00000300); + INSTANCE_WR(ctx, 0x1869c/4, 0x00000300); + INSTANCE_WR(ctx, 0x186bc/4, 0x00000300); + INSTANCE_WR(ctx, 0x186dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x186fc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x187fc/4, 0x00000020); + INSTANCE_WR(ctx, 0x1881c/4, 0x00000011); + INSTANCE_WR(ctx, 0x1883c/4, 0x00000100); + INSTANCE_WR(ctx, 0x1887c/4, 0x00000001); + INSTANCE_WR(ctx, 0x188dc/4, 0x00000040); + INSTANCE_WR(ctx, 0x188fc/4, 0x00000100); + INSTANCE_WR(ctx, 0x1893c/4, 0x00000003); + INSTANCE_WR(ctx, 0x189dc/4, 0x00003e60); + INSTANCE_WR(ctx, 0x18a5c/4, 0x00000002); + INSTANCE_WR(ctx, 0x18a7c/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x18bbc/4, 0x00000001); + INSTANCE_WR(ctx, 0x18c5c/4, 0x00000004); + INSTANCE_WR(ctx, 0x18c9c/4, 0x00000001); + INSTANCE_WR(ctx, 0x18cbc/4, 0x00000400); + INSTANCE_WR(ctx, 0x18cdc/4, 0x00000300); + INSTANCE_WR(ctx, 0x18cfc/4, 0x00001001); + INSTANCE_WR(ctx, 0x18d7c/4, 0x00000011); + INSTANCE_WR(ctx, 0x18e7c/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x18e9c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x1919c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x1921c/4, 0x00000011); + INSTANCE_WR(ctx, 0x1927c/4, 0x00000004); + INSTANCE_WR(ctx, 0x192bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x192dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x1935c/4, 0x00000001); + INSTANCE_WR(ctx, 0x193dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x1941c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1947c/4, 0x2a712488); + INSTANCE_WR(ctx, 0x194bc/4, 0x4085c000); + INSTANCE_WR(ctx, 0x194dc/4, 0x00000040); + INSTANCE_WR(ctx, 0x194fc/4, 0x00000100); + INSTANCE_WR(ctx, 0x1951c/4, 0x00010100); + INSTANCE_WR(ctx, 0x1953c/4, 0x02800000); + INSTANCE_WR(ctx, 0x1973c/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x1975c/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x1977c/4, 0x00000001); + INSTANCE_WR(ctx, 0x197bc/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x197dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x1983c/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x1995c/4, 0x00000001); + INSTANCE_WR(ctx, 0x1999c/4, 0x00000001); + INSTANCE_WR(ctx, 0x199bc/4, 0x30201000); + INSTANCE_WR(ctx, 0x199dc/4, 0x70605040); + INSTANCE_WR(ctx, 0x199fc/4, 0xb8a89888); + INSTANCE_WR(ctx, 0x19a1c/4, 0xf8e8d8c8); + INSTANCE_WR(ctx, 0x19a5c/4, 0x0000001a); + INSTANCE_WR(ctx, 0x19a9c/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d5c/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d7c/4, 0x00000004); + INSTANCE_WR(ctx, 0x19d9c/4, 0x00608080); + INSTANCE_WR(ctx, 0x19e3c/4, 0x00000004); + INSTANCE_WR(ctx, 0x19e9c/4, 0x00000004); + INSTANCE_WR(ctx, 0x19ebc/4, 0x00000004); + INSTANCE_WR(ctx, 0x19edc/4, 0x00000080); + INSTANCE_WR(ctx, 0x19efc/4, 0x00001000); + INSTANCE_WR(ctx, 0x19f1c/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a3bc/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a3dc/4, 0x00000080); + INSTANCE_WR(ctx, 0x1a3fc/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a41c/4, 0x03020100); + INSTANCE_WR(ctx, 0x1a43c/4, 0x00000003); + INSTANCE_WR(ctx, 0x1a45c/4, 0x00001000); + INSTANCE_WR(ctx, 0x1a47c/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a51c/4, 0x00000004); + INSTANCE_WR(ctx, 0x1a53c/4, 0x00000003); + INSTANCE_WR(ctx, 0x1a5bc/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ea5c/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ea7c/4, 0x00000003); + INSTANCE_WR(ctx, 0x2ecbc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x2ee3c/4, 0x00000004); + INSTANCE_WR(ctx, 0x2ee5c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2ee7c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2ee9c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2eebc/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x2efdc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f05c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f11c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f2fc/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f31c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f33c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f35c/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f37c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f3bc/4, 0x00000011); + INSTANCE_WR(ctx, 0x2f4bc/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2f51c/4, 0x00000004); + INSTANCE_WR(ctx, 0x2f59c/4, 0x00000011); + INSTANCE_WR(ctx, 0x2f5bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f5fc/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f61c/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f63c/4, 0x000000cf); + INSTANCE_WR(ctx, 0x2f79c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f7bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f7dc/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f7fc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f81c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f83c/4, 0x00000002); + INSTANCE_WR(ctx, 0x2f85c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f89c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f8fc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f91c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f93c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f95c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f97c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2f99c/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fa9c/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2fabc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x2fbbc/4, 0x00003e60); + INSTANCE_WR(ctx, 0x2fc1c/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fc3c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fc7c/4, 0x00000004); + INSTANCE_WR(ctx, 0x2fd3c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fddc/4, 0x00000011); + INSTANCE_WR(ctx, 0x2fedc/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x2ff5c/4, 0x00000011); + INSTANCE_WR(ctx, 0x2ff7c/4, 0x00000001); + INSTANCE_WR(ctx, 0x2ffbc/4, 0x00000001); + INSTANCE_WR(ctx, 0x2fffc/4, 0x00000001); + INSTANCE_WR(ctx, 0x3003c/4, 0x000003ff); + INSTANCE_WR(ctx, 0x3007c/4, 0x00000001); + INSTANCE_WR(ctx, 0x300bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x3061c/4, 0x00000008); + INSTANCE_WR(ctx, 0x3063c/4, 0x00000008); + INSTANCE_WR(ctx, 0x3065c/4, 0x00000008); + INSTANCE_WR(ctx, 0x3067c/4, 0x00000008); + INSTANCE_WR(ctx, 0x3069c/4, 0x00000008); + INSTANCE_WR(ctx, 0x306bc/4, 0x00000008); + INSTANCE_WR(ctx, 0x306dc/4, 0x00000008); + INSTANCE_WR(ctx, 0x306fc/4, 0x00000008); + INSTANCE_WR(ctx, 0x3071c/4, 0x00000011); + INSTANCE_WR(ctx, 0x3081c/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x3083c/4, 0x00000400); + INSTANCE_WR(ctx, 0x3085c/4, 0x00000400); + INSTANCE_WR(ctx, 0x3087c/4, 0x00000400); + INSTANCE_WR(ctx, 0x3089c/4, 0x00000400); + INSTANCE_WR(ctx, 0x308bc/4, 0x00000400); + INSTANCE_WR(ctx, 0x308dc/4, 0x00000400); + INSTANCE_WR(ctx, 0x308fc/4, 0x00000400); + INSTANCE_WR(ctx, 0x3091c/4, 0x00000400); + INSTANCE_WR(ctx, 0x3093c/4, 0x00000300); + INSTANCE_WR(ctx, 0x3095c/4, 0x00000300); + INSTANCE_WR(ctx, 0x3097c/4, 0x00000300); + INSTANCE_WR(ctx, 0x3099c/4, 0x00000300); + INSTANCE_WR(ctx, 0x309bc/4, 0x00000300); + INSTANCE_WR(ctx, 0x309dc/4, 0x00000300); + INSTANCE_WR(ctx, 0x309fc/4, 0x00000300); + INSTANCE_WR(ctx, 0x30a1c/4, 0x00000300); + INSTANCE_WR(ctx, 0x30a3c/4, 0x00000001); + INSTANCE_WR(ctx, 0x30a5c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x30b5c/4, 0x00000020); + INSTANCE_WR(ctx, 0x30b7c/4, 0x00000011); + INSTANCE_WR(ctx, 0x30b9c/4, 0x00000100); + INSTANCE_WR(ctx, 0x30bdc/4, 0x00000001); + INSTANCE_WR(ctx, 0x30c3c/4, 0x00000040); + INSTANCE_WR(ctx, 0x30c5c/4, 0x00000100); + INSTANCE_WR(ctx, 0x30c9c/4, 0x00000003); + INSTANCE_WR(ctx, 0x30d3c/4, 0x00003e60); + INSTANCE_WR(ctx, 0x30dbc/4, 0x00000002); + INSTANCE_WR(ctx, 0x30ddc/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x30f1c/4, 0x00000001); + INSTANCE_WR(ctx, 0x30fbc/4, 0x00000004); + INSTANCE_WR(ctx, 0x30ffc/4, 0x00000001); + INSTANCE_WR(ctx, 0x3101c/4, 0x00000400); + INSTANCE_WR(ctx, 0x3103c/4, 0x00000300); + INSTANCE_WR(ctx, 0x3105c/4, 0x00001001); + INSTANCE_WR(ctx, 0x310dc/4, 0x00000011); + INSTANCE_WR(ctx, 0x311dc/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x311fc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x314fc/4, 0x00003e60); + INSTANCE_WR(ctx, 0x3157c/4, 0x00000011); + INSTANCE_WR(ctx, 0x315dc/4, 0x00000004); + INSTANCE_WR(ctx, 0x3161c/4, 0x00000001); + INSTANCE_WR(ctx, 0x3163c/4, 0x00000001); + INSTANCE_WR(ctx, 0x316bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x3173c/4, 0x00000001); + INSTANCE_WR(ctx, 0x3177c/4, 0x00000001); + INSTANCE_WR(ctx, 0x317dc/4, 0x2a712488); + INSTANCE_WR(ctx, 0x3181c/4, 0x4085c000); + INSTANCE_WR(ctx, 0x3183c/4, 0x00000040); + INSTANCE_WR(ctx, 0x3185c/4, 0x00000100); + INSTANCE_WR(ctx, 0x3187c/4, 0x00010100); + INSTANCE_WR(ctx, 0x3189c/4, 0x02800000); + INSTANCE_WR(ctx, 0x31a9c/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x31abc/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x31adc/4, 0x00000001); + INSTANCE_WR(ctx, 0x31b1c/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x31b3c/4, 0x00000001); + INSTANCE_WR(ctx, 0x31b9c/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x31cbc/4, 0x00000001); + INSTANCE_WR(ctx, 0x31cfc/4, 0x00000001); + INSTANCE_WR(ctx, 0x31d1c/4, 0x30201000); + INSTANCE_WR(ctx, 0x31d3c/4, 0x70605040); + INSTANCE_WR(ctx, 0x31d5c/4, 0xb8a89888); + INSTANCE_WR(ctx, 0x31d7c/4, 0xf8e8d8c8); + INSTANCE_WR(ctx, 0x31dbc/4, 0x0000001a); + INSTANCE_WR(ctx, 0x4dc00/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4dc40/4, 0x00000080); + INSTANCE_WR(ctx, 0x4dc60/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dc80/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dca0/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd00/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dd60/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd80/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dda0/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dde0/4, 0x00000004); + INSTANCE_WR(ctx, 0x4de00/4, 0x00000002); + INSTANCE_WR(ctx, 0x4df80/4, 0x00000080); + INSTANCE_WR(ctx, 0x4dfa0/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dfc0/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dfe0/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e040/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e0a0/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0c0/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0e0/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e120/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e140/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e2a0/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e380/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3a0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3c0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3e0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e400/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e420/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e440/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e460/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e4a0/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x4e560/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e580/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e5c0/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e5e0/4, 0x00000011); + INSTANCE_WR(ctx, 0x4e700/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x4e7a0/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e8e0/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e900/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e920/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e940/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e960/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e980/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e9a0/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e9e0/4, 0x00000004); + INSTANCE_WR(ctx, 0x55e00/4, 0x00000011); + INSTANCE_WR(ctx, 0x55e40/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dc24/4, 0x00000080); + INSTANCE_WR(ctx, 0x4dc44/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dc64/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dc84/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dce4/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dd44/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd64/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd84/4, 0x00000001); + INSTANCE_WR(ctx, 0x4ddc4/4, 0x00000004); + INSTANCE_WR(ctx, 0x4dde4/4, 0x00000002); + INSTANCE_WR(ctx, 0x4df64/4, 0x00000080); + INSTANCE_WR(ctx, 0x4df84/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dfa4/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dfc4/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e024/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e084/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0a4/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0c4/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e104/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e124/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e284/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e364/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e384/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3a4/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3c4/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3e4/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e404/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e424/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e444/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e484/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x4e544/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e564/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e5a4/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e5c4/4, 0x00000011); + INSTANCE_WR(ctx, 0x4e6e4/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x4e784/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e8c4/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e8e4/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e904/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e924/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e944/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e964/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e984/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e9c4/4, 0x00000004); + INSTANCE_WR(ctx, 0x55de4/4, 0x00000011); + INSTANCE_WR(ctx, 0x55e24/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dc28/4, 0x00000080); + INSTANCE_WR(ctx, 0x4dc48/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dc68/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dc88/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dce8/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dd48/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd68/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd88/4, 0x00000001); + INSTANCE_WR(ctx, 0x4ddc8/4, 0x00000004); + INSTANCE_WR(ctx, 0x4dde8/4, 0x00000002); + INSTANCE_WR(ctx, 0x4df68/4, 0x00000080); + INSTANCE_WR(ctx, 0x4df88/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dfa8/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dfc8/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e028/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e088/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0a8/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0c8/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e108/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e128/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e288/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e368/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e388/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3a8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3c8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3e8/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e408/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e428/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e448/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e488/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x4e548/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e568/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e5a8/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e5c8/4, 0x00000011); + INSTANCE_WR(ctx, 0x4e6e8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x4e788/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e8c8/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e8e8/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e908/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e928/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e948/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e968/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e988/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e9c8/4, 0x00000004); + INSTANCE_WR(ctx, 0x55de8/4, 0x00000011); + INSTANCE_WR(ctx, 0x55e28/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dc2c/4, 0x00000080); + INSTANCE_WR(ctx, 0x4dc4c/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dc6c/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dc8c/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dcec/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dd4c/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd6c/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd8c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4ddcc/4, 0x00000004); + INSTANCE_WR(ctx, 0x4ddec/4, 0x00000002); + INSTANCE_WR(ctx, 0x4df6c/4, 0x00000080); + INSTANCE_WR(ctx, 0x4df8c/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dfac/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dfcc/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e02c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e08c/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0ac/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0cc/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e10c/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e12c/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e28c/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e36c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e38c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3ac/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3cc/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e40c/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e42c/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e44c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e48c/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x4e54c/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e56c/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e5ac/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e5cc/4, 0x00000011); + INSTANCE_WR(ctx, 0x4e6ec/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x4e78c/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e8cc/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e8ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e90c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e92c/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e94c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e96c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e98c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e9cc/4, 0x00000004); + INSTANCE_WR(ctx, 0x55dec/4, 0x00000011); + INSTANCE_WR(ctx, 0x55e2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dc30/4, 0x00000080); + INSTANCE_WR(ctx, 0x4dc50/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dc70/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dc90/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dcf0/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dd50/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd70/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd90/4, 0x00000001); + INSTANCE_WR(ctx, 0x4ddd0/4, 0x00000004); + INSTANCE_WR(ctx, 0x4ddf0/4, 0x00000002); + INSTANCE_WR(ctx, 0x4df70/4, 0x00000080); + INSTANCE_WR(ctx, 0x4df90/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dfb0/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dfd0/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e030/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e090/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0b0/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0d0/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e110/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e130/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e290/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e370/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e390/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3b0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3d0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3f0/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e410/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e430/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e450/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e490/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x4e550/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e570/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e5b0/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e5d0/4, 0x00000011); + INSTANCE_WR(ctx, 0x4e6f0/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x4e790/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e8d0/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e8f0/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e910/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e930/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e950/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e970/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e990/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e9d0/4, 0x00000004); + INSTANCE_WR(ctx, 0x55df0/4, 0x00000011); + INSTANCE_WR(ctx, 0x55e30/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dc34/4, 0x00000080); + INSTANCE_WR(ctx, 0x4dc54/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dc74/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dc94/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dcf4/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dd54/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd74/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd94/4, 0x00000001); + INSTANCE_WR(ctx, 0x4ddd4/4, 0x00000004); + INSTANCE_WR(ctx, 0x4ddf4/4, 0x00000002); + INSTANCE_WR(ctx, 0x4df74/4, 0x00000080); + INSTANCE_WR(ctx, 0x4df94/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dfb4/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dfd4/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e034/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e094/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0b4/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e114/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e134/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e294/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e374/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e394/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3b4/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3d4/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3f4/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e414/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e434/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e454/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e494/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x4e554/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e574/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e5b4/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e5d4/4, 0x00000011); + INSTANCE_WR(ctx, 0x4e6f4/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x4e794/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e8d4/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e8f4/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e914/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e934/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e954/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e974/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e994/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e9d4/4, 0x00000004); + INSTANCE_WR(ctx, 0x55df4/4, 0x00000011); + INSTANCE_WR(ctx, 0x55e34/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dc38/4, 0x00000080); + INSTANCE_WR(ctx, 0x4dc58/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dc78/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dc98/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dcf8/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dd58/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd78/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd98/4, 0x00000001); + INSTANCE_WR(ctx, 0x4ddd8/4, 0x00000004); + INSTANCE_WR(ctx, 0x4ddf8/4, 0x00000002); + INSTANCE_WR(ctx, 0x4df78/4, 0x00000080); + INSTANCE_WR(ctx, 0x4df98/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dfb8/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dfd8/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e038/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e098/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0b8/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e118/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e138/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e298/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e378/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e398/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3b8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3d8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e418/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e438/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e458/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e498/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x4e558/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e578/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e5b8/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e5d8/4, 0x00000011); + INSTANCE_WR(ctx, 0x4e6f8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x4e798/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e8d8/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e8f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e918/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e938/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e958/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e978/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e998/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e9d8/4, 0x00000004); + INSTANCE_WR(ctx, 0x55df8/4, 0x00000011); + INSTANCE_WR(ctx, 0x55e38/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dc3c/4, 0x00000080); + INSTANCE_WR(ctx, 0x4dc5c/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dc7c/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dc9c/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dcfc/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dd5c/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd7c/4, 0x00001000); + INSTANCE_WR(ctx, 0x4dd9c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4dddc/4, 0x00000004); + INSTANCE_WR(ctx, 0x4ddfc/4, 0x00000002); + INSTANCE_WR(ctx, 0x4df7c/4, 0x00000080); + INSTANCE_WR(ctx, 0x4df9c/4, 0x80007004); + INSTANCE_WR(ctx, 0x4dfbc/4, 0x04000400); + INSTANCE_WR(ctx, 0x4dfdc/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e03c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e09c/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0bc/4, 0x00001000); + INSTANCE_WR(ctx, 0x4e0dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e11c/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e13c/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e29c/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e37c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e39c/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3bc/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3dc/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x4e3fc/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e41c/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e43c/4, 0x00010001); + INSTANCE_WR(ctx, 0x4e45c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e49c/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x4e55c/4, 0x08100c12); + INSTANCE_WR(ctx, 0x4e57c/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e5bc/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e5dc/4, 0x00000011); + INSTANCE_WR(ctx, 0x4e6fc/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x4e79c/4, 0x00000004); + INSTANCE_WR(ctx, 0x4e8dc/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e8fc/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e91c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e93c/4, 0x00000002); + INSTANCE_WR(ctx, 0x4e95c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e97c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e99c/4, 0x00000001); + INSTANCE_WR(ctx, 0x4e9dc/4, 0x00000004); + INSTANCE_WR(ctx, 0x55dfc/4, 0x00000011); + INSTANCE_WR(ctx, 0x55e3c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00130/4, 0x00000002); + INSTANCE_WR(ctx, 0x00858/4, 0x00000000); + INSTANCE_WR(ctx, 0x00760/4, 0x00000000); + INSTANCE_WR(ctx, 0x00774/4, 0x00000000); + INSTANCE_WR(ctx, 0x00784/4, 0x00000000); + INSTANCE_WR(ctx, 0x00798/4, 0x00000000); + INSTANCE_WR(ctx, 0x007a8/4, 0x00000000); + INSTANCE_WR(ctx, 0x007bc/4, 0x00000000); + INSTANCE_WR(ctx, 0x007cc/4, 0x00000000); + INSTANCE_WR(ctx, 0x007e0/4, 0x00000000); + INSTANCE_WR(ctx, 0x007f0/4, 0x00000000); + INSTANCE_WR(ctx, 0x00804/4, 0x00000000); + INSTANCE_WR(ctx, 0x00814/4, 0x00000000); + INSTANCE_WR(ctx, 0x00828/4, 0x00000000); } - static void nv84_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) { @@ -2262,6 +4269,690 @@ nv84_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) INSTANCE_WR(ctx, 0x5b700/4, 0x00000001); } +static void +nv86_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_gpuobj *ctx = ref->gpuobj; + + INSTANCE_WR(ctx, 0x10C/4, 0x30); + INSTANCE_WR(ctx, 0x1D4/4, 0x3); + INSTANCE_WR(ctx, 0x1D8/4, 0x1000); + INSTANCE_WR(ctx, 0x218/4, 0xFE0C); + INSTANCE_WR(ctx, 0x22C/4, 0x1000); + INSTANCE_WR(ctx, 0x258/4, 0x187); + INSTANCE_WR(ctx, 0x26C/4, 0x1018); + INSTANCE_WR(ctx, 0x270/4, 0xFF); + INSTANCE_WR(ctx, 0x2AC/4, 0x4); + INSTANCE_WR(ctx, 0x2B0/4, 0x44D00DF); + INSTANCE_WR(ctx, 0x2B8/4, 0x600); + INSTANCE_WR(ctx, 0x2D0/4, 0x1000000); + INSTANCE_WR(ctx, 0x2D4/4, 0xFF); + INSTANCE_WR(ctx, 0x2DC/4, 0x400); + INSTANCE_WR(ctx, 0x2F4/4, 0x1); + INSTANCE_WR(ctx, 0x2F8/4, 0x80); + INSTANCE_WR(ctx, 0x2FC/4, 0x4); + INSTANCE_WR(ctx, 0x318/4, 0x2); + INSTANCE_WR(ctx, 0x31C/4, 0x1); + INSTANCE_WR(ctx, 0x328/4, 0x1); + INSTANCE_WR(ctx, 0x32C/4, 0x100); + INSTANCE_WR(ctx, 0x344/4, 0x2); + INSTANCE_WR(ctx, 0x348/4, 0x1); + INSTANCE_WR(ctx, 0x34C/4, 0x1); + INSTANCE_WR(ctx, 0x35C/4, 0x1); + INSTANCE_WR(ctx, 0x360/4, 0x3FFFFF); + INSTANCE_WR(ctx, 0x364/4, 0x1FFF); + INSTANCE_WR(ctx, 0x36C/4, 0x1); + INSTANCE_WR(ctx, 0x370/4, 0x1); + INSTANCE_WR(ctx, 0x378/4, 0x1); + INSTANCE_WR(ctx, 0x37C/4, 0x1); + INSTANCE_WR(ctx, 0x380/4, 0x1); + INSTANCE_WR(ctx, 0x384/4, 0x4); + INSTANCE_WR(ctx, 0x388/4, 0x1); + INSTANCE_WR(ctx, 0x38C/4, 0x1); + INSTANCE_WR(ctx, 0x390/4, 0x1); + INSTANCE_WR(ctx, 0x394/4, 0x7); + INSTANCE_WR(ctx, 0x398/4, 0x1); + INSTANCE_WR(ctx, 0x39C/4, 0x7); + INSTANCE_WR(ctx, 0x3A0/4, 0x1); + INSTANCE_WR(ctx, 0x3A4/4, 0x1); + INSTANCE_WR(ctx, 0x3A8/4, 0x1); + INSTANCE_WR(ctx, 0x3BC/4, 0x1); + INSTANCE_WR(ctx, 0x3C0/4, 0x100); + INSTANCE_WR(ctx, 0x3C8/4, 0x1); + INSTANCE_WR(ctx, 0x3D4/4, 0x100); + INSTANCE_WR(ctx, 0x3D8/4, 0x1); + INSTANCE_WR(ctx, 0x3DC/4, 0x100); + INSTANCE_WR(ctx, 0x3E4/4, 0x1); + INSTANCE_WR(ctx, 0x3F0/4, 0x100); + INSTANCE_WR(ctx, 0x404/4, 0x4); + INSTANCE_WR(ctx, 0x408/4, 0x70); + INSTANCE_WR(ctx, 0x40C/4, 0x80); + INSTANCE_WR(ctx, 0x420/4, 0xC); + INSTANCE_WR(ctx, 0x428/4, 0x8); + INSTANCE_WR(ctx, 0x42C/4, 0x14); + INSTANCE_WR(ctx, 0x434/4, 0x29); + INSTANCE_WR(ctx, 0x438/4, 0x27); + INSTANCE_WR(ctx, 0x43C/4, 0x26); + INSTANCE_WR(ctx, 0x440/4, 0x8); + INSTANCE_WR(ctx, 0x444/4, 0x4); + INSTANCE_WR(ctx, 0x448/4, 0x27); + INSTANCE_WR(ctx, 0x454/4, 0x1); + INSTANCE_WR(ctx, 0x458/4, 0x2); + INSTANCE_WR(ctx, 0x45C/4, 0x3); + INSTANCE_WR(ctx, 0x460/4, 0x4); + INSTANCE_WR(ctx, 0x464/4, 0x5); + INSTANCE_WR(ctx, 0x468/4, 0x6); + INSTANCE_WR(ctx, 0x46C/4, 0x7); + INSTANCE_WR(ctx, 0x470/4, 0x1); + INSTANCE_WR(ctx, 0x4B4/4, 0xCF); + INSTANCE_WR(ctx, 0x4E4/4, 0x80); + INSTANCE_WR(ctx, 0x4E8/4, 0x4); + INSTANCE_WR(ctx, 0x4EC/4, 0x4); + INSTANCE_WR(ctx, 0x4F0/4, 0x3); + INSTANCE_WR(ctx, 0x4F4/4, 0x1); + INSTANCE_WR(ctx, 0x500/4, 0x12); + INSTANCE_WR(ctx, 0x504/4, 0x10); + INSTANCE_WR(ctx, 0x508/4, 0xC); + INSTANCE_WR(ctx, 0x50C/4, 0x1); + INSTANCE_WR(ctx, 0x51C/4, 0x4); + INSTANCE_WR(ctx, 0x520/4, 0x2); + INSTANCE_WR(ctx, 0x524/4, 0x4); + INSTANCE_WR(ctx, 0x530/4, 0x3FFFFF); + INSTANCE_WR(ctx, 0x534/4, 0x1FFF); + INSTANCE_WR(ctx, 0x55C/4, 0x4); + INSTANCE_WR(ctx, 0x560/4, 0x14); + INSTANCE_WR(ctx, 0x564/4, 0x1); + INSTANCE_WR(ctx, 0x570/4, 0x2); + INSTANCE_WR(ctx, 0x57C/4, 0x1); + INSTANCE_WR(ctx, 0x584/4, 0x2); + INSTANCE_WR(ctx, 0x588/4, 0x1000); + INSTANCE_WR(ctx, 0x58C/4, 0xE00); + INSTANCE_WR(ctx, 0x590/4, 0x1000); + INSTANCE_WR(ctx, 0x594/4, 0x1E00); + INSTANCE_WR(ctx, 0x59C/4, 0x1); + INSTANCE_WR(ctx, 0x5A0/4, 0x1); + INSTANCE_WR(ctx, 0x5A4/4, 0x1); + INSTANCE_WR(ctx, 0x5A8/4, 0x1); + INSTANCE_WR(ctx, 0x5AC/4, 0x1); + INSTANCE_WR(ctx, 0x5BC/4, 0x200); + INSTANCE_WR(ctx, 0x5C4/4, 0x1); + INSTANCE_WR(ctx, 0x5C8/4, 0x70); + INSTANCE_WR(ctx, 0x5CC/4, 0x80); + INSTANCE_WR(ctx, 0x5D8/4, 0x1); + INSTANCE_WR(ctx, 0x5DC/4, 0x70); + INSTANCE_WR(ctx, 0x5E0/4, 0x80); + INSTANCE_WR(ctx, 0x5F0/4, 0x1); + INSTANCE_WR(ctx, 0x5F4/4, 0xCF); + INSTANCE_WR(ctx, 0x5FC/4, 0x1); + INSTANCE_WR(ctx, 0x60C/4, 0xCF); + INSTANCE_WR(ctx, 0x614/4, 0x2); + INSTANCE_WR(ctx, 0x61C/4, 0x1); + INSTANCE_WR(ctx, 0x624/4, 0x1); + INSTANCE_WR(ctx, 0x62C/4, 0xCF); + INSTANCE_WR(ctx, 0x630/4, 0xCF); + INSTANCE_WR(ctx, 0x634/4, 0x1); + INSTANCE_WR(ctx, 0x63C/4, 0xF80); + INSTANCE_WR(ctx, 0x684/4, 0x7F0080); + INSTANCE_WR(ctx, 0x6C0/4, 0x7F0080); + INSTANCE_WR(ctx, 0x6E4/4, 0x3B74F821); + INSTANCE_WR(ctx, 0x6E8/4, 0x89058001); + INSTANCE_WR(ctx, 0x6F0/4, 0x1000); + INSTANCE_WR(ctx, 0x6F4/4, 0x1F); + INSTANCE_WR(ctx, 0x6F8/4, 0x27C10FA); + INSTANCE_WR(ctx, 0x6FC/4, 0x400000C0); + INSTANCE_WR(ctx, 0x700/4, 0xB7892080); + INSTANCE_WR(ctx, 0x70C/4, 0x3B74F821); + INSTANCE_WR(ctx, 0x710/4, 0x89058001); + INSTANCE_WR(ctx, 0x718/4, 0x1000); + INSTANCE_WR(ctx, 0x71C/4, 0x1F); + INSTANCE_WR(ctx, 0x720/4, 0x27C10FA); + INSTANCE_WR(ctx, 0x724/4, 0x400000C0); + INSTANCE_WR(ctx, 0x728/4, 0xB7892080); + INSTANCE_WR(ctx, 0x734/4, 0x10040); + INSTANCE_WR(ctx, 0x73C/4, 0x22); + INSTANCE_WR(ctx, 0x748/4, 0x10040); + INSTANCE_WR(ctx, 0x74C/4, 0x22); + INSTANCE_WR(ctx, 0x764/4, 0x1800000); + INSTANCE_WR(ctx, 0x768/4, 0x160000); + INSTANCE_WR(ctx, 0x76C/4, 0x1800000); + INSTANCE_WR(ctx, 0x77C/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x780/4, 0x8C0000); + INSTANCE_WR(ctx, 0x7A4/4, 0x10401); + INSTANCE_WR(ctx, 0x7AC/4, 0x78); + INSTANCE_WR(ctx, 0x7B4/4, 0xBF); + INSTANCE_WR(ctx, 0x7BC/4, 0x1210); + INSTANCE_WR(ctx, 0x7C0/4, 0x8000080); + INSTANCE_WR(ctx, 0x7E4/4, 0x1800000); + INSTANCE_WR(ctx, 0x7E8/4, 0x160000); + INSTANCE_WR(ctx, 0x7EC/4, 0x1800000); + INSTANCE_WR(ctx, 0x7FC/4, 0x3FFFF); + INSTANCE_WR(ctx, 0x800/4, 0x8C0000); + INSTANCE_WR(ctx, 0x824/4, 0x10401); + INSTANCE_WR(ctx, 0x82C/4, 0x78); + INSTANCE_WR(ctx, 0x834/4, 0xBF); + INSTANCE_WR(ctx, 0x83C/4, 0x1210); + INSTANCE_WR(ctx, 0x840/4, 0x8000080); + INSTANCE_WR(ctx, 0x868/4, 0x27070); + INSTANCE_WR(ctx, 0x874/4, 0x3FFFFFF); + INSTANCE_WR(ctx, 0x88C/4, 0x120407); + INSTANCE_WR(ctx, 0x890/4, 0x5091507); + INSTANCE_WR(ctx, 0x894/4, 0x5010202); + INSTANCE_WR(ctx, 0x898/4, 0x30201); + INSTANCE_WR(ctx, 0x8B4/4, 0x40); + INSTANCE_WR(ctx, 0x8B8/4, 0xD0C0B0A); + INSTANCE_WR(ctx, 0x8BC/4, 0x141210); + INSTANCE_WR(ctx, 0x8C0/4, 0x1F0); + INSTANCE_WR(ctx, 0x8C4/4, 0x1); + INSTANCE_WR(ctx, 0x8C8/4, 0x3); + INSTANCE_WR(ctx, 0x8D4/4, 0x39E00); + INSTANCE_WR(ctx, 0x8D8/4, 0x100); + INSTANCE_WR(ctx, 0x8DC/4, 0x3800); + INSTANCE_WR(ctx, 0x8E0/4, 0x404040); + INSTANCE_WR(ctx, 0x8E4/4, 0xFF0A); + INSTANCE_WR(ctx, 0x8EC/4, 0x77F005); + INSTANCE_WR(ctx, 0x8F0/4, 0x3F7FFF); + INSTANCE_WR(ctx, 0x7BA0/4, 0x21); + INSTANCE_WR(ctx, 0x7BC0/4, 0x1); + INSTANCE_WR(ctx, 0x7BE0/4, 0x2); + INSTANCE_WR(ctx, 0x7C00/4, 0x100); + INSTANCE_WR(ctx, 0x7C20/4, 0x100); + INSTANCE_WR(ctx, 0x7C40/4, 0x1); + INSTANCE_WR(ctx, 0x7CA0/4, 0x1); + INSTANCE_WR(ctx, 0x7CC0/4, 0x2); + INSTANCE_WR(ctx, 0x7CE0/4, 0x100); + INSTANCE_WR(ctx, 0x7D00/4, 0x100); + INSTANCE_WR(ctx, 0x7D20/4, 0x1); + INSTANCE_WR(ctx, 0x11640/4, 0x4); + INSTANCE_WR(ctx, 0x11660/4, 0x4); + INSTANCE_WR(ctx, 0x49FE0/4, 0x4); + INSTANCE_WR(ctx, 0x4A000/4, 0x4); + INSTANCE_WR(ctx, 0x4A020/4, 0x8100C12); + INSTANCE_WR(ctx, 0x4A040/4, 0x3); + INSTANCE_WR(ctx, 0x4A080/4, 0x8100C12); + INSTANCE_WR(ctx, 0x4A0C0/4, 0x80C14); + INSTANCE_WR(ctx, 0x4A0E0/4, 0x1); + INSTANCE_WR(ctx, 0x4A100/4, 0x80C14); + INSTANCE_WR(ctx, 0x4A160/4, 0x8100C12); + INSTANCE_WR(ctx, 0x4A180/4, 0x27); + INSTANCE_WR(ctx, 0x4A1E0/4, 0x1); + INSTANCE_WR(ctx, 0x51A20/4, 0x1); + INSTANCE_WR(ctx, 0x51D00/4, 0x8100C12); + INSTANCE_WR(ctx, 0x51EA0/4, 0x4000000); + INSTANCE_WR(ctx, 0x51EC0/4, 0x4000000); + INSTANCE_WR(ctx, 0x51F00/4, 0x80); + INSTANCE_WR(ctx, 0x51F80/4, 0x80); + INSTANCE_WR(ctx, 0x51FC0/4, 0x3F); + INSTANCE_WR(ctx, 0x52120/4, 0x2); + INSTANCE_WR(ctx, 0x52140/4, 0x4000000); + INSTANCE_WR(ctx, 0x52160/4, 0x4000000); + INSTANCE_WR(ctx, 0x52280/4, 0x4); + INSTANCE_WR(ctx, 0x52300/4, 0x4); + INSTANCE_WR(ctx, 0x52540/4, 0x1); + INSTANCE_WR(ctx, 0x52560/4, 0x1001); + INSTANCE_WR(ctx, 0x52580/4, 0xFFFF); + INSTANCE_WR(ctx, 0x525A0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x525C0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x525E0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x52A00/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52A20/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52A40/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52A60/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52A80/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52AA0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52AC0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52AE0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52B00/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52B20/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52B40/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52B60/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52B80/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52BA0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52BC0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52BE0/4, 0x3F800000); + INSTANCE_WR(ctx, 0x52C00/4, 0x10); + INSTANCE_WR(ctx, 0x52C60/4, 0x3); + INSTANCE_WR(ctx, 0xA84/4, 0xF); + INSTANCE_WR(ctx, 0xB24/4, 0x20); + INSTANCE_WR(ctx, 0xD04/4, 0x1A); + INSTANCE_WR(ctx, 0xEC4/4, 0x4); + INSTANCE_WR(ctx, 0xEE4/4, 0x4); + INSTANCE_WR(ctx, 0xF24/4, 0x4); + INSTANCE_WR(ctx, 0xF44/4, 0x8); + INSTANCE_WR(ctx, 0xF84/4, 0x7FF); + INSTANCE_WR(ctx, 0x1124/4, 0xF); + INSTANCE_WR(ctx, 0x3604/4, 0xF); + INSTANCE_WR(ctx, 0x3644/4, 0x1); + INSTANCE_WR(ctx, 0x41A4/4, 0xF); + INSTANCE_WR(ctx, 0x14844/4, 0xF); + INSTANCE_WR(ctx, 0x14AE4/4, 0x1); + INSTANCE_WR(ctx, 0x14B04/4, 0x100); + INSTANCE_WR(ctx, 0x14B24/4, 0x100); + INSTANCE_WR(ctx, 0x14B44/4, 0x11); + INSTANCE_WR(ctx, 0x14B84/4, 0x8); + INSTANCE_WR(ctx, 0x14C44/4, 0x1); + INSTANCE_WR(ctx, 0x14C84/4, 0x1); + INSTANCE_WR(ctx, 0x14CA4/4, 0x1); + INSTANCE_WR(ctx, 0x14CC4/4, 0x1); + INSTANCE_WR(ctx, 0x14CE4/4, 0xCF); + INSTANCE_WR(ctx, 0x14D04/4, 0x2); + INSTANCE_WR(ctx, 0x14DE4/4, 0x1); + INSTANCE_WR(ctx, 0x14E24/4, 0x1); + INSTANCE_WR(ctx, 0x14E44/4, 0x1); + INSTANCE_WR(ctx, 0x14E64/4, 0x1); + INSTANCE_WR(ctx, 0x14F04/4, 0x4); + INSTANCE_WR(ctx, 0x14F44/4, 0x1); + INSTANCE_WR(ctx, 0x14F64/4, 0x15); + INSTANCE_WR(ctx, 0x14FE4/4, 0x4444480); + INSTANCE_WR(ctx, 0x15764/4, 0x8100C12); + INSTANCE_WR(ctx, 0x15804/4, 0x100); + INSTANCE_WR(ctx, 0x15864/4, 0x10001); + INSTANCE_WR(ctx, 0x158A4/4, 0x10001); + INSTANCE_WR(ctx, 0x158C4/4, 0x1); + INSTANCE_WR(ctx, 0x158E4/4, 0x10001); + INSTANCE_WR(ctx, 0x15904/4, 0x1); + INSTANCE_WR(ctx, 0x15924/4, 0x4); + INSTANCE_WR(ctx, 0x15944/4, 0x2); + INSTANCE_WR(ctx, 0x166C4/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x166E4/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x16784/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x16904/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x16924/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x15948/4, 0x3FFFFF); + INSTANCE_WR(ctx, 0x159A8/4, 0x1FFF); + INSTANCE_WR(ctx, 0x15B88/4, 0x3F800000); + INSTANCE_WR(ctx, 0x15C68/4, 0x4); + INSTANCE_WR(ctx, 0x15C88/4, 0x1A); + INSTANCE_WR(ctx, 0x15CE8/4, 0x1); + INSTANCE_WR(ctx, 0x15F48/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x16028/4, 0xF); + INSTANCE_WR(ctx, 0x16128/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x16148/4, 0x11); + INSTANCE_WR(ctx, 0x16348/4, 0x4); + INSTANCE_WR(ctx, 0x163E8/4, 0x2); + INSTANCE_WR(ctx, 0x16408/4, 0x4000000); + INSTANCE_WR(ctx, 0x16428/4, 0x4000000); + INSTANCE_WR(ctx, 0x164A8/4, 0x5); + INSTANCE_WR(ctx, 0x164C8/4, 0x52); + INSTANCE_WR(ctx, 0x16568/4, 0x1); + INSTANCE_WR(ctx, 0x16788/4, 0x3F800000); + INSTANCE_WR(ctx, 0x167A8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x167C8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x167E8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16808/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16828/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16848/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16868/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16888/4, 0x3F800000); + INSTANCE_WR(ctx, 0x168A8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x168C8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x168E8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16908/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16928/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16948/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16968/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16988/4, 0x10); + INSTANCE_WR(ctx, 0x16E68/4, 0x8100C12); + INSTANCE_WR(ctx, 0x16E88/4, 0x5); + INSTANCE_WR(ctx, 0x16EE8/4, 0x1); + INSTANCE_WR(ctx, 0x16F28/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16F48/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16F68/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16F88/4, 0xFFFF); + INSTANCE_WR(ctx, 0x16FA8/4, 0x3); + INSTANCE_WR(ctx, 0x173A8/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x173C8/4, 0x1A); + INSTANCE_WR(ctx, 0x17408/4, 0x3); + INSTANCE_WR(ctx, 0x178E8/4, 0x102); + INSTANCE_WR(ctx, 0x17928/4, 0x4); + INSTANCE_WR(ctx, 0x17948/4, 0x4); + INSTANCE_WR(ctx, 0x17968/4, 0x4); + INSTANCE_WR(ctx, 0x17988/4, 0x4); + INSTANCE_WR(ctx, 0x179A8/4, 0x4); + INSTANCE_WR(ctx, 0x179C8/4, 0x4); + INSTANCE_WR(ctx, 0x17A08/4, 0x7FF); + INSTANCE_WR(ctx, 0x17A48/4, 0x102); + INSTANCE_WR(ctx, 0x17B88/4, 0x4); + INSTANCE_WR(ctx, 0x17BA8/4, 0x4); + INSTANCE_WR(ctx, 0x17BC8/4, 0x4); + INSTANCE_WR(ctx, 0x17BE8/4, 0x4); + INSTANCE_WR(ctx, 0x18228/4, 0x80C14); + INSTANCE_WR(ctx, 0x18288/4, 0x804); + INSTANCE_WR(ctx, 0x182C8/4, 0x4); + INSTANCE_WR(ctx, 0x182E8/4, 0x4); + INSTANCE_WR(ctx, 0x18308/4, 0x8100C12); + INSTANCE_WR(ctx, 0x18348/4, 0x4); + INSTANCE_WR(ctx, 0x18368/4, 0x4); + INSTANCE_WR(ctx, 0x183A8/4, 0x10); + INSTANCE_WR(ctx, 0x18448/4, 0x804); + INSTANCE_WR(ctx, 0x18468/4, 0x1); + INSTANCE_WR(ctx, 0x18488/4, 0x1A); + INSTANCE_WR(ctx, 0x184A8/4, 0x7F); + INSTANCE_WR(ctx, 0x184E8/4, 0x1); + INSTANCE_WR(ctx, 0x18508/4, 0x80C14); + INSTANCE_WR(ctx, 0x18548/4, 0x8100C12); + INSTANCE_WR(ctx, 0x18568/4, 0x4); + INSTANCE_WR(ctx, 0x18588/4, 0x4); + INSTANCE_WR(ctx, 0x185C8/4, 0x10); + INSTANCE_WR(ctx, 0x18648/4, 0x1); + INSTANCE_WR(ctx, 0x18668/4, 0x8100C12); + INSTANCE_WR(ctx, 0x18748/4, 0x7FF); + INSTANCE_WR(ctx, 0x18768/4, 0x80C14); + INSTANCE_WR(ctx, 0x18E88/4, 0x1); + INSTANCE_WR(ctx, 0x18EE8/4, 0x10); + INSTANCE_WR(ctx, 0x19608/4, 0x88); + INSTANCE_WR(ctx, 0x19628/4, 0x88); + INSTANCE_WR(ctx, 0x19688/4, 0x4); + INSTANCE_WR(ctx, 0x19968/4, 0x26); + INSTANCE_WR(ctx, 0x199C8/4, 0x3F800000); + INSTANCE_WR(ctx, 0x19A48/4, 0x1A); + INSTANCE_WR(ctx, 0x19A68/4, 0x10); + INSTANCE_WR(ctx, 0x19F88/4, 0x52); + INSTANCE_WR(ctx, 0x19FC8/4, 0x26); + INSTANCE_WR(ctx, 0x1A008/4, 0x4); + INSTANCE_WR(ctx, 0x1A028/4, 0x4); + INSTANCE_WR(ctx, 0x1A068/4, 0x1A); + INSTANCE_WR(ctx, 0x1A0C8/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x1A108/4, 0x4); + INSTANCE_WR(ctx, 0x1A128/4, 0x4); + INSTANCE_WR(ctx, 0x1A168/4, 0x80); + INSTANCE_WR(ctx, 0x1A188/4, 0x4); + INSTANCE_WR(ctx, 0x1A1A8/4, 0x80C14); + INSTANCE_WR(ctx, 0x1A1E8/4, 0x7FF); + INSTANCE_WR(ctx, 0x24A48/4, 0x4); + INSTANCE_WR(ctx, 0x24A68/4, 0x4); + INSTANCE_WR(ctx, 0x24AA8/4, 0x80); + INSTANCE_WR(ctx, 0x24AC8/4, 0x4); + INSTANCE_WR(ctx, 0x24AE8/4, 0x1); + INSTANCE_WR(ctx, 0x24B28/4, 0x27); + INSTANCE_WR(ctx, 0x24B68/4, 0x26); + INSTANCE_WR(ctx, 0x24BE8/4, 0x4000000); + INSTANCE_WR(ctx, 0x24C08/4, 0x4000000); + INSTANCE_WR(ctx, 0x24C28/4, 0x4000000); + INSTANCE_WR(ctx, 0x24C48/4, 0x4000000); + INSTANCE_WR(ctx, 0x24C68/4, 0x4000000); + INSTANCE_WR(ctx, 0x24C88/4, 0x4000000); + INSTANCE_WR(ctx, 0x24CA8/4, 0x4000000); + INSTANCE_WR(ctx, 0x24CC8/4, 0x4000000); + INSTANCE_WR(ctx, 0x24CE8/4, 0x4000000); + INSTANCE_WR(ctx, 0x24D08/4, 0x4000000); + INSTANCE_WR(ctx, 0x24D28/4, 0x4000000); + INSTANCE_WR(ctx, 0x24D48/4, 0x4000000); + INSTANCE_WR(ctx, 0x24D68/4, 0x4000000); + INSTANCE_WR(ctx, 0x24D88/4, 0x4000000); + INSTANCE_WR(ctx, 0x24DA8/4, 0x4000000); + INSTANCE_WR(ctx, 0x24DC8/4, 0x4000000); + INSTANCE_WR(ctx, 0x25268/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x25288/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x252E8/4, 0x1FE21); + INSTANCE_WR(ctx, 0xB0C/4, 0x2); + INSTANCE_WR(ctx, 0xB4C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0xCEC/4, 0x1); + INSTANCE_WR(ctx, 0xD0C/4, 0x10); + INSTANCE_WR(ctx, 0xD6C/4, 0x1); + INSTANCE_WR(ctx, 0xE0C/4, 0x4); + INSTANCE_WR(ctx, 0xE2C/4, 0x400); + INSTANCE_WR(ctx, 0xE4C/4, 0x300); + INSTANCE_WR(ctx, 0xE6C/4, 0x1001); + INSTANCE_WR(ctx, 0xE8C/4, 0x15); + INSTANCE_WR(ctx, 0xF4C/4, 0x2); + INSTANCE_WR(ctx, 0x106C/4, 0x1); + INSTANCE_WR(ctx, 0x108C/4, 0x10); + INSTANCE_WR(ctx, 0x10CC/4, 0x1); + INSTANCE_WR(ctx, 0x134C/4, 0x10); + INSTANCE_WR(ctx, 0x156C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x158C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x15AC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x15CC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x15EC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x160C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x162C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x164C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x166C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x168C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16AC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16CC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x16EC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x170C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x172C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x174C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x1A8C/4, 0x10); + INSTANCE_WR(ctx, 0x1ACC/4, 0x3F); + INSTANCE_WR(ctx, 0x1BAC/4, 0x1); + INSTANCE_WR(ctx, 0x1BEC/4, 0x1); + INSTANCE_WR(ctx, 0x1C2C/4, 0x1); + INSTANCE_WR(ctx, 0x1DCC/4, 0x11); + INSTANCE_WR(ctx, 0x1ECC/4, 0xF); + INSTANCE_WR(ctx, 0x1FCC/4, 0x11); + INSTANCE_WR(ctx, 0x20AC/4, 0x1); + INSTANCE_WR(ctx, 0x20CC/4, 0x1); + INSTANCE_WR(ctx, 0x20EC/4, 0x1); + INSTANCE_WR(ctx, 0x210C/4, 0x2); + INSTANCE_WR(ctx, 0x212C/4, 0x1); + INSTANCE_WR(ctx, 0x214C/4, 0x2); + INSTANCE_WR(ctx, 0x216C/4, 0x1); + INSTANCE_WR(ctx, 0x21AC/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x21EC/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x24AC/4, 0x1); + INSTANCE_WR(ctx, 0x24CC/4, 0x2); + INSTANCE_WR(ctx, 0x24EC/4, 0x1); + INSTANCE_WR(ctx, 0x250C/4, 0x1); + INSTANCE_WR(ctx, 0x252C/4, 0x2); + INSTANCE_WR(ctx, 0x254C/4, 0x1); + INSTANCE_WR(ctx, 0x256C/4, 0x1); + INSTANCE_WR(ctx, 0x25EC/4, 0x11); + INSTANCE_WR(ctx, 0x260C/4, 0x1); + INSTANCE_WR(ctx, 0x328C/4, 0x2); + INSTANCE_WR(ctx, 0x32CC/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x346C/4, 0x1); + INSTANCE_WR(ctx, 0x348C/4, 0x10); + INSTANCE_WR(ctx, 0x34EC/4, 0x1); + INSTANCE_WR(ctx, 0x358C/4, 0x4); + INSTANCE_WR(ctx, 0x35AC/4, 0x400); + INSTANCE_WR(ctx, 0x35CC/4, 0x300); + INSTANCE_WR(ctx, 0x35EC/4, 0x1001); + INSTANCE_WR(ctx, 0x360C/4, 0x15); + INSTANCE_WR(ctx, 0x36CC/4, 0x2); + INSTANCE_WR(ctx, 0x37EC/4, 0x1); + INSTANCE_WR(ctx, 0x380C/4, 0x10); + INSTANCE_WR(ctx, 0x384C/4, 0x1); + INSTANCE_WR(ctx, 0x3ACC/4, 0x10); + INSTANCE_WR(ctx, 0x3CEC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3D0C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3D2C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3D4C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3D6C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3D8C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3DAC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3DCC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3DEC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3E0C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3E2C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3E4C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3E6C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3E8C/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3EAC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x3ECC/4, 0x3F800000); + INSTANCE_WR(ctx, 0x420C/4, 0x10); + INSTANCE_WR(ctx, 0x424C/4, 0x3F); + INSTANCE_WR(ctx, 0x432C/4, 0x1); + INSTANCE_WR(ctx, 0x436C/4, 0x1); + INSTANCE_WR(ctx, 0x43AC/4, 0x1); + INSTANCE_WR(ctx, 0x454C/4, 0x11); + INSTANCE_WR(ctx, 0x464C/4, 0xF); + INSTANCE_WR(ctx, 0x474C/4, 0x11); + INSTANCE_WR(ctx, 0x482C/4, 0x1); + INSTANCE_WR(ctx, 0x484C/4, 0x1); + INSTANCE_WR(ctx, 0x486C/4, 0x1); + INSTANCE_WR(ctx, 0x488C/4, 0x2); + INSTANCE_WR(ctx, 0x48AC/4, 0x1); + INSTANCE_WR(ctx, 0x48CC/4, 0x2); + INSTANCE_WR(ctx, 0x48EC/4, 0x1); + INSTANCE_WR(ctx, 0x492C/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x496C/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x4C2C/4, 0x1); + INSTANCE_WR(ctx, 0x4C4C/4, 0x2); + INSTANCE_WR(ctx, 0x4C6C/4, 0x1); + INSTANCE_WR(ctx, 0x4C8C/4, 0x1); + INSTANCE_WR(ctx, 0x4CAC/4, 0x2); + INSTANCE_WR(ctx, 0x4CCC/4, 0x1); + INSTANCE_WR(ctx, 0x4CEC/4, 0x1); + INSTANCE_WR(ctx, 0x4D6C/4, 0x11); + INSTANCE_WR(ctx, 0x4D8C/4, 0x1); + INSTANCE_WR(ctx, 0xA30/4, 0x4); + INSTANCE_WR(ctx, 0xCF0/4, 0x4); + INSTANCE_WR(ctx, 0xD10/4, 0x4); + INSTANCE_WR(ctx, 0xD30/4, 0x608080); + INSTANCE_WR(ctx, 0xDD0/4, 0x4); + INSTANCE_WR(ctx, 0xE30/4, 0x4); + INSTANCE_WR(ctx, 0xE50/4, 0x4); + INSTANCE_WR(ctx, 0xE70/4, 0x80); + INSTANCE_WR(ctx, 0xE90/4, 0x1E00); + INSTANCE_WR(ctx, 0xEB0/4, 0x4); + INSTANCE_WR(ctx, 0x1350/4, 0x4); + INSTANCE_WR(ctx, 0x1370/4, 0x80); + INSTANCE_WR(ctx, 0x1390/4, 0x4); + INSTANCE_WR(ctx, 0x13B0/4, 0x3020100); + INSTANCE_WR(ctx, 0x13D0/4, 0x3); + INSTANCE_WR(ctx, 0x13F0/4, 0x1E00); + INSTANCE_WR(ctx, 0x1410/4, 0x4); + INSTANCE_WR(ctx, 0x14B0/4, 0x4); + INSTANCE_WR(ctx, 0x14D0/4, 0x3); + INSTANCE_WR(ctx, 0x1550/4, 0x4); + INSTANCE_WR(ctx, 0x159F0/4, 0x4); + INSTANCE_WR(ctx, 0x15A10/4, 0x3); + INSTANCE_WR(ctx, 0x15C50/4, 0xF); + INSTANCE_WR(ctx, 0x15DD0/4, 0x4); + INSTANCE_WR(ctx, 0x15DF0/4, 0xFFFF); + INSTANCE_WR(ctx, 0x15E10/4, 0xFFFF); + INSTANCE_WR(ctx, 0x15E30/4, 0xFFFF); + INSTANCE_WR(ctx, 0x15E50/4, 0xFFFF); + INSTANCE_WR(ctx, 0x15F70/4, 0x1); + INSTANCE_WR(ctx, 0x15FF0/4, 0x1); + INSTANCE_WR(ctx, 0x160B0/4, 0x1); + INSTANCE_WR(ctx, 0x16250/4, 0x1); + INSTANCE_WR(ctx, 0x16270/4, 0x1); + INSTANCE_WR(ctx, 0x16290/4, 0x2); + INSTANCE_WR(ctx, 0x162B0/4, 0x1); + INSTANCE_WR(ctx, 0x162D0/4, 0x1); + INSTANCE_WR(ctx, 0x162F0/4, 0x2); + INSTANCE_WR(ctx, 0x16310/4, 0x1); + INSTANCE_WR(ctx, 0x16350/4, 0x11); + INSTANCE_WR(ctx, 0x16450/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x164B0/4, 0x4); + INSTANCE_WR(ctx, 0x16530/4, 0x11); + INSTANCE_WR(ctx, 0x16550/4, 0x1); + INSTANCE_WR(ctx, 0x16590/4, 0xCF); + INSTANCE_WR(ctx, 0x165B0/4, 0xCF); + INSTANCE_WR(ctx, 0x165D0/4, 0xCF); + INSTANCE_WR(ctx, 0x16730/4, 0x1); + INSTANCE_WR(ctx, 0x16750/4, 0x1); + INSTANCE_WR(ctx, 0x16770/4, 0x2); + INSTANCE_WR(ctx, 0x16790/4, 0x1); + INSTANCE_WR(ctx, 0x167B0/4, 0x1); + INSTANCE_WR(ctx, 0x167D0/4, 0x2); + INSTANCE_WR(ctx, 0x167F0/4, 0x1); + INSTANCE_WR(ctx, 0x16830/4, 0x1); + INSTANCE_WR(ctx, 0x16850/4, 0x1); + INSTANCE_WR(ctx, 0x16870/4, 0x1); + INSTANCE_WR(ctx, 0x16890/4, 0x1); + INSTANCE_WR(ctx, 0x168B0/4, 0x1); + INSTANCE_WR(ctx, 0x168D0/4, 0x1); + INSTANCE_WR(ctx, 0x168F0/4, 0x1); + INSTANCE_WR(ctx, 0x16910/4, 0x1); + INSTANCE_WR(ctx, 0x16930/4, 0x11); + INSTANCE_WR(ctx, 0x16A30/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x16A50/4, 0xF); + INSTANCE_WR(ctx, 0x16B50/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x16BB0/4, 0x11); + INSTANCE_WR(ctx, 0x16BD0/4, 0x1); + INSTANCE_WR(ctx, 0x16C50/4, 0x4); + INSTANCE_WR(ctx, 0x16D10/4, 0x1); + INSTANCE_WR(ctx, 0x16DB0/4, 0x11); + INSTANCE_WR(ctx, 0x16EB0/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x16F30/4, 0x11); + INSTANCE_WR(ctx, 0x16F50/4, 0x1); + INSTANCE_WR(ctx, 0x16F90/4, 0x1); + INSTANCE_WR(ctx, 0x16FD0/4, 0x1); + INSTANCE_WR(ctx, 0x17010/4, 0x7FF); + INSTANCE_WR(ctx, 0x17050/4, 0x1); + INSTANCE_WR(ctx, 0x17090/4, 0x1); + INSTANCE_WR(ctx, 0x175F0/4, 0x8); + INSTANCE_WR(ctx, 0x17610/4, 0x8); + INSTANCE_WR(ctx, 0x17630/4, 0x8); + INSTANCE_WR(ctx, 0x17650/4, 0x8); + INSTANCE_WR(ctx, 0x17670/4, 0x8); + INSTANCE_WR(ctx, 0x17690/4, 0x8); + INSTANCE_WR(ctx, 0x176B0/4, 0x8); + INSTANCE_WR(ctx, 0x176D0/4, 0x8); + INSTANCE_WR(ctx, 0x176F0/4, 0x11); + INSTANCE_WR(ctx, 0x177F0/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x17810/4, 0x400); + INSTANCE_WR(ctx, 0x17830/4, 0x400); + INSTANCE_WR(ctx, 0x17850/4, 0x400); + INSTANCE_WR(ctx, 0x17870/4, 0x400); + INSTANCE_WR(ctx, 0x17890/4, 0x400); + INSTANCE_WR(ctx, 0x178B0/4, 0x400); + INSTANCE_WR(ctx, 0x178D0/4, 0x400); + INSTANCE_WR(ctx, 0x178F0/4, 0x400); + INSTANCE_WR(ctx, 0x17910/4, 0x300); + INSTANCE_WR(ctx, 0x17930/4, 0x300); + INSTANCE_WR(ctx, 0x17950/4, 0x300); + INSTANCE_WR(ctx, 0x17970/4, 0x300); + INSTANCE_WR(ctx, 0x17990/4, 0x300); + INSTANCE_WR(ctx, 0x179B0/4, 0x300); + INSTANCE_WR(ctx, 0x179D0/4, 0x300); + INSTANCE_WR(ctx, 0x179F0/4, 0x300); + INSTANCE_WR(ctx, 0x17A10/4, 0x1); + INSTANCE_WR(ctx, 0x17A30/4, 0xF); + INSTANCE_WR(ctx, 0x17B30/4, 0x20); + INSTANCE_WR(ctx, 0x17B50/4, 0x11); + INSTANCE_WR(ctx, 0x17B70/4, 0x100); + INSTANCE_WR(ctx, 0x17BB0/4, 0x1); + INSTANCE_WR(ctx, 0x17C10/4, 0x40); + INSTANCE_WR(ctx, 0x17C30/4, 0x100); + INSTANCE_WR(ctx, 0x17C70/4, 0x3); + INSTANCE_WR(ctx, 0x17D10/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x17D90/4, 0x2); + INSTANCE_WR(ctx, 0x17DB0/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x17EF0/4, 0x1); + INSTANCE_WR(ctx, 0x17F90/4, 0x4); + INSTANCE_WR(ctx, 0x17FD0/4, 0x1); + INSTANCE_WR(ctx, 0x17FF0/4, 0x400); + INSTANCE_WR(ctx, 0x18010/4, 0x300); + INSTANCE_WR(ctx, 0x18030/4, 0x1001); + INSTANCE_WR(ctx, 0x180B0/4, 0x11); + INSTANCE_WR(ctx, 0x181B0/4, 0xFAC6881); + INSTANCE_WR(ctx, 0x181D0/4, 0xF); + INSTANCE_WR(ctx, 0x184D0/4, 0x1FFE67); + INSTANCE_WR(ctx, 0x18550/4, 0x11); + INSTANCE_WR(ctx, 0x185B0/4, 0x4); + INSTANCE_WR(ctx, 0x185F0/4, 0x1); + INSTANCE_WR(ctx, 0x18610/4, 0x1); + INSTANCE_WR(ctx, 0x18690/4, 0x1); + INSTANCE_WR(ctx, 0x18730/4, 0x1); + INSTANCE_WR(ctx, 0x18770/4, 0x1); + INSTANCE_WR(ctx, 0x187F0/4, 0x2A712488); + INSTANCE_WR(ctx, 0x18830/4, 0x4085C000); + INSTANCE_WR(ctx, 0x18850/4, 0x40); + INSTANCE_WR(ctx, 0x18870/4, 0x100); + INSTANCE_WR(ctx, 0x18890/4, 0x10100); + INSTANCE_WR(ctx, 0x188B0/4, 0x2800000); + INSTANCE_WR(ctx, 0x18B10/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x18B30/4, 0x4E3BFDF); + INSTANCE_WR(ctx, 0x18B50/4, 0x1); + INSTANCE_WR(ctx, 0x18B90/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x18BB0/4, 0x1); + INSTANCE_WR(ctx, 0x18C10/4, 0xFFFF00); + INSTANCE_WR(ctx, 0x18D30/4, 0x1); + INSTANCE_WR(ctx, 0x18D70/4, 0x1); + INSTANCE_WR(ctx, 0x18D90/4, 0x30201000); + INSTANCE_WR(ctx, 0x18DB0/4, 0x70605040); + INSTANCE_WR(ctx, 0x18DD0/4, 0xB8A89888); + INSTANCE_WR(ctx, 0x18DF0/4, 0xF8E8D8C8); + INSTANCE_WR(ctx, 0x18E30/4, 0x1A); +} + static void nv92_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) { @@ -4762,6 +7453,9 @@ nv50_graph_create_context(struct nouveau_channel *chan) INSTANCE_WR(chan->ramin_grctx->gpuobj, 0x0011c/4, 0x00000002); switch (dev_priv->chipset) { + case 0x50: + nv50_graph_init_ctxvals(dev, chan->ramin_grctx); + break; case 0x84: nv84_graph_init_ctxvals(dev, chan->ramin_grctx); break; -- cgit v1.2.3 From ee6bcabc506e4d506fb65447c405f8514ab1f4e1 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 17 Sep 2008 22:18:03 +1000 Subject: nv50: add initial context for chipset 0xaa This just doesn't look right.. --- shared-core/nv50_graph.c | 724 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 723 insertions(+), 1 deletion(-) diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index 2fb6f967..9c9156ab 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -7421,6 +7421,722 @@ nv92_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) INSTANCE_WR(ctx, 0x651FC/4, 0x1); } +static void +nvaa_graph_init_ctxvals(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_gpuobj *ctx = ref->gpuobj; + + INSTANCE_WR(ctx, 0x0010c/4, 0x00000030); + INSTANCE_WR(ctx, 0x001d0/4, 0x00000003); + INSTANCE_WR(ctx, 0x001d4/4, 0x00001000); + INSTANCE_WR(ctx, 0x00220/4, 0x0000fe0c); + INSTANCE_WR(ctx, 0x00238/4, 0x00001000); + INSTANCE_WR(ctx, 0x00264/4, 0x00000187); + INSTANCE_WR(ctx, 0x00278/4, 0x00001018); + INSTANCE_WR(ctx, 0x0027c/4, 0x000000ff); + INSTANCE_WR(ctx, 0x002c8/4, 0x00000004); + INSTANCE_WR(ctx, 0x002cc/4, 0x042500df); + INSTANCE_WR(ctx, 0x002d4/4, 0x00000600); + INSTANCE_WR(ctx, 0x002ec/4, 0x01000000); + INSTANCE_WR(ctx, 0x002f0/4, 0x000000ff); + INSTANCE_WR(ctx, 0x002f8/4, 0x00000800); + INSTANCE_WR(ctx, 0x00310/4, 0x00000001); + INSTANCE_WR(ctx, 0x00310/4, 0x00000001); + INSTANCE_WR(ctx, 0x00310/4, 0x000e0080); + INSTANCE_WR(ctx, 0x00310/4, 0x00000004); + INSTANCE_WR(ctx, 0x00338/4, 0x00000002); + INSTANCE_WR(ctx, 0x0033c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0034c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00350/4, 0x00000100); + INSTANCE_WR(ctx, 0x00368/4, 0x00000002); + INSTANCE_WR(ctx, 0x0036c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00370/4, 0x00000001); + INSTANCE_WR(ctx, 0x00380/4, 0x00000001); + INSTANCE_WR(ctx, 0x00384/4, 0x003fffff); + INSTANCE_WR(ctx, 0x00388/4, 0x00001fff); + INSTANCE_WR(ctx, 0x00390/4, 0x00000001); + INSTANCE_WR(ctx, 0x00394/4, 0x00000001); + INSTANCE_WR(ctx, 0x0039c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0039c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0039c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0039c/4, 0x00000004); + INSTANCE_WR(ctx, 0x0039c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0039c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0039c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0039c/4, 0x00000007); + INSTANCE_WR(ctx, 0x003bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x003bc/4, 0x00000007); + INSTANCE_WR(ctx, 0x003bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x003bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x003bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x003e0/4, 0x00000001); + INSTANCE_WR(ctx, 0x003e4/4, 0x00000100); + INSTANCE_WR(ctx, 0x003ec/4, 0x00000001); + INSTANCE_WR(ctx, 0x003f8/4, 0x00000100); + INSTANCE_WR(ctx, 0x003fc/4, 0x00000001); + INSTANCE_WR(ctx, 0x00400/4, 0x00000100); + INSTANCE_WR(ctx, 0x00408/4, 0x00000001); + INSTANCE_WR(ctx, 0x00414/4, 0x00000100); + INSTANCE_WR(ctx, 0x00428/4, 0x00000004); + INSTANCE_WR(ctx, 0x0042c/4, 0x00000070); + INSTANCE_WR(ctx, 0x00430/4, 0x00000080); + INSTANCE_WR(ctx, 0x00444/4, 0x0000000c); + INSTANCE_WR(ctx, 0x0044c/4, 0x00000008); + INSTANCE_WR(ctx, 0x00450/4, 0x00000014); + INSTANCE_WR(ctx, 0x00458/4, 0x00000029); + INSTANCE_WR(ctx, 0x00458/4, 0x00000027); + INSTANCE_WR(ctx, 0x00458/4, 0x00000026); + INSTANCE_WR(ctx, 0x00458/4, 0x00000008); + INSTANCE_WR(ctx, 0x00458/4, 0x00000004); + INSTANCE_WR(ctx, 0x00458/4, 0x00000027); + INSTANCE_WR(ctx, 0x00478/4, 0x00000001); + INSTANCE_WR(ctx, 0x00478/4, 0x00000002); + INSTANCE_WR(ctx, 0x00478/4, 0x00000003); + INSTANCE_WR(ctx, 0x00478/4, 0x00000004); + INSTANCE_WR(ctx, 0x00478/4, 0x00000005); + INSTANCE_WR(ctx, 0x00478/4, 0x00000006); + INSTANCE_WR(ctx, 0x00478/4, 0x00000007); + INSTANCE_WR(ctx, 0x00478/4, 0x00000001); + INSTANCE_WR(ctx, 0x004d8/4, 0x000000cf); + INSTANCE_WR(ctx, 0x00508/4, 0x00000080); + INSTANCE_WR(ctx, 0x00508/4, 0x00000004); + INSTANCE_WR(ctx, 0x00508/4, 0x00000004); + INSTANCE_WR(ctx, 0x00508/4, 0x00000003); + INSTANCE_WR(ctx, 0x00508/4, 0x00000001); + INSTANCE_WR(ctx, 0x00524/4, 0x00000012); + INSTANCE_WR(ctx, 0x00524/4, 0x00000010); + INSTANCE_WR(ctx, 0x00524/4, 0x0000000c); + INSTANCE_WR(ctx, 0x00524/4, 0x00000001); + INSTANCE_WR(ctx, 0x00540/4, 0x00000004); + INSTANCE_WR(ctx, 0x00544/4, 0x00000002); + INSTANCE_WR(ctx, 0x00548/4, 0x00000004); + INSTANCE_WR(ctx, 0x00558/4, 0x003fffff); + INSTANCE_WR(ctx, 0x0055c/4, 0x00001fff); + INSTANCE_WR(ctx, 0x00584/4, 0x00000001); + INSTANCE_WR(ctx, 0x00588/4, 0x00000001); + INSTANCE_WR(ctx, 0x0058c/4, 0x00000002); + INSTANCE_WR(ctx, 0x00594/4, 0x00000004); + INSTANCE_WR(ctx, 0x00598/4, 0x00000014); + INSTANCE_WR(ctx, 0x0059c/4, 0x00000001); + INSTANCE_WR(ctx, 0x005a8/4, 0x00000002); + INSTANCE_WR(ctx, 0x005bc/4, 0x00000001); + INSTANCE_WR(ctx, 0x005c4/4, 0x00000002); + INSTANCE_WR(ctx, 0x005c4/4, 0x00001000); + INSTANCE_WR(ctx, 0x005c4/4, 0x00000e00); + INSTANCE_WR(ctx, 0x005c4/4, 0x00001000); + INSTANCE_WR(ctx, 0x005c4/4, 0x00001e00); + INSTANCE_WR(ctx, 0x005dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x005dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x005dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x005dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x005dc/4, 0x00000001); + INSTANCE_WR(ctx, 0x005fc/4, 0x00000200); + INSTANCE_WR(ctx, 0x00604/4, 0x00000001); + INSTANCE_WR(ctx, 0x00608/4, 0x000000f0); + INSTANCE_WR(ctx, 0x0060c/4, 0x000000ff); + INSTANCE_WR(ctx, 0x00618/4, 0x00000001); + INSTANCE_WR(ctx, 0x0061c/4, 0x000000f0); + INSTANCE_WR(ctx, 0x00620/4, 0x000000ff); + INSTANCE_WR(ctx, 0x00628/4, 0x00000009); + INSTANCE_WR(ctx, 0x00634/4, 0x00000001); + INSTANCE_WR(ctx, 0x00638/4, 0x000000cf); + INSTANCE_WR(ctx, 0x00640/4, 0x00000001); + INSTANCE_WR(ctx, 0x00650/4, 0x000000cf); + INSTANCE_WR(ctx, 0x00658/4, 0x00000002); + INSTANCE_WR(ctx, 0x00660/4, 0x00000001); + INSTANCE_WR(ctx, 0x00668/4, 0x00000001); + INSTANCE_WR(ctx, 0x00670/4, 0x000000cf); + INSTANCE_WR(ctx, 0x00674/4, 0x000000cf); + INSTANCE_WR(ctx, 0x00678/4, 0x00000001); + INSTANCE_WR(ctx, 0x00680/4, 0x00001f80); + INSTANCE_WR(ctx, 0x00698/4, 0x3b74f821); + INSTANCE_WR(ctx, 0x0069c/4, 0x89058001); + INSTANCE_WR(ctx, 0x006a4/4, 0x00001000); + INSTANCE_WR(ctx, 0x006a8/4, 0x000000ff); + INSTANCE_WR(ctx, 0x006b0/4, 0x027c10fa); + INSTANCE_WR(ctx, 0x006b4/4, 0x400000c0); + INSTANCE_WR(ctx, 0x006b8/4, 0xb7892080); + INSTANCE_WR(ctx, 0x006cc/4, 0x003d0040); + INSTANCE_WR(ctx, 0x006d4/4, 0x00000022); + INSTANCE_WR(ctx, 0x006f4/4, 0x003d0040); + INSTANCE_WR(ctx, 0x006f8/4, 0x00000022); + INSTANCE_WR(ctx, 0x00740/4, 0x0000ff0a); + INSTANCE_WR(ctx, 0x00748/4, 0x01800000); + INSTANCE_WR(ctx, 0x0074c/4, 0x00160000); + INSTANCE_WR(ctx, 0x00750/4, 0x01800000); + INSTANCE_WR(ctx, 0x00760/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00764/4, 0x300c0000); + INSTANCE_WR(ctx, 0x00788/4, 0x00010401); + INSTANCE_WR(ctx, 0x00790/4, 0x00000078); + INSTANCE_WR(ctx, 0x00798/4, 0x000000bf); + INSTANCE_WR(ctx, 0x007a0/4, 0x00001210); + INSTANCE_WR(ctx, 0x007a4/4, 0x08000080); + INSTANCE_WR(ctx, 0x007b0/4, 0x0000003e); + INSTANCE_WR(ctx, 0x007c8/4, 0x01800000); + INSTANCE_WR(ctx, 0x007cc/4, 0x00160000); + INSTANCE_WR(ctx, 0x007d0/4, 0x01800000); + INSTANCE_WR(ctx, 0x007e0/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x007e4/4, 0x300c0000); + INSTANCE_WR(ctx, 0x00808/4, 0x00010401); + INSTANCE_WR(ctx, 0x00810/4, 0x00000078); + INSTANCE_WR(ctx, 0x00818/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00820/4, 0x00001210); + INSTANCE_WR(ctx, 0x00824/4, 0x08000080); + INSTANCE_WR(ctx, 0x00830/4, 0x0000003e); + INSTANCE_WR(ctx, 0x00848/4, 0x01800000); + INSTANCE_WR(ctx, 0x0084c/4, 0x00160000); + INSTANCE_WR(ctx, 0x00850/4, 0x01800000); + INSTANCE_WR(ctx, 0x00860/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x00864/4, 0x300c0000); + INSTANCE_WR(ctx, 0x00888/4, 0x00010401); + INSTANCE_WR(ctx, 0x00890/4, 0x00000078); + INSTANCE_WR(ctx, 0x00898/4, 0x000000bf); + INSTANCE_WR(ctx, 0x008a0/4, 0x00001210); + INSTANCE_WR(ctx, 0x008a4/4, 0x08000080); + INSTANCE_WR(ctx, 0x008b0/4, 0x0000003e); + INSTANCE_WR(ctx, 0x008c8/4, 0x01800000); + INSTANCE_WR(ctx, 0x008cc/4, 0x00160000); + INSTANCE_WR(ctx, 0x008d0/4, 0x01800000); + INSTANCE_WR(ctx, 0x008e0/4, 0x0003ffff); + INSTANCE_WR(ctx, 0x008e4/4, 0x300c0000); + INSTANCE_WR(ctx, 0x00908/4, 0x00010401); + INSTANCE_WR(ctx, 0x00910/4, 0x00000078); + INSTANCE_WR(ctx, 0x00918/4, 0x000000bf); + INSTANCE_WR(ctx, 0x00920/4, 0x00001210); + INSTANCE_WR(ctx, 0x00924/4, 0x08000080); + INSTANCE_WR(ctx, 0x00930/4, 0x0000003e); + INSTANCE_WR(ctx, 0x0094c/4, 0x01127070); + INSTANCE_WR(ctx, 0x0095c/4, 0x07ffffff); + INSTANCE_WR(ctx, 0x00978/4, 0x00120407); + INSTANCE_WR(ctx, 0x00978/4, 0x05091507); + INSTANCE_WR(ctx, 0x00978/4, 0x05010202); + INSTANCE_WR(ctx, 0x00978/4, 0x00030201); + INSTANCE_WR(ctx, 0x009a0/4, 0x00000040); + INSTANCE_WR(ctx, 0x009a0/4, 0x0d0c0b0a); + INSTANCE_WR(ctx, 0x009a0/4, 0x00141210); + INSTANCE_WR(ctx, 0x009a0/4, 0x000001f0); + INSTANCE_WR(ctx, 0x009a0/4, 0x00000001); + INSTANCE_WR(ctx, 0x009a0/4, 0x00000003); + INSTANCE_WR(ctx, 0x009a0/4, 0x00008000); + INSTANCE_WR(ctx, 0x009c0/4, 0x00039e00); + INSTANCE_WR(ctx, 0x009c0/4, 0x00000100); + INSTANCE_WR(ctx, 0x009c0/4, 0x00003800); + INSTANCE_WR(ctx, 0x009c0/4, 0x003fe006); + INSTANCE_WR(ctx, 0x009c0/4, 0x003fe000); + INSTANCE_WR(ctx, 0x009c0/4, 0x00404040); + INSTANCE_WR(ctx, 0x009c0/4, 0x0cf7f007); + INSTANCE_WR(ctx, 0x009c0/4, 0x02bf7fff); + INSTANCE_WR(ctx, 0x07ba0/4, 0x00000021); + INSTANCE_WR(ctx, 0x07bc0/4, 0x00000001); + INSTANCE_WR(ctx, 0x07be0/4, 0x00000002); + INSTANCE_WR(ctx, 0x07c00/4, 0x00000100); + INSTANCE_WR(ctx, 0x07c20/4, 0x00000100); + INSTANCE_WR(ctx, 0x07c40/4, 0x00000001); + INSTANCE_WR(ctx, 0x07ca0/4, 0x00000001); + INSTANCE_WR(ctx, 0x07cc0/4, 0x00000002); + INSTANCE_WR(ctx, 0x07ce0/4, 0x00000100); + INSTANCE_WR(ctx, 0x07d00/4, 0x00000100); + INSTANCE_WR(ctx, 0x07d20/4, 0x00000001); + INSTANCE_WR(ctx, 0x1a7c0/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a7e0/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a800/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a820/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a840/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a860/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a880/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a8a0/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a8c0/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a8e0/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a900/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a920/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a940/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a960/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a980/4, 0x04000000); + INSTANCE_WR(ctx, 0x1a9a0/4, 0x04000000); + INSTANCE_WR(ctx, 0x1ae40/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x1ae60/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x1aec0/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x1aee0/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x1af80/4, 0x08100c12); + INSTANCE_WR(ctx, 0x1b020/4, 0x00000100); + INSTANCE_WR(ctx, 0x1b080/4, 0x00010001); + INSTANCE_WR(ctx, 0x1b0c0/4, 0x00010001); + INSTANCE_WR(ctx, 0x1b0e0/4, 0x00000001); + INSTANCE_WR(ctx, 0x1b100/4, 0x00010001); + INSTANCE_WR(ctx, 0x1b120/4, 0x00000001); + INSTANCE_WR(ctx, 0x1b140/4, 0x00000004); + INSTANCE_WR(ctx, 0x1b160/4, 0x00000002); + INSTANCE_WR(ctx, 0x1be20/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1bf00/4, 0x00000004); + INSTANCE_WR(ctx, 0x1bf20/4, 0x0000001a); + INSTANCE_WR(ctx, 0x1bf80/4, 0x00000001); + INSTANCE_WR(ctx, 0x1c1e0/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x1c2c0/4, 0x0000000f); + INSTANCE_WR(ctx, 0x1c3c0/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x1c3e0/4, 0x00000011); + INSTANCE_WR(ctx, 0x1c5e0/4, 0x00000004); + INSTANCE_WR(ctx, 0x1c640/4, 0x00000001); + INSTANCE_WR(ctx, 0x1c6a0/4, 0x00000002); + INSTANCE_WR(ctx, 0x1c6c0/4, 0x04000000); + INSTANCE_WR(ctx, 0x1c6e0/4, 0x04000000); + INSTANCE_WR(ctx, 0x1c760/4, 0x00000005); + INSTANCE_WR(ctx, 0x1c780/4, 0x00000052); + INSTANCE_WR(ctx, 0x1c820/4, 0x00000001); + INSTANCE_WR(ctx, 0x1ca40/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1ca60/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1ca80/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1caa0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cac0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cae0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cb00/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cb20/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cb40/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cb60/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cb80/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cba0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cbc0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cbe0/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cc00/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cc20/4, 0x3f800000); + INSTANCE_WR(ctx, 0x1cc40/4, 0x00000010); + INSTANCE_WR(ctx, 0x1d120/4, 0x08100c12); + INSTANCE_WR(ctx, 0x1d140/4, 0x00000005); + INSTANCE_WR(ctx, 0x1d1a0/4, 0x00000001); + INSTANCE_WR(ctx, 0x1d1e0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x1d200/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x1d220/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x1d240/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x1d260/4, 0x00000003); + INSTANCE_WR(ctx, 0x1d2e0/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x1d300/4, 0x0000001a); + INSTANCE_WR(ctx, 0x1d340/4, 0x00000003); + INSTANCE_WR(ctx, 0x1dae0/4, 0x00000102); + INSTANCE_WR(ctx, 0x1db20/4, 0x00000004); + INSTANCE_WR(ctx, 0x1db40/4, 0x00000004); + INSTANCE_WR(ctx, 0x1db60/4, 0x00000004); + INSTANCE_WR(ctx, 0x1db80/4, 0x00000004); + INSTANCE_WR(ctx, 0x1dca0/4, 0x00000004); + INSTANCE_WR(ctx, 0x1dcc0/4, 0x00000004); + INSTANCE_WR(ctx, 0x1dd00/4, 0x000007ff); + INSTANCE_WR(ctx, 0x1dd40/4, 0x00000102); + INSTANCE_WR(ctx, 0x1de80/4, 0x00000004); + INSTANCE_WR(ctx, 0x1dea0/4, 0x00000004); + INSTANCE_WR(ctx, 0x1dec0/4, 0x00000004); + INSTANCE_WR(ctx, 0x1dee0/4, 0x00000004); + INSTANCE_WR(ctx, 0x00a04/4, 0x00000004); + INSTANCE_WR(ctx, 0x00a24/4, 0x00000004); + INSTANCE_WR(ctx, 0x00a64/4, 0x00000080); + INSTANCE_WR(ctx, 0x00a84/4, 0x00000004); + INSTANCE_WR(ctx, 0x00aa4/4, 0x00080c14); + INSTANCE_WR(ctx, 0x00ae4/4, 0x000007ff); + INSTANCE_WR(ctx, 0x0b344/4, 0x00000004); + INSTANCE_WR(ctx, 0x0b364/4, 0x00000004); + INSTANCE_WR(ctx, 0x0b3a4/4, 0x00000080); + INSTANCE_WR(ctx, 0x0b3c4/4, 0x00000004); + INSTANCE_WR(ctx, 0x0b3e4/4, 0x00000001); + INSTANCE_WR(ctx, 0x0b424/4, 0x00000027); + INSTANCE_WR(ctx, 0x0b464/4, 0x00000026); + INSTANCE_WR(ctx, 0x010c8/4, 0x00000004); + INSTANCE_WR(ctx, 0x010e8/4, 0x00000004); + INSTANCE_WR(ctx, 0x39a68/4, 0x00000004); + INSTANCE_WR(ctx, 0x39a88/4, 0x00000004); + INSTANCE_WR(ctx, 0x39aa8/4, 0x08100c12); + INSTANCE_WR(ctx, 0x39ac8/4, 0x00000003); + INSTANCE_WR(ctx, 0x39b08/4, 0x08100c12); + INSTANCE_WR(ctx, 0x39b48/4, 0x00080c14); + INSTANCE_WR(ctx, 0x39b68/4, 0x00000001); + INSTANCE_WR(ctx, 0x39b88/4, 0x00000004); + INSTANCE_WR(ctx, 0x39ba8/4, 0x00000004); + INSTANCE_WR(ctx, 0x39bc8/4, 0x00080c14); + INSTANCE_WR(ctx, 0x39c28/4, 0x08100c12); + INSTANCE_WR(ctx, 0x39c48/4, 0x00000027); + INSTANCE_WR(ctx, 0x39ca8/4, 0x00000001); + INSTANCE_WR(ctx, 0x414e8/4, 0x00000001); + INSTANCE_WR(ctx, 0x417c8/4, 0x08100c12); + INSTANCE_WR(ctx, 0x00a2c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00acc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x00b6c/4, 0x00000020); + INSTANCE_WR(ctx, 0x00d6c/4, 0x0000001a); + INSTANCE_WR(ctx, 0x00f2c/4, 0x00000004); + INSTANCE_WR(ctx, 0x00f4c/4, 0x00000004); + INSTANCE_WR(ctx, 0x00f8c/4, 0x00000004); + INSTANCE_WR(ctx, 0x00fac/4, 0x00000008); + INSTANCE_WR(ctx, 0x00fec/4, 0x000007ff); + INSTANCE_WR(ctx, 0x0118c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x0362c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x0366c/4, 0x00000001); + INSTANCE_WR(ctx, 0x041cc/4, 0x0000000f); + INSTANCE_WR(ctx, 0x1484c/4, 0x0000000f); + INSTANCE_WR(ctx, 0x15950/4, 0x003fffff); + INSTANCE_WR(ctx, 0x159b0/4, 0x00001fff); + INSTANCE_WR(ctx, 0x00a34/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x00bb4/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x00bd4/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x00c74/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x00c94/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x00e14/4, 0x00000002); + INSTANCE_WR(ctx, 0x00e54/4, 0x001ffe67); + INSTANCE_WR(ctx, 0x00ff4/4, 0x00000001); + INSTANCE_WR(ctx, 0x01014/4, 0x00000010); + INSTANCE_WR(ctx, 0x01074/4, 0x00000001); + INSTANCE_WR(ctx, 0x01114/4, 0x00000004); + INSTANCE_WR(ctx, 0x01134/4, 0x00000400); + INSTANCE_WR(ctx, 0x01154/4, 0x00000300); + INSTANCE_WR(ctx, 0x01174/4, 0x00001001); + INSTANCE_WR(ctx, 0x01194/4, 0x00000015); + INSTANCE_WR(ctx, 0x01254/4, 0x00000002); + INSTANCE_WR(ctx, 0x01374/4, 0x00000001); + INSTANCE_WR(ctx, 0x01394/4, 0x00000010); + INSTANCE_WR(ctx, 0x013d4/4, 0x00000001); + INSTANCE_WR(ctx, 0x01654/4, 0x00000010); + INSTANCE_WR(ctx, 0x01874/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01894/4, 0x3f800000); + INSTANCE_WR(ctx, 0x018b4/4, 0x3f800000); + INSTANCE_WR(ctx, 0x018d4/4, 0x3f800000); + INSTANCE_WR(ctx, 0x018f4/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01914/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01934/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01954/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01974/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01994/4, 0x3f800000); + INSTANCE_WR(ctx, 0x019b4/4, 0x3f800000); + INSTANCE_WR(ctx, 0x019d4/4, 0x3f800000); + INSTANCE_WR(ctx, 0x019f4/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01a14/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01a34/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01a54/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01d94/4, 0x00000010); + INSTANCE_WR(ctx, 0x01dd4/4, 0x0000003f); + INSTANCE_WR(ctx, 0x01eb4/4, 0x00000001); + INSTANCE_WR(ctx, 0x01ef4/4, 0x00000001); + INSTANCE_WR(ctx, 0x01f34/4, 0x00000001); + INSTANCE_WR(ctx, 0x01f94/4, 0x00001001); + INSTANCE_WR(ctx, 0x02114/4, 0x00000011); + INSTANCE_WR(ctx, 0x02214/4, 0x0000000f); + INSTANCE_WR(ctx, 0x02314/4, 0x00000011); + INSTANCE_WR(ctx, 0x023f4/4, 0x00000001); + INSTANCE_WR(ctx, 0x02414/4, 0x00000001); + INSTANCE_WR(ctx, 0x02434/4, 0x00000001); + INSTANCE_WR(ctx, 0x02454/4, 0x00000002); + INSTANCE_WR(ctx, 0x02474/4, 0x00000001); + INSTANCE_WR(ctx, 0x02494/4, 0x00000002); + INSTANCE_WR(ctx, 0x024b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x024f4/4, 0x001ffe67); + INSTANCE_WR(ctx, 0x02534/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x028b4/4, 0x00000001); + INSTANCE_WR(ctx, 0x028d4/4, 0x00000002); + INSTANCE_WR(ctx, 0x028f4/4, 0x00000001); + INSTANCE_WR(ctx, 0x02914/4, 0x00000001); + INSTANCE_WR(ctx, 0x02934/4, 0x00000002); + INSTANCE_WR(ctx, 0x02954/4, 0x00000001); + INSTANCE_WR(ctx, 0x02974/4, 0x00000001); + INSTANCE_WR(ctx, 0x02a14/4, 0x00000011); + INSTANCE_WR(ctx, 0x02a34/4, 0x00000001); + INSTANCE_WR(ctx, 0x00a18/4, 0x0000003f); + INSTANCE_WR(ctx, 0x00b78/4, 0x00000002); + INSTANCE_WR(ctx, 0x00b98/4, 0x04000000); + INSTANCE_WR(ctx, 0x00bb8/4, 0x04000000); + INSTANCE_WR(ctx, 0x00cd8/4, 0x00000004); + INSTANCE_WR(ctx, 0x00d58/4, 0x00000004); + INSTANCE_WR(ctx, 0x00f98/4, 0x00000001); + INSTANCE_WR(ctx, 0x00fb8/4, 0x00001001); + INSTANCE_WR(ctx, 0x00fd8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x00ff8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x01018/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x01038/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x01458/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01478/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01498/4, 0x3f800000); + INSTANCE_WR(ctx, 0x014b8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x014d8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x014f8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01518/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01538/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01558/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01578/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01598/4, 0x3f800000); + INSTANCE_WR(ctx, 0x015b8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x015d8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x015f8/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01618/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01638/4, 0x3f800000); + INSTANCE_WR(ctx, 0x01658/4, 0x00000010); + INSTANCE_WR(ctx, 0x016b8/4, 0x00000003); + INSTANCE_WR(ctx, 0x01878/4, 0x04000000); + INSTANCE_WR(ctx, 0x01898/4, 0x04000000); + INSTANCE_WR(ctx, 0x018d8/4, 0x00000080); + INSTANCE_WR(ctx, 0x01958/4, 0x00000080); + INSTANCE_WR(ctx, 0x01a38/4, 0x00000001); + INSTANCE_WR(ctx, 0x01a58/4, 0x00000100); + INSTANCE_WR(ctx, 0x01a78/4, 0x00000100); + INSTANCE_WR(ctx, 0x01a98/4, 0x00000011); + INSTANCE_WR(ctx, 0x01ad8/4, 0x00000008); + INSTANCE_WR(ctx, 0x01b98/4, 0x00000001); + INSTANCE_WR(ctx, 0x01bd8/4, 0x00000001); + INSTANCE_WR(ctx, 0x01bf8/4, 0x00000001); + INSTANCE_WR(ctx, 0x01c18/4, 0x00000001); + INSTANCE_WR(ctx, 0x01c38/4, 0x000000cf); + INSTANCE_WR(ctx, 0x01c58/4, 0x00000002); + INSTANCE_WR(ctx, 0x01d38/4, 0x00000001); + INSTANCE_WR(ctx, 0x01d78/4, 0x00000001); + INSTANCE_WR(ctx, 0x01d98/4, 0x00000001); + INSTANCE_WR(ctx, 0x01db8/4, 0x00000001); + INSTANCE_WR(ctx, 0x01e58/4, 0x00000004); + INSTANCE_WR(ctx, 0x01e98/4, 0x00000001); + INSTANCE_WR(ctx, 0x01eb8/4, 0x00000015); + INSTANCE_WR(ctx, 0x01f38/4, 0x04444480); + INSTANCE_WR(ctx, 0x02698/4, 0x00000001); + INSTANCE_WR(ctx, 0x026d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x02758/4, 0x2a712488); + INSTANCE_WR(ctx, 0x02798/4, 0x4085c000); + INSTANCE_WR(ctx, 0x027b8/4, 0x00000040); + INSTANCE_WR(ctx, 0x027d8/4, 0x00000100); + INSTANCE_WR(ctx, 0x027f8/4, 0x00010100); + INSTANCE_WR(ctx, 0x02818/4, 0x02800000); + INSTANCE_WR(ctx, 0x02b58/4, 0x0000000f); + INSTANCE_WR(ctx, 0x02cd8/4, 0x00000004); + INSTANCE_WR(ctx, 0x02cf8/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x02d18/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x02d38/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x02d58/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x02e78/4, 0x00000001); + INSTANCE_WR(ctx, 0x02ef8/4, 0x00000001); + INSTANCE_WR(ctx, 0x02fb8/4, 0x00000001); + INSTANCE_WR(ctx, 0x03018/4, 0x00000001); + INSTANCE_WR(ctx, 0x03178/4, 0x00000001); + INSTANCE_WR(ctx, 0x03198/4, 0x00000001); + INSTANCE_WR(ctx, 0x031b8/4, 0x00000002); + INSTANCE_WR(ctx, 0x031d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x031f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x03218/4, 0x00000002); + INSTANCE_WR(ctx, 0x03238/4, 0x00000001); + INSTANCE_WR(ctx, 0x03278/4, 0x00000011); + INSTANCE_WR(ctx, 0x03378/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x033d8/4, 0x00000004); + INSTANCE_WR(ctx, 0x03458/4, 0x00000011); + INSTANCE_WR(ctx, 0x03478/4, 0x00000001); + INSTANCE_WR(ctx, 0x034b8/4, 0x000000cf); + INSTANCE_WR(ctx, 0x034d8/4, 0x000000cf); + INSTANCE_WR(ctx, 0x034f8/4, 0x000000cf); + INSTANCE_WR(ctx, 0x03658/4, 0x00000001); + INSTANCE_WR(ctx, 0x03678/4, 0x00000001); + INSTANCE_WR(ctx, 0x03698/4, 0x00000002); + INSTANCE_WR(ctx, 0x036b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x036d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x036f8/4, 0x00000002); + INSTANCE_WR(ctx, 0x03718/4, 0x00000001); + INSTANCE_WR(ctx, 0x03758/4, 0x00000001); + INSTANCE_WR(ctx, 0x03778/4, 0x00000001); + INSTANCE_WR(ctx, 0x03798/4, 0x00000001); + INSTANCE_WR(ctx, 0x037b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x037d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x037f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x03818/4, 0x00000001); + INSTANCE_WR(ctx, 0x03838/4, 0x00000001); + INSTANCE_WR(ctx, 0x03858/4, 0x00000011); + INSTANCE_WR(ctx, 0x03958/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x03978/4, 0x0000000f); + INSTANCE_WR(ctx, 0x03a78/4, 0x001ffe67); + INSTANCE_WR(ctx, 0x03ad8/4, 0x00000011); + INSTANCE_WR(ctx, 0x03af8/4, 0x00000001); + INSTANCE_WR(ctx, 0x03b78/4, 0x00000004); + INSTANCE_WR(ctx, 0x03c38/4, 0x00000001); + INSTANCE_WR(ctx, 0x03cd8/4, 0x00000011); + INSTANCE_WR(ctx, 0x03dd8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x03e58/4, 0x00000011); + INSTANCE_WR(ctx, 0x03e78/4, 0x00000001); + INSTANCE_WR(ctx, 0x03eb8/4, 0x00000001); + INSTANCE_WR(ctx, 0x03ef8/4, 0x00000001); + INSTANCE_WR(ctx, 0x03f38/4, 0x000007ff); + INSTANCE_WR(ctx, 0x03f78/4, 0x00000001); + INSTANCE_WR(ctx, 0x03fb8/4, 0x00000001); + INSTANCE_WR(ctx, 0x04518/4, 0x00000008); + INSTANCE_WR(ctx, 0x04538/4, 0x00000008); + INSTANCE_WR(ctx, 0x04558/4, 0x00000008); + INSTANCE_WR(ctx, 0x04578/4, 0x00000008); + INSTANCE_WR(ctx, 0x04598/4, 0x00000008); + INSTANCE_WR(ctx, 0x045b8/4, 0x00000008); + INSTANCE_WR(ctx, 0x045d8/4, 0x00000008); + INSTANCE_WR(ctx, 0x045f8/4, 0x00000008); + INSTANCE_WR(ctx, 0x04618/4, 0x00000011); + INSTANCE_WR(ctx, 0x04718/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x04738/4, 0x00000400); + INSTANCE_WR(ctx, 0x04758/4, 0x00000400); + INSTANCE_WR(ctx, 0x04778/4, 0x00000400); + INSTANCE_WR(ctx, 0x04798/4, 0x00000400); + INSTANCE_WR(ctx, 0x047b8/4, 0x00000400); + INSTANCE_WR(ctx, 0x047d8/4, 0x00000400); + INSTANCE_WR(ctx, 0x047f8/4, 0x00000400); + INSTANCE_WR(ctx, 0x04818/4, 0x00000400); + INSTANCE_WR(ctx, 0x04838/4, 0x00000300); + INSTANCE_WR(ctx, 0x04858/4, 0x00000300); + INSTANCE_WR(ctx, 0x04878/4, 0x00000300); + INSTANCE_WR(ctx, 0x04898/4, 0x00000300); + INSTANCE_WR(ctx, 0x048b8/4, 0x00000300); + INSTANCE_WR(ctx, 0x048d8/4, 0x00000300); + INSTANCE_WR(ctx, 0x048f8/4, 0x00000300); + INSTANCE_WR(ctx, 0x04918/4, 0x00000300); + INSTANCE_WR(ctx, 0x04938/4, 0x00000001); + INSTANCE_WR(ctx, 0x04958/4, 0x0000000f); + INSTANCE_WR(ctx, 0x04a58/4, 0x00000020); + INSTANCE_WR(ctx, 0x04a78/4, 0x00000011); + INSTANCE_WR(ctx, 0x04a98/4, 0x00000100); + INSTANCE_WR(ctx, 0x04ad8/4, 0x00000001); + INSTANCE_WR(ctx, 0x04b38/4, 0x00000040); + INSTANCE_WR(ctx, 0x04b58/4, 0x00000100); + INSTANCE_WR(ctx, 0x04b98/4, 0x00000003); + INSTANCE_WR(ctx, 0x04c38/4, 0x001ffe67); + INSTANCE_WR(ctx, 0x04cb8/4, 0x00000002); + INSTANCE_WR(ctx, 0x04cd8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x04e18/4, 0x00000001); + INSTANCE_WR(ctx, 0x04eb8/4, 0x00000004); + INSTANCE_WR(ctx, 0x04ef8/4, 0x00000001); + INSTANCE_WR(ctx, 0x04f18/4, 0x00000400); + INSTANCE_WR(ctx, 0x04f38/4, 0x00000300); + INSTANCE_WR(ctx, 0x04f58/4, 0x00001001); + INSTANCE_WR(ctx, 0x04fd8/4, 0x00000011); + INSTANCE_WR(ctx, 0x050d8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x050f8/4, 0x0000000f); + INSTANCE_WR(ctx, 0x053f8/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x05418/4, 0x001ffe67); + INSTANCE_WR(ctx, 0x05498/4, 0x00000011); + INSTANCE_WR(ctx, 0x054f8/4, 0x00000004); + INSTANCE_WR(ctx, 0x05538/4, 0x00000001); + INSTANCE_WR(ctx, 0x05558/4, 0x00000001); + INSTANCE_WR(ctx, 0x055d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x05678/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x05718/4, 0x00000004); + INSTANCE_WR(ctx, 0x05758/4, 0x00000001); + INSTANCE_WR(ctx, 0x05778/4, 0x00000001); + INSTANCE_WR(ctx, 0x057d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x05938/4, 0x00000001); + INSTANCE_WR(ctx, 0x05958/4, 0x00000001); + INSTANCE_WR(ctx, 0x05978/4, 0x00000001); + INSTANCE_WR(ctx, 0x05998/4, 0x00000001); + INSTANCE_WR(ctx, 0x059b8/4, 0x00000001); + INSTANCE_WR(ctx, 0x059d8/4, 0x00000001); + INSTANCE_WR(ctx, 0x059f8/4, 0x00000001); + INSTANCE_WR(ctx, 0x05a18/4, 0x00000001); + INSTANCE_WR(ctx, 0x05a38/4, 0x00000011); + INSTANCE_WR(ctx, 0x05b38/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x05b58/4, 0x0000000f); + INSTANCE_WR(ctx, 0x05c58/4, 0x00000011); + INSTANCE_WR(ctx, 0x05c78/4, 0x00000001); + INSTANCE_WR(ctx, 0x05df8/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x05e18/4, 0x04e3bfdf); + INSTANCE_WR(ctx, 0x05e38/4, 0x00000001); + INSTANCE_WR(ctx, 0x05e78/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x05e98/4, 0x00000001); + INSTANCE_WR(ctx, 0x05ef8/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x06018/4, 0x00000001); + INSTANCE_WR(ctx, 0x06058/4, 0x00000001); + INSTANCE_WR(ctx, 0x06078/4, 0x30201000); + INSTANCE_WR(ctx, 0x06098/4, 0x70605040); + INSTANCE_WR(ctx, 0x060b8/4, 0xb8a89888); + INSTANCE_WR(ctx, 0x060d8/4, 0xf8e8d8c8); + INSTANCE_WR(ctx, 0x06118/4, 0x0000001a); + INSTANCE_WR(ctx, 0x06158/4, 0x00000004); + INSTANCE_WR(ctx, 0x063f8/4, 0x00000004); + INSTANCE_WR(ctx, 0x06418/4, 0x00000004); + INSTANCE_WR(ctx, 0x06438/4, 0x03020100); + INSTANCE_WR(ctx, 0x064d8/4, 0x00000004); + INSTANCE_WR(ctx, 0x06538/4, 0x00000004); + INSTANCE_WR(ctx, 0x06558/4, 0x00000004); + INSTANCE_WR(ctx, 0x06578/4, 0x00000080); + INSTANCE_WR(ctx, 0x06598/4, 0x00001e00); + INSTANCE_WR(ctx, 0x065b8/4, 0x00000004); + INSTANCE_WR(ctx, 0x06a58/4, 0x00000004); + INSTANCE_WR(ctx, 0x06a78/4, 0x00000080); + INSTANCE_WR(ctx, 0x06a98/4, 0x00000004); + INSTANCE_WR(ctx, 0x06ab8/4, 0x03020100); + INSTANCE_WR(ctx, 0x06ad8/4, 0x00000003); + INSTANCE_WR(ctx, 0x06af8/4, 0x00001e00); + INSTANCE_WR(ctx, 0x06b18/4, 0x00000004); + INSTANCE_WR(ctx, 0x06bb8/4, 0x00000004); + INSTANCE_WR(ctx, 0x06bd8/4, 0x00000003); + INSTANCE_WR(ctx, 0x06c58/4, 0x00000004); + INSTANCE_WR(ctx, 0x0aef8/4, 0x00000004); + INSTANCE_WR(ctx, 0x0af18/4, 0x00000003); + INSTANCE_WR(ctx, 0x00abc/4, 0x00080c14); + INSTANCE_WR(ctx, 0x00b1c/4, 0x00000804); + INSTANCE_WR(ctx, 0x00b5c/4, 0x00000004); + INSTANCE_WR(ctx, 0x00b7c/4, 0x00000004); + INSTANCE_WR(ctx, 0x00b9c/4, 0x08100c12); + INSTANCE_WR(ctx, 0x00bdc/4, 0x00000004); + INSTANCE_WR(ctx, 0x00bfc/4, 0x00000004); + INSTANCE_WR(ctx, 0x00c3c/4, 0x00000010); + INSTANCE_WR(ctx, 0x00cdc/4, 0x00000804); + INSTANCE_WR(ctx, 0x00cfc/4, 0x00000001); + INSTANCE_WR(ctx, 0x00d1c/4, 0x0000001a); + INSTANCE_WR(ctx, 0x00d3c/4, 0x0000007f); + INSTANCE_WR(ctx, 0x00d7c/4, 0x00000001); + INSTANCE_WR(ctx, 0x00d9c/4, 0x00080c14); + INSTANCE_WR(ctx, 0x00ddc/4, 0x08100c12); + INSTANCE_WR(ctx, 0x00dfc/4, 0x00000004); + INSTANCE_WR(ctx, 0x00e1c/4, 0x00000004); + INSTANCE_WR(ctx, 0x00e5c/4, 0x00000010); + INSTANCE_WR(ctx, 0x00edc/4, 0x00000001); + INSTANCE_WR(ctx, 0x00efc/4, 0x08100c12); + INSTANCE_WR(ctx, 0x00fdc/4, 0x000007ff); + INSTANCE_WR(ctx, 0x00ffc/4, 0x00080c14); + INSTANCE_WR(ctx, 0x0171c/4, 0x00000001); + INSTANCE_WR(ctx, 0x0177c/4, 0x00000010); + INSTANCE_WR(ctx, 0x01e9c/4, 0x00000088); + INSTANCE_WR(ctx, 0x01ebc/4, 0x00000088); + INSTANCE_WR(ctx, 0x01f1c/4, 0x00000004); + INSTANCE_WR(ctx, 0x021fc/4, 0x00000026); + INSTANCE_WR(ctx, 0x0225c/4, 0x3f800000); + INSTANCE_WR(ctx, 0x022dc/4, 0x0000001a); + INSTANCE_WR(ctx, 0x022fc/4, 0x00000010); + INSTANCE_WR(ctx, 0x0281c/4, 0x00000052); + INSTANCE_WR(ctx, 0x0285c/4, 0x00000026); + INSTANCE_WR(ctx, 0x0289c/4, 0x00000004); + INSTANCE_WR(ctx, 0x028bc/4, 0x00000004); + INSTANCE_WR(ctx, 0x028fc/4, 0x0000001a); + INSTANCE_WR(ctx, 0x0295c/4, 0x00ffff00); + INSTANCE_WR(ctx, 0x41800/4, 0x08100c12); + INSTANCE_WR(ctx, 0x41840/4, 0x00000080); + INSTANCE_WR(ctx, 0x41860/4, 0x80007004); + INSTANCE_WR(ctx, 0x41880/4, 0x04000400); + INSTANCE_WR(ctx, 0x418a0/4, 0x000000c0); + INSTANCE_WR(ctx, 0x418c0/4, 0x00001000); + INSTANCE_WR(ctx, 0x41920/4, 0x00000e00); + INSTANCE_WR(ctx, 0x41940/4, 0x00001e00); + INSTANCE_WR(ctx, 0x41960/4, 0x00000001); + INSTANCE_WR(ctx, 0x419c0/4, 0x00000001); + INSTANCE_WR(ctx, 0x41a00/4, 0x00000004); + INSTANCE_WR(ctx, 0x41a20/4, 0x00000002); + INSTANCE_WR(ctx, 0x41ba0/4, 0x08100c12); + INSTANCE_WR(ctx, 0x41be0/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x41ca0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x41cc0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x41ce0/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x41d00/4, 0x0000ffff); + INSTANCE_WR(ctx, 0x41d20/4, 0x00000001); + INSTANCE_WR(ctx, 0x41d40/4, 0x00010001); + INSTANCE_WR(ctx, 0x41d60/4, 0x00010001); + INSTANCE_WR(ctx, 0x41d80/4, 0x00000001); + INSTANCE_WR(ctx, 0x41dc0/4, 0x0001fe21); + INSTANCE_WR(ctx, 0x41e80/4, 0x08100c12); + INSTANCE_WR(ctx, 0x41ea0/4, 0x00000004); + INSTANCE_WR(ctx, 0x41ee0/4, 0x00000002); + INSTANCE_WR(ctx, 0x41f00/4, 0x00000011); + INSTANCE_WR(ctx, 0x42020/4, 0x0fac6881); + INSTANCE_WR(ctx, 0x420c0/4, 0x00000004); + INSTANCE_WR(ctx, 0x42200/4, 0x00000002); + INSTANCE_WR(ctx, 0x42220/4, 0x00000001); + INSTANCE_WR(ctx, 0x42240/4, 0x00000001); + INSTANCE_WR(ctx, 0x42260/4, 0x00000002); + INSTANCE_WR(ctx, 0x42280/4, 0x00000001); + INSTANCE_WR(ctx, 0x422a0/4, 0x00000001); + INSTANCE_WR(ctx, 0x422c0/4, 0x00000001); + INSTANCE_WR(ctx, 0x42300/4, 0x00000004); + INSTANCE_WR(ctx, 0x49700/4, 0x00000011); + INSTANCE_WR(ctx, 0x49740/4, 0x00000001); + INSTANCE_WR(ctx, 0x0012c/4, 0x00000002); +} + int nv50_graph_create_context(struct nouveau_channel *chan) { @@ -7450,7 +8166,10 @@ nv50_graph_create_context(struct nouveau_channel *chan) INSTANCE_WR(chan->ramin_grctx->gpuobj, 0x00000/4, chan->ramin->instance >> 12); - INSTANCE_WR(chan->ramin_grctx->gpuobj, 0x0011c/4, 0x00000002); + if (dev_priv->chipset == 0xaa) + INSTANCE_WR(chan->ramin_grctx->gpuobj, 0x00004/4, 0x00000002); + else + INSTANCE_WR(chan->ramin_grctx->gpuobj, 0x0011c/4, 0x00000002); switch (dev_priv->chipset) { case 0x50: @@ -7465,6 +8184,9 @@ nv50_graph_create_context(struct nouveau_channel *chan) case 0x92: nv92_graph_init_ctxvals(dev, chan->ramin_grctx); break; + case 0xaa: + nvaa_graph_init_ctxvals(dev, chan->ramin_grctx); + break; default: /* This is complete crack, it accidently used to make at * least some G8x cards work partially somehow, though there's -- cgit v1.2.3 From 8ca06eb492f861dbf049a2e104e4e2a5ba814c13 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 17 Sep 2008 23:10:15 -0400 Subject: [FreeBSD] Convert to using cdevpriv for file_priv tracking --- bsd-core/drmP.h | 17 ++++++----- bsd-core/drm_auth.c | 6 ++-- bsd-core/drm_drv.c | 26 ++++------------- bsd-core/drm_fops.c | 78 ++++++++++++++++++++++----------------------------- bsd-core/drm_ioctl.c | 6 ++-- bsd-core/drm_sysctl.c | 4 +-- bsd-core/drm_vm.c | 14 ++++----- 7 files changed, 62 insertions(+), 89 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 8404df74..fcce9066 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -37,7 +37,7 @@ #if defined(_KERNEL) || defined(__KERNEL__) struct drm_device; -typedef struct drm_file drm_file_t; +struct drm_file; #include #include @@ -412,12 +412,12 @@ typedef struct drm_buf_entry { typedef TAILQ_HEAD(drm_file_list, drm_file) drm_file_list_t; struct drm_file { TAILQ_ENTRY(drm_file) link; + struct drm_device *dev; int authenticated; int master; int minor; pid_t pid; uid_t uid; - int refs; drm_magic_t magic; unsigned long ioctl_count; void *driver_priv; @@ -551,9 +551,9 @@ struct drm_ati_pcigart_info { struct drm_driver_info { int (*load)(struct drm_device *, unsigned long flags); int (*firstopen)(struct drm_device *); - int (*open)(struct drm_device *, drm_file_t *); + int (*open)(struct drm_device *, struct drm_file *); void (*preclose)(struct drm_device *, struct drm_file *file_priv); - void (*postclose)(struct drm_device *, drm_file_t *); + void (*postclose)(struct drm_device *, struct drm_file *); void (*lastclose)(struct drm_device *); int (*unload)(struct drm_device *); void (*reclaim_buffers_locked)(struct drm_device *, @@ -728,10 +728,10 @@ extern int drm_debug_flag; /* Device setup support (drm_drv.c) */ int drm_probe(device_t nbdev, drm_pci_id_list_t *idlist); int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist); +void drm_close(void *data); int drm_detach(device_t nbdev); d_ioctl_t drm_ioctl; d_open_t drm_open; -d_close_t drm_close; d_read_t drm_read; d_poll_t drm_poll; d_mmap_t drm_mmap; @@ -741,8 +741,6 @@ extern drm_local_map_t *drm_getsarea(struct drm_device *dev); extern int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p, struct drm_device *dev); -extern drm_file_t *drm_find_file_by_proc(struct drm_device *dev, - DRM_STRUCTPROC *p); /* Memory management support (drm_memory.c) */ void drm_mem_init(void); @@ -874,7 +872,7 @@ int drm_noop(struct drm_device *dev, void *data, int drm_resctx(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_addctx(struct drm_device *dev, void *data, -struct drm_file *file_priv); + struct drm_file *file_priv); int drm_modctx(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_getctx(struct drm_device *dev, void *data, @@ -929,7 +927,8 @@ int drm_mapbufs(struct drm_device *dev, void *data, int drm_dma(struct drm_device *dev, void *data, struct drm_file *file_priv); /* IRQ support (drm_irq.c) */ -int drm_control(struct drm_device *dev, void *data, struct drm_file *file_priv); +int drm_control(struct drm_device *dev, void *data, + struct drm_file *file_priv); int drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_priv); void drm_locked_tasklet(struct drm_device *dev, diff --git a/bsd-core/drm_auth.c b/bsd-core/drm_auth.c index 455a7164..b5fc5587 100644 --- a/bsd-core/drm_auth.c +++ b/bsd-core/drm_auth.c @@ -43,7 +43,7 @@ static int drm_hash_magic(drm_magic_t magic) /** * Returns the file private associated with the given magic number. */ -static drm_file_t *drm_find_file(struct drm_device *dev, drm_magic_t magic) +static struct drm_file *drm_find_file(struct drm_device *dev, drm_magic_t magic) { drm_magic_entry_t *pt; int hash = drm_hash_magic(magic); @@ -63,7 +63,7 @@ static drm_file_t *drm_find_file(struct drm_device *dev, drm_magic_t magic) * Inserts the given magic number into the hash table of used magic number * lists. */ -static int drm_add_magic(struct drm_device *dev, drm_file_t *priv, +static int drm_add_magic(struct drm_device *dev, struct drm_file *priv, drm_magic_t magic) { int hash; @@ -169,7 +169,7 @@ int drm_authmagic(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_auth *auth = data; - drm_file_t *priv; + struct drm_file *priv; DRM_DEBUG("%u\n", auth->magic); diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 57a2bbed..a35d60a7 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -123,7 +123,6 @@ static drm_ioctl_desc_t drm_ioctls[256] = { static struct cdevsw drm_cdevsw = { .d_version = D_VERSION, .d_open = drm_open, - .d_close = drm_close, .d_read = drm_read, .d_ioctl = drm_ioctl, .d_poll = drm_poll, @@ -553,26 +552,16 @@ int drm_open(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) return retcode; } -int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) +void drm_close(void *data) { - struct drm_device *dev = drm_get_device_from_kdev(kdev); - drm_file_t *file_priv; + struct drm_file *file_priv = data; + struct drm_device *dev = file_priv->dev; int retcode = 0; DRM_DEBUG("open_count = %d\n", dev->open_count); DRM_LOCK(); - file_priv = drm_find_file_by_proc(dev, p); - if (!file_priv) { - DRM_UNLOCK(); - DRM_ERROR("can't find authenticator\n"); - return EINVAL; - } - - if (--file_priv->refs != 0) - goto done; - if (dev->driver->preclose != NULL) dev->driver->preclose(dev, file_priv); @@ -640,7 +629,6 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) * End inline drm_release */ -done: atomic_inc(&dev->counts[_DRM_STAT_CLOSES]); device_unbusy(dev->device); if (--dev->open_count == 0) { @@ -648,8 +636,6 @@ done: } DRM_UNLOCK(); - - return retcode; } /* drm_ioctl is called whenever a process performs an ioctl on /dev/drm. @@ -663,12 +649,12 @@ int drm_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int flags, int (*func)(struct drm_device *dev, void *data, struct drm_file *file_priv); int nr = DRM_IOCTL_NR(cmd); int is_driver_ioctl = 0; - drm_file_t *file_priv; + struct drm_file *file_priv; DRM_LOCK(); - file_priv = drm_find_file_by_proc(dev, p); + retcode = devfs_get_cdevpriv((void **)&file_priv); DRM_UNLOCK(); - if (file_priv == NULL) { + if (retcode != 0) { DRM_ERROR("can't find authenticator\n"); return EINVAL; } diff --git a/bsd-core/drm_fops.c b/bsd-core/drm_fops.c index a002d259..6850f489 100644 --- a/bsd-core/drm_fops.c +++ b/bsd-core/drm_fops.c @@ -36,26 +36,12 @@ #include "drmP.h" -drm_file_t *drm_find_file_by_proc(struct drm_device *dev, DRM_STRUCTPROC *p) -{ - uid_t uid = p->td_ucred->cr_svuid; - pid_t pid = p->td_proc->p_pid; - drm_file_t *priv; - - DRM_SPINLOCK_ASSERT(&dev->dev_lock); - - TAILQ_FOREACH(priv, &dev->files, link) - if (priv->pid == pid && priv->uid == uid) - return priv; - return NULL; -} - /* drm_open_helper is called whenever a process opens /dev/drm. */ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p, struct drm_device *dev) { - int m = minor(kdev); - drm_file_t *priv; + struct drm_file *priv; + int m = minor(kdev); int retcode; if (flags & O_EXCL) @@ -64,40 +50,42 @@ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p, DRM_DEBUG("pid = %d, minor = %d\n", DRM_CURRENTPID, m); + priv = malloc(sizeof(*priv), M_DRM, M_NOWAIT | M_ZERO); + if (priv == NULL) { + return ENOMEM; + } + + retcode = devfs_set_cdevpriv(priv, drm_close); + if (retcode != 0) { + free(priv, M_DRM); + return retcode; + } + DRM_LOCK(); - priv = drm_find_file_by_proc(dev, p); - if (priv) { - priv->refs++; - } else { - priv = malloc(sizeof(*priv), M_DRM, M_NOWAIT | M_ZERO); - if (priv == NULL) { + priv->dev = dev; + priv->uid = p->td_ucred->cr_svuid; + priv->pid = p->td_proc->p_pid; + priv->minor = m; + priv->ioctl_count = 0; + + /* for compatibility root is always authenticated */ + priv->authenticated = DRM_SUSER(p); + + if (dev->driver->open) { + /* shared code returns -errno */ + retcode = -dev->driver->open(dev, priv); + if (retcode != 0) { + devfs_clear_cdevpriv(); + free(priv, M_DRM); DRM_UNLOCK(); - return ENOMEM; - } - priv->uid = p->td_ucred->cr_svuid; - priv->pid = p->td_proc->p_pid; - priv->refs = 1; - priv->minor = m; - priv->ioctl_count = 0; - - /* for compatibility root is always authenticated */ - priv->authenticated = DRM_SUSER(p); - - if (dev->driver->open) { - /* shared code returns -errno */ - retcode = -dev->driver->open(dev, priv); - if (retcode != 0) { - free(priv, M_DRM); - DRM_UNLOCK(); - return retcode; - } + return retcode; } + } - /* first opener automatically becomes master */ - priv->master = TAILQ_EMPTY(&dev->files); + /* first opener automatically becomes master */ + priv->master = TAILQ_EMPTY(&dev->files); - TAILQ_INSERT_TAIL(&dev->files, priv, link); - } + TAILQ_INSERT_TAIL(&dev->files, priv, link); DRM_UNLOCK(); kdev->si_drv1 = dev; return 0; diff --git a/bsd-core/drm_ioctl.c b/bsd-core/drm_ioctl.c index ad6bd819..0523291e 100644 --- a/bsd-core/drm_ioctl.c +++ b/bsd-core/drm_ioctl.c @@ -179,9 +179,9 @@ int drm_getclient(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_client *client = data; - drm_file_t *pt; - int idx; - int i = 0; + struct drm_file *pt; + int idx; + int i = 0; idx = client->idx; DRM_LOCK(); diff --git a/bsd-core/drm_sysctl.c b/bsd-core/drm_sysctl.c index 4c281fe3..f9cfd9cf 100644 --- a/bsd-core/drm_sysctl.c +++ b/bsd-core/drm_sysctl.c @@ -268,7 +268,7 @@ done: static int drm_clients_info DRM_SYSCTL_HANDLER_ARGS { struct drm_device *dev = arg1; - drm_file_t *priv, *tempprivs; + struct drm_file *priv, *tempprivs; char buf[128]; int retcode; int privcount, i; @@ -279,7 +279,7 @@ static int drm_clients_info DRM_SYSCTL_HANDLER_ARGS TAILQ_FOREACH(priv, &dev->files, link) privcount++; - tempprivs = malloc(sizeof(drm_file_t) * privcount, M_DRM, M_NOWAIT); + tempprivs = malloc(sizeof(struct drm_file) * privcount, M_DRM, M_NOWAIT); if (tempprivs == NULL) { DRM_UNLOCK(); return ENOMEM; diff --git a/bsd-core/drm_vm.c b/bsd-core/drm_vm.c index 7fa33c91..8ee49a28 100644 --- a/bsd-core/drm_vm.c +++ b/bsd-core/drm_vm.c @@ -32,20 +32,20 @@ int drm_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot) { struct drm_device *dev = drm_get_device_from_kdev(kdev); + struct drm_file *file_priv; drm_local_map_t *map; - drm_file_t *priv; enum drm_map_type type; vm_paddr_t phys; DRM_LOCK(); - priv = drm_find_file_by_proc(dev, DRM_CURPROC); + TAILQ_FOREACH(file_priv, &dev->files, link) + if (file_priv->pid == curthread->td_proc->p_pid && + file_priv->uid == curthread->td_ucred->cr_svuid && + file_priv->authenticated == 1) + break; DRM_UNLOCK(); - if (priv == NULL) { - DRM_ERROR("can't find authenticator\n"); - return EINVAL; - } - if (!priv->authenticated) + if (!file_priv) return EACCES; if (dev->dma && offset >= 0 && offset < ptoa(dev->dma->page_count)) { -- cgit v1.2.3 From 3949f3c9eaad9547fe046ca4d469fa7cc8f12304 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Mon, 22 Sep 2008 10:16:19 +0800 Subject: intel: Fix driver-supplied argument to exec function (fd.o bug #17653). --- libdrm/intel/intel_bufmgr_fake.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdrm/intel/intel_bufmgr_fake.c b/libdrm/intel/intel_bufmgr_fake.c index 4b4c2a1b..28c7f6b3 100644 --- a/libdrm/intel/intel_bufmgr_fake.c +++ b/libdrm/intel/intel_bufmgr_fake.c @@ -1177,7 +1177,7 @@ void intel_bufmgr_fake_set_exec_callback(dri_bufmgr *bufmgr, dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bufmgr; bufmgr_fake->exec = exec; - bufmgr_fake->exec_priv = exec; + bufmgr_fake->exec_priv = priv; } static int -- cgit v1.2.3 From 1b3abe62b5751d0514d57aa850e584dca7dfc23e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 23 Sep 2008 10:47:21 -0700 Subject: intel: Do strerror on errno, not on the -1 return value from ioctl. --- libdrm/intel/intel_bufmgr_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c index 97e387f5..cd36cdc7 100644 --- a/libdrm/intel/intel_bufmgr_gem.c +++ b/libdrm/intel/intel_bufmgr_gem.c @@ -357,7 +357,7 @@ intel_bo_gem_create_from_name(dri_bufmgr *bufmgr, const char *name, ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_GEM_OPEN, &open_arg); if (ret != 0) { fprintf(stderr, "Couldn't reference %s handle 0x%08x: %s\n", - name, handle, strerror(-ret)); + name, handle, strerror(errno)); free(bo_gem); return NULL; } @@ -401,7 +401,7 @@ dri_gem_bo_free(dri_bo *bo) if (ret != 0) { fprintf(stderr, "DRM_IOCTL_GEM_CLOSE %d failed (%s): %s\n", - bo_gem->gem_handle, bo_gem->name, strerror(-ret)); + bo_gem->gem_handle, bo_gem->name, strerror(errno)); } free(bo); } -- cgit v1.2.3 From 0dccf017ab629d69fce91e18b013882ecb45f55d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 23 Sep 2008 10:48:39 -0700 Subject: intel: Replace wraparound test logic in bufmgr_fake. Again. I'd swapped the operands, so if we weren't in lockstep with the hardware we said the sequence was always passed. Additionally, a race was available that we might have failed at recovering from. Instead, I've replaced the logic with new stuff that should be more robust and not rely on all the parties in userland following the same IRQ_EMIT() == 1 protocol. Also, in a radical departure from past efforts, include a long comment describing the failure modes and how we're working around them. Thanks to haihao for catching the original issue. --- libdrm/intel/intel_bufmgr_fake.c | 115 ++++++++++++++++++++++++++++----------- 1 file changed, 84 insertions(+), 31 deletions(-) diff --git a/libdrm/intel/intel_bufmgr_fake.c b/libdrm/intel/intel_bufmgr_fake.c index 28c7f6b3..e26d46c1 100644 --- a/libdrm/intel/intel_bufmgr_fake.c +++ b/libdrm/intel/intel_bufmgr_fake.c @@ -166,7 +166,7 @@ typedef struct _bufmgr_fake { /** Driver-supplied argument to driver callbacks */ void *driver_priv; /* Pointer to kernel-updated sarea data for the last completed user irq */ - volatile unsigned int *last_dispatch; + volatile int *last_dispatch; int fd; @@ -264,61 +264,114 @@ _fence_emit_internal(dri_bufmgr_fake *bufmgr_fake) abort(); } - /* The kernel implementation of IRQ_WAIT is broken for wraparound, and has - * been since it was first introduced. It only checks for - * completed_seq >= seq, and thus returns success early for wrapped irq - * values if the CPU wins a race. - * - * We have to do it up front at emit when we discover wrap, so that another - * client can't race (after we drop the lock) to emit and wait and fail. - */ - if (seq == 0 || seq == 1) { - drmCommandWriteRead(bufmgr_fake->fd, DRM_I915_FLUSH, &ie, sizeof(ie)); - } - DBG("emit 0x%08x\n", seq); bufmgr_fake->last_fence = seq; return bufmgr_fake->last_fence; } static void -_fence_wait_internal(dri_bufmgr_fake *bufmgr_fake, unsigned int cookie) +_fence_wait_internal(dri_bufmgr_fake *bufmgr_fake, int seq) { struct drm_i915_irq_wait iw; - unsigned int last_dispatch; + int hw_seq; int ret; + int kernel_lied; if (bufmgr_fake->fence_wait != NULL) { - bufmgr_fake->fence_wait(cookie, bufmgr_fake->fence_priv); + bufmgr_fake->fence_wait(seq, bufmgr_fake->fence_priv); return; } DBG("wait 0x%08x\n", iw.irq_seq); - /* The kernel implementation of IRQ_WAIT is broken for wraparound, and has - * been since it was first introduced. It only checks for - * completed_seq >= seq, and thus never returns for pre-wrapped irq values - * if the GPU wins the race. + iw.irq_seq = seq; + + /* The kernel IRQ_WAIT implementation is all sorts of broken. + * 1) It returns 1 to 0x7fffffff instead of using the full 32-bit unsigned + * range. + * 2) It returns 0 if hw_seq >= seq, not seq - hw_seq < 0 on the 32-bit + * signed range. + * 3) It waits if seq < hw_seq, not seq - hw_seq > 0 on the 32-bit + * signed range. + * 4) It returns -EBUSY in 3 seconds even if the hardware is still + * successfully chewing through buffers. + * + * Assume that in userland we treat sequence numbers as ints, which makes + * some of the comparisons convenient, since the sequence numbers are + * all postive signed integers. + * + * From this we get several cases we need to handle. Here's a timeline. + * 0x2 0x7 0x7ffffff8 0x7ffffffd + * | | | | + * ------------------------------------------------------------------- + * + * A) Normal wait for hw to catch up + * hw_seq seq + * | | + * ------------------------------------------------------------------- + * seq - hw_seq = 5. If we call IRQ_WAIT, it will wait for hw to catch up. + * + * B) Normal wait for a sequence number that's already passed. + * seq hw_seq + * | | + * ------------------------------------------------------------------- + * seq - hw_seq = -5. If we call IRQ_WAIT, it returns 0 quickly. * - * So, check if it looks like a pre-wrapped value and just return success. + * C) Hardware has already wrapped around ahead of us + * hw_seq seq + * | | + * ------------------------------------------------------------------- + * seq - hw_seq = 0x80000000 - 5. If we called IRQ_WAIT, it would wait + * for hw_seq >= seq, which may never occur. Thus, we want to catch this + * in userland and return 0. + * + * D) We've wrapped around ahead of the hardware. + * seq hw_seq + * | | + * ------------------------------------------------------------------- + * seq - hw_seq = -(0x80000000 - 5). If we called IRQ_WAIT, it would return + * 0 quickly because hw_seq >= seq, even though the hardware isn't caught up. + * Thus, we need to catch this early return in userland and bother the + * kernel until the hardware really does catch up. + * + * E) Hardware might wrap after we test in userland. + * hw_seq seq + * | | + * ------------------------------------------------------------------- + * seq - hw_seq = 5. If we call IRQ_WAIT, it will likely see seq >= hw_seq + * and wait. However, suppose hw_seq wraps before we make it into the + * kernel. The kernel sees hw_seq >= seq and waits for 3 seconds then + * returns -EBUSY. This is case C). We should catch this and then return + * successfully. */ - if (*bufmgr_fake->last_dispatch - cookie > 0x4000000) - return; + do { + /* Keep a copy of last_dispatch so that if the wait -EBUSYs because the + * hardware didn't catch up in 3 seconds, we can see if it at least made + * progress and retry. + */ + hw_seq = *bufmgr_fake->last_dispatch; - iw.irq_seq = cookie; + /* Catch case C */ + if (seq - hw_seq > 0x40000000) + return; - do { - last_dispatch = *bufmgr_fake->last_dispatch; ret = drmCommandWrite(bufmgr_fake->fd, DRM_I915_IRQ_WAIT, &iw, sizeof(iw)); - } while (ret == -EAGAIN || ret == -EINTR || - (ret == -EBUSY && last_dispatch != *bufmgr_fake->last_dispatch)); + /* Catch case D */ + kernel_lied = (ret == 0) && (seq - *bufmgr_fake->last_dispatch < + -0x40000000); + + /* Catch case E */ + if (ret == -EBUSY && (seq - *bufmgr_fake->last_dispatch > 0x40000000)) + ret = 0; + } while (kernel_lied || ret == -EAGAIN || ret == -EINTR || + (ret == -EBUSY && hw_seq != *bufmgr_fake->last_dispatch)); if (ret != 0) { drmMsg("%s:%d: Error %d waiting for fence.\n", __FILE__, __LINE__, ret); abort(); } - clear_fenced(bufmgr_fake, cookie); + clear_fenced(bufmgr_fake, seq); } static int @@ -1312,7 +1365,7 @@ void intel_bufmgr_fake_set_last_dispatch(dri_bufmgr *bufmgr, { dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)bufmgr; - bufmgr_fake->last_dispatch = last_dispatch; + bufmgr_fake->last_dispatch = (volatile int *)last_dispatch; } dri_bufmgr * @@ -1349,7 +1402,7 @@ intel_bufmgr_fake_init(int fd, bufmgr_fake->bufmgr.debug = 0; bufmgr_fake->fd = fd; - bufmgr_fake->last_dispatch = last_dispatch; + bufmgr_fake->last_dispatch = (volatile int *)last_dispatch; return &bufmgr_fake->bufmgr; } -- cgit v1.2.3 From 2db8e0c8ef8c7a66460fceda129533b364f6418c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 23 Sep 2008 17:06:01 -0700 Subject: intel: Allow up to 15 seconds chewing on one buffer before acknowledging -EBUSY. The gltestperf demo in some cases took over seven seconds to make it through one batchbuffer on a GM965. Bug #17004. --- libdrm/intel/intel_bufmgr_fake.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/libdrm/intel/intel_bufmgr_fake.c b/libdrm/intel/intel_bufmgr_fake.c index e26d46c1..a5b183aa 100644 --- a/libdrm/intel/intel_bufmgr_fake.c +++ b/libdrm/intel/intel_bufmgr_fake.c @@ -273,7 +273,7 @@ static void _fence_wait_internal(dri_bufmgr_fake *bufmgr_fake, int seq) { struct drm_i915_irq_wait iw; - int hw_seq; + int hw_seq, busy_count = 0; int ret; int kernel_lied; @@ -343,7 +343,17 @@ _fence_wait_internal(dri_bufmgr_fake *bufmgr_fake, int seq) * kernel. The kernel sees hw_seq >= seq and waits for 3 seconds then * returns -EBUSY. This is case C). We should catch this and then return * successfully. + * + * F) Hardware might take a long time on a buffer. + * hw_seq seq + * | | + * ------------------------------------------------------------------- + * seq - hw_seq = 5. If we call IRQ_WAIT, if sequence 2 through 5 take too + * long, it will return -EBUSY. Batchbuffers in the gltestperf demo were + * seen to take up to 7 seconds. We should catch early -EBUSY return + * and keep trying. */ + do { /* Keep a copy of last_dispatch so that if the wait -EBUSYs because the * hardware didn't catch up in 3 seconds, we can see if it at least made @@ -364,11 +374,18 @@ _fence_wait_internal(dri_bufmgr_fake *bufmgr_fake, int seq) /* Catch case E */ if (ret == -EBUSY && (seq - *bufmgr_fake->last_dispatch > 0x40000000)) ret = 0; + + /* Catch case F: Allow up to 15 seconds chewing on one buffer. */ + if ((ret == -EBUSY) && (hw_seq != *bufmgr_fake->last_dispatch)) + busy_count = 0; + else + busy_count++; } while (kernel_lied || ret == -EAGAIN || ret == -EINTR || - (ret == -EBUSY && hw_seq != *bufmgr_fake->last_dispatch)); + (ret == -EBUSY && busy_count < 5)); if (ret != 0) { - drmMsg("%s:%d: Error %d waiting for fence.\n", __FILE__, __LINE__, ret); + drmMsg("%s:%d: Error waiting for fence: %s.\n", __FILE__, __LINE__, + strerror(-ret)); abort(); } clear_fenced(bufmgr_fake, seq); -- cgit v1.2.3