diff options
author | Dave Airlie <airlied@redhat.com> | 2014-12-01 19:58:33 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-12-01 19:58:33 -0500 |
commit | e8115e79aa62b6ebdb3e8e61ca4092cc32938afc (patch) | |
tree | 42b791ab54ef9d5c73dcd49f907b8b37fa2f7e19 /drivers/gpu | |
parent | 9be23ae4350bfd71c0cc2ea3494671ee90e5603b (diff) | |
parent | 009d0431c3914de64666bec0d350e54fdd59df6a (diff) |
Merge tag 'v3.18-rc7' into drm-next
This fixes a bunch of conflicts prior to merging i915 tree.
Linux 3.18-rc7
Conflicts:
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/tegra/dc.c
Diffstat (limited to 'drivers/gpu')
29 files changed, 196 insertions, 60 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index d71fb54582d2..25ba3628960a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c | |||
@@ -646,6 +646,18 @@ static int exynos_drm_init(void) | |||
646 | if (!is_exynos) | 646 | if (!is_exynos) |
647 | return -ENODEV; | 647 | return -ENODEV; |
648 | 648 | ||
649 | /* | ||
650 | * Register device object only in case of Exynos SoC. | ||
651 | * | ||
652 | * Below codes resolves temporarily infinite loop issue incurred | ||
653 | * by Exynos drm driver when using multi-platform kernel. | ||
654 | * So these codes will be replaced with more generic way later. | ||
655 | */ | ||
656 | if (!of_machine_is_compatible("samsung,exynos3") && | ||
657 | !of_machine_is_compatible("samsung,exynos4") && | ||
658 | !of_machine_is_compatible("samsung,exynos5")) | ||
659 | return -ENODEV; | ||
660 | |||
649 | exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1, | 661 | exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1, |
650 | NULL, 0); | 662 | NULL, 0); |
651 | if (IS_ERR(exynos_drm_pdev)) | 663 | if (IS_ERR(exynos_drm_pdev)) |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 9a7353302b3f..7a966f3c9950 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1663,15 +1663,17 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1663 | goto out_regs; | 1663 | goto out_regs; |
1664 | 1664 | ||
1665 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | 1665 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { |
1666 | ret = i915_kick_out_vgacon(dev_priv); | 1666 | /* WARNING: Apparently we must kick fbdev drivers before vgacon, |
1667 | * otherwise the vga fbdev driver falls over. */ | ||
1668 | ret = i915_kick_out_firmware_fb(dev_priv); | ||
1667 | if (ret) { | 1669 | if (ret) { |
1668 | DRM_ERROR("failed to remove conflicting VGA console\n"); | 1670 | DRM_ERROR("failed to remove conflicting framebuffer drivers\n"); |
1669 | goto out_gtt; | 1671 | goto out_gtt; |
1670 | } | 1672 | } |
1671 | 1673 | ||
1672 | ret = i915_kick_out_firmware_fb(dev_priv); | 1674 | ret = i915_kick_out_vgacon(dev_priv); |
1673 | if (ret) { | 1675 | if (ret) { |
1674 | DRM_ERROR("failed to remove conflicting framebuffer drivers\n"); | 1676 | DRM_ERROR("failed to remove conflicting VGA console\n"); |
1675 | goto out_gtt; | 1677 | goto out_gtt; |
1676 | } | 1678 | } |
1677 | } | 1679 | } |
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index de12017c809b..c1cf3329108c 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -1920,6 +1920,22 @@ static void bdw_setup_private_ppat(struct drm_i915_private *dev_priv) | |||
1920 | GEN8_PPAT(6, GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(2)) | | 1920 | GEN8_PPAT(6, GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(2)) | |
1921 | GEN8_PPAT(7, GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(3)); | 1921 | GEN8_PPAT(7, GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(3)); |
1922 | 1922 | ||
1923 | if (!USES_PPGTT(dev_priv->dev)) | ||
1924 | /* Spec: "For GGTT, there is NO pat_sel[2:0] from the entry, | ||
1925 | * so RTL will always use the value corresponding to | ||
1926 | * pat_sel = 000". | ||
1927 | * So let's disable cache for GGTT to avoid screen corruptions. | ||
1928 | * MOCS still can be used though. | ||
1929 | * - System agent ggtt writes (i.e. cpu gtt mmaps) already work | ||
1930 | * before this patch, i.e. the same uncached + snooping access | ||
1931 | * like on gen6/7 seems to be in effect. | ||
1932 | * - So this just fixes blitter/render access. Again it looks | ||
1933 | * like it's not just uncached access, but uncached + snooping. | ||
1934 | * So we can still hold onto all our assumptions wrt cpu | ||
1935 | * clflushing on LLC machines. | ||
1936 | */ | ||
1937 | pat = GEN8_PPAT(0, GEN8_PPAT_UC); | ||
1938 | |||
1923 | /* XXX: spec defines this as 2 distinct registers. It's unclear if a 64b | 1939 | /* XXX: spec defines this as 2 distinct registers. It's unclear if a 64b |
1924 | * write would work. */ | 1940 | * write would work. */ |
1925 | I915_WRITE(GEN8_PRIVATE_PAT, pat); | 1941 | I915_WRITE(GEN8_PRIVATE_PAT, pat); |
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index 749ab485569e..cd7f4734c9f8 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c | |||
@@ -375,22 +375,9 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, | |||
375 | * has to also include the unfenced register the GPU uses | 375 | * has to also include the unfenced register the GPU uses |
376 | * whilst executing a fenced command for an untiled object. | 376 | * whilst executing a fenced command for an untiled object. |
377 | */ | 377 | */ |
378 | 378 | if (obj->map_and_fenceable && | |
379 | obj->map_and_fenceable = | 379 | !i915_gem_object_fence_ok(obj, args->tiling_mode)) |
380 | !i915_gem_obj_ggtt_bound(obj) || | 380 | ret = i915_gem_object_ggtt_unbind(obj); |
381 | (i915_gem_obj_ggtt_offset(obj) + | ||
382 | obj->base.size <= dev_priv->gtt.mappable_end && | ||
383 | i915_gem_object_fence_ok(obj, args->tiling_mode)); | ||
384 | |||
385 | /* Rebind if we need a change of alignment */ | ||
386 | if (!obj->map_and_fenceable) { | ||
387 | u32 unfenced_align = | ||
388 | i915_gem_get_gtt_alignment(dev, obj->base.size, | ||
389 | args->tiling_mode, | ||
390 | false); | ||
391 | if (i915_gem_obj_ggtt_offset(obj) & (unfenced_align - 1)) | ||
392 | ret = i915_gem_object_ggtt_unbind(obj); | ||
393 | } | ||
394 | 381 | ||
395 | if (ret == 0) { | 382 | if (ret == 0) { |
396 | obj->fence_dirty = | 383 | obj->fence_dirty = |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 947144985700..e9a0df8a437b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -9066,6 +9066,10 @@ static bool page_flip_finished(struct intel_crtc *crtc) | |||
9066 | struct drm_device *dev = crtc->base.dev; | 9066 | struct drm_device *dev = crtc->base.dev; |
9067 | struct drm_i915_private *dev_priv = dev->dev_private; | 9067 | struct drm_i915_private *dev_priv = dev->dev_private; |
9068 | 9068 | ||
9069 | if (i915_reset_in_progress(&dev_priv->gpu_error) || | ||
9070 | crtc->reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter)) | ||
9071 | return true; | ||
9072 | |||
9069 | /* | 9073 | /* |
9070 | * The relevant registers doen't exist on pre-ctg. | 9074 | * The relevant registers doen't exist on pre-ctg. |
9071 | * As the flip done interrupt doesn't trigger for mmio | 9075 | * As the flip done interrupt doesn't trigger for mmio |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index ceb528f07c25..49288437e52a 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -4686,6 +4686,7 @@ static void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder) | |||
4686 | * vdd might still be enabled do to the delayed vdd off. | 4686 | * vdd might still be enabled do to the delayed vdd off. |
4687 | * Make sure vdd is actually turned off here. | 4687 | * Make sure vdd is actually turned off here. |
4688 | */ | 4688 | */ |
4689 | cancel_delayed_work_sync(&intel_dp->panel_vdd_work); | ||
4689 | pps_lock(intel_dp); | 4690 | pps_lock(intel_dp); |
4690 | edp_panel_vdd_off_sync(intel_dp); | 4691 | edp_panel_vdd_off_sync(intel_dp); |
4691 | pps_unlock(intel_dp); | 4692 | pps_unlock(intel_dp); |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index e18b3f49074c..b001c90312e7 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
@@ -1094,12 +1094,25 @@ static u32 get_backlight_min_vbt(struct intel_connector *connector) | |||
1094 | struct drm_device *dev = connector->base.dev; | 1094 | struct drm_device *dev = connector->base.dev; |
1095 | struct drm_i915_private *dev_priv = dev->dev_private; | 1095 | struct drm_i915_private *dev_priv = dev->dev_private; |
1096 | struct intel_panel *panel = &connector->panel; | 1096 | struct intel_panel *panel = &connector->panel; |
1097 | int min; | ||
1097 | 1098 | ||
1098 | WARN_ON(panel->backlight.max == 0); | 1099 | WARN_ON(panel->backlight.max == 0); |
1099 | 1100 | ||
1101 | /* | ||
1102 | * XXX: If the vbt value is 255, it makes min equal to max, which leads | ||
1103 | * to problems. There are such machines out there. Either our | ||
1104 | * interpretation is wrong or the vbt has bogus data. Or both. Safeguard | ||
1105 | * against this by letting the minimum be at most (arbitrarily chosen) | ||
1106 | * 25% of the max. | ||
1107 | */ | ||
1108 | min = clamp_t(int, dev_priv->vbt.backlight.min_brightness, 0, 64); | ||
1109 | if (min != dev_priv->vbt.backlight.min_brightness) { | ||
1110 | DRM_DEBUG_KMS("clamping VBT min backlight %d/255 to %d/255\n", | ||
1111 | dev_priv->vbt.backlight.min_brightness, min); | ||
1112 | } | ||
1113 | |||
1100 | /* vbt value is a coefficient in range [0..255] */ | 1114 | /* vbt value is a coefficient in range [0..255] */ |
1101 | return scale(dev_priv->vbt.backlight.min_brightness, 0, 255, | 1115 | return scale(min, 0, 255, 0, panel->backlight.max); |
1102 | 0, panel->backlight.max); | ||
1103 | } | 1116 | } |
1104 | 1117 | ||
1105 | static int bdw_setup_backlight(struct intel_connector *connector) | 1118 | static int bdw_setup_backlight(struct intel_connector *connector) |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 300d7e503f96..8a0788dcf106 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -6533,11 +6533,6 @@ static void gen6_init_clock_gating(struct drm_device *dev) | |||
6533 | I915_WRITE(_3D_CHICKEN, | 6533 | I915_WRITE(_3D_CHICKEN, |
6534 | _MASKED_BIT_ENABLE(_3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB)); | 6534 | _MASKED_BIT_ENABLE(_3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB)); |
6535 | 6535 | ||
6536 | /* WaSetupGtModeTdRowDispatch:snb */ | ||
6537 | if (IS_SNB_GT1(dev)) | ||
6538 | I915_WRITE(GEN6_GT_MODE, | ||
6539 | _MASKED_BIT_ENABLE(GEN6_TD_FOUR_ROW_DISPATCH_DISABLE)); | ||
6540 | |||
6541 | /* WaDisable_RenderCache_OperationalFlush:snb */ | 6536 | /* WaDisable_RenderCache_OperationalFlush:snb */ |
6542 | I915_WRITE(CACHE_MODE_0, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE)); | 6537 | I915_WRITE(CACHE_MODE_0, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE)); |
6543 | 6538 | ||
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/gk20a.c b/drivers/gpu/drm/nouveau/core/subdev/fb/gk20a.c index a16024a74771..fde42e4d1b56 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/gk20a.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/gk20a.c | |||
@@ -27,6 +27,20 @@ struct gk20a_fb_priv { | |||
27 | }; | 27 | }; |
28 | 28 | ||
29 | static int | 29 | static int |
30 | gk20a_fb_init(struct nouveau_object *object) | ||
31 | { | ||
32 | struct gk20a_fb_priv *priv = (void *)object; | ||
33 | int ret; | ||
34 | |||
35 | ret = nouveau_fb_init(&priv->base); | ||
36 | if (ret) | ||
37 | return ret; | ||
38 | |||
39 | nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */ | ||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | static int | ||
30 | gk20a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | 44 | gk20a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, |
31 | struct nouveau_oclass *oclass, void *data, u32 size, | 45 | struct nouveau_oclass *oclass, void *data, u32 size, |
32 | struct nouveau_object **pobject) | 46 | struct nouveau_object **pobject) |
@@ -48,7 +62,7 @@ gk20a_fb_oclass = &(struct nouveau_fb_impl) { | |||
48 | .base.ofuncs = &(struct nouveau_ofuncs) { | 62 | .base.ofuncs = &(struct nouveau_ofuncs) { |
49 | .ctor = gk20a_fb_ctor, | 63 | .ctor = gk20a_fb_ctor, |
50 | .dtor = _nouveau_fb_dtor, | 64 | .dtor = _nouveau_fb_dtor, |
51 | .init = _nouveau_fb_init, | 65 | .init = gk20a_fb_init, |
52 | .fini = _nouveau_fb_fini, | 66 | .fini = _nouveau_fb_fini, |
53 | }, | 67 | }, |
54 | .memtype = nvc0_fb_memtype_valid, | 68 | .memtype = nvc0_fb_memtype_valid, |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 76b8c4f980ea..5beae7596f62 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -792,6 +792,22 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update) | |||
792 | } | 792 | } |
793 | 793 | ||
794 | static int | 794 | static int |
795 | nv50_crtc_set_raster_vblank_dmi(struct nouveau_crtc *nv_crtc, u32 usec) | ||
796 | { | ||
797 | struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); | ||
798 | u32 *push; | ||
799 | |||
800 | push = evo_wait(mast, 8); | ||
801 | if (!push) | ||
802 | return -ENOMEM; | ||
803 | |||
804 | evo_mthd(push, 0x0828 + (nv_crtc->index * 0x400), 1); | ||
805 | evo_data(push, usec); | ||
806 | evo_kick(push, mast); | ||
807 | return 0; | ||
808 | } | ||
809 | |||
810 | static int | ||
795 | nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update) | 811 | nv50_crtc_set_color_vibrance(struct nouveau_crtc *nv_crtc, bool update) |
796 | { | 812 | { |
797 | struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); | 813 | struct nv50_mast *mast = nv50_mast(nv_crtc->base.dev); |
@@ -1105,14 +1121,14 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, | |||
1105 | evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2); | 1121 | evo_mthd(push, 0x0804 + (nv_crtc->index * 0x400), 2); |
1106 | evo_data(push, 0x00800000 | mode->clock); | 1122 | evo_data(push, 0x00800000 | mode->clock); |
1107 | evo_data(push, (ilace == 2) ? 2 : 0); | 1123 | evo_data(push, (ilace == 2) ? 2 : 0); |
1108 | evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 8); | 1124 | evo_mthd(push, 0x0810 + (nv_crtc->index * 0x400), 6); |
1109 | evo_data(push, 0x00000000); | 1125 | evo_data(push, 0x00000000); |
1110 | evo_data(push, (vactive << 16) | hactive); | 1126 | evo_data(push, (vactive << 16) | hactive); |
1111 | evo_data(push, ( vsynce << 16) | hsynce); | 1127 | evo_data(push, ( vsynce << 16) | hsynce); |
1112 | evo_data(push, (vblanke << 16) | hblanke); | 1128 | evo_data(push, (vblanke << 16) | hblanke); |
1113 | evo_data(push, (vblanks << 16) | hblanks); | 1129 | evo_data(push, (vblanks << 16) | hblanks); |
1114 | evo_data(push, (vblan2e << 16) | vblan2s); | 1130 | evo_data(push, (vblan2e << 16) | vblan2s); |
1115 | evo_data(push, vblankus); | 1131 | evo_mthd(push, 0x082c + (nv_crtc->index * 0x400), 1); |
1116 | evo_data(push, 0x00000000); | 1132 | evo_data(push, 0x00000000); |
1117 | evo_mthd(push, 0x0900 + (nv_crtc->index * 0x400), 2); | 1133 | evo_mthd(push, 0x0900 + (nv_crtc->index * 0x400), 2); |
1118 | evo_data(push, 0x00000311); | 1134 | evo_data(push, 0x00000311); |
@@ -1142,6 +1158,11 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, | |||
1142 | nv_connector = nouveau_crtc_connector_get(nv_crtc); | 1158 | nv_connector = nouveau_crtc_connector_get(nv_crtc); |
1143 | nv50_crtc_set_dither(nv_crtc, false); | 1159 | nv50_crtc_set_dither(nv_crtc, false); |
1144 | nv50_crtc_set_scale(nv_crtc, false); | 1160 | nv50_crtc_set_scale(nv_crtc, false); |
1161 | |||
1162 | /* G94 only accepts this after setting scale */ | ||
1163 | if (nv50_vers(mast) < GF110_DISP_CORE_CHANNEL_DMA) | ||
1164 | nv50_crtc_set_raster_vblank_dmi(nv_crtc, vblankus); | ||
1165 | |||
1145 | nv50_crtc_set_color_vibrance(nv_crtc, false); | 1166 | nv50_crtc_set_color_vibrance(nv_crtc, false); |
1146 | nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false); | 1167 | nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false); |
1147 | return 0; | 1168 | return 0; |
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index 15da7ef344a4..ec1593a6a561 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
@@ -1217,7 +1217,7 @@ free: | |||
1217 | return ret; | 1217 | return ret; |
1218 | } | 1218 | } |
1219 | 1219 | ||
1220 | int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params) | 1220 | int atom_execute_table_scratch_unlocked(struct atom_context *ctx, int index, uint32_t * params) |
1221 | { | 1221 | { |
1222 | int r; | 1222 | int r; |
1223 | 1223 | ||
@@ -1238,6 +1238,15 @@ int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params) | |||
1238 | return r; | 1238 | return r; |
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params) | ||
1242 | { | ||
1243 | int r; | ||
1244 | mutex_lock(&ctx->scratch_mutex); | ||
1245 | r = atom_execute_table_scratch_unlocked(ctx, index, params); | ||
1246 | mutex_unlock(&ctx->scratch_mutex); | ||
1247 | return r; | ||
1248 | } | ||
1249 | |||
1241 | static int atom_iio_len[] = { 1, 2, 3, 3, 3, 3, 4, 4, 4, 3 }; | 1250 | static int atom_iio_len[] = { 1, 2, 3, 3, 3, 3, 4, 4, 4, 3 }; |
1242 | 1251 | ||
1243 | static void atom_index_iio(struct atom_context *ctx, int base) | 1252 | static void atom_index_iio(struct atom_context *ctx, int base) |
diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h index feba6b8d36b3..6d014ddb6b78 100644 --- a/drivers/gpu/drm/radeon/atom.h +++ b/drivers/gpu/drm/radeon/atom.h | |||
@@ -125,6 +125,7 @@ struct card_info { | |||
125 | struct atom_context { | 125 | struct atom_context { |
126 | struct card_info *card; | 126 | struct card_info *card; |
127 | struct mutex mutex; | 127 | struct mutex mutex; |
128 | struct mutex scratch_mutex; | ||
128 | void *bios; | 129 | void *bios; |
129 | uint32_t cmd_table, data_table; | 130 | uint32_t cmd_table, data_table; |
130 | uint16_t *iio; | 131 | uint16_t *iio; |
@@ -145,6 +146,7 @@ extern int atom_debug; | |||
145 | 146 | ||
146 | struct atom_context *atom_parse(struct card_info *, void *); | 147 | struct atom_context *atom_parse(struct card_info *, void *); |
147 | int atom_execute_table(struct atom_context *, int, uint32_t *); | 148 | int atom_execute_table(struct atom_context *, int, uint32_t *); |
149 | int atom_execute_table_scratch_unlocked(struct atom_context *, int, uint32_t *); | ||
148 | int atom_asic_init(struct atom_context *); | 150 | int atom_asic_init(struct atom_context *); |
149 | void atom_destroy(struct atom_context *); | 151 | void atom_destroy(struct atom_context *); |
150 | bool atom_parse_data_header(struct atom_context *ctx, int index, uint16_t *size, | 152 | bool atom_parse_data_header(struct atom_context *ctx, int index, uint16_t *size, |
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 95d5d4ab3335..11ba9d21b89b 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c | |||
@@ -100,6 +100,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan, | |||
100 | memset(&args, 0, sizeof(args)); | 100 | memset(&args, 0, sizeof(args)); |
101 | 101 | ||
102 | mutex_lock(&chan->mutex); | 102 | mutex_lock(&chan->mutex); |
103 | mutex_lock(&rdev->mode_info.atom_context->scratch_mutex); | ||
103 | 104 | ||
104 | base = (unsigned char *)(rdev->mode_info.atom_context->scratch + 1); | 105 | base = (unsigned char *)(rdev->mode_info.atom_context->scratch + 1); |
105 | 106 | ||
@@ -113,7 +114,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan, | |||
113 | if (ASIC_IS_DCE4(rdev)) | 114 | if (ASIC_IS_DCE4(rdev)) |
114 | args.v2.ucHPD_ID = chan->rec.hpd; | 115 | args.v2.ucHPD_ID = chan->rec.hpd; |
115 | 116 | ||
116 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | 117 | atom_execute_table_scratch_unlocked(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
117 | 118 | ||
118 | *ack = args.v1.ucReplyStatus; | 119 | *ack = args.v1.ucReplyStatus; |
119 | 120 | ||
@@ -147,6 +148,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan, | |||
147 | 148 | ||
148 | r = recv_bytes; | 149 | r = recv_bytes; |
149 | done: | 150 | done: |
151 | mutex_unlock(&rdev->mode_info.atom_context->scratch_mutex); | ||
150 | mutex_unlock(&chan->mutex); | 152 | mutex_unlock(&chan->mutex); |
151 | 153 | ||
152 | return r; | 154 | return r; |
diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c index 9c570fb15b8c..4157780585a0 100644 --- a/drivers/gpu/drm/radeon/atombios_i2c.c +++ b/drivers/gpu/drm/radeon/atombios_i2c.c | |||
@@ -48,6 +48,7 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan, | |||
48 | memset(&args, 0, sizeof(args)); | 48 | memset(&args, 0, sizeof(args)); |
49 | 49 | ||
50 | mutex_lock(&chan->mutex); | 50 | mutex_lock(&chan->mutex); |
51 | mutex_lock(&rdev->mode_info.atom_context->scratch_mutex); | ||
51 | 52 | ||
52 | base = (unsigned char *)rdev->mode_info.atom_context->scratch; | 53 | base = (unsigned char *)rdev->mode_info.atom_context->scratch; |
53 | 54 | ||
@@ -82,7 +83,7 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan, | |||
82 | args.ucSlaveAddr = slave_addr << 1; | 83 | args.ucSlaveAddr = slave_addr << 1; |
83 | args.ucLineNumber = chan->rec.i2c_id; | 84 | args.ucLineNumber = chan->rec.i2c_id; |
84 | 85 | ||
85 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | 86 | atom_execute_table_scratch_unlocked(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
86 | 87 | ||
87 | /* error */ | 88 | /* error */ |
88 | if (args.ucStatus != HW_ASSISTED_I2C_STATUS_SUCCESS) { | 89 | if (args.ucStatus != HW_ASSISTED_I2C_STATUS_SUCCESS) { |
@@ -95,6 +96,7 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan, | |||
95 | radeon_atom_copy_swap(buf, base, num, false); | 96 | radeon_atom_copy_swap(buf, base, num, false); |
96 | 97 | ||
97 | done: | 98 | done: |
99 | mutex_unlock(&rdev->mode_info.atom_context->scratch_mutex); | ||
98 | mutex_unlock(&chan->mutex); | 100 | mutex_unlock(&chan->mutex); |
99 | 101 | ||
100 | return r; | 102 | return r; |
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index 3deeed33322f..6dcde3798b45 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
@@ -4333,8 +4333,8 @@ static int cik_cp_gfx_start(struct radeon_device *rdev) | |||
4333 | /* init the CE partitions. CE only used for gfx on CIK */ | 4333 | /* init the CE partitions. CE only used for gfx on CIK */ |
4334 | radeon_ring_write(ring, PACKET3(PACKET3_SET_BASE, 2)); | 4334 | radeon_ring_write(ring, PACKET3(PACKET3_SET_BASE, 2)); |
4335 | radeon_ring_write(ring, PACKET3_BASE_INDEX(CE_PARTITION_BASE)); | 4335 | radeon_ring_write(ring, PACKET3_BASE_INDEX(CE_PARTITION_BASE)); |
4336 | radeon_ring_write(ring, 0xc000); | 4336 | radeon_ring_write(ring, 0x8000); |
4337 | radeon_ring_write(ring, 0xc000); | 4337 | radeon_ring_write(ring, 0x8000); |
4338 | 4338 | ||
4339 | /* setup clear context state */ | 4339 | /* setup clear context state */ |
4340 | radeon_ring_write(ring, PACKET3(PACKET3_PREAMBLE_CNTL, 0)); | 4340 | radeon_ring_write(ring, PACKET3(PACKET3_PREAMBLE_CNTL, 0)); |
@@ -9417,6 +9417,9 @@ void dce8_bandwidth_update(struct radeon_device *rdev) | |||
9417 | u32 num_heads = 0, lb_size; | 9417 | u32 num_heads = 0, lb_size; |
9418 | int i; | 9418 | int i; |
9419 | 9419 | ||
9420 | if (!rdev->mode_info.mode_config_initialized) | ||
9421 | return; | ||
9422 | |||
9420 | radeon_update_display_priority(rdev); | 9423 | radeon_update_display_priority(rdev); |
9421 | 9424 | ||
9422 | for (i = 0; i < rdev->num_crtc; i++) { | 9425 | for (i = 0; i < rdev->num_crtc; i++) { |
diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c index 54b98379188d..dde5c7e29eb2 100644 --- a/drivers/gpu/drm/radeon/cik_sdma.c +++ b/drivers/gpu/drm/radeon/cik_sdma.c | |||
@@ -663,17 +663,20 @@ int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
663 | { | 663 | { |
664 | struct radeon_ib ib; | 664 | struct radeon_ib ib; |
665 | unsigned i; | 665 | unsigned i; |
666 | unsigned index; | ||
666 | int r; | 667 | int r; |
667 | void __iomem *ptr = (void *)rdev->vram_scratch.ptr; | ||
668 | u32 tmp = 0; | 668 | u32 tmp = 0; |
669 | u64 gpu_addr; | ||
669 | 670 | ||
670 | if (!ptr) { | 671 | if (ring->idx == R600_RING_TYPE_DMA_INDEX) |
671 | DRM_ERROR("invalid vram scratch pointer\n"); | 672 | index = R600_WB_DMA_RING_TEST_OFFSET; |
672 | return -EINVAL; | 673 | else |
673 | } | 674 | index = CAYMAN_WB_DMA1_RING_TEST_OFFSET; |
675 | |||
676 | gpu_addr = rdev->wb.gpu_addr + index; | ||
674 | 677 | ||
675 | tmp = 0xCAFEDEAD; | 678 | tmp = 0xCAFEDEAD; |
676 | writel(tmp, ptr); | 679 | rdev->wb.wb[index/4] = cpu_to_le32(tmp); |
677 | 680 | ||
678 | r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256); | 681 | r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256); |
679 | if (r) { | 682 | if (r) { |
@@ -682,8 +685,8 @@ int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
682 | } | 685 | } |
683 | 686 | ||
684 | ib.ptr[0] = SDMA_PACKET(SDMA_OPCODE_WRITE, SDMA_WRITE_SUB_OPCODE_LINEAR, 0); | 687 | ib.ptr[0] = SDMA_PACKET(SDMA_OPCODE_WRITE, SDMA_WRITE_SUB_OPCODE_LINEAR, 0); |
685 | ib.ptr[1] = rdev->vram_scratch.gpu_addr & 0xfffffffc; | 688 | ib.ptr[1] = lower_32_bits(gpu_addr); |
686 | ib.ptr[2] = upper_32_bits(rdev->vram_scratch.gpu_addr); | 689 | ib.ptr[2] = upper_32_bits(gpu_addr); |
687 | ib.ptr[3] = 1; | 690 | ib.ptr[3] = 1; |
688 | ib.ptr[4] = 0xDEADBEEF; | 691 | ib.ptr[4] = 0xDEADBEEF; |
689 | ib.length_dw = 5; | 692 | ib.length_dw = 5; |
@@ -700,7 +703,7 @@ int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
700 | return r; | 703 | return r; |
701 | } | 704 | } |
702 | for (i = 0; i < rdev->usec_timeout; i++) { | 705 | for (i = 0; i < rdev->usec_timeout; i++) { |
703 | tmp = readl(ptr); | 706 | tmp = le32_to_cpu(rdev->wb.wb[index/4]); |
704 | if (tmp == 0xDEADBEEF) | 707 | if (tmp == 0xDEADBEEF) |
705 | break; | 708 | break; |
706 | DRM_UDELAY(1); | 709 | DRM_UDELAY(1); |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index f37d39d2bbbc..85995b4e3338 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -2345,6 +2345,9 @@ void evergreen_bandwidth_update(struct radeon_device *rdev) | |||
2345 | u32 num_heads = 0, lb_size; | 2345 | u32 num_heads = 0, lb_size; |
2346 | int i; | 2346 | int i; |
2347 | 2347 | ||
2348 | if (!rdev->mode_info.mode_config_initialized) | ||
2349 | return; | ||
2350 | |||
2348 | radeon_update_display_priority(rdev); | 2351 | radeon_update_display_priority(rdev); |
2349 | 2352 | ||
2350 | for (i = 0; i < rdev->num_crtc; i++) { | 2353 | for (i = 0; i < rdev->num_crtc; i++) { |
@@ -2552,6 +2555,7 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav | |||
2552 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); | 2555 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1); |
2553 | tmp |= EVERGREEN_CRTC_BLANK_DATA_EN; | 2556 | tmp |= EVERGREEN_CRTC_BLANK_DATA_EN; |
2554 | WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp); | 2557 | WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp); |
2558 | WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0); | ||
2555 | } | 2559 | } |
2556 | } else { | 2560 | } else { |
2557 | tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); | 2561 | tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]); |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 10f8be0ee173..b53b31a7b76f 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -3207,6 +3207,9 @@ void r100_bandwidth_update(struct radeon_device *rdev) | |||
3207 | uint32_t pixel_bytes1 = 0; | 3207 | uint32_t pixel_bytes1 = 0; |
3208 | uint32_t pixel_bytes2 = 0; | 3208 | uint32_t pixel_bytes2 = 0; |
3209 | 3209 | ||
3210 | if (!rdev->mode_info.mode_config_initialized) | ||
3211 | return; | ||
3212 | |||
3210 | radeon_update_display_priority(rdev); | 3213 | radeon_update_display_priority(rdev); |
3211 | 3214 | ||
3212 | if (rdev->mode_info.crtcs[0]->base.enabled) { | 3215 | if (rdev->mode_info.crtcs[0]->base.enabled) { |
diff --git a/drivers/gpu/drm/radeon/r600_dma.c b/drivers/gpu/drm/radeon/r600_dma.c index 3a58b8073f49..d2dd29ab24fa 100644 --- a/drivers/gpu/drm/radeon/r600_dma.c +++ b/drivers/gpu/drm/radeon/r600_dma.c | |||
@@ -338,17 +338,17 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
338 | { | 338 | { |
339 | struct radeon_ib ib; | 339 | struct radeon_ib ib; |
340 | unsigned i; | 340 | unsigned i; |
341 | unsigned index; | ||
341 | int r; | 342 | int r; |
342 | void __iomem *ptr = (void *)rdev->vram_scratch.ptr; | ||
343 | u32 tmp = 0; | 343 | u32 tmp = 0; |
344 | u64 gpu_addr; | ||
344 | 345 | ||
345 | if (!ptr) { | 346 | if (ring->idx == R600_RING_TYPE_DMA_INDEX) |
346 | DRM_ERROR("invalid vram scratch pointer\n"); | 347 | index = R600_WB_DMA_RING_TEST_OFFSET; |
347 | return -EINVAL; | 348 | else |
348 | } | 349 | index = CAYMAN_WB_DMA1_RING_TEST_OFFSET; |
349 | 350 | ||
350 | tmp = 0xCAFEDEAD; | 351 | gpu_addr = rdev->wb.gpu_addr + index; |
351 | writel(tmp, ptr); | ||
352 | 352 | ||
353 | r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256); | 353 | r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256); |
354 | if (r) { | 354 | if (r) { |
@@ -357,8 +357,8 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
357 | } | 357 | } |
358 | 358 | ||
359 | ib.ptr[0] = DMA_PACKET(DMA_PACKET_WRITE, 0, 0, 1); | 359 | ib.ptr[0] = DMA_PACKET(DMA_PACKET_WRITE, 0, 0, 1); |
360 | ib.ptr[1] = rdev->vram_scratch.gpu_addr & 0xfffffffc; | 360 | ib.ptr[1] = lower_32_bits(gpu_addr); |
361 | ib.ptr[2] = upper_32_bits(rdev->vram_scratch.gpu_addr) & 0xff; | 361 | ib.ptr[2] = upper_32_bits(gpu_addr) & 0xff; |
362 | ib.ptr[3] = 0xDEADBEEF; | 362 | ib.ptr[3] = 0xDEADBEEF; |
363 | ib.length_dw = 4; | 363 | ib.length_dw = 4; |
364 | 364 | ||
@@ -374,7 +374,7 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
374 | return r; | 374 | return r; |
375 | } | 375 | } |
376 | for (i = 0; i < rdev->usec_timeout; i++) { | 376 | for (i = 0; i < rdev->usec_timeout; i++) { |
377 | tmp = readl(ptr); | 377 | tmp = le32_to_cpu(rdev->wb.wb[index/4]); |
378 | if (tmp == 0xDEADBEEF) | 378 | if (tmp == 0xDEADBEEF) |
379 | break; | 379 | break; |
380 | DRM_UDELAY(1); | 380 | DRM_UDELAY(1); |
diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c index 76c6a17eeb2d..843b65f46ece 100644 --- a/drivers/gpu/drm/radeon/r600_dpm.c +++ b/drivers/gpu/drm/radeon/r600_dpm.c | |||
@@ -1265,7 +1265,7 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) | |||
1265 | (mode_info->atom_context->bios + data_offset + | 1265 | (mode_info->atom_context->bios + data_offset + |
1266 | le16_to_cpu(ext_hdr->usPowerTuneTableOffset)); | 1266 | le16_to_cpu(ext_hdr->usPowerTuneTableOffset)); |
1267 | rdev->pm.dpm.dyn_state.cac_tdp_table->maximum_power_delivery_limit = | 1267 | rdev->pm.dpm.dyn_state.cac_tdp_table->maximum_power_delivery_limit = |
1268 | ppt->usMaximumPowerDeliveryLimit; | 1268 | le16_to_cpu(ppt->usMaximumPowerDeliveryLimit); |
1269 | pt = &ppt->power_tune_table; | 1269 | pt = &ppt->power_tune_table; |
1270 | } else { | 1270 | } else { |
1271 | ATOM_PPLIB_POWERTUNE_Table *ppt = (ATOM_PPLIB_POWERTUNE_Table *) | 1271 | ATOM_PPLIB_POWERTUNE_Table *ppt = (ATOM_PPLIB_POWERTUNE_Table *) |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 300c4b3d4669..26baa9c05f6c 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -322,6 +322,12 @@ static void radeon_connector_get_edid(struct drm_connector *connector) | |||
322 | } | 322 | } |
323 | 323 | ||
324 | if (!radeon_connector->edid) { | 324 | if (!radeon_connector->edid) { |
325 | /* don't fetch the edid from the vbios if ddc fails and runpm is | ||
326 | * enabled so we report disconnected. | ||
327 | */ | ||
328 | if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0)) | ||
329 | return; | ||
330 | |||
325 | if (rdev->is_atom_bios) { | 331 | if (rdev->is_atom_bios) { |
326 | /* some laptops provide a hardcoded edid in rom for LCDs */ | 332 | /* some laptops provide a hardcoded edid in rom for LCDs */ |
327 | if (((connector->connector_type == DRM_MODE_CONNECTOR_LVDS) || | 333 | if (((connector->connector_type == DRM_MODE_CONNECTOR_LVDS) || |
@@ -826,6 +832,8 @@ static int radeon_lvds_mode_valid(struct drm_connector *connector, | |||
826 | static enum drm_connector_status | 832 | static enum drm_connector_status |
827 | radeon_lvds_detect(struct drm_connector *connector, bool force) | 833 | radeon_lvds_detect(struct drm_connector *connector, bool force) |
828 | { | 834 | { |
835 | struct drm_device *dev = connector->dev; | ||
836 | struct radeon_device *rdev = dev->dev_private; | ||
829 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 837 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
830 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); | 838 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); |
831 | enum drm_connector_status ret = connector_status_disconnected; | 839 | enum drm_connector_status ret = connector_status_disconnected; |
@@ -842,7 +850,11 @@ radeon_lvds_detect(struct drm_connector *connector, bool force) | |||
842 | /* check if panel is valid */ | 850 | /* check if panel is valid */ |
843 | if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240) | 851 | if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240) |
844 | ret = connector_status_connected; | 852 | ret = connector_status_connected; |
845 | 853 | /* don't fetch the edid from the vbios if ddc fails and runpm is | |
854 | * enabled so we report disconnected. | ||
855 | */ | ||
856 | if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0)) | ||
857 | ret = connector_status_disconnected; | ||
846 | } | 858 | } |
847 | 859 | ||
848 | /* check for edid as well */ | 860 | /* check for edid as well */ |
@@ -1589,6 +1601,11 @@ radeon_dp_detect(struct drm_connector *connector, bool force) | |||
1589 | /* check if panel is valid */ | 1601 | /* check if panel is valid */ |
1590 | if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240) | 1602 | if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240) |
1591 | ret = connector_status_connected; | 1603 | ret = connector_status_connected; |
1604 | /* don't fetch the edid from the vbios if ddc fails and runpm is | ||
1605 | * enabled so we report disconnected. | ||
1606 | */ | ||
1607 | if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0)) | ||
1608 | ret = connector_status_disconnected; | ||
1592 | } | 1609 | } |
1593 | /* eDP is always DP */ | 1610 | /* eDP is always DP */ |
1594 | radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; | 1611 | radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index ae87310fd96e..0ec65168f331 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -983,6 +983,7 @@ int radeon_atombios_init(struct radeon_device *rdev) | |||
983 | } | 983 | } |
984 | 984 | ||
985 | mutex_init(&rdev->mode_info.atom_context->mutex); | 985 | mutex_init(&rdev->mode_info.atom_context->mutex); |
986 | mutex_init(&rdev->mode_info.atom_context->scratch_mutex); | ||
986 | radeon_atom_initialize_bios_scratch_regs(rdev->ddev); | 987 | radeon_atom_initialize_bios_scratch_regs(rdev->ddev); |
987 | atom_allocate_fb_scratch(rdev->mode_info.atom_context); | 988 | atom_allocate_fb_scratch(rdev->mode_info.atom_context); |
988 | return 0; | 989 | return 0; |
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 9a19e52cc655..6b670b0bc47b 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
@@ -179,6 +179,9 @@ static void radeon_encoder_add_backlight(struct radeon_encoder *radeon_encoder, | |||
179 | (rdev->pdev->subsystem_vendor == 0x1734) && | 179 | (rdev->pdev->subsystem_vendor == 0x1734) && |
180 | (rdev->pdev->subsystem_device == 0x1107)) | 180 | (rdev->pdev->subsystem_device == 0x1107)) |
181 | use_bl = false; | 181 | use_bl = false; |
182 | /* disable native backlight control on older asics */ | ||
183 | else if (rdev->family < CHIP_R600) | ||
184 | use_bl = false; | ||
182 | else | 185 | else |
183 | use_bl = true; | 186 | use_bl = true; |
184 | } | 187 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 7784911d78ef..00fc59762e0d 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c | |||
@@ -185,6 +185,16 @@ static bool radeon_msi_ok(struct radeon_device *rdev) | |||
185 | if (rdev->flags & RADEON_IS_AGP) | 185 | if (rdev->flags & RADEON_IS_AGP) |
186 | return false; | 186 | return false; |
187 | 187 | ||
188 | /* | ||
189 | * Older chips have a HW limitation, they can only generate 40 bits | ||
190 | * of address for "64-bit" MSIs which breaks on some platforms, notably | ||
191 | * IBM POWER servers, so we limit them | ||
192 | */ | ||
193 | if (rdev->family < CHIP_BONAIRE) { | ||
194 | dev_info(rdev->dev, "radeon: MSI limited to 32-bit\n"); | ||
195 | rdev->pdev->no_64bit_msi = 1; | ||
196 | } | ||
197 | |||
188 | /* force MSI on */ | 198 | /* force MSI on */ |
189 | if (radeon_msi == 1) | 199 | if (radeon_msi == 1) |
190 | return true; | 200 | return true; |
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 5f6db4629aaa..9acb1c3c005b 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
@@ -879,6 +879,9 @@ void rs600_bandwidth_update(struct radeon_device *rdev) | |||
879 | u32 d1mode_priority_a_cnt, d2mode_priority_a_cnt; | 879 | u32 d1mode_priority_a_cnt, d2mode_priority_a_cnt; |
880 | /* FIXME: implement full support */ | 880 | /* FIXME: implement full support */ |
881 | 881 | ||
882 | if (!rdev->mode_info.mode_config_initialized) | ||
883 | return; | ||
884 | |||
882 | radeon_update_display_priority(rdev); | 885 | radeon_update_display_priority(rdev); |
883 | 886 | ||
884 | if (rdev->mode_info.crtcs[0]->base.enabled) | 887 | if (rdev->mode_info.crtcs[0]->base.enabled) |
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index 3462b64369bf..0a2d36e81108 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c | |||
@@ -579,6 +579,9 @@ void rs690_bandwidth_update(struct radeon_device *rdev) | |||
579 | u32 d1mode_priority_a_cnt, d1mode_priority_b_cnt; | 579 | u32 d1mode_priority_a_cnt, d1mode_priority_b_cnt; |
580 | u32 d2mode_priority_a_cnt, d2mode_priority_b_cnt; | 580 | u32 d2mode_priority_a_cnt, d2mode_priority_b_cnt; |
581 | 581 | ||
582 | if (!rdev->mode_info.mode_config_initialized) | ||
583 | return; | ||
584 | |||
582 | radeon_update_display_priority(rdev); | 585 | radeon_update_display_priority(rdev); |
583 | 586 | ||
584 | if (rdev->mode_info.crtcs[0]->base.enabled) | 587 | if (rdev->mode_info.crtcs[0]->base.enabled) |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 8a477bf1fdb3..c55d653aaf5f 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
@@ -1277,6 +1277,9 @@ void rv515_bandwidth_update(struct radeon_device *rdev) | |||
1277 | struct drm_display_mode *mode0 = NULL; | 1277 | struct drm_display_mode *mode0 = NULL; |
1278 | struct drm_display_mode *mode1 = NULL; | 1278 | struct drm_display_mode *mode1 = NULL; |
1279 | 1279 | ||
1280 | if (!rdev->mode_info.mode_config_initialized) | ||
1281 | return; | ||
1282 | |||
1280 | radeon_update_display_priority(rdev); | 1283 | radeon_update_display_priority(rdev); |
1281 | 1284 | ||
1282 | if (rdev->mode_info.crtcs[0]->base.enabled) | 1285 | if (rdev->mode_info.crtcs[0]->base.enabled) |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 14896ce76324..60df444bd075 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -2384,6 +2384,9 @@ void dce6_bandwidth_update(struct radeon_device *rdev) | |||
2384 | u32 num_heads = 0, lb_size; | 2384 | u32 num_heads = 0, lb_size; |
2385 | int i; | 2385 | int i; |
2386 | 2386 | ||
2387 | if (!rdev->mode_info.mode_config_initialized) | ||
2388 | return; | ||
2389 | |||
2387 | radeon_update_display_priority(rdev); | 2390 | radeon_update_display_priority(rdev); |
2388 | 2391 | ||
2389 | for (i = 0; i < rdev->num_crtc; i++) { | 2392 | for (i = 0; i < rdev->num_crtc; i++) { |
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index b957908aec73..3367960286a6 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c | |||
@@ -906,7 +906,7 @@ static void tegra_crtc_disable(struct drm_crtc *crtc) | |||
906 | } | 906 | } |
907 | } | 907 | } |
908 | 908 | ||
909 | drm_vblank_off(drm, dc->pipe); | 909 | drm_crtc_vblank_off(crtc); |
910 | tegra_dc_commit(dc); | 910 | tegra_dc_commit(dc); |
911 | } | 911 | } |
912 | 912 | ||
@@ -996,8 +996,6 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc, | |||
996 | u32 value; | 996 | u32 value; |
997 | int err; | 997 | int err; |
998 | 998 | ||
999 | drm_vblank_pre_modeset(crtc->dev, dc->pipe); | ||
1000 | |||
1001 | err = tegra_crtc_setup_clk(crtc, mode); | 999 | err = tegra_crtc_setup_clk(crtc, mode); |
1002 | if (err) { | 1000 | if (err) { |
1003 | dev_err(dc->dev, "failed to setup clock for CRTC: %d\n", err); | 1001 | dev_err(dc->dev, "failed to setup clock for CRTC: %d\n", err); |
@@ -1051,6 +1049,8 @@ static void tegra_crtc_prepare(struct drm_crtc *crtc) | |||
1051 | unsigned int syncpt; | 1049 | unsigned int syncpt; |
1052 | unsigned long value; | 1050 | unsigned long value; |
1053 | 1051 | ||
1052 | drm_crtc_vblank_off(crtc); | ||
1053 | |||
1054 | /* hardware initialization */ | 1054 | /* hardware initialization */ |
1055 | reset_control_deassert(dc->rst); | 1055 | reset_control_deassert(dc->rst); |
1056 | usleep_range(10000, 20000); | 1056 | usleep_range(10000, 20000); |
@@ -1091,7 +1091,7 @@ static void tegra_crtc_commit(struct drm_crtc *crtc) | |||
1091 | { | 1091 | { |
1092 | struct tegra_dc *dc = to_tegra_dc(crtc); | 1092 | struct tegra_dc *dc = to_tegra_dc(crtc); |
1093 | 1093 | ||
1094 | drm_vblank_post_modeset(crtc->dev, dc->pipe); | 1094 | drm_crtc_vblank_on(crtc); |
1095 | tegra_dc_commit(dc); | 1095 | tegra_dc_commit(dc); |
1096 | } | 1096 | } |
1097 | 1097 | ||