From: <jb...@ke...> - 2008-08-08 00:16:58
|
libdrm/intel/intel_bufmgr.h | 35 ++++++++++ libdrm/intel/intel_bufmgr_gem.c | 131 ++++++++++++++++++++++++++++++++++++++++ linux-core/drm_compat.c | 99 ++++++++++++++++++++++++++++++ linux-core/drm_compat.h | 3 linux-core/drm_vm.c | 35 +++++----- linux-core/i915_gem.c | 43 +++++++------ linux-core/i915_gem_debug.c | 4 - linux-core/i915_gem_tiling.c | 3 shared-core/i915_drv.h | 3 shared-core/i915_irq.c | 51 ++++++++++++++- 10 files changed, 363 insertions(+), 44 deletions(-) New commits: commit 8074b2e83d18bbf85d1c3284f561d849c829dd4b Merge: c7fb19e... 4585787... Author: Jesse Barnes <jb...@vi...> Date: Thu Aug 7 17:15:50 2008 -0700 Make modesetting-gem build with recent kernels Needed to merge in VM fault changes & pci_read_base API update. diff --cc linux-core/drm_compat.c index aa825f3,c4ebc2f..d06b9d2 --- a/linux-core/drm_compat.c +++ b/linux-core/drm_compat.c @@@ -804,5 -756,105 +804,104 @@@ void *kmap_atomic_prot_pfn(unsigned lon } EXPORT_SYMBOL(kmap_atomic_prot_pfn); - #endif + #ifdef DRM_FULL_MM_COMPAT + #ifdef DRM_NO_FAULT + unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, + unsigned long address) + { + struct drm_buffer_object *bo = (struct drm_buffer_object *) vma->vm_private_data; + unsigned long page_offset; + struct page *page = NULL; + struct drm_ttm *ttm; + struct drm_device *dev; + unsigned long pfn; + int err; + unsigned long bus_base; + unsigned long bus_offset; + unsigned long bus_size; + unsigned long ret = NOPFN_REFAULT; + + if (address > vma->vm_end) + return NOPFN_SIGBUS; + + dev = bo->dev; + err = drm_bo_read_lock(&dev->bm.bm_lock, 1); + if (err) + return NOPFN_REFAULT; + + err = mutex_lock_interruptible(&bo->mutex); + if (err) { + drm_bo_read_unlock(&dev->bm.bm_lock); + return NOPFN_REFAULT; + } + + err = drm_bo_wait(bo, 0, 1, 0, 1); + if (err) { + ret = (err != -EAGAIN) ? NOPFN_SIGBUS : NOPFN_REFAULT; + bo->priv_flags &= ~_DRM_BO_FLAG_UNLOCKED; + goto out_unlock; + } + + bo->priv_flags &= ~_DRM_BO_FLAG_UNLOCKED; + + /* + * If buffer happens to be in a non-mappable location, + * move it to a mappable. + */ + + if (!(bo->mem.flags & DRM_BO_FLAG_MAPPABLE)) { + uint32_t new_flags = bo->mem.proposed_flags | + DRM_BO_FLAG_MAPPABLE | + DRM_BO_FLAG_FORCE_MAPPABLE; + err = drm_bo_move_buffer(bo, new_flags, 0, 0); + if (err) { + ret = (err != -EAGAIN) ? NOPFN_SIGBUS : NOPFN_REFAULT; + goto out_unlock; + } + } + + err = drm_bo_pci_offset(dev, &bo->mem, &bus_base, &bus_offset, + &bus_size); + + if (err) { + ret = NOPFN_SIGBUS; + goto out_unlock; + } + + page_offset = (address - vma->vm_start) >> PAGE_SHIFT; + + if (bus_size) { + struct drm_mem_type_manager *man = &dev->bm.man[bo->mem.mem_type]; + + pfn = ((bus_base + bus_offset) >> PAGE_SHIFT) + page_offset; + vma->vm_page_prot = drm_io_prot(man->drm_bus_maptype, vma); + } else { + ttm = bo->ttm; + + drm_ttm_fixup_caching(ttm); + page = drm_ttm_get_page(ttm, page_offset); + if (!page) { + ret = NOPFN_OOM; + goto out_unlock; + } + pfn = page_to_pfn(page); + vma->vm_page_prot = (bo->mem.flags & DRM_BO_FLAG_CACHED) ? + vm_get_page_prot(vma->vm_flags) : + drm_io_prot(_DRM_TTM, vma); + } + + err = vm_insert_pfn(vma, address, pfn); + if (err) { + ret = (err != -EAGAIN) ? NOPFN_OOM : NOPFN_REFAULT; + goto out_unlock; + } + out_unlock: + BUG_ON(bo->priv_flags & _DRM_BO_FLAG_UNLOCKED); + mutex_unlock(&bo->mutex); + drm_bo_read_unlock(&dev->bm.bm_lock); + return ret; + } + #endif + #endif diff --cc linux-core/i915_gem_debug.c index a2d6f28,0000000..6d50e5b mode 100644,000000..100644 --- a/linux-core/i915_gem_debug.c +++ b/linux-core/i915_gem_debug.c @@@ -1,202 -1,0 +1,202 @@@ +/* + * 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: + * Keith Packard <ke...@ke...> + * + */ + +#include "drmP.h" +#include "drm.h" +#include "drm_compat.h" +#include "i915_drm.h" +#include "i915_drv.h" + +#if WATCH_INACTIVE +void +i915_verify_inactive(struct drm_device *dev, char *file, int line) +{ - drm_i915_private_t *dev_priv = dev->dev_private; ++ struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_gem_object *obj; + struct drm_i915_gem_object *obj_priv; + + list_for_each_entry(obj_priv, &dev_priv->mm.inactive_list, list) { + obj = obj_priv->obj; + if (obj_priv->pin_count || obj_priv->active || + (obj->write_domain & ~(I915_GEM_DOMAIN_CPU | + I915_GEM_DOMAIN_GTT))) + DRM_ERROR("inactive %p (p %d a %d w %x) %s:%d\n", + obj, + obj_priv->pin_count, obj_priv->active, + obj->write_domain, file, line); + } +} +#endif /* WATCH_INACTIVE */ + + +#if WATCH_BUF | WATCH_EXEC | WATCH_PWRITE +static void +i915_gem_dump_page(struct page *page, uint32_t start, uint32_t end, + uint32_t bias, uint32_t mark) +{ + uint32_t *mem = kmap_atomic(page, KM_USER0); + int i; + for (i = start; i < end; i += 4) + DRM_INFO("%08x: %08x%s\n", + (int) (bias + i), mem[i / 4], + (bias + i == mark) ? " ********" : ""); + kunmap_atomic(mem, KM_USER0); + /* give syslog time to catch up */ + msleep(1); +} + +void +i915_gem_dump_object(struct drm_gem_object *obj, int len, + const char *where, uint32_t mark) +{ + struct drm_i915_gem_object *obj_priv = obj->driver_private; + int page; + + DRM_INFO("%s: object at offset %08x\n", where, obj_priv->gtt_offset); + for (page = 0; page < (len + PAGE_SIZE-1) / PAGE_SIZE; page++) { + int page_len, chunk, chunk_len; + + page_len = len - page * PAGE_SIZE; + if (page_len > PAGE_SIZE) + page_len = PAGE_SIZE; + + for (chunk = 0; chunk < page_len; chunk += 128) { + chunk_len = page_len - chunk; + if (chunk_len > 128) + chunk_len = 128; + i915_gem_dump_page(obj_priv->page_list[page], + chunk, chunk + chunk_len, + obj_priv->gtt_offset + + page * PAGE_SIZE, + mark); + } + } +} +#endif + +#if WATCH_LRU +void +i915_dump_lru(struct drm_device *dev, const char *where) +{ - drm_i915_private_t *dev_priv = dev->dev_private; ++ struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_i915_gem_object *obj_priv; + + DRM_INFO("active list %s {\n", where); + list_for_each_entry(obj_priv, &dev_priv->mm.active_list, + list) + { + DRM_INFO(" %p: %08x\n", obj_priv, + obj_priv->last_rendering_seqno); + } + DRM_INFO("}\n"); + DRM_INFO("flushing list %s {\n", where); + list_for_each_entry(obj_priv, &dev_priv->mm.flushing_list, + list) + { + DRM_INFO(" %p: %08x\n", obj_priv, + obj_priv->last_rendering_seqno); + } + DRM_INFO("}\n"); + DRM_INFO("inactive %s {\n", where); + list_for_each_entry(obj_priv, &dev_priv->mm.inactive_list, list) { + DRM_INFO(" %p: %08x\n", obj_priv, + obj_priv->last_rendering_seqno); + } + DRM_INFO("}\n"); +} +#endif + + +#if WATCH_COHERENCY +void +i915_gem_object_check_coherency(struct drm_gem_object *obj, int handle) +{ + struct drm_device *dev = obj->dev; + struct drm_i915_gem_object *obj_priv = obj->driver_private; + int page; + uint32_t *gtt_mapping; + uint32_t *backing_map = NULL; + int bad_count = 0; + + DRM_INFO("%s: checking coherency of object %p@0x%08x (%d, %dkb):\n", + __func__, obj, obj_priv->gtt_offset, handle, + obj->size / 1024); + + gtt_mapping = ioremap(dev->agp->base + obj_priv->gtt_offset, + obj->size); + if (gtt_mapping == NULL) { + DRM_ERROR("failed to map GTT space\n"); + return; + } + + for (page = 0; page < obj->size / PAGE_SIZE; page++) { + int i; + + backing_map = kmap_atomic(obj_priv->page_list[page], KM_USER0); + + if (backing_map == NULL) { + DRM_ERROR("failed to map backing page\n"); + goto out; + } + + for (i = 0; i < PAGE_SIZE / 4; i++) { + uint32_t cpuval = backing_map[i]; + uint32_t gttval = readl(gtt_mapping + + page * 1024 + i); + + if (cpuval != gttval) { + DRM_INFO("incoherent CPU vs GPU at 0x%08x: " + "0x%08x vs 0x%08x\n", + (int)(obj_priv->gtt_offset + + page * PAGE_SIZE + i * 4), + cpuval, gttval); + if (bad_count++ >= 8) { + DRM_INFO("...\n"); + goto out; + } + } + } + kunmap_atomic(backing_map, KM_USER0); + backing_map = NULL; + } + + out: + if (backing_map != NULL) + kunmap_atomic(backing_map, KM_USER0); + iounmap(gtt_mapping); + + /* give syslog time to catch up */ + msleep(1); + + /* Directly flush the object, since we just loaded values with the CPU + * from the backing pages and we don't want to disturb the cache + * management that we're trying to observe. + */ + + i915_gem_clflush_object(obj); +} +#endif diff --cc linux-core/i915_gem_tiling.c index c5825fb,0000000..3ac1f35 mode 100644,000000..100644 --- a/linux-core/i915_gem_tiling.c +++ b/linux-core/i915_gem_tiling.c @@@ -1,309 -1,0 +1,310 @@@ +/* + * 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 <er...@an...> + * + */ + +#include "drmP.h" +#include "drm.h" +#include "i915_drm.h" +#include "i915_drv.h" + +/** @file i915_gem_tiling.c + * + * Support for managing tiling state of buffer objects. + * + * The idea behind tiling is to increase cache hit rates by rearranging + * pixel data so that a group of pixel accesses are in the same cacheline. + * Performance improvement from doing this on the back/depth buffer are on + * the order of 30%. + * + * Intel architectures make this somewhat more complicated, though, by + * adjustments made to addressing of data when the memory is in interleaved + * mode (matched pairs of DIMMS) to improve memory bandwidth. + * For interleaved memory, the CPU sends every sequential 64 bytes + * to an alternate memory channel so it can get the bandwidth from both. + * + * The GPU also rearranges its accesses for increased bandwidth to interleaved + * memory, and it matches what the CPU does for non-tiled. However, when tiled + * it does it a little differently, since one walks addresses not just in the + * X direction but also Y. So, along with alternating channels when bit + * 6 of the address flips, it also alternates when other bits flip -- Bits 9 + * (every 512 bytes, an X tile scanline) and 10 (every two X tile scanlines) + * are common to both the 915 and 965-class hardware. + * + * The CPU also sometimes XORs in higher bits as well, to improve + * bandwidth doing strided access like we do so frequently in graphics. This + * is called "Channel XOR Randomization" in the MCH documentation. The result + * is that the CPU is XORing in either bit 11 or bit 17 to bit 6 of its address + * decode. + * + * All of this bit 6 XORing has an effect on our memory management, + * as we need to make sure that the 3d driver can correctly address object + * contents. + * + * If we don't have interleaved memory, all tiling is safe and no swizzling is + * required. + * + * When bit 17 is XORed in, we simply refuse to tile at all. Bit + * 17 is not just a page offset, so as we page an objet out and back in, + * individual pages in it will have different bit 17 addresses, resulting in + * each 64 bytes being swapped with its neighbor! + * + * Otherwise, if interleaved, we have to tell the 3d driver what the address + * swizzling it needs to do is, since it's writing with the CPU to the pages + * (bit 6 and potentially bit 11 XORed in), and the GPU is reading from the + * pages (bit 6, 9, and 10 XORed in), resulting in a cumulative bit swizzling + * required by the CPU of XORing in bit 6, 9, 10, and potentially 11, in order + * to match what the GPU expects. + */ + +/** + * Detects bit 6 swizzling of address lookup between IGD access and CPU + * access through main memory. + */ +void +i915_gem_detect_bit_6_swizzle(struct drm_device *dev) +{ + struct drm_i915_private *dev_priv = dev->dev_private; + struct pci_dev *bridge; + uint32_t swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN; + uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; + int mchbar_offset; + char __iomem *mchbar; + int ret; + + bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); + if (bridge == NULL) { + DRM_ERROR("Couldn't get bridge device\n"); + return; + } + + ret = pci_enable_device(bridge); + if (ret != 0) { + DRM_ERROR("pci_enable_device failed: %d\n", ret); + return; + } + + if (IS_I965G(dev)) + mchbar_offset = 0x48; + else + mchbar_offset = 0x44; + + /* Use resource 2 for our BAR that's stashed in a nonstandard location, + * since the bridge would only ever use standard BARs 0-1 (though it + * doesn't anyway) + */ - ret = pci_read_base(bridge, mchbar_offset, &bridge->resource[2]); ++ ret = pci_read_base(bridge, pci_bar_mem64, &bridge->resource[2], ++ mchbar_offset); + if (ret != 0) { + DRM_ERROR("pci_read_base failed: %d\n", ret); + return; + } + + mchbar = ioremap(pci_resource_start(bridge, 2), + pci_resource_len(bridge, 2)); + if (mchbar == NULL) { + DRM_ERROR("Couldn't map MCHBAR to determine tile swizzling\n"); + return; + } + + if (IS_I965G(dev) && !IS_I965GM(dev)) { + uint32_t chdecmisc; + + /* On the 965, channel interleave appears to be determined by + * the flex bit. If flex is set, then the ranks (sides of a + * DIMM) of memory will be "stacked" (physical addresses walk + * through one rank then move on to the next, flipping channels + * or not depending on rank configuration). The GPU in this + * case does exactly the same addressing as the CPU. + * + * Unlike the 945, channel randomization based does not + * appear to be available. + * + * XXX: While the G965 doesn't appear to do any interleaving + * when the DIMMs are not exactly matched, the G4x chipsets + * might be for "L-shaped" configurations, and will need to be + * detected. + * + * L-shaped configuration: + * + * +-----+ + * | | + * |DIMM2| <-- non-interleaved + * +-----+ + * +-----+ +-----+ + * | | | | + * |DIMM0| |DIMM1| <-- interleaved area + * +-----+ +-----+ + */ + chdecmisc = readb(mchbar + CHDECMISC); + + if (chdecmisc == 0xff) { + DRM_ERROR("Couldn't read from MCHBAR. " + "Disabling tiling.\n"); + } else if (chdecmisc & CHDECMISC_FLEXMEMORY) { + swizzle_x = I915_BIT_6_SWIZZLE_NONE; + swizzle_y = I915_BIT_6_SWIZZLE_NONE; + } else { + swizzle_x = I915_BIT_6_SWIZZLE_9_10; + swizzle_y = I915_BIT_6_SWIZZLE_9; + } + } else if (IS_I9XX(dev)) { + uint32_t dcc; + + /* On 915-945 and GM965, channel interleave by the CPU is + * determined by DCC. The CPU will alternate based on bit 6 + * in interleaved mode, and the GPU will then also alternate + * on bit 6, 9, and 10 for X, but the CPU may also optionally + * alternate based on bit 17 (XOR not disabled and XOR + * bit == 17). + */ + dcc = readl(mchbar + DCC); + switch (dcc & DCC_ADDRESSING_MODE_MASK) { + case DCC_ADDRESSING_MODE_SINGLE_CHANNEL: + case DCC_ADDRESSING_MODE_DUAL_CHANNEL_ASYMMETRIC: + swizzle_x = I915_BIT_6_SWIZZLE_NONE; + swizzle_y = I915_BIT_6_SWIZZLE_NONE; + break; + case DCC_ADDRESSING_MODE_DUAL_CHANNEL_INTERLEAVED: + if (IS_I915G(dev) || IS_I915GM(dev) || + dcc & DCC_CHANNEL_XOR_DISABLE) { + swizzle_x = I915_BIT_6_SWIZZLE_9_10; + swizzle_y = I915_BIT_6_SWIZZLE_9; + } else if (IS_I965GM(dev)) { + /* GM965 only does bit 11-based channel + * randomization + */ + swizzle_x = I915_BIT_6_SWIZZLE_9_10_11; + swizzle_y = I915_BIT_6_SWIZZLE_9_11; + } else { + /* Bit 17 or perhaps other swizzling */ + swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN; + swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; + } + break; + } + if (dcc == 0xffffffff) { + DRM_ERROR("Couldn't read from MCHBAR. " + "Disabling tiling.\n"); + swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN; + swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; + } + } else { + /* As far as we know, the 865 doesn't have these bit 6 + * swizzling issues. + */ + swizzle_x = I915_BIT_6_SWIZZLE_NONE; + swizzle_y = I915_BIT_6_SWIZZLE_NONE; + } + + iounmap(mchbar); + + dev_priv->mm.bit_6_swizzle_x = swizzle_x; + dev_priv->mm.bit_6_swizzle_y = swizzle_y; +} + +/** + * Sets the tiling mode of an object, returning the required swizzling of + * bit 6 of addresses in the object. + */ +int +i915_gem_set_tiling(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + struct drm_i915_gem_set_tiling *args = data; + struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_gem_object *obj; + struct drm_i915_gem_object *obj_priv; + + obj = drm_gem_object_lookup(dev, file_priv, args->handle); + if (obj == NULL) + return -EINVAL; + obj_priv = obj->driver_private; + + mutex_lock(&dev->struct_mutex); + + if (args->tiling_mode == I915_TILING_NONE) { + obj_priv->tiling_mode = I915_TILING_NONE; + args->swizzle_mode = I915_BIT_6_SWIZZLE_NONE; + } else { + if (args->tiling_mode == I915_TILING_X) + args->swizzle_mode = dev_priv->mm.bit_6_swizzle_x; + else + args->swizzle_mode = dev_priv->mm.bit_6_swizzle_y; + /* If we can't handle the swizzling, make it untiled. */ + if (args->swizzle_mode == I915_BIT_6_SWIZZLE_UNKNOWN) { + args->tiling_mode = I915_TILING_NONE; + args->swizzle_mode = I915_BIT_6_SWIZZLE_NONE; + } + } + obj_priv->tiling_mode = args->tiling_mode; + + mutex_unlock(&dev->struct_mutex); + + drm_gem_object_unreference(obj); + + return 0; +} + +/** + * Returns the current tiling mode and required bit 6 swizzling for the object. + */ +int +i915_gem_get_tiling(struct drm_device *dev, void *data, + struct drm_file *file_priv) +{ + struct drm_i915_gem_get_tiling *args = data; + struct drm_i915_private *dev_priv = dev->dev_private; + struct drm_gem_object *obj; + struct drm_i915_gem_object *obj_priv; + + obj = drm_gem_object_lookup(dev, file_priv, args->handle); + if (obj == NULL) + return -EINVAL; + obj_priv = obj->driver_private; + + mutex_lock(&dev->struct_mutex); + + args->tiling_mode = obj_priv->tiling_mode; + switch (obj_priv->tiling_mode) { + case I915_TILING_X: + args->swizzle_mode = dev_priv->mm.bit_6_swizzle_x; + break; + case I915_TILING_Y: + args->swizzle_mode = dev_priv->mm.bit_6_swizzle_y; + break; + case I915_TILING_NONE: + args->swizzle_mode = I915_BIT_6_SWIZZLE_NONE; + break; + default: + DRM_ERROR("unknown tiling mode\n"); + } + + mutex_unlock(&dev->struct_mutex); + + drm_gem_object_unreference(obj); + + return 0; +} diff --cc shared-core/i915_drv.h index 2d18655,421572c..087c6d6 --- a/shared-core/i915_drv.h +++ b/shared-core/i915_drv.h @@@ -306,96 -267,7 +306,96 @@@ struct drm_i915_private u8 saveDACMASK; u8 saveDACDATA[256*3]; /* 256 3-byte colors */ u8 saveCR[37]; -} drm_i915_private_t; + + struct { + struct drm_mm gtt_space; + + /** + * List of objects currently involved in rendering from the + * ringbuffer. + * + * A reference is held on the buffer while on this list. + */ + struct list_head active_list; + + /** + * List of objects which are not in the ringbuffer but which + * still have a write_domain which needs to be flushed before + * unbinding. + * + * A reference is held on the buffer while on this list. + */ + struct list_head flushing_list; + + /** + * LRU list of objects which are not in the ringbuffer and + * are ready to unbind, but are still in the GTT. + * + * A reference is not held on the buffer while on this list, + * as merely being GTT-bound shouldn't prevent its being + * freed, and we'll pull it off the list in the free path. + */ + struct list_head inactive_list; + + /** + * List of breadcrumbs associated with GPU requests currently + * outstanding. + */ + struct list_head request_list; + + /** + * We leave the user IRQ off as much as possible, + * but this means that requests will finish and never + * be retired once the system goes idle. Set a timer to + * fire periodically while the ring is running. When it + * fires, go retire requests. + */ + struct delayed_work retire_work; + + uint32_t next_gem_seqno; + + /** + * Waiting sequence number, if any + */ + uint32_t waiting_gem_seqno; + + /** + * Last seq seen at irq time + */ + uint32_t irq_gem_seqno; + + /** + * Flag if the X Server, and thus DRM, is not currently in + * control of the device. + * + * This is set between LeaveVT and EnterVT. It needs to be + * replaced with a semaphore. It also needs to be + * transitioned away from for kernel modesetting. + */ + int suspended; + + /** + * Flag if the hardware appears to be wedged. + * + * This is set when attempts to idle the device timeout. + * It prevents command submission from occuring and makes + * every pending request fail + */ + int wedged; + + /** Bit 6 swizzling required for X tiling */ + uint32_t bit_6_swizzle_x; + /** Bit 6 swizzling required for Y tiling */ + uint32_t bit_6_swizzle_y; + } mm; - } drm_i915_private_t; ++}; + +struct drm_i915_file_private { + struct { + uint32_t last_gem_seqno; + uint32_t last_gem_throttle_seqno; + } mm; +}; enum intel_chip_family { CHIP_I8XX = 0x01, diff --cc shared-core/i915_irq.c index 00570e1,ae4081f..1b294bb --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@@ -1101,15 -882,63 +1101,62 @@@ int i915_vblank_swap(struct drm_device */ void i915_driver_irq_preinstall(struct drm_device * dev) { - return; - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; ++ struct drm_i915_private *dev_priv = dev->dev_private; + + I915_WRITE16(HWSTAM, 0xeffe); + I915_WRITE16(IMR, 0x0); + I915_WRITE16(IER, 0x0); } int i915_driver_irq_postinstall(struct drm_device * dev) { - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; ++ struct drm_i915_private *dev_priv = 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_enable_reg = 0; + + ret = drm_vblank_init(dev, num_pipes); + if (ret) + return ret; + + dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; + dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ + + i915_enable_interrupt(dev); + DRM_INIT_WAITQUEUE(&dev_priv->irq_queue); + + /* + * Initialize the hardware status page IRQ location. + */ + + I915_WRITE(INSTPM, (1 << 5) | (1 << 21)); return 0; } void i915_driver_irq_uninstall(struct drm_device * dev) { - return; - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; ++ struct drm_i915_private *dev_priv = dev->dev_private; + u32 temp; + + if (!dev_priv) + return; + + dev_priv->vblank_pipe = 0; + + dev_priv->irq_enabled = 0; + I915_WRITE(HWSTAM, 0xffffffff); + I915_WRITE(IMR, 0xffffffff); + I915_WRITE(IER, 0x0); + + temp = I915_READ(PIPEASTAT); + I915_WRITE(PIPEASTAT, temp); + temp = I915_READ(PIPEBSTAT); + I915_WRITE(PIPEBSTAT, temp); + temp = I915_READ(IIR); + I915_WRITE(IIR, temp); } commit c7fb19e9b074281f143b0e1c9d054ebcf5ff1091 Merge: 086716c... ac20e14... Author: Jesse Barnes <jb...@vi...> Date: Thu Aug 7 14:02:04 2008 -0700 Merge branch 'drm-gem' into modesetting-gem commit ac20e14d2361160cf199dc31c3fe1ffbacdf5bb7 Author: Keith Packard <ke...@ke...> Date: Mon Aug 4 23:33:03 2008 -0700 Switch from shmem_getpage to read_mapping_page diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c index 354bd0d..35dc5bd 100644 --- a/linux-core/i915_gem.c +++ b/linux-core/i915_gem.c @@ -1083,20 +1083,12 @@ i915_gem_object_get_page_list(struct drm_gem_object *obj) inode = obj->filp->f_path.dentry->d_inode; mapping = inode->i_mapping; for (i = 0; i < page_count; i++) { - page = find_get_page(mapping, i); - if (page == NULL || !PageUptodate(page)) { - if (page) { - page_cache_release(page); - page = NULL; - } - ret = shmem_getpage(inode, i, &page, SGP_DIRTY, NULL); - - if (ret) { - DRM_ERROR("shmem_getpage failed: %d\n", ret); - i915_gem_object_free_page_list(obj); - return ret; - } - unlock_page(page); + page = read_mapping_page(mapping, i, NULL); + if (IS_ERR(page)) { + ret = PTR_ERR(page); + DRM_ERROR("read_mapping_page failed: %d\n", ret); + i915_gem_object_free_page_list(obj); + return ret; } obj_priv->page_list[i] = page; } commit dc0546c87ffc6701802d6141810c24954274e1ac Author: Keith Packard <ke...@ke...> Date: Tue Aug 5 16:06:40 2008 -0700 [gem-intel] Retiring flush requests should clear flushed write_domains When i915_gem_retire_request has a flush which matches an object write domain, clear the write domain. This will move the object to the inactive list rather than the flushing list, avoiding trouble with objects left stuck on the flushing list. diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c index acded2e..354bd0d 100644 --- a/linux-core/i915_gem.c +++ b/linux-core/i915_gem.c @@ -661,6 +661,12 @@ i915_gem_retire_request(struct drm_device *dev, __func__, request->seqno, obj); #endif + /* If this request flushes the write domain, + * clear the write domain from the object now + */ + if (request->flush_domains & obj->write_domain) + obj->write_domain = 0; + if (obj->write_domain != 0) { list_move_tail(&obj_priv->list, &dev_priv->mm.flushing_list); @@ -760,7 +766,7 @@ i915_wait_request(struct drm_device *dev, uint32_t seqno) if (dev_priv->mm.wedged) ret = -EIO; - if (ret) + if (ret && ret != -ERESTARTSYS) DRM_ERROR("%s returns %d (awaiting %d at %d)\n", __func__, ret, seqno, i915_get_gem_seqno(dev)); @@ -890,13 +896,6 @@ i915_gem_object_wait_rendering(struct drm_gem_object *obj) ret = i915_wait_request(dev, obj_priv->last_rendering_seqno); if (ret != 0) return ret; - if (write_domain) { -#if WATCH_BUF - DRM_INFO("%s: flushed object %p from write domain %08x\n", - __func__, obj, write_domain); -#endif - obj->write_domain = 0; - } } return 0; commit ceb3d5e3834452f9d54f974b8066f90168467443 Author: Keith Packard <ke...@ke...> Date: Tue Aug 5 14:44:53 2008 -0700 [gem-intel] Don't clear write_domain until flush completes In i915_gem_object_wait_rendering, if the object write domain is being written by the GPU, the appropriate flushing commands are written to the device and an additional request queued to mark that flush. Finally, the function blocks on that new request. The bug was that the write_domain in the object was cleared before the function blocked. If the wait is interrupted by a signal, the flushing commands may still be pending. With the current write_domain information lost, the restarted syscall will drop right through the write_domain test as that value was lost, and so the function will not block at all. Oops. Fixed by simply moving the write_domain clear until after the wait_request succeeds. Note that the restarted system call will generate an additional flush sequence and request, but that should be 'harmless', aside from a slight performance impact. Someday we'll track flushing more accurately and clear write_domains more efficiently, but for now, this should suffice. This bug was discovered in the 2d gem development by running x11perf -copypixwin500 and noticing that the window got cleared accidentally. diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c index 70f1151..acded2e 100644 --- a/linux-core/i915_gem.c +++ b/linux-core/i915_gem.c @@ -381,6 +381,10 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data, return -EBADF; mutex_lock(&dev->struct_mutex); +#if WATCH_BUF + DRM_INFO("set_domain_ioctl %p(%d), %08x %08x\n", + obj, obj->size, args->read_domains, args->write_domain); +#endif ret = i915_gem_set_domain(obj, file_priv, args->read_domains, args->write_domain); drm_gem_object_unreference(obj); @@ -411,8 +415,8 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data, } #if WATCH_BUF - DRM_INFO("%s: sw_finish %d (%p)\n", - __func__, args->handle, obj); + DRM_INFO("%s: sw_finish %d (%p %d)\n", + __func__, args->handle, obj, obj->size); #endif obj_priv = obj->driver_private; @@ -853,18 +857,18 @@ i915_gem_object_wait_rendering(struct drm_gem_object *obj) struct drm_device *dev = obj->dev; struct drm_i915_gem_object *obj_priv = obj->driver_private; int ret; + uint32_t write_domain; /* If there are writes queued to the buffer, flush and * create a new seqno to wait for. */ - if (obj->write_domain & ~(I915_GEM_DOMAIN_CPU|I915_GEM_DOMAIN_GTT)) { - uint32_t write_domain = obj->write_domain; + write_domain = obj->write_domain & ~(I915_GEM_DOMAIN_CPU|I915_GEM_DOMAIN_GTT); + if (write_domain) { #if WATCH_BUF DRM_INFO("%s: flushing object %p from write domain %08x\n", __func__, obj, write_domain); #endif i915_gem_flush(dev, 0, write_domain); - obj->write_domain = 0; i915_gem_object_move_to_active(obj); obj_priv->last_rendering_seqno = i915_add_request(dev, @@ -874,6 +878,7 @@ i915_gem_object_wait_rendering(struct drm_gem_object *obj) DRM_INFO("%s: flush moves to exec list %p\n", __func__, obj); #endif } + /* If there is rendering queued on the buffer being evicted, wait for * it. */ @@ -885,6 +890,13 @@ i915_gem_object_wait_rendering(struct drm_gem_object *obj) ret = i915_wait_request(dev, obj_priv->last_rendering_seqno); if (ret != 0) return ret; + if (write_domain) { +#if WATCH_BUF + DRM_INFO("%s: flushed object %p from write domain %08x\n", + __func__, obj, write_domain); +#endif + obj->write_domain = 0; + } } return 0; commit 8e41ce17b4ab72f526cc6e9acd75c3fa81a60433 Author: Keith Packard <ke...@ke...> Date: Mon Aug 4 00:34:08 2008 -0700 Expose pin/unpin/set_tiling/flink APIs diff --git a/libdrm/intel/intel_bufmgr.h b/libdrm/intel/intel_bufmgr.h index 1cf0d51..4d33521 100644 --- a/libdrm/intel/intel_bufmgr.h +++ b/libdrm/intel/intel_bufmgr.h @@ -61,6 +61,33 @@ struct intel_bufmgr { 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); + /** + * Unpin a buffer from the aperture, allowing it to be removed + * + * \param buf Buffer to unpin + */ + int (*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 (*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 (*flink) (dri_bo *buf, uint32_t *name); }; /* intel_bufmgr_gem.c */ @@ -91,5 +118,13 @@ 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); + #endif /* INTEL_BUFMGR_GEM_H */ diff --git a/libdrm/intel/intel_bufmgr_gem.c b/libdrm/intel/intel_bufmgr_gem.c index cdc2a7a..22f8695 100644 --- a/libdrm/intel/intel_bufmgr_gem.c +++ b/libdrm/intel/intel_bufmgr_gem.c @@ -768,6 +768,81 @@ dri_gem_post_submit(dri_bo *batch_buf) bufmgr_gem->exec_count = 0; } +static int +dri_gem_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; + struct drm_i915_gem_pin pin; + int ret; + + pin.handle = bo_gem->gem_handle; + pin.alignment = alignment; + + ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_PIN, &pin); + if (ret != 0) + return -errno; + + bo->offset = pin.offset; + return 0; +} + +static int +dri_gem_unpin(dri_bo *bo) +{ + dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)bo->bufmgr; + dri_bo_gem *bo_gem = (dri_bo_gem *)bo; + struct drm_i915_gem_unpin unpin; + int ret; + + unpin.handle = bo_gem->gem_handle; + + ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_UNPIN, &unpin); + if (ret != 0) + return -errno; + + return 0; +} + +static int +dri_gem_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; + struct drm_i915_gem_set_tiling set_tiling; + int ret; + + set_tiling.handle = bo_gem->gem_handle; + set_tiling.tiling_mode = *tiling_mode; + + ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_SET_TILING, &set_tiling); + if (ret != 0) { + *tiling_mode = I915_TILING_NONE; + return -errno; + } + + *tiling_mode = set_tiling.tiling_mode; + return 0; +} + +static int +dri_gem_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; + struct drm_gem_flink flink; + int ret; + + flink.handle = bo_gem->gem_handle; + + ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_GEM_FLINK, &flink); + if (ret != 0) + return -errno; + + *name = flink.name; + return 0; +} + /** * Enables unlimited caching of buffer objects for reuse. * @@ -832,6 +907,10 @@ intel_bufmgr_gem_init(int fd, int batch_size) 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; @@ -851,3 +930,55 @@ intel_bo_emit_reloc(dri_bo *reloc_buf, 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; +} + commit 4585787bd1a1d782b9e7c06095f98d09165b8c23 Author: Dave Airlie <ai...@li...> Date: Fri Aug 1 07:43:58 2008 +1000 Revert "i915: Move all of the irq install/uninstall to load time." This reverts commit 965a72202b439068e62ac341990f51953457b202. Please re-do over properly diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 47f1f46..852b243 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -1010,7 +1010,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) { struct drm_i915_private *dev_priv; unsigned long base, size; - int ret = 0, num_pipes = 2, mmio_bar = IS_I9XX(dev) ? 0 : 1; + int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1; /* i915 has 4 more counters */ dev->counters += 4; @@ -1043,57 +1043,12 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) #endif #endif - I915_WRITE16(HWSTAM, 0xeffe); - I915_WRITE16(IMR, 0x0); - I915_WRITE16(IER, 0x0); - - 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_enable_reg = 0; - - ret = drm_vblank_init(dev, num_pipes); - if (ret) - return ret; - - dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; - dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ - - i915_enable_interrupt(dev); - DRM_INIT_WAITQUEUE(&dev_priv->irq_queue); - - /* - * Initialize the hardware status page IRQ location. - */ - - I915_WRITE(INSTPM, (1 << 5) | (1 << 21)); - return ret; } int i915_driver_unload(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; - u32 temp; - - if (dev_priv) { - dev_priv->vblank_pipe = 0; - - dev_priv->irq_enabled = 0; - I915_WRITE(HWSTAM, 0xffffffff); - I915_WRITE(IMR, 0xffffffff); - I915_WRITE(IER, 0x0); - - temp = I915_READ(PIPEASTAT); - I915_WRITE(PIPEASTAT, temp); - temp = I915_READ(PIPEBSTAT); - I915_WRITE(PIPEBSTAT, temp); - temp = I915_READ(IIR); - I915_WRITE(IIR, temp); - } if (dev_priv->mmio_map) drm_rmmap(dev, dev_priv->mmio_map); diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h index a77fcf0..421572c 100644 --- a/shared-core/i915_drv.h +++ b/shared-core/i915_drv.h @@ -307,7 +307,6 @@ extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); extern void i915_driver_irq_preinstall(struct drm_device * dev); extern int i915_driver_irq_postinstall(struct drm_device * dev); extern void i915_driver_irq_uninstall(struct drm_device * dev); -extern void i915_enable_interrupt(struct drm_device *dev); extern int i915_vblank_pipe_set(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int i915_vblank_pipe_get(struct drm_device *dev, void *data, diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index d507d76..ae4081f 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -672,7 +672,7 @@ void i915_disable_vblank(struct drm_device *dev, int plane) } } -void i915_enable_interrupt (struct drm_device *dev) +static void i915_enable_interrupt (struct drm_device *dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; @@ -882,15 +882,63 @@ int i915_vblank_swap(struct drm_device *dev, void *data, */ void i915_driver_irq_preinstall(struct drm_device * dev) { - return; + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + + I915_WRITE16(HWSTAM, 0xeffe); + I915_WRITE16(IMR, 0x0); + I915_WRITE16(IER, 0x0); } 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_enable_reg = 0; + + ret = drm_vblank_init(dev, num_pipes); + if (ret) + return ret; + + dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; + dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ + + i915_enable_interrupt(dev); + DRM_INIT_WAITQUEUE(&dev_priv->irq_queue); + + /* + * Initialize the hardware status page IRQ location. + */ + + I915_WRITE(INSTPM, (1 << 5) | (1 << 21)); return 0; } void i915_driver_irq_uninstall(struct drm_device * dev) { - return; + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + u32 temp; + + if (!dev_priv) + return; + + dev_priv->vblank_pipe = 0; + + dev_priv->irq_enabled = 0; + I915_WRITE(HWSTAM, 0xffffffff); + I915_WRITE(IMR, 0xffffffff); + I915_WRITE(IER, 0x0); + + temp = I915_READ(PIPEASTAT); + I915_WRITE(PIPEASTAT, temp); + temp = I915_READ(PIPEBSTAT); + I915_WRITE(PIPEBSTAT, temp); + temp = I915_READ(IIR); + I915_WRITE(IIR, temp); } commit 10d5b037b85706037df89bf0275436797e4eb559 Author: Dave Airlie <ai...@re...> Date: Thu Jul 31 13:12:36 2008 +1000 drm: add fault handler support so as to be more like possible upstream diff --git a/linux-core/drm_compat.c b/linux-core/drm_compat.c index 3d082e7..c4ebc2f 100644 --- a/linux-core/drm_compat.c +++ b/linux-core/drm_compat.c @@ -759,3 +759,102 @@ EXPORT_SYMBOL(kmap_atomic_prot_pfn); #endif +#ifdef DRM_FULL_MM_COMPAT +#ifdef DRM_NO_FAULT +unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, + unsigned long address) +{ + struct drm_buffer_object *bo = (struct drm_buffer_object *) vma->vm_private_data; + unsigned long page_offset; + struct page *page = NULL; + struct drm_ttm *ttm; + struct drm_device *dev; + unsigned long pfn; + int err; + unsigned long bus_base; + unsigned long bus_offset; + unsigned long bus_size; + unsigned long ret = NOPFN_REFAULT; + + if (address > vma->vm_end) + return NOPFN_SIGBUS; + + dev = bo->dev; + err = drm_bo_read_lock(&dev->bm.bm_lock, 1); + if (err) + return NOPFN_REFAULT; + + err = mutex_lock_interruptible(&bo->mutex); + if (err) { + drm_bo_read_unlock(&dev->bm.bm_lock); + return NOPFN_REFAULT; + } + + err = drm_bo_wait(bo, 0, 1, 0, 1); + if (err) { + ret = (err != -EAGAIN) ? NOPFN_SIGBUS : NOPFN_REFAULT; + bo->priv_flags &= ~_DRM_BO_FLAG_UNLOCKED; + goto out_unlock; + } + + bo->priv_flags &= ~_DRM_BO_FLAG_UNLOCKED; + + /* + * If buffer happens to be in a non-mappable location, + * move it to a mappable. + */ + + if (!(bo->mem.flags & DRM_BO_FLAG_MAPPABLE)) { + uint32_t new_flags = bo->mem.proposed_flags | + DRM_BO_FLAG_MAPPABLE | + DRM_BO_FLAG_FORCE_MAPPABLE; + err = drm_bo_move_buffer(bo, new_flags, 0, 0); + if (err) { + ret = (err != -EAGAIN) ? NOPFN_SIGBUS : NOPFN_REFAULT; + goto out_unlock; + } + } + + err = drm_bo_pci_offset(dev, &bo->mem, &bus_base, &bus_offset, + &bus_size); + + if (err) { + ret = NOPFN_SIGBUS; + goto out_unlock; + } + + page_offset = (address - vma->vm_start) >> PAGE_SHIFT; + + if (bus_size) { + struct drm_mem_type_manager *man = &dev->bm.man[bo->mem.mem_type]; + + pfn = ((bus_base + bus_offset) >> PAGE_SHIFT) + page_offset; + vma->vm_page_prot = drm_io_prot(man->drm_bus_maptype, vma); + } else { + ttm = bo->ttm; + + drm_ttm_fixup_caching(ttm); + page = drm_ttm_get_page(ttm, page_offset); + if (!page) { + ret = NOPFN_OOM; + goto out_unlock; + } + pfn = page_to_pfn(page); + vma->vm_page_prot = (bo->mem.flags & DRM_BO_FLAG_CACHED) ? + vm_get_page_prot(vma->vm_flags) : + drm_io_prot(_DRM_TTM, vma); + } + + err = vm_insert_pfn(vma, address, pfn); + if (err) { + ret = (err != -EAGAIN) ? NOPFN_OOM : NOPFN_REFAULT; + goto out_unlock; + } +out_unlock: + BUG_ON(bo->priv_flags & _DRM_BO_FLAG_UNLOCKED); + mutex_unlock(&bo->mutex); + drm_bo_read_unlock(&dev->bm.bm_lock); + return ret; +} +#endif +#endif diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h index 3339219..efeee83 100644 --- a/linux-core/drm_compat.h +++ b/linux-core/drm_compat.h @@ -312,6 +312,9 @@ extern int drm_bo_map_bound(struct vm_area_struct *vma); /* fixme when functions are upstreamed - upstreamed for 2.6.23 */ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) #define DRM_IDR_COMPAT_FN +#define DRM_NO_FAULT +extern unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, + unsigned long address); #endif #ifdef DRM_IDR_COMPAT_FN int idr_for_each(struct idr *idp, diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 6618c0a..0d5242d 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -685,8 +685,8 @@ EXPORT_SYMBOL(drm_mmap); * \c Pagefault method for buffer objects. * * \param vma Virtual memory area. - * \param address File offset. - * \return Error or refault. The pfn is manually inserted. + * \param vmf vm fault data + * \return Error or VM_FAULT_NOPAGE:. The pfn is manually inserted. * * It's important that pfns are inserted while holding the bo->mutex lock. * otherwise we might race with unmap_mapping_range() which is always @@ -699,8 +699,8 @@ EXPORT_SYMBOL(drm_mmap); */ #ifdef DRM_FULL_MM_COMPAT -static unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, - unsigned long address) +static int drm_bo_vm_fault(struct vm_area_struct *vma, + struct vm_fault *vmf) { struct drm_buffer_object *bo = (struct drm_buffer_object *) vma->vm_private_data; unsigned long page_offset; @@ -712,25 +712,22 @@ static unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, unsigned long bus_base; unsigned long bus_offset; unsigned long bus_size; - unsigned long ret = NOPFN_REFAULT; - - if (address > vma->vm_end) - return NOPFN_SIGBUS; + unsigned long ret = VM_FAULT_NOPAGE; dev = bo->dev; err = drm_bo_read_lock(&dev->bm.bm_lock, 1); if (err) - return NOPFN_REFAULT; + return VM_FAULT_NOPAGE; err = mutex_lock_interruptible(&bo->mutex); if (err) { drm_bo_read_unlock(&dev->bm.bm_lock); - return NOPFN_REFAULT; + return VM_FAULT_NOPAGE; } err = drm_bo_wait(bo, 0, 1, 0, 1); if (err) { - ret = (err != -EAGAIN) ? NOPFN_SIGBUS : NOPFN_REFAULT; + ret = (err != -EAGAIN) ? VM_FAULT_SIGBUS : VM_FAULT_NOPAGE; bo->priv_flags &= ~_DRM_BO_FLAG_UNLOCKED; goto out_unlock; } @@ -748,7 +745,7 @@ static unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, DRM_BO_FLAG_FORCE_MAPPABLE; err = drm_bo_move_buffer(bo, new_flags, 0, 0); if (err) { - ret = (err != -EAGAIN) ? NOPFN_SIGBUS : NOPFN_REFAULT; + ret = (err != -EAGAIN) ? VM_FAULT_SIGBUS : VM_FAULT_NOPAGE; goto out_unlock; } } @@ -757,11 +754,11 @@ static unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, &bus_size); if (err) { - ret = NOPFN_SIGBUS; + ret = VM_FAULT_SIGBUS; goto out_unlock; } - page_offset = (address - vma->vm_start) >> PAGE_SHIFT; + page_offset = ((unsigned long)vmf->virtual_address - vma->vm_start) >> PAGE_SHIFT; if (bus_size) { struct drm_mem_type_manager *man = &dev->bm.man[bo->mem.mem_type]; @@ -774,7 +771,7 @@ static unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, drm_ttm_fixup_caching(ttm); page = drm_ttm_get_page(ttm, page_offset); if (!page) { - ret = NOPFN_OOM; + ret = VM_FAULT_OOM; goto out_unlock; } pfn = page_to_pfn(page); @@ -783,9 +780,9 @@ static unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, drm_io_prot(_DRM_TTM, vma); } - err = vm_insert_pfn(vma, address, pfn); + err = vm_insert_pfn(vma, (unsigned long)vmf->virtual_address, pfn); if (err) { - ret = (err != -EAGAIN) ? NOPFN_OOM : NOPFN_REFAULT; + ret = (err != -EAGAIN) ? VM_FAULT_OOM : VM_FAULT_NOPAGE; goto out_unlock; } out_unlock: @@ -849,8 +846,12 @@ static void drm_bo_vm_close(struct vm_area_struct *vma) static struct vm_operations_struct drm_bo_vm_ops = { #ifdef DRM_FULL_MM_COMPAT +#ifdef DRM_NO_FAULT .nopfn = drm_bo_vm_nopfn, #else + .fault = drm_bo_vm_fault, +#endif +#else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) .nopfn = drm_bo_vm_nopfn, #else |
From: <dar...@ke...> - 2009-02-09 23:28:20
|
linux-core/drm_compat.h | 6 linux-core/drm_fops.c | 2 shared-core/nouveau_fifo.c | 5 shared-core/nouveau_state.c | 13 shared-core/nv50_fifo.c | 2 shared-core/nv50_graph.c | 35 shared-core/nv50_grctx.h | 2043 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 2074 insertions(+), 32 deletions(-) New commits: commit 13d7b06bafcc1b72198747f9873361ba98ae23d2 Author: Ben Skeggs <sk...@gm...> Date: Tue Feb 10 09:05:09 2009 +1000 drm/nv50: use a slightly different initial context for nv96 I'm not 100% sure that the nv94 one we were using won't work. The context layouts are identical (well.. same ctxprog, so of course!), only a couple of registers differ. But, be safe until we actually get some 9xxx chips working. diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index 85c9c74..fef6efb 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -198,9 +198,11 @@ nv50_graph_create_context(struct nouveau_channel *chan) ctxvals = nv92_ctxvals; break; case 0x94: - case 0x96: ctxvals = nv94_ctxvals; break; + case 0x96: + ctxvals = nv96_ctxvals; + break; case 0xaa: ctxvals = nvaa_ctxvals; break; diff --git a/shared-core/nv50_grctx.h b/shared-core/nv50_grctx.h index ef66608..245235f 100644 --- a/shared-core/nv50_grctx.h +++ b/shared-core/nv50_grctx.h @@ -11509,4 +11509,2047 @@ static unsigned nv94_ctxvals[] = { 0x0001, 0x00000001, 0x0000 }; + +static unsigned nv96_ctxvals[] = { + 0x0043, 0x00000000, + 0x0001, 0x00000030, + 0x0008, 0x00000000, + 0x0001, 0x00000002, + 0x0028, 0x00000000, + 0x0001, 0x00000003, + 0x0001, 0x00001000, + 0x000f, 0x00000000, + 0x0001, 0x0000fe0c, + 0x0004, 0x00000000, + 0x0001, 0x00001000, + 0x000a, 0x00000000, + 0x0001, 0x00000187, + 0x0004, 0x00000000, + 0x0001, 0x00001018, + 0x0001, 0x000000ff, + 0x000e, 0x00000000, + 0x0001, 0x00000004, + 0x0001, 0x042500df, + 0x0001, 0x00000000, + 0x0001, 0x00000600, + 0x0005, 0x00000000, + 0x0001, 0x01000000, + 0x0001, 0x000000ff, + 0x0001, 0x00000000, + 0x0001, 0x00000400, + 0x0005, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000080, + 0x0001, 0x00000004, + 0x0006, 0x00000000, + 0x0001, 0x00000002, + 0x0001, 0x00000001, + 0x0003, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000100, + 0x0005, 0x00000000, + 0x0001, 0x00000002, + 0x0002, 0x00000001, + 0x0003, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x003fffff, + 0x0001, 0x00001fff, + 0x0001, 0x00000000, + 0x0002, 0x00000001, + 0x0001, 0x00000000, + 0x0003, 0x00000001, + 0x0001, 0x00000004, + 0x0003, 0x00000001, + 0x0001, 0x00000007, + 0x0001, 0x00000001, + 0x0001, 0x00000007, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000100, + 0x0001, 0x00000000, + 0x0001, 0x00000001, + 0x0002, 0x00000000, + 0x0001, 0x00000100, + 0x0001, 0x00000001, + 0x0001, 0x00000100, + 0x0001, 0x00000000, + 0x0001, 0x00000001, + 0x0002, 0x00000000, + 0x0001, 0x00000100, + 0x0004, 0x00000000, + 0x0001, 0x00000004, + 0x0001, 0x00000070, + 0x0001, 0x00000080, + 0x0004, 0x00000000, + 0x0001, 0x0000000c, + 0x0001, 0x00000000, + 0x0001, 0x00000008, + 0x0001, 0x00000014, + 0x0001, 0x00000000, + 0x0001, 0x00000029, + 0x0001, 0x00000027, + 0x0001, 0x00000026, + 0x0001, 0x00000008, + 0x0001, 0x00000004, + 0x0001, 0x00000027, + 0x0002, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000002, + 0x0001, 0x00000003, + 0x0001, 0x00000004, + 0x0001, 0x00000005, + 0x0001, 0x00000006, + 0x0001, 0x00000007, + 0x0001, 0x00000001, + 0x0010, 0x00000000, + 0x0001, 0x000000cf, + 0x000b, 0x00000000, + 0x0001, 0x00000080, + 0x0002, 0x00000004, + 0x0001, 0x00000003, + 0x0001, 0x00000001, + 0x0002, 0x00000000, + 0x0001, 0x00000012, + 0x0001, 0x00000010, + 0x0001, 0x0000000c, + 0x0001, 0x00000001, + 0x0003, 0x00000000, + 0x0001, 0x00000004, + 0x0001, 0x00000002, + 0x0001, 0x00000004, + 0x0002, 0x00000000, + 0x0001, 0x003fffff, + 0x0001, 0x00001fff, + 0x0009, 0x00000000, + 0x0001, 0x00000004, + 0x0001, 0x00000014, + 0x0001, 0x00000001, + 0x0002, 0x00000000, + 0x0001, 0x00000002, + 0x0002, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000000, + 0x0001, 0x00000002, + 0x0001, 0x00001000, + 0x0001, 0x00000e00, + 0x0001, 0x00001000, + 0x0001, 0x00001e00, + 0x0001, 0x00000000, + 0x0005, 0x00000001, + 0x0003, 0x00000000, + 0x0001, 0x00000200, + 0x0001, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000070, + 0x0001, 0x00000080, + 0x0002, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000070, + 0x0001, 0x00000080, + 0x0003, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x000000cf, + 0x0001, 0x00000000, + 0x0001, 0x00000001, + 0x0003, 0x00000000, + 0x0001, 0x000000cf, + 0x0001, 0x00000000, + 0x0001, 0x00000002, + 0x0001, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000000, + 0x0002, 0x000000cf, + 0x0001, 0x00000001, + 0x0001, 0x00000000, + 0x0001, 0x00001f80, + 0x0005, 0x00000000, + 0x0001, 0x3b74f821, + 0x0001, 0x89058001, + 0x0001, 0x00000000, + 0x0001, 0x00001000, + 0x0001, 0x0000001f, + 0x0001, 0x027c10fa, + 0x0001, 0x400000c0, + 0x0001, 0xb7892080, + 0x0002, 0x00000000, + 0x0001, 0x3b74f821, + 0x0001, 0x89058001, + 0x0001, 0x00000000, + 0x0001, 0x00001000, + 0x0001, 0x0000001f, + 0x0001, 0x027c10fa, + 0x0001, 0x400000c0, + 0x0001, 0xb7892080, + 0x0002, 0x00000000, + 0x0001, 0x3b74f821, + 0x0001, 0x89058001, + 0x0001, 0x00000000, + 0x0001, 0x00001000, + 0x0001, 0x0000001f, + 0x0001, 0x027c10fa, + 0x0001, 0x400000c0, + 0x0001, 0xb7892080, + 0x0002, 0x00000000, + 0x0001, 0x3b74f821, + 0x0001, 0x89058001, + 0x0001, 0x00000000, + 0x0001, 0x00001000, + 0x0001, 0x0000001f, + 0x0001, 0x027c10fa, + 0x0001, 0x400000c0, + 0x0001, 0xb7892080, + 0x0002, 0x00000000, + 0x0001, 0x00390040, + 0x0001, 0x00000000, + 0x0001, 0x00000022, + 0x0002, 0x00000000, + 0x0001, 0x00390040, + 0x0001, 0x00000022, + 0x0005, 0x00000000, + 0x0001, 0x01800000, + 0x0001, 0x00160000, + 0x0001, 0x01800000, + 0x0003, 0x00000000, + 0x0001, 0x0003ffff, + 0x0001, 0x118c0000, + 0x0008, 0x00000000, + 0x0001, 0x00010401, + 0x0001, 0x00000000, + 0x0001, 0x00000078, + 0x0001, 0x00000000, + 0x0001, 0x000000bf, + 0x0001, 0x00000000, + 0x0001, 0x00001210, + 0x0001, 0x08000080, + 0x0008, 0x00000000, + 0x0001, 0x01800000, + 0x0001, 0x00160000, + 0x0001, 0x01800000, + 0x0003, 0x00000000, + 0x0001, 0x0003ffff, + 0x0001, 0x118c0000, + 0x0008, 0x00000000, + 0x0001, 0x00010401, + 0x0001, 0x00000000, + 0x0001, 0x00000078, + 0x0001, 0x00000000, + 0x0001, 0x000000bf, + 0x0001, 0x00000000, + 0x0001, 0x00001210, + 0x0001, 0x08000080, + 0x0009, 0x00000000, + 0x0001, 0x00027070, + 0x0002, 0x00000000, + 0x0001, 0x03ffffff, + 0x0005, 0x00000000, + 0x0001, 0x00120407, + 0x0001, 0x05091507, + 0x0001, 0x05010202, + 0x0001, 0x00030201, + 0x0006, 0x00000000, + 0x0001, 0x00000040, + 0x0001, 0x0d0c0b0a, + 0x0001, 0x00141210, + 0x0001, 0x000001f0, + 0x0001, 0x00000001, + 0x0001, 0x00000003, + 0x0002, 0x00000000, + 0x0001, 0x00039e00, + 0x0001, 0x00000100, + 0x0001, 0x00003800, + 0x0001, 0x00404040, + 0x0001, 0x0000ff0a, + 0x0001, 0x00000000, + 0x0001, 0x0077f005, + 0x0001, 0x003f7fff, + 0x0003, 0x00000000, + 0x0001, 0x01800000, + 0x0001, 0x00160000, + 0x0001, 0x01800000, + 0x0003, 0x00000000, + 0x0001, 0x0003ffff, + 0x0001, 0x118c0000, + 0x0008, 0x00000000, + 0x0001, 0x00010401, + 0x0001, 0x00000000, + 0x0001, 0x00000078, + 0x0001, 0x00000000, + 0x0001, 0x000000bf, + 0x0001, 0x00000000, + 0x0001, 0x00001210, + 0x0001, 0x08000080, + 0x0008, 0x00000000, + 0x0001, 0x01800000, + 0x0001, 0x00160000, + 0x0001, 0x01800000, + 0x0003, 0x00000000, + 0x0001, 0x0003ffff, + 0x0001, 0x118c0000, + 0x0008, 0x00000000, + 0x0001, 0x00010401, + 0x0001, 0x00000000, + 0x0001, 0x00000078, + 0x0001, 0x00000000, + 0x0001, 0x000000bf, + 0x0001, 0x00000000, + 0x0001, 0x00001210, + 0x0001, 0x08000080, + 0x0009, 0x00000000, + 0x0001, 0x00027070, + 0x0002, 0x00000000, + 0x0001, 0x03ffffff, + 0x0005, 0x00000000, + 0x0001, 0x00120407, + 0x0001, 0x05091507, + 0x0001, 0x05010202, + 0x0001, 0x00030201, + 0x0006, 0x00000000, + 0x0001, 0x00000040, + 0x0001, 0x0d0c0b0a, + 0x0001, 0x00141210, + 0x0001, 0x000001f0, + 0x0001, 0x00000001, + 0x0001, 0x00000003, + 0x0002, 0x00000000, + 0x0001, 0x00039e00, + 0x0001, 0x00000100, + 0x0001, 0x00003800, + 0x0001, 0x00404040, + 0x0001, 0x0000ff0a, + 0x0001, 0x00000000, + 0x0001, 0x0077f005, + 0x0001, 0x003f7fff, + 0x0003, 0x00000000, + 0x0001, 0x01800000, + 0x0001, 0x00160000, + 0x0001, 0x01800000, + 0x0003, 0x00000000, + 0x0001, 0x0003ffff, + 0x0001, 0x118c0000, + 0x0008, 0x00000000, + 0x0001, 0x00010401, + 0x0001, 0x00000000, + 0x0001, 0x00000078, + 0x0001, 0x00000000, + 0x0001, 0x000000bf, + 0x0001, 0x00000000, + 0x0001, 0x00001210, + 0x0001, 0x08000080, + 0x0008, 0x00000000, + 0x0001, 0x01800000, + 0x0001, 0x00160000, + 0x0001, 0x01800000, + 0x0003, 0x00000000, + 0x0001, 0x0003ffff, + 0x0001, 0x118c0000, + 0x0008, 0x00000000, + 0x0001, 0x00010401, + 0x0001, 0x00000000, + 0x0001, 0x00000078, + 0x0001, 0x00000000, + 0x0001, 0x000000bf, + 0x0001, 0x00000000, + 0x0001, 0x00001210, + 0x0001, 0x08000080, + 0x0009, 0x00000000, + 0x0001, 0x00027070, + 0x0002, 0x00000000, + 0x0001, 0x03ffffff, + 0x0005, 0x00000000, + 0x0001, 0x00120407, + 0x0001, 0x05091507, + 0x0001, 0x05010202, + 0x0001, 0x00030201, + 0x0006, 0x00000000, + 0x0001, 0x00000040, + 0x0001, 0x0d0c0b0a, + 0x0001, 0x00141210, + 0x0001, 0x000001f0, + 0x0001, 0x00000001, + 0x0001, 0x00000003, + 0x0002, 0x00000000, + 0x0001, 0x00039e00, + 0x0001, 0x00000100, + 0x0001, 0x00003800, + 0x0001, 0x00404040, + 0x0001, 0x0000ff0a, + 0x0001, 0x00000000, + 0x0001, 0x0077f005, + 0x0001, 0x003f7fff, + 0x0003, 0x00000000, + 0x0001, 0x01800000, + 0x0001, 0x00160000, + 0x0001, 0x01800000, + 0x0003, 0x00000000, + 0x0001, 0x0003ffff, + 0x0001, 0x118c0000, + 0x0008, 0x00000000, + 0x0001, 0x00010401, + 0x0001, 0x00000000, + 0x0001, 0x00000078, + 0x0001, 0x00000000, + 0x0001, 0x000000bf, + 0x0001, 0x00000000, + 0x0001, 0x00001210, + 0x0001, 0x08000080, + 0x0008, 0x00000000, + 0x0001, 0x01800000, + 0x0001, 0x00160000, + 0x0001, 0x01800000, + 0x0003, 0x00000000, + 0x0001, 0x0003ffff, + 0x0001, 0x118c0000, + 0x0008, 0x00000000, + 0x0001, 0x00010401, + 0x0001, 0x00000000, + 0x0001, 0x00000078, + 0x0001, 0x00000000, + 0x0001, 0x000000bf, + 0x0001, 0x00000000, + 0x0001, 0x00001210, + 0x0001, 0x08000080, + 0x0009, 0x00000000, + 0x0001, 0x00027070, + 0x0002, 0x00000000, + 0x0001, 0x03ffffff, + 0x0005, 0x00000000, + 0x0001, 0x00120407, + 0x0001, 0x05091507, + 0x0001, 0x05010202, + 0x0001, 0x00030201, + 0x0006, 0x00000000, + 0x0001, 0x00000040, + 0x0001, 0x0d0c0b0a, + 0x0001, 0x00141210, + 0x0001, 0x000001f0, + 0x0001, 0x00000001, + 0x0001, 0x00000003, + 0x0002, 0x00000000, + 0x0001, 0x00039e00, + 0x0001, 0x00000100, + 0x0001, 0x00003800, + 0x0001, 0x00404040, + 0x0001, 0x0000ff0a, + 0x0001, 0x00000000, + 0x0001, 0x0077f005, + 0x0001, 0x003f7fff, + 0x0029, 0x00000000, + 0x0002, 0x00000004, + 0x0013, 0x00000000, + 0x0001, 0x0000000f, + 0x0021, 0x00000000, + 0x0001, 0x00000002, + 0x0005, 0x00000000, + 0x0001, 0x00000020, + 0x0009, 0x00000000, + 0x0001, 0x001ffe67, + 0x0067, 0x00000000, + 0x0001, 0x00000001, + 0x0002, 0x00000004, + 0x0003, 0x00000000, + 0x0001, 0x0000001a, + 0x0001, 0x00000000, + 0x0001, 0x00000010, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00608080, + 0x000d, 0x00000000, + 0x0001, 0x00000001, + 0x0018, 0x00000000, + 0x0002, 0x00000004, + 0x0016, 0x00000000, + 0x0002, 0x00000004, + 0x0005, 0x00000000, + 0x0001, 0x00000002, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00000080, + 0x0006, 0x00000000, + 0x0002, 0x00000004, + 0x000b, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x000f, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000008, + 0x0009, 0x00000000, + 0x0001, 0x00000001, + 0x0005, 0x00000000, + 0x0001, 0x000007ff, + 0x0001, 0x00000000, + 0x0001, 0x00000010, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x0055, 0x00000000, + 0x0001, 0x0000000f, + 0x0049, 0x00000000, + 0x0001, 0x00000010, + 0x0038, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00000080, + 0x0006, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x03020100, + 0x0006, 0x00000000, + 0x0002, 0x00000003, + 0x0006, 0x00000000, + 0x0002, 0x00000004, + 0x0025, 0x00000000, + 0x0001, 0x3f800000, + 0x0002, 0x00000004, + 0x0005, 0x00000000, + 0x0001, 0x3f800000, + 0x0002, 0x00000003, + 0x0005, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0002, 0x00000004, + 0x0005, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x00cf, 0x00000000, + 0x0001, 0x00000010, + 0x000f, 0x00000000, + 0x0001, 0x0000003f, + 0x0037, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x0067, 0x00000000, + 0x0001, 0x00000011, + 0x003f, 0x00000000, + 0x0001, 0x0000000f, + 0x003f, 0x00000000, + 0x0001, 0x00000011, + 0x0037, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x001ffe67, + 0x000f, 0x00000000, + 0x0001, 0x0fac6881, + 0x00af, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x001f, 0x00000000, + 0x0001, 0x00000011, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x031f, 0x00000000, + 0x0001, 0x00000002, + 0x000f, 0x00000000, + 0x0001, 0x001ffe67, + 0x0067, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000010, + 0x0017, 0x00000000, + 0x0001, 0x00000001, + 0x0037, 0x00000000, + 0x0001, 0x00000002, + 0x0047, 0x00000000, + 0x0001, 0x00000001, + 0x0005, 0x00000000, + 0x0001, 0x0000000f, + 0x0001, 0x00000000, + 0x0001, 0x00000010, + 0x000d, 0x00000000, + 0x0001, 0x00000001, + 0x0001, 0x00000000, + 0x0001, 0x00000001, + 0x009f, 0x00000000, + 0x0001, 0x00000010, + 0x0087, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x00cf, 0x00000000, + 0x0001, 0x00000010, + 0x000f, 0x00000000, + 0x0001, 0x0000003f, + 0x0037, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x000d, 0x00000000, + 0x0001, 0x0000000f, + 0x0001, 0x00000000, + 0x0001, 0x00000001, + 0x0067, 0x00000000, + 0x0001, 0x00000011, + 0x003f, 0x00000000, + 0x0001, 0x0000000f, + 0x003f, 0x00000000, + 0x0001, 0x00000011, + 0x0037, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x001ffe67, + 0x000f, 0x00000000, + 0x0001, 0x0fac6881, + 0x00af, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x001f, 0x00000000, + 0x0001, 0x00000011, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x031f, 0x00000000, + 0x0001, 0x00000002, + 0x000f, 0x00000000, + 0x0001, 0x001ffe67, + 0x0067, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000010, + 0x0017, 0x00000000, + 0x0001, 0x00000001, + 0x0037, 0x00000000, + 0x0001, 0x00000002, + 0x0047, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000010, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x009f, 0x00000000, + 0x0001, 0x00000010, + 0x0087, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x00cf, 0x00000000, + 0x0001, 0x00000010, + 0x000f, 0x00000000, + 0x0001, 0x0000003f, + 0x0037, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x0067, 0x00000000, + 0x0001, 0x00000011, + 0x003f, 0x00000000, + 0x0001, 0x0000000f, + 0x003f, 0x00000000, + 0x0001, 0x00000011, + 0x0037, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x001ffe67, + 0x000f, 0x00000000, + 0x0001, 0x0fac6881, + 0x00af, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x001f, 0x00000000, + 0x0001, 0x00000011, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0244, 0x00000000, + 0x0001, 0x00000021, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000100, + 0x0007, 0x00000000, + 0x0001, 0x00000100, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0017, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000100, + 0x0007, 0x00000000, + 0x0001, 0x00000100, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x007a, 0x00000000, + 0x0001, 0x00000002, + 0x000f, 0x00000000, + 0x0001, 0x001ffe67, + 0x0067, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000010, + 0x0017, 0x00000000, + 0x0001, 0x00000001, + 0x0037, 0x00000000, + 0x0001, 0x00000002, + 0x0047, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000010, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x009f, 0x00000000, + 0x0001, 0x00000010, + 0x0087, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x00cf, 0x00000000, + 0x0001, 0x00000010, + 0x000f, 0x00000000, + 0x0001, 0x0000003f, + 0x0037, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x0067, 0x00000000, + 0x0001, 0x00000011, + 0x003f, 0x00000000, + 0x0001, 0x0000000f, + 0x003f, 0x00000000, + 0x0001, 0x00000011, + 0x0037, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x001ffe67, + 0x000f, 0x00000000, + 0x0001, 0x0fac6881, + 0x00af, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x001f, 0x00000000, + 0x0001, 0x00000011, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x2bed, 0x00000000, + 0x0001, 0x0000000f, + 0x00a7, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000100, + 0x0007, 0x00000000, + 0x0001, 0x00000100, + 0x0007, 0x00000000, + 0x0001, 0x00000011, + 0x000f, 0x00000000, + 0x0001, 0x00000008, + 0x002f, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x000000cf, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0037, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0027, 0x00000000, + 0x0001, 0x00000004, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000015, + 0x001f, 0x00000000, + 0x0001, 0x04444480, + 0x01df, 0x00000000, + 0x0001, 0x08100c12, + 0x0027, 0x00000000, + 0x0001, 0x00000100, + 0x0017, 0x00000000, + 0x0001, 0x00010001, + 0x000f, 0x00000000, + 0x0001, 0x00010001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00010001, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000002, + 0x0010, 0x00000000, + 0x0001, 0x003fffff, + 0x0017, 0x00000000, + 0x0001, 0x00001fff, + 0x0077, 0x00000000, + 0x0001, 0x3f800000, + 0x0037, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x0000001a, + 0x0017, 0x00000000, + 0x0001, 0x00000001, + 0x0097, 0x00000000, + 0x0001, 0x00ffff00, + 0x0037, 0x00000000, + 0x0001, 0x0000000f, + 0x003f, 0x00000000, + 0x0001, 0x0fac6881, + 0x0007, 0x00000000, + 0x0001, 0x00000011, + 0x007f, 0x00000000, + 0x0001, 0x00000004, + 0x0027, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x001f, 0x00000000, + 0x0001, 0x00000005, + 0x0007, 0x00000000, + 0x0001, 0x00000052, + 0x0027, 0x00000000, + 0x0001, 0x00000001, + 0x0087, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x00000010, + 0x0137, 0x00000000, + 0x0001, 0x08100c12, + 0x0006, 0x00000000, + 0x0001, 0x04e3bfdf, + 0x0001, 0x00000005, + 0x0006, 0x00000000, + 0x0001, 0x04e3bfdf, + 0x0010, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x0000ffff, + 0x0006, 0x00000000, + 0x0001, 0x0fac6881, + 0x0001, 0x0000ffff, + 0x0007, 0x00000000, + 0x0001, 0x0000ffff, + 0x0007, 0x00000000, + 0x0001, 0x0000ffff, + 0x0007, 0x00000000, + 0x0001, 0x00000003, + 0x0046, 0x00000000, + 0x0001, 0x04e3bfdf, + 0x0007, 0x00000000, + 0x0001, 0x04e3bfdf, + 0x00b0, 0x00000000, + 0x0001, 0x00ffff00, + 0x0007, 0x00000000, + 0x0001, 0x0000001a, + 0x000f, 0x00000000, + 0x0001, 0x00000003, + 0x0137, 0x00000000, + 0x0001, 0x00000102, + 0x000f, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x000f, 0x00000000, + 0x0001, 0x000007ff, + 0x000f, 0x00000000, + 0x0001, 0x00000102, + 0x004f, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x018f, 0x00000000, + 0x0001, 0x00080c14, + 0x0017, 0x00000000, + 0x0001, 0x00000804, + 0x000f, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x08100c12, + 0x000f, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x000f, 0x00000000, + 0x0001, 0x00000010, + 0x0027, 0x00000000, + 0x0001, 0x00000804, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x0000001a, + 0x0007, 0x00000000, + 0x0001, 0x0000007f, + 0x000f, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00080c14, + 0x000f, 0x00000000, + 0x0001, 0x08100c12, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x000f, 0x00000000, + 0x0001, 0x00000010, + 0x001f, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x08100c12, + 0x0037, 0x00000000, + 0x0001, 0x000007ff, + 0x0007, 0x00000000, + 0x0001, 0x00080c14, + 0x01c7, 0x00000000, + 0x0001, 0x00000001, + 0x0017, 0x00000000, + 0x0001, 0x00000010, + 0x01c7, 0x00000000, + 0x0001, 0x00000088, + 0x0007, 0x00000000, + 0x0001, 0x00000088, + 0x0017, 0x00000000, + 0x0001, 0x00000004, + 0x00b7, 0x00000000, + 0x0001, 0x00000026, + 0x0017, 0x00000000, + 0x0001, 0x3f800000, + 0x001f, 0x00000000, + 0x0001, 0x0000001a, + 0x0007, 0x00000000, + 0x0001, 0x00000010, + 0x0147, 0x00000000, + 0x0001, 0x00000052, + 0x000f, 0x00000000, + 0x0001, 0x00000026, + 0x000f, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x000f, 0x00000000, + 0x0001, 0x0000001a, + 0x0017, 0x00000000, + 0x0001, 0x00ffff00, + 0x000f, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x000f, 0x00000000, + 0x0001, 0x00000080, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00080c14, + 0x000f, 0x00000000, + 0x0001, 0x000007ff, + 0x02e5, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x1af3, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00000003, + 0x008e, 0x00000000, + 0x0002, 0x0000000f, + 0x005e, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x0000ffff, + 0x0006, 0x00000000, + 0x0002, 0x0000ffff, + 0x0006, 0x00000000, + 0x0002, 0x0000ffff, + 0x0006, 0x00000000, + 0x0002, 0x0000ffff, + 0x0046, 0x00000000, + 0x0002, 0x00000001, + 0x001e, 0x00000000, + 0x0002, 0x00000001, + 0x002e, 0x00000000, + 0x0002, 0x00000001, + 0x0066, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x0016, 0x00000000, + 0x0002, 0x00000004, + 0x001e, 0x00000000, + 0x0002, 0x00000011, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x000000cf, + 0x0006, 0x00000000, + 0x0002, 0x000000cf, + 0x0006, 0x00000000, + 0x0002, 0x000000cf, + 0x0056, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x0006, 0x00000000, + 0x0002, 0x0000000f, + 0x003e, 0x00000000, + 0x0002, 0x001ffe67, + 0x0016, 0x00000000, + 0x0002, 0x00000011, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x001e, 0x00000000, + 0x0002, 0x00000004, + 0x002e, 0x00000000, + 0x0002, 0x00000001, + 0x0026, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x001e, 0x00000000, + 0x0002, 0x00000011, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x000007ff, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0156, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x0000000f, + 0x003e, 0x00000000, + 0x0002, 0x00000020, + 0x0006, 0x00000000, + 0x0002, 0x00000011, + 0x0006, 0x00000000, + 0x0002, 0x00000100, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0016, 0x00000000, + 0x0002, 0x00000040, + 0x0006, 0x00000000, + 0x0002, 0x00000100, + 0x000e, 0x00000000, + 0x0002, 0x00000003, + 0x0026, 0x00000000, + 0x0002, 0x001ffe67, + 0x001e, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x0fac6881, + 0x004e, 0x00000000, + 0x0002, 0x00000001, + 0x0026, 0x00000000, + 0x0002, 0x00000004, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00001001, + 0x001e, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x0006, 0x00000000, + 0x0002, 0x0000000f, + 0x00be, 0x00000000, + 0x0002, 0x001ffe67, + 0x001e, 0x00000000, + 0x0002, 0x00000011, + 0x0016, 0x00000000, + 0x0002, 0x00000004, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x001e, 0x00000000, + 0x0002, 0x00000001, + 0x0026, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x001e, 0x00000000, + 0x0002, 0x2a712488, + 0x000e, 0x00000000, + 0x0002, 0x4085c000, + 0x0006, 0x00000000, + 0x0002, 0x00000040, + 0x0006, 0x00000000, + 0x0002, 0x00000100, + 0x0006, 0x00000000, + 0x0002, 0x00010100, + 0x0006, 0x00000000, + 0x0002, 0x02800000, + 0x0096, 0x00000000, + 0x0002, 0x04e3bfdf, + 0x0006, 0x00000000, + 0x0002, 0x04e3bfdf, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00ffff00, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0016, 0x00000000, + 0x0002, 0x00ffff00, + 0x0046, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x30201000, + 0x0006, 0x00000000, + 0x0002, 0x70605040, + 0x0006, 0x00000000, + 0x0002, 0xb8a89888, + 0x0006, 0x00000000, + 0x0002, 0xf8e8d8c8, + 0x000e, 0x00000000, + 0x0002, 0x0000001a, + 0x000e, 0x00000000, + 0x0002, 0x00000004, + 0x00ae, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00608080, + 0x0026, 0x00000000, + 0x0002, 0x00000004, + 0x0016, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00000080, + 0x0006, 0x00000000, + 0x0002, 0x00000004, + 0x0126, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00000080, + 0x0006, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x03020100, + 0x0006, 0x00000000, + 0x0002, 0x00000003, + 0x0006, 0x00000000, + 0x0002, 0x00000004, + 0x0026, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00000003, + 0x001e, 0x00000000, + 0x0002, 0x00000004, + 0x1c5c, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x000f, 0x00000000, + 0x0001, 0x00000080, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x000f, 0x00000000, + 0x0001, 0x00000027, + 0x000f, 0x00000000, + 0x0001, 0x00000026, + 0x001f, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0127, 0x00000000, + 0x0001, 0x04e3bfdf, + 0x0007, 0x00000000, + 0x0001, 0x04e3bfdf, + 0x0017, 0x00000000, + 0x0001, 0x0001fe21, + 0x62a1, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x00000003, + 0x008e, 0x00000000, + 0x0002, 0x0000000f, + 0x005e, 0x00000000, + 0x0002, 0x00000004, + 0x0006, 0x00000000, + 0x0002, 0x0000ffff, + 0x0006, 0x00000000, + 0x0002, 0x0000ffff, + 0x0006, 0x00000000, + 0x0002, 0x0000ffff, + 0x0006, 0x00000000, + 0x0002, 0x0000ffff, + 0x0046, 0x00000000, + 0x0002, 0x00000001, + 0x001e, 0x00000000, + 0x0002, 0x00000001, + 0x002e, 0x00000000, + 0x0002, 0x00000001, + 0x0066, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x0016, 0x00000000, + 0x0002, 0x00000004, + 0x001e, 0x00000000, + 0x0002, 0x00000011, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x000000cf, + 0x0006, 0x00000000, + 0x0002, 0x000000cf, + 0x0006, 0x00000000, + 0x0002, 0x000000cf, + 0x0056, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x0006, 0x00000000, + 0x0002, 0x0000000f, + 0x003e, 0x00000000, + 0x0002, 0x001ffe67, + 0x0016, 0x00000000, + 0x0002, 0x00000011, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x001e, 0x00000000, + 0x0002, 0x00000004, + 0x002e, 0x00000000, + 0x0002, 0x00000001, + 0x0026, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x001e, 0x00000000, + 0x0002, 0x00000011, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x000007ff, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0156, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000008, + 0x0006, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x0000000f, + 0x003e, 0x00000000, + 0x0002, 0x00000020, + 0x0006, 0x00000000, + 0x0002, 0x00000011, + 0x0006, 0x00000000, + 0x0002, 0x00000100, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0016, 0x00000000, + 0x0002, 0x00000040, + 0x0006, 0x00000000, + 0x0002, 0x00000100, + 0x000e, 0x00000000, + 0x0002, 0x00000003, + 0x0026, 0x00000000, + 0x0002, 0x001ffe67, + 0x001e, 0x00000000, + 0x0002, 0x00000002, + 0x0006, 0x00000000, + 0x0002, 0x0fac6881, + 0x004e, 0x00000000, + 0x0002, 0x00000001, + 0x0026, 0x00000000, + 0x0002, 0x00000004, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000400, + 0x0006, 0x00000000, + 0x0002, 0x00000300, + 0x0006, 0x00000000, + 0x0002, 0x00001001, + 0x001e, 0x00000000, + 0x0002, 0x00000011, + 0x003e, 0x00000000, + 0x0002, 0x0fac6881, + 0x0006, 0x00000000, + 0x0002, 0x0000000f, + 0x00be, 0x00000000, + 0x0002, 0x001ffe67, + 0x001e, 0x00000000, + 0x0002, 0x00000011, + 0x0016, 0x00000000, + 0x0002, 0x00000004, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x001e, 0x00000000, + 0x0002, 0x00000001, + 0x0026, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x001e, 0x00000000, + 0x0002, 0x2a712488, + 0x000e, 0x00000000, + 0x0002, 0x4085c000, + 0x0006, 0x00000000, + 0x0002, 0x00000040, + 0x0006, 0x00000000, + 0x0002, 0x00000100, + 0x0006, 0x00000000, + 0x0002, 0x00010100, + 0x0006, 0x00000000, + 0x0002, 0x02800000, + 0x0096, 0x00000000, + 0x0002, 0x04e3bfdf, + 0x0006, 0x00000000, + 0x0002, 0x04e3bfdf, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00ffff00, + 0x0006, 0x00000000, + 0x0002, 0x00000001, + 0x0016, 0x00000000, + 0x0002, 0x00ffff00, + 0x0046, 0x00000000, + 0x0002, 0x00000001, + 0x000e, 0x00000000, + 0x0002, 0x00000001, + 0x0006, 0x00000000, + 0x0002, 0x30201000, + 0x0006, 0x00000000, + 0x0002, 0x70605040, + 0x0006, 0x00000000, + 0x0002, 0xb8a89888, + 0x0006, 0x00000000, + 0x0002, 0xf8e8d8c8, + 0x000e, 0x00000000, + 0x0002, 0x0000001a, + 0x295a, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x00000004, + 0x0007, 0x00000000, + 0x0001, 0x08100c12, + 0x0007, 0x00000000, + 0x0001, 0x00000003, + 0x000f, 0x00000000, + 0x0001, 0x08100c12, + 0x000f, 0x00000000, + 0x0001, 0x00080c14, + 0x0007, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00080c14, + 0x0017, 0x00000000, + 0x0001, 0x08100c12, + 0x0007, 0x00000000, + 0x0001, 0x00000027, + 0x0017, 0x00000000, + 0x0001, 0x00000001, + 0x1e0f, 0x00000000, + 0x0001, 0x00000001, + 0x00b7, 0x00000000, + 0x0001, 0x08100c12, + 0x0067, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x000f, 0x00000000, + 0x0001, 0x00000080, + 0x001f, 0x00000000, + 0x0001, 0x00000080, + 0x000f, 0x00000000, + 0x0001, 0x0000003f, + 0x0057, 0x00000000, + 0x0001, 0x00000002, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0007, 0x00000000, + 0x0001, 0x04000000, + 0x0047, 0x00000000, + 0x0001, 0x00000004, + 0x001f, 0x00000000, + 0x0001, 0x00000004, + 0x008f, 0x00000000, + 0x0001, 0x00000001, + 0x0007, 0x00000000, + 0x0001, 0x00001001, + 0x0007, 0x00000000, + 0x0001, 0x0000ffff, + 0x0007, 0x00000000, + 0x0001, 0x0000ffff, + 0x0007, 0x00000000, + 0x0001, 0x0000ffff, + 0x0007, 0x00000000, + 0x0001, 0x0000ffff, + 0x0107, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x3f800000, + 0x0007, 0x00000000, + 0x0001, 0x00000010, + 0x0017, 0x00000000, + 0x0001, 0x00000003, + 0x0047, 0x00000000, + 0x0001, 0x08100c12, + 0x0008, 0x00000000, + 0x0003, 0x00000080, + 0x0004, 0x00000000, + 0x0001, 0x00000080, + 0x0003, 0x80007004, + 0x0004, 0x00000000, + 0x0001, 0x80007004, + 0x0003, 0x04000400, + 0x0004, 0x00000000, + 0x0001, 0x04000400, + 0x0003, 0x00001000, + 0x0004, 0x00000000, + 0x0001, 0x00001000, + 0x0010, 0x00000000, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0010, 0x00000000, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0008, 0x00000000, + 0x0003, 0x00000004, + 0x0004, 0x00000000, + 0x0001, 0x00000004, + 0x0003, 0x00000002, + 0x0004, 0x00000000, + 0x0001, 0x00000002, + 0x0058, 0x00000000, + 0x0003, 0x00000080, + 0x0004, 0x00000000, + 0x0001, 0x00000080, + 0x0003, 0x80007004, + 0x0004, 0x00000000, + 0x0001, 0x80007004, + 0x0003, 0x04000400, + 0x0004, 0x00000000, + 0x0001, 0x04000400, + 0x0003, 0x00001000, + 0x0004, 0x00000000, + 0x0001, 0x00001000, + 0x0010, 0x00000000, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0010, 0x00000000, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0008, 0x00000000, + 0x0003, 0x00000004, + 0x0004, 0x00000000, + 0x0001, 0x00000004, + 0x0003, 0x00000002, + 0x0004, 0x00000000, + 0x0001, 0x00000002, + 0x0050, 0x00000000, + 0x0003, 0x08100c12, + 0x0004, 0x00000000, + 0x0001, 0x08100c12, + 0x0030, 0x00000000, + 0x0003, 0x0000ffff, + 0x0004, 0x00000000, + 0x0004, 0x0000ffff, + 0x0004, 0x00000000, + 0x0004, 0x0000ffff, + 0x0004, 0x00000000, + 0x0004, 0x0000ffff, + 0x0004, 0x00000000, + 0x0001, 0x0000ffff, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0003, 0x00010001, + 0x0004, 0x00000000, + 0x0004, 0x00010001, + 0x0004, 0x00000000, + 0x0001, 0x00010001, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0008, 0x00000000, + 0x0003, 0x0001fe21, + 0x0004, 0x00000000, + 0x0001, 0x0001fe21, + 0x0028, 0x00000000, + 0x0003, 0x08100c12, + 0x0004, 0x00000000, + 0x0001, 0x08100c12, + 0x0003, 0x00000004, + 0x0004, 0x00000000, + 0x0001, 0x00000004, + 0x0008, 0x00000000, + 0x0003, 0x00000002, + 0x0004, 0x00000000, + 0x0001, 0x00000002, + 0x0003, 0x00000011, + 0x0004, 0x00000000, + 0x0001, 0x00000011, + 0x0040, 0x00000000, + 0x0003, 0x0fac6881, + 0x0004, 0x00000000, + 0x0001, 0x0fac6881, + 0x0020, 0x00000000, + 0x0003, 0x00000004, + 0x0004, 0x00000000, + 0x0001, 0x00000004, + 0x0048, 0x00000000, + 0x0003, 0x00000002, + 0x0004, 0x00000000, + 0x0001, 0x00000002, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0004, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0003, 0x00000002, + 0x0004, 0x00000000, + 0x0001, 0x00000002, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0004, 0x00000001, + 0x0004, 0x00000000, + 0x0004, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0008, 0x00000000, + 0x0003, 0x00000004, + 0x0004, 0x00000000, + 0x0001, 0x00000004, + 0x1d18, 0x00000000, + 0x0003, 0x00000011, + 0x0004, 0x00000000, + 0x0001, 0x00000011, + 0x0008, 0x00000000, + 0x0003, 0x00000001, + 0x0004, 0x00000000, + 0x0001, 0x00000001, + 0x0000 +}; #endif commit 8a60b2d6a8984adbe8ec72b3ba0ce95930baaaec Author: Ben Skeggs <sk...@gm...> Date: Tue Feb 10 09:02:17 2009 +1000 drm/nv50: correct ramfc pointer in channel header Suprisingly the card still worked without this... diff --git a/shared-core/nv50_fifo.c b/shared-core/nv50_fifo.c index ce5bca7..59a7b10 100644 --- a/shared-core/nv50_fifo.c +++ b/shared-core/nv50_fifo.c @@ -269,7 +269,7 @@ nv50_fifo_create_context(struct nouveau_channel *chan) if (!IS_G80) { INSTANCE_WR(chan->ramin->gpuobj, 0, chan->id); - INSTANCE_WR(chan->ramin->gpuobj, 1, chan->ramfc->instance); + INSTANCE_WR(chan->ramin->gpuobj, 1, chan->ramfc->instance >> 8); INSTANCE_WR(ramfc, 0x88/4, 0x3d520); /* some vram addy >> 10 */ INSTANCE_WR(ramfc, 0x98/4, chan->ramin->instance >> 12); commit bc0e48baa3b33bf46d1e40744ea4641eda2fa916 Author: Ben Skeggs <sk...@gm...> Date: Tue Jan 27 08:36:33 2009 +1000 nv50: support chipset NV96 ctxprog seen in okias' trace identical to one we use on NV94, assuming the initial context values for NV94 will work here too. diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index ec5c49f..85c9c74 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -106,6 +106,7 @@ nv50_graph_init_ctxctl(struct drm_device *dev) voodoo = nv92_ctxprog; break; case 0x94: + case 0x96: voodoo = nv94_ctxprog; break; case 0xaa: @@ -197,6 +198,7 @@ nv50_graph_create_context(struct nouveau_channel *chan) ctxvals = nv92_ctxvals; break; case 0x94: + case 0x96: ctxvals = nv94_ctxvals; break; case 0xaa: commit 31caf2f9a93f6debe4a31b48736e42c5ea2ec842 Author: Ben Skeggs <sk...@gm...> Date: Tue Feb 10 08:57:21 2009 +1000 drm/nv50: let the card handle the initial context switch Our PFIFO/PGRAPH context save/load functions don't really work well (at all?) on nv5x yet. Depending on what random state the card is in before the drm loads, fbcon probably won't work correctly. Luckily we've setup the GPU in such a way that it'll actually do a hw context switch for the first context. Not sure of how successful this'd be currently on the older chips (actually, pretty sure it won't work), so NV50 only for now. diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c index 3737db1..9bd5afb 100644 --- a/shared-core/nouveau_fifo.c +++ b/shared-core/nouveau_fifo.c @@ -375,7 +375,8 @@ nouveau_fifo_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret, /* If this is the first channel, setup PFIFO ourselves. For any * other case, the GPU will handle this when it switches contexts. */ - if (dev_priv->fifo_alloc_count == 1) { + if (dev_priv->card_type < NV_50 && + dev_priv->fifo_alloc_count == 1) { ret = engine->fifo.load_context(chan); if (ret) { nouveau_fifo_free(chan); commit 2e7db8cc34c1e16084030020523329bbc2008ab7 Author: Ben Skeggs <sk...@gm...> Date: Tue Feb 10 08:56:17 2009 +1000 drm/nouveau: init fbcon after we flag the card as initialised diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 31a0763..cb00eff 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -380,16 +380,17 @@ nouveau_card_init(struct drm_device *dev) ret = nv50_display_create(dev); if (ret) return ret; - - ret = nv50_fbcon_init(dev); - if (ret) { - nv50_display_destroy(dev); - return ret; - } } } dev_priv->init_state = NOUVEAU_CARD_INIT_DONE; + + if (drm_core_check_feature(dev, DRIVER_MODESET)) { + ret = nv50_fbcon_init(dev); + if (ret) + return ret; + } + return 0; } commit 3762c97c82fdff5026ae4d1cfc35687028337636 Author: Pekka Paalanen <pq...@ik...> Date: Tue Jan 27 22:39:50 2009 +0200 drm compat: fix euid for >=2.6.28 drm_fops.c reads the current process' EUID directly from task_struct. Apparently starting in 2.6.28-rc4 this fails to build. In Linus' tree, commit b6dff3ec5e116e3af6f537d4caedcad6b9e5082a "CRED: Separate task security context from task_struct" moves the euid field from task_struct to another struct. Earlier commit 9e2b2dc4133f65272a6d3c5dcb2ce63f8a87cae9 "CRED: Introduce credential access wrappers" implements the wrapper macros to access e.g. euid. This is in 2.6.27-rc4, and this contains the definition of current_euid() that will be used in the DRM compatibility header for kernels before 2.6.27. That commit also creates <linux/cred.h>, which contains the upstream definition of current_euid(). drm_fops.c is fixed to use current_euid(), and drm_compat.h will offer the compatibility definition for kernels <2.6.27. Signed-off-by: Pekka Paalanen <pq...@ik...> diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h index 585350f..03b2526 100644 --- a/linux-core/drm_compat.h +++ b/linux-core/drm_compat.h @@ -56,6 +56,12 @@ #define module_param(name, type, perm) #endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) +#define current_euid() (current->euid) +#else +#include <linux/cred.h> +#endif + /* older kernels had different irq args */ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) #undef DRM_IRQ_ARGS diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c index 7bc73d2..1f3c039 100644 --- a/linux-core/drm_fops.c +++ b/linux-core/drm_fops.c @@ -237,7 +237,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp, memset(priv, 0, sizeof(*priv)); filp->private_data = priv; priv->filp = filp; - priv->uid = current->euid; + priv->uid = current_euid(); priv->pid = current->pid; priv->minor = idr_find(&drm_minors_idr, minor_id); priv->ioctl_count = 0; commit 933995b1da9d60ea7c7834353bb7593474ad5207 Author: Ben Skeggs <sk...@gm...> Date: Tue Feb 10 08:43:07 2009 +1000 drm/nouveau: store vram/gart object handles for each channel diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c index d531152..3737db1 100644 --- a/shared-core/nouveau_fifo.c +++ b/shared-core/nouveau_fifo.c @@ -293,6 +293,8 @@ nouveau_fifo_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret, chan->id = channel; chan->file_priv = file_priv; chan->pushbuf_mem = pushbuf; + chan->vram_handle = vram_handle; + chan->gart_handle = tt_handle; DRM_INFO("Allocating FIFO number %d\n", channel); diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index 78adf65..ec5c49f 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -161,7 +161,6 @@ 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_gpuobj *ctx; - struct nouveau_engine *engine = &dev_priv->Engine; uint32_t *ctxvals = NULL; int grctx_size = 0x70000, hdr; int ret, pos; commit 417c2c411f0155e9b2234a0ad4ce793d19475c66 Author: Ben Skeggs <sk...@gm...> Date: Fri Feb 6 05:29:14 2009 +1000 nv50: remove some badness, we bail in these situations now anyway diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index d1dcbd5..78adf65 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -164,7 +164,7 @@ nv50_graph_create_context(struct nouveau_channel *chan) struct nouveau_engine *engine = &dev_priv->Engine; uint32_t *ctxvals = NULL; int grctx_size = 0x70000, hdr; - int ret; + int ret, pos; DRM_DEBUG("ch%d\n", chan->id); @@ -207,27 +207,13 @@ nv50_graph_create_context(struct nouveau_channel *chan) break; } - if (ctxvals) { - int pos = 0; - - while (*ctxvals) { - int cnt = *ctxvals++; - - while (cnt--) - INSTANCE_WR(ctx, pos++, *ctxvals); - ctxvals++; - } - } else { - /* This is complete crack, it accidently used to make at - * least some G8x cards work partially somehow, though there's - * no good reason why - and it stopped working as the rest - * of the code got off the drugs.. - */ - ret = engine->graph.load_context(chan); - if (ret) { - DRM_ERROR("Error hacking up context: %d\n", ret); - return ret; - } + pos = 0; + while (*ctxvals) { + int cnt = *ctxvals++; + + while (cnt--) + INSTANCE_WR(ctx, pos++, *ctxvals); + ctxvals++; } INSTANCE_WR(ctx, 0x00000/4, chan->ramin->instance >> 12); |
From: <dar...@ke...> - 2009-02-22 04:47:45
|
linux-core/nouveau_sgdma.c | 10 ++++++ shared-core/nouveau_drv.h | 15 ++++++--- shared-core/nouveau_fifo.c | 12 ++++--- shared-core/nouveau_irq.c | 18 ++++++---- shared-core/nouveau_mem.c | 4 +- shared-core/nouveau_object.c | 67 +++++++++++++++++++++++++++++----------- shared-core/nouveau_state.c | 33 +++++++++++++------ shared-core/nv04_fifo.c | 9 +++++ shared-core/nv04_graph.c | 2 - shared-core/nv04_instmem.c | 23 ++++++++++++- shared-core/nv10_fifo.c | 9 +++++ shared-core/nv10_graph.c | 4 +- shared-core/nv20_graph.c | 4 ++ shared-core/nv40_fifo.c | 9 +++++ shared-core/nv40_graph.c | 2 + shared-core/nv50_fifo.c | 18 ++++++++-- shared-core/nv50_graph.c | 8 ++++ shared-core/nv50_instmem.c | 71 +++++++++++++++++++++++++++++++++++-------- 18 files changed, 250 insertions(+), 68 deletions(-) New commits: commit b283b22d0b8d277ab07da1a7bf583d8977a76268 Author: Ben Skeggs <bs...@re...> Date: Sun Feb 22 12:03:51 2009 +1000 nv50: leave vm offset 0-512MiB invalid To catch "NULL pointer" access diff --git a/shared-core/nouveau_mem.c b/shared-core/nouveau_mem.c index d70fa5f..67e32b2 100644 --- a/shared-core/nouveau_mem.c +++ b/shared-core/nouveau_mem.c @@ -210,7 +210,7 @@ nv50_mem_vm_preinit(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - dev_priv->vm_gart_base = roundup(0, VMBLOCK); + dev_priv->vm_gart_base = roundup(VMBLOCK, VMBLOCK); dev_priv->vm_gart_size = VMBLOCK; dev_priv->vm_vram_base = dev_priv->vm_gart_base + dev_priv->vm_gart_size; commit e033cbf09aef59aed3ef1efb67b237815e757e87 Author: Ben Skeggs <bs...@re...> Date: Sun Feb 22 11:09:11 2009 +1000 nv50: use nv_wait for PRAMIN page table update flushes diff --git a/shared-core/nv50_instmem.c b/shared-core/nv50_instmem.c index 4417a6a..545196b 100644 --- a/shared-core/nv50_instmem.c +++ b/shared-core/nv50_instmem.c @@ -304,9 +304,18 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) dev_priv->engine.instmem.finish_access(dev); nv_wr32(0x100c80, 0x00040001); - while(nv_rd32(0x100c80) & 1); + if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) { + DRM_ERROR("timeout: (0x100c80 & 1) == 0 (1)\n"); + DRM_ERROR("0x100c80 = 0x%08x\n", nv_rd32(0x100c80)); + return -EBUSY; + } + nv_wr32(0x100c80, 0x00060001); - while(nv_rd32(0x100c80) & 1); + if (!nv_wait(0x100c80, 0x00000001, 0x00000000)) { + DRM_ERROR("timeout: (0x100c80 & 1) == 0 (2)\n"); + DRM_ERROR("0x100c80 = 0x%08x\n", nv_rd32(0x100c80)); + return -EBUSY; + } gpuobj->im_bound = 1; return 0; commit f38b6546098eddd2a3ddb1b7b75ba03d8e5a7518 Author: Ben Skeggs <bs...@re...> Date: Sun Feb 22 11:07:04 2009 +1000 nv50: remove redundant instmem flush after PRAMIN page table update diff --git a/shared-core/nv50_instmem.c b/shared-core/nv50_instmem.c index 11d9c48..4417a6a 100644 --- a/shared-core/nv50_instmem.c +++ b/shared-core/nv50_instmem.c @@ -303,8 +303,6 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) } dev_priv->engine.instmem.finish_access(dev); - nv_wr32(0x070000, 0x00000001); - while(nv_rd32(0x070000) & 1); nv_wr32(0x100c80, 0x00040001); while(nv_rd32(0x100c80) & 1); nv_wr32(0x100c80, 0x00060001); commit 9ab2a667b90c54647d5b685e1d9dc71d7942890c Author: Ben Skeggs <bs...@re...> Date: Sun Feb 22 11:06:34 2009 +1000 nv50: de-typedef nv50_instmem_priv diff --git a/shared-core/nv50_instmem.c b/shared-core/nv50_instmem.c index 17f2763..11d9c48 100644 --- a/shared-core/nv50_instmem.c +++ b/shared-core/nv50_instmem.c @@ -29,14 +29,14 @@ #include "drm.h" #include "nouveau_drv.h" -typedef struct { +struct nv50_instmem_priv { uint32_t save1700[5]; /* 0x1700->0x1710 */ struct nouveau_gpuobj_ref *pramin_pt; struct nouveau_gpuobj_ref *pramin_bar; bool last_access_wr; -} nv50_instmem_priv; +}; #define NV50_INSTMEM_PAGE_SHIFT 12 #define NV50_INSTMEM_PAGE_SIZE (1 << NV50_INSTMEM_PAGE_SHIFT) @@ -62,7 +62,7 @@ nv50_instmem_init(struct drm_device *dev) struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_channel *chan; uint32_t c_offset, c_size, c_ramfc, c_vmpd, c_base, pt_size; - nv50_instmem_priv *priv; + struct nv50_instmem_priv *priv; int ret, i; uint32_t v; @@ -205,7 +205,7 @@ void nv50_instmem_takedown(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; + struct nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; struct nouveau_channel *chan = dev_priv->fifos[0]; int i; @@ -275,7 +275,7 @@ int nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) { struct drm_nouveau_private *dev_priv = dev->dev_private; - nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; + struct nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; uint32_t pte, pte_end, vram; if (!gpuobj->im_backing || !gpuobj->im_pramin || gpuobj->im_bound) @@ -318,7 +318,7 @@ int nv50_instmem_unbind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) { struct drm_nouveau_private *dev_priv = dev->dev_private; - nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; + struct nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; uint32_t pte, pte_end; if (gpuobj->im_bound == 0) @@ -343,7 +343,7 @@ void nv50_instmem_prepare_access(struct drm_device *dev, bool write) { struct drm_nouveau_private *dev_priv = dev->dev_private; - nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; + struct nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; BUG_ON(dev_priv->ramin_map != NULL); dev_priv->ramin_map = dev_priv->ramin; @@ -355,7 +355,7 @@ void nv50_instmem_finish_access(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; + struct nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; BUG_ON(dev_priv->ramin_map == NULL); dev_priv->ramin_map = NULL; commit 05cda72eb74297c4336b58ea177fb96a4558a33d Author: Ben Skeggs <bs...@re...> Date: Sun Feb 22 11:05:05 2009 +1000 nouveau: fix backwards conditional in wait_for_idle() oops.. diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 11ecc30..a8f9bc6 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -753,15 +753,12 @@ bool nouveau_wait_until(struct drm_device *dev, uint64_t timeout, void nouveau_wait_for_idle(struct drm_device *dev) { struct drm_nouveau_private *dev_priv=dev->dev_private; - bool ret = true; switch(dev_priv->card_type) { case NV_50: break; default: - ret = nouveau_wait_until(dev, 1000000000ULL, NV04_PGRAPH_STATUS, - 0xFFFFFFFF, 0x00000000); - if (ret) { + if (!nv_wait(NV04_PGRAPH_STATUS, 0xffffffff, 0x00000000)) { DRM_ERROR("timed out with status 0x%08x\n", nv_rd32(NV04_PGRAPH_STATUS)); } commit 569d3f8281086af47066a9097261664977b1b06d Author: Ben Skeggs <bs...@re...> Date: Sun Feb 22 10:59:22 2009 +1000 nv50: do instmem flush magic on finish_access() after writes diff --git a/shared-core/nv50_instmem.c b/shared-core/nv50_instmem.c index 661c934..17f2763 100644 --- a/shared-core/nv50_instmem.c +++ b/shared-core/nv50_instmem.c @@ -34,6 +34,8 @@ typedef struct { struct nouveau_gpuobj_ref *pramin_pt; struct nouveau_gpuobj_ref *pramin_bar; + + bool last_access_wr; } nv50_instmem_priv; #define NV50_INSTMEM_PAGE_SHIFT 12 @@ -341,17 +343,27 @@ void nv50_instmem_prepare_access(struct drm_device *dev, bool write) { struct drm_nouveau_private *dev_priv = dev->dev_private; + nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; BUG_ON(dev_priv->ramin_map != NULL); dev_priv->ramin_map = dev_priv->ramin; + + priv->last_access_wr = write; } void nv50_instmem_finish_access(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; + nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; BUG_ON(dev_priv->ramin_map == NULL); dev_priv->ramin_map = NULL; + + if (priv->last_access_wr) { + nv_wr32(0x070000, 0x00000001); + if (!nv_wait(0x070000, 0x00000001, 0x00000000)) + DRM_ERROR("PRAMIN flush timeout\n"); + } } commit afac6a4ddc96fc3135c9b18fcc2514393984d536 Author: Ben Skeggs <bs...@re...> Date: Sun Feb 22 10:55:29 2009 +1000 nouveau: hide instmem map, force use of {prepare,finish}_access diff --git a/linux-core/nouveau_sgdma.c b/linux-core/nouveau_sgdma.c index 16543a9..c7c646f 100644 --- a/linux-core/nouveau_sgdma.c +++ b/linux-core/nouveau_sgdma.c @@ -105,11 +105,13 @@ nouveau_sgdma_bind(struct drm_ttm_backend *be, struct drm_bo_mem_reg *mem) if (dev_priv->card_type < NV_50) nvbe->pte_start += 2; /* skip ctxdma header */ + dev_priv->engine.instmem.prepare_access(nvbe->dev, true); for (i = nvbe->pte_start; i < nvbe->pte_start + nvbe->pages; i++) { uint64_t pteval = nvbe->pagelist[i - nvbe->pte_start]; if (pteval & NV_CTXDMA_PAGE_MASK) { DRM_ERROR("Bad pteval 0x%llx\n", pteval); + dev_priv->engine.instmem.finish_access(nvbe->dev); return -EINVAL; } @@ -129,6 +131,7 @@ nouveau_sgdma_bind(struct drm_ttm_backend *be, struct drm_bo_mem_reg *mem) INSTANCE_WR(gpuobj, (i<<1)+1, tile); } } + dev_priv->engine.instmem.finish_access(nvbe->dev); nvbe->is_bound = 1; return 0; @@ -146,6 +149,7 @@ nouveau_sgdma_unbind(struct drm_ttm_backend *be) struct nouveau_gpuobj *gpuobj = dev_priv->gart_info.sg_ctxdma; unsigned int pte; + dev_priv->engine.instmem.prepare_access(nvbe->dev, true); pte = nvbe->pte_start; while (pte < (nvbe->pte_start + nvbe->pages)) { uint64_t pteval = dev_priv->gart_info.sg_dummy_bus; @@ -159,6 +163,7 @@ nouveau_sgdma_unbind(struct drm_ttm_backend *be) pte++; } + dev_priv->engine.instmem.finish_access(nvbe->dev); nvbe->is_bound = 0; } @@ -242,6 +247,7 @@ nouveau_sgdma_init(struct drm_device *dev) pci_map_page(dev->pdev, dev_priv->gart_info.sg_dummy_page, 0, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); + dev_priv->engine.instmem.prepare_access(dev, true); if (dev_priv->card_type < NV_50) { /* Maybe use NV_DMA_TARGET_AGP for PCIE? NVIDIA do this, and * confirmed to work on c51. Perhaps means NV_DMA_TARGET_PCIE @@ -263,6 +269,7 @@ nouveau_sgdma_init(struct drm_device *dev) INSTANCE_WR(gpuobj, (i+4)/4, 0); } } + dev_priv->engine.instmem.finish_access(dev); dev_priv->gart_info.type = NOUVEAU_GART_SGDMA; dev_priv->gart_info.aper_base = 0; @@ -343,11 +350,14 @@ nouveau_sgdma_get_page(struct drm_device *dev, uint32_t offset, uint32_t *page) { struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_gpuobj *gpuobj = dev_priv->gart_info.sg_ctxdma; + struct nouveau_instmem_engine *instmem = &dev_priv->engine.instmem; int pte; pte = (offset >> NV_CTXDMA_PAGE_SHIFT); if (dev_priv->card_type < NV_50) { + instmem->prepare_access(dev, false); *page = INSTANCE_RD(gpuobj, (pte + 2)) & ~NV_CTXDMA_PAGE_MASK; + instmem->finish_access(dev); return 0; } diff --git a/shared-core/nouveau_drv.h b/shared-core/nouveau_drv.h index ac22c5c..cd618e6 100644 --- a/shared-core/nouveau_drv.h +++ b/shared-core/nouveau_drv.h @@ -202,6 +202,8 @@ struct nouveau_instmem_engine { void (*clear)(struct drm_device *, struct nouveau_gpuobj *); int (*bind)(struct drm_device *, struct nouveau_gpuobj *); int (*unbind)(struct drm_device *, struct nouveau_gpuobj *); + void (*prepare_access)(struct drm_device *, bool write); + void (*finish_access)(struct drm_device *); }; struct nouveau_mc_engine { @@ -273,7 +275,8 @@ struct drm_nouveau_private { drm_local_map_t *mmio; drm_local_map_t *fb; - drm_local_map_t *ramin; /* NV40 onwards */ + drm_local_map_t *ramin_map; + drm_local_map_t *ramin; int fifo_alloc_count; struct nouveau_channel *fifos[NOUVEAU_MAX_CHANNEL_NR]; @@ -633,6 +636,8 @@ extern int nv04_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, extern void nv04_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); extern int nv04_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); extern int nv04_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); +extern void nv04_instmem_prepare_access(struct drm_device *, bool write); +extern void nv04_instmem_finish_access(struct drm_device *); /* nv50_instmem.c */ extern int nv50_instmem_init(struct drm_device *); @@ -642,6 +647,8 @@ extern int nv50_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, extern void nv50_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); extern int nv50_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); extern int nv50_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); +extern void nv50_instmem_prepare_access(struct drm_device *, bool write); +extern void nv50_instmem_finish_access(struct drm_device *); /* nv04_mc.c */ extern int nv04_mc_init(struct drm_device *); @@ -720,8 +727,8 @@ extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *, #define nv_wait(reg,mask,val) nouveau_wait_until(dev, 1000000000ULL, (reg), \ (mask), (val)) /* PRAMIN access */ -#define nv_ri32(reg) nv_in32(dev_priv->ramin, (reg)) -#define nv_wi32(reg,val) nv_out32(dev_priv->ramin, (reg), (val)) +#define nv_ri32(reg) nv_in32(dev_priv->ramin_map, (reg)) +#define nv_wi32(reg,val) nv_out32(dev_priv->ramin_map, (reg), (val)) /* object access */ #define INSTANCE_RD(o,i) nv_ri32((o)->im_pramin->start + ((i)<<2)) #define INSTANCE_WR(o,i,v) nv_wi32((o)->im_pramin->start + ((i)<<2), (v)) diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c index 7efd941..9cfc171 100644 --- a/shared-core/nouveau_fifo.c +++ b/shared-core/nouveau_fifo.c @@ -438,10 +438,12 @@ nouveau_channel_idle(struct nouveau_channel *chan) return 1; } + engine->instmem.prepare_access(dev, false); if (INSTANCE_RD(ramfc, 0) != INSTANCE_RD(ramfc, 1)) idle = 0; else idle = 1; + engine->instmem.finish_access(dev); } else { idle = (nv_rd32(NV04_PFIFO_CACHE1_DMA_GET) == nv_rd32(NV04_PFIFO_CACHE1_DMA_PUT)); diff --git a/shared-core/nouveau_irq.c b/shared-core/nouveau_irq.c index 427ef47..3c0d192 100644 --- a/shared-core/nouveau_irq.c +++ b/shared-core/nouveau_irq.c @@ -201,7 +201,7 @@ static int nouveau_graph_chid_from_grctx(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - uint32_t inst; + uint32_t inst, tmp; int i; if (dev_priv->card_type < NV_40) @@ -222,7 +222,11 @@ nouveau_graph_chid_from_grctx(struct drm_device *dev) if (inst == chan->ramin_grctx->instance) break; } else { - if (inst == INSTANCE_RD(chan->ramin_grctx->gpuobj, 0)) + dev_priv->engine.instmem.prepare_access(dev, false); + tmp = INSTANCE_RD(chan->ramin_grctx->gpuobj, 0); + dev_priv->engine.instmem.finish_access(dev); + + if (inst == tmp) break; } } diff --git a/shared-core/nouveau_mem.c b/shared-core/nouveau_mem.c index 3b4a707..d70fa5f 100644 --- a/shared-core/nouveau_mem.c +++ b/shared-core/nouveau_mem.c @@ -305,6 +305,7 @@ nv50_mem_vm_bind_linear(struct drm_device *dev, uint64_t virt, uint32_t size, size &= ~(psz - 1); + dev_priv->engine.instmem.prepare_access(dev, true); if (flags & 0x80000000) { while (size) { struct nouveau_gpuobj *pt = pgt[virt / (512*1024*1024)]; @@ -329,6 +330,7 @@ nv50_mem_vm_bind_linear(struct drm_device *dev, uint64_t virt, uint32_t size, virt += psz; } } + dev_priv->engine.instmem.finish_access(dev); return 0; } diff --git a/shared-core/nouveau_object.c b/shared-core/nouveau_object.c index 14b24cb..bcd8205 100644 --- a/shared-core/nouveau_object.c +++ b/shared-core/nouveau_object.c @@ -102,6 +102,7 @@ static int nouveau_ramht_insert(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) { struct drm_nouveau_private *dev_priv=dev->dev_private; + struct nouveau_instmem_engine *instmem = &dev_priv->engine.instmem; struct nouveau_channel *chan = dev_priv->fifos[ref->channel]; struct nouveau_gpuobj *ramht = chan->ramht ? chan->ramht->gpuobj : NULL; struct nouveau_gpuobj *gpuobj = ref->gpuobj; @@ -126,6 +127,7 @@ nouveau_ramht_insert(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) (gpuobj->engine << NV40_RAMHT_CONTEXT_ENGINE_SHIFT); } + instmem->prepare_access(dev, true); co = ho = nouveau_ramht_hash_handle(dev, ref->channel, ref->handle); do { if (!nouveau_ramht_entry_valid(dev, ramht, co)) { @@ -135,6 +137,7 @@ nouveau_ramht_insert(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) INSTANCE_WR(ramht, (co + 4)/4, ctx); list_add_tail(&ref->list, &chan->ramht_refs); + instmem->finish_access(dev); return 0; } DRM_DEBUG("collision ch%d 0x%08x: h=0x%08x\n", @@ -149,6 +152,7 @@ nouveau_ramht_insert(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) break; } } while (co != ho); + instmem->finish_access(dev); DRM_ERROR("RAMHT space exhausted. ch=%d\n", ref->channel); return -ENOMEM; @@ -158,6 +162,7 @@ static void nouveau_ramht_remove(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) { struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_instmem_engine *instmem = &dev_priv->engine.instmem; struct nouveau_channel *chan = dev_priv->fifos[ref->channel]; struct nouveau_gpuobj *ramht = chan->ramht ? chan->ramht->gpuobj : NULL; uint32_t co, ho; @@ -167,6 +172,7 @@ nouveau_ramht_remove(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) return; } + instmem->prepare_access(dev, true); co = ho = nouveau_ramht_hash_handle(dev, ref->channel, ref->handle); do { if (nouveau_ramht_entry_valid(dev, ramht, co) && @@ -178,6 +184,7 @@ nouveau_ramht_remove(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) INSTANCE_WR(ramht, (co + 4)/4, 0x00000000); list_del(&ref->list); + instmem->finish_access(dev); return; } @@ -185,6 +192,7 @@ nouveau_ramht_remove(struct drm_device *dev, struct nouveau_gpuobj_ref *ref) if (co >= dev_priv->ramht_size) co = 0; } while (co != ho); + instmem->finish_access(dev); DRM_ERROR("RAMHT entry not found. ch=%d, handle=0x%08x\n", ref->channel, ref->handle); @@ -263,8 +271,10 @@ nouveau_gpuobj_new(struct drm_device *dev, struct nouveau_channel *chan, if (gpuobj->flags & NVOBJ_FLAG_ZERO_ALLOC) { int i; + engine->instmem.prepare_access(dev, true); for (i = 0; i < gpuobj->im_pramin->size; i += 4) INSTANCE_WR(gpuobj, i/4, 0); + engine->instmem.finish_access(dev); } *gpuobj_ret = gpuobj; @@ -582,8 +592,10 @@ nouveau_gpuobj_new_fake(struct drm_device *dev, uint32_t p_offset, } if (gpuobj->flags & NVOBJ_FLAG_ZERO_ALLOC) { + dev_priv->engine.instmem.prepare_access(dev, true); for (i = 0; i < gpuobj->im_pramin->size; i += 4) INSTANCE_WR(gpuobj, i/4, 0); + dev_priv->engine.instmem.finish_access(dev); } if (pref) { @@ -646,6 +658,7 @@ nouveau_gpuobj_dma_new(struct nouveau_channel *chan, int class, { struct drm_device *dev = chan->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_instmem_engine *instmem = &dev_priv->engine.instmem; int ret; uint32_t is_scatter_gather = 0; @@ -682,6 +695,8 @@ nouveau_gpuobj_dma_new(struct nouveau_channel *chan, int class, return ret; } + instmem->prepare_access(dev, true); + if (dev_priv->card_type < NV_50) { uint32_t frame, adjust, pte_flags = 0; adjust = offset & 0x00000fff; @@ -745,6 +760,7 @@ nouveau_gpuobj_dma_new(struct nouveau_channel *chan, int class, #else if (dma_mapping_error(dev->sg->busaddr[idx])) { #endif + instmem->finish_access(dev); return -ENOMEM; } } @@ -773,6 +789,8 @@ nouveau_gpuobj_dma_new(struct nouveau_channel *chan, int class, INSTANCE_WR(*gpuobj, 2, offset); INSTANCE_WR(*gpuobj, 5, flags5); } + + instmem->finish_access(dev); (*gpuobj)->engine = NVOBJ_ENGINE_SW; (*gpuobj)->class = class; @@ -886,30 +904,32 @@ nouveau_gpuobj_gr_new(struct nouveau_channel *chan, int class, return ret; } + dev_priv->engine.instmem.prepare_access(dev, true); if (dev_priv->card_type >= NV_50) { INSTANCE_WR(*gpuobj, 0, class); INSTANCE_WR(*gpuobj, 5, 0x00010000); } else { - switch (class) { - case NV_CLASS_NULL: - INSTANCE_WR(*gpuobj, 0, 0x00001030); - INSTANCE_WR(*gpuobj, 1, 0xFFFFFFFF); - break; - default: - if (dev_priv->card_type >= NV_40) { - INSTANCE_WR(*gpuobj, 0, class); + switch (class) { + case NV_CLASS_NULL: + INSTANCE_WR(*gpuobj, 0, 0x00001030); + INSTANCE_WR(*gpuobj, 1, 0xFFFFFFFF); + break; + default: + if (dev_priv->card_type >= NV_40) { + INSTANCE_WR(*gpuobj, 0, class); #ifdef __BIG_ENDIAN - INSTANCE_WR(*gpuobj, 2, 0x01000000); + INSTANCE_WR(*gpuobj, 2, 0x01000000); #endif - } else { + } else { #ifdef __BIG_ENDIAN - INSTANCE_WR(*gpuobj, 0, class | 0x00080000); + INSTANCE_WR(*gpuobj, 0, class | 0x00080000); #else - INSTANCE_WR(*gpuobj, 0, class); + INSTANCE_WR(*gpuobj, 0, class); #endif + } } } - } + dev_priv->engine.instmem.finish_access(dev); (*gpuobj)->engine = NVOBJ_ENGINE_GR; (*gpuobj)->class = class; @@ -972,6 +992,7 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan, { struct drm_device *dev = chan->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_instmem_engine *instmem = &dev_priv->engine.instmem; struct nouveau_gpuobj *vram = NULL, *tt = NULL; int ret, i; @@ -998,6 +1019,8 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan, if (dev_priv->card_type >= NV_50) { uint32_t vm_offset, pde; + instmem->prepare_access(dev, true); + vm_offset = (dev_priv->chipset & 0xf0) == 0x50 ? 0x1400 : 0x200; vm_offset += chan->ramin->gpuobj->im_pramin->start; if ((ret = nouveau_gpuobj_new_fake(dev, vm_offset, ~0, 0x4000, @@ -1012,8 +1035,10 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan, ret = nouveau_gpuobj_ref_add(dev, NULL, 0, dev_priv->gart_info.sg_ctxdma, &chan->vm_gart_pt); - if (ret) + if (ret) { + instmem->finish_access(dev); return ret; + } INSTANCE_WR(chan->vm_pd, pde++, chan->vm_gart_pt->instance | 0x03); INSTANCE_WR(chan->vm_pd, pde++, 0x00000000); @@ -1022,16 +1047,20 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan, drm_calloc(dev_priv->vm_vram_pt_nr, sizeof(struct nouveau_gpuobj_ref *), DRM_MEM_DRIVER); - if (!chan->vm_vram_pt) + if (!chan->vm_vram_pt) { + instmem->finish_access(dev); return -ENOMEM; + } pde = (dev_priv->vm_vram_base / (512*1024*1024)) * 2; for (i = 0; i < dev_priv->vm_vram_pt_nr; i++) { ret = nouveau_gpuobj_ref_add(dev, NULL, 0, dev_priv->vm_vram_pt[i], &chan->vm_vram_pt[i]); - if (ret) + if (ret) { + instmem->finish_access(dev); return ret; + } INSTANCE_WR(chan->vm_pd, pde++, chan->vm_vram_pt[i]->instance | 0x61); @@ -1039,6 +1068,8 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan, } } + instmem->finish_access(dev); + /* RAMHT */ if (dev_priv->card_type < NV_50) { ret = nouveau_gpuobj_ref_add(dev, NULL, 0, dev_priv->ramht, diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index d91adb8..11ecc30 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -47,6 +47,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) engine->instmem.clear = nv04_instmem_clear; engine->instmem.bind = nv04_instmem_bind; engine->instmem.unbind = nv04_instmem_unbind; + engine->instmem.prepare_access = nv04_instmem_prepare_access; + engine->instmem.finish_access = nv04_instmem_finish_access; engine->mc.init = nv04_mc_init; engine->mc.takedown = nv04_mc_takedown; engine->timer.init = nv04_timer_init; @@ -76,6 +78,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) engine->instmem.clear = nv04_instmem_clear; engine->instmem.bind = nv04_instmem_bind; engine->instmem.unbind = nv04_instmem_unbind; + engine->instmem.prepare_access = nv04_instmem_prepare_access; + engine->instmem.finish_access = nv04_instmem_finish_access; engine->mc.init = nv04_mc_init; engine->mc.takedown = nv04_mc_takedown; engine->timer.init = nv04_timer_init; @@ -105,6 +109,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) engine->instmem.clear = nv04_instmem_clear; engine->instmem.bind = nv04_instmem_bind; engine->instmem.unbind = nv04_instmem_unbind; + engine->instmem.prepare_access = nv04_instmem_prepare_access; + engine->instmem.finish_access = nv04_instmem_finish_access; engine->mc.init = nv04_mc_init; engine->mc.takedown = nv04_mc_takedown; engine->timer.init = nv04_timer_init; @@ -134,6 +140,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) engine->instmem.clear = nv04_instmem_clear; engine->instmem.bind = nv04_instmem_bind; engine->instmem.unbind = nv04_instmem_unbind; + engine->instmem.prepare_access = nv04_instmem_prepare_access; + engine->instmem.finish_access = nv04_instmem_finish_access; engine->mc.init = nv04_mc_init; engine->mc.takedown = nv04_mc_takedown; engine->timer.init = nv04_timer_init; @@ -164,6 +172,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) engine->instmem.clear = nv04_instmem_clear; engine->instmem.bind = nv04_instmem_bind; engine->instmem.unbind = nv04_instmem_unbind; + engine->instmem.prepare_access = nv04_instmem_prepare_access; + engine->instmem.finish_access = nv04_instmem_finish_access; engine->mc.init = nv40_mc_init; engine->mc.takedown = nv40_mc_takedown; engine->timer.init = nv04_timer_init; @@ -196,6 +206,8 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) engine->instmem.clear = nv50_instmem_clear; engine->instmem.bind = nv50_instmem_bind; engine->instmem.unbind = nv50_instmem_unbind; + engine->instmem.prepare_access = nv50_instmem_prepare_access; + engine->instmem.finish_access = nv50_instmem_finish_access; engine->mc.init = nv50_mc_init; engine->mc.takedown = nv50_mc_takedown; engine->timer.init = nv04_timer_init; @@ -526,7 +538,7 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) } /* map larger RAMIN aperture on NV40 cards */ - dev_priv->ramin = NULL; + dev_priv->ramin_map = dev_priv->ramin = NULL; if (dev_priv->card_type >= NV_40) { int ramin_resource = 2; if (drm_get_resource_len(dev, ramin_resource) == 0) @@ -812,8 +824,10 @@ static int nouveau_suspend(struct drm_device *dev) engine->graph.save_context(dev_priv->fifos[engine->fifo.channel_id(dev)]); nouveau_wait_for_idle(dev); + engine->instmem.prepare_access(dev, false); for (i = 0; i < susres->ramin_size / 4; i++) susres->ramin_copy[i] = nv_ri32(i << 2); + engine->instmem.finish_access(dev); /* reenable the fifo caches */ nv_wr32(NV04_PFIFO_CACHE1_DMA_PUSH, diff --git a/shared-core/nv04_fifo.c b/shared-core/nv04_fifo.c index 3463e07..18605d0 100644 --- a/shared-core/nv04_fifo.c +++ b/shared-core/nv04_fifo.c @@ -59,6 +59,7 @@ nv04_fifo_create_context(struct nouveau_channel *chan) return ret; /* Setup initial state */ + dev_priv->engine.instmem.prepare_access(dev, true); RAMFC_WR(DMA_PUT, chan->pushbuf_base); RAMFC_WR(DMA_GET, chan->pushbuf_base); RAMFC_WR(DMA_INSTANCE, chan->pushbuf->instance >> 4); @@ -69,6 +70,7 @@ nv04_fifo_create_context(struct nouveau_channel *chan) NV_PFIFO_CACHE1_BIG_ENDIAN | #endif 0)); + dev_priv->engine.instmem.finish_access(dev); /* enable the fifo dma operation */ nv_wr32(NV04_PFIFO_MODE,nv_rd32(NV04_PFIFO_MODE) | (1<<chan->id)); @@ -93,6 +95,8 @@ nv04_fifo_load_context(struct nouveau_channel *chan) struct drm_nouveau_private *dev_priv = dev->dev_private; uint32_t tmp; + dev_priv->engine.instmem.prepare_access(dev, false); + nv_wr32(NV03_PFIFO_CACHE1_PUSH1, NV03_PFIFO_CACHE1_PUSH1_DMA | chan->id); @@ -108,6 +112,8 @@ nv04_fifo_load_context(struct nouveau_channel *chan) nv_wr32(NV04_PFIFO_CACHE1_ENGINE, RAMFC_RD(ENGINE)); nv_wr32(NV04_PFIFO_CACHE1_PULL1, RAMFC_RD(PULL1_ENGINE)); + dev_priv->engine.instmem.finish_access(dev); + /* Reset NV04_PFIFO_CACHE1_DMA_CTL_AT_INFO to INVALID */ tmp = nv_rd32(NV04_PFIFO_CACHE1_DMA_CTL) & ~(1<<31); nv_wr32(NV04_PFIFO_CACHE1_DMA_CTL, tmp); @@ -122,6 +128,8 @@ nv04_fifo_save_context(struct nouveau_channel *chan) struct drm_nouveau_private *dev_priv = dev->dev_private; uint32_t tmp; + dev_priv->engine.instmem.prepare_access(dev, true); + RAMFC_WR(DMA_PUT, nv_rd32(NV04_PFIFO_CACHE1_DMA_PUT)); RAMFC_WR(DMA_GET, nv_rd32(NV04_PFIFO_CACHE1_DMA_GET)); @@ -134,5 +142,6 @@ nv04_fifo_save_context(struct nouveau_channel *chan) RAMFC_WR(ENGINE, nv_rd32(NV04_PFIFO_CACHE1_ENGINE)); RAMFC_WR(PULL1_ENGINE, nv_rd32(NV04_PFIFO_CACHE1_PULL1)); + dev_priv->engine.instmem.finish_access(dev); return 0; } diff --git a/shared-core/nv04_instmem.c b/shared-core/nv04_instmem.c index 6268529..7d902d8 100644 --- a/shared-core/nv04_instmem.c +++ b/shared-core/nv04_instmem.c @@ -167,3 +167,22 @@ nv04_instmem_unbind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) gpuobj->im_bound = 0; return 0; } + +void +nv04_instmem_prepare_access(struct drm_device *dev, bool write) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + + BUG_ON(dev_priv->ramin_map != NULL); + dev_priv->ramin_map = dev_priv->ramin; +} + +void +nv04_instmem_finish_access(struct drm_device *dev) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + + BUG_ON(dev_priv->ramin_map == NULL); + dev_priv->ramin_map = NULL; +} + diff --git a/shared-core/nv10_fifo.c b/shared-core/nv10_fifo.c index b224558..4d59457 100644 --- a/shared-core/nv10_fifo.c +++ b/shared-core/nv10_fifo.c @@ -62,6 +62,7 @@ nv10_fifo_create_context(struct nouveau_channel *chan) /* Fill entries that are seen filled in dumps of nvidia driver just * after channel's is put into DMA mode */ + dev_priv->engine.instmem.prepare_access(dev, true); RAMFC_WR(DMA_PUT , chan->pushbuf_base); RAMFC_WR(DMA_GET , chan->pushbuf_base); RAMFC_WR(DMA_INSTANCE , chan->pushbuf->instance >> 4); @@ -72,6 +73,7 @@ nv10_fifo_create_context(struct nouveau_channel *chan) NV_PFIFO_CACHE1_BIG_ENDIAN | #endif 0); + dev_priv->engine.instmem.finish_access(dev); /* enable the fifo dma operation */ nv_wr32(NV04_PFIFO_MODE,nv_rd32(NV04_PFIFO_MODE)|(1<<chan->id)); @@ -99,6 +101,8 @@ nv10_fifo_load_context(struct nouveau_channel *chan) nv_wr32(NV03_PFIFO_CACHE1_PUSH1, NV03_PFIFO_CACHE1_PUSH1_DMA | chan->id); + dev_priv->engine.instmem.prepare_access(dev, false); + nv_wr32(NV04_PFIFO_CACHE1_DMA_GET , RAMFC_RD(DMA_GET)); nv_wr32(NV04_PFIFO_CACHE1_DMA_PUT , RAMFC_RD(DMA_PUT)); nv_wr32(NV10_PFIFO_CACHE1_REF_CNT , RAMFC_RD(REF_CNT)); @@ -125,6 +129,8 @@ nv10_fifo_load_context(struct nouveau_channel *chan) RAMFC_RD(DMA_SUBROUTINE)); } + dev_priv->engine.instmem.finish_access(dev); + /* Reset NV04_PFIFO_CACHE1_DMA_CTL_AT_INFO to INVALID */ tmp = nv_rd32(NV04_PFIFO_CACHE1_DMA_CTL) & ~(1<<31); nv_wr32(NV04_PFIFO_CACHE1_DMA_CTL, tmp); @@ -139,6 +145,8 @@ nv10_fifo_save_context(struct nouveau_channel *chan) struct drm_nouveau_private *dev_priv = dev->dev_private; uint32_t tmp; + dev_priv->engine.instmem.prepare_access(dev, true); + RAMFC_WR(DMA_PUT , nv_rd32(NV04_PFIFO_CACHE1_DMA_PUT)); RAMFC_WR(DMA_GET , nv_rd32(NV04_PFIFO_CACHE1_DMA_GET)); RAMFC_WR(REF_CNT , nv_rd32(NV10_PFIFO_CACHE1_REF_CNT)); @@ -165,5 +173,6 @@ nv10_fifo_save_context(struct nouveau_channel *chan) nv_rd32(NV04_PFIFO_CACHE1_DMA_GET)); } + dev_priv->engine.instmem.finish_access(dev); return 0; } diff --git a/shared-core/nv20_graph.c b/shared-core/nv20_graph.c index 122bfb5..b8e138e 100644 --- a/shared-core/nv20_graph.c +++ b/shared-core/nv20_graph.c @@ -606,6 +606,7 @@ int nv20_graph_create_context(struct nouveau_channel *chan) return ret; /* Initialise default context values */ + dev_priv->engine.instmem.prepare_access(dev, true); ctx_init(dev, chan->ramin_grctx->gpuobj); /* nv20: INSTANCE_WR(chan->ramin_grctx->gpuobj, 10, chan->id<<24); */ @@ -615,6 +616,7 @@ int nv20_graph_create_context(struct nouveau_channel *chan) INSTANCE_WR(dev_priv->ctx_table->gpuobj, chan->id, chan->ramin_grctx->instance >> 4); + dev_priv->engine.instmem.finish_access(dev); return 0; } @@ -626,7 +628,9 @@ void nv20_graph_destroy_context(struct nouveau_channel *chan) if (chan->ramin_grctx) nouveau_gpuobj_ref_del(dev, &chan->ramin_grctx); + dev_priv->engine.instmem.prepare_access(dev, true); INSTANCE_WR(dev_priv->ctx_table->gpuobj, chan->id, 0); + dev_priv->engine.instmem.finish_access(dev); } int nv20_graph_load_context(struct nouveau_channel *chan) diff --git a/shared-core/nv40_fifo.c b/shared-core/nv40_fifo.c index 983b346..b156dc8 100644 --- a/shared-core/nv40_fifo.c +++ b/shared-core/nv40_fifo.c @@ -53,6 +53,7 @@ nv40_fifo_create_context(struct nouveau_channel *chan) /* Fill entries that are seen filled in dumps of nvidia driver just * after channel's is put into DMA mode */ + dev_priv->engine.instmem.prepare_access(dev, true); RAMFC_WR(DMA_PUT , chan->pushbuf_base); RAMFC_WR(DMA_GET , chan->pushbuf_base); RAMFC_WR(DMA_INSTANCE , chan->pushbuf->instance >> 4); @@ -66,6 +67,7 @@ nv40_fifo_create_context(struct nouveau_channel *chan) RAMFC_WR(DMA_SUBROUTINE, 0); RAMFC_WR(GRCTX_INSTANCE, chan->ramin_grctx->instance >> 4); RAMFC_WR(DMA_TIMESLICE , 0x0001FFFF); + dev_priv->engine.instmem.finish_access(dev); /* enable the fifo dma operation */ nv_wr32(NV04_PFIFO_MODE,nv_rd32(NV04_PFIFO_MODE)|(1<<chan->id)); @@ -91,6 +93,8 @@ nv40_fifo_load_context(struct nouveau_channel *chan) struct drm_nouveau_private *dev_priv = dev->dev_private; uint32_t tmp, tmp2; + dev_priv->engine.instmem.prepare_access(dev, false); + nv_wr32(NV04_PFIFO_CACHE1_DMA_GET , RAMFC_RD(DMA_GET)); nv_wr32(NV04_PFIFO_CACHE1_DMA_PUT , RAMFC_RD(DMA_PUT)); nv_wr32(NV10_PFIFO_CACHE1_REF_CNT , RAMFC_RD(REF_CNT)); @@ -134,6 +138,8 @@ nv40_fifo_load_context(struct nouveau_channel *chan) tmp |= RAMFC_RD(DMA_TIMESLICE) & 0x1FFFF; nv_wr32(NV04_PFIFO_DMA_TIMESLICE, tmp); + dev_priv->engine.instmem.finish_access(dev); + /* Set channel active, and in DMA mode */ nv_wr32(NV03_PFIFO_CACHE1_PUSH1, NV03_PFIFO_CACHE1_PUSH1_DMA | chan->id); @@ -152,6 +158,8 @@ nv40_fifo_save_context(struct nouveau_channel *chan) struct drm_nouveau_private *dev_priv = dev->dev_private; uint32_t tmp; + dev_priv->engine.instmem.prepare_access(dev, true); + RAMFC_WR(DMA_PUT , nv_rd32(NV04_PFIFO_CACHE1_DMA_PUT)); RAMFC_WR(DMA_GET , nv_rd32(NV04_PFIFO_CACHE1_DMA_GET)); RAMFC_WR(REF_CNT , nv_rd32(NV10_PFIFO_CACHE1_REF_CNT)); @@ -192,6 +200,7 @@ nv40_fifo_save_context(struct nouveau_channel *chan) RAMFC_WR(UNK_48 , tmp); #endif + dev_priv->engine.instmem.finish_access(dev); return 0; } diff --git a/shared-core/nv40_graph.c b/shared-core/nv40_graph.c index b0340c5..31147ef 100644 --- a/shared-core/nv40_graph.c +++ b/shared-core/nv40_graph.c @@ -1514,7 +1514,9 @@ nv40_graph_create_context(struct nouveau_channel *chan) return ret; /* Initialise default context values */ + dev_priv->engine.instmem.prepare_access(dev, true); ctx_init(dev, chan->ramin_grctx->gpuobj); + dev_priv->engine.instmem.finish_access(dev); return 0; } diff --git a/shared-core/nv50_fifo.c b/shared-core/nv50_fifo.c index b8150b6..f776396 100644 --- a/shared-core/nv50_fifo.c +++ b/shared-core/nv50_fifo.c @@ -49,11 +49,14 @@ nv50_fifo_init_thingo(struct drm_device *dev) priv->cur_thingo = !priv->cur_thingo; /* We never schedule channel 0 or 127 */ + dev_priv->engine.instmem.prepare_access(dev, true); for (i = 1, nr = 0; i < 127; i++) { if (dev_priv->fifos[i]) { INSTANCE_WR(cur->gpuobj, nr++, i); } } + dev_priv->engine.instmem.finish_access(dev); + nv_wr32(0x32f4, cur->instance >> 12); nv_wr32(0x32ec, nr); nv_wr32(0x2500, 0x101); @@ -253,6 +256,8 @@ nv50_fifo_create_context(struct nouveau_channel *chan) ramfc = chan->ramfc->gpuobj; } + dev_priv->engine.instmem.prepare_access(dev, true); + INSTANCE_WR(ramfc, 0x08/4, chan->pushbuf_base); INSTANCE_WR(ramfc, 0x10/4, chan->pushbuf_base); INSTANCE_WR(ramfc, 0x48/4, chan->pushbuf->instance >> 4); @@ -275,6 +280,8 @@ nv50_fifo_create_context(struct nouveau_channel *chan) INSTANCE_WR(ramfc, 0x98/4, chan->ramin->instance >> 12); } + dev_priv->engine.instmem.finish_access(dev); + ret = nv50_fifo_channel_enable(dev, chan->id, 0); if (ret) { DRM_ERROR("error enabling ch%d: %d\n", chan->id, ret); @@ -315,6 +322,7 @@ nv50_fifo_load_context(struct nouveau_channel *chan) DRM_DEBUG("ch%d\n", chan->id); /*XXX: incomplete, only touches the regs that NV does */ + dev_priv->engine.instmem.prepare_access(dev, false); nv_wr32(0x3244, INSTANCE_RD(ramfc, 0x08/4)); nv_wr32(0x3240, INSTANCE_RD(ramfc, 0x10/4)); @@ -330,6 +338,8 @@ nv50_fifo_load_context(struct nouveau_channel *chan) nv_wr32(0x3410, INSTANCE_RD(ramfc, 0x98/4)); } + dev_priv->engine.instmem.finish_access(dev); + nv_wr32(NV03_PFIFO_CACHE1_PUSH1, chan->id | (1<<16)); return 0; } diff --git a/shared-core/nv50_graph.c b/shared-core/nv50_graph.c index a4c7e1b..b892830 100644 --- a/shared-core/nv50_graph.c +++ b/shared-core/nv50_graph.c @@ -182,6 +182,7 @@ nv50_graph_create_context(struct nouveau_channel *chan) ctx = chan->ramin_grctx->gpuobj; hdr = IS_G80 ? 0x200 : 0x20; + dev_priv->engine.instmem.prepare_access(dev, true); INSTANCE_WR(ramin, (hdr + 0x00)/4, 0x00190002); INSTANCE_WR(ramin, (hdr + 0x04)/4, chan->ramin_grctx->instance + grctx_size - 1); @@ -189,6 +190,7 @@ nv50_graph_create_context(struct nouveau_channel *chan) INSTANCE_WR(ramin, (hdr + 0x0c)/4, 0); INSTANCE_WR(ramin, (hdr + 0x10)/4, 0); INSTANCE_WR(ramin, (hdr + 0x14)/4, 0x00010000); + dev_priv->engine.instmem.finish_access(dev); switch (dev_priv->chipset) { case 0x50: @@ -222,6 +224,8 @@ nv50_graph_create_context(struct nouveau_channel *chan) break; } + dev_priv->engine.instmem.prepare_access(dev, true); + pos = 0; while (*ctxvals) { int cnt = *ctxvals++; @@ -237,6 +241,8 @@ nv50_graph_create_context(struct nouveau_channel *chan) else INSTANCE_WR(ctx, 0x0011c/4, 0x00000002); + dev_priv->engine.instmem.finish_access(dev); + return 0; } @@ -252,8 +258,10 @@ nv50_graph_destroy_context(struct nouveau_channel *chan) int i, hdr; hdr = IS_G80 ? 0x200 : 0x20; + dev_priv->engine.instmem.prepare_access(dev, true); for (i=hdr; i<hdr+24; i+=4) INSTANCE_WR(chan->ramin->gpuobj, i/4, 0); + dev_priv->engine.instmem.finish_access(dev); nouveau_gpuobj_ref_del(dev, &chan->ramin_grctx); } diff --git a/shared-core/nv50_instmem.c b/shared-core/nv50_instmem.c index 393d557..661c934 100644 --- a/shared-core/nv50_instmem.c +++ b/shared-core/nv50_instmem.c @@ -176,12 +176,14 @@ nv50_instmem_init(struct drm_device *dev) /* Assume that praying isn't enough, check that we can re-read the * entire fake channel back from the PRAMIN BAR */ + dev_priv->engine.instmem.prepare_access(dev, false); for (i = 0; i < c_size; i+=4) { if (nv_rd32(NV_RAMIN + i) != nv_ri32(i)) { DRM_ERROR("Error reading back PRAMIN at 0x%08x\n", i); return -EINVAL; } } + dev_priv->engine.instmem.finish_access(dev); /* Global PRAMIN heap */ if (nouveau_mem_init_heap(&dev_priv->ramin_heap, @@ -289,6 +291,7 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) DRM_DEBUG("first vram page: 0x%llx\n", gpuobj->im_backing->start); + dev_priv->engine.instmem.prepare_access(dev, true); while (pte < pte_end) { INSTANCE_WR(priv->pramin_pt->gpuobj, (pte + 0)/4, vram | 1); INSTANCE_WR(priv->pramin_pt->gpuobj, (pte + 4)/4, 0x00000000); @@ -296,6 +299,7 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) pte += 8; vram += NV50_INSTMEM_PAGE_SIZE; } + dev_priv->engine.instmem.finish_access(dev); nv_wr32(0x070000, 0x00000001); while(nv_rd32(0x070000) & 1); @@ -320,12 +324,34 @@ nv50_instmem_unbind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) pte = (gpuobj->im_pramin->start >> 12) << 3; pte_end = ((gpuobj->im_pramin->size >> 12) << 3) + pte; + + dev_priv->engine.instmem.prepare_access(dev, true); while (pte < pte_end) { INSTANCE_WR(priv->pramin_pt->gpuobj, (pte + 0)/4, 0x00000009); INSTANCE_WR(priv->pramin_pt->gpuobj, (pte + 4)/4, 0x00000000); pte += 8; } + dev_priv->engine.instmem.finish_access(dev); gpuobj->im_bound = 0; return 0; } + +void +nv50_instmem_prepare_access(struct drm_device *dev, bool write) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + + BUG_ON(dev_priv->ramin_map != NULL); + dev_priv->ramin_map = dev_priv->ramin; +} + +void +nv50_instmem_finish_access(struct drm_device *dev) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + + BUG_ON(dev_priv->ramin_map == NULL); + dev_priv->ramin_map = NULL; +} + commit cdba1bf2e4c92f38c8378770594e33aa65a8e897 Author: Ben Skeggs <bs...@re...> Date: Sun Feb 22 10:21:01 2009 +1000 nouveau: decapitalise dev_priv->Engine diff --git a/shared-core/nouveau_drv.h b/shared-core/nouveau_drv.h index 7a4cf58..ac22c5c 100644 --- a/shared-core/nouveau_drv.h +++ b/shared-core/nouveau_drv.h @@ -278,7 +278,7 @@ struct drm_nouveau_private { int fifo_alloc_count; struct nouveau_channel *fifos[NOUVEAU_MAX_CHANNEL_NR]; - struct nouveau_engine Engine; + struct nouveau_engine engine; struct nouveau_channel *channel; /* RAMIN configuration, RAMFC, RAMHT and RAMRO offsets */ diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c index e244a89..7efd941 100644 --- a/shared-core/nouveau_fifo.c +++ b/shared-core/nouveau_fifo.c @@ -262,7 +262,7 @@ nouveau_fifo_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret, { int ret; struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; struct nouveau_channel *chan; int channel; @@ -417,7 +417,7 @@ nouveau_channel_idle(struct nouveau_channel *chan) { struct drm_device *dev = chan->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; uint32_t caches; int idle; @@ -456,7 +456,7 @@ void nouveau_fifo_free(struct nouveau_channel *chan) { struct drm_device *dev = chan->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; uint64_t t_start; DRM_INFO("%s: freeing fifo %d\n", __func__, chan->id); @@ -522,7 +522,7 @@ void nouveau_fifo_free(struct nouveau_channel *chan) void nouveau_fifo_cleanup(struct drm_device *dev, struct drm_file *file_priv) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; int i; DRM_DEBUG("clearing FIFO enables from file_priv\n"); @@ -539,7 +539,7 @@ nouveau_fifo_owner(struct drm_device *dev, struct drm_file *file_priv, int channel) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; if (channel >= engine->fifo.channels) return 0; diff --git a/shared-core/nouveau_irq.c b/shared-core/nouveau_irq.c index cc7a03c..427ef47 100644 --- a/shared-core/nouveau_irq.c +++ b/shared-core/nouveau_irq.c @@ -77,7 +77,7 @@ static void nouveau_fifo_irq_handler(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; uint32_t status, reassign; reassign = nv_rd32(NV03_PFIFO_CACHES) & 1; @@ -205,14 +205,14 @@ nouveau_graph_chid_from_grctx(struct drm_device *dev) int i; if (dev_priv->card_type < NV_40) - return dev_priv->Engine.fifo.channels; + return dev_priv->engine.fifo.channels; else if (dev_priv->card_type < NV_50) inst = (nv_rd32(0x40032c) & 0xfffff) << 4; else inst = nv_rd32(0x40032c) & 0xfffff; - for (i = 0; i < dev_priv->Engine.fifo.channels; i++) { + for (i = 0; i < dev_priv->engine.fifo.channels; i++) { struct nouveau_channel *chan = dev_priv->fifos[i]; if (!chan || !chan->ramin_grctx) @@ -234,7 +234,7 @@ static int nouveau_graph_trapped_channel(struct drm_device *dev, int *channel_ret) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; int channel; if (dev_priv->card_type < NV_10) @@ -380,7 +380,7 @@ static inline void nouveau_pgraph_intr_context_switch(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; uint32_t chid; chid = engine->fifo.channel_id(dev); diff --git a/shared-core/nouveau_object.c b/shared-core/nouveau_object.c index 10e715d..14b24cb 100644 --- a/shared-core/nouveau_object.c +++ b/shared-core/nouveau_object.c @@ -196,7 +196,7 @@ nouveau_gpuobj_new(struct drm_device *dev, struct nouveau_channel *chan, struct nouveau_gpuobj **gpuobj_ret) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; struct nouveau_gpuobj *gpuobj; struct mem_block *pramin = NULL; int ret; @@ -336,7 +336,7 @@ int nouveau_gpuobj_del(struct drm_device *dev, struct nouveau_gpuobj **pgpuobj) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; struct nouveau_gpuobj *gpuobj; DRM_DEBUG("gpuobj %p\n", pgpuobj ? *pgpuobj : NULL); diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 22ab688..d91adb8 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -37,7 +37,7 @@ static void nouveau_stub_takedown(struct drm_device *dev) {} static int nouveau_init_engine_ptrs(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; switch (dev_priv->chipset & 0xf0) { case 0x00: @@ -253,7 +253,7 @@ nouveau_card_init(struct drm_device *dev) /* Initialise internal driver API hooks */ ret = nouveau_init_engine_ptrs(dev); if (ret) return ret; - engine = &dev_priv->Engine; + engine = &dev_priv->engine; dev_priv->init_state = NOUVEAU_CARD_INIT_FAILED; ret = nouveau_gpuobj_early_init(dev); @@ -344,7 +344,7 @@ nouveau_card_init(struct drm_device *dev) static void nouveau_card_takedown(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; DRM_DEBUG("prev state = %d\n", dev_priv->init_state); @@ -726,7 +726,7 @@ bool nouveau_wait_until(struct drm_device *dev, uint64_t timeout, uint32_t reg, uint32_t mask, uint32_t val) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_timer_engine *ptimer = &dev_priv->Engine.timer; + struct nouveau_timer_engine *ptimer = &dev_priv->engine.timer; uint64_t start = ptimer->read(dev); do { @@ -761,7 +761,7 @@ 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; + struct nouveau_engine *engine = &dev_priv->engine; int i; drm_free(susres->ramin_copy, susres->ramin_size, DRM_MEM_DRIVER); @@ -830,7 +830,7 @@ 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; + struct nouveau_engine *engine = &dev_priv->engine; int i; if (!susres->ramin_copy) diff --git a/shared-core/nv04_graph.c b/shared-core/nv04_graph.c index a1342f7..62ef1cf 100644 --- a/shared-core/nv04_graph.c +++ b/shared-core/nv04_graph.c @@ -353,7 +353,7 @@ struct graph_state { void nouveau_nv04_context_switch(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; struct nouveau_channel *next, *last; int chid; diff --git a/shared-core/nv04_instmem.c b/shared-core/nv04_instmem.c index fb4a178..6268529 100644 --- a/shared-core/nv04_instmem.c +++ b/shared-core/nv04_instmem.c @@ -43,7 +43,7 @@ static void nv04_instmem_configure_fixed_tables(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; /* FIFO hash table (RAMHT) * use 4k hash table at RAMIN+0x10000 @@ -143,7 +143,7 @@ nv04_instmem_clear(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) if (gpuobj && gpuobj->im_backing) { if (gpuobj->im_bound) - dev_priv->Engine.instmem.unbind(dev, gpuobj); + dev_priv->engine.instmem.unbind(dev, gpuobj); gpuobj->im_backing = NULL; } } diff --git a/shared-core/nv10_graph.c b/shared-core/nv10_graph.c index b2b2e4b..791e08b 100644 --- a/shared-core/nv10_graph.c +++ b/shared-core/nv10_graph.c @@ -709,7 +709,7 @@ void nouveau_nv10_context_switch(struct drm_device *dev) DRM_DEBUG("Invalid drm_nouveau_private->fifos\n"); return; } - engine = &dev_priv->Engine; + engine = &dev_priv->engine; chid = (nv_rd32(NV04_PGRAPH_TRAPPED_ADDR) >> 20) & (engine->fifo.channels - 1); @@ -831,7 +831,7 @@ void nv10_graph_destroy_context(struct nouveau_channel *chan) { struct drm_device *dev = chan->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_engine *engine = &dev_priv->Engine; + struct nouveau_engine *engine = &dev_priv->engine; struct graph_state* pgraph_ctx = chan->pgraph_ctx; int chid; diff --git a/shared-core/nv50_fifo.c b/shared-core/nv50_fifo.c index 07d6b9d..b8150b6 100644 --- a/shared-core/nv50_fifo.c +++ b/shared-core/nv50_fifo.c @@ -39,7 +39,7 @@ static void nv50_fifo_init_thingo(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nv50_fifo_priv *priv = dev_priv->Engine.fifo.priv; + struct nv50_fifo_priv *priv = dev_priv->engine.fifo.priv; struct nouveau_gpuobj_ref *cur; int i, nr; @@ -171,7 +171,7 @@ nv50_fifo_init(struct drm_device *dev) priv = drm_calloc(1, sizeof(*priv), DRM_MEM_DRIVER); if (!priv) return -ENOMEM; - dev_priv->Engine.fifo.priv = priv; + dev_priv->engine.fifo.priv = priv; nv50_fifo_init_reset(dev); nv50_fifo_init_intr(dev); @@ -201,7 +201,7 @@ void nv50_fifo_takedown(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nv50_fifo_priv *priv = dev_priv->Engine.fifo.priv; + struct nv50_fifo_priv *priv = dev_priv->engine.fifo.priv; DRM_DEBUG("\n"); @@ -211,7 +211,7 @@ nv50_fifo_takedown(struct drm_device *dev) nouveau_gpuobj_ref_del(dev, &priv->thingo[0]); nouveau_gpuobj_ref_del(dev, &priv->thingo[1]); - dev_priv->Engine.fifo.priv = NULL; + dev_priv->engine.fifo.priv = NULL; drm_free(priv, sizeof(*priv), DRM_MEM_DRIVER); } diff --git a/shared-core/nv50_instmem.c b/shared-core/nv50_instmem.c index e89df2e..393d557 100644 --- a/shared-core/nv50_instmem.c +++ b/shared-core/nv50_instmem.c @@ -67,7 +67,7 @@ nv50_instmem_init(struct drm_device *dev) priv = drm_calloc(1, sizeof(*priv), DRM_MEM_DRIVER); if (!priv) return -ENOMEM; - dev_priv->Engine.instmem.priv = priv; + dev_priv->engine.instmem.priv = priv; /* Save state, will restore at takedown. */ for (i = 0x1700; i <= 0x1710; i+=4) @@ -201,7 +201,7 @@ void nv50_instmem_takedown(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; - nv50_instmem_priv *priv = dev_priv->Engine.instmem.priv; + nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; struct nouveau_channel *chan = dev_priv->fifos[0]; int i; @@ -228,7 +228,7 @@ nv50_instmem_takedown(struct drm_device *dev) drm_free(chan, sizeof(*chan), DRM_MEM_DRIVER); } - dev_priv->Engine.instmem.priv = NULL; + dev_priv->engine.instmem.priv = NULL; drm_free(priv, sizeof(*priv), DRM_MEM_DRIVER); } @@ -261,7 +261,7 @@ nv50_instmem_clear(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) if (gpuobj && gpuobj->im_backing) { if (gpuobj->im_bound) - dev_priv->Engine.instmem.unbind(dev, gpuobj); + dev_priv->engine.instmem.unbind(dev, gpuobj); nouveau_mem_free(dev, gpuobj->im_backing); gpuobj->im_backing = NULL; } @@ -271,7 +271,7 @@ int nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) { struct drm_nouveau_private *dev_priv = dev->dev_private; - nv50_instmem_priv *priv = dev_priv->Engine.instmem.priv; + nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; uint32_t pte, pte_end, vram; if (!gpuobj->im_backing || !gpuobj->im_pramin || gpuobj->im_bound) @@ -312,7 +312,7 @@ int nv50_instmem_unbind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) { struct drm_nouveau_private *dev_priv = dev->dev_private; - nv50_instmem_priv *priv = dev_priv->Engine.instmem.priv; + nv50_instmem_priv *priv = dev_priv->engine.instmem.priv; uint32_t pte, pte_end; if (gpuobj->im_bound == 0) |