diff options
author | Eric Anholt <eric@anholt.net> | 2010-08-01 22:23:53 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-08-01 22:34:47 -0400 |
commit | 2bd34f6ca86b5a5f9b749624f73310820e7a93fd (patch) | |
tree | 9e42100423e78f400412dfa974a6a13bac94d2c0 /drivers/gpu | |
parent | a2757b6fab6dee3dbf43bdb7d7226d03747fbdb1 (diff) | |
parent | 9fe6206f400646a2322096b56c59891d530e8d51 (diff) |
Merge remote branch 'origin/master' into drm-intel-next
This resolves the conflict in the EDP code, which has been rather
popular to hack on recently.
Conflicts:
drivers/gpu/drm/i915/intel_dp.c
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 109 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 53 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_fb.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 1 |
10 files changed, 167 insertions, 18 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 83d8072066cb..ea1d57291b0e 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -864,8 +864,8 @@ drm_mode_std(struct drm_connector *connector, struct edid *edid, | |||
864 | mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, | 864 | mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, |
865 | false); | 865 | false); |
866 | mode->hdisplay = 1366; | 866 | mode->hdisplay = 1366; |
867 | mode->vsync_start = mode->vsync_start - 1; | 867 | mode->hsync_start = mode->hsync_start - 1; |
868 | mode->vsync_end = mode->vsync_end - 1; | 868 | mode->hsync_end = mode->hsync_end - 1; |
869 | return mode; | 869 | return mode; |
870 | } | 870 | } |
871 | 871 | ||
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index aee83fa178f6..9214119c0154 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -605,6 +605,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused) | |||
605 | case FBC_NOT_TILED: | 605 | case FBC_NOT_TILED: |
606 | seq_printf(m, "scanout buffer not tiled"); | 606 | seq_printf(m, "scanout buffer not tiled"); |
607 | break; | 607 | break; |
608 | case FBC_MULTIPLE_PIPES: | ||
609 | seq_printf(m, "multiple pipes are enabled"); | ||
610 | break; | ||
608 | default: | 611 | default: |
609 | seq_printf(m, "unknown reason"); | 612 | seq_printf(m, "unknown reason"); |
610 | } | 613 | } |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 9ddb7b5ac057..14054c051e40 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1302,7 +1302,7 @@ static void i915_cleanup_compression(struct drm_device *dev) | |||
1302 | struct drm_i915_private *dev_priv = dev->dev_private; | 1302 | struct drm_i915_private *dev_priv = dev->dev_private; |
1303 | 1303 | ||
1304 | drm_mm_put_block(dev_priv->compressed_fb); | 1304 | drm_mm_put_block(dev_priv->compressed_fb); |
1305 | if (!IS_GM45(dev)) | 1305 | if (dev_priv->compressed_llb) |
1306 | drm_mm_put_block(dev_priv->compressed_llb); | 1306 | drm_mm_put_block(dev_priv->compressed_llb); |
1307 | } | 1307 | } |
1308 | 1308 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5a0100ef21d0..46a544abbd6d 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -218,6 +218,7 @@ enum no_fbc_reason { | |||
218 | FBC_MODE_TOO_LARGE, /* mode too large for compression */ | 218 | FBC_MODE_TOO_LARGE, /* mode too large for compression */ |
219 | FBC_BAD_PLANE, /* fbc not supported on plane */ | 219 | FBC_BAD_PLANE, /* fbc not supported on plane */ |
220 | FBC_NOT_TILED, /* buffer not tiled */ | 220 | FBC_NOT_TILED, /* buffer not tiled */ |
221 | FBC_MULTIPLE_PIPES, /* more than one pipe active */ | ||
221 | }; | 222 | }; |
222 | 223 | ||
223 | enum intel_pch { | 224 | enum intel_pch { |
@@ -225,6 +226,8 @@ enum intel_pch { | |||
225 | PCH_CPT, /* Cougarpoint PCH */ | 226 | PCH_CPT, /* Cougarpoint PCH */ |
226 | }; | 227 | }; |
227 | 228 | ||
229 | #define QUIRK_PIPEA_FORCE (1<<0) | ||
230 | |||
228 | struct intel_fbdev; | 231 | struct intel_fbdev; |
229 | 232 | ||
230 | typedef struct drm_i915_private { | 233 | typedef struct drm_i915_private { |
@@ -342,6 +345,8 @@ typedef struct drm_i915_private { | |||
342 | /* PCH chipset type */ | 345 | /* PCH chipset type */ |
343 | enum intel_pch pch_type; | 346 | enum intel_pch pch_type; |
344 | 347 | ||
348 | unsigned long quirks; | ||
349 | |||
345 | /* Register state */ | 350 | /* Register state */ |
346 | bool modeset_on_lid; | 351 | bool modeset_on_lid; |
347 | u8 saveLBB; | 352 | u8 saveLBB; |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 849ab8aff51c..281db6e5403a 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -2869,6 +2869,7 @@ | |||
2869 | 2869 | ||
2870 | #define PCH_PP_STATUS 0xc7200 | 2870 | #define PCH_PP_STATUS 0xc7200 |
2871 | #define PCH_PP_CONTROL 0xc7204 | 2871 | #define PCH_PP_CONTROL 0xc7204 |
2872 | #define PANEL_UNLOCK_REGS (0xabcd << 16) | ||
2872 | #define EDP_FORCE_VDD (1 << 3) | 2873 | #define EDP_FORCE_VDD (1 << 3) |
2873 | #define EDP_BLC_ENABLE (1 << 2) | 2874 | #define EDP_BLC_ENABLE (1 << 2) |
2874 | #define PANEL_POWER_RESET (1 << 1) | 2875 | #define PANEL_POWER_RESET (1 << 1) |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 8359c50e6646..30d89111f559 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -866,8 +866,8 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | |||
866 | intel_clock_t clock; | 866 | intel_clock_t clock; |
867 | int max_n; | 867 | int max_n; |
868 | bool found; | 868 | bool found; |
869 | /* approximately equals target * 0.00488 */ | 869 | /* approximately equals target * 0.00585 */ |
870 | int err_most = (target >> 8) + (target >> 10); | 870 | int err_most = (target >> 8) + (target >> 9); |
871 | found = false; | 871 | found = false; |
872 | 872 | ||
873 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { | 873 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { |
@@ -1245,8 +1245,12 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1245 | struct drm_framebuffer *fb = crtc->fb; | 1245 | struct drm_framebuffer *fb = crtc->fb; |
1246 | struct intel_framebuffer *intel_fb; | 1246 | struct intel_framebuffer *intel_fb; |
1247 | struct drm_i915_gem_object *obj_priv; | 1247 | struct drm_i915_gem_object *obj_priv; |
1248 | struct drm_crtc *tmp_crtc; | ||
1248 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 1249 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
1249 | int plane = intel_crtc->plane; | 1250 | int plane = intel_crtc->plane; |
1251 | int crtcs_enabled = 0; | ||
1252 | |||
1253 | DRM_DEBUG_KMS("\n"); | ||
1250 | 1254 | ||
1251 | if (!i915_powersave) | 1255 | if (!i915_powersave) |
1252 | return; | 1256 | return; |
@@ -1264,10 +1268,21 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1264 | * If FBC is already on, we just have to verify that we can | 1268 | * If FBC is already on, we just have to verify that we can |
1265 | * keep it that way... | 1269 | * keep it that way... |
1266 | * Need to disable if: | 1270 | * Need to disable if: |
1271 | * - more than one pipe is active | ||
1267 | * - changing FBC params (stride, fence, mode) | 1272 | * - changing FBC params (stride, fence, mode) |
1268 | * - new fb is too large to fit in compressed buffer | 1273 | * - new fb is too large to fit in compressed buffer |
1269 | * - going to an unsupported config (interlace, pixel multiply, etc.) | 1274 | * - going to an unsupported config (interlace, pixel multiply, etc.) |
1270 | */ | 1275 | */ |
1276 | list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) { | ||
1277 | if (tmp_crtc->enabled) | ||
1278 | crtcs_enabled++; | ||
1279 | } | ||
1280 | DRM_DEBUG_KMS("%d pipes active\n", crtcs_enabled); | ||
1281 | if (crtcs_enabled > 1) { | ||
1282 | DRM_DEBUG_KMS("more than one pipe active, disabling compression\n"); | ||
1283 | dev_priv->no_fbc_reason = FBC_MULTIPLE_PIPES; | ||
1284 | goto out_disable; | ||
1285 | } | ||
1271 | if (intel_fb->obj->size > dev_priv->cfb_size) { | 1286 | if (intel_fb->obj->size > dev_priv->cfb_size) { |
1272 | DRM_DEBUG_KMS("framebuffer too large, disabling " | 1287 | DRM_DEBUG_KMS("framebuffer too large, disabling " |
1273 | "compression\n"); | 1288 | "compression\n"); |
@@ -1320,7 +1335,7 @@ out_disable: | |||
1320 | } | 1335 | } |
1321 | } | 1336 | } |
1322 | 1337 | ||
1323 | static int | 1338 | int |
1324 | intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj) | 1339 | intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj) |
1325 | { | 1340 | { |
1326 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); | 1341 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); |
@@ -2321,6 +2336,11 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2321 | intel_wait_for_vblank(dev); | 2336 | intel_wait_for_vblank(dev); |
2322 | } | 2337 | } |
2323 | 2338 | ||
2339 | /* Don't disable pipe A or pipe A PLLs if needed */ | ||
2340 | if (pipeconf_reg == PIPEACONF && | ||
2341 | (dev_priv->quirks & QUIRK_PIPEA_FORCE)) | ||
2342 | goto skip_pipe_off; | ||
2343 | |||
2324 | /* Next, disable display pipes */ | 2344 | /* Next, disable display pipes */ |
2325 | temp = I915_READ(pipeconf_reg); | 2345 | temp = I915_READ(pipeconf_reg); |
2326 | if ((temp & PIPEACONF_ENABLE) != 0) { | 2346 | if ((temp & PIPEACONF_ENABLE) != 0) { |
@@ -2336,7 +2356,7 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2336 | I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE); | 2356 | I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE); |
2337 | I915_READ(dpll_reg); | 2357 | I915_READ(dpll_reg); |
2338 | } | 2358 | } |
2339 | 2359 | skip_pipe_off: | |
2340 | /* Wait for the clocks to turn off. */ | 2360 | /* Wait for the clocks to turn off. */ |
2341 | udelay(150); | 2361 | udelay(150); |
2342 | break; | 2362 | break; |
@@ -2422,8 +2442,6 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, | |||
2422 | if (mode->clock * 3 > IRONLAKE_FDI_FREQ * 4) | 2442 | if (mode->clock * 3 > IRONLAKE_FDI_FREQ * 4) |
2423 | return false; | 2443 | return false; |
2424 | } | 2444 | } |
2425 | |||
2426 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
2427 | return true; | 2445 | return true; |
2428 | } | 2446 | } |
2429 | 2447 | ||
@@ -3902,6 +3920,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
3902 | if (dev_priv->lvds_dither) { | 3920 | if (dev_priv->lvds_dither) { |
3903 | if (HAS_PCH_SPLIT(dev)) { | 3921 | if (HAS_PCH_SPLIT(dev)) { |
3904 | pipeconf |= PIPE_ENABLE_DITHER; | 3922 | pipeconf |= PIPE_ENABLE_DITHER; |
3923 | pipeconf &= ~PIPE_DITHER_TYPE_MASK; | ||
3905 | pipeconf |= PIPE_DITHER_TYPE_ST01; | 3924 | pipeconf |= PIPE_DITHER_TYPE_ST01; |
3906 | } else | 3925 | } else |
3907 | lvds |= LVDS_ENABLE_DITHER; | 3926 | lvds |= LVDS_ENABLE_DITHER; |
@@ -4578,7 +4597,8 @@ static void intel_increase_pllclock(struct drm_crtc *crtc, bool schedule) | |||
4578 | DRM_DEBUG_DRIVER("upclocking LVDS\n"); | 4597 | DRM_DEBUG_DRIVER("upclocking LVDS\n"); |
4579 | 4598 | ||
4580 | /* Unlock panel regs */ | 4599 | /* Unlock panel regs */ |
4581 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); | 4600 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | |
4601 | PANEL_UNLOCK_REGS); | ||
4582 | 4602 | ||
4583 | dpll &= ~DISPLAY_RATE_SELECT_FPA1; | 4603 | dpll &= ~DISPLAY_RATE_SELECT_FPA1; |
4584 | I915_WRITE(dpll_reg, dpll); | 4604 | I915_WRITE(dpll_reg, dpll); |
@@ -4621,7 +4641,8 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc) | |||
4621 | DRM_DEBUG_DRIVER("downclocking LVDS\n"); | 4641 | DRM_DEBUG_DRIVER("downclocking LVDS\n"); |
4622 | 4642 | ||
4623 | /* Unlock panel regs */ | 4643 | /* Unlock panel regs */ |
4624 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); | 4644 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | |
4645 | PANEL_UNLOCK_REGS); | ||
4625 | 4646 | ||
4626 | dpll |= DISPLAY_RATE_SELECT_FPA1; | 4647 | dpll |= DISPLAY_RATE_SELECT_FPA1; |
4627 | I915_WRITE(dpll_reg, dpll); | 4648 | I915_WRITE(dpll_reg, dpll); |
@@ -4863,7 +4884,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4863 | struct drm_gem_object *obj; | 4884 | struct drm_gem_object *obj; |
4864 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 4885 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
4865 | struct intel_unpin_work *work; | 4886 | struct intel_unpin_work *work; |
4866 | unsigned long flags; | 4887 | unsigned long flags, offset; |
4867 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; | 4888 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; |
4868 | int ret, pipesrc; | 4889 | int ret, pipesrc; |
4869 | u32 flip_mask; | 4890 | u32 flip_mask; |
@@ -4925,19 +4946,23 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4925 | while (I915_READ(ISR) & flip_mask) | 4946 | while (I915_READ(ISR) & flip_mask) |
4926 | ; | 4947 | ; |
4927 | 4948 | ||
4949 | /* Offset into the new buffer for cases of shared fbs between CRTCs */ | ||
4950 | offset = obj_priv->gtt_offset; | ||
4951 | offset += (crtc->y * fb->pitch) + (crtc->x * (fb->bits_per_pixel) / 8); | ||
4952 | |||
4928 | BEGIN_LP_RING(4); | 4953 | BEGIN_LP_RING(4); |
4929 | if (IS_I965G(dev)) { | 4954 | if (IS_I965G(dev)) { |
4930 | OUT_RING(MI_DISPLAY_FLIP | | 4955 | OUT_RING(MI_DISPLAY_FLIP | |
4931 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 4956 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
4932 | OUT_RING(fb->pitch); | 4957 | OUT_RING(fb->pitch); |
4933 | OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode); | 4958 | OUT_RING(offset | obj_priv->tiling_mode); |
4934 | pipesrc = I915_READ(pipesrc_reg); | 4959 | pipesrc = I915_READ(pipesrc_reg); |
4935 | OUT_RING(pipesrc & 0x0fff0fff); | 4960 | OUT_RING(pipesrc & 0x0fff0fff); |
4936 | } else { | 4961 | } else { |
4937 | OUT_RING(MI_DISPLAY_FLIP_I915 | | 4962 | OUT_RING(MI_DISPLAY_FLIP_I915 | |
4938 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 4963 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
4939 | OUT_RING(fb->pitch); | 4964 | OUT_RING(fb->pitch); |
4940 | OUT_RING(obj_priv->gtt_offset); | 4965 | OUT_RING(offset); |
4941 | OUT_RING(MI_NOOP); | 4966 | OUT_RING(MI_NOOP); |
4942 | } | 4967 | } |
4943 | ADVANCE_LP_RING(); | 4968 | ADVANCE_LP_RING(); |
@@ -5709,6 +5734,66 @@ static void intel_init_display(struct drm_device *dev) | |||
5709 | } | 5734 | } |
5710 | } | 5735 | } |
5711 | 5736 | ||
5737 | /* | ||
5738 | * Some BIOSes insist on assuming the GPU's pipe A is enabled at suspend, | ||
5739 | * resume, or other times. This quirk makes sure that's the case for | ||
5740 | * affected systems. | ||
5741 | */ | ||
5742 | static void quirk_pipea_force (struct drm_device *dev) | ||
5743 | { | ||
5744 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5745 | |||
5746 | dev_priv->quirks |= QUIRK_PIPEA_FORCE; | ||
5747 | DRM_DEBUG_DRIVER("applying pipe a force quirk\n"); | ||
5748 | } | ||
5749 | |||
5750 | struct intel_quirk { | ||
5751 | int device; | ||
5752 | int subsystem_vendor; | ||
5753 | int subsystem_device; | ||
5754 | void (*hook)(struct drm_device *dev); | ||
5755 | }; | ||
5756 | |||
5757 | struct intel_quirk intel_quirks[] = { | ||
5758 | /* HP Compaq 2730p needs pipe A force quirk (LP: #291555) */ | ||
5759 | { 0x2a42, 0x103c, 0x30eb, quirk_pipea_force }, | ||
5760 | /* HP Mini needs pipe A force quirk (LP: #322104) */ | ||
5761 | { 0x27ae,0x103c, 0x361a, quirk_pipea_force }, | ||
5762 | |||
5763 | /* Thinkpad R31 needs pipe A force quirk */ | ||
5764 | { 0x3577, 0x1014, 0x0505, quirk_pipea_force }, | ||
5765 | /* Toshiba Protege R-205, S-209 needs pipe A force quirk */ | ||
5766 | { 0x2592, 0x1179, 0x0001, quirk_pipea_force }, | ||
5767 | |||
5768 | /* ThinkPad X30 needs pipe A force quirk (LP: #304614) */ | ||
5769 | { 0x3577, 0x1014, 0x0513, quirk_pipea_force }, | ||
5770 | /* ThinkPad X40 needs pipe A force quirk */ | ||
5771 | |||
5772 | /* ThinkPad T60 needs pipe A force quirk (bug #16494) */ | ||
5773 | { 0x2782, 0x17aa, 0x201a, quirk_pipea_force }, | ||
5774 | |||
5775 | /* 855 & before need to leave pipe A & dpll A up */ | ||
5776 | { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, | ||
5777 | { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, | ||
5778 | }; | ||
5779 | |||
5780 | static void intel_init_quirks(struct drm_device *dev) | ||
5781 | { | ||
5782 | struct pci_dev *d = dev->pdev; | ||
5783 | int i; | ||
5784 | |||
5785 | for (i = 0; i < ARRAY_SIZE(intel_quirks); i++) { | ||
5786 | struct intel_quirk *q = &intel_quirks[i]; | ||
5787 | |||
5788 | if (d->device == q->device && | ||
5789 | (d->subsystem_vendor == q->subsystem_vendor || | ||
5790 | q->subsystem_vendor == PCI_ANY_ID) && | ||
5791 | (d->subsystem_device == q->subsystem_device || | ||
5792 | q->subsystem_device == PCI_ANY_ID)) | ||
5793 | q->hook(dev); | ||
5794 | } | ||
5795 | } | ||
5796 | |||
5712 | void intel_modeset_init(struct drm_device *dev) | 5797 | void intel_modeset_init(struct drm_device *dev) |
5713 | { | 5798 | { |
5714 | struct drm_i915_private *dev_priv = dev->dev_private; | 5799 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -5721,6 +5806,8 @@ void intel_modeset_init(struct drm_device *dev) | |||
5721 | 5806 | ||
5722 | dev->mode_config.funcs = (void *)&intel_mode_funcs; | 5807 | dev->mode_config.funcs = (void *)&intel_mode_funcs; |
5723 | 5808 | ||
5809 | intel_init_quirks(dev); | ||
5810 | |||
5724 | intel_init_display(dev); | 5811 | intel_init_display(dev); |
5725 | 5812 | ||
5726 | if (IS_I965G(dev)) { | 5813 | if (IS_I965G(dev)) { |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index b4f02826676e..c612981e6195 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -744,6 +744,51 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
744 | } | 744 | } |
745 | } | 745 | } |
746 | 746 | ||
747 | static void ironlake_edp_panel_on (struct drm_device *dev) | ||
748 | { | ||
749 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
750 | unsigned long timeout = jiffies + msecs_to_jiffies(5000); | ||
751 | u32 pp, pp_status; | ||
752 | |||
753 | pp_status = I915_READ(PCH_PP_STATUS); | ||
754 | if (pp_status & PP_ON) | ||
755 | return; | ||
756 | |||
757 | pp = I915_READ(PCH_PP_CONTROL); | ||
758 | pp |= PANEL_UNLOCK_REGS | POWER_TARGET_ON; | ||
759 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
760 | do { | ||
761 | pp_status = I915_READ(PCH_PP_STATUS); | ||
762 | } while (((pp_status & PP_ON) == 0) && !time_after(jiffies, timeout)); | ||
763 | |||
764 | if (time_after(jiffies, timeout)) | ||
765 | DRM_DEBUG_KMS("panel on wait timed out: 0x%08x\n", pp_status); | ||
766 | |||
767 | pp &= ~(PANEL_UNLOCK_REGS | EDP_FORCE_VDD); | ||
768 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
769 | } | ||
770 | |||
771 | static void ironlake_edp_panel_off (struct drm_device *dev) | ||
772 | { | ||
773 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
774 | unsigned long timeout = jiffies + msecs_to_jiffies(5000); | ||
775 | u32 pp, pp_status; | ||
776 | |||
777 | pp = I915_READ(PCH_PP_CONTROL); | ||
778 | pp &= ~POWER_TARGET_ON; | ||
779 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
780 | do { | ||
781 | pp_status = I915_READ(PCH_PP_STATUS); | ||
782 | } while ((pp_status & PP_ON) && !time_after(jiffies, timeout)); | ||
783 | |||
784 | if (time_after(jiffies, timeout)) | ||
785 | DRM_DEBUG_KMS("panel off wait timed out\n"); | ||
786 | |||
787 | /* Make sure VDD is enabled so DP AUX will work */ | ||
788 | pp |= EDP_FORCE_VDD; | ||
789 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
790 | } | ||
791 | |||
747 | static void ironlake_edp_backlight_on (struct drm_device *dev) | 792 | static void ironlake_edp_backlight_on (struct drm_device *dev) |
748 | { | 793 | { |
749 | struct drm_i915_private *dev_priv = dev->dev_private; | 794 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -778,14 +823,18 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
778 | if (mode != DRM_MODE_DPMS_ON) { | 823 | if (mode != DRM_MODE_DPMS_ON) { |
779 | if (dp_reg & DP_PORT_EN) { | 824 | if (dp_reg & DP_PORT_EN) { |
780 | intel_dp_link_down(intel_encoder, dp_priv->DP); | 825 | intel_dp_link_down(intel_encoder, dp_priv->DP); |
781 | if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv)) | 826 | if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv)) { |
782 | ironlake_edp_backlight_off(dev); | 827 | ironlake_edp_backlight_off(dev); |
828 | ironlake_edp_panel_off(dev); | ||
829 | } | ||
783 | } | 830 | } |
784 | } else { | 831 | } else { |
785 | if (!(dp_reg & DP_PORT_EN)) { | 832 | if (!(dp_reg & DP_PORT_EN)) { |
786 | intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); | 833 | intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); |
787 | if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv)) | 834 | if (IS_eDP(intel_encoder) || IS_PCH_eDP(dp_priv)) { |
835 | ironlake_edp_panel_on(dev); | ||
788 | ironlake_edp_backlight_on(dev); | 836 | ironlake_edp_backlight_on(dev); |
837 | } | ||
789 | } | 838 | } |
790 | } | 839 | } |
791 | dp_priv->dpms_mode = mode; | 840 | dp_priv->dpms_mode = mode; |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 3fbedd829965..8c941da8ca38 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -216,6 +216,9 @@ extern void intel_init_clock_gating(struct drm_device *dev); | |||
216 | extern void ironlake_enable_drps(struct drm_device *dev); | 216 | extern void ironlake_enable_drps(struct drm_device *dev); |
217 | extern void ironlake_disable_drps(struct drm_device *dev); | 217 | extern void ironlake_disable_drps(struct drm_device *dev); |
218 | 218 | ||
219 | extern int intel_pin_and_fence_fb_obj(struct drm_device *dev, | ||
220 | struct drm_gem_object *obj); | ||
221 | |||
219 | extern int intel_framebuffer_init(struct drm_device *dev, | 222 | extern int intel_framebuffer_init(struct drm_device *dev, |
220 | struct intel_framebuffer *ifb, | 223 | struct intel_framebuffer *ifb, |
221 | struct drm_mode_fb_cmd *mode_cmd, | 224 | struct drm_mode_fb_cmd *mode_cmd, |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index c3c505244e07..3e18c9e7729b 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -98,7 +98,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev, | |||
98 | 98 | ||
99 | mutex_lock(&dev->struct_mutex); | 99 | mutex_lock(&dev->struct_mutex); |
100 | 100 | ||
101 | ret = i915_gem_object_pin(fbo, 64*1024); | 101 | ret = intel_pin_and_fence_fb_obj(dev, fbo); |
102 | if (ret) { | 102 | if (ret) { |
103 | DRM_ERROR("failed to pin fb: %d\n", ret); | 103 | DRM_ERROR("failed to pin fb: %d\n", ret); |
104 | goto out_unref; | 104 | goto out_unref; |
@@ -236,7 +236,7 @@ int intel_fbdev_destroy(struct drm_device *dev, | |||
236 | 236 | ||
237 | drm_framebuffer_cleanup(&ifb->base); | 237 | drm_framebuffer_cleanup(&ifb->base); |
238 | if (ifb->obj) | 238 | if (ifb->obj) |
239 | drm_gem_object_unreference_unlocked(ifb->obj); | 239 | drm_gem_object_unreference(ifb->obj); |
240 | 240 | ||
241 | return 0; | 241 | return 0; |
242 | } | 242 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index ed66062ae9d0..07579ae2ab68 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -335,6 +335,7 @@ static ssize_t radeon_get_pm_profile(struct device *dev, | |||
335 | return snprintf(buf, PAGE_SIZE, "%s\n", | 335 | return snprintf(buf, PAGE_SIZE, "%s\n", |
336 | (cp == PM_PROFILE_AUTO) ? "auto" : | 336 | (cp == PM_PROFILE_AUTO) ? "auto" : |
337 | (cp == PM_PROFILE_LOW) ? "low" : | 337 | (cp == PM_PROFILE_LOW) ? "low" : |
338 | (cp == PM_PROFILE_MID) ? "mid" : | ||
338 | (cp == PM_PROFILE_HIGH) ? "high" : "default"); | 339 | (cp == PM_PROFILE_HIGH) ? "high" : "default"); |
339 | } | 340 | } |
340 | 341 | ||