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/i915: i915 cannot provide switcher services.
drm/radeon/kms: fix vram base calculation on rs780/rs880
drm/radeon/kms: fix formatting of vram and gtt info
drm/radeon/kms: forbid big bo allocation (fdo 31708) v3
drm: Don't try and disable an encoder that was never enabled
drm: Add missing drm_vblank_put() along queue vblank error path
drm/i915/dp: Only apply the workaround if the select is still active
drm/i915: Emit a request to clear a flushed and idle ring for unbusy bo
drm/i915/lvds: Always restore panel-fitter when enabling the LVDS
drm/i915/ringbuffer: Only print an error on the second attempt to reset head
drm/i915: announce to userspace that the bsd ring is coherent
agp/intel: Fix wrong kunmap in i830_cleanup()
drm/i915: Factor in pixel-repeat in FDI M/N calculation
drm/i915: Death to the unnecessary 64bit divide
drm/i915: Clean conflicting modesetting registers upon init
drm/i915: Apply a workaround for transitioning from DP on pipe B to HDMI.
drm/i915: Always set the DP transcoder config to 8BPC.

+211 -122
+4 -2
drivers/char/agp/intel-gtt.c
··· 812 813 static void i830_cleanup(void) 814 { 815 - kunmap(intel_private.i8xx_page); 816 - intel_private.i8xx_flush_page = NULL; 817 818 __free_page(intel_private.i8xx_page); 819 intel_private.i8xx_page = NULL;
··· 812 813 static void i830_cleanup(void) 814 { 815 + if (intel_private.i8xx_flush_page) { 816 + kunmap(intel_private.i8xx_flush_page); 817 + intel_private.i8xx_flush_page = NULL; 818 + } 819 820 __free_page(intel_private.i8xx_page); 821 intel_private.i8xx_page = NULL;
+1 -1
drivers/gpu/drm/drm_crtc_helper.c
··· 241 } 242 243 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { 244 - if (!drm_helper_encoder_in_use(encoder)) { 245 drm_encoder_disable(encoder); 246 /* disconnector encoder from any connector */ 247 encoder->crtc = NULL;
··· 241 } 242 243 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { 244 + if (encoder->crtc && !drm_helper_encoder_in_use(encoder)) { 245 drm_encoder_disable(encoder); 246 /* disconnector encoder from any connector */ 247 encoder->crtc = NULL;
+14 -5
drivers/gpu/drm/drm_irq.c
··· 585 struct timeval now; 586 unsigned long flags; 587 unsigned int seq; 588 589 e = kzalloc(sizeof *e, GFP_KERNEL); 590 - if (e == NULL) 591 - return -ENOMEM; 592 593 e->pipe = pipe; 594 e->base.pid = current->pid; ··· 606 spin_lock_irqsave(&dev->event_lock, flags); 607 608 if (file_priv->event_space < sizeof e->event) { 609 - spin_unlock_irqrestore(&dev->event_lock, flags); 610 - kfree(e); 611 - return -ENOMEM; 612 } 613 614 file_priv->event_space -= sizeof e->event; ··· 640 spin_unlock_irqrestore(&dev->event_lock, flags); 641 642 return 0; 643 } 644 645 /**
··· 585 struct timeval now; 586 unsigned long flags; 587 unsigned int seq; 588 + int ret; 589 590 e = kzalloc(sizeof *e, GFP_KERNEL); 591 + if (e == NULL) { 592 + ret = -ENOMEM; 593 + goto err_put; 594 + } 595 596 e->pipe = pipe; 597 e->base.pid = current->pid; ··· 603 spin_lock_irqsave(&dev->event_lock, flags); 604 605 if (file_priv->event_space < sizeof e->event) { 606 + ret = -EBUSY; 607 + goto err_unlock; 608 } 609 610 file_priv->event_space -= sizeof e->event; ··· 638 spin_unlock_irqrestore(&dev->event_lock, flags); 639 640 return 0; 641 + 642 + err_unlock: 643 + spin_unlock_irqrestore(&dev->event_lock, flags); 644 + kfree(e); 645 + err_put: 646 + drm_vblank_put(dev, e->pipe); 647 + return ret; 648 } 649 650 /**
+3
drivers/gpu/drm/i915/i915_dma.c
··· 767 case I915_PARAM_HAS_BLT: 768 value = HAS_BLT(dev); 769 break; 770 default: 771 DRM_DEBUG_DRIVER("Unknown parameter %d\n", 772 param->param);
··· 767 case I915_PARAM_HAS_BLT: 768 value = HAS_BLT(dev); 769 break; 770 + case I915_PARAM_HAS_COHERENT_RINGS: 771 + value = 1; 772 + break; 773 default: 774 DRM_DEBUG_DRIVER("Unknown parameter %d\n", 775 param->param);
+11 -1
drivers/gpu/drm/i915/i915_gem.c
··· 4374 * use this buffer rather sooner than later, so issuing the required 4375 * flush earlier is beneficial. 4376 */ 4377 - if (obj->write_domain & I915_GEM_GPU_DOMAINS) 4378 i915_gem_flush_ring(dev, file_priv, 4379 obj_priv->ring, 4380 0, obj->write_domain); 4381 4382 /* Update the active list for the hardware's current position. 4383 * Otherwise this only updates on a delayed timer or when irqs
··· 4374 * use this buffer rather sooner than later, so issuing the required 4375 * flush earlier is beneficial. 4376 */ 4377 + if (obj->write_domain & I915_GEM_GPU_DOMAINS) { 4378 i915_gem_flush_ring(dev, file_priv, 4379 obj_priv->ring, 4380 0, obj->write_domain); 4381 + } else if (obj_priv->ring->outstanding_lazy_request) { 4382 + /* This ring is not being cleared by active usage, 4383 + * so emit a request to do so. 4384 + */ 4385 + u32 seqno = i915_add_request(dev, 4386 + NULL, NULL, 4387 + obj_priv->ring); 4388 + if (seqno == 0) 4389 + ret = -ENOMEM; 4390 + } 4391 4392 /* Update the active list for the hardware's current position. 4393 * Otherwise this only updates on a delayed timer or when irqs
+1
drivers/gpu/drm/i915/i915_reg.h
··· 3033 #define TRANS_DP_10BPC (1<<9) 3034 #define TRANS_DP_6BPC (2<<9) 3035 #define TRANS_DP_12BPC (3<<9) 3036 #define TRANS_DP_VSYNC_ACTIVE_HIGH (1<<4) 3037 #define TRANS_DP_VSYNC_ACTIVE_LOW 0 3038 #define TRANS_DP_HSYNC_ACTIVE_HIGH (1<<3)
··· 3033 #define TRANS_DP_10BPC (1<<9) 3034 #define TRANS_DP_6BPC (2<<9) 3035 #define TRANS_DP_12BPC (3<<9) 3036 + #define TRANS_DP_BPC_MASK (3<<9) 3037 #define TRANS_DP_VSYNC_ACTIVE_HIGH (1<<4) 3038 #define TRANS_DP_VSYNC_ACTIVE_LOW 0 3039 #define TRANS_DP_HSYNC_ACTIVE_HIGH (1<<3)
-34
drivers/gpu/drm/i915/intel_acpi.c
··· 190 kfree(output.pointer); 191 } 192 193 - static int intel_dsm_switchto(enum vga_switcheroo_client_id id) 194 - { 195 - return 0; 196 - } 197 - 198 - static int intel_dsm_power_state(enum vga_switcheroo_client_id id, 199 - enum vga_switcheroo_state state) 200 - { 201 - return 0; 202 - } 203 - 204 - static int intel_dsm_init(void) 205 - { 206 - return 0; 207 - } 208 - 209 - static int intel_dsm_get_client_id(struct pci_dev *pdev) 210 - { 211 - if (intel_dsm_priv.dhandle == DEVICE_ACPI_HANDLE(&pdev->dev)) 212 - return VGA_SWITCHEROO_IGD; 213 - else 214 - return VGA_SWITCHEROO_DIS; 215 - } 216 - 217 - static struct vga_switcheroo_handler intel_dsm_handler = { 218 - .switchto = intel_dsm_switchto, 219 - .power_state = intel_dsm_power_state, 220 - .init = intel_dsm_init, 221 - .get_client_id = intel_dsm_get_client_id, 222 - }; 223 - 224 static bool intel_dsm_pci_probe(struct pci_dev *pdev) 225 { 226 acpi_handle dhandle, intel_handle; ··· 245 { 246 if (!intel_dsm_detect()) 247 return; 248 - 249 - vga_switcheroo_register_handler(&intel_dsm_handler); 250 } 251 252 void intel_unregister_dsm_handler(void) 253 { 254 - vga_switcheroo_unregister_handler(); 255 }
··· 190 kfree(output.pointer); 191 } 192 193 static bool intel_dsm_pci_probe(struct pci_dev *pdev) 194 { 195 acpi_handle dhandle, intel_handle; ··· 276 { 277 if (!intel_dsm_detect()) 278 return; 279 } 280 281 void intel_unregister_dsm_handler(void) 282 { 283 }
+62 -14
drivers/gpu/drm/i915/intel_display.c
··· 2120 reg = TRANS_DP_CTL(pipe); 2121 temp = I915_READ(reg); 2122 temp &= ~(TRANS_DP_PORT_SEL_MASK | 2123 - TRANS_DP_SYNC_MASK); 2124 temp |= (TRANS_DP_OUTPUT_ENABLE | 2125 TRANS_DP_ENH_FRAMING); 2126 2127 if (crtc->mode.flags & DRM_MODE_FLAG_PHSYNC) 2128 temp |= TRANS_DP_HSYNC_ACTIVE_HIGH; ··· 2714 } 2715 } 2716 2717 - #define DATA_N 0x800000 2718 - #define LINK_N 0x80000 2719 - 2720 static void 2721 ironlake_compute_m_n(int bits_per_pixel, int nlanes, int pixel_clock, 2722 int link_clock, struct fdi_m_n *m_n) 2723 { 2724 - u64 temp; 2725 - 2726 m_n->tu = 64; /* default size */ 2727 2728 - temp = (u64) DATA_N * pixel_clock; 2729 - temp = div_u64(temp, link_clock); 2730 - m_n->gmch_m = div_u64(temp * bits_per_pixel, nlanes); 2731 - m_n->gmch_m >>= 3; /* convert to bytes_per_pixel */ 2732 - m_n->gmch_n = DATA_N; 2733 fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); 2734 2735 - temp = (u64) LINK_N * pixel_clock; 2736 - m_n->link_m = div_u64(temp, link_clock); 2737 - m_n->link_n = LINK_N; 2738 fdi_reduce_ratio(&m_n->link_m, &m_n->link_n); 2739 } 2740 ··· 3710 3711 /* FDI link */ 3712 if (HAS_PCH_SPLIT(dev)) { 3713 int lane = 0, link_bw, bpp; 3714 /* CPU eDP doesn't require FDI link, so just set DP M/N 3715 according to current link config */ ··· 3794 3795 intel_crtc->fdi_lanes = lane; 3796 3797 ironlake_compute_m_n(bpp, lane, target_clock, link_bw, &m_n); 3798 } 3799 ··· 5233 .page_flip = intel_crtc_page_flip, 5234 }; 5235 5236 5237 static void intel_crtc_init(struct drm_device *dev, int pipe) 5238 { ··· 5333 5334 setup_timer(&intel_crtc->idle_timer, intel_crtc_idle_timer, 5335 (unsigned long)intel_crtc); 5336 } 5337 5338 int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
··· 2120 reg = TRANS_DP_CTL(pipe); 2121 temp = I915_READ(reg); 2122 temp &= ~(TRANS_DP_PORT_SEL_MASK | 2123 + TRANS_DP_SYNC_MASK | 2124 + TRANS_DP_BPC_MASK); 2125 temp |= (TRANS_DP_OUTPUT_ENABLE | 2126 TRANS_DP_ENH_FRAMING); 2127 + temp |= TRANS_DP_8BPC; 2128 2129 if (crtc->mode.flags & DRM_MODE_FLAG_PHSYNC) 2130 temp |= TRANS_DP_HSYNC_ACTIVE_HIGH; ··· 2712 } 2713 } 2714 2715 static void 2716 ironlake_compute_m_n(int bits_per_pixel, int nlanes, int pixel_clock, 2717 int link_clock, struct fdi_m_n *m_n) 2718 { 2719 m_n->tu = 64; /* default size */ 2720 2721 + /* BUG_ON(pixel_clock > INT_MAX / 36); */ 2722 + m_n->gmch_m = bits_per_pixel * pixel_clock; 2723 + m_n->gmch_n = link_clock * nlanes * 8; 2724 fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); 2725 2726 + m_n->link_m = pixel_clock; 2727 + m_n->link_n = link_clock; 2728 fdi_reduce_ratio(&m_n->link_m, &m_n->link_n); 2729 } 2730 ··· 3716 3717 /* FDI link */ 3718 if (HAS_PCH_SPLIT(dev)) { 3719 + int pixel_multiplier = intel_mode_get_pixel_multiplier(adjusted_mode); 3720 int lane = 0, link_bw, bpp; 3721 /* CPU eDP doesn't require FDI link, so just set DP M/N 3722 according to current link config */ ··· 3799 3800 intel_crtc->fdi_lanes = lane; 3801 3802 + if (pixel_multiplier > 1) 3803 + link_bw *= pixel_multiplier; 3804 ironlake_compute_m_n(bpp, lane, target_clock, link_bw, &m_n); 3805 } 3806 ··· 5236 .page_flip = intel_crtc_page_flip, 5237 }; 5238 5239 + static void intel_sanitize_modesetting(struct drm_device *dev, 5240 + int pipe, int plane) 5241 + { 5242 + struct drm_i915_private *dev_priv = dev->dev_private; 5243 + u32 reg, val; 5244 + 5245 + if (HAS_PCH_SPLIT(dev)) 5246 + return; 5247 + 5248 + /* Who knows what state these registers were left in by the BIOS or 5249 + * grub? 5250 + * 5251 + * If we leave the registers in a conflicting state (e.g. with the 5252 + * display plane reading from the other pipe than the one we intend 5253 + * to use) then when we attempt to teardown the active mode, we will 5254 + * not disable the pipes and planes in the correct order -- leaving 5255 + * a plane reading from a disabled pipe and possibly leading to 5256 + * undefined behaviour. 5257 + */ 5258 + 5259 + reg = DSPCNTR(plane); 5260 + val = I915_READ(reg); 5261 + 5262 + if ((val & DISPLAY_PLANE_ENABLE) == 0) 5263 + return; 5264 + if (!!(val & DISPPLANE_SEL_PIPE_MASK) == pipe) 5265 + return; 5266 + 5267 + /* This display plane is active and attached to the other CPU pipe. */ 5268 + pipe = !pipe; 5269 + 5270 + /* Disable the plane and wait for it to stop reading from the pipe. */ 5271 + I915_WRITE(reg, val & ~DISPLAY_PLANE_ENABLE); 5272 + intel_flush_display_plane(dev, plane); 5273 + 5274 + if (IS_GEN2(dev)) 5275 + intel_wait_for_vblank(dev, pipe); 5276 + 5277 + if (pipe == 0 && (dev_priv->quirks & QUIRK_PIPEA_FORCE)) 5278 + return; 5279 + 5280 + /* Switch off the pipe. */ 5281 + reg = PIPECONF(pipe); 5282 + val = I915_READ(reg); 5283 + if (val & PIPECONF_ENABLE) { 5284 + I915_WRITE(reg, val & ~PIPECONF_ENABLE); 5285 + intel_wait_for_pipe_off(dev, pipe); 5286 + } 5287 + } 5288 5289 static void intel_crtc_init(struct drm_device *dev, int pipe) 5290 { ··· 5287 5288 setup_timer(&intel_crtc->idle_timer, intel_crtc_idle_timer, 5289 (unsigned long)intel_crtc); 5290 + 5291 + intel_sanitize_modesetting(dev, intel_crtc->pipe, intel_crtc->plane); 5292 } 5293 5294 int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
+25
drivers/gpu/drm/i915/intel_dp.c
··· 1376 struct drm_i915_private *dev_priv = dev->dev_private; 1377 uint32_t DP = intel_dp->DP; 1378 1379 DRM_DEBUG_KMS("\n"); 1380 1381 if (is_edp(intel_dp)) { ··· 1401 1402 if (is_edp(intel_dp)) 1403 DP |= DP_LINK_TRAIN_OFF; 1404 I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); 1405 POSTING_READ(intel_dp->output_reg); 1406 }
··· 1376 struct drm_i915_private *dev_priv = dev->dev_private; 1377 uint32_t DP = intel_dp->DP; 1378 1379 + if ((I915_READ(intel_dp->output_reg) & DP_PORT_EN) == 0) 1380 + return; 1381 + 1382 DRM_DEBUG_KMS("\n"); 1383 1384 if (is_edp(intel_dp)) { ··· 1398 1399 if (is_edp(intel_dp)) 1400 DP |= DP_LINK_TRAIN_OFF; 1401 + 1402 + if (!HAS_PCH_CPT(dev) && 1403 + I915_READ(intel_dp->output_reg) & DP_PIPEB_SELECT) { 1404 + struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.base.crtc); 1405 + /* Hardware workaround: leaving our transcoder select 1406 + * set to transcoder B while it's off will prevent the 1407 + * corresponding HDMI output on transcoder A. 1408 + * 1409 + * Combine this with another hardware workaround: 1410 + * transcoder select bit can only be cleared while the 1411 + * port is enabled. 1412 + */ 1413 + DP &= ~DP_PIPEB_SELECT; 1414 + I915_WRITE(intel_dp->output_reg, DP); 1415 + 1416 + /* Changes to enable or select take place the vblank 1417 + * after being written. 1418 + */ 1419 + intel_wait_for_vblank(intel_dp->base.base.dev, 1420 + intel_crtc->pipe); 1421 + } 1422 + 1423 I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); 1424 POSTING_READ(intel_dp->output_reg); 1425 }
+55 -45
drivers/gpu/drm/i915/intel_lvds.c
··· 68 /** 69 * Sets the power state for the panel. 70 */ 71 - static void intel_lvds_set_power(struct intel_lvds *intel_lvds, bool on) 72 { 73 struct drm_device *dev = intel_lvds->base.base.dev; 74 struct drm_i915_private *dev_priv = dev->dev_private; ··· 82 lvds_reg = LVDS; 83 } 84 85 - if (on) { 86 - I915_WRITE(lvds_reg, I915_READ(lvds_reg) | LVDS_PORT_EN); 87 - I915_WRITE(ctl_reg, I915_READ(ctl_reg) | POWER_TARGET_ON); 88 - intel_panel_set_backlight(dev, dev_priv->backlight_level); 89 - } else { 90 - dev_priv->backlight_level = intel_panel_get_backlight(dev); 91 92 - intel_panel_set_backlight(dev, 0); 93 - I915_WRITE(ctl_reg, I915_READ(ctl_reg) & ~POWER_TARGET_ON); 94 - 95 - if (intel_lvds->pfit_control) { 96 - if (wait_for((I915_READ(PP_STATUS) & PP_ON) == 0, 1000)) 97 - DRM_ERROR("timed out waiting for panel to power off\n"); 98 - I915_WRITE(PFIT_CONTROL, 0); 99 - intel_lvds->pfit_control = 0; 100 intel_lvds->pfit_dirty = false; 101 } 102 - 103 - I915_WRITE(lvds_reg, I915_READ(lvds_reg) & ~LVDS_PORT_EN); 104 } 105 POSTING_READ(lvds_reg); 106 } 107 ··· 145 struct intel_lvds *intel_lvds = to_intel_lvds(encoder); 146 147 if (mode == DRM_MODE_DPMS_ON) 148 - intel_lvds_set_power(intel_lvds, true); 149 else 150 - intel_lvds_set_power(intel_lvds, false); 151 152 /* XXX: We never power down the LVDS pairs. */ 153 } ··· 446 /* Always do a full power on as we do not know what state 447 * we were left in. 448 */ 449 - intel_lvds_set_power(intel_lvds, true); 450 } 451 452 static void intel_lvds_mode_set(struct drm_encoder *encoder, 453 struct drm_display_mode *mode, 454 struct drm_display_mode *adjusted_mode) 455 { 456 - struct drm_device *dev = encoder->dev; 457 - struct drm_i915_private *dev_priv = dev->dev_private; 458 - struct intel_lvds *intel_lvds = to_intel_lvds(encoder); 459 - 460 /* 461 * The LVDS pin pair will already have been turned on in the 462 * intel_crtc_mode_set since it has a large impact on the DPLL 463 * settings. 464 */ 465 - 466 - if (HAS_PCH_SPLIT(dev)) 467 - return; 468 - 469 - if (!intel_lvds->pfit_dirty) 470 - return; 471 - 472 - /* 473 - * Enable automatic panel scaling so that non-native modes fill the 474 - * screen. Should be enabled before the pipe is enabled, according to 475 - * register description and PRM. 476 - */ 477 - DRM_DEBUG_KMS("applying panel-fitter: %x, %x\n", 478 - intel_lvds->pfit_control, 479 - intel_lvds->pfit_pgm_ratios); 480 - if (wait_for((I915_READ(PP_STATUS) & PP_ON) == 0, 1000)) 481 - DRM_ERROR("timed out waiting for panel to power off\n"); 482 - 483 - I915_WRITE(PFIT_PGM_RATIOS, intel_lvds->pfit_pgm_ratios); 484 - I915_WRITE(PFIT_CONTROL, intel_lvds->pfit_control); 485 - intel_lvds->pfit_dirty = false; 486 } 487 488 /**
··· 68 /** 69 * Sets the power state for the panel. 70 */ 71 + static void intel_lvds_enable(struct intel_lvds *intel_lvds) 72 { 73 struct drm_device *dev = intel_lvds->base.base.dev; 74 struct drm_i915_private *dev_priv = dev->dev_private; ··· 82 lvds_reg = LVDS; 83 } 84 85 + I915_WRITE(lvds_reg, I915_READ(lvds_reg) | LVDS_PORT_EN); 86 87 + if (intel_lvds->pfit_dirty) { 88 + /* 89 + * Enable automatic panel scaling so that non-native modes 90 + * fill the screen. The panel fitter should only be 91 + * adjusted whilst the pipe is disabled, according to 92 + * register description and PRM. 93 + */ 94 + DRM_DEBUG_KMS("applying panel-fitter: %x, %x\n", 95 + intel_lvds->pfit_control, 96 + intel_lvds->pfit_pgm_ratios); 97 + if (wait_for((I915_READ(PP_STATUS) & PP_ON) == 0, 1000)) { 98 + DRM_ERROR("timed out waiting for panel to power off\n"); 99 + } else { 100 + I915_WRITE(PFIT_PGM_RATIOS, intel_lvds->pfit_pgm_ratios); 101 + I915_WRITE(PFIT_CONTROL, intel_lvds->pfit_control); 102 intel_lvds->pfit_dirty = false; 103 } 104 } 105 + 106 + I915_WRITE(ctl_reg, I915_READ(ctl_reg) | POWER_TARGET_ON); 107 + POSTING_READ(lvds_reg); 108 + 109 + intel_panel_set_backlight(dev, dev_priv->backlight_level); 110 + } 111 + 112 + static void intel_lvds_disable(struct intel_lvds *intel_lvds) 113 + { 114 + struct drm_device *dev = intel_lvds->base.base.dev; 115 + struct drm_i915_private *dev_priv = dev->dev_private; 116 + u32 ctl_reg, lvds_reg; 117 + 118 + if (HAS_PCH_SPLIT(dev)) { 119 + ctl_reg = PCH_PP_CONTROL; 120 + lvds_reg = PCH_LVDS; 121 + } else { 122 + ctl_reg = PP_CONTROL; 123 + lvds_reg = LVDS; 124 + } 125 + 126 + dev_priv->backlight_level = intel_panel_get_backlight(dev); 127 + intel_panel_set_backlight(dev, 0); 128 + 129 + I915_WRITE(ctl_reg, I915_READ(ctl_reg) & ~POWER_TARGET_ON); 130 + 131 + if (intel_lvds->pfit_control) { 132 + if (wait_for((I915_READ(PP_STATUS) & PP_ON) == 0, 1000)) 133 + DRM_ERROR("timed out waiting for panel to power off\n"); 134 + 135 + I915_WRITE(PFIT_CONTROL, 0); 136 + intel_lvds->pfit_dirty = true; 137 + } 138 + 139 + I915_WRITE(lvds_reg, I915_READ(lvds_reg) & ~LVDS_PORT_EN); 140 POSTING_READ(lvds_reg); 141 } 142 ··· 110 struct intel_lvds *intel_lvds = to_intel_lvds(encoder); 111 112 if (mode == DRM_MODE_DPMS_ON) 113 + intel_lvds_enable(intel_lvds); 114 else 115 + intel_lvds_disable(intel_lvds); 116 117 /* XXX: We never power down the LVDS pairs. */ 118 } ··· 411 /* Always do a full power on as we do not know what state 412 * we were left in. 413 */ 414 + intel_lvds_enable(intel_lvds); 415 } 416 417 static void intel_lvds_mode_set(struct drm_encoder *encoder, 418 struct drm_display_mode *mode, 419 struct drm_display_mode *adjusted_mode) 420 { 421 /* 422 * The LVDS pin pair will already have been turned on in the 423 * intel_crtc_mode_set since it has a large impact on the DPLL 424 * settings. 425 */ 426 } 427 428 /**
+16 -14
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 156 157 /* G45 ring initialization fails to reset head to zero */ 158 if (head != 0) { 159 - DRM_ERROR("%s head not reset to zero " 160 - "ctl %08x head %08x tail %08x start %08x\n", 161 - ring->name, 162 - I915_READ_CTL(ring), 163 - I915_READ_HEAD(ring), 164 - I915_READ_TAIL(ring), 165 - I915_READ_START(ring)); 166 167 I915_WRITE_HEAD(ring, 0); 168 169 - DRM_ERROR("%s head forced to zero " 170 - "ctl %08x head %08x tail %08x start %08x\n", 171 - ring->name, 172 - I915_READ_CTL(ring), 173 - I915_READ_HEAD(ring), 174 - I915_READ_TAIL(ring), 175 - I915_READ_START(ring)); 176 } 177 178 I915_WRITE_CTL(ring,
··· 156 157 /* G45 ring initialization fails to reset head to zero */ 158 if (head != 0) { 159 + DRM_DEBUG_KMS("%s head not reset to zero " 160 + "ctl %08x head %08x tail %08x start %08x\n", 161 + ring->name, 162 + I915_READ_CTL(ring), 163 + I915_READ_HEAD(ring), 164 + I915_READ_TAIL(ring), 165 + I915_READ_START(ring)); 166 167 I915_WRITE_HEAD(ring, 0); 168 169 + if (I915_READ_HEAD(ring) & HEAD_ADDR) { 170 + DRM_ERROR("failed to set %s head to zero " 171 + "ctl %08x head %08x tail %08x start %08x\n", 172 + ring->name, 173 + I915_READ_CTL(ring), 174 + I915_READ_HEAD(ring), 175 + I915_READ_TAIL(ring), 176 + I915_READ_START(ring)); 177 + } 178 } 179 180 I915_WRITE_CTL(ring,
+4 -2
drivers/gpu/drm/radeon/r600.c
··· 1195 mc->vram_end, mc->real_vram_size >> 20); 1196 } else { 1197 u64 base = 0; 1198 - if (rdev->flags & RADEON_IS_IGP) 1199 - base = (RREG32(MC_VM_FB_LOCATION) & 0xFFFF) << 24; 1200 radeon_vram_location(rdev, &rdev->mc, base); 1201 rdev->mc.gtt_base_align = 0; 1202 radeon_gtt_location(rdev, mc);
··· 1195 mc->vram_end, mc->real_vram_size >> 20); 1196 } else { 1197 u64 base = 0; 1198 + if (rdev->flags & RADEON_IS_IGP) { 1199 + base = RREG32(MC_VM_FB_LOCATION) & 0xFFFF; 1200 + base <<= 24; 1201 + } 1202 radeon_vram_location(rdev, &rdev->mc, base); 1203 rdev->mc.gtt_base_align = 0; 1204 radeon_gtt_location(rdev, mc);
+2 -2
drivers/gpu/drm/radeon/radeon_device.c
··· 286 mc->mc_vram_size = mc->aper_size; 287 } 288 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; 289 - dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n", 290 mc->mc_vram_size >> 20, mc->vram_start, 291 mc->vram_end, mc->real_vram_size >> 20); 292 } ··· 323 mc->gtt_start = (mc->vram_end + 1 + mc->gtt_base_align) & ~mc->gtt_base_align; 324 } 325 mc->gtt_end = mc->gtt_start + mc->gtt_size - 1; 326 - dev_info(rdev->dev, "GTT: %lluM 0x%08llX - 0x%08llX\n", 327 mc->gtt_size >> 20, mc->gtt_start, mc->gtt_end); 328 } 329
··· 286 mc->mc_vram_size = mc->aper_size; 287 } 288 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; 289 + dev_info(rdev->dev, "VRAM: %lluM 0x%016llX - 0x%016llX (%lluM used)\n", 290 mc->mc_vram_size >> 20, mc->vram_start, 291 mc->vram_end, mc->real_vram_size >> 20); 292 } ··· 323 mc->gtt_start = (mc->vram_end + 1 + mc->gtt_base_align) & ~mc->gtt_base_align; 324 } 325 mc->gtt_end = mc->gtt_start + mc->gtt_size - 1; 326 + dev_info(rdev->dev, "GTT: %lluM 0x%016llX - 0x%016llX\n", 327 mc->gtt_size >> 20, mc->gtt_start, mc->gtt_end); 328 } 329
+11 -2
drivers/gpu/drm/radeon/radeon_object.c
··· 69 u32 c = 0; 70 71 rbo->placement.fpfn = 0; 72 - rbo->placement.lpfn = rbo->rdev->mc.active_vram_size >> PAGE_SHIFT; 73 rbo->placement.placement = rbo->placements; 74 rbo->placement.busy_placement = rbo->placements; 75 if (domain & RADEON_GEM_DOMAIN_VRAM) ··· 91 { 92 struct radeon_bo *bo; 93 enum ttm_bo_type type; 94 - int page_align = roundup(byte_align, PAGE_SIZE) >> PAGE_SHIFT; 95 int r; 96 97 if (unlikely(rdev->mman.bdev.dev_mapping == NULL)) { ··· 104 type = ttm_bo_type_device; 105 } 106 *bo_ptr = NULL; 107 108 retry: 109 bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL);
··· 69 u32 c = 0; 70 71 rbo->placement.fpfn = 0; 72 + rbo->placement.lpfn = 0; 73 rbo->placement.placement = rbo->placements; 74 rbo->placement.busy_placement = rbo->placements; 75 if (domain & RADEON_GEM_DOMAIN_VRAM) ··· 91 { 92 struct radeon_bo *bo; 93 enum ttm_bo_type type; 94 + unsigned long page_align = roundup(byte_align, PAGE_SIZE) >> PAGE_SHIFT; 95 + unsigned long max_size = 0; 96 int r; 97 98 if (unlikely(rdev->mman.bdev.dev_mapping == NULL)) { ··· 103 type = ttm_bo_type_device; 104 } 105 *bo_ptr = NULL; 106 + 107 + /* maximun bo size is the minimun btw visible vram and gtt size */ 108 + max_size = min(rdev->mc.visible_vram_size, rdev->mc.gtt_size); 109 + if ((page_align << PAGE_SHIFT) >= max_size) { 110 + printk(KERN_WARNING "%s:%d alloc size %ldM bigger than %ldMb limit\n", 111 + __func__, __LINE__, page_align >> (20 - PAGE_SHIFT), max_size >> 20); 112 + return -ENOMEM; 113 + } 114 115 retry: 116 bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL);
+2
include/drm/i915_drm.h
··· 287 #define I915_PARAM_HAS_EXECBUF2 9 288 #define I915_PARAM_HAS_BSD 10 289 #define I915_PARAM_HAS_BLT 11 290 291 typedef struct drm_i915_getparam { 292 int param;
··· 287 #define I915_PARAM_HAS_EXECBUF2 9 288 #define I915_PARAM_HAS_BSD 10 289 #define I915_PARAM_HAS_BLT 11 290 + #define I915_PARAM_HAS_RELAXED_FENCING 12 291 + #define I915_PARAM_HAS_COHERENT_RINGS 13 292 293 typedef struct drm_i915_getparam { 294 int param;