diff --git a/packages/linux/patches/110-linux-2.6.36-drm_nouveau_upstream-20101024.diff b/packages/linux/patches/110-linux-2.6.36-drm_nouveau_upstream-20101025.diff similarity index 95% rename from packages/linux/patches/110-linux-2.6.36-drm_nouveau_upstream-20101024.diff rename to packages/linux/patches/110-linux-2.6.36-drm_nouveau_upstream-20101025.diff index 88eef980aa..e453a52ee3 100644 --- a/packages/linux/patches/110-linux-2.6.36-drm_nouveau_upstream-20101024.diff +++ b/packages/linux/patches/110-linux-2.6.36-drm_nouveau_upstream-20101025.diff @@ -1,6 +1,6 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/Kconfig linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/Kconfig --- linux-2.6.36/drivers/gpu/drm/nouveau/Kconfig 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/Kconfig 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/Kconfig 2010-10-26 02:30:09.000000000 +0200 @@ -10,6 +10,7 @@ select FB select FRAMEBUFFER_CONSOLE if !EMBEDDED @@ -11,7 +11,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/Kconfig linux-2.6.36.nouveau/dri diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/Makefile linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/Makefile --- linux-2.6.36/drivers/gpu/drm/nouveau/Makefile 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/Makefile 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/Makefile 2010-10-26 02:30:09.000000000 +0200 @@ -9,7 +9,8 @@ nouveau_bo.o nouveau_fence.o nouveau_gem.o nouveau_ttm.o \ nouveau_hw.o nouveau_calc.o nouveau_bios.o nouveau_i2c.o \ @@ -42,7 +42,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/Makefile linux-2.6.36.nouveau/dr nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_acpi.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_acpi.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_acpi.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_acpi.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_acpi.c 2010-10-26 02:30:09.000000000 +0200 @@ -292,6 +292,6 @@ if (ret < 0) return ret; @@ -53,7 +53,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_acpi.c linux-2.6.36.nouv } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bios.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_bios.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bios.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_bios.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_bios.c 2010-10-26 02:30:09.000000000 +0200 @@ -43,9 +43,6 @@ #define BIOSLOG(sip, fmt, arg...) NV_DEBUG(sip->dev, fmt, ##arg) #define LOG_OLD_VALUE(x) @@ -603,7 +603,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bios.c linux-2.6.36.nouv if (ret) diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bios.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_bios.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bios.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_bios.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_bios.h 2010-10-26 02:30:09.000000000 +0200 @@ -34,6 +34,20 @@ #define DCB_LOC_ON_CHIP 0 @@ -674,7 +674,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bios.h linux-2.6.36.nouv diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_bo.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_bo.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_bo.c 2010-10-26 02:30:09.000000000 +0200 @@ -36,21 +36,6 @@ #include #include @@ -697,7 +697,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea static void nouveau_bo_del_ttm(struct ttm_buffer_object *bo) { -@@ -58,8 +43,6 @@ +@@ -58,14 +43,10 @@ struct drm_device *dev = dev_priv->dev; struct nouveau_bo *nvbo = nouveau_bo(bo); @@ -706,7 +706,14 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea if (unlikely(nvbo->gem)) DRM_ERROR("bo %p still attached to GEM object\n", bo); -@@ -160,12 +143,12 @@ +- if (nvbo->tile) +- nv10_mem_expire_tiling(dev, nvbo->tile, NULL); +- ++ nv10_mem_put_tile_region(dev, nvbo->tile, NULL); + kfree(nvbo); + } + +@@ -160,12 +141,12 @@ nvbo->no_vm = no_vm; nvbo->tile_mode = tile_mode; nvbo->tile_flags = tile_flags; @@ -722,7 +729,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea nouveau_bo_placement_set(nvbo, flags, 0); nvbo->channel = chan; -@@ -195,6 +178,31 @@ +@@ -195,6 +176,31 @@ pl[(*n)++] = TTM_PL_FLAG_SYSTEM | flags; } @@ -754,7 +761,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea void nouveau_bo_placement_set(struct nouveau_bo *nvbo, uint32_t type, uint32_t busy) { -@@ -209,6 +217,8 @@ +@@ -209,6 +215,8 @@ pl->busy_placement = nvbo->busy_placements; set_placement_list(nvbo->busy_placements, &pl->num_busy_placement, type | busy, flags); @@ -763,7 +770,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea } int -@@ -305,7 +315,8 @@ +@@ -305,7 +313,8 @@ void nouveau_bo_unmap(struct nouveau_bo *nvbo) { @@ -773,7 +780,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea } u16 -@@ -399,14 +410,19 @@ +@@ -399,14 +408,19 @@ man->default_caching = TTM_PL_FLAG_CACHED; break; case TTM_PL_VRAM: @@ -794,7 +801,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea switch (dev_priv->gart_info.type) { case NOUVEAU_GART_AGP: man->flags = TTM_MEMTYPE_FLAG_MAPPABLE; -@@ -469,19 +485,19 @@ +@@ -469,19 +483,19 @@ if (ret) return ret; @@ -821,7 +828,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea if (mem->mem_type == TTM_PL_TT) return NvDmaGART; return NvDmaVRAM; -@@ -493,87 +509,191 @@ +@@ -493,87 +507,191 @@ } static int @@ -1042,7 +1049,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea + chan = nvbo->channel; + if (!chan || nvbo->no_vm) { + chan = dev_priv->channel; -+ mutex_lock(&chan->mutex); ++ mutex_lock_nested(&chan->mutex, NOUVEAU_KCHANNEL_MUTEX); + } + + if (dev_priv->card_type < NV_50) @@ -1061,7 +1068,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea } static int -@@ -606,12 +726,7 @@ +@@ -606,12 +724,7 @@ ret = ttm_bo_move_ttm(bo, evict, no_wait_reserve, no_wait_gpu, new_mem); out: @@ -1075,7 +1082,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea return ret; } -@@ -644,12 +759,7 @@ +@@ -644,12 +757,7 @@ goto out; out: @@ -1089,7 +1096,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea return ret; } -@@ -669,12 +779,13 @@ +@@ -669,19 +777,21 @@ return 0; } @@ -1105,7 +1112,27 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea offset); if (ret) return ret; -@@ -719,12 +830,6 @@ + + } else if (dev_priv->card_type >= NV_10) { + *new_tile = nv10_mem_set_tiling(dev, offset, new_mem->size, +- nvbo->tile_mode); ++ nvbo->tile_mode, ++ nvbo->tile_flags); + } + + return 0; +@@ -697,9 +807,7 @@ + + if (dev_priv->card_type >= NV_10 && + dev_priv->card_type < NV_50) { +- if (*old_tile) +- nv10_mem_expire_tiling(dev, *old_tile, bo->sync_obj); +- ++ nv10_mem_put_tile_region(dev, *old_tile, bo->sync_obj); + *old_tile = new_tile; + } + } +@@ -719,12 +827,6 @@ if (ret) return ret; @@ -1118,7 +1145,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea /* Fake bo copy. */ if (old_mem->mem_type == TTM_PL_SYSTEM && !bo->ttm) { BUG_ON(bo->mem.mm_node != NULL); -@@ -733,6 +838,12 @@ +@@ -733,6 +835,12 @@ goto out; } @@ -1131,7 +1158,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea /* Hardware assisted copy. */ if (new_mem->mem_type == TTM_PL_SYSTEM) ret = nouveau_bo_move_flipd(bo, evict, intr, no_wait_reserve, no_wait_gpu, new_mem); -@@ -783,14 +894,14 @@ +@@ -783,14 +891,14 @@ case TTM_PL_TT: #if __OS_HAS_AGP if (dev_priv->gart_info.type == NOUVEAU_GART_AGP) { @@ -1148,7 +1175,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea mem->bus.base = pci_resource_start(dev->pdev, 1); mem->bus.is_iomem = true; break; -@@ -808,7 +919,39 @@ +@@ -808,7 +916,39 @@ static int nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo) { @@ -1189,7 +1216,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea } struct ttm_bo_driver nouveau_bo_driver = { -@@ -818,11 +961,11 @@ +@@ -818,11 +958,11 @@ .evict_flags = nouveau_bo_evict_flags, .move = nouveau_bo_move, .verify_access = nouveau_bo_verify_access, @@ -1208,7 +1235,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.36.nouvea .io_mem_free = &nouveau_ttm_io_mem_free, diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_calc.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_calc.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_calc.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_calc.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_calc.c 2010-10-26 02:30:09.000000000 +0200 @@ -198,8 +198,8 @@ struct drm_nouveau_private *dev_priv = dev->dev_private; struct nv_fifo_info fifo_data; @@ -1248,7 +1275,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_calc.c linux-2.6.36.nouv static int diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_channel.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_channel.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_channel.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_channel.c 2010-10-26 02:30:09.000000000 +0200 @@ -48,14 +48,14 @@ dev_priv->gart_info.aper_size, NV_DMA_ACCESS_RO, &pushbuf, @@ -1754,7 +1781,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.36.n int nouveau_max_ioctl = DRM_ARRAY_SIZE(nouveau_ioctls); diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_connector.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_connector.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_connector.c 2010-10-26 02:30:09.000000000 +0200 @@ -76,6 +76,22 @@ return NULL; } @@ -1815,32 +1842,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.6.36 static void nouveau_connector_set_encoder(struct drm_connector *connector, struct nouveau_encoder *nv_encoder) -@@ -167,6 +213,24 @@ - } - } - -+static bool -+nouveau_connector_poll_allowed(struct drm_connector *connector) -+{ -+ struct drm_device *dev = connector->dev; -+ struct drm_nouveau_private *dev_priv = dev->dev_private; -+ struct drm_crtc *crtc; -+ bool spare_crtc = false; -+ -+ if (dev_priv->card_type >= NV_50) { -+ return true; -+ } else { -+ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) -+ spare_crtc |= !crtc->enabled; -+ -+ return spare_crtc; -+ } -+} -+ - static enum drm_connector_status - nouveau_connector_detect(struct drm_connector *connector, bool force) - { -@@ -225,11 +289,18 @@ +@@ -225,11 +271,17 @@ return connector_status_connected; } @@ -1855,12 +1857,11 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.6.36 if (!nv_encoder && !nouveau_tv_disable) nv_encoder = find_encoder_by_type(connector, OUTPUT_TV); - if (nv_encoder) { -+ if (nv_encoder && -+ (force || nouveau_connector_poll_allowed(connector))) { ++ if (nv_encoder && force) { struct drm_encoder *encoder = to_drm_encoder(nv_encoder); struct drm_encoder_helper_funcs *helper = encoder->helper_private; -@@ -589,11 +660,28 @@ +@@ -589,11 +641,28 @@ return ret; } @@ -1890,7 +1891,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.6.36 struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder; struct drm_encoder *encoder = to_drm_encoder(nv_encoder); -@@ -611,11 +699,9 @@ +@@ -611,11 +680,9 @@ max_clock = 400000; break; case OUTPUT_TMDS: @@ -1905,7 +1906,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.6.36 break; case OUTPUT_ANALOG: max_clock = nv_encoder->dcb->crtconf.maxfreq; -@@ -630,7 +716,7 @@ +@@ -630,7 +697,7 @@ else max_clock = nv_encoder->dp.link_nr * 162000; @@ -1914,7 +1915,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.6.36 break; default: BUG_ON(1); -@@ -657,44 +743,6 @@ +@@ -657,44 +724,6 @@ return NULL; } @@ -1959,17 +1960,15 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.6.36 static const struct drm_connector_helper_funcs nouveau_connector_helper_funcs = { .get_modes = nouveau_connector_get_modes, -@@ -825,6 +873,9 @@ +@@ -820,6 +849,7 @@ + dev->mode_config.scaling_mode_property, + nv_connector->scaling_mode); + } ++ connector->polled = DRM_CONNECTOR_POLL_CONNECT; + /* fall-through */ + case DCB_CONNECTOR_TV_0: case DCB_CONNECTOR_TV_1: - case DCB_CONNECTOR_TV_3: - nv_connector->scaling_mode = DRM_MODE_SCALE_NONE; -+ -+ if (nv_gf4_disp_arch(dev)) -+ connector->polled = DRM_CONNECTOR_POLL_CONNECT; - break; - default: - nv_connector->scaling_mode = DRM_MODE_SCALE_FULLSCREEN; -@@ -836,11 +887,16 @@ +@@ -836,11 +866,16 @@ dev->mode_config.dithering_mode_property, nv_connector->use_dithering ? DRM_MODE_DITHERING_ON : DRM_MODE_DITHERING_OFF); @@ -1990,7 +1989,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.6.36 return dcb->drm; diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_connector.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_connector.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_connector.h 2010-10-26 02:30:09.000000000 +0200 @@ -52,7 +52,7 @@ struct drm_connector * nouveau_connector_create(struct drm_device *, int index); @@ -2003,7 +2002,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_connector.h linux-2.6.36 #endif /* __NOUVEAU_CONNECTOR_H__ */ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_debugfs.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_debugfs.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_debugfs.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_debugfs.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_debugfs.c 2010-10-26 02:30:09.000000000 +0200 @@ -157,7 +157,23 @@ return 0; } @@ -2030,7 +2029,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_debugfs.c linux-2.6.36.n { "vbios.rom", nouveau_debugfs_vbios_image, 0, NULL }, diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_display.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_display.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_display.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_display.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_display.c 2010-10-26 02:30:09.000000000 +0200 @@ -29,6 +29,9 @@ #include "nouveau_drv.h" #include "nouveau_fb.h" @@ -2251,7 +2250,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_display.c linux-2.6.36.n +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_dma.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_dma.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_dma.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_dma.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_dma.c 2010-10-26 02:30:09.000000000 +0200 @@ -28,6 +28,7 @@ #include "drm.h" #include "nouveau_drv.h" @@ -2328,7 +2327,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_dma.c linux-2.6.36.nouve return 0; diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_dma.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_dma.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_dma.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_dma.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_dma.h 2010-10-26 02:30:09.000000000 +0200 @@ -72,6 +72,7 @@ NvGdiRect = 0x8000000c, NvImageBlit = 0x8000000d, @@ -2339,7 +2338,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_dma.h linux-2.6.36.nouve NvEvoVRAM = 0x01000000, diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_dp.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_dp.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_dp.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_dp.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_dp.c 2010-10-26 02:30:09.000000000 +0200 @@ -317,7 +317,8 @@ return false; @@ -2376,7 +2375,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_dp.c linux-2.6.36.nouvea ret = -EBUSY; diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.c 2010-10-26 02:30:09.000000000 +0200 @@ -31,13 +31,14 @@ #include "nouveau_hw.h" #include "nouveau_fb.h" @@ -2504,8 +2503,23 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.c linux-2.6.36.nouve } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.h 2010-10-25 03:27:16.000000000 +0200 -@@ -96,10 +96,12 @@ ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.h 2010-10-26 02:30:09.000000000 +0200 +@@ -66,10 +66,11 @@ + #define NV50_VM_VRAM_NR (NV50_VM_MAX_VRAM / NV50_VM_BLOCK) + + struct nouveau_tile_reg { +- struct nouveau_fence *fence; +- uint32_t addr; +- uint32_t size; + bool used; ++ uint32_t addr; ++ uint32_t limit; ++ uint32_t pitch; ++ struct nouveau_fence *fence; + }; + + struct nouveau_bo { +@@ -96,10 +97,12 @@ struct nouveau_tile_reg *tile; struct drm_gem_object *gem; @@ -2519,7 +2533,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve static inline struct nouveau_bo * nouveau_bo(struct ttm_buffer_object *bo) { -@@ -130,25 +132,32 @@ +@@ -130,25 +133,32 @@ #define NVOBJ_ENGINE_SW 0 #define NVOBJ_ENGINE_GR 1 @@ -2558,7 +2572,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve uint32_t engine; uint32_t class; -@@ -157,20 +166,24 @@ +@@ -157,20 +167,29 @@ void *priv; }; @@ -2567,14 +2581,18 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve - - struct nouveau_gpuobj *gpuobj; - uint32_t instance; -- -- struct nouveau_channel *channel; -- int handle; +struct nouveau_page_flip_state { + struct list_head head; + struct drm_pending_vblank_event *event; + int crtc, bpp, pitch, x, y; + uint64_t offset; ++}; + +- struct nouveau_channel *channel; +- int handle; ++enum nouveau_channel_mutex_class { ++ NOUVEAU_UCHANNEL_MUTEX, ++ NOUVEAU_KCHANNEL_MUTEX }; struct nouveau_channel { @@ -2591,7 +2609,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve /* owner of this fifo */ struct drm_file *file_priv; /* mapping of the fifo itself */ -@@ -192,33 +205,33 @@ +@@ -192,33 +211,33 @@ } fence; /* DMA push buffer */ @@ -2638,7 +2656,11 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve /* GPU object info for stuff used in-kernel (mm_enabled) */ uint32_t m2mf_ntfy; -@@ -247,6 +260,7 @@ +@@ -244,9 +263,11 @@ + + struct { + struct nouveau_gpuobj *vblsem; ++ uint32_t vblsem_head; uint32_t vblsem_offset; uint32_t vblsem_rval; struct list_head vbl_wait; @@ -2646,7 +2668,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve } nvsw; struct { -@@ -265,7 +279,7 @@ +@@ -265,7 +286,7 @@ void (*resume)(struct drm_device *dev); int (*populate)(struct drm_device *, struct nouveau_gpuobj *, @@ -2655,7 +2677,19 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve void (*clear)(struct drm_device *, struct nouveau_gpuobj *); int (*bind)(struct drm_device *, struct nouveau_gpuobj *); int (*unbind)(struct drm_device *, struct nouveau_gpuobj *); -@@ -296,7 +310,7 @@ +@@ -289,14 +310,17 @@ + int (*init)(struct drm_device *dev); + void (*takedown)(struct drm_device *dev); + +- void (*set_region_tiling)(struct drm_device *dev, int i, uint32_t addr, +- uint32_t size, uint32_t pitch); ++ void (*init_tile_region)(struct drm_device *dev, int i, ++ uint32_t addr, uint32_t size, ++ uint32_t pitch, uint32_t flags); ++ void (*set_tile_region)(struct drm_device *dev, int i); ++ void (*free_tile_region)(struct drm_device *dev, int i); + }; + struct nouveau_fifo_engine { int channels; @@ -2664,7 +2698,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve int cur_playlist; int (*init)(struct drm_device *); -@@ -305,7 +319,6 @@ +@@ -305,7 +329,6 @@ void (*disable)(struct drm_device *); void (*enable)(struct drm_device *); bool (*reassign)(struct drm_device *, bool enable); @@ -2672,7 +2706,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve bool (*cache_pull)(struct drm_device *dev, bool enable); int (*channel_id)(struct drm_device *); -@@ -314,27 +327,16 @@ +@@ -314,27 +337,16 @@ void (*destroy_context)(struct nouveau_channel *); int (*load_context)(struct nouveau_channel *); int (*unload_context)(struct drm_device *); @@ -2703,15 +2737,19 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve int (*init)(struct drm_device *); void (*takedown)(struct drm_device *); -@@ -346,6 +348,7 @@ +@@ -346,9 +358,9 @@ void (*destroy_context)(struct nouveau_channel *); int (*load_context)(struct nouveau_channel *); int (*unload_context)(struct drm_device *); + void (*tlb_flush)(struct drm_device *dev); - void (*set_region_tiling)(struct drm_device *dev, int i, uint32_t addr, - uint32_t size, uint32_t pitch); -@@ -369,6 +372,102 @@ +- void (*set_region_tiling)(struct drm_device *dev, int i, uint32_t addr, +- uint32_t size, uint32_t pitch); ++ void (*set_tile_region)(struct drm_device *dev, int i); + }; + + struct nouveau_display_engine { +@@ -369,6 +381,102 @@ void (*irq_enable)(struct drm_device *, enum dcb_gpio_tag, bool on); }; @@ -2814,7 +2852,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve struct nouveau_engine { struct nouveau_instmem_engine instmem; struct nouveau_mc_engine mc; -@@ -378,6 +477,8 @@ +@@ -378,6 +486,8 @@ struct nouveau_fifo_engine fifo; struct nouveau_display_engine display; struct nouveau_gpio_engine gpio; @@ -2823,7 +2861,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve }; struct nouveau_pll_vals { -@@ -409,13 +510,13 @@ +@@ -409,13 +519,13 @@ }; struct nv04_crtc_reg { @@ -2839,7 +2877,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve /* PCRTC regs */ uint32_t fb_start; -@@ -463,43 +564,9 @@ +@@ -463,43 +573,9 @@ }; struct nv04_mode_state { @@ -2884,7 +2922,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve }; enum nouveau_card_type { -@@ -522,11 +589,20 @@ +@@ -522,11 +598,20 @@ int flags; void __iomem *mmio; @@ -2906,7 +2944,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve struct workqueue_struct *wq; struct work_struct irq_work; struct work_struct hpd_work; -@@ -540,8 +616,16 @@ +@@ -540,8 +625,16 @@ atomic_t validate_sequence; } ttm; @@ -2925,7 +2963,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve struct nouveau_engine engine; struct nouveau_channel *channel; -@@ -550,15 +634,11 @@ +@@ -550,15 +643,11 @@ spinlock_t context_switch_lock; /* RAMIN configuration, RAMFC, RAMHT and RAMRO offsets */ @@ -2945,16 +2983,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve struct { enum { -@@ -576,14 +656,12 @@ - } gart_info; - - /* nv10-nv40 tiling regions */ -- struct { -- struct nouveau_tile_reg reg[NOUVEAU_MAX_TILE_NR]; -- spinlock_t lock; -- } tile; -+ struct nouveau_tile_reg tile[NOUVEAU_MAX_TILE_NR]; - +@@ -584,6 +673,7 @@ /* VRAM/fb configuration */ uint64_t vram_size; uint64_t vram_sys_base; @@ -2962,7 +2991,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve uint64_t fb_phys; uint64_t fb_available_size; -@@ -600,10 +678,6 @@ +@@ -600,10 +690,6 @@ struct nouveau_gpuobj *vm_vram_pt[NV50_VM_VRAM_NR]; int vm_vram_pt_nr; @@ -2973,7 +3002,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve struct nvbios vbios; struct nv04_mode_state mode_reg; -@@ -619,6 +693,7 @@ +@@ -619,6 +705,7 @@ struct backlight_device *backlight; struct nouveau_channel *evo; @@ -2981,7 +3010,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve struct { struct dcb_entry *dcb; u16 script; -@@ -634,6 +709,12 @@ +@@ -634,6 +721,12 @@ }; static inline struct drm_nouveau_private * @@ -2994,7 +3023,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve nouveau_bdev(struct ttm_bo_device *bd) { return container_of(bd, struct drm_nouveau_private, ttm.bdev); -@@ -658,18 +739,8 @@ +@@ -658,18 +751,8 @@ return 0; } @@ -3014,7 +3043,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern int nouveau_duallink; extern int nouveau_uscript_lvds; extern int nouveau_uscript_tmds; -@@ -683,7 +754,11 @@ +@@ -683,7 +766,11 @@ extern int nouveau_ignorelid; extern int nouveau_nofbaccel; extern int nouveau_noaccel; @@ -3026,7 +3055,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state); extern int nouveau_pci_resume(struct pci_dev *pdev); -@@ -704,8 +779,10 @@ +@@ -704,18 +791,19 @@ extern int nouveau_card_init(struct drm_device *); /* nouveau_mem.c */ @@ -3039,7 +3068,23 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern int nouveau_mem_init_agp(struct drm_device *); extern int nouveau_mem_reset_agp(struct drm_device *); extern void nouveau_mem_close(struct drm_device *); -@@ -737,46 +814,54 @@ +-extern struct nouveau_tile_reg *nv10_mem_set_tiling(struct drm_device *dev, +- uint32_t addr, +- uint32_t size, +- uint32_t pitch); +-extern void nv10_mem_expire_tiling(struct drm_device *dev, +- struct nouveau_tile_reg *tile, +- struct nouveau_fence *fence); ++extern struct nouveau_tile_reg *nv10_mem_set_tiling( ++ struct drm_device *dev, uint32_t addr, uint32_t size, ++ uint32_t pitch, uint32_t flags); ++extern void nv10_mem_put_tile_region(struct drm_device *dev, ++ struct nouveau_tile_reg *tile, ++ struct nouveau_fence *fence); + extern int nv50_mem_vm_bind_linear(struct drm_device *, uint64_t virt, + uint32_t size, uint32_t flags, + uint64_t phys); +@@ -737,46 +825,54 @@ extern struct drm_ioctl_desc nouveau_ioctls[]; extern int nouveau_max_ioctl; extern void nouveau_channel_cleanup(struct drm_device *, struct drm_file *); @@ -3116,7 +3161,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern int nouveau_gpuobj_dma_new(struct nouveau_channel *, int class, uint64_t offset, uint64_t size, int access, int target, struct nouveau_gpuobj **); -@@ -786,14 +871,14 @@ +@@ -786,14 +882,14 @@ uint32_t *o_ret); extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, int class, struct nouveau_gpuobj **); @@ -3133,7 +3178,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern irqreturn_t nouveau_irq_handler(DRM_IRQ_ARGS); extern void nouveau_irq_preinstall(struct drm_device *); extern int nouveau_irq_postinstall(struct drm_device *); -@@ -879,6 +964,7 @@ +@@ -879,6 +975,7 @@ enum dcb_gpio_tag); extern struct dcb_connector_table_entry * nouveau_bios_connector_entry(struct drm_device *, int index); @@ -3141,10 +3186,33 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern int get_pll_limits(struct drm_device *, uint32_t limit_match, struct pll_lims *); extern int nouveau_bios_run_display_table(struct drm_device *, -@@ -925,6 +1011,10 @@ +@@ -913,18 +1010,29 @@ + /* nv10_fb.c */ + extern int nv10_fb_init(struct drm_device *); + extern void nv10_fb_takedown(struct drm_device *); +-extern void nv10_fb_set_region_tiling(struct drm_device *, int, uint32_t, +- uint32_t, uint32_t); ++extern void nv10_fb_init_tile_region(struct drm_device *dev, int i, ++ uint32_t addr, uint32_t size, ++ uint32_t pitch, uint32_t flags); ++extern void nv10_fb_set_tile_region(struct drm_device *dev, int i); ++extern void nv10_fb_free_tile_region(struct drm_device *dev, int i); + + /* nv30_fb.c */ + extern int nv30_fb_init(struct drm_device *); + extern void nv30_fb_takedown(struct drm_device *); ++extern void nv30_fb_init_tile_region(struct drm_device *dev, int i, ++ uint32_t addr, uint32_t size, ++ uint32_t pitch, uint32_t flags); ++extern void nv30_fb_free_tile_region(struct drm_device *dev, int i); + + /* nv40_fb.c */ + extern int nv40_fb_init(struct drm_device *); extern void nv40_fb_takedown(struct drm_device *); - extern void nv40_fb_set_region_tiling(struct drm_device *, int, uint32_t, - uint32_t, uint32_t); +-extern void nv40_fb_set_region_tiling(struct drm_device *, int, uint32_t, +- uint32_t, uint32_t); ++extern void nv40_fb_set_tile_region(struct drm_device *dev, int i); ++ +/* nv50_fb.c */ +extern int nv50_fb_init(struct drm_device *); +extern void nv50_fb_takedown(struct drm_device *); @@ -3152,7 +3220,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve /* nv50_fb.c */ extern int nv50_fb_init(struct drm_device *); -@@ -939,7 +1029,6 @@ +@@ -939,7 +1047,6 @@ extern void nv04_fifo_disable(struct drm_device *); extern void nv04_fifo_enable(struct drm_device *); extern bool nv04_fifo_reassign(struct drm_device *, bool); @@ -3160,7 +3228,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern bool nv04_fifo_cache_pull(struct drm_device *, bool); extern int nv04_fifo_channel_id(struct drm_device *); extern int nv04_fifo_create_context(struct nouveau_channel *); -@@ -951,14 +1040,12 @@ +@@ -951,14 +1058,12 @@ extern int nv10_fifo_init(struct drm_device *); extern int nv10_fifo_channel_id(struct drm_device *); extern int nv10_fifo_create_context(struct nouveau_channel *); @@ -3175,7 +3243,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern int nv40_fifo_load_context(struct nouveau_channel *); extern int nv40_fifo_unload_context(struct drm_device *); -@@ -970,6 +1057,7 @@ +@@ -970,6 +1075,7 @@ extern void nv50_fifo_destroy_context(struct nouveau_channel *); extern int nv50_fifo_load_context(struct nouveau_channel *); extern int nv50_fifo_unload_context(struct drm_device *); @@ -3183,7 +3251,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve /* nvc0_fifo.c */ extern int nvc0_fifo_init(struct drm_device *); -@@ -977,7 +1065,6 @@ +@@ -977,7 +1083,6 @@ extern void nvc0_fifo_disable(struct drm_device *); extern void nvc0_fifo_enable(struct drm_device *); extern bool nvc0_fifo_reassign(struct drm_device *, bool); @@ -3191,7 +3259,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern bool nvc0_fifo_cache_pull(struct drm_device *, bool); extern int nvc0_fifo_channel_id(struct drm_device *); extern int nvc0_fifo_create_context(struct nouveau_channel *); -@@ -986,7 +1073,6 @@ +@@ -986,7 +1091,6 @@ extern int nvc0_fifo_unload_context(struct drm_device *); /* nv04_graph.c */ @@ -3199,7 +3267,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern int nv04_graph_init(struct drm_device *); extern void nv04_graph_takedown(struct drm_device *); extern void nv04_graph_fifo_access(struct drm_device *, bool); -@@ -996,9 +1082,10 @@ +@@ -996,9 +1100,10 @@ extern int nv04_graph_load_context(struct nouveau_channel *); extern int nv04_graph_unload_context(struct drm_device *); extern void nv04_graph_context_switch(struct drm_device *); @@ -3211,8 +3279,13 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern int nv10_graph_init(struct drm_device *); extern void nv10_graph_takedown(struct drm_device *); extern struct nouveau_channel *nv10_graph_channel(struct drm_device *); -@@ -1011,8 +1098,6 @@ - uint32_t, uint32_t); +@@ -1007,12 +1112,9 @@ + extern int nv10_graph_load_context(struct nouveau_channel *); + extern int nv10_graph_unload_context(struct drm_device *); + extern void nv10_graph_context_switch(struct drm_device *); +-extern void nv10_graph_set_region_tiling(struct drm_device *, int, uint32_t, +- uint32_t, uint32_t); ++extern void nv10_graph_set_tile_region(struct drm_device *dev, int i); /* nv20_graph.c */ -extern struct nouveau_pgraph_object_class nv20_graph_grclass[]; @@ -3220,23 +3293,33 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern int nv20_graph_create_context(struct nouveau_channel *); extern void nv20_graph_destroy_context(struct nouveau_channel *); extern int nv20_graph_load_context(struct nouveau_channel *); -@@ -1024,7 +1109,6 @@ - uint32_t, uint32_t); +@@ -1020,11 +1122,9 @@ + extern int nv20_graph_init(struct drm_device *); + extern void nv20_graph_takedown(struct drm_device *); + extern int nv30_graph_init(struct drm_device *); +-extern void nv20_graph_set_region_tiling(struct drm_device *, int, uint32_t, +- uint32_t, uint32_t); ++extern void nv20_graph_set_tile_region(struct drm_device *dev, int i); /* nv40_graph.c */ -extern struct nouveau_pgraph_object_class nv40_graph_grclass[]; extern int nv40_graph_init(struct drm_device *); extern void nv40_graph_takedown(struct drm_device *); extern struct nouveau_channel *nv40_graph_channel(struct drm_device *); -@@ -1037,7 +1121,6 @@ - uint32_t, uint32_t); +@@ -1033,11 +1133,9 @@ + extern int nv40_graph_load_context(struct nouveau_channel *); + extern int nv40_graph_unload_context(struct drm_device *); + extern void nv40_grctx_init(struct nouveau_grctx *); +-extern void nv40_graph_set_region_tiling(struct drm_device *, int, uint32_t, +- uint32_t, uint32_t); ++extern void nv40_graph_set_tile_region(struct drm_device *dev, int i); /* nv50_graph.c */ -extern struct nouveau_pgraph_object_class nv50_graph_grclass[]; extern int nv50_graph_init(struct drm_device *); extern void nv50_graph_takedown(struct drm_device *); extern void nv50_graph_fifo_access(struct drm_device *, bool); -@@ -1048,6 +1131,8 @@ +@@ -1048,6 +1146,8 @@ extern int nv50_graph_unload_context(struct drm_device *); extern void nv50_graph_context_switch(struct drm_device *); extern int nv50_grctx_init(struct nouveau_grctx *); @@ -3245,7 +3328,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve /* nvc0_graph.c */ extern int nvc0_graph_init(struct drm_device *); -@@ -1059,13 +1144,20 @@ +@@ -1059,13 +1159,20 @@ extern int nvc0_graph_load_context(struct nouveau_channel *); extern int nvc0_graph_unload_context(struct drm_device *); @@ -3267,7 +3350,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve 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 *); -@@ -1077,7 +1169,7 @@ +@@ -1077,7 +1184,7 @@ extern int nv50_instmem_suspend(struct drm_device *); extern void nv50_instmem_resume(struct drm_device *); extern int nv50_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, @@ -3276,7 +3359,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve 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 *); -@@ -1091,7 +1183,7 @@ +@@ -1091,7 +1198,7 @@ extern int nvc0_instmem_suspend(struct drm_device *); extern void nvc0_instmem_resume(struct drm_device *); extern int nvc0_instmem_populate(struct drm_device *, struct nouveau_gpuobj *, @@ -3285,7 +3368,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve extern void nvc0_instmem_clear(struct drm_device *, struct nouveau_gpuobj *); extern int nvc0_instmem_bind(struct drm_device *, struct nouveau_gpuobj *); extern int nvc0_instmem_unbind(struct drm_device *, struct nouveau_gpuobj *); -@@ -1165,22 +1257,51 @@ +@@ -1165,22 +1272,51 @@ extern void nouveau_bo_wr16(struct nouveau_bo *nvbo, unsigned index, u16 val); extern u32 nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index); extern void nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val); @@ -3345,7 +3428,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve /* nouveau_gem.c */ extern int nouveau_gem_new(struct drm_device *, struct nouveau_channel *, -@@ -1200,6 +1321,14 @@ +@@ -1200,6 +1336,14 @@ extern int nouveau_gem_ioctl_info(struct drm_device *, void *, struct drm_file *); @@ -3360,7 +3443,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve /* nv10_gpio.c */ int nv10_gpio_get(struct drm_device *dev, enum dcb_gpio_tag tag); int nv10_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state); -@@ -1255,12 +1384,11 @@ +@@ -1255,12 +1399,11 @@ iowrite32_native(val, dev_priv->mmio + reg); } @@ -3376,7 +3459,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve } static inline u8 nv_rd08(struct drm_device *dev, unsigned reg) -@@ -1275,7 +1403,7 @@ +@@ -1275,7 +1418,7 @@ iowrite8(val, dev_priv->mmio + reg); } @@ -3385,7 +3468,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve nouveau_wait_until(dev, 2000000000ULL, (reg), (mask), (val)) /* PRAMIN access */ -@@ -1292,17 +1420,8 @@ +@@ -1292,17 +1435,8 @@ } /* object access */ @@ -3405,7 +3488,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve /* * Logging -@@ -1403,9 +1522,11 @@ +@@ -1403,9 +1537,11 @@ #define NV_SW_SEMAPHORE_OFFSET 0x00000064 #define NV_SW_SEMAPHORE_ACQUIRE 0x00000068 #define NV_SW_SEMAPHORE_RELEASE 0x0000006c @@ -3419,7 +3502,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.36.nouve #endif /* __NOUVEAU_DRV_H__ */ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_encoder.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_encoder.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_encoder.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_encoder.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_encoder.h 2010-10-26 02:30:09.000000000 +0200 @@ -55,6 +55,7 @@ int dpcd_version; int link_nr; @@ -3430,7 +3513,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_encoder.h linux-2.6.36.n }; diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_fbcon.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_fbcon.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.c 2010-10-26 02:30:09.000000000 +0200 @@ -49,6 +49,96 @@ #include "nouveau_fbcon.h" #include "nouveau_dma.h" @@ -3650,7 +3733,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_fbcon.c linux-2.6.36.nou diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_fbcon.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_fbcon.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.h 2010-10-26 02:30:09.000000000 +0200 @@ -40,13 +40,13 @@ void nouveau_fbcon_restore(void); @@ -3673,7 +3756,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_fbcon.h linux-2.6.36.nou void nouveau_fbcon_gpu_lockup(struct fb_info *info); diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_fence.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_fence.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_fence.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_fence.c 2010-10-26 02:30:09.000000000 +0200 @@ -28,9 +28,11 @@ #include "drm.h" @@ -4171,7 +4254,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.36.nou +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_gem.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_gem.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_gem.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_gem.c 2010-10-26 02:30:09.000000000 +0200 @@ -48,9 +48,6 @@ return; nvbo->gem = NULL; @@ -4522,7 +4605,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.36.nouve int diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_grctx.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_grctx.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_grctx.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_grctx.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_grctx.h 2010-10-26 02:30:09.000000000 +0200 @@ -126,7 +126,7 @@ reg = (reg - 0x00400000) / 4; reg = (reg - ctx->ctxprog_reg) + ctx->ctxvals_base; @@ -4534,7 +4617,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_grctx.h linux-2.6.36.nou diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_hw.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_hw.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_hw.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_hw.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_hw.c 2010-10-26 02:30:09.000000000 +0200 @@ -305,7 +305,7 @@ bool mpll = Preg == 0x4020; uint32_t oldPval = nvReadMC(dev, Preg); @@ -4686,7 +4769,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_hw.c linux-2.6.36.nouvea diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_hw.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_hw.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_hw.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_hw.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_hw.h 2010-10-26 02:30:09.000000000 +0200 @@ -416,6 +416,25 @@ } @@ -4715,7 +4798,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_hw.h linux-2.6.36.nouvea struct drm_nouveau_private *dev_priv = dev->dev_private; diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_i2c.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_i2c.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_i2c.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_i2c.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_i2c.c 2010-10-26 02:30:09.000000000 +0200 @@ -299,7 +299,10 @@ int @@ -4740,7 +4823,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_i2c.c linux-2.6.36.nouve } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_i2c.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_i2c.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_i2c.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_i2c.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_i2c.h 2010-10-26 02:30:09.000000000 +0200 @@ -44,7 +44,10 @@ struct nouveau_i2c_chan *nouveau_i2c_find(struct drm_device *, int index); bool nouveau_probe_i2c_addr(struct nouveau_i2c_chan *i2c, int addr); @@ -4755,7 +4838,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_i2c.h linux-2.6.36.nouve diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_irq.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_irq.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_irq.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_irq.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_irq.c 2010-10-26 02:30:09.000000000 +0200 @@ -35,12 +35,20 @@ #include "nouveau_drm.h" #include "nouveau_drv.h" @@ -5297,8 +5380,8 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_irq.c linux-2.6.36.nouve +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_mem.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_mem.c 2010-10-25 03:27:16.000000000 +0200 -@@ -33,7 +33,9 @@ ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_mem.c 2010-10-26 02:30:09.000000000 +0200 +@@ -33,92 +33,113 @@ #include "drmP.h" #include "drm.h" #include "drm_sarea.h" @@ -5308,75 +5391,157 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve /* * NV10-NV40 tiling helpers -@@ -47,18 +49,14 @@ + */ + + static void +-nv10_mem_set_region_tiling(struct drm_device *dev, int i, uint32_t addr, +- uint32_t size, uint32_t pitch) ++nv10_mem_update_tile_region(struct drm_device *dev, ++ struct nouveau_tile_reg *tile, uint32_t addr, ++ uint32_t size, uint32_t pitch, uint32_t flags) + { + struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo; struct nouveau_fb_engine *pfb = &dev_priv->engine.fb; struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; - struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; -+ struct nouveau_tile_reg *tile = &dev_priv->tile[i]; ++ int i = tile - dev_priv->tile.reg; ++ unsigned long save; - tile->addr = addr; - tile->size = size; - tile->used = !!pitch; +- tile->addr = addr; +- tile->size = size; +- tile->used = !!pitch; - nouveau_fence_unref((void **)&tile->fence); -- -- if (!pfifo->cache_flush(dev)) -- return; + nouveau_fence_unref(&tile->fence); +- if (!pfifo->cache_flush(dev)) +- return; ++ if (tile->pitch) ++ pfb->free_tile_region(dev, i); + ++ if (pitch) ++ pfb->init_tile_region(dev, i, addr, size, pitch, flags); ++ ++ spin_lock_irqsave(&dev_priv->context_switch_lock, save); pfifo->reassign(dev, false); - pfifo->cache_flush(dev); pfifo->cache_pull(dev, false); nouveau_wait_for_idle(dev); -@@ -76,34 +74,36 @@ + +- pgraph->set_region_tiling(dev, i, addr, size, pitch); +- pfb->set_region_tiling(dev, i, addr, size, pitch); ++ pfb->set_tile_region(dev, i); ++ pgraph->set_tile_region(dev, i); + + pfifo->cache_pull(dev, true); + pfifo->reassign(dev, true); ++ spin_unlock_irqrestore(&dev_priv->context_switch_lock, save); + } + +-struct nouveau_tile_reg * +-nv10_mem_set_tiling(struct drm_device *dev, uint32_t addr, uint32_t size, +- uint32_t pitch) ++static struct nouveau_tile_reg * ++nv10_mem_get_tile_region(struct drm_device *dev, int i) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_fb_engine *pfb = &dev_priv->engine.fb; +- struct nouveau_fb_engine *pfb = &dev_priv->engine.fb; - struct nouveau_tile_reg *tile = dev_priv->tile.reg, *found = NULL; - int i; -+ struct nouveau_tile_reg *found = NULL; -+ unsigned long i, flags; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; -- spin_lock(&dev_priv->tile.lock); -+ spin_lock_irqsave(&dev_priv->context_switch_lock, flags); + spin_lock(&dev_priv->tile.lock); - for (i = 0; i < pfb->num_tiles; i++) { +- for (i = 0; i < pfb->num_tiles; i++) { - if (tile[i].used) -+ struct nouveau_tile_reg *tile = &dev_priv->tile[i]; -+ -+ if (tile->used) - /* Tile region in use. */ - continue; +- /* Tile region in use. */ +- continue; ++ if (!tile->used && ++ (!tile->fence || nouveau_fence_signalled(tile->fence))) ++ tile->used = true; ++ else ++ tile = NULL; - if (tile[i].fence && - !nouveau_fence_signalled(tile[i].fence, NULL)) -+ if (tile->fence && -+ !nouveau_fence_signalled(tile->fence)) - /* Pending tile region. */ - continue; +- /* Pending tile region. */ +- continue; ++ spin_unlock(&dev_priv->tile.lock); ++ return tile; ++} - if (max(tile[i].addr, addr) < - min(tile[i].addr + tile[i].size, addr + size)) -+ if (max(tile->addr, addr) < -+ min(tile->addr + tile->size, addr + size)) - /* Kill an intersecting tile region. */ - nv10_mem_set_region_tiling(dev, i, 0, 0, 0); +- /* Kill an intersecting tile region. */ +- nv10_mem_set_region_tiling(dev, i, 0, 0, 0); ++void ++nv10_mem_put_tile_region(struct drm_device *dev, struct nouveau_tile_reg *tile, ++ struct nouveau_fence *fence) ++{ ++ struct drm_nouveau_private *dev_priv = dev->dev_private; - if (pitch && !found) { - /* Free tile region. */ - nv10_mem_set_region_tiling(dev, i, addr, size, pitch); +- if (pitch && !found) { +- /* Free tile region. */ +- nv10_mem_set_region_tiling(dev, i, addr, size, pitch); - found = &tile[i]; -+ found = tile; ++ if (tile) { ++ spin_lock(&dev_priv->tile.lock); ++ if (fence) { ++ /* Mark it as pending. */ ++ tile->fence = fence; ++ nouveau_fence_ref(fence); } - } +- } - spin_unlock(&dev_priv->tile.lock); -+ spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); - - return found; +- +- return found; ++ tile->used = false; ++ spin_unlock(&dev_priv->tile.lock); ++ } } -@@ -169,16 +169,17 @@ + +-void +-nv10_mem_expire_tiling(struct drm_device *dev, struct nouveau_tile_reg *tile, +- struct nouveau_fence *fence) ++struct nouveau_tile_reg * ++nv10_mem_set_tiling(struct drm_device *dev, uint32_t addr, uint32_t size, ++ uint32_t pitch, uint32_t flags) + { +- if (fence) { +- /* Mark it as pending. */ +- tile->fence = fence; +- nouveau_fence_ref(fence); ++ struct drm_nouveau_private *dev_priv = dev->dev_private; ++ struct nouveau_fb_engine *pfb = &dev_priv->engine.fb; ++ struct nouveau_tile_reg *tile, *found = NULL; ++ int i; ++ ++ for (i = 0; i < pfb->num_tiles; i++) { ++ tile = nv10_mem_get_tile_region(dev, i); ++ ++ if (pitch && !found) { ++ found = tile; ++ continue; ++ ++ } else if (tile && tile->pitch) { ++ /* Kill an unused tile region. */ ++ nv10_mem_update_tile_region(dev, tile, 0, 0, 0, 0); ++ } ++ ++ nv10_mem_put_tile_region(dev, tile, NULL); + } + +- tile->used = false; ++ if (found) ++ nv10_mem_update_tile_region(dev, found, addr, size, ++ pitch, flags); ++ return found; + } + + /* +@@ -169,16 +190,17 @@ virt += (end - pte); while (pte < end) { @@ -5399,7 +5564,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve nv50_vm_flush(dev, 6); return 0; } -@@ -203,14 +204,15 @@ +@@ -203,14 +225,15 @@ pages -= (end - pte); virt += (end - pte) << 15; @@ -5421,7 +5586,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve nv50_vm_flush(dev, 6); } -@@ -218,7 +220,7 @@ +@@ -218,7 +241,7 @@ * Cleanup everything */ void @@ -5430,7 +5595,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve { struct drm_nouveau_private *dev_priv = dev->dev_private; -@@ -229,6 +231,19 @@ +@@ -229,6 +252,19 @@ nouveau_ttm_global_release(dev_priv); @@ -5450,7 +5615,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve if (drm_core_has_AGP(dev) && dev->agp) { struct drm_agp_mem *entry, *tempe; -@@ -248,13 +263,6 @@ +@@ -248,13 +284,6 @@ dev->agp->acquired = 0; dev->agp->enabled = 0; } @@ -5464,7 +5629,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve } static uint32_t -@@ -305,8 +313,62 @@ +@@ -305,8 +334,62 @@ return 0; } @@ -5529,7 +5694,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve nouveau_mem_detect(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; -@@ -325,9 +387,18 @@ +@@ -325,9 +408,18 @@ dev_priv->vram_size = nv_rd32(dev, NV04_PFB_FIFO_DATA); dev_priv->vram_size |= (dev_priv->vram_size & 0xff) << 32; dev_priv->vram_size &= 0xffffffff00ll; @@ -5549,7 +5714,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve } } else { dev_priv->vram_size = nv_rd32(dev, 0x10f20c) << 20; -@@ -345,6 +416,33 @@ +@@ -345,6 +437,33 @@ return -ENOMEM; } @@ -5583,7 +5748,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve int nouveau_mem_reset_agp(struct drm_device *dev) { -@@ -355,7 +453,8 @@ +@@ -355,7 +474,8 @@ /* First of all, disable fast writes, otherwise if it's * already enabled in the AGP bridge and we disable the card's * AGP controller we might be locking ourselves out of it. */ @@ -5593,7 +5758,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve struct drm_agp_info info; struct drm_agp_mode mode; -@@ -363,7 +462,7 @@ +@@ -363,7 +483,7 @@ if (ret) return ret; @@ -5602,7 +5767,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve ret = drm_agp_enable(dev, mode); if (ret) return ret; -@@ -418,7 +517,7 @@ +@@ -418,7 +538,7 @@ } /* see agp.h for the AGPSTAT_* modes available */ @@ -5611,7 +5776,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve ret = drm_agp_enable(dev, mode); if (ret) { NV_ERROR(dev, "Unable to enable AGP: %d\n", ret); -@@ -433,24 +532,27 @@ +@@ -433,24 +553,27 @@ } int @@ -5636,18 +5801,18 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve - if (ret) { - NV_ERROR(dev, "Error setting DMA mask: %d\n", ret); + if (ret) - return ret; -- } ++ return ret; + + ret = nouveau_mem_detect(dev); + if (ret) -+ return ret; + return ret; +- } + + dev_priv->fb_phys = pci_resource_start(dev->pdev, 1); ret = nouveau_ttm_global_init(dev_priv); if (ret) -@@ -465,8 +567,6 @@ +@@ -465,8 +588,6 @@ return ret; } @@ -5656,7 +5821,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve dev_priv->fb_available_size = dev_priv->vram_size; dev_priv->fb_mappable_pages = dev_priv->fb_available_size; if (dev_priv->fb_mappable_pages > pci_resource_len(dev->pdev, 1)) -@@ -474,7 +574,16 @@ +@@ -474,7 +595,16 @@ pci_resource_len(dev->pdev, 1); dev_priv->fb_mappable_pages >>= PAGE_SHIFT; @@ -5674,7 +5839,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve dev_priv->fb_available_size -= dev_priv->ramin_rsvd_vram; dev_priv->fb_aper_free = dev_priv->fb_available_size; -@@ -495,9 +604,23 @@ +@@ -495,9 +625,23 @@ nouveau_bo_ref(NULL, &dev_priv->vga_ram); } @@ -5700,7 +5865,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve ret = nouveau_mem_init_agp(dev); if (ret) NV_ERROR(dev, "Error initialising AGP: %d\n", ret); -@@ -523,11 +646,150 @@ +@@ -523,11 +667,150 @@ return ret; } @@ -5745,7 +5910,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve + NV_DEBUG(dev, "BMP version too old for memory\n"); + return; + } - ++ + if (!mem) { + NV_DEBUG(dev, "memory timing table pointer invalid\n"); + return; @@ -5775,7 +5940,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve + struct nouveau_pm_memtiming *timing = &pm->memtimings.timing[i]; + if (entry[0] == 0) + continue; -+ + + tUNK_18 = 1; + tUNK_19 = 1; + tUNK_20 = 0; @@ -5857,7 +6022,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.36.nouve +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_notifier.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_notifier.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_notifier.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_notifier.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_notifier.c 2010-10-26 02:30:09.000000000 +0200 @@ -28,6 +28,7 @@ #include "drmP.h" #include "drm.h" @@ -5909,7 +6074,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_notifier.c linux-2.6.36. } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_object.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_object.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_object.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_object.c 2010-10-26 02:30:09.000000000 +0200 @@ -34,6 +34,84 @@ #include "drm.h" #include "nouveau_drv.h" @@ -7253,7 +7418,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.36.no } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_perf.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_perf.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_perf.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_perf.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_perf.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,205 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -7462,7 +7627,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_perf.c linux-2.6.36.nouv +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_pm.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_pm.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_pm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_pm.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_pm.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,548 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -8014,7 +8179,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_pm.c linux-2.6.36.nouvea +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_pm.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_pm.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_pm.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_pm.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_pm.h 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,74 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -8092,7 +8257,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_pm.h linux-2.6.36.nouvea +#endif diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_ramht.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_ramht.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,307 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -8403,7 +8568,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_ramht.c linux-2.6.36.nou +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_ramht.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_ramht.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.h 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,55 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -8462,7 +8627,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_ramht.h linux-2.6.36.nou +#endif diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_reg.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_reg.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_reg.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_reg.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_reg.h 2010-10-26 02:30:09.000000000 +0200 @@ -332,6 +332,7 @@ #define NV04_PGRAPH_BSWIZZLE5 0x004006A0 #define NV03_PGRAPH_STATUS 0x004006B0 @@ -8575,7 +8740,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_reg.h linux-2.6.36.nouve #define NV50_PDISPLAY_CRTC_CLK_CTRL1(i) ((i) * 0x800 + 0x614100) diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_sgdma.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_sgdma.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_sgdma.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_sgdma.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_sgdma.c 2010-10-26 02:30:09.000000000 +0200 @@ -95,9 +95,9 @@ struct nouveau_gpuobj *gpuobj = dev_priv->gart_info.sg_ctxdma; unsigned i, j, pte; @@ -8751,7 +8916,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_sgdma.c linux-2.6.36.nou diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_state.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_state.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_state.c 2010-10-26 02:30:09.000000000 +0200 @@ -35,6 +35,8 @@ #include "nouveau_drv.h" #include "nouveau_drm.h" @@ -8789,15 +8954,27 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou break; case 0x10: engine->instmem.init = nv04_instmem_init; -@@ -114,7 +119,6 @@ +@@ -113,8 +118,9 @@ + engine->timer.takedown = nv04_timer_takedown; engine->fb.init = nv10_fb_init; engine->fb.takedown = nv10_fb_takedown; - engine->fb.set_region_tiling = nv10_fb_set_region_tiling; +- engine->fb.set_region_tiling = nv10_fb_set_region_tiling; - engine->graph.grclass = nv10_graph_grclass; ++ engine->fb.init_tile_region = nv10_fb_init_tile_region; ++ engine->fb.set_tile_region = nv10_fb_set_tile_region; ++ engine->fb.free_tile_region = nv10_fb_free_tile_region; engine->graph.init = nv10_graph_init; engine->graph.takedown = nv10_graph_takedown; engine->graph.channel = nv10_graph_channel; -@@ -130,11 +134,10 @@ +@@ -123,18 +129,17 @@ + engine->graph.fifo_access = nv04_graph_fifo_access; + engine->graph.load_context = nv10_graph_load_context; + engine->graph.unload_context = nv10_graph_unload_context; +- engine->graph.set_region_tiling = nv10_graph_set_region_tiling; ++ engine->graph.set_tile_region = nv10_graph_set_tile_region; + engine->fifo.channels = 32; + engine->fifo.init = nv10_fifo_init; + engine->fifo.takedown = nouveau_stub_takedown; engine->fifo.disable = nv04_fifo_disable; engine->fifo.enable = nv04_fifo_enable; engine->fifo.reassign = nv04_fifo_reassign; @@ -8810,7 +8987,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou engine->fifo.load_context = nv10_fifo_load_context; engine->fifo.unload_context = nv10_fifo_unload_context; engine->display.early_init = nv04_display_early_init; -@@ -147,6 +150,11 @@ +@@ -147,6 +152,11 @@ engine->gpio.get = nv10_gpio_get; engine->gpio.set = nv10_gpio_set; engine->gpio.irq_enable = NULL; @@ -8822,15 +8999,27 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou break; case 0x20: engine->instmem.init = nv04_instmem_init; -@@ -166,7 +174,6 @@ +@@ -165,8 +175,9 @@ + engine->timer.takedown = nv04_timer_takedown; engine->fb.init = nv10_fb_init; engine->fb.takedown = nv10_fb_takedown; - engine->fb.set_region_tiling = nv10_fb_set_region_tiling; +- engine->fb.set_region_tiling = nv10_fb_set_region_tiling; - engine->graph.grclass = nv20_graph_grclass; ++ engine->fb.init_tile_region = nv10_fb_init_tile_region; ++ engine->fb.set_tile_region = nv10_fb_set_tile_region; ++ engine->fb.free_tile_region = nv10_fb_free_tile_region; engine->graph.init = nv20_graph_init; engine->graph.takedown = nv20_graph_takedown; engine->graph.channel = nv10_graph_channel; -@@ -182,11 +189,10 @@ +@@ -175,18 +186,17 @@ + engine->graph.fifo_access = nv04_graph_fifo_access; + engine->graph.load_context = nv20_graph_load_context; + engine->graph.unload_context = nv20_graph_unload_context; +- engine->graph.set_region_tiling = nv20_graph_set_region_tiling; ++ engine->graph.set_tile_region = nv20_graph_set_tile_region; + engine->fifo.channels = 32; + engine->fifo.init = nv10_fifo_init; + engine->fifo.takedown = nouveau_stub_takedown; engine->fifo.disable = nv04_fifo_disable; engine->fifo.enable = nv04_fifo_enable; engine->fifo.reassign = nv04_fifo_reassign; @@ -8843,7 +9032,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou engine->fifo.load_context = nv10_fifo_load_context; engine->fifo.unload_context = nv10_fifo_unload_context; engine->display.early_init = nv04_display_early_init; -@@ -199,6 +205,11 @@ +@@ -199,6 +209,11 @@ engine->gpio.get = nv10_gpio_get; engine->gpio.set = nv10_gpio_set; engine->gpio.irq_enable = NULL; @@ -8855,15 +9044,27 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou break; case 0x30: engine->instmem.init = nv04_instmem_init; -@@ -218,7 +229,6 @@ +@@ -217,8 +232,9 @@ + engine->timer.takedown = nv04_timer_takedown; engine->fb.init = nv30_fb_init; engine->fb.takedown = nv30_fb_takedown; - engine->fb.set_region_tiling = nv10_fb_set_region_tiling; +- engine->fb.set_region_tiling = nv10_fb_set_region_tiling; - engine->graph.grclass = nv30_graph_grclass; ++ engine->fb.init_tile_region = nv30_fb_init_tile_region; ++ engine->fb.set_tile_region = nv10_fb_set_tile_region; ++ engine->fb.free_tile_region = nv30_fb_free_tile_region; engine->graph.init = nv30_graph_init; engine->graph.takedown = nv20_graph_takedown; engine->graph.fifo_access = nv04_graph_fifo_access; -@@ -234,11 +244,10 @@ +@@ -227,18 +243,17 @@ + engine->graph.destroy_context = nv20_graph_destroy_context; + engine->graph.load_context = nv20_graph_load_context; + engine->graph.unload_context = nv20_graph_unload_context; +- engine->graph.set_region_tiling = nv20_graph_set_region_tiling; ++ engine->graph.set_tile_region = nv20_graph_set_tile_region; + engine->fifo.channels = 32; + engine->fifo.init = nv10_fifo_init; + engine->fifo.takedown = nouveau_stub_takedown; engine->fifo.disable = nv04_fifo_disable; engine->fifo.enable = nv04_fifo_enable; engine->fifo.reassign = nv04_fifo_reassign; @@ -8876,7 +9077,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou engine->fifo.load_context = nv10_fifo_load_context; engine->fifo.unload_context = nv10_fifo_unload_context; engine->display.early_init = nv04_display_early_init; -@@ -251,6 +260,13 @@ +@@ -251,6 +266,13 @@ engine->gpio.get = nv10_gpio_get; engine->gpio.set = nv10_gpio_set; engine->gpio.irq_enable = NULL; @@ -8890,15 +9091,27 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou break; case 0x40: case 0x60: -@@ -271,7 +287,6 @@ +@@ -270,8 +292,9 @@ + engine->timer.takedown = nv04_timer_takedown; engine->fb.init = nv40_fb_init; engine->fb.takedown = nv40_fb_takedown; - engine->fb.set_region_tiling = nv40_fb_set_region_tiling; +- engine->fb.set_region_tiling = nv40_fb_set_region_tiling; - engine->graph.grclass = nv40_graph_grclass; ++ engine->fb.init_tile_region = nv30_fb_init_tile_region; ++ engine->fb.set_tile_region = nv40_fb_set_tile_region; ++ engine->fb.free_tile_region = nv30_fb_free_tile_region; engine->graph.init = nv40_graph_init; engine->graph.takedown = nv40_graph_takedown; engine->graph.fifo_access = nv04_graph_fifo_access; -@@ -287,11 +302,10 @@ +@@ -280,18 +303,17 @@ + engine->graph.destroy_context = nv40_graph_destroy_context; + engine->graph.load_context = nv40_graph_load_context; + engine->graph.unload_context = nv40_graph_unload_context; +- engine->graph.set_region_tiling = nv40_graph_set_region_tiling; ++ engine->graph.set_tile_region = nv40_graph_set_tile_region; + engine->fifo.channels = 32; + engine->fifo.init = nv40_fifo_init; + engine->fifo.takedown = nouveau_stub_takedown; engine->fifo.disable = nv04_fifo_disable; engine->fifo.enable = nv04_fifo_enable; engine->fifo.reassign = nv04_fifo_reassign; @@ -8911,7 +9124,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou engine->fifo.load_context = nv40_fifo_load_context; engine->fifo.unload_context = nv40_fifo_unload_context; engine->display.early_init = nv04_display_early_init; -@@ -304,6 +318,14 @@ +@@ -304,6 +326,14 @@ engine->gpio.get = nv10_gpio_get; engine->gpio.set = nv10_gpio_set; engine->gpio.irq_enable = NULL; @@ -8926,7 +9139,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou break; case 0x50: case 0x80: /* gotta love NVIDIA's consistency.. */ -@@ -328,7 +350,6 @@ +@@ -328,7 +358,6 @@ engine->timer.takedown = nv04_timer_takedown; engine->fb.init = nv50_fb_init; engine->fb.takedown = nv50_fb_takedown; @@ -8934,7 +9147,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou engine->graph.init = nv50_graph_init; engine->graph.takedown = nv50_graph_takedown; engine->graph.fifo_access = nv50_graph_fifo_access; -@@ -337,6 +358,15 @@ +@@ -337,6 +366,15 @@ engine->graph.destroy_context = nv50_graph_destroy_context; engine->graph.load_context = nv50_graph_load_context; engine->graph.unload_context = nv50_graph_unload_context; @@ -8950,7 +9163,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou engine->fifo.channels = 128; engine->fifo.init = nv50_fifo_init; engine->fifo.takedown = nv50_fifo_takedown; -@@ -348,6 +378,7 @@ +@@ -348,6 +386,7 @@ engine->fifo.destroy_context = nv50_fifo_destroy_context; engine->fifo.load_context = nv50_fifo_load_context; engine->fifo.unload_context = nv50_fifo_unload_context; @@ -8958,7 +9171,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou engine->display.early_init = nv50_display_early_init; engine->display.late_takedown = nv50_display_late_takedown; engine->display.create = nv50_display_create; -@@ -358,6 +389,50 @@ +@@ -358,6 +397,50 @@ engine->gpio.get = nv50_gpio_get; engine->gpio.set = nv50_gpio_set; engine->gpio.irq_enable = nv50_gpio_irq_enable; @@ -9009,7 +9222,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou break; case 0xC0: engine->instmem.init = nvc0_instmem_init; -@@ -376,7 +451,6 @@ +@@ -376,7 +459,6 @@ engine->timer.takedown = nv04_timer_takedown; engine->fb.init = nvc0_fb_init; engine->fb.takedown = nvc0_fb_takedown; @@ -9017,7 +9230,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou engine->graph.init = nvc0_graph_init; engine->graph.takedown = nvc0_graph_takedown; engine->graph.fifo_access = nvc0_graph_fifo_access; -@@ -406,6 +480,8 @@ +@@ -406,6 +488,8 @@ engine->gpio.get = nv50_gpio_get; engine->gpio.set = nv50_gpio_set; engine->gpio.irq_enable = nv50_gpio_irq_enable; @@ -9026,7 +9239,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou break; default: NV_ERROR(dev, "NV%02x unsupported\n", dev_priv->chipset); -@@ -437,16 +513,14 @@ +@@ -437,16 +521,14 @@ nouveau_card_init_channel(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; @@ -9045,7 +9258,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou ret = nouveau_gpuobj_dma_new(dev_priv->channel, NV_CLASS_DMA_IN_MEMORY, 0, dev_priv->vram_size, NV_DMA_ACCESS_RW, NV_DMA_TARGET_VIDMEM, -@@ -454,28 +528,27 @@ +@@ -454,28 +536,27 @@ if (ret) goto out_err; @@ -9081,15 +9294,16 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou return ret; } -@@ -522,6 +595,7 @@ +@@ -522,6 +603,8 @@ if (ret) goto out; engine = &dev_priv->engine; + spin_lock_init(&dev_priv->channels.lock); ++ spin_lock_init(&dev_priv->tile.lock); spin_lock_init(&dev_priv->context_switch_lock); /* Make the CRTCs and I2C buses accessible */ -@@ -534,35 +608,28 @@ +@@ -534,35 +617,28 @@ if (ret) goto out_display_early; @@ -9133,7 +9347,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou /* PGPIO */ ret = engine->gpio.init(dev); -@@ -587,33 +654,39 @@ +@@ -587,33 +663,39 @@ if (ret) goto out_fb; @@ -9182,7 +9396,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou } ret = nouveau_backlight_init(dev); -@@ -624,13 +697,19 @@ +@@ -624,13 +706,19 @@ drm_kms_helper_poll_init(dev); return 0; @@ -9204,7 +9418,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou out_graph: if (!nouveau_noaccel) engine->graph.takedown(dev); -@@ -642,16 +721,16 @@ +@@ -642,16 +730,16 @@ engine->gpio.takedown(dev); out_mc: engine->mc.takedown(dev); @@ -9228,7 +9442,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou nouveau_bios_takedown(dev); out_display_early: engine->display.late_takedown(dev); -@@ -667,13 +746,14 @@ +@@ -667,13 +755,14 @@ nouveau_backlight_exit(dev); @@ -9246,7 +9460,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou engine->graph.takedown(dev); } engine->fb.takedown(dev); -@@ -686,15 +766,16 @@ +@@ -686,15 +775,16 @@ ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM); ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_TT); mutex_unlock(&dev->struct_mutex); @@ -9268,7 +9482,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou nouveau_bios_takedown(dev); vga_client_register(dev->pdev, NULL, NULL, NULL); -@@ -1006,6 +1087,12 @@ +@@ -1006,6 +1096,12 @@ case NOUVEAU_GETPARAM_PTIMER_TIME: getparam->value = dev_priv->engine.timer.read(dev); break; @@ -9281,7 +9495,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou case NOUVEAU_GETPARAM_GRAPH_UNITS: /* NV40 and NV50 versions are quite different, but register * address is the same. User is supposed to know the card -@@ -1016,7 +1103,7 @@ +@@ -1016,7 +1112,7 @@ } /* FALLTHRU */ default: @@ -9290,7 +9504,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou return -EINVAL; } -@@ -1031,7 +1118,7 @@ +@@ -1031,7 +1127,7 @@ switch (setparam->param) { default: @@ -9299,7 +9513,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou return -EINVAL; } -@@ -1057,7 +1144,13 @@ +@@ -1057,7 +1153,13 @@ /* Waits for PGRAPH to go completely idle */ bool nouveau_wait_for_idle(struct drm_device *dev) { @@ -9316,7 +9530,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.36.nou return false; diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_temp.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_temp.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_temp.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_temp.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_temp.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,309 @@ +/* + * Copyright 2010 PathScale inc. @@ -9629,7 +9843,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_temp.c linux-2.6.36.nouv +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_volt.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_volt.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_volt.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_volt.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nouveau_volt.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,212 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -9845,7 +10059,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nouveau_volt.c linux-2.6.36.nouv +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_crtc.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_crtc.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv04_crtc.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_crtc.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_crtc.c 2010-10-26 02:30:09.000000000 +0200 @@ -109,7 +109,7 @@ struct nouveau_pll_vals *pv = ®p->pllvals; struct pll_lims pll_lim; @@ -9886,7 +10100,23 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_crtc.c linux-2.6.36.nouveau /* Some misc regs */ if (dev_priv->card_type == NV_40) { -@@ -718,6 +716,7 @@ +@@ -673,6 +671,7 @@ + if (nv_two_heads(dev)) + NVSetOwner(dev, nv_crtc->index); + ++ drm_vblank_pre_modeset(dev, nv_crtc->index); + funcs->dpms(crtc, DRM_MODE_DPMS_OFF); + + NVBlankScreen(dev, nv_crtc->index, true); +@@ -705,6 +704,7 @@ + #endif + + funcs->dpms(crtc, DRM_MODE_DPMS_ON); ++ drm_vblank_post_modeset(dev, nv_crtc->index); + } + + static void nv_crtc_destroy(struct drm_crtc *crtc) +@@ -718,6 +718,7 @@ drm_crtc_cleanup(crtc); @@ -9894,7 +10124,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_crtc.c linux-2.6.36.nouveau nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo); kfree(nv_crtc); } -@@ -815,7 +814,7 @@ +@@ -815,7 +816,7 @@ /* Update the framebuffer location. */ regp->fb_start = nv_crtc->fb.offset & ~3; regp->fb_start += (y * drm_fb->pitch) + (x * drm_fb->bits_per_pixel / 8); @@ -9903,7 +10133,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_crtc.c linux-2.6.36.nouveau /* Update the arbitration parameters. */ nouveau_calc_arb(dev, crtc->mode.clock, drm_fb->bits_per_pixel, -@@ -826,7 +825,7 @@ +@@ -826,7 +827,7 @@ crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FF_INDEX); crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FFLWM__INDEX); @@ -9912,7 +10142,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_crtc.c linux-2.6.36.nouveau regp->CRTC[NV_CIO_CRE_47] = arb_lwm >> 8; crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_47); } -@@ -952,6 +951,7 @@ +@@ -952,6 +953,7 @@ .cursor_move = nv04_crtc_cursor_move, .gamma_set = nv_crtc_gamma_set, .set_config = drm_crtc_helper_set_config, @@ -9922,7 +10152,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_crtc.c linux-2.6.36.nouveau diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_dac.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_dac.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv04_dac.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_dac.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_dac.c 2010-10-26 02:30:09.000000000 +0200 @@ -291,6 +291,8 @@ msleep(5); @@ -9957,7 +10187,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_dac.c linux-2.6.36.nouveau/ struct drm_display_mode *adjusted_mode) diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_dfp.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_dfp.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv04_dfp.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_dfp.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_dfp.c 2010-10-26 02:30:09.000000000 +0200 @@ -104,6 +104,8 @@ } /* don't inadvertently turn it on when state written later */ @@ -10041,7 +10271,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_dfp.c linux-2.6.36.nouveau/ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_fbcon.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_fbcon.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv04_fbcon.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_fbcon.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_fbcon.c 2010-10-26 02:30:09.000000000 +0200 @@ -25,54 +25,42 @@ #include "drmP.h" #include "nouveau_drv.h" @@ -10191,7 +10421,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_fbcon.c linux-2.6.36.nouvea int diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_fifo.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv04_fifo.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_fifo.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_fifo.c 2010-10-26 02:30:09.000000000 +0200 @@ -27,8 +27,9 @@ #include "drmP.h" #include "drm.h" @@ -10359,7 +10589,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.36.nouveau } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_graph.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_graph.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv04_graph.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_graph.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_graph.c 2010-10-26 02:30:09.000000000 +0200 @@ -26,6 +26,9 @@ #include "drm.h" #include "nouveau_drm.h" @@ -11123,7 +11353,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_graph.c linux-2.6.36.nouvea - diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_instmem.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_instmem.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv04_instmem.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_instmem.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_instmem.c 2010-10-26 02:30:09.000000000 +0200 @@ -1,6 +1,7 @@ #include "drmP.h" #include "drm.h" @@ -11322,8 +11552,8 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_instmem.c linux-2.6.36.nouv diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_pm.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_pm.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv04_pm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_pm.c 2010-10-25 03:27:16.000000000 +0200 -@@ -0,0 +1,81 @@ ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_pm.c 2010-10-26 02:30:09.000000000 +0200 +@@ -0,0 +1,90 @@ +/* + * Copyright 2010 Red Hat Inc. + * @@ -11402,12 +11632,21 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_pm.c linux-2.6.36.nouveau/d + reg += 4; + + nouveau_hw_setpll(dev, reg, &state->calc); ++ ++ if (dev_priv->card_type < NV_30 && reg == NV_PRAMDAC_MPLL_COEFF) { ++ if (dev_priv->card_type == NV_20) ++ nv_mask(dev, 0x1002c4, 0, 1 << 20); ++ ++ /* Reset the DLLs */ ++ nv_mask(dev, 0x1002c0, 0, 1 << 8); ++ } ++ + kfree(state); +} + diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_tv.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_tv.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv04_tv.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_tv.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv04_tv.c 2010-10-26 02:30:09.000000000 +0200 @@ -49,8 +49,8 @@ int nv04_tv_identify(struct drm_device *dev, int i2c_index) @@ -11434,9 +11673,75 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv04_tv.c linux-2.6.36.nouveau/d NVWriteVgaCrtc(dev, head, NV_CIO_CRE_LCD__INDEX, state->CRTC[NV_CIO_CRE_LCD__INDEX]); +diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_fb.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv10_fb.c +--- linux-2.6.36/drivers/gpu/drm/nouveau/nv10_fb.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv10_fb.c 2010-10-26 02:30:09.000000000 +0200 +@@ -4,22 +4,40 @@ + #include "nouveau_drm.h" + + void +-nv10_fb_set_region_tiling(struct drm_device *dev, int i, uint32_t addr, +- uint32_t size, uint32_t pitch) ++nv10_fb_init_tile_region(struct drm_device *dev, int i, uint32_t addr, ++ uint32_t size, uint32_t pitch, uint32_t flags) + { + struct drm_nouveau_private *dev_priv = dev->dev_private; +- uint32_t limit = max(1u, addr + size) - 1; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; + +- if (pitch) { +- if (dev_priv->card_type >= NV_20) +- addr |= 1; +- else +- addr |= 1 << 31; +- } +- +- nv_wr32(dev, NV10_PFB_TLIMIT(i), limit); +- nv_wr32(dev, NV10_PFB_TSIZE(i), pitch); +- nv_wr32(dev, NV10_PFB_TILE(i), addr); ++ tile->addr = addr; ++ tile->limit = max(1u, addr + size) - 1; ++ tile->pitch = pitch; ++ ++ if (dev_priv->card_type == NV_20) ++ tile->addr |= 1; ++ else ++ tile->addr |= 1 << 31; ++} ++ ++void ++nv10_fb_free_tile_region(struct drm_device *dev, int i) ++{ ++ struct drm_nouveau_private *dev_priv = dev->dev_private; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; ++ ++ tile->addr = tile->limit = tile->pitch = 0; ++} ++ ++void ++nv10_fb_set_tile_region(struct drm_device *dev, int i) ++{ ++ struct drm_nouveau_private *dev_priv = dev->dev_private; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; ++ ++ nv_wr32(dev, NV10_PFB_TLIMIT(i), tile->limit); ++ nv_wr32(dev, NV10_PFB_TSIZE(i), tile->pitch); ++ nv_wr32(dev, NV10_PFB_TILE(i), tile->addr); + } + + int +@@ -33,7 +51,7 @@ + + /* Turn all the tiling regions off. */ + for (i = 0; i < pfb->num_tiles; i++) +- pfb->set_region_tiling(dev, i, 0, 0, 0); ++ pfb->set_tile_region(dev, i); + + return 0; + } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_fifo.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv10_fifo.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv10_fifo.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv10_fifo.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv10_fifo.c 2010-10-26 02:30:09.000000000 +0200 @@ -27,8 +27,9 @@ #include "drmP.h" #include "drm.h" @@ -11515,7 +11820,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_fifo.c linux-2.6.36.nouveau } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv10_graph.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv10_graph.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv10_graph.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv10_graph.c 2010-10-26 02:30:09.000000000 +0200 @@ -27,6 +27,8 @@ #include "nouveau_drm.h" #include "nouveau_drv.h" @@ -11545,7 +11850,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.36.nouvea } int nv10_graph_create_context(struct nouveau_channel *chan) -@@ -875,10 +877,25 @@ +@@ -875,37 +877,53 @@ void nv10_graph_destroy_context(struct nouveau_channel *chan) { @@ -11557,11 +11862,11 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.36.nouvea + + spin_lock_irqsave(&dev_priv->context_switch_lock, flags); + pgraph->fifo_access(dev, false); - ++ + /* Unload the context if it's the currently active one */ + if (pgraph->channel(dev) == chan) + pgraph->unload_context(dev); -+ + + /* Free the context resources */ kfree(pgraph_ctx); chan->pgraph_ctx = NULL; @@ -11571,7 +11876,26 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.36.nouvea } void -@@ -899,13 +916,17 @@ +-nv10_graph_set_region_tiling(struct drm_device *dev, int i, uint32_t addr, +- uint32_t size, uint32_t pitch) ++nv10_graph_set_tile_region(struct drm_device *dev, int i) + { +- uint32_t limit = max(1u, addr + size) - 1; +- +- if (pitch) +- addr |= 1 << 31; ++ struct drm_nouveau_private *dev_priv = dev->dev_private; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; + +- nv_wr32(dev, NV10_PGRAPH_TLIMIT(i), limit); +- nv_wr32(dev, NV10_PGRAPH_TSIZE(i), pitch); +- nv_wr32(dev, NV10_PGRAPH_TILE(i), addr); ++ nv_wr32(dev, NV10_PGRAPH_TLIMIT(i), tile->limit); ++ nv_wr32(dev, NV10_PGRAPH_TSIZE(i), tile->pitch); ++ nv_wr32(dev, NV10_PGRAPH_TILE(i), tile->addr); + } + + int nv10_graph_init(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; uint32_t tmp; @@ -11590,7 +11914,16 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.36.nouvea nv_wr32(dev, NV03_PGRAPH_INTR , 0xFFFFFFFF); nv_wr32(dev, NV03_PGRAPH_INTR_EN, 0xFFFFFFFF); -@@ -951,8 +972,8 @@ +@@ -928,7 +946,7 @@ + + /* Turn all the tiling regions off. */ + for (i = 0; i < NV10_PFB_TILE__SIZE; i++) +- nv10_graph_set_region_tiling(dev, i, 0, 0, 0); ++ nv10_graph_set_tile_region(dev, i); + + nv_wr32(dev, NV10_PGRAPH_CTX_SWITCH(0), 0x00000000); + nv_wr32(dev, NV10_PGRAPH_CTX_SWITCH(1), 0x00000000); +@@ -951,8 +969,8 @@ } static int @@ -11601,7 +11934,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.36.nouvea { struct drm_device *dev = chan->dev; struct graph_state *ctx = chan->pgraph_ctx; -@@ -1031,8 +1052,8 @@ +@@ -1031,8 +1049,8 @@ } static int @@ -11612,7 +11945,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.36.nouvea { struct drm_device *dev = chan->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; -@@ -1050,35 +1071,52 @@ +@@ -1050,35 +1068,52 @@ return 0; } @@ -11698,7 +12031,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.36.nouvea +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv17_tv.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv17_tv.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv17_tv.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv17_tv.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv17_tv.c 2010-10-26 02:30:09.000000000 +0200 @@ -193,55 +193,56 @@ } } @@ -11861,7 +12194,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv17_tv.c linux-2.6.36.nouveau/d dacclk = (NVReadRAMDAC(dev, 0, dacclk_off) & ~0x30) | 0x1; diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv17_tv.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv17_tv.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nv17_tv.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv17_tv.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv17_tv.h 2010-10-26 02:30:09.000000000 +0200 @@ -127,7 +127,8 @@ /* TV hardware access functions */ @@ -11899,7 +12232,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv17_tv.h linux-2.6.36.nouveau/d #endif diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv17_tv_modes.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv17_tv_modes.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv17_tv_modes.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv17_tv_modes.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv17_tv_modes.c 2010-10-26 02:30:09.000000000 +0200 @@ -336,12 +336,17 @@ struct filter_params *p = &fparams[k][j]; @@ -11993,7 +12326,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv17_tv_modes.c linux-2.6.36.nou regs->fp_horiz_regs[FP_VALID_END] = output_mode->hdisplay - hmargin - 1; diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv20_graph.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv20_graph.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv20_graph.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv20_graph.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv20_graph.c 2010-10-26 02:30:09.000000000 +0200 @@ -32,54 +32,57 @@ #define NV34_GRCTX_SIZE (18140) #define NV35_36_GRCTX_SIZE (22396) @@ -12649,7 +12982,41 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv20_graph.c linux-2.6.36.nouvea nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, inst); nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_XFER, -@@ -552,18 +563,24 @@ +@@ -500,24 +511,21 @@ + } + + void +-nv20_graph_set_region_tiling(struct drm_device *dev, int i, uint32_t addr, +- uint32_t size, uint32_t pitch) ++nv20_graph_set_tile_region(struct drm_device *dev, int i) + { +- uint32_t limit = max(1u, addr + size) - 1; +- +- if (pitch) +- addr |= 1; ++ struct drm_nouveau_private *dev_priv = dev->dev_private; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; + +- nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), limit); +- nv_wr32(dev, NV20_PGRAPH_TSIZE(i), pitch); +- nv_wr32(dev, NV20_PGRAPH_TILE(i), addr); ++ nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); ++ nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); ++ nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); + + nv_wr32(dev, NV10_PGRAPH_RDI_INDEX, 0x00EA0030 + 4 * i); +- nv_wr32(dev, NV10_PGRAPH_RDI_DATA, limit); ++ nv_wr32(dev, NV10_PGRAPH_RDI_DATA, tile->limit); + nv_wr32(dev, NV10_PGRAPH_RDI_INDEX, 0x00EA0050 + 4 * i); +- nv_wr32(dev, NV10_PGRAPH_RDI_DATA, pitch); ++ nv_wr32(dev, NV10_PGRAPH_RDI_DATA, tile->pitch); + nv_wr32(dev, NV10_PGRAPH_RDI_INDEX, 0x00EA0010 + 4 * i); +- nv_wr32(dev, NV10_PGRAPH_RDI_DATA, addr); ++ nv_wr32(dev, NV10_PGRAPH_RDI_DATA, tile->addr); + } + + int +@@ -552,18 +560,24 @@ if (!pgraph->ctx_table) { /* Create Context Pointer Table */ @@ -12678,7 +13045,16 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv20_graph.c linux-2.6.36.nouvea nv_wr32(dev, NV03_PGRAPH_INTR , 0xFFFFFFFF); nv_wr32(dev, NV03_PGRAPH_INTR_EN, 0xFFFFFFFF); -@@ -646,7 +663,7 @@ +@@ -595,7 +609,7 @@ + + /* Turn all the tiling regions off. */ + for (i = 0; i < NV10_PFB_TILE__SIZE; i++) +- nv20_graph_set_region_tiling(dev, i, 0, 0, 0); ++ nv20_graph_set_tile_region(dev, i); + + for (i = 0; i < 8; i++) { + nv_wr32(dev, 0x400980 + i * 4, nv_rd32(dev, 0x100300 + i * 4)); +@@ -646,7 +660,7 @@ struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; @@ -12687,7 +13063,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv20_graph.c linux-2.6.36.nouvea } int -@@ -681,15 +698,21 @@ +@@ -681,15 +695,21 @@ if (!pgraph->ctx_table) { /* Create Context Pointer Table */ @@ -12713,7 +13089,16 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv20_graph.c linux-2.6.36.nouvea nv_wr32(dev, NV03_PGRAPH_INTR , 0xFFFFFFFF); nv_wr32(dev, NV03_PGRAPH_INTR_EN, 0xFFFFFFFF); -@@ -748,46 +771,84 @@ +@@ -728,7 +748,7 @@ + + /* Turn all the tiling regions off. */ + for (i = 0; i < NV10_PFB_TILE__SIZE; i++) +- nv20_graph_set_region_tiling(dev, i, 0, 0, 0); ++ nv20_graph_set_tile_region(dev, i); + + nv_wr32(dev, NV10_PGRAPH_CTX_CONTROL, 0x10000100); + nv_wr32(dev, NV10_PGRAPH_STATE , 0xFFFFFFFF); +@@ -748,46 +768,84 @@ return 0; } @@ -12763,10 +13148,10 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv20_graph.c linux-2.6.36.nouvea +nv20_graph_register(struct drm_device *dev) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; -+ + + if (dev_priv->engine.graph.registered) + return 0; - ++ + NVOBJ_CLASS(dev, 0x506e, SW); /* nvsw */ + NVOBJ_CLASS(dev, 0x0030, GR); /* null */ + NVOBJ_CLASS(dev, 0x0039, GR); /* m2mf */ @@ -12840,9 +13225,96 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv20_graph.c linux-2.6.36.nouvea + dev_priv->engine.graph.registered = true; + return 0; +} +diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv30_fb.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv30_fb.c +--- linux-2.6.36/drivers/gpu/drm/nouveau/nv30_fb.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv30_fb.c 2010-10-26 02:30:09.000000000 +0200 +@@ -29,6 +29,27 @@ + #include "nouveau_drv.h" + #include "nouveau_drm.h" + ++void ++nv30_fb_init_tile_region(struct drm_device *dev, int i, uint32_t addr, ++ uint32_t size, uint32_t pitch, uint32_t flags) ++{ ++ struct drm_nouveau_private *dev_priv = dev->dev_private; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; ++ ++ tile->addr = addr | 1; ++ tile->limit = max(1u, addr + size) - 1; ++ tile->pitch = pitch; ++} ++ ++void ++nv30_fb_free_tile_region(struct drm_device *dev, int i) ++{ ++ struct drm_nouveau_private *dev_priv = dev->dev_private; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; ++ ++ tile->addr = tile->limit = tile->pitch = 0; ++} ++ + static int + calc_bias(struct drm_device *dev, int k, int i, int j) + { +@@ -65,7 +86,7 @@ + + /* Turn all the tiling regions off. */ + for (i = 0; i < pfb->num_tiles; i++) +- pfb->set_region_tiling(dev, i, 0, 0, 0); ++ pfb->set_tile_region(dev, i); + + /* Init the memory timing regs at 0x10037c/0x1003ac */ + if (dev_priv->chipset == 0x30 || +diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_fb.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_fb.c +--- linux-2.6.36/drivers/gpu/drm/nouveau/nv40_fb.c 2010-10-20 22:30:22.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_fb.c 2010-10-26 02:30:09.000000000 +0200 +@@ -4,26 +4,22 @@ + #include "nouveau_drm.h" + + void +-nv40_fb_set_region_tiling(struct drm_device *dev, int i, uint32_t addr, +- uint32_t size, uint32_t pitch) ++nv40_fb_set_tile_region(struct drm_device *dev, int i) + { + struct drm_nouveau_private *dev_priv = dev->dev_private; +- uint32_t limit = max(1u, addr + size) - 1; +- +- if (pitch) +- addr |= 1; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; + + switch (dev_priv->chipset) { + case 0x40: +- nv_wr32(dev, NV10_PFB_TLIMIT(i), limit); +- nv_wr32(dev, NV10_PFB_TSIZE(i), pitch); +- nv_wr32(dev, NV10_PFB_TILE(i), addr); ++ nv_wr32(dev, NV10_PFB_TLIMIT(i), tile->limit); ++ nv_wr32(dev, NV10_PFB_TSIZE(i), tile->pitch); ++ nv_wr32(dev, NV10_PFB_TILE(i), tile->addr); + break; + + default: +- nv_wr32(dev, NV40_PFB_TLIMIT(i), limit); +- nv_wr32(dev, NV40_PFB_TSIZE(i), pitch); +- nv_wr32(dev, NV40_PFB_TILE(i), addr); ++ nv_wr32(dev, NV40_PFB_TLIMIT(i), tile->limit); ++ nv_wr32(dev, NV40_PFB_TSIZE(i), tile->pitch); ++ nv_wr32(dev, NV40_PFB_TILE(i), tile->addr); + break; + } + } +@@ -64,7 +60,7 @@ + + /* Turn all the tiling regions off. */ + for (i = 0; i < pfb->num_tiles; i++) +- pfb->set_region_tiling(dev, i, 0, 0, 0); ++ pfb->set_tile_region(dev, i); + + return 0; + } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_fifo.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_fifo.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv40_fifo.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_fifo.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_fifo.c 2010-10-26 02:30:09.000000000 +0200 @@ -27,8 +27,9 @@ #include "drmP.h" #include "nouveau_drv.h" @@ -12933,7 +13405,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_fifo.c linux-2.6.36.nouveau } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_graph.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_graph.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv40_graph.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_graph.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_graph.c 2010-10-26 02:30:09.000000000 +0200 @@ -29,6 +29,8 @@ #include "nouveau_drv.h" #include "nouveau_grctx.h" @@ -13014,7 +13486,68 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_graph.c linux-2.6.36.nouvea ret = nv40_graph_transfer_context(dev, inst, 0); if (ret) -@@ -234,7 +250,7 @@ +@@ -176,43 +192,39 @@ + } + + void +-nv40_graph_set_region_tiling(struct drm_device *dev, int i, uint32_t addr, +- uint32_t size, uint32_t pitch) ++nv40_graph_set_tile_region(struct drm_device *dev, int i) + { + struct drm_nouveau_private *dev_priv = dev->dev_private; +- uint32_t limit = max(1u, addr + size) - 1; +- +- if (pitch) +- addr |= 1; ++ struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; + + switch (dev_priv->chipset) { + case 0x44: + case 0x4a: + case 0x4e: +- nv_wr32(dev, NV20_PGRAPH_TSIZE(i), pitch); +- nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), limit); +- nv_wr32(dev, NV20_PGRAPH_TILE(i), addr); ++ nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); ++ nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); ++ nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); + break; + + case 0x46: + case 0x47: + case 0x49: + case 0x4b: +- nv_wr32(dev, NV47_PGRAPH_TSIZE(i), pitch); +- nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), limit); +- nv_wr32(dev, NV47_PGRAPH_TILE(i), addr); +- nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), pitch); +- nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), limit); +- nv_wr32(dev, NV40_PGRAPH_TILE1(i), addr); ++ nv_wr32(dev, NV47_PGRAPH_TSIZE(i), tile->pitch); ++ nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), tile->limit); ++ nv_wr32(dev, NV47_PGRAPH_TILE(i), tile->addr); ++ nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch); ++ nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); ++ nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); + break; + + default: +- nv_wr32(dev, NV20_PGRAPH_TSIZE(i), pitch); +- nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), limit); +- nv_wr32(dev, NV20_PGRAPH_TILE(i), addr); +- nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), pitch); +- nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), limit); +- nv_wr32(dev, NV40_PGRAPH_TILE1(i), addr); ++ nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); ++ nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); ++ nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); ++ nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch); ++ nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); ++ nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); + break; + } + } +@@ -234,7 +246,7 @@ struct nouveau_fb_engine *pfb = &dev_priv->engine.fb; struct nouveau_grctx ctx = {}; uint32_t vramsz, *cp; @@ -13023,7 +13556,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_graph.c linux-2.6.36.nouvea nv_wr32(dev, NV03_PMC_ENABLE, nv_rd32(dev, NV03_PMC_ENABLE) & ~NV_PMC_ENABLE_PGRAPH); -@@ -258,6 +274,10 @@ +@@ -258,6 +270,10 @@ kfree(cp); @@ -13034,7 +13567,16 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_graph.c linux-2.6.36.nouvea /* No context present currently */ nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, 0x00000000); -@@ -394,24 +414,42 @@ +@@ -349,7 +365,7 @@ + + /* Turn all the tiling regions off. */ + for (i = 0; i < pfb->num_tiles; i++) +- nv40_graph_set_region_tiling(dev, i, 0, 0, 0); ++ nv40_graph_set_tile_region(dev, i); + + /* begin RAM config */ + vramsz = pci_resource_len(dev->pdev, 0) - 1; +@@ -394,24 +410,42 @@ { } @@ -13062,7 +13604,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_graph.c linux-2.6.36.nouvea +nv40_graph_register(struct drm_device *dev) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; - ++ + if (dev_priv->engine.graph.registered) + return 0; + @@ -13093,13 +13635,13 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_graph.c linux-2.6.36.nouvea + /* nvsw */ + NVOBJ_CLASS(dev, 0x506e, SW); + NVOBJ_MTHD (dev, 0x506e, 0x0500, nv04_graph_mthd_page_flip); -+ + + dev_priv->engine.graph.registered = true; + return 0; +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_grctx.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_grctx.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv40_grctx.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_grctx.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv40_grctx.c 2010-10-26 02:30:09.000000000 +0200 @@ -596,13 +596,13 @@ offset += 0x0280/4; @@ -13119,7 +13661,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv40_grctx.c linux-2.6.36.nouvea diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_calc.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_calc.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_calc.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_calc.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_calc.c 2010-10-26 02:30:09.000000000 +0200 @@ -51,24 +51,28 @@ int *N, int *fN, int *M, int *P) { @@ -13157,7 +13699,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_calc.c linux-2.6.36.nouveau /* *N = floor(fb_div); */ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_crtc.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_crtc.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_crtc.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_crtc.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_crtc.c 2010-10-26 02:30:09.000000000 +0200 @@ -104,8 +104,7 @@ OUT_RING(evo, nv_crtc->lut.depth == 8 ? NV50_EVO_CRTC_CLUT_MODE_OFF : @@ -13249,7 +13791,23 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_crtc.c linux-2.6.36.nouveau .destroy = nv50_crtc_destroy, }; -@@ -536,7 +533,7 @@ +@@ -457,6 +454,7 @@ + + NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index); + ++ drm_vblank_pre_modeset(dev, nv_crtc->index); + nv50_crtc_blank(nv_crtc, true); + } + +@@ -472,6 +470,7 @@ + NV_DEBUG_KMS(dev, "index %d\n", nv_crtc->index); + + nv50_crtc_blank(nv_crtc, false); ++ drm_vblank_post_modeset(dev, nv_crtc->index); + + ret = RING_SPACE(evo, 2); + if (ret) { +@@ -536,7 +535,7 @@ } nv_crtc->fb.offset = fb->nvbo->bo.offset - dev_priv->vm_vram_base; @@ -13258,7 +13816,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_crtc.c linux-2.6.36.nouveau nv_crtc->fb.cpp = drm_fb->bits_per_pixel / 8; if (!nv_crtc->fb.blanked && dev_priv->chipset != 0x50) { ret = RING_SPACE(evo, 2); -@@ -568,7 +565,7 @@ +@@ -568,7 +567,7 @@ fb->nvbo->tile_mode); } if (dev_priv->chipset == 0x50) @@ -13269,7 +13827,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_crtc.c linux-2.6.36.nouveau diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_cursor.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_cursor.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_cursor.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_cursor.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_cursor.c 2010-10-26 02:30:09.000000000 +0200 @@ -147,7 +147,7 @@ NV_DEBUG_KMS(dev, "\n"); @@ -13281,7 +13839,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_cursor.c linux-2.6.36.nouve NV_ERROR(dev, "CURSOR_CTRL2 = 0x%08x\n", diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_dac.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_dac.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_dac.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_dac.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_dac.c 2010-10-26 02:30:09.000000000 +0200 @@ -79,7 +79,7 @@ nv_wr32(dev, NV50_PDISPLAY_DAC_DPMS_CTRL(or), @@ -13302,7 +13860,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_dac.c linux-2.6.36.nouveau/ NV_ERROR(dev, "DAC_DPMS_CTRL(%d) = 0x%08x\n", or, diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_display.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_display.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_display.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_display.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_display.c 2010-10-26 02:30:09.000000000 +0200 @@ -30,154 +30,20 @@ #include "nouveau_connector.h" #include "nouveau_fb.h" @@ -13738,19 +14296,21 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_display.c linux-2.6.36.nouv } static u16 -@@ -640,32 +428,29 @@ +@@ -640,32 +428,32 @@ nv50_display_vblank_crtc_handler(struct drm_device *dev, int crtc) { struct drm_nouveau_private *dev_priv = dev->dev_private; - struct nouveau_channel *chan; - struct list_head *entry, *tmp; -- -- list_for_each_safe(entry, tmp, &dev_priv->vbl_waiting) { -- chan = list_entry(entry, struct nouveau_channel, nvsw.vbl_wait); + struct nouveau_channel *chan, *tmp; +- list_for_each_safe(entry, tmp, &dev_priv->vbl_waiting) { +- chan = list_entry(entry, struct nouveau_channel, nvsw.vbl_wait); + list_for_each_entry_safe(chan, tmp, &dev_priv->vbl_waiting, + nvsw.vbl_wait) { ++ if (chan->nvsw.vblsem_head != crtc) ++ continue; + nouveau_bo_wr32(chan->notifier_bo, chan->nvsw.vblsem_offset, chan->nvsw.vblsem_rval); list_del(&chan->nvsw.vbl_wait); @@ -13778,7 +14338,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_display.c linux-2.6.36.nouv } static void -@@ -710,7 +495,7 @@ +@@ -710,7 +498,7 @@ or = i; } @@ -13787,7 +14347,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_display.c linux-2.6.36.nouv if (dev_priv->chipset < 0x90 || dev_priv->chipset == 0x92 || dev_priv->chipset == 0xa0) -@@ -841,7 +626,7 @@ +@@ -841,7 +629,7 @@ or = i; } @@ -13796,7 +14356,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_display.c linux-2.6.36.nouv if (dev_priv->chipset < 0x90 || dev_priv->chipset == 0x92 || dev_priv->chipset == 0xa0) -@@ -991,16 +776,23 @@ +@@ -991,16 +779,23 @@ static void nv50_display_error_handler(struct drm_device *dev) { @@ -13829,7 +14389,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_display.c linux-2.6.36.nouv } void -@@ -1086,9 +878,9 @@ +@@ -1086,9 +881,9 @@ if (!intr0 && !(intr1 & ~delayed)) break; @@ -13843,7 +14403,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_display.c linux-2.6.36.nouv if (intr1 & NV50_PDISPLAY_INTR_1_VBLANK_CRTC) { diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_evo.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_evo.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_evo.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_evo.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_evo.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,318 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -14165,7 +14725,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_evo.c linux-2.6.36.nouveau/ +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_evo.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_evo.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_evo.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_evo.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_evo.h 2010-10-26 02:30:09.000000000 +0200 @@ -24,6 +24,15 @@ * */ @@ -14189,7 +14749,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_evo.h linux-2.6.36.nouveau/ +#endif diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_fb.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_fb.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_fb.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_fb.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_fb.c 2010-10-26 02:30:09.000000000 +0200 @@ -20,6 +20,7 @@ case 0x50: nv_wr32(dev, 0x100c90, 0x0707ff); @@ -14247,7 +14807,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_fb.c linux-2.6.36.nouveau/d +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_fbcon.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_fbcon.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_fbcon.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_fbcon.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_fbcon.c 2010-10-26 02:30:09.000000000 +0200 @@ -1,28 +1,21 @@ #include "drmP.h" #include "nouveau_drv.h" @@ -14394,7 +14954,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_fbcon.c linux-2.6.36.nouvea diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_fifo.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_fifo.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_fifo.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_fifo.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_fifo.c 2010-10-26 02:30:09.000000000 +0200 @@ -27,13 +27,14 @@ #include "drmP.h" #include "drm.h" @@ -14863,7 +15423,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_fifo.c linux-2.6.36.nouveau +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_graph.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_graph.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_graph.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_graph.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_graph.c 2010-10-26 02:30:09.000000000 +0200 @@ -27,8 +27,12 @@ #include "drmP.h" #include "drm.h" @@ -15064,7 +15624,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_graph.c linux-2.6.36.nouvea { struct drm_device *dev = chan->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; -@@ -369,37 +386,121 @@ +@@ -369,37 +386,124 @@ if (!chan->nvsw.vblsem || chan->nvsw.vblsem_offset == ~0 || data > 1) return -EINVAL; @@ -15075,8 +15635,12 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_graph.c linux-2.6.36.nouvea - nv_wr32(dev, NV50_PDISPLAY_INTR_EN, nv_rd32(dev, - NV50_PDISPLAY_INTR_EN) | - NV50_PDISPLAY_INTR_EN_VBLANK_CRTC_(data)); +- } + drm_vblank_get(dev, data); -+ list_add(&chan->nvsw.vbl_wait, &dev_priv->vbl_waiting); + ++ chan->nvsw.vblsem_head = data; + list_add(&chan->nvsw.vbl_wait, &dev_priv->vbl_waiting); ++ + return 0; +} + @@ -15088,33 +15652,11 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_graph.c linux-2.6.36.nouvea + + if (!nouveau_finish_page_flip(chan, &s)) { + /* XXX - Do something here */ - } - -- list_add(&chan->nvsw.vbl_wait, &dev_priv->vbl_waiting); - return 0; - } - --static struct nouveau_pgraph_object_method nv50_graph_nvsw_methods[] = { -- { 0x018c, nv50_graph_nvsw_dma_vblsem }, -- { 0x0400, nv50_graph_nvsw_vblsem_offset }, -- { 0x0404, nv50_graph_nvsw_vblsem_release_val }, -- { 0x0408, nv50_graph_nvsw_vblsem_release }, -- {} --}; -- --struct nouveau_pgraph_object_class nv50_graph_grclass[] = { -- { 0x506e, true, nv50_graph_nvsw_methods }, /* nvsw */ -- { 0x0030, false, NULL }, /* null */ -- { 0x5039, false, NULL }, /* m2mf */ -- { 0x502d, false, NULL }, /* 2d */ -- { 0x50c0, false, NULL }, /* compute */ -- { 0x85c0, false, NULL }, /* compute (nva3, nva5, nva8) */ -- { 0x5097, false, NULL }, /* tesla (nv50) */ -- { 0x8297, false, NULL }, /* tesla (nv8x/nv9x) */ -- { 0x8397, false, NULL }, /* tesla (nva0, nvaa, nvac) */ -- { 0x8597, false, NULL }, /* tesla (nva3, nva5, nva8) */ -- {} --}; ++ } ++ ++ return 0; ++} ++ +static int +nv50_graph_register(struct drm_device *dev) +{ @@ -15161,9 +15703,30 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_graph.c linux-2.6.36.nouvea + } + + dev_priv->engine.graph.registered = true; -+ return 0; -+} -+ + return 0; + } + +-static struct nouveau_pgraph_object_method nv50_graph_nvsw_methods[] = { +- { 0x018c, nv50_graph_nvsw_dma_vblsem }, +- { 0x0400, nv50_graph_nvsw_vblsem_offset }, +- { 0x0404, nv50_graph_nvsw_vblsem_release_val }, +- { 0x0408, nv50_graph_nvsw_vblsem_release }, +- {} +-}; +- +-struct nouveau_pgraph_object_class nv50_graph_grclass[] = { +- { 0x506e, true, nv50_graph_nvsw_methods }, /* nvsw */ +- { 0x0030, false, NULL }, /* null */ +- { 0x5039, false, NULL }, /* m2mf */ +- { 0x502d, false, NULL }, /* 2d */ +- { 0x50c0, false, NULL }, /* compute */ +- { 0x85c0, false, NULL }, /* compute (nva3, nva5, nva8) */ +- { 0x5097, false, NULL }, /* tesla (nv50) */ +- { 0x8297, false, NULL }, /* tesla (nv8x/nv9x) */ +- { 0x8397, false, NULL }, /* tesla (nva0, nvaa, nvac) */ +- { 0x8597, false, NULL }, /* tesla (nva3, nva5, nva8) */ +- {} +-}; +void +nv50_graph_tlb_flush(struct drm_device *dev) +{ @@ -15217,7 +15780,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_graph.c linux-2.6.36.nouvea +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_grctx.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_grctx.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_grctx.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_grctx.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_grctx.c 2010-10-26 02:30:09.000000000 +0200 @@ -103,6 +103,9 @@ #include "nouveau_drv.h" #include "nouveau_grctx.h" @@ -19029,7 +19592,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_grctx.c linux-2.6.36.nouvea } diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_instmem.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_instmem.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_instmem.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_instmem.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_instmem.c 2010-10-26 02:30:09.000000000 +0200 @@ -32,39 +32,87 @@ struct nv50_instmem_priv { uint32_t save1700[5]; /* 0x1700->0x1710 */ @@ -19657,7 +20220,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_instmem.c linux-2.6.36.nouv diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_pm.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_pm.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_pm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_pm.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_pm.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,131 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -19792,7 +20355,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_pm.c linux-2.6.36.nouveau/d + diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_sor.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_sor.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv50_sor.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_sor.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv50_sor.c 2010-10-26 02:30:09.000000000 +0200 @@ -92,7 +92,7 @@ } @@ -19813,7 +20376,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv50_sor.c linux-2.6.36.nouveau/ NV_ERROR(dev, "SOR_DPMS_STATE(%d) = 0x%08x\n", or, diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv84_crypt.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv84_crypt.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nv84_crypt.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv84_crypt.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nv84_crypt.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,110 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -19927,7 +20490,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nv84_crypt.c linux-2.6.36.nouvea +} diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nva3_pm.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nva3_pm.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nva3_pm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nva3_pm.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nva3_pm.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,95 @@ +/* + * Copyright 2010 Red Hat Inc. @@ -20026,7 +20589,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nva3_pm.c linux-2.6.36.nouveau/d + diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nvc0_fifo.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nvc0_fifo.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nvc0_fifo.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nvc0_fifo.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nvc0_fifo.c 2010-10-26 02:30:09.000000000 +0200 @@ -43,12 +43,6 @@ } @@ -20042,7 +20605,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nvc0_fifo.c linux-2.6.36.nouveau return false; diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nvc0_instmem.c linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nvc0_instmem.c --- linux-2.6.36/drivers/gpu/drm/nouveau/nvc0_instmem.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nvc0_instmem.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nvc0_instmem.c 2010-10-26 02:30:09.000000000 +0200 @@ -28,7 +28,7 @@ int @@ -20109,7 +20672,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nvc0_instmem.c linux-2.6.36.nouv diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nvreg.h linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nvreg.h --- linux-2.6.36/drivers/gpu/drm/nouveau/nvreg.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nvreg.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/nouveau/nvreg.h 2010-10-26 02:30:09.000000000 +0200 @@ -153,7 +153,8 @@ #define NV_PCRTC_START 0x00600800 #define NV_PCRTC_CONFIG 0x00600804 @@ -20130,7 +20693,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/nouveau/nvreg.h linux-2.6.36.nouveau/dri # define NV_CIO_CRE_ILACE__INDEX 0x39 /* interlace */ diff -Naur linux-2.6.36/drivers/gpu/drm/radeon/radeon_object.c linux-2.6.36.nouveau/drivers/gpu/drm/radeon/radeon_object.c --- linux-2.6.36/drivers/gpu/drm/radeon/radeon_object.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/radeon/radeon_object.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/radeon/radeon_object.c 2010-10-26 02:30:09.000000000 +0200 @@ -435,7 +435,7 @@ out: @@ -20160,7 +20723,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/radeon/radeon_object.c linux-2.6.36.nouv return -EINVAL; diff -Naur linux-2.6.36/drivers/gpu/drm/radeon/radeon_ttm.c linux-2.6.36.nouveau/drivers/gpu/drm/radeon/radeon_ttm.c --- linux-2.6.36/drivers/gpu/drm/radeon/radeon_ttm.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/radeon/radeon_ttm.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/radeon/radeon_ttm.c 2010-10-26 02:30:09.000000000 +0200 @@ -152,6 +152,7 @@ man->default_caching = TTM_PL_FLAG_CACHED; break; @@ -20260,7 +20823,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/radeon/radeon_ttm.c linux-2.6.36.nouveau /* Add ttm page pool to debugfs */ diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/Makefile linux-2.6.36.nouveau/drivers/gpu/drm/ttm/Makefile --- linux-2.6.36/drivers/gpu/drm/ttm/Makefile 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/Makefile 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/Makefile 2010-10-26 02:30:09.000000000 +0200 @@ -4,6 +4,7 @@ ccflags-y := -Iinclude/drm ttm-y := ttm_agp_backend.o ttm_memory.o ttm_tt.o ttm_bo.o \ @@ -20272,7 +20835,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/Makefile linux-2.6.36.nouveau/driver obj-$(CONFIG_DRM_TTM) += ttm.o diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/ttm_agp_backend.c linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_agp_backend.c --- linux-2.6.36/drivers/gpu/drm/ttm/ttm_agp_backend.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_agp_backend.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_agp_backend.c 2010-10-26 02:30:09.000000000 +0200 @@ -74,6 +74,7 @@ { struct ttm_agp_backend *agp_be = @@ -20292,7 +20855,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/ttm_agp_backend.c linux-2.6.36.nouve diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/ttm_bo.c linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_bo.c --- linux-2.6.36/drivers/gpu/drm/ttm/ttm_bo.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_bo.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_bo.c 2010-10-26 02:30:09.000000000 +0200 @@ -84,11 +84,8 @@ man->available_caching); printk(KERN_ERR TTM_PFX " default_caching: 0x%08X\n", @@ -20549,7 +21112,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/ttm_bo.c linux-2.6.36.nouveau/driver } diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/ttm_bo_manager.c linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_bo_manager.c --- linux-2.6.36/drivers/gpu/drm/ttm/ttm_bo_manager.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_bo_manager.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_bo_manager.c 2010-10-26 02:30:09.000000000 +0200 @@ -0,0 +1,148 @@ +/************************************************************************** + * @@ -20701,7 +21264,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/ttm_bo_manager.c linux-2.6.36.nouvea +EXPORT_SYMBOL(ttm_bo_manager_func); diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/ttm_bo_util.c linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_bo_util.c --- linux-2.6.36/drivers/gpu/drm/ttm/ttm_bo_util.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_bo_util.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/ttm/ttm_bo_util.c 2010-10-26 02:30:09.000000000 +0200 @@ -39,14 +39,7 @@ void ttm_bo_free_old_node(struct ttm_buffer_object *bo) @@ -20730,7 +21293,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/ttm/ttm_bo_util.c linux-2.6.36.nouveau/d } diff -Naur linux-2.6.36/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c linux-2.6.36.nouveau/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c --- linux-2.6.36/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c 2010-10-26 02:30:09.000000000 +0200 @@ -147,6 +147,7 @@ break; case TTM_PL_VRAM: @@ -20750,7 +21313,7 @@ diff -Naur linux-2.6.36/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c linux-2.6.36.nouv break; diff -Naur linux-2.6.36/include/drm/nouveau_drm.h linux-2.6.36.nouveau/include/drm/nouveau_drm.h --- linux-2.6.36/include/drm/nouveau_drm.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/include/drm/nouveau_drm.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/include/drm/nouveau_drm.h 2010-10-26 02:30:09.000000000 +0200 @@ -80,6 +80,8 @@ #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 @@ -20783,7 +21346,7 @@ diff -Naur linux-2.6.36/include/drm/nouveau_drm.h linux-2.6.36.nouveau/include/d uint32_t handle; diff -Naur linux-2.6.36/include/drm/ttm/ttm_bo_api.h linux-2.6.36.nouveau/include/drm/ttm/ttm_bo_api.h --- linux-2.6.36/include/drm/ttm/ttm_bo_api.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/include/drm/ttm/ttm_bo_api.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/include/drm/ttm/ttm_bo_api.h 2010-10-26 02:30:09.000000000 +0200 @@ -102,7 +102,8 @@ */ @@ -20796,7 +21359,7 @@ diff -Naur linux-2.6.36/include/drm/ttm/ttm_bo_api.h linux-2.6.36.nouveau/includ uint32_t page_alignment; diff -Naur linux-2.6.36/include/drm/ttm/ttm_bo_driver.h linux-2.6.36.nouveau/include/drm/ttm/ttm_bo_driver.h --- linux-2.6.36/include/drm/ttm/ttm_bo_driver.h 2010-10-20 22:30:22.000000000 +0200 -+++ linux-2.6.36.nouveau/include/drm/ttm/ttm_bo_driver.h 2010-10-25 03:27:16.000000000 +0200 ++++ linux-2.6.36.nouveau/include/drm/ttm/ttm_bo_driver.h 2010-10-26 02:30:09.000000000 +0200 @@ -203,7 +203,22 @@ * It's set up by the ttm_bo_driver::init_mem_type method. */