Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
drm/radeon/kms: add missing frac fb div flag for dce4+
drm/radeon/kms: do not reject X16 and Y16X16 floating-point formats on r300
drm/nouveau: fix suspend/resume on GPUs that don't have PM support
drm/nouveau: flips/flipd need to always set 'evict' for move_accel_cleanup()
drm/nv40: fix tiling-related setup for a number of chipsets
drm/nouveau: fix non-EDIDful native mode selection
drm/nouveau: Fix detection of DDC-based LVDS on DCB15 boards.
drm/nv04-nv40: Fix NULL dereference when we fail to find an LVDS native mode.
drm/nv10: Fix crash when allocating a BO larger than half the available VRAM.

+47 -39
+1 -1
drivers/gpu/drm/nouveau/nouveau_bios.c
··· 6228 entry->tvconf.has_component_output = false; 6229 break; 6230 case OUTPUT_LVDS: 6231 - if ((conn & 0x00003f00) != 0x10) 6232 entry->lvdsconf.use_straps_for_mode = true; 6233 entry->lvdsconf.use_power_scripts = true; 6234 break;
··· 6228 entry->tvconf.has_component_output = false; 6229 break; 6230 case OUTPUT_LVDS: 6231 + if ((conn & 0x00003f00) >> 8 != 0x10) 6232 entry->lvdsconf.use_straps_for_mode = true; 6233 entry->lvdsconf.use_power_scripts = true; 6234 break;
+7 -6
drivers/gpu/drm/nouveau/nouveau_bo.c
··· 128 } 129 } 130 131 nouveau_bo_placement_set(nvbo, flags, 0); 132 133 nvbo->channel = chan; ··· 167 set_placement_range(struct nouveau_bo *nvbo, uint32_t type) 168 { 169 struct drm_nouveau_private *dev_priv = nouveau_bdev(nvbo->bo.bdev); 170 171 if (dev_priv->card_type == NV_10 && 172 - nvbo->tile_mode && (type & TTM_PL_FLAG_VRAM)) { 173 /* 174 * Make sure that the color and depth buffers are handled 175 * by independent memory controller units. Up to a 9x 176 * speed up when alpha-blending and depth-test are enabled 177 * at the same time. 178 */ 179 - int vram_pages = dev_priv->vram_size >> PAGE_SHIFT; 180 - 181 if (nvbo->tile_flags & NOUVEAU_GEM_TILE_ZETA) { 182 nvbo->placement.fpfn = vram_pages / 2; 183 nvbo->placement.lpfn = ~0; ··· 786 if (ret) 787 goto out; 788 789 - ret = ttm_bo_move_ttm(bo, evict, no_wait_reserve, no_wait_gpu, new_mem); 790 out: 791 ttm_bo_mem_put(bo, &tmp_mem); 792 return ret; ··· 812 if (ret) 813 return ret; 814 815 - ret = ttm_bo_move_ttm(bo, evict, no_wait_reserve, no_wait_gpu, &tmp_mem); 816 if (ret) 817 goto out; 818 819 - ret = nouveau_bo_move_m2mf(bo, evict, intr, no_wait_reserve, no_wait_gpu, new_mem); 820 if (ret) 821 goto out; 822
··· 128 } 129 } 130 131 + nvbo->bo.mem.num_pages = size >> PAGE_SHIFT; 132 nouveau_bo_placement_set(nvbo, flags, 0); 133 134 nvbo->channel = chan; ··· 166 set_placement_range(struct nouveau_bo *nvbo, uint32_t type) 167 { 168 struct drm_nouveau_private *dev_priv = nouveau_bdev(nvbo->bo.bdev); 169 + int vram_pages = dev_priv->vram_size >> PAGE_SHIFT; 170 171 if (dev_priv->card_type == NV_10 && 172 + nvbo->tile_mode && (type & TTM_PL_FLAG_VRAM) && 173 + nvbo->bo.mem.num_pages < vram_pages / 2) { 174 /* 175 * Make sure that the color and depth buffers are handled 176 * by independent memory controller units. Up to a 9x 177 * speed up when alpha-blending and depth-test are enabled 178 * at the same time. 179 */ 180 if (nvbo->tile_flags & NOUVEAU_GEM_TILE_ZETA) { 181 nvbo->placement.fpfn = vram_pages / 2; 182 nvbo->placement.lpfn = ~0; ··· 785 if (ret) 786 goto out; 787 788 + ret = ttm_bo_move_ttm(bo, true, no_wait_reserve, no_wait_gpu, new_mem); 789 out: 790 ttm_bo_mem_put(bo, &tmp_mem); 791 return ret; ··· 811 if (ret) 812 return ret; 813 814 + ret = ttm_bo_move_ttm(bo, true, no_wait_reserve, no_wait_gpu, &tmp_mem); 815 if (ret) 816 goto out; 817 818 + ret = nouveau_bo_move_m2mf(bo, true, intr, no_wait_reserve, no_wait_gpu, new_mem); 819 if (ret) 820 goto out; 821
+1
drivers/gpu/drm/nouveau/nouveau_connector.c
··· 507 int high_w = 0, high_h = 0, high_v = 0; 508 509 list_for_each_entry(mode, &nv_connector->base.probed_modes, head) { 510 if (helper->mode_valid(connector, mode) != MODE_OK || 511 (mode->flags & DRM_MODE_FLAG_INTERLACE)) 512 continue;
··· 507 int high_w = 0, high_h = 0, high_v = 0; 508 509 list_for_each_entry(mode, &nv_connector->base.probed_modes, head) { 510 + mode->vrefresh = drm_mode_vrefresh(mode); 511 if (helper->mode_valid(connector, mode) != MODE_OK || 512 (mode->flags & DRM_MODE_FLAG_INTERLACE)) 513 continue;
+1 -1
drivers/gpu/drm/nouveau/nouveau_pm.c
··· 543 struct nouveau_pm_engine *pm = &dev_priv->engine.pm; 544 struct nouveau_pm_level *perflvl; 545 546 - if (pm->cur == &pm->boot) 547 return; 548 549 perflvl = pm->cur;
··· 543 struct nouveau_pm_engine *pm = &dev_priv->engine.pm; 544 struct nouveau_pm_level *perflvl; 545 546 + if (!pm->cur || pm->cur == &pm->boot) 547 return; 548 549 perflvl = pm->cur;
+3 -9
drivers/gpu/drm/nouveau/nv04_dfp.c
··· 342 if (nv_encoder->dcb->type == OUTPUT_LVDS) { 343 bool duallink, dummy; 344 345 - nouveau_bios_parse_lvds_table(dev, nv_connector->native_mode-> 346 - clock, &duallink, &dummy); 347 if (duallink) 348 regp->fp_control |= (8 << 28); 349 } else ··· 518 return; 519 520 if (nv_encoder->dcb->lvdsconf.use_power_scripts) { 521 - struct nouveau_connector *nv_connector = nouveau_encoder_connector_get(nv_encoder); 522 - 523 /* when removing an output, crtc may not be set, but PANEL_OFF 524 * must still be run 525 */ ··· 525 nv04_dfp_get_bound_head(dev, nv_encoder->dcb); 526 527 if (mode == DRM_MODE_DPMS_ON) { 528 - if (!nv_connector->native_mode) { 529 - NV_ERROR(dev, "Not turning on LVDS without native mode\n"); 530 - return; 531 - } 532 call_lvds_script(dev, nv_encoder->dcb, head, 533 - LVDS_PANEL_ON, nv_connector->native_mode->clock); 534 } else 535 /* pxclk of 0 is fine for PANEL_OFF, and for a 536 * disconnected LVDS encoder there is no native_mode
··· 342 if (nv_encoder->dcb->type == OUTPUT_LVDS) { 343 bool duallink, dummy; 344 345 + nouveau_bios_parse_lvds_table(dev, output_mode->clock, 346 + &duallink, &dummy); 347 if (duallink) 348 regp->fp_control |= (8 << 28); 349 } else ··· 518 return; 519 520 if (nv_encoder->dcb->lvdsconf.use_power_scripts) { 521 /* when removing an output, crtc may not be set, but PANEL_OFF 522 * must still be run 523 */ ··· 527 nv04_dfp_get_bound_head(dev, nv_encoder->dcb); 528 529 if (mode == DRM_MODE_DPMS_ON) { 530 call_lvds_script(dev, nv_encoder->dcb, head, 531 + LVDS_PANEL_ON, nv_encoder->mode.clock); 532 } else 533 /* pxclk of 0 is fine for PANEL_OFF, and for a 534 * disconnected LVDS encoder there is no native_mode
+29 -21
drivers/gpu/drm/nouveau/nv40_graph.c
··· 211 struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; 212 213 switch (dev_priv->chipset) { 214 - case 0x44: 215 - case 0x4a: 216 case 0x4e: 217 nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); 218 nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); 219 nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); 220 - break; 221 - 222 - case 0x46: 223 - case 0x47: 224 - case 0x49: 225 - case 0x4b: 226 - nv_wr32(dev, NV47_PGRAPH_TSIZE(i), tile->pitch); 227 - nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), tile->limit); 228 - nv_wr32(dev, NV47_PGRAPH_TILE(i), tile->addr); 229 nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch); 230 nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); 231 nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); 232 break; 233 - 234 - default: 235 nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); 236 nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); 237 nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); 238 nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch); 239 nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); 240 nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); ··· 401 break; 402 default: 403 switch (dev_priv->chipset) { 404 - case 0x46: 405 - case 0x47: 406 - case 0x49: 407 - case 0x4b: 408 - nv_wr32(dev, 0x400DF0, nv_rd32(dev, NV04_PFB_CFG0)); 409 - nv_wr32(dev, 0x400DF4, nv_rd32(dev, NV04_PFB_CFG1)); 410 - break; 411 - default: 412 nv_wr32(dev, 0x4009F0, nv_rd32(dev, NV04_PFB_CFG0)); 413 nv_wr32(dev, 0x4009F4, nv_rd32(dev, NV04_PFB_CFG1)); 414 break; 415 } 416 nv_wr32(dev, 0x4069F0, nv_rd32(dev, NV04_PFB_CFG0));
··· 211 struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; 212 213 switch (dev_priv->chipset) { 214 + case 0x40: 215 + case 0x41: /* guess */ 216 + case 0x42: 217 + case 0x43: 218 + case 0x45: /* guess */ 219 case 0x4e: 220 nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); 221 nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); 222 nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); 223 nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch); 224 nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); 225 nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); 226 break; 227 + case 0x44: 228 + case 0x4a: 229 nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); 230 nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); 231 nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); 232 + break; 233 + case 0x46: 234 + case 0x47: 235 + case 0x49: 236 + case 0x4b: 237 + case 0x4c: 238 + case 0x67: 239 + default: 240 + nv_wr32(dev, NV47_PGRAPH_TSIZE(i), tile->pitch); 241 + nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), tile->limit); 242 + nv_wr32(dev, NV47_PGRAPH_TILE(i), tile->addr); 243 nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch); 244 nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); 245 nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); ··· 396 break; 397 default: 398 switch (dev_priv->chipset) { 399 + case 0x41: 400 + case 0x42: 401 + case 0x43: 402 + case 0x45: 403 + case 0x4e: 404 + case 0x44: 405 + case 0x4a: 406 nv_wr32(dev, 0x4009F0, nv_rd32(dev, NV04_PFB_CFG0)); 407 nv_wr32(dev, 0x4009F4, nv_rd32(dev, NV04_PFB_CFG1)); 408 + break; 409 + default: 410 + nv_wr32(dev, 0x400DF0, nv_rd32(dev, NV04_PFB_CFG0)); 411 + nv_wr32(dev, 0x400DF4, nv_rd32(dev, NV04_PFB_CFG1)); 412 break; 413 } 414 nv_wr32(dev, 0x4069F0, nv_rd32(dev, NV04_PFB_CFG0));
+3 -1
drivers/gpu/drm/radeon/atombios_crtc.c
··· 557 558 /* use recommended ref_div for ss */ 559 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { 560 - pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; 561 if (ss_enabled) { 562 if (ss->refdiv) { 563 pll->flags |= RADEON_PLL_USE_REF_DIV; 564 pll->reference_div = ss->refdiv; 565 if (ASIC_IS_AVIVO(rdev)) ··· 662 index, (uint32_t *)&args); 663 adjusted_clock = le32_to_cpu(args.v3.sOutput.ulDispPllFreq) * 10; 664 if (args.v3.sOutput.ucRefDiv) { 665 pll->flags |= RADEON_PLL_USE_REF_DIV; 666 pll->reference_div = args.v3.sOutput.ucRefDiv; 667 } 668 if (args.v3.sOutput.ucPostDiv) { 669 pll->flags |= RADEON_PLL_USE_POST_DIV; 670 pll->post_div = args.v3.sOutput.ucPostDiv; 671 }
··· 557 558 /* use recommended ref_div for ss */ 559 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { 560 if (ss_enabled) { 561 if (ss->refdiv) { 562 + pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; 563 pll->flags |= RADEON_PLL_USE_REF_DIV; 564 pll->reference_div = ss->refdiv; 565 if (ASIC_IS_AVIVO(rdev)) ··· 662 index, (uint32_t *)&args); 663 adjusted_clock = le32_to_cpu(args.v3.sOutput.ulDispPllFreq) * 10; 664 if (args.v3.sOutput.ucRefDiv) { 665 + pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV; 666 pll->flags |= RADEON_PLL_USE_REF_DIV; 667 pll->reference_div = args.v3.sOutput.ucRefDiv; 668 } 669 if (args.v3.sOutput.ucPostDiv) { 670 + pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV; 671 pll->flags |= RADEON_PLL_USE_POST_DIV; 672 pll->post_div = args.v3.sOutput.ucPostDiv; 673 }
+2
drivers/gpu/drm/radeon/r300.c
··· 910 track->textures[i].compress_format = R100_TRACK_COMP_NONE; 911 break; 912 case R300_TX_FORMAT_X16: 913 case R300_TX_FORMAT_Y8X8: 914 case R300_TX_FORMAT_Z5Y6X5: 915 case R300_TX_FORMAT_Z6Y5X5: ··· 923 track->textures[i].compress_format = R100_TRACK_COMP_NONE; 924 break; 925 case R300_TX_FORMAT_Y16X16: 926 case R300_TX_FORMAT_Z11Y11X10: 927 case R300_TX_FORMAT_Z10Y11X11: 928 case R300_TX_FORMAT_W8Z8Y8X8:
··· 910 track->textures[i].compress_format = R100_TRACK_COMP_NONE; 911 break; 912 case R300_TX_FORMAT_X16: 913 + case R300_TX_FORMAT_FL_I16: 914 case R300_TX_FORMAT_Y8X8: 915 case R300_TX_FORMAT_Z5Y6X5: 916 case R300_TX_FORMAT_Z6Y5X5: ··· 922 track->textures[i].compress_format = R100_TRACK_COMP_NONE; 923 break; 924 case R300_TX_FORMAT_Y16X16: 925 + case R300_TX_FORMAT_FL_I16A16: 926 case R300_TX_FORMAT_Z11Y11X10: 927 case R300_TX_FORMAT_Z10Y11X11: 928 case R300_TX_FORMAT_W8Z8Y8X8: