aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/drm_drv.c3
-rw-r--r--drivers/gpu/drm/drm_modeset_lock.c1
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dpi.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.c8
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.h2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c19
-rw-r--r--drivers/gpu/drm/exynos/exynos_mixer.c50
-rw-r--r--drivers/gpu/drm/exynos/regs-mixer.h1
-rw-r--r--drivers/gpu/drm/i2c/tda998x_drv.c12
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c2
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c48
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c8
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c9
-rw-r--r--drivers/gpu/drm/i915/i915_gem_stolen.c44
-rw-r--r--drivers/gpu/drm/i915/i915_gpu_error.c3
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c18
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h3
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c6
-rw-r--r--drivers/gpu/drm/i915/intel_display.c54
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c42
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h6
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.c29
-rw-r--r--drivers/gpu/drm/i915/intel_dsi_cmd.c6
-rw-r--r--drivers/gpu/drm/i915/intel_opregion.c9
-rw-r--r--drivers/gpu/drm/i915/intel_panel.c13
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c89
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h2
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c4
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c8
-rw-r--r--drivers/gpu/drm/i915/intel_uncore.c3
-rw-r--r--drivers/gpu/drm/msm/hdmi/hdmi.c2
-rw-r--r--drivers/gpu/drm/msm/hdmi/hdmi.h1
-rw-r--r--drivers/gpu/drm/msm/hdmi/hdmi_connector.c8
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c22
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h1
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c2
-rw-r--r--drivers/gpu/drm/msm/msm_fbdev.c2
-rw-r--r--drivers/gpu/drm/msm/msm_gem.c6
-rw-r--r--drivers/gpu/drm/msm/msm_iommu.c23
-rw-r--r--drivers/gpu/drm/msm/msm_mmu.h1
-rw-r--r--drivers/gpu/drm/nouveau/Makefile1
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/device/nvc0.c2
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/base.c6
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/dport.c7
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nv50.c8
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c6
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c8
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c1
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc2
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/hub.fuc18
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubgm107.fuc5.h460
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnv108.fuc5.h460
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc.h188
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvd7.fuc.h188
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h170
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvf0.fuc.h170
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/macros.fuc6
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/fuc/os.h1
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nv50.c9
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c41
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h2
-rw-r--r--drivers/gpu/drm/nouveau/core/include/subdev/i2c.h1
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/clock/nve0.c8
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h4
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c77
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/i2c/gf117.c39
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/ibus/nve0.c19
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/host.fuc2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nv108.fuc.h2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nva3.fuc.h2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvc0.fuc.h2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvd0.fuc.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.c7
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drm.c17
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.c13
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.h1
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c3
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c118
-rw-r--r--drivers/gpu/drm/radeon/atombios_dp.c14
-rw-r--r--drivers/gpu/drm/radeon/ci_dpm.c2
-rw-r--r--drivers/gpu/drm/radeon/cik.c6
-rw-r--r--drivers/gpu/drm/radeon/cikd.h2
-rw-r--r--drivers/gpu/drm/radeon/cypress_dpm.c2
-rw-r--r--drivers/gpu/drm/radeon/evergreen.c14
-rw-r--r--drivers/gpu/drm/radeon/evergreen_reg.h2
-rw-r--r--drivers/gpu/drm/radeon/kv_dpm.c2
-rw-r--r--drivers/gpu/drm/radeon/ni_dpm.c2
-rw-r--r--drivers/gpu/drm/radeon/r500_reg.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon.h5
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c10
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c38
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c41
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_mode.h15
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c6
-rw-r--r--drivers/gpu/drm/radeon/radeon_vm.c4
-rw-r--r--drivers/gpu/drm/radeon/rv770_dpm.c6
-rw-r--r--drivers/gpu/drm/radeon/si.c6
-rw-r--r--drivers/gpu/drm/radeon/trinity_dpm.c10
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fb.c1
102 files changed, 1846 insertions, 995 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 03711d00aaae..8218078b6133 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -419,8 +419,9 @@ long drm_ioctl(struct file *filp,
419 retcode = -EFAULT; 419 retcode = -EFAULT;
420 goto err_i1; 420 goto err_i1;
421 } 421 }
422 } else 422 } else if (cmd & IOC_OUT) {
423 memset(kdata, 0, usize); 423 memset(kdata, 0, usize);
424 }
424 425
425 if (ioctl->flags & DRM_UNLOCKED) 426 if (ioctl->flags & DRM_UNLOCKED)
426 retcode = func(dev, kdata, file_priv); 427 retcode = func(dev, kdata, file_priv);
diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c
index 7c2497dea1e9..0dc57d5ecd10 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -64,6 +64,7 @@
64void drm_modeset_acquire_init(struct drm_modeset_acquire_ctx *ctx, 64void drm_modeset_acquire_init(struct drm_modeset_acquire_ctx *ctx,
65 uint32_t flags) 65 uint32_t flags)
66{ 66{
67 memset(ctx, 0, sizeof(*ctx));
67 ww_acquire_init(&ctx->ww_ctx, &crtc_ww_class); 68 ww_acquire_init(&ctx->ww_ctx, &crtc_ww_class);
68 INIT_LIST_HEAD(&ctx->locked); 69 INIT_LIST_HEAD(&ctx->locked);
69} 70}
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
index 482127f633c5..9e530f205ad2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
@@ -40,7 +40,7 @@ exynos_dpi_detect(struct drm_connector *connector, bool force)
40{ 40{
41 struct exynos_dpi *ctx = connector_to_dpi(connector); 41 struct exynos_dpi *ctx = connector_to_dpi(connector);
42 42
43 if (!ctx->panel->connector) 43 if (ctx->panel && !ctx->panel->connector)
44 drm_panel_attach(ctx->panel, &ctx->connector); 44 drm_panel_attach(ctx->panel, &ctx->connector);
45 45
46 return connector_status_connected; 46 return connector_status_connected;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index d91f27777537..ab7d182063c3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -765,24 +765,24 @@ static int exynos_drm_init(void)
765 765
766 return 0; 766 return 0;
767 767
768err_unregister_pd:
769 platform_device_unregister(exynos_drm_pdev);
770
771err_remove_vidi: 768err_remove_vidi:
772#ifdef CONFIG_DRM_EXYNOS_VIDI 769#ifdef CONFIG_DRM_EXYNOS_VIDI
773 exynos_drm_remove_vidi(); 770 exynos_drm_remove_vidi();
771
772err_unregister_pd:
774#endif 773#endif
774 platform_device_unregister(exynos_drm_pdev);
775 775
776 return ret; 776 return ret;
777} 777}
778 778
779static void exynos_drm_exit(void) 779static void exynos_drm_exit(void)
780{ 780{
781 platform_driver_unregister(&exynos_drm_platform_driver);
781#ifdef CONFIG_DRM_EXYNOS_VIDI 782#ifdef CONFIG_DRM_EXYNOS_VIDI
782 exynos_drm_remove_vidi(); 783 exynos_drm_remove_vidi();
783#endif 784#endif
784 platform_device_unregister(exynos_drm_pdev); 785 platform_device_unregister(exynos_drm_pdev);
785 platform_driver_unregister(&exynos_drm_platform_driver);
786} 786}
787 787
788module_init(exynos_drm_init); 788module_init(exynos_drm_init);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 36535f398848..06cde4506278 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -343,7 +343,7 @@ struct exynos_drm_display * exynos_dpi_probe(struct device *dev);
343int exynos_dpi_remove(struct device *dev); 343int exynos_dpi_remove(struct device *dev);
344#else 344#else
345static inline struct exynos_drm_display * 345static inline struct exynos_drm_display *
346exynos_dpi_probe(struct device *dev) { return 0; } 346exynos_dpi_probe(struct device *dev) { return NULL; }
347static inline int exynos_dpi_remove(struct device *dev) { return 0; } 347static inline int exynos_dpi_remove(struct device *dev) { return 0; }
348#endif 348#endif
349 349
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index bb45ab2e7384..33161ad38201 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -741,6 +741,8 @@ static void fimd_apply(struct exynos_drm_manager *mgr)
741 win_data = &ctx->win_data[i]; 741 win_data = &ctx->win_data[i];
742 if (win_data->enabled) 742 if (win_data->enabled)
743 fimd_win_commit(mgr, i); 743 fimd_win_commit(mgr, i);
744 else
745 fimd_win_disable(mgr, i);
744 } 746 }
745 747
746 fimd_commit(mgr); 748 fimd_commit(mgr);
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index c104d0c9b385..aa259b0a873a 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2090,6 +2090,11 @@ out:
2090 2090
2091static void hdmi_dpms(struct exynos_drm_display *display, int mode) 2091static void hdmi_dpms(struct exynos_drm_display *display, int mode)
2092{ 2092{
2093 struct hdmi_context *hdata = display->ctx;
2094 struct drm_encoder *encoder = hdata->encoder;
2095 struct drm_crtc *crtc = encoder->crtc;
2096 struct drm_crtc_helper_funcs *funcs = NULL;
2097
2093 DRM_DEBUG_KMS("mode %d\n", mode); 2098 DRM_DEBUG_KMS("mode %d\n", mode);
2094 2099
2095 switch (mode) { 2100 switch (mode) {
@@ -2099,6 +2104,20 @@ static void hdmi_dpms(struct exynos_drm_display *display, int mode)
2099 case DRM_MODE_DPMS_STANDBY: 2104 case DRM_MODE_DPMS_STANDBY:
2100 case DRM_MODE_DPMS_SUSPEND: 2105 case DRM_MODE_DPMS_SUSPEND:
2101 case DRM_MODE_DPMS_OFF: 2106 case DRM_MODE_DPMS_OFF:
2107 /*
2108 * The SFRs of VP and Mixer are updated by Vertical Sync of
2109 * Timing generator which is a part of HDMI so the sequence
2110 * to disable TV Subsystem should be as following,
2111 * VP -> Mixer -> HDMI
2112 *
2113 * Below codes will try to disable Mixer and VP(if used)
2114 * prior to disabling HDMI.
2115 */
2116 if (crtc)
2117 funcs = crtc->helper_private;
2118 if (funcs && funcs->dpms)
2119 (*funcs->dpms)(crtc, mode);
2120
2102 hdmi_poweroff(display); 2121 hdmi_poweroff(display);
2103 break; 2122 break;
2104 default: 2123 default:
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 4c5aed7e54c8..7529946d0a74 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -377,6 +377,20 @@ static void mixer_run(struct mixer_context *ctx)
377 mixer_regs_dump(ctx); 377 mixer_regs_dump(ctx);
378} 378}
379 379
380static void mixer_stop(struct mixer_context *ctx)
381{
382 struct mixer_resources *res = &ctx->mixer_res;
383 int timeout = 20;
384
385 mixer_reg_writemask(res, MXR_STATUS, 0, MXR_STATUS_REG_RUN);
386
387 while (!(mixer_reg_read(res, MXR_STATUS) & MXR_STATUS_REG_IDLE) &&
388 --timeout)
389 usleep_range(10000, 12000);
390
391 mixer_regs_dump(ctx);
392}
393
380static void vp_video_buffer(struct mixer_context *ctx, int win) 394static void vp_video_buffer(struct mixer_context *ctx, int win)
381{ 395{
382 struct mixer_resources *res = &ctx->mixer_res; 396 struct mixer_resources *res = &ctx->mixer_res;
@@ -497,13 +511,8 @@ static void vp_video_buffer(struct mixer_context *ctx, int win)
497static void mixer_layer_update(struct mixer_context *ctx) 511static void mixer_layer_update(struct mixer_context *ctx)
498{ 512{
499 struct mixer_resources *res = &ctx->mixer_res; 513 struct mixer_resources *res = &ctx->mixer_res;
500 u32 val;
501
502 val = mixer_reg_read(res, MXR_CFG);
503 514
504 /* allow one update per vsync only */ 515 mixer_reg_writemask(res, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE);
505 if (!(val & MXR_CFG_LAYER_UPDATE_COUNT_MASK))
506 mixer_reg_writemask(res, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE);
507} 516}
508 517
509static void mixer_graph_buffer(struct mixer_context *ctx, int win) 518static void mixer_graph_buffer(struct mixer_context *ctx, int win)
@@ -1010,6 +1019,8 @@ static void mixer_wait_for_vblank(struct exynos_drm_manager *mgr)
1010 } 1019 }
1011 mutex_unlock(&mixer_ctx->mixer_mutex); 1020 mutex_unlock(&mixer_ctx->mixer_mutex);
1012 1021
1022 drm_vblank_get(mgr->crtc->dev, mixer_ctx->pipe);
1023
1013 atomic_set(&mixer_ctx->wait_vsync_event, 1); 1024 atomic_set(&mixer_ctx->wait_vsync_event, 1);
1014 1025
1015 /* 1026 /*
@@ -1020,6 +1031,8 @@ static void mixer_wait_for_vblank(struct exynos_drm_manager *mgr)
1020 !atomic_read(&mixer_ctx->wait_vsync_event), 1031 !atomic_read(&mixer_ctx->wait_vsync_event),
1021 HZ/20)) 1032 HZ/20))
1022 DRM_DEBUG_KMS("vblank wait timed out.\n"); 1033 DRM_DEBUG_KMS("vblank wait timed out.\n");
1034
1035 drm_vblank_put(mgr->crtc->dev, mixer_ctx->pipe);
1023} 1036}
1024 1037
1025static void mixer_window_suspend(struct exynos_drm_manager *mgr) 1038static void mixer_window_suspend(struct exynos_drm_manager *mgr)
@@ -1061,7 +1074,7 @@ static void mixer_poweron(struct exynos_drm_manager *mgr)
1061 mutex_unlock(&ctx->mixer_mutex); 1074 mutex_unlock(&ctx->mixer_mutex);
1062 return; 1075 return;
1063 } 1076 }
1064 ctx->powered = true; 1077
1065 mutex_unlock(&ctx->mixer_mutex); 1078 mutex_unlock(&ctx->mixer_mutex);
1066 1079
1067 pm_runtime_get_sync(ctx->dev); 1080 pm_runtime_get_sync(ctx->dev);
@@ -1072,6 +1085,12 @@ static void mixer_poweron(struct exynos_drm_manager *mgr)
1072 clk_prepare_enable(res->sclk_mixer); 1085 clk_prepare_enable(res->sclk_mixer);
1073 } 1086 }
1074 1087
1088 mutex_lock(&ctx->mixer_mutex);
1089 ctx->powered = true;
1090 mutex_unlock(&ctx->mixer_mutex);
1091
1092 mixer_reg_writemask(res, MXR_STATUS, ~0, MXR_STATUS_SOFT_RESET);
1093
1075 mixer_reg_write(res, MXR_INT_EN, ctx->int_en); 1094 mixer_reg_write(res, MXR_INT_EN, ctx->int_en);
1076 mixer_win_reset(ctx); 1095 mixer_win_reset(ctx);
1077 1096
@@ -1084,14 +1103,21 @@ static void mixer_poweroff(struct exynos_drm_manager *mgr)
1084 struct mixer_resources *res = &ctx->mixer_res; 1103 struct mixer_resources *res = &ctx->mixer_res;
1085 1104
1086 mutex_lock(&ctx->mixer_mutex); 1105 mutex_lock(&ctx->mixer_mutex);
1087 if (!ctx->powered) 1106 if (!ctx->powered) {
1088 goto out; 1107 mutex_unlock(&ctx->mixer_mutex);
1108 return;
1109 }
1089 mutex_unlock(&ctx->mixer_mutex); 1110 mutex_unlock(&ctx->mixer_mutex);
1090 1111
1112 mixer_stop(ctx);
1091 mixer_window_suspend(mgr); 1113 mixer_window_suspend(mgr);
1092 1114
1093 ctx->int_en = mixer_reg_read(res, MXR_INT_EN); 1115 ctx->int_en = mixer_reg_read(res, MXR_INT_EN);
1094 1116
1117 mutex_lock(&ctx->mixer_mutex);
1118 ctx->powered = false;
1119 mutex_unlock(&ctx->mixer_mutex);
1120
1095 clk_disable_unprepare(res->mixer); 1121 clk_disable_unprepare(res->mixer);
1096 if (ctx->vp_enabled) { 1122 if (ctx->vp_enabled) {
1097 clk_disable_unprepare(res->vp); 1123 clk_disable_unprepare(res->vp);
@@ -1099,12 +1125,6 @@ static void mixer_poweroff(struct exynos_drm_manager *mgr)
1099 } 1125 }
1100 1126
1101 pm_runtime_put_sync(ctx->dev); 1127 pm_runtime_put_sync(ctx->dev);
1102
1103 mutex_lock(&ctx->mixer_mutex);
1104 ctx->powered = false;
1105
1106out:
1107 mutex_unlock(&ctx->mixer_mutex);
1108} 1128}
1109 1129
1110static void mixer_dpms(struct exynos_drm_manager *mgr, int mode) 1130static void mixer_dpms(struct exynos_drm_manager *mgr, int mode)
diff --git a/drivers/gpu/drm/exynos/regs-mixer.h b/drivers/gpu/drm/exynos/regs-mixer.h
index 4537026bc385..5f32e1a29411 100644
--- a/drivers/gpu/drm/exynos/regs-mixer.h
+++ b/drivers/gpu/drm/exynos/regs-mixer.h
@@ -78,6 +78,7 @@
78#define MXR_STATUS_BIG_ENDIAN (1 << 3) 78#define MXR_STATUS_BIG_ENDIAN (1 << 3)
79#define MXR_STATUS_ENDIAN_MASK (1 << 3) 79#define MXR_STATUS_ENDIAN_MASK (1 << 3)
80#define MXR_STATUS_SYNC_ENABLE (1 << 2) 80#define MXR_STATUS_SYNC_ENABLE (1 << 2)
81#define MXR_STATUS_REG_IDLE (1 << 1)
81#define MXR_STATUS_REG_RUN (1 << 0) 82#define MXR_STATUS_REG_RUN (1 << 0)
82 83
83/* bits for MXR_CFG */ 84/* bits for MXR_CFG */
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index 240c331405b9..ac357b02bd35 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -810,6 +810,12 @@ static int
810tda998x_encoder_mode_valid(struct drm_encoder *encoder, 810tda998x_encoder_mode_valid(struct drm_encoder *encoder,
811 struct drm_display_mode *mode) 811 struct drm_display_mode *mode)
812{ 812{
813 if (mode->clock > 150000)
814 return MODE_CLOCK_HIGH;
815 if (mode->htotal >= BIT(13))
816 return MODE_BAD_HVALUE;
817 if (mode->vtotal >= BIT(11))
818 return MODE_BAD_VVALUE;
813 return MODE_OK; 819 return MODE_OK;
814} 820}
815 821
@@ -1048,8 +1054,8 @@ read_edid_block(struct drm_encoder *encoder, uint8_t *buf, int blk)
1048 return i; 1054 return i;
1049 } 1055 }
1050 } else { 1056 } else {
1051 for (i = 10; i > 0; i--) { 1057 for (i = 100; i > 0; i--) {
1052 msleep(10); 1058 msleep(1);
1053 ret = reg_read(priv, REG_INT_FLAGS_2); 1059 ret = reg_read(priv, REG_INT_FLAGS_2);
1054 if (ret < 0) 1060 if (ret < 0)
1055 return ret; 1061 return ret;
@@ -1183,7 +1189,6 @@ static void
1183tda998x_encoder_destroy(struct drm_encoder *encoder) 1189tda998x_encoder_destroy(struct drm_encoder *encoder)
1184{ 1190{
1185 struct tda998x_priv *priv = to_tda998x_priv(encoder); 1191 struct tda998x_priv *priv = to_tda998x_priv(encoder);
1186 drm_i2c_encoder_destroy(encoder);
1187 1192
1188 /* disable all IRQs and free the IRQ handler */ 1193 /* disable all IRQs and free the IRQ handler */
1189 cec_write(priv, REG_CEC_RXSHPDINTENA, 0); 1194 cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
@@ -1193,6 +1198,7 @@ tda998x_encoder_destroy(struct drm_encoder *encoder)
1193 1198
1194 if (priv->cec) 1199 if (priv->cec)
1195 i2c_unregister_device(priv->cec); 1200 i2c_unregister_device(priv->cec);
1201 drm_i2c_encoder_destroy(encoder);
1196 kfree(priv); 1202 kfree(priv);
1197} 1203}
1198 1204
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 601caa88c092..b8c689202c40 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -446,7 +446,9 @@ static int i915_gem_object_info(struct seq_file *m, void* data)
446 446
447 memset(&stats, 0, sizeof(stats)); 447 memset(&stats, 0, sizeof(stats));
448 stats.file_priv = file->driver_priv; 448 stats.file_priv = file->driver_priv;
449 spin_lock(&file->table_lock);
449 idr_for_each(&file->object_idr, per_file_stats, &stats); 450 idr_for_each(&file->object_idr, per_file_stats, &stats);
451 spin_unlock(&file->table_lock);
450 /* 452 /*
451 * Although we have a valid reference on file->pid, that does 453 * Although we have a valid reference on file->pid, that does
452 * not guarantee that the task_struct who called get_pid() is 454 * not guarantee that the task_struct who called get_pid() is
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 4c22a5b7f4c5..d44344140627 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -36,6 +36,8 @@
36#include "i915_drv.h" 36#include "i915_drv.h"
37#include "i915_trace.h" 37#include "i915_trace.h"
38#include <linux/pci.h> 38#include <linux/pci.h>
39#include <linux/console.h>
40#include <linux/vt.h>
39#include <linux/vgaarb.h> 41#include <linux/vgaarb.h>
40#include <linux/acpi.h> 42#include <linux/acpi.h>
41#include <linux/pnp.h> 43#include <linux/pnp.h>
@@ -1386,7 +1388,6 @@ cleanup_gem:
1386 i915_gem_context_fini(dev); 1388 i915_gem_context_fini(dev);
1387 mutex_unlock(&dev->struct_mutex); 1389 mutex_unlock(&dev->struct_mutex);
1388 WARN_ON(dev_priv->mm.aliasing_ppgtt); 1390 WARN_ON(dev_priv->mm.aliasing_ppgtt);
1389 drm_mm_takedown(&dev_priv->gtt.base.mm);
1390cleanup_irq: 1391cleanup_irq:
1391 drm_irq_uninstall(dev); 1392 drm_irq_uninstall(dev);
1392cleanup_gem_stolen: 1393cleanup_gem_stolen:
@@ -1450,6 +1451,39 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
1450} 1451}
1451#endif 1452#endif
1452 1453
1454#if !defined(CONFIG_VGA_CONSOLE)
1455static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
1456{
1457 return 0;
1458}
1459#elif !defined(CONFIG_DUMMY_CONSOLE)
1460static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
1461{
1462 return -ENODEV;
1463}
1464#else
1465static int i915_kick_out_vgacon(struct drm_i915_private *dev_priv)
1466{
1467 int ret = 0;
1468
1469 DRM_INFO("Replacing VGA console driver\n");
1470
1471 console_lock();
1472 if (con_is_bound(&vga_con))
1473 ret = do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES - 1, 1);
1474 if (ret == 0) {
1475 ret = do_unregister_con_driver(&vga_con);
1476
1477 /* Ignore "already unregistered". */
1478 if (ret == -ENODEV)
1479 ret = 0;
1480 }
1481 console_unlock();
1482
1483 return ret;
1484}
1485#endif
1486
1453static void i915_dump_device_info(struct drm_i915_private *dev_priv) 1487static void i915_dump_device_info(struct drm_i915_private *dev_priv)
1454{ 1488{
1455 const struct intel_device_info *info = &dev_priv->info; 1489 const struct intel_device_info *info = &dev_priv->info;
@@ -1623,8 +1657,15 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1623 if (ret) 1657 if (ret)
1624 goto out_regs; 1658 goto out_regs;
1625 1659
1626 if (drm_core_check_feature(dev, DRIVER_MODESET)) 1660 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
1661 ret = i915_kick_out_vgacon(dev_priv);
1662 if (ret) {
1663 DRM_ERROR("failed to remove conflicting VGA console\n");
1664 goto out_gtt;
1665 }
1666
1627 i915_kick_out_firmware_fb(dev_priv); 1667 i915_kick_out_firmware_fb(dev_priv);
1668 }
1628 1669
1629 pci_set_master(dev->pdev); 1670 pci_set_master(dev->pdev);
1630 1671
@@ -1756,8 +1797,6 @@ out_mtrrfree:
1756 arch_phys_wc_del(dev_priv->gtt.mtrr); 1797 arch_phys_wc_del(dev_priv->gtt.mtrr);
1757 io_mapping_free(dev_priv->gtt.mappable); 1798 io_mapping_free(dev_priv->gtt.mappable);
1758out_gtt: 1799out_gtt:
1759 list_del(&dev_priv->gtt.base.global_link);
1760 drm_mm_takedown(&dev_priv->gtt.base.mm);
1761 dev_priv->gtt.base.cleanup(&dev_priv->gtt.base); 1800 dev_priv->gtt.base.cleanup(&dev_priv->gtt.base);
1762out_regs: 1801out_regs:
1763 intel_uncore_fini(dev); 1802 intel_uncore_fini(dev);
@@ -1846,7 +1885,6 @@ int i915_driver_unload(struct drm_device *dev)
1846 i915_free_hws(dev); 1885 i915_free_hws(dev);
1847 } 1886 }
1848 1887
1849 list_del(&dev_priv->gtt.base.global_link);
1850 WARN_ON(!list_empty(&dev_priv->vm_list)); 1888 WARN_ON(!list_empty(&dev_priv->vm_list));
1851 1889
1852 drm_vblank_cleanup(dev); 1890 drm_vblank_cleanup(dev);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 49414d30e8d4..374f964323ad 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -656,6 +656,7 @@ enum intel_sbi_destination {
656#define QUIRK_PIPEA_FORCE (1<<0) 656#define QUIRK_PIPEA_FORCE (1<<0)
657#define QUIRK_LVDS_SSC_DISABLE (1<<1) 657#define QUIRK_LVDS_SSC_DISABLE (1<<1)
658#define QUIRK_INVERT_BRIGHTNESS (1<<2) 658#define QUIRK_INVERT_BRIGHTNESS (1<<2)
659#define QUIRK_BACKLIGHT_PRESENT (1<<3)
659 660
660struct intel_fbdev; 661struct intel_fbdev;
661struct intel_fbc_work; 662struct intel_fbc_work;
@@ -977,6 +978,8 @@ struct i915_power_well {
977 bool always_on; 978 bool always_on;
978 /* power well enable/disable usage count */ 979 /* power well enable/disable usage count */
979 int count; 980 int count;
981 /* cached hw enabled state */
982 bool hw_enabled;
980 unsigned long domains; 983 unsigned long domains;
981 unsigned long data; 984 unsigned long data;
982 const struct i915_power_well_ops *ops; 985 const struct i915_power_well_ops *ops;
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 3ffe308d5893..a5ddf3bce9c3 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -598,6 +598,7 @@ static int do_switch(struct intel_engine_cs *ring,
598 struct intel_context *from = ring->last_context; 598 struct intel_context *from = ring->last_context;
599 struct i915_hw_ppgtt *ppgtt = ctx_to_ppgtt(to); 599 struct i915_hw_ppgtt *ppgtt = ctx_to_ppgtt(to);
600 u32 hw_flags = 0; 600 u32 hw_flags = 0;
601 bool uninitialized = false;
601 int ret, i; 602 int ret, i;
602 603
603 if (from != NULL && ring == &dev_priv->ring[RCS]) { 604 if (from != NULL && ring == &dev_priv->ring[RCS]) {
@@ -696,19 +697,20 @@ static int do_switch(struct intel_engine_cs *ring,
696 i915_gem_context_unreference(from); 697 i915_gem_context_unreference(from);
697 } 698 }
698 699
700 uninitialized = !to->is_initialized && from == NULL;
701 to->is_initialized = true;
702
699done: 703done:
700 i915_gem_context_reference(to); 704 i915_gem_context_reference(to);
701 ring->last_context = to; 705 ring->last_context = to;
702 to->last_ring = ring; 706 to->last_ring = ring;
703 707
704 if (ring->id == RCS && !to->is_initialized && from == NULL) { 708 if (uninitialized) {
705 ret = i915_gem_render_state_init(ring); 709 ret = i915_gem_render_state_init(ring);
706 if (ret) 710 if (ret)
707 DRM_ERROR("init render state: %d\n", ret); 711 DRM_ERROR("init render state: %d\n", ret);
708 } 712 }
709 713
710 to->is_initialized = true;
711
712 return 0; 714 return 0;
713 715
714unpin_out: 716unpin_out:
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index eec820aec022..8b3cde703364 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1992,7 +1992,10 @@ static void gen6_gmch_remove(struct i915_address_space *vm)
1992 1992
1993 struct i915_gtt *gtt = container_of(vm, struct i915_gtt, base); 1993 struct i915_gtt *gtt = container_of(vm, struct i915_gtt, base);
1994 1994
1995 drm_mm_takedown(&vm->mm); 1995 if (drm_mm_initialized(&vm->mm)) {
1996 drm_mm_takedown(&vm->mm);
1997 list_del(&vm->global_link);
1998 }
1996 iounmap(gtt->gsm); 1999 iounmap(gtt->gsm);
1997 teardown_scratch_page(vm->dev); 2000 teardown_scratch_page(vm->dev);
1998} 2001}
@@ -2025,6 +2028,10 @@ static int i915_gmch_probe(struct drm_device *dev,
2025 2028
2026static void i915_gmch_remove(struct i915_address_space *vm) 2029static void i915_gmch_remove(struct i915_address_space *vm)
2027{ 2030{
2031 if (drm_mm_initialized(&vm->mm)) {
2032 drm_mm_takedown(&vm->mm);
2033 list_del(&vm->global_link);
2034 }
2028 intel_gmch_remove(); 2035 intel_gmch_remove();
2029} 2036}
2030 2037
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 62ef55ba061c..7465ab0fd396 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -74,6 +74,50 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev)
74 if (base == 0) 74 if (base == 0)
75 return 0; 75 return 0;
76 76
77 /* make sure we don't clobber the GTT if it's within stolen memory */
78 if (INTEL_INFO(dev)->gen <= 4 && !IS_G33(dev) && !IS_G4X(dev)) {
79 struct {
80 u32 start, end;
81 } stolen[2] = {
82 { .start = base, .end = base + dev_priv->gtt.stolen_size, },
83 { .start = base, .end = base + dev_priv->gtt.stolen_size, },
84 };
85 u64 gtt_start, gtt_end;
86
87 gtt_start = I915_READ(PGTBL_CTL);
88 if (IS_GEN4(dev))
89 gtt_start = (gtt_start & PGTBL_ADDRESS_LO_MASK) |
90 (gtt_start & PGTBL_ADDRESS_HI_MASK) << 28;
91 else
92 gtt_start &= PGTBL_ADDRESS_LO_MASK;
93 gtt_end = gtt_start + gtt_total_entries(dev_priv->gtt) * 4;
94
95 if (gtt_start >= stolen[0].start && gtt_start < stolen[0].end)
96 stolen[0].end = gtt_start;
97 if (gtt_end > stolen[1].start && gtt_end <= stolen[1].end)
98 stolen[1].start = gtt_end;
99
100 /* pick the larger of the two chunks */
101 if (stolen[0].end - stolen[0].start >
102 stolen[1].end - stolen[1].start) {
103 base = stolen[0].start;
104 dev_priv->gtt.stolen_size = stolen[0].end - stolen[0].start;
105 } else {
106 base = stolen[1].start;
107 dev_priv->gtt.stolen_size = stolen[1].end - stolen[1].start;
108 }
109
110 if (stolen[0].start != stolen[1].start ||
111 stolen[0].end != stolen[1].end) {
112 DRM_DEBUG_KMS("GTT within stolen memory at 0x%llx-0x%llx\n",
113 (unsigned long long) gtt_start,
114 (unsigned long long) gtt_end - 1);
115 DRM_DEBUG_KMS("Stolen memory adjusted to 0x%x-0x%x\n",
116 base, base + (u32) dev_priv->gtt.stolen_size - 1);
117 }
118 }
119
120
77 /* Verify that nothing else uses this physical address. Stolen 121 /* Verify that nothing else uses this physical address. Stolen
78 * memory should be reserved by the BIOS and hidden from the 122 * memory should be reserved by the BIOS and hidden from the
79 * kernel. So if the region is already marked as busy, something 123 * kernel. So if the region is already marked as busy, something
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 87ec60e181a7..66cf41765bf9 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -888,6 +888,8 @@ static void i915_gem_record_rings(struct drm_device *dev,
888 for (i = 0; i < I915_NUM_RINGS; i++) { 888 for (i = 0; i < I915_NUM_RINGS; i++) {
889 struct intel_engine_cs *ring = &dev_priv->ring[i]; 889 struct intel_engine_cs *ring = &dev_priv->ring[i];
890 890
891 error->ring[i].pid = -1;
892
891 if (ring->dev == NULL) 893 if (ring->dev == NULL)
892 continue; 894 continue;
893 895
@@ -895,7 +897,6 @@ static void i915_gem_record_rings(struct drm_device *dev,
895 897
896 i915_record_ring_state(dev, ring, &error->ring[i]); 898 i915_record_ring_state(dev, ring, &error->ring[i]);
897 899
898 error->ring[i].pid = -1;
899 request = i915_gem_find_active_request(ring); 900 request = i915_gem_find_active_request(ring);
900 if (request) { 901 if (request) {
901 /* We need to copy these to an anonymous buffer 902 /* We need to copy these to an anonymous buffer
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 6f8017a7e937..267f069765ad 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2847,10 +2847,14 @@ static int semaphore_passed(struct intel_engine_cs *ring)
2847 struct intel_engine_cs *signaller; 2847 struct intel_engine_cs *signaller;
2848 u32 seqno, ctl; 2848 u32 seqno, ctl;
2849 2849
2850 ring->hangcheck.deadlock = true; 2850 ring->hangcheck.deadlock++;
2851 2851
2852 signaller = semaphore_waits_for(ring, &seqno); 2852 signaller = semaphore_waits_for(ring, &seqno);
2853 if (signaller == NULL || signaller->hangcheck.deadlock) 2853 if (signaller == NULL)
2854 return -1;
2855
2856 /* Prevent pathological recursion due to driver bugs */
2857 if (signaller->hangcheck.deadlock >= I915_NUM_RINGS)
2854 return -1; 2858 return -1;
2855 2859
2856 /* cursory check for an unkickable deadlock */ 2860 /* cursory check for an unkickable deadlock */
@@ -2858,7 +2862,13 @@ static int semaphore_passed(struct intel_engine_cs *ring)
2858 if (ctl & RING_WAIT_SEMAPHORE && semaphore_passed(signaller) < 0) 2862 if (ctl & RING_WAIT_SEMAPHORE && semaphore_passed(signaller) < 0)
2859 return -1; 2863 return -1;
2860 2864
2861 return i915_seqno_passed(signaller->get_seqno(signaller, false), seqno); 2865 if (i915_seqno_passed(signaller->get_seqno(signaller, false), seqno))
2866 return 1;
2867
2868 if (signaller->hangcheck.deadlock)
2869 return -1;
2870
2871 return 0;
2862} 2872}
2863 2873
2864static void semaphore_clear_deadlocks(struct drm_i915_private *dev_priv) 2874static void semaphore_clear_deadlocks(struct drm_i915_private *dev_priv)
@@ -2867,7 +2877,7 @@ static void semaphore_clear_deadlocks(struct drm_i915_private *dev_priv)
2867 int i; 2877 int i;
2868 2878
2869 for_each_ring(ring, dev_priv, i) 2879 for_each_ring(ring, dev_priv, i)
2870 ring->hangcheck.deadlock = false; 2880 ring->hangcheck.deadlock = 0;
2871} 2881}
2872 2882
2873static enum intel_ring_hangcheck_action 2883static enum intel_ring_hangcheck_action
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index e691b30b2817..a5bab61bfc00 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -942,6 +942,9 @@ enum punit_power_well {
942/* 942/*
943 * Instruction and interrupt control regs 943 * Instruction and interrupt control regs
944 */ 944 */
945#define PGTBL_CTL 0x02020
946#define PGTBL_ADDRESS_LO_MASK 0xfffff000 /* bits [31:12] */
947#define PGTBL_ADDRESS_HI_MASK 0x000000f0 /* bits [35:32] (gen4) */
945#define PGTBL_ER 0x02024 948#define PGTBL_ER 0x02024
946#define RENDER_RING_BASE 0x02000 949#define RENDER_RING_BASE 0x02000
947#define BSD_RING_BASE 0x04000 950#define BSD_RING_BASE 0x04000
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 1ee98f121a00..827498e081df 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -315,9 +315,6 @@ parse_lfp_backlight(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
315 const struct bdb_lfp_backlight_data *backlight_data; 315 const struct bdb_lfp_backlight_data *backlight_data;
316 const struct bdb_lfp_backlight_data_entry *entry; 316 const struct bdb_lfp_backlight_data_entry *entry;
317 317
318 /* Err to enabling backlight if no backlight block. */
319 dev_priv->vbt.backlight.present = true;
320
321 backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT); 318 backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT);
322 if (!backlight_data) 319 if (!backlight_data)
323 return; 320 return;
@@ -1088,6 +1085,9 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
1088 1085
1089 dev_priv->vbt.crt_ddc_pin = GMBUS_PORT_VGADDC; 1086 dev_priv->vbt.crt_ddc_pin = GMBUS_PORT_VGADDC;
1090 1087
1088 /* Default to having backlight */
1089 dev_priv->vbt.backlight.present = true;
1090
1091 /* LFP panel data */ 1091 /* LFP panel data */
1092 dev_priv->vbt.lvds_dither = 1; 1092 dev_priv->vbt.lvds_dither = 1;
1093 dev_priv->vbt.lvds_vbt = 0; 1093 dev_priv->vbt.lvds_vbt = 0;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index efd3cf50cb0f..e27e7804c0b9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2087,6 +2087,7 @@ void intel_flush_primary_plane(struct drm_i915_private *dev_priv,
2087static void intel_enable_primary_hw_plane(struct drm_i915_private *dev_priv, 2087static void intel_enable_primary_hw_plane(struct drm_i915_private *dev_priv,
2088 enum plane plane, enum pipe pipe) 2088 enum plane plane, enum pipe pipe)
2089{ 2089{
2090 struct drm_device *dev = dev_priv->dev;
2090 struct intel_crtc *intel_crtc = 2091 struct intel_crtc *intel_crtc =
2091 to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); 2092 to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
2092 int reg; 2093 int reg;
@@ -2106,6 +2107,14 @@ static void intel_enable_primary_hw_plane(struct drm_i915_private *dev_priv,
2106 2107
2107 I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE); 2108 I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE);
2108 intel_flush_primary_plane(dev_priv, plane); 2109 intel_flush_primary_plane(dev_priv, plane);
2110
2111 /*
2112 * BDW signals flip done immediately if the plane
2113 * is disabled, even if the plane enable is already
2114 * armed to occur at the next vblank :(
2115 */
2116 if (IS_BROADWELL(dev))
2117 intel_wait_for_vblank(dev, intel_crtc->pipe);
2109} 2118}
2110 2119
2111/** 2120/**
@@ -4564,7 +4573,10 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
4564 if (intel_crtc->active) 4573 if (intel_crtc->active)
4565 return; 4574 return;
4566 4575
4567 vlv_prepare_pll(intel_crtc); 4576 is_dsi = intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI);
4577
4578 if (!is_dsi && !IS_CHERRYVIEW(dev))
4579 vlv_prepare_pll(intel_crtc);
4568 4580
4569 /* Set up the display plane register */ 4581 /* Set up the display plane register */
4570 dspcntr = DISPPLANE_GAMMA_ENABLE; 4582 dspcntr = DISPPLANE_GAMMA_ENABLE;
@@ -4598,8 +4610,6 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)
4598 if (encoder->pre_pll_enable) 4610 if (encoder->pre_pll_enable)
4599 encoder->pre_pll_enable(encoder); 4611 encoder->pre_pll_enable(encoder);
4600 4612
4601 is_dsi = intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI);
4602
4603 if (!is_dsi) { 4613 if (!is_dsi) {
4604 if (IS_CHERRYVIEW(dev)) 4614 if (IS_CHERRYVIEW(dev))
4605 chv_enable_pll(intel_crtc); 4615 chv_enable_pll(intel_crtc);
@@ -11087,6 +11097,22 @@ const char *intel_output_name(int output)
11087 return names[output]; 11097 return names[output];
11088} 11098}
11089 11099
11100static bool intel_crt_present(struct drm_device *dev)
11101{
11102 struct drm_i915_private *dev_priv = dev->dev_private;
11103
11104 if (IS_ULT(dev))
11105 return false;
11106
11107 if (IS_CHERRYVIEW(dev))
11108 return false;
11109
11110 if (IS_VALLEYVIEW(dev) && !dev_priv->vbt.int_crt_support)
11111 return false;
11112
11113 return true;
11114}
11115
11090static void intel_setup_outputs(struct drm_device *dev) 11116static void intel_setup_outputs(struct drm_device *dev)
11091{ 11117{
11092 struct drm_i915_private *dev_priv = dev->dev_private; 11118 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -11095,7 +11121,7 @@ static void intel_setup_outputs(struct drm_device *dev)
11095 11121
11096 intel_lvds_init(dev); 11122 intel_lvds_init(dev);
11097 11123
11098 if (!IS_ULT(dev) && !IS_CHERRYVIEW(dev) && dev_priv->vbt.int_crt_support) 11124 if (intel_crt_present(dev))
11099 intel_crt_init(dev); 11125 intel_crt_init(dev);
11100 11126
11101 if (HAS_DDI(dev)) { 11127 if (HAS_DDI(dev)) {
@@ -11565,6 +11591,14 @@ static void quirk_invert_brightness(struct drm_device *dev)
11565 DRM_INFO("applying inverted panel brightness quirk\n"); 11591 DRM_INFO("applying inverted panel brightness quirk\n");
11566} 11592}
11567 11593
11594/* Some VBT's incorrectly indicate no backlight is present */
11595static void quirk_backlight_present(struct drm_device *dev)
11596{
11597 struct drm_i915_private *dev_priv = dev->dev_private;
11598 dev_priv->quirks |= QUIRK_BACKLIGHT_PRESENT;
11599 DRM_INFO("applying backlight present quirk\n");
11600}
11601
11568struct intel_quirk { 11602struct intel_quirk {
11569 int device; 11603 int device;
11570 int subsystem_vendor; 11604 int subsystem_vendor;
@@ -11633,6 +11667,12 @@ static struct intel_quirk intel_quirks[] = {
11633 11667
11634 /* Acer Aspire 5336 */ 11668 /* Acer Aspire 5336 */
11635 { 0x2a42, 0x1025, 0x048a, quirk_invert_brightness }, 11669 { 0x2a42, 0x1025, 0x048a, quirk_invert_brightness },
11670
11671 /* Acer C720 and C720P Chromebooks (Celeron 2955U) have backlights */
11672 { 0x0a06, 0x1025, 0x0a11, quirk_backlight_present },
11673
11674 /* Toshiba CB35 Chromebook (Celeron 2955U) */
11675 { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present },
11636}; 11676};
11637 11677
11638static void intel_init_quirks(struct drm_device *dev) 11678static void intel_init_quirks(struct drm_device *dev)
@@ -12411,8 +12451,8 @@ intel_display_capture_error_state(struct drm_device *dev)
12411 12451
12412 for_each_pipe(i) { 12452 for_each_pipe(i) {
12413 error->pipe[i].power_domain_on = 12453 error->pipe[i].power_domain_on =
12414 intel_display_power_enabled_sw(dev_priv, 12454 intel_display_power_enabled_unlocked(dev_priv,
12415 POWER_DOMAIN_PIPE(i)); 12455 POWER_DOMAIN_PIPE(i));
12416 if (!error->pipe[i].power_domain_on) 12456 if (!error->pipe[i].power_domain_on)
12417 continue; 12457 continue;
12418 12458
@@ -12447,7 +12487,7 @@ intel_display_capture_error_state(struct drm_device *dev)
12447 enum transcoder cpu_transcoder = transcoders[i]; 12487 enum transcoder cpu_transcoder = transcoders[i];
12448 12488
12449 error->transcoder[i].power_domain_on = 12489 error->transcoder[i].power_domain_on =
12450 intel_display_power_enabled_sw(dev_priv, 12490 intel_display_power_enabled_unlocked(dev_priv,
12451 POWER_DOMAIN_TRANSCODER(cpu_transcoder)); 12491 POWER_DOMAIN_TRANSCODER(cpu_transcoder));
12452 if (!error->transcoder[i].power_domain_on) 12492 if (!error->transcoder[i].power_domain_on)
12453 continue; 12493 continue;
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 52fda950fd2a..075170d1844f 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -28,6 +28,8 @@
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/export.h> 30#include <linux/export.h>
31#include <linux/notifier.h>
32#include <linux/reboot.h>
31#include <drm/drmP.h> 33#include <drm/drmP.h>
32#include <drm/drm_crtc.h> 34#include <drm/drm_crtc.h>
33#include <drm/drm_crtc_helper.h> 35#include <drm/drm_crtc_helper.h>
@@ -336,6 +338,37 @@ static u32 _pp_stat_reg(struct intel_dp *intel_dp)
336 return VLV_PIPE_PP_STATUS(vlv_power_sequencer_pipe(intel_dp)); 338 return VLV_PIPE_PP_STATUS(vlv_power_sequencer_pipe(intel_dp));
337} 339}
338 340
341/* Reboot notifier handler to shutdown panel power to guarantee T12 timing
342 This function only applicable when panel PM state is not to be tracked */
343static int edp_notify_handler(struct notifier_block *this, unsigned long code,
344 void *unused)
345{
346 struct intel_dp *intel_dp = container_of(this, typeof(* intel_dp),
347 edp_notifier);
348 struct drm_device *dev = intel_dp_to_dev(intel_dp);
349 struct drm_i915_private *dev_priv = dev->dev_private;
350 u32 pp_div;
351 u32 pp_ctrl_reg, pp_div_reg;
352 enum pipe pipe = vlv_power_sequencer_pipe(intel_dp);
353
354 if (!is_edp(intel_dp) || code != SYS_RESTART)
355 return 0;
356
357 if (IS_VALLEYVIEW(dev)) {
358 pp_ctrl_reg = VLV_PIPE_PP_CONTROL(pipe);
359 pp_div_reg = VLV_PIPE_PP_DIVISOR(pipe);
360 pp_div = I915_READ(pp_div_reg);
361 pp_div &= PP_REFERENCE_DIVIDER_MASK;
362
363 /* 0x1F write to PP_DIV_REG sets max cycle delay */
364 I915_WRITE(pp_div_reg, pp_div | 0x1F);
365 I915_WRITE(pp_ctrl_reg, PANEL_UNLOCK_REGS | PANEL_POWER_OFF);
366 msleep(intel_dp->panel_power_cycle_delay);
367 }
368
369 return 0;
370}
371
339static bool edp_have_panel_power(struct intel_dp *intel_dp) 372static bool edp_have_panel_power(struct intel_dp *intel_dp)
340{ 373{
341 struct drm_device *dev = intel_dp_to_dev(intel_dp); 374 struct drm_device *dev = intel_dp_to_dev(intel_dp);
@@ -3707,6 +3740,10 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
3707 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); 3740 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
3708 edp_panel_vdd_off_sync(intel_dp); 3741 edp_panel_vdd_off_sync(intel_dp);
3709 drm_modeset_unlock(&dev->mode_config.connection_mutex); 3742 drm_modeset_unlock(&dev->mode_config.connection_mutex);
3743 if (intel_dp->edp_notifier.notifier_call) {
3744 unregister_reboot_notifier(&intel_dp->edp_notifier);
3745 intel_dp->edp_notifier.notifier_call = NULL;
3746 }
3710 } 3747 }
3711 kfree(intel_dig_port); 3748 kfree(intel_dig_port);
3712} 3749}
@@ -4184,6 +4221,11 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
4184 } 4221 }
4185 mutex_unlock(&dev->mode_config.mutex); 4222 mutex_unlock(&dev->mode_config.mutex);
4186 4223
4224 if (IS_VALLEYVIEW(dev)) {
4225 intel_dp->edp_notifier.notifier_call = edp_notify_handler;
4226 register_reboot_notifier(&intel_dp->edp_notifier);
4227 }
4228
4187 intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode); 4229 intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
4188 intel_panel_setup_backlight(connector); 4230 intel_panel_setup_backlight(connector);
4189 4231
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index bda0ae3d80cc..f67340ed2c12 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -538,6 +538,8 @@ struct intel_dp {
538 unsigned long last_power_on; 538 unsigned long last_power_on;
539 unsigned long last_backlight_off; 539 unsigned long last_backlight_off;
540 bool psr_setup_done; 540 bool psr_setup_done;
541 struct notifier_block edp_notifier;
542
541 bool use_tps3; 543 bool use_tps3;
542 struct intel_connector *attached_connector; 544 struct intel_connector *attached_connector;
543 545
@@ -950,8 +952,8 @@ int intel_power_domains_init(struct drm_i915_private *);
950void intel_power_domains_remove(struct drm_i915_private *); 952void intel_power_domains_remove(struct drm_i915_private *);
951bool intel_display_power_enabled(struct drm_i915_private *dev_priv, 953bool intel_display_power_enabled(struct drm_i915_private *dev_priv,
952 enum intel_display_power_domain domain); 954 enum intel_display_power_domain domain);
953bool intel_display_power_enabled_sw(struct drm_i915_private *dev_priv, 955bool intel_display_power_enabled_unlocked(struct drm_i915_private *dev_priv,
954 enum intel_display_power_domain domain); 956 enum intel_display_power_domain domain);
955void intel_display_power_get(struct drm_i915_private *dev_priv, 957void intel_display_power_get(struct drm_i915_private *dev_priv,
956 enum intel_display_power_domain domain); 958 enum intel_display_power_domain domain);
957void intel_display_power_put(struct drm_i915_private *dev_priv, 959void intel_display_power_put(struct drm_i915_private *dev_priv,
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 02f99d768d49..3fd082933c87 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -117,17 +117,18 @@ static void intel_dsi_device_ready(struct intel_encoder *encoder)
117 /* bandgap reset is needed after everytime we do power gate */ 117 /* bandgap reset is needed after everytime we do power gate */
118 band_gap_reset(dev_priv); 118 band_gap_reset(dev_priv);
119 119
120 I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_ENTER);
121 usleep_range(2500, 3000);
122
120 val = I915_READ(MIPI_PORT_CTRL(pipe)); 123 val = I915_READ(MIPI_PORT_CTRL(pipe));
121 I915_WRITE(MIPI_PORT_CTRL(pipe), val | LP_OUTPUT_HOLD); 124 I915_WRITE(MIPI_PORT_CTRL(pipe), val | LP_OUTPUT_HOLD);
122 usleep_range(1000, 1500); 125 usleep_range(1000, 1500);
123 I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_EXIT); 126
124 usleep_range(2000, 2500); 127 I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_EXIT);
125 I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY); 128 usleep_range(2500, 3000);
126 usleep_range(2000, 2500); 129
127 I915_WRITE(MIPI_DEVICE_READY(pipe), 0x00);
128 usleep_range(2000, 2500);
129 I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY); 130 I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY);
130 usleep_range(2000, 2500); 131 usleep_range(2500, 3000);
131} 132}
132 133
133static void intel_dsi_enable(struct intel_encoder *encoder) 134static void intel_dsi_enable(struct intel_encoder *encoder)
@@ -271,23 +272,23 @@ static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)
271 272
272 DRM_DEBUG_KMS("\n"); 273 DRM_DEBUG_KMS("\n");
273 274
274 I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_ENTER); 275 I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_ENTER);
275 usleep_range(2000, 2500); 276 usleep_range(2000, 2500);
276 277
277 I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_EXIT); 278 I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_EXIT);
278 usleep_range(2000, 2500); 279 usleep_range(2000, 2500);
279 280
280 I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_ENTER); 281 I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_ENTER);
281 usleep_range(2000, 2500); 282 usleep_range(2000, 2500);
282 283
283 val = I915_READ(MIPI_PORT_CTRL(pipe));
284 I915_WRITE(MIPI_PORT_CTRL(pipe), val & ~LP_OUTPUT_HOLD);
285 usleep_range(1000, 1500);
286
287 if (wait_for(((I915_READ(MIPI_PORT_CTRL(pipe)) & AFE_LATCHOUT) 284 if (wait_for(((I915_READ(MIPI_PORT_CTRL(pipe)) & AFE_LATCHOUT)
288 == 0x00000), 30)) 285 == 0x00000), 30))
289 DRM_ERROR("DSI LP not going Low\n"); 286 DRM_ERROR("DSI LP not going Low\n");
290 287
288 val = I915_READ(MIPI_PORT_CTRL(pipe));
289 I915_WRITE(MIPI_PORT_CTRL(pipe), val & ~LP_OUTPUT_HOLD);
290 usleep_range(1000, 1500);
291
291 I915_WRITE(MIPI_DEVICE_READY(pipe), 0x00); 292 I915_WRITE(MIPI_DEVICE_READY(pipe), 0x00);
292 usleep_range(2000, 2500); 293 usleep_range(2000, 2500);
293 294
diff --git a/drivers/gpu/drm/i915/intel_dsi_cmd.c b/drivers/gpu/drm/i915/intel_dsi_cmd.c
index 3eeb21b9fddf..933c86305237 100644
--- a/drivers/gpu/drm/i915/intel_dsi_cmd.c
+++ b/drivers/gpu/drm/i915/intel_dsi_cmd.c
@@ -404,12 +404,6 @@ int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs)
404 else 404 else
405 cmd |= DPI_LP_MODE; 405 cmd |= DPI_LP_MODE;
406 406
407 /* DPI virtual channel?! */
408
409 mask = DPI_FIFO_EMPTY;
410 if (wait_for((I915_READ(MIPI_GEN_FIFO_STAT(pipe)) & mask) == mask, 50))
411 DRM_ERROR("Timeout waiting for DPI FIFO empty.\n");
412
413 /* clear bit */ 407 /* clear bit */
414 I915_WRITE(MIPI_INTR_STAT(pipe), SPL_PKT_SENT_INTERRUPT); 408 I915_WRITE(MIPI_INTR_STAT(pipe), SPL_PKT_SENT_INTERRUPT);
415 409
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 2e2c71fcc9ed..4f6b53998d79 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -403,6 +403,15 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
403 403
404 DRM_DEBUG_DRIVER("bclp = 0x%08x\n", bclp); 404 DRM_DEBUG_DRIVER("bclp = 0x%08x\n", bclp);
405 405
406 /*
407 * If the acpi_video interface is not supposed to be used, don't
408 * bother processing backlight level change requests from firmware.
409 */
410 if (!acpi_video_verify_backlight_support()) {
411 DRM_DEBUG_KMS("opregion backlight request ignored\n");
412 return 0;
413 }
414
406 if (!(bclp & ASLE_BCLP_VALID)) 415 if (!(bclp & ASLE_BCLP_VALID))
407 return ASLC_BACKLIGHT_FAILED; 416 return ASLC_BACKLIGHT_FAILED;
408 417
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 5e6c888b4928..628cd8938274 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -798,9 +798,6 @@ static void i965_enable_backlight(struct intel_connector *connector)
798 ctl = freq << 16; 798 ctl = freq << 16;
799 I915_WRITE(BLC_PWM_CTL, ctl); 799 I915_WRITE(BLC_PWM_CTL, ctl);
800 800
801 /* XXX: combine this into above write? */
802 intel_panel_actually_set_backlight(connector, panel->backlight.level);
803
804 ctl2 = BLM_PIPE(pipe); 801 ctl2 = BLM_PIPE(pipe);
805 if (panel->backlight.combination_mode) 802 if (panel->backlight.combination_mode)
806 ctl2 |= BLM_COMBINATION_MODE; 803 ctl2 |= BLM_COMBINATION_MODE;
@@ -809,6 +806,8 @@ static void i965_enable_backlight(struct intel_connector *connector)
809 I915_WRITE(BLC_PWM_CTL2, ctl2); 806 I915_WRITE(BLC_PWM_CTL2, ctl2);
810 POSTING_READ(BLC_PWM_CTL2); 807 POSTING_READ(BLC_PWM_CTL2);
811 I915_WRITE(BLC_PWM_CTL2, ctl2 | BLM_PWM_ENABLE); 808 I915_WRITE(BLC_PWM_CTL2, ctl2 | BLM_PWM_ENABLE);
809
810 intel_panel_actually_set_backlight(connector, panel->backlight.level);
812} 811}
813 812
814static void vlv_enable_backlight(struct intel_connector *connector) 813static void vlv_enable_backlight(struct intel_connector *connector)
@@ -1119,8 +1118,12 @@ int intel_panel_setup_backlight(struct drm_connector *connector)
1119 int ret; 1118 int ret;
1120 1119
1121 if (!dev_priv->vbt.backlight.present) { 1120 if (!dev_priv->vbt.backlight.present) {
1122 DRM_DEBUG_KMS("native backlight control not available per VBT\n"); 1121 if (dev_priv->quirks & QUIRK_BACKLIGHT_PRESENT) {
1123 return 0; 1122 DRM_DEBUG_KMS("no backlight present per VBT, but present per quirk\n");
1123 } else {
1124 DRM_DEBUG_KMS("no backlight present per VBT\n");
1125 return 0;
1126 }
1124 } 1127 }
1125 1128
1126 /* set level and max in panel struct */ 1129 /* set level and max in panel struct */
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index d1e53abec1b5..ee72807069e4 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -511,8 +511,7 @@ void intel_update_fbc(struct drm_device *dev)
511 obj = intel_fb->obj; 511 obj = intel_fb->obj;
512 adjusted_mode = &intel_crtc->config.adjusted_mode; 512 adjusted_mode = &intel_crtc->config.adjusted_mode;
513 513
514 if (i915.enable_fbc < 0 && 514 if (i915.enable_fbc < 0) {
515 INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev)) {
516 if (set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT)) 515 if (set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT))
517 DRM_DEBUG_KMS("disabled per chip default\n"); 516 DRM_DEBUG_KMS("disabled per chip default\n");
518 goto out_disable; 517 goto out_disable;
@@ -3210,6 +3209,14 @@ void gen6_set_rps(struct drm_device *dev, u8 val)
3210*/ 3209*/
3211static void vlv_set_rps_idle(struct drm_i915_private *dev_priv) 3210static void vlv_set_rps_idle(struct drm_i915_private *dev_priv)
3212{ 3211{
3212 struct drm_device *dev = dev_priv->dev;
3213
3214 /* Latest VLV doesn't need to force the gfx clock */
3215 if (dev->pdev->revision >= 0xd) {
3216 valleyview_set_rps(dev_priv->dev, dev_priv->rps.min_freq_softlimit);
3217 return;
3218 }
3219
3213 /* 3220 /*
3214 * When we are idle. Drop to min voltage state. 3221 * When we are idle. Drop to min voltage state.
3215 */ 3222 */
@@ -3506,15 +3513,11 @@ static void gen8_enable_rps(struct drm_device *dev)
3506 3513
3507 I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10); 3514 I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10);
3508 3515
3509 /* WaDisablePwrmtrEvent:chv (pre-production hw) */
3510 I915_WRITE(0xA80C, I915_READ(0xA80C) & 0x00ffffff);
3511 I915_WRITE(0xA810, I915_READ(0xA810) & 0xffffff00);
3512
3513 /* 5: Enable RPS */ 3516 /* 5: Enable RPS */
3514 I915_WRITE(GEN6_RP_CONTROL, 3517 I915_WRITE(GEN6_RP_CONTROL,
3515 GEN6_RP_MEDIA_TURBO | 3518 GEN6_RP_MEDIA_TURBO |
3516 GEN6_RP_MEDIA_HW_NORMAL_MODE | 3519 GEN6_RP_MEDIA_HW_NORMAL_MODE |
3517 GEN6_RP_MEDIA_IS_GFX | /* WaSetMaskForGfxBusyness:chv (pre-production hw ?) */ 3520 GEN6_RP_MEDIA_IS_GFX |
3518 GEN6_RP_ENABLE | 3521 GEN6_RP_ENABLE |
3519 GEN6_RP_UP_BUSY_AVG | 3522 GEN6_RP_UP_BUSY_AVG |
3520 GEN6_RP_DOWN_IDLE_AVG); 3523 GEN6_RP_DOWN_IDLE_AVG);
@@ -5608,8 +5611,8 @@ static bool hsw_power_well_enabled(struct drm_i915_private *dev_priv,
5608 (HSW_PWR_WELL_ENABLE_REQUEST | HSW_PWR_WELL_STATE_ENABLED); 5611 (HSW_PWR_WELL_ENABLE_REQUEST | HSW_PWR_WELL_STATE_ENABLED);
5609} 5612}
5610 5613
5611bool intel_display_power_enabled_sw(struct drm_i915_private *dev_priv, 5614bool intel_display_power_enabled_unlocked(struct drm_i915_private *dev_priv,
5612 enum intel_display_power_domain domain) 5615 enum intel_display_power_domain domain)
5613{ 5616{
5614 struct i915_power_domains *power_domains; 5617 struct i915_power_domains *power_domains;
5615 struct i915_power_well *power_well; 5618 struct i915_power_well *power_well;
@@ -5620,16 +5623,19 @@ bool intel_display_power_enabled_sw(struct drm_i915_private *dev_priv,
5620 return false; 5623 return false;
5621 5624
5622 power_domains = &dev_priv->power_domains; 5625 power_domains = &dev_priv->power_domains;
5626
5623 is_enabled = true; 5627 is_enabled = true;
5628
5624 for_each_power_well_rev(i, power_well, BIT(domain), power_domains) { 5629 for_each_power_well_rev(i, power_well, BIT(domain), power_domains) {
5625 if (power_well->always_on) 5630 if (power_well->always_on)
5626 continue; 5631 continue;
5627 5632
5628 if (!power_well->count) { 5633 if (!power_well->hw_enabled) {
5629 is_enabled = false; 5634 is_enabled = false;
5630 break; 5635 break;
5631 } 5636 }
5632 } 5637 }
5638
5633 return is_enabled; 5639 return is_enabled;
5634} 5640}
5635 5641
@@ -5637,30 +5643,15 @@ bool intel_display_power_enabled(struct drm_i915_private *dev_priv,
5637 enum intel_display_power_domain domain) 5643 enum intel_display_power_domain domain)
5638{ 5644{
5639 struct i915_power_domains *power_domains; 5645 struct i915_power_domains *power_domains;
5640 struct i915_power_well *power_well; 5646 bool ret;
5641 bool is_enabled;
5642 int i;
5643
5644 if (dev_priv->pm.suspended)
5645 return false;
5646 5647
5647 power_domains = &dev_priv->power_domains; 5648 power_domains = &dev_priv->power_domains;
5648 5649
5649 is_enabled = true;
5650
5651 mutex_lock(&power_domains->lock); 5650 mutex_lock(&power_domains->lock);
5652 for_each_power_well_rev(i, power_well, BIT(domain), power_domains) { 5651 ret = intel_display_power_enabled_unlocked(dev_priv, domain);
5653 if (power_well->always_on)
5654 continue;
5655
5656 if (!power_well->ops->is_enabled(dev_priv, power_well)) {
5657 is_enabled = false;
5658 break;
5659 }
5660 }
5661 mutex_unlock(&power_domains->lock); 5652 mutex_unlock(&power_domains->lock);
5662 5653
5663 return is_enabled; 5654 return ret;
5664} 5655}
5665 5656
5666/* 5657/*
@@ -5981,6 +5972,7 @@ void intel_display_power_get(struct drm_i915_private *dev_priv,
5981 if (!power_well->count++) { 5972 if (!power_well->count++) {
5982 DRM_DEBUG_KMS("enabling %s\n", power_well->name); 5973 DRM_DEBUG_KMS("enabling %s\n", power_well->name);
5983 power_well->ops->enable(dev_priv, power_well); 5974 power_well->ops->enable(dev_priv, power_well);
5975 power_well->hw_enabled = true;
5984 } 5976 }
5985 5977
5986 check_power_well_state(dev_priv, power_well); 5978 check_power_well_state(dev_priv, power_well);
@@ -6010,6 +6002,7 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
6010 6002
6011 if (!--power_well->count && i915.disable_power_well) { 6003 if (!--power_well->count && i915.disable_power_well) {
6012 DRM_DEBUG_KMS("disabling %s\n", power_well->name); 6004 DRM_DEBUG_KMS("disabling %s\n", power_well->name);
6005 power_well->hw_enabled = false;
6013 power_well->ops->disable(dev_priv, power_well); 6006 power_well->ops->disable(dev_priv, power_well);
6014 } 6007 }
6015 6008
@@ -6024,33 +6017,56 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
6024static struct i915_power_domains *hsw_pwr; 6017static struct i915_power_domains *hsw_pwr;
6025 6018
6026/* Display audio driver power well request */ 6019/* Display audio driver power well request */
6027void i915_request_power_well(void) 6020int i915_request_power_well(void)
6028{ 6021{
6029 struct drm_i915_private *dev_priv; 6022 struct drm_i915_private *dev_priv;
6030 6023
6031 if (WARN_ON(!hsw_pwr)) 6024 if (!hsw_pwr)
6032 return; 6025 return -ENODEV;
6033 6026
6034 dev_priv = container_of(hsw_pwr, struct drm_i915_private, 6027 dev_priv = container_of(hsw_pwr, struct drm_i915_private,
6035 power_domains); 6028 power_domains);
6036 intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO); 6029 intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO);
6030 return 0;
6037} 6031}
6038EXPORT_SYMBOL_GPL(i915_request_power_well); 6032EXPORT_SYMBOL_GPL(i915_request_power_well);
6039 6033
6040/* Display audio driver power well release */ 6034/* Display audio driver power well release */
6041void i915_release_power_well(void) 6035int i915_release_power_well(void)
6042{ 6036{
6043 struct drm_i915_private *dev_priv; 6037 struct drm_i915_private *dev_priv;
6044 6038
6045 if (WARN_ON(!hsw_pwr)) 6039 if (!hsw_pwr)
6046 return; 6040 return -ENODEV;
6047 6041
6048 dev_priv = container_of(hsw_pwr, struct drm_i915_private, 6042 dev_priv = container_of(hsw_pwr, struct drm_i915_private,
6049 power_domains); 6043 power_domains);
6050 intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO); 6044 intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO);
6045 return 0;
6051} 6046}
6052EXPORT_SYMBOL_GPL(i915_release_power_well); 6047EXPORT_SYMBOL_GPL(i915_release_power_well);
6053 6048
6049/*
6050 * Private interface for the audio driver to get CDCLK in kHz.
6051 *
6052 * Caller must request power well using i915_request_power_well() prior to
6053 * making the call.
6054 */
6055int i915_get_cdclk_freq(void)
6056{
6057 struct drm_i915_private *dev_priv;
6058
6059 if (!hsw_pwr)
6060 return -ENODEV;
6061
6062 dev_priv = container_of(hsw_pwr, struct drm_i915_private,
6063 power_domains);
6064
6065 return intel_ddi_get_cdclk_freq(dev_priv);
6066}
6067EXPORT_SYMBOL_GPL(i915_get_cdclk_freq);
6068
6069
6054#define POWER_DOMAIN_MASK (BIT(POWER_DOMAIN_NUM) - 1) 6070#define POWER_DOMAIN_MASK (BIT(POWER_DOMAIN_NUM) - 1)
6055 6071
6056#define HSW_ALWAYS_ON_POWER_DOMAINS ( \ 6072#define HSW_ALWAYS_ON_POWER_DOMAINS ( \
@@ -6270,8 +6286,11 @@ static void intel_power_domains_resume(struct drm_i915_private *dev_priv)
6270 int i; 6286 int i;
6271 6287
6272 mutex_lock(&power_domains->lock); 6288 mutex_lock(&power_domains->lock);
6273 for_each_power_well(i, power_well, POWER_DOMAIN_MASK, power_domains) 6289 for_each_power_well(i, power_well, POWER_DOMAIN_MASK, power_domains) {
6274 power_well->ops->sync_hw(dev_priv, power_well); 6290 power_well->ops->sync_hw(dev_priv, power_well);
6291 power_well->hw_enabled = power_well->ops->is_enabled(dev_priv,
6292 power_well);
6293 }
6275 mutex_unlock(&power_domains->lock); 6294 mutex_unlock(&power_domains->lock);
6276} 6295}
6277 6296
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 910c83cf7d44..e72017bdcd7f 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -55,7 +55,7 @@ struct intel_ring_hangcheck {
55 u32 seqno; 55 u32 seqno;
56 int score; 56 int score;
57 enum intel_ring_hangcheck_action action; 57 enum intel_ring_hangcheck_action action;
58 bool deadlock; 58 int deadlock;
59}; 59};
60 60
61struct intel_ringbuffer { 61struct intel_ringbuffer {
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 6a4d5bc17697..20375cc7f82d 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1385,7 +1385,9 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,
1385 >> SDVO_PORT_MULTIPLY_SHIFT) + 1; 1385 >> SDVO_PORT_MULTIPLY_SHIFT) + 1;
1386 } 1386 }
1387 1387
1388 dotclock = pipe_config->port_clock / pipe_config->pixel_multiplier; 1388 dotclock = pipe_config->port_clock;
1389 if (pipe_config->pixel_multiplier)
1390 dotclock /= pipe_config->pixel_multiplier;
1389 1391
1390 if (HAS_PCH_SPLIT(dev)) 1392 if (HAS_PCH_SPLIT(dev))
1391 ironlake_check_encoder_dotclock(pipe_config, dotclock); 1393 ironlake_check_encoder_dotclock(pipe_config, dotclock);
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 1b66ddcdfb33..9a17b4e92ef4 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -691,6 +691,14 @@ intel_post_enable_primary(struct drm_crtc *crtc)
691 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 691 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
692 692
693 /* 693 /*
694 * BDW signals flip done immediately if the plane
695 * is disabled, even if the plane enable is already
696 * armed to occur at the next vblank :(
697 */
698 if (IS_BROADWELL(dev))
699 intel_wait_for_vblank(dev, intel_crtc->pipe);
700
701 /*
694 * FIXME IPS should be fine as long as one plane is 702 * FIXME IPS should be fine as long as one plane is
695 * enabled, but in practice it seems to have problems 703 * enabled, but in practice it seems to have problems
696 * when going from primary only to sprite only and vice 704 * when going from primary only to sprite only and vice
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 79cba593df0d..4f6fef7ac069 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -320,7 +320,8 @@ static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)
320 struct drm_i915_private *dev_priv = dev->dev_private; 320 struct drm_i915_private *dev_priv = dev->dev_private;
321 unsigned long irqflags; 321 unsigned long irqflags;
322 322
323 del_timer_sync(&dev_priv->uncore.force_wake_timer); 323 if (del_timer_sync(&dev_priv->uncore.force_wake_timer))
324 gen6_force_wake_timer((unsigned long)dev_priv);
324 325
325 /* Hold uncore.lock across reset to prevent any register access 326 /* Hold uncore.lock across reset to prevent any register access
326 * with forcewake not set correctly 327 * with forcewake not set correctly
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index ae750f6928c1..7f7aadef8a82 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -277,6 +277,7 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
277 static const char *hpd_reg_names[] = {"hpd-gdsc", "hpd-5v"}; 277 static const char *hpd_reg_names[] = {"hpd-gdsc", "hpd-5v"};
278 static const char *pwr_reg_names[] = {"core-vdda", "core-vcc"}; 278 static const char *pwr_reg_names[] = {"core-vdda", "core-vcc"};
279 static const char *hpd_clk_names[] = {"iface_clk", "core_clk", "mdp_core_clk"}; 279 static const char *hpd_clk_names[] = {"iface_clk", "core_clk", "mdp_core_clk"};
280 static unsigned long hpd_clk_freq[] = {0, 19200000, 0};
280 static const char *pwr_clk_names[] = {"extp_clk", "alt_iface_clk"}; 281 static const char *pwr_clk_names[] = {"extp_clk", "alt_iface_clk"};
281 282
282 config.phy_init = hdmi_phy_8x74_init; 283 config.phy_init = hdmi_phy_8x74_init;
@@ -286,6 +287,7 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
286 config.pwr_reg_names = pwr_reg_names; 287 config.pwr_reg_names = pwr_reg_names;
287 config.pwr_reg_cnt = ARRAY_SIZE(pwr_reg_names); 288 config.pwr_reg_cnt = ARRAY_SIZE(pwr_reg_names);
288 config.hpd_clk_names = hpd_clk_names; 289 config.hpd_clk_names = hpd_clk_names;
290 config.hpd_freq = hpd_clk_freq;
289 config.hpd_clk_cnt = ARRAY_SIZE(hpd_clk_names); 291 config.hpd_clk_cnt = ARRAY_SIZE(hpd_clk_names);
290 config.pwr_clk_names = pwr_clk_names; 292 config.pwr_clk_names = pwr_clk_names;
291 config.pwr_clk_cnt = ARRAY_SIZE(pwr_clk_names); 293 config.pwr_clk_cnt = ARRAY_SIZE(pwr_clk_names);
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.h b/drivers/gpu/drm/msm/hdmi/hdmi.h
index 9fafee6a3e43..9d7723c6528a 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.h
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.h
@@ -87,6 +87,7 @@ struct hdmi_platform_config {
87 87
88 /* clks that need to be on for hpd: */ 88 /* clks that need to be on for hpd: */
89 const char **hpd_clk_names; 89 const char **hpd_clk_names;
90 const long unsigned *hpd_freq;
90 int hpd_clk_cnt; 91 int hpd_clk_cnt;
91 92
92 /* clks that need to be on for screen pwr (ie pixel clk): */ 93 /* clks that need to be on for screen pwr (ie pixel clk): */
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
index e56a6196867c..28f7e3ec6c28 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
@@ -127,6 +127,14 @@ static int hpd_enable(struct hdmi_connector *hdmi_connector)
127 } 127 }
128 128
129 for (i = 0; i < config->hpd_clk_cnt; i++) { 129 for (i = 0; i < config->hpd_clk_cnt; i++) {
130 if (config->hpd_freq && config->hpd_freq[i]) {
131 ret = clk_set_rate(hdmi->hpd_clks[i],
132 config->hpd_freq[i]);
133 if (ret)
134 dev_warn(dev->dev, "failed to set clk %s (%d)\n",
135 config->hpd_clk_names[i], ret);
136 }
137
130 ret = clk_prepare_enable(hdmi->hpd_clks[i]); 138 ret = clk_prepare_enable(hdmi->hpd_clks[i]);
131 if (ret) { 139 if (ret) {
132 dev_err(dev->dev, "failed to enable hpd clk: %s (%d)\n", 140 dev_err(dev->dev, "failed to enable hpd clk: %s (%d)\n",
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
index 42caf7fcb0b9..71510ee26e96 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
@@ -20,6 +20,10 @@
20#include "msm_mmu.h" 20#include "msm_mmu.h"
21#include "mdp5_kms.h" 21#include "mdp5_kms.h"
22 22
23static const char *iommu_ports[] = {
24 "mdp_0",
25};
26
23static struct mdp5_platform_config *mdp5_get_config(struct platform_device *dev); 27static struct mdp5_platform_config *mdp5_get_config(struct platform_device *dev);
24 28
25static int mdp5_hw_init(struct msm_kms *kms) 29static int mdp5_hw_init(struct msm_kms *kms)
@@ -104,6 +108,12 @@ static void mdp5_preclose(struct msm_kms *kms, struct drm_file *file)
104static void mdp5_destroy(struct msm_kms *kms) 108static void mdp5_destroy(struct msm_kms *kms)
105{ 109{
106 struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms)); 110 struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms));
111 struct msm_mmu *mmu = mdp5_kms->mmu;
112
113 if (mmu) {
114 mmu->funcs->detach(mmu, iommu_ports, ARRAY_SIZE(iommu_ports));
115 mmu->funcs->destroy(mmu);
116 }
107 kfree(mdp5_kms); 117 kfree(mdp5_kms);
108} 118}
109 119
@@ -216,10 +226,6 @@ fail:
216 return ret; 226 return ret;
217} 227}
218 228
219static const char *iommu_ports[] = {
220 "mdp_0",
221};
222
223static int get_clk(struct platform_device *pdev, struct clk **clkp, 229static int get_clk(struct platform_device *pdev, struct clk **clkp,
224 const char *name) 230 const char *name)
225{ 231{
@@ -317,17 +323,23 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
317 mmu = msm_iommu_new(dev, config->iommu); 323 mmu = msm_iommu_new(dev, config->iommu);
318 if (IS_ERR(mmu)) { 324 if (IS_ERR(mmu)) {
319 ret = PTR_ERR(mmu); 325 ret = PTR_ERR(mmu);
326 dev_err(dev->dev, "failed to init iommu: %d\n", ret);
320 goto fail; 327 goto fail;
321 } 328 }
329
322 ret = mmu->funcs->attach(mmu, iommu_ports, 330 ret = mmu->funcs->attach(mmu, iommu_ports,
323 ARRAY_SIZE(iommu_ports)); 331 ARRAY_SIZE(iommu_ports));
324 if (ret) 332 if (ret) {
333 dev_err(dev->dev, "failed to attach iommu: %d\n", ret);
334 mmu->funcs->destroy(mmu);
325 goto fail; 335 goto fail;
336 }
326 } else { 337 } else {
327 dev_info(dev->dev, "no iommu, fallback to phys " 338 dev_info(dev->dev, "no iommu, fallback to phys "
328 "contig buffers for scanout\n"); 339 "contig buffers for scanout\n");
329 mmu = NULL; 340 mmu = NULL;
330 } 341 }
342 mdp5_kms->mmu = mmu;
331 343
332 mdp5_kms->id = msm_register_mmu(dev, mmu); 344 mdp5_kms->id = msm_register_mmu(dev, mmu);
333 if (mdp5_kms->id < 0) { 345 if (mdp5_kms->id < 0) {
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h
index c8b1a2522c25..6e981b692d1d 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h
@@ -33,6 +33,7 @@ struct mdp5_kms {
33 33
34 /* mapper-id used to request GEM buffer mapped for scanout: */ 34 /* mapper-id used to request GEM buffer mapped for scanout: */
35 int id; 35 int id;
36 struct msm_mmu *mmu;
36 37
37 /* for tracking smp allocation amongst pipes: */ 38 /* for tracking smp allocation amongst pipes: */
38 mdp5_smp_state_t smp_state; 39 mdp5_smp_state_t smp_state;
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 0d2562fb681e..9a5d87db5c23 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -159,7 +159,7 @@ static int msm_unload(struct drm_device *dev)
159static int get_mdp_ver(struct platform_device *pdev) 159static int get_mdp_ver(struct platform_device *pdev)
160{ 160{
161#ifdef CONFIG_OF 161#ifdef CONFIG_OF
162 const static struct of_device_id match_types[] = { { 162 static const struct of_device_id match_types[] = { {
163 .compatible = "qcom,mdss_mdp", 163 .compatible = "qcom,mdss_mdp",
164 .data = (void *)5, 164 .data = (void *)5,
165 }, { 165 }, {
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index a752ab83b810..5107fc4826bc 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -59,7 +59,7 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
59 struct drm_framebuffer *fb = NULL; 59 struct drm_framebuffer *fb = NULL;
60 struct fb_info *fbi = NULL; 60 struct fb_info *fbi = NULL;
61 struct drm_mode_fb_cmd2 mode_cmd = {0}; 61 struct drm_mode_fb_cmd2 mode_cmd = {0};
62 dma_addr_t paddr; 62 uint32_t paddr;
63 int ret, size; 63 int ret, size;
64 64
65 sizes->surface_bpp = 32; 65 sizes->surface_bpp = 32;
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index bb8026daebc9..690d7e7b6d1e 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -278,6 +278,7 @@ int msm_gem_get_iova_locked(struct drm_gem_object *obj, int id,
278 uint32_t *iova) 278 uint32_t *iova)
279{ 279{
280 struct msm_gem_object *msm_obj = to_msm_bo(obj); 280 struct msm_gem_object *msm_obj = to_msm_bo(obj);
281 struct drm_device *dev = obj->dev;
281 int ret = 0; 282 int ret = 0;
282 283
283 if (!msm_obj->domain[id].iova) { 284 if (!msm_obj->domain[id].iova) {
@@ -285,6 +286,11 @@ int msm_gem_get_iova_locked(struct drm_gem_object *obj, int id,
285 struct msm_mmu *mmu = priv->mmus[id]; 286 struct msm_mmu *mmu = priv->mmus[id];
286 struct page **pages = get_pages(obj); 287 struct page **pages = get_pages(obj);
287 288
289 if (!mmu) {
290 dev_err(dev->dev, "null MMU pointer\n");
291 return -EINVAL;
292 }
293
288 if (IS_ERR(pages)) 294 if (IS_ERR(pages))
289 return PTR_ERR(pages); 295 return PTR_ERR(pages);
290 296
diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c
index 92b745986231..4b2ad9181edf 100644
--- a/drivers/gpu/drm/msm/msm_iommu.c
+++ b/drivers/gpu/drm/msm/msm_iommu.c
@@ -28,7 +28,7 @@ static int msm_fault_handler(struct iommu_domain *iommu, struct device *dev,
28 unsigned long iova, int flags, void *arg) 28 unsigned long iova, int flags, void *arg)
29{ 29{
30 DBG("*** fault: iova=%08lx, flags=%d", iova, flags); 30 DBG("*** fault: iova=%08lx, flags=%d", iova, flags);
31 return 0; 31 return -ENOSYS;
32} 32}
33 33
34static int msm_iommu_attach(struct msm_mmu *mmu, const char **names, int cnt) 34static int msm_iommu_attach(struct msm_mmu *mmu, const char **names, int cnt)
@@ -40,8 +40,10 @@ static int msm_iommu_attach(struct msm_mmu *mmu, const char **names, int cnt)
40 for (i = 0; i < cnt; i++) { 40 for (i = 0; i < cnt; i++) {
41 struct device *msm_iommu_get_ctx(const char *ctx_name); 41 struct device *msm_iommu_get_ctx(const char *ctx_name);
42 struct device *ctx = msm_iommu_get_ctx(names[i]); 42 struct device *ctx = msm_iommu_get_ctx(names[i]);
43 if (IS_ERR_OR_NULL(ctx)) 43 if (IS_ERR_OR_NULL(ctx)) {
44 dev_warn(dev->dev, "couldn't get %s context", names[i]);
44 continue; 45 continue;
46 }
45 ret = iommu_attach_device(iommu->domain, ctx); 47 ret = iommu_attach_device(iommu->domain, ctx);
46 if (ret) { 48 if (ret) {
47 dev_warn(dev->dev, "could not attach iommu to %s", names[i]); 49 dev_warn(dev->dev, "could not attach iommu to %s", names[i]);
@@ -52,6 +54,20 @@ static int msm_iommu_attach(struct msm_mmu *mmu, const char **names, int cnt)
52 return 0; 54 return 0;
53} 55}
54 56
57static void msm_iommu_detach(struct msm_mmu *mmu, const char **names, int cnt)
58{
59 struct msm_iommu *iommu = to_msm_iommu(mmu);
60 int i;
61
62 for (i = 0; i < cnt; i++) {
63 struct device *msm_iommu_get_ctx(const char *ctx_name);
64 struct device *ctx = msm_iommu_get_ctx(names[i]);
65 if (IS_ERR_OR_NULL(ctx))
66 continue;
67 iommu_detach_device(iommu->domain, ctx);
68 }
69}
70
55static int msm_iommu_map(struct msm_mmu *mmu, uint32_t iova, 71static int msm_iommu_map(struct msm_mmu *mmu, uint32_t iova,
56 struct sg_table *sgt, unsigned len, int prot) 72 struct sg_table *sgt, unsigned len, int prot)
57{ 73{
@@ -110,7 +126,7 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint32_t iova,
110 126
111 VERB("unmap[%d]: %08x(%x)", i, iova, bytes); 127 VERB("unmap[%d]: %08x(%x)", i, iova, bytes);
112 128
113 BUG_ON(!IS_ALIGNED(bytes, PAGE_SIZE)); 129 BUG_ON(!PAGE_ALIGNED(bytes));
114 130
115 da += bytes; 131 da += bytes;
116 } 132 }
@@ -127,6 +143,7 @@ static void msm_iommu_destroy(struct msm_mmu *mmu)
127 143
128static const struct msm_mmu_funcs funcs = { 144static const struct msm_mmu_funcs funcs = {
129 .attach = msm_iommu_attach, 145 .attach = msm_iommu_attach,
146 .detach = msm_iommu_detach,
130 .map = msm_iommu_map, 147 .map = msm_iommu_map,
131 .unmap = msm_iommu_unmap, 148 .unmap = msm_iommu_unmap,
132 .destroy = msm_iommu_destroy, 149 .destroy = msm_iommu_destroy,
diff --git a/drivers/gpu/drm/msm/msm_mmu.h b/drivers/gpu/drm/msm/msm_mmu.h
index 030324482b4a..21da6d154f71 100644
--- a/drivers/gpu/drm/msm/msm_mmu.h
+++ b/drivers/gpu/drm/msm/msm_mmu.h
@@ -22,6 +22,7 @@
22 22
23struct msm_mmu_funcs { 23struct msm_mmu_funcs {
24 int (*attach)(struct msm_mmu *mmu, const char **names, int cnt); 24 int (*attach)(struct msm_mmu *mmu, const char **names, int cnt);
25 void (*detach)(struct msm_mmu *mmu, const char **names, int cnt);
25 int (*map)(struct msm_mmu *mmu, uint32_t iova, struct sg_table *sgt, 26 int (*map)(struct msm_mmu *mmu, uint32_t iova, struct sg_table *sgt,
26 unsigned len, int prot); 27 unsigned len, int prot);
27 int (*unmap)(struct msm_mmu *mmu, uint32_t iova, struct sg_table *sgt, 28 int (*unmap)(struct msm_mmu *mmu, uint32_t iova, struct sg_table *sgt,
diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile
index 2b6156d0e4b5..8b307e143632 100644
--- a/drivers/gpu/drm/nouveau/Makefile
+++ b/drivers/gpu/drm/nouveau/Makefile
@@ -140,6 +140,7 @@ nouveau-y += core/subdev/i2c/nv4e.o
140nouveau-y += core/subdev/i2c/nv50.o 140nouveau-y += core/subdev/i2c/nv50.o
141nouveau-y += core/subdev/i2c/nv94.o 141nouveau-y += core/subdev/i2c/nv94.o
142nouveau-y += core/subdev/i2c/nvd0.o 142nouveau-y += core/subdev/i2c/nvd0.o
143nouveau-y += core/subdev/i2c/gf117.o
143nouveau-y += core/subdev/i2c/nve0.o 144nouveau-y += core/subdev/i2c/nve0.o
144nouveau-y += core/subdev/ibus/nvc0.o 145nouveau-y += core/subdev/ibus/nvc0.o
145nouveau-y += core/subdev/ibus/nve0.o 146nouveau-y += core/subdev/ibus/nve0.o
diff --git a/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
index f199957995fa..8d55ed633b19 100644
--- a/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
@@ -314,7 +314,7 @@ nvc0_identify(struct nouveau_device *device)
314 device->cname = "GF117"; 314 device->cname = "GF117";
315 device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass; 315 device->oclass[NVDEV_SUBDEV_VBIOS ] = &nouveau_bios_oclass;
316 device->oclass[NVDEV_SUBDEV_GPIO ] = nvd0_gpio_oclass; 316 device->oclass[NVDEV_SUBDEV_GPIO ] = nvd0_gpio_oclass;
317 device->oclass[NVDEV_SUBDEV_I2C ] = nvd0_i2c_oclass; 317 device->oclass[NVDEV_SUBDEV_I2C ] = gf117_i2c_oclass;
318 device->oclass[NVDEV_SUBDEV_CLOCK ] = &nvc0_clock_oclass; 318 device->oclass[NVDEV_SUBDEV_CLOCK ] = &nvc0_clock_oclass;
319 device->oclass[NVDEV_SUBDEV_THERM ] = &nvd0_therm_oclass; 319 device->oclass[NVDEV_SUBDEV_THERM ] = &nvd0_therm_oclass;
320 device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass; 320 device->oclass[NVDEV_SUBDEV_MXM ] = &nv50_mxm_oclass;
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/base.c b/drivers/gpu/drm/nouveau/core/engine/disp/base.c
index c41f656abe64..9c38c5e40500 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/base.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/base.c
@@ -99,8 +99,10 @@ _nouveau_disp_dtor(struct nouveau_object *object)
99 99
100 nouveau_event_destroy(&disp->vblank); 100 nouveau_event_destroy(&disp->vblank);
101 101
102 list_for_each_entry_safe(outp, outt, &disp->outp, head) { 102 if (disp->outp.next) {
103 nouveau_object_ref(NULL, (struct nouveau_object **)&outp); 103 list_for_each_entry_safe(outp, outt, &disp->outp, head) {
104 nouveau_object_ref(NULL, (struct nouveau_object **)&outp);
105 }
104 } 106 }
105 107
106 nouveau_engine_destroy(&disp->base); 108 nouveau_engine_destroy(&disp->base);
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dport.c b/drivers/gpu/drm/nouveau/core/engine/disp/dport.c
index 39562d48101d..5a5b59b21130 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/dport.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/dport.c
@@ -241,7 +241,9 @@ dp_link_train_eq(struct dp_state *dp)
241 dp_set_training_pattern(dp, 2); 241 dp_set_training_pattern(dp, 2);
242 242
243 do { 243 do {
244 if (dp_link_train_update(dp, dp->pc2, 400)) 244 if ((tries &&
245 dp_link_train_commit(dp, dp->pc2)) ||
246 dp_link_train_update(dp, dp->pc2, 400))
245 break; 247 break;
246 248
247 eq_done = !!(dp->stat[2] & DPCD_LS04_INTERLANE_ALIGN_DONE); 249 eq_done = !!(dp->stat[2] & DPCD_LS04_INTERLANE_ALIGN_DONE);
@@ -253,9 +255,6 @@ dp_link_train_eq(struct dp_state *dp)
253 !(lane & DPCD_LS02_LANE0_SYMBOL_LOCKED)) 255 !(lane & DPCD_LS02_LANE0_SYMBOL_LOCKED))
254 eq_done = false; 256 eq_done = false;
255 } 257 }
256
257 if (dp_link_train_commit(dp, dp->pc2))
258 break;
259 } while (!eq_done && cr_done && ++tries <= 5); 258 } while (!eq_done && cr_done && ++tries <= 5);
260 259
261 return eq_done ? 0 : -1; 260 return eq_done ? 0 : -1;
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
index 1e85f36c705f..2283c442a10d 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
@@ -1270,7 +1270,7 @@ exec_clkcmp(struct nv50_disp_priv *priv, int head, int id, u32 pclk, u32 *conf)
1270 i--; 1270 i--;
1271 1271
1272 outp = exec_lookup(priv, head, i, ctrl, &data, &ver, &hdr, &cnt, &len, &info1); 1272 outp = exec_lookup(priv, head, i, ctrl, &data, &ver, &hdr, &cnt, &len, &info1);
1273 if (!data) 1273 if (!outp)
1274 return NULL; 1274 return NULL;
1275 1275
1276 if (outp->info.location == 0) { 1276 if (outp->info.location == 0) {
@@ -1516,11 +1516,11 @@ nv50_disp_intr_unk20_2(struct nv50_disp_priv *priv, int head)
1516 } 1516 }
1517 1517
1518 switch ((ctrl & 0x000f0000) >> 16) { 1518 switch ((ctrl & 0x000f0000) >> 16) {
1519 case 6: datarate = pclk * 30 / 8; break; 1519 case 6: datarate = pclk * 30; break;
1520 case 5: datarate = pclk * 24 / 8; break; 1520 case 5: datarate = pclk * 24; break;
1521 case 2: 1521 case 2:
1522 default: 1522 default:
1523 datarate = pclk * 18 / 8; 1523 datarate = pclk * 18;
1524 break; 1524 break;
1525 } 1525 }
1526 1526
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
index 48aa38a87e3f..fa30d8196f35 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
@@ -1159,11 +1159,11 @@ nvd0_disp_intr_unk2_2(struct nv50_disp_priv *priv, int head)
1159 if (outp->info.type == DCB_OUTPUT_DP) { 1159 if (outp->info.type == DCB_OUTPUT_DP) {
1160 u32 sync = nv_rd32(priv, 0x660404 + (head * 0x300)); 1160 u32 sync = nv_rd32(priv, 0x660404 + (head * 0x300));
1161 switch ((sync & 0x000003c0) >> 6) { 1161 switch ((sync & 0x000003c0) >> 6) {
1162 case 6: pclk = pclk * 30 / 8; break; 1162 case 6: pclk = pclk * 30; break;
1163 case 5: pclk = pclk * 24 / 8; break; 1163 case 5: pclk = pclk * 24; break;
1164 case 2: 1164 case 2:
1165 default: 1165 default:
1166 pclk = pclk * 18 / 8; 1166 pclk = pclk * 18;
1167 break; 1167 break;
1168 } 1168 }
1169 1169
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c b/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c
index 52c299c3d300..eb2d7789555d 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/outpdp.c
@@ -34,7 +34,7 @@ nvkm_output_dp_train(struct nvkm_output *base, u32 datarate, bool wait)
34 struct nvkm_output_dp *outp = (void *)base; 34 struct nvkm_output_dp *outp = (void *)base;
35 bool retrain = true; 35 bool retrain = true;
36 u8 link[2], stat[3]; 36 u8 link[2], stat[3];
37 u32 rate; 37 u32 linkrate;
38 int ret, i; 38 int ret, i;
39 39
40 /* check that the link is trained at a high enough rate */ 40 /* check that the link is trained at a high enough rate */
@@ -44,8 +44,10 @@ nvkm_output_dp_train(struct nvkm_output *base, u32 datarate, bool wait)
44 goto done; 44 goto done;
45 } 45 }
46 46
47 rate = link[0] * 27000 * (link[1] & DPCD_LC01_LANE_COUNT_SET); 47 linkrate = link[0] * 27000 * (link[1] & DPCD_LC01_LANE_COUNT_SET);
48 if (rate < ((datarate / 8) * 10)) { 48 linkrate = (linkrate * 8) / 10; /* 8B/10B coding overhead */
49 datarate = (datarate + 9) / 10; /* -> decakilobits */
50 if (linkrate < datarate) {
49 DBG("link not trained at sufficient rate\n"); 51 DBG("link not trained at sufficient rate\n");
50 goto done; 52 goto done;
51 } 53 }
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c
index e1832778e8b6..7a1ebdfa9e1b 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/sornv50.c
@@ -87,6 +87,7 @@ nv50_sor_mthd(struct nouveau_object *object, u32 mthd, void *args, u32 size)
87 struct nvkm_output_dp *outpdp = (void *)outp; 87 struct nvkm_output_dp *outpdp = (void *)outp;
88 switch (data) { 88 switch (data) {
89 case NV94_DISP_SOR_DP_PWR_STATE_OFF: 89 case NV94_DISP_SOR_DP_PWR_STATE_OFF:
90 nouveau_event_put(outpdp->irq);
90 ((struct nvkm_output_dp_impl *)nv_oclass(outp)) 91 ((struct nvkm_output_dp_impl *)nv_oclass(outp))
91 ->lnk_pwr(outpdp, 0); 92 ->lnk_pwr(outpdp, 0);
92 atomic_set(&outpdp->lt.done, 0); 93 atomic_set(&outpdp->lt.done, 0);
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc
index 2f7345f7fe07..7445f12b1d9e 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/gpc.fuc
@@ -54,7 +54,7 @@ mmio_list_base:
54#ifdef INCLUDE_CODE 54#ifdef INCLUDE_CODE
55// reports an exception to the host 55// reports an exception to the host
56// 56//
57// In: $r15 error code (see nvc0.fuc) 57// In: $r15 error code (see os.h)
58// 58//
59error: 59error:
60 push $r14 60 push $r14
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hub.fuc b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hub.fuc
index c8ddb8d71b91..b4ad18bf5a26 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hub.fuc
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hub.fuc
@@ -49,7 +49,7 @@ hub_mmio_list_next:
49#ifdef INCLUDE_CODE 49#ifdef INCLUDE_CODE
50// reports an exception to the host 50// reports an exception to the host
51// 51//
52// In: $r15 error code (see nvc0.fuc) 52// In: $r15 error code (see os.h)
53// 53//
54error: 54error:
55 nv_iowr(NV_PGRAPH_FECS_CC_SCRATCH_VAL(5), 0, $r15) 55 nv_iowr(NV_PGRAPH_FECS_CC_SCRATCH_VAL(5), 0, $r15)
@@ -343,13 +343,25 @@ ih:
343 ih_no_ctxsw: 343 ih_no_ctxsw:
344 and $r11 $r10 NV_PGRAPH_FECS_INTR_FWMTHD 344 and $r11 $r10 NV_PGRAPH_FECS_INTR_FWMTHD
345 bra e #ih_no_fwmthd 345 bra e #ih_no_fwmthd
346 // none we handle, ack, and fall-through to unhandled 346 // none we handle; report to host and ack
347 nv_rd32($r15, NV_PGRAPH_TRAPPED_DATA_LO)
348 nv_iowr(NV_PGRAPH_FECS_CC_SCRATCH_VAL(4), 0, $r15)
349 nv_rd32($r15, NV_PGRAPH_TRAPPED_ADDR)
350 nv_iowr(NV_PGRAPH_FECS_CC_SCRATCH_VAL(3), 0, $r15)
351 extr $r14 $r15 16:18
352 shl b32 $r14 $r14 2
353 imm32($r15, NV_PGRAPH_FE_OBJECT_TABLE(0))
354 add b32 $r14 $r15
355 call(nv_rd32)
356 nv_iowr(NV_PGRAPH_FECS_CC_SCRATCH_VAL(2), 0, $r15)
357 mov $r15 E_BAD_FWMTHD
358 call(error)
347 mov $r11 0x100 359 mov $r11 0x100
348 nv_wr32(0x400144, $r11) 360 nv_wr32(0x400144, $r11)
349 361
350 // anything we didn't handle, bring it to the host's attention 362 // anything we didn't handle, bring it to the host's attention
351 ih_no_fwmthd: 363 ih_no_fwmthd:
352 mov $r11 0x104 // FIFO | CHSW 364 mov $r11 0x504 // FIFO | CHSW | FWMTHD
353 not b32 $r11 365 not b32 $r11
354 and $r11 $r10 $r11 366 and $r11 $r10 $r11
355 bra e #ih_no_other 367 bra e #ih_no_other
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubgm107.fuc5.h b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubgm107.fuc5.h
index 214dd16ec566..5f953c5c20b7 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubgm107.fuc5.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubgm107.fuc5.h
@@ -478,10 +478,10 @@ uint32_t gm107_grhub_code[] = {
478 0x01040080, 478 0x01040080,
479 0xbd0001f6, 479 0xbd0001f6,
480 0x01004104, 480 0x01004104,
481 0x627e020f, 481 0xa87e020f,
482 0x717e0006, 482 0xb77e0006,
483 0x100f0006, 483 0x100f0006,
484 0x0006b37e, 484 0x0006f97e,
485 0x98000e98, 485 0x98000e98,
486 0x207e010f, 486 0x207e010f,
487 0x14950001, 487 0x14950001,
@@ -523,8 +523,8 @@ uint32_t gm107_grhub_code[] = {
523 0x800040b7, 523 0x800040b7,
524 0xf40132b6, 524 0xf40132b6,
525 0x000fb41b, 525 0x000fb41b,
526 0x0006b37e, 526 0x0006f97e,
527 0x627e000f, 527 0xa87e000f,
528 0x00800006, 528 0x00800006,
529 0x01f60201, 529 0x01f60201,
530 0xbd04bd00, 530 0xbd04bd00,
@@ -554,7 +554,7 @@ uint32_t gm107_grhub_code[] = {
554 0x0009f602, 554 0x0009f602,
555 0x32f404bd, 555 0x32f404bd,
556 0x0231f401, 556 0x0231f401,
557 0x0008367e, 557 0x00087c7e,
558 0x99f094bd, 558 0x99f094bd,
559 0x17008007, 559 0x17008007,
560 0x0009f602, 560 0x0009f602,
@@ -563,7 +563,7 @@ uint32_t gm107_grhub_code[] = {
563 0x37008006, 563 0x37008006,
564 0x0009f602, 564 0x0009f602,
565 0x31f404bd, 565 0x31f404bd,
566 0x08367e01, 566 0x087c7e01,
567 0xf094bd00, 567 0xf094bd00,
568 0x00800699, 568 0x00800699,
569 0x09f60217, 569 0x09f60217,
@@ -572,7 +572,7 @@ uint32_t gm107_grhub_code[] = {
572 0x20f92f0e, 572 0x20f92f0e,
573 0x32f412b2, 573 0x32f412b2,
574 0x0232f401, 574 0x0232f401,
575 0x0008367e, 575 0x00087c7e,
576 0x008020fc, 576 0x008020fc,
577 0x02f602c0, 577 0x02f602c0,
578 0xf404bd00, 578 0xf404bd00,
@@ -580,7 +580,7 @@ uint32_t gm107_grhub_code[] = {
580 0x23c8130e, 580 0x23c8130e,
581 0x0d0bf41f, 581 0x0d0bf41f,
582 0xf40131f4, 582 0xf40131f4,
583 0x367e0232, 583 0x7c7e0232,
584/* 0x054e: chsw_done */ 584/* 0x054e: chsw_done */
585 0x01020008, 585 0x01020008,
586 0x02c30080, 586 0x02c30080,
@@ -593,7 +593,7 @@ uint32_t gm107_grhub_code[] = {
593 0xb0ff2a0e, 593 0xb0ff2a0e,
594 0x1bf401e4, 594 0x1bf401e4,
595 0x7ef2b20c, 595 0x7ef2b20c,
596 0xf40007d6, 596 0xf400081c,
597/* 0x057a: main_not_ctx_chan */ 597/* 0x057a: main_not_ctx_chan */
598 0xe4b0400e, 598 0xe4b0400e,
599 0x2c1bf402, 599 0x2c1bf402,
@@ -602,7 +602,7 @@ uint32_t gm107_grhub_code[] = {
602 0x0009f602, 602 0x0009f602,
603 0x32f404bd, 603 0x32f404bd,
604 0x0232f401, 604 0x0232f401,
605 0x0008367e, 605 0x00087c7e,
606 0x99f094bd, 606 0x99f094bd,
607 0x17008007, 607 0x17008007,
608 0x0009f602, 608 0x0009f602,
@@ -642,238 +642,238 @@ uint32_t gm107_grhub_code[] = {
642/* 0x061a: ih_no_ctxsw */ 642/* 0x061a: ih_no_ctxsw */
643 0xabe40000, 643 0xabe40000,
644 0x0bf40400, 644 0x0bf40400,
645 0x01004b10, 645 0x07088e56,
646 0x448ebfb2,
647 0x8f7e4001,
648/* 0x062e: ih_no_fwmthd */
649 0x044b0000,
650 0xffb0bd01,
651 0x0bf4b4ab,
652 0x0700800c,
653 0x000bf603,
654/* 0x0642: ih_no_other */
655 0x004004bd,
656 0x000af601,
657 0xf0fc04bd,
658 0xd0fce0fc,
659 0xa0fcb0fc,
660 0x80fc90fc,
661 0xfc0088fe,
662 0x0032f480,
663/* 0x0662: ctx_4170s */
664 0xf5f001f8,
665 0x8effb210,
666 0x7e404170,
667 0xf800008f,
668/* 0x0671: ctx_4170w */
669 0x41708e00,
670 0x00657e40, 646 0x00657e40,
671 0xf0ffb200, 647 0x80ffb200,
672 0x1bf410f4, 648 0xf6020400,
673/* 0x0683: ctx_redswitch */
674 0x4e00f8f3,
675 0xe5f00200,
676 0x20e5f040,
677 0x8010e5f0,
678 0xf6018500,
679 0x04bd000e,
680/* 0x069a: ctx_redswitch_delay */
681 0xf2b6080f,
682 0xfd1bf401,
683 0x0400e5f1,
684 0x0100e5f1,
685 0x01850080,
686 0xbd000ef6,
687/* 0x06b3: ctx_86c */
688 0x8000f804,
689 0xf6022300,
690 0x04bd000f, 649 0x04bd000f,
691 0x148effb2, 650 0x4007048e,
692 0x8f7e408a, 651 0x0000657e,
693 0xffb20000, 652 0x0080ffb2,
694 0x41a88c8e, 653 0x0ff60203,
654 0xc704bd00,
655 0xee9450fe,
656 0x07008f02,
657 0x00efbb40,
658 0x0000657e,
659 0x02020080,
660 0xbd000ff6,
661 0x7e030f04,
662 0x4b0002f8,
663 0xbfb20100,
664 0x4001448e,
695 0x00008f7e, 665 0x00008f7e,
696/* 0x06d2: ctx_mem */ 666/* 0x0674: ih_no_fwmthd */
697 0x008000f8, 667 0xbd05044b,
698 0x0ff60284, 668 0xb4abffb0,
699/* 0x06db: ctx_mem_wait */ 669 0x800c0bf4,
700 0x8f04bd00, 670 0xf6030700,
701 0xcf028400, 671 0x04bd000b,
702 0xfffd00ff, 672/* 0x0688: ih_no_other */
703 0xf61bf405, 673 0xf6010040,
704/* 0x06ea: ctx_load */ 674 0x04bd000a,
705 0x94bd00f8, 675 0xe0fcf0fc,
706 0x800599f0, 676 0xb0fcd0fc,
707 0xf6023700, 677 0x90fca0fc,
708 0x04bd0009, 678 0x88fe80fc,
709 0xb87e0c0a, 679 0xf480fc00,
710 0xf4bd0000, 680 0x01f80032,
711 0x02890080, 681/* 0x06a8: ctx_4170s */
682 0xb210f5f0,
683 0x41708eff,
684 0x008f7e40,
685/* 0x06b7: ctx_4170w */
686 0x8e00f800,
687 0x7e404170,
688 0xb2000065,
689 0x10f4f0ff,
690 0xf8f31bf4,
691/* 0x06c9: ctx_redswitch */
692 0x02004e00,
693 0xf040e5f0,
694 0xe5f020e5,
695 0x85008010,
696 0x000ef601,
697 0x080f04bd,
698/* 0x06e0: ctx_redswitch_delay */
699 0xf401f2b6,
700 0xe5f1fd1b,
701 0xe5f10400,
702 0x00800100,
703 0x0ef60185,
704 0xf804bd00,
705/* 0x06f9: ctx_86c */
706 0x23008000,
707 0x000ff602,
708 0xffb204bd,
709 0x408a148e,
710 0x00008f7e,
711 0x8c8effb2,
712 0x8f7e41a8,
713 0x00f80000,
714/* 0x0718: ctx_mem */
715 0x02840080,
712 0xbd000ff6, 716 0xbd000ff6,
713 0xc1008004, 717/* 0x0721: ctx_mem_wait */
714 0x0002f602, 718 0x84008f04,
715 0x008004bd, 719 0x00ffcf02,
716 0x02f60283, 720 0xf405fffd,
717 0x0f04bd00, 721 0x00f8f61b,
718 0x06d27e07, 722/* 0x0730: ctx_load */
719 0xc0008000, 723 0x99f094bd,
720 0x0002f602, 724 0x37008005,
721 0x0bfe04bd, 725 0x0009f602,
722 0x1f2af000, 726 0x0c0a04bd,
723 0xb60424b6, 727 0x0000b87e,
724 0x94bd0220, 728 0x0080f4bd,
725 0x800899f0, 729 0x0ff60289,
726 0xf6023700, 730 0x8004bd00,
727 0x04bd0009, 731 0xf602c100,
728 0x02810080, 732 0x04bd0002,
729 0xbd0002f6, 733 0x02830080,
730 0x0000d204,
731 0x25f08000,
732 0x88008002,
733 0x0002f602,
734 0x100104bd,
735 0xf0020042,
736 0x12fa0223,
737 0xbd03f805,
738 0x0899f094,
739 0x02170080,
740 0xbd0009f6,
741 0x81019804,
742 0x981814b6,
743 0x25b68002,
744 0x0512fd08,
745 0xbd1601b5,
746 0x0999f094,
747 0x02370080,
748 0xbd0009f6,
749 0x81008004,
750 0x0001f602,
751 0x010204bd,
752 0x02880080,
753 0xbd0002f6, 734 0xbd0002f6,
754 0x01004104, 735 0x7e070f04,
755 0xfa0613f0, 736 0x80000718,
756 0x03f80501, 737 0xf602c000,
738 0x04bd0002,
739 0xf0000bfe,
740 0x24b61f2a,
741 0x0220b604,
757 0x99f094bd, 742 0x99f094bd,
758 0x17008009, 743 0x37008008,
759 0x0009f602, 744 0x0009f602,
760 0x94bd04bd, 745 0x008004bd,
761 0x800599f0, 746 0x02f60281,
747 0xd204bd00,
748 0x80000000,
749 0x800225f0,
750 0xf6028800,
751 0x04bd0002,
752 0x00421001,
753 0x0223f002,
754 0xf80512fa,
755 0xf094bd03,
756 0x00800899,
757 0x09f60217,
758 0x9804bd00,
759 0x14b68101,
760 0x80029818,
761 0xfd0825b6,
762 0x01b50512,
763 0xf094bd16,
764 0x00800999,
765 0x09f60237,
766 0x8004bd00,
767 0xf6028100,
768 0x04bd0001,
769 0x00800102,
770 0x02f60288,
771 0x4104bd00,
772 0x13f00100,
773 0x0501fa06,
774 0x94bd03f8,
775 0x800999f0,
762 0xf6021700, 776 0xf6021700,
763 0x04bd0009, 777 0x04bd0009,
764/* 0x07d6: ctx_chan */ 778 0x99f094bd,
765 0xea7e00f8, 779 0x17008005,
766 0x0c0a0006, 780 0x0009f602,
767 0x0000b87e, 781 0x00f804bd,
768 0xd27e050f, 782/* 0x081c: ctx_chan */
769 0x00f80006, 783 0x0007307e,
770/* 0x07e8: ctx_mmio_exec */ 784 0xb87e0c0a,
771 0x80410398, 785 0x050f0000,
786 0x0007187e,
787/* 0x082e: ctx_mmio_exec */
788 0x039800f8,
789 0x81008041,
790 0x0003f602,
791 0x34bd04bd,
792/* 0x083c: ctx_mmio_loop */
793 0xf4ff34c4,
794 0x00450e1b,
795 0x0653f002,
796 0xf80535fa,
797/* 0x084d: ctx_mmio_pull */
798 0x804e9803,
799 0x7e814f98,
800 0xb600008f,
801 0x12b60830,
802 0xdf1bf401,
803/* 0x0860: ctx_mmio_done */
804 0x80160398,
772 0xf6028100, 805 0xf6028100,
773 0x04bd0003, 806 0x04bd0003,
774/* 0x07f6: ctx_mmio_loop */ 807 0x414000b5,
775 0x34c434bd, 808 0x13f00100,
776 0x0e1bf4ff, 809 0x0601fa06,
777 0xf0020045, 810 0x00f803f8,
778 0x35fa0653, 811/* 0x087c: ctx_xfer */
779/* 0x0807: ctx_mmio_pull */ 812 0x0080040e,
780 0x9803f805, 813 0x0ef60302,
781 0x4f98804e, 814/* 0x0887: ctx_xfer_idle */
782 0x008f7e81, 815 0x8e04bd00,
783 0x0830b600, 816 0xcf030000,
784 0xf40112b6, 817 0xe4f100ee,
785/* 0x081a: ctx_mmio_done */ 818 0x1bf42000,
786 0x0398df1b, 819 0x0611f4f5,
787 0x81008016, 820/* 0x089b: ctx_xfer_pre */
788 0x0003f602, 821 0x0f0c02f4,
789 0x00b504bd, 822 0x06f97e10,
790 0x01004140, 823 0x1b11f400,
791 0xfa0613f0, 824/* 0x08a4: ctx_xfer_pre_load */
792 0x03f80601, 825 0xa87e020f,
793/* 0x0836: ctx_xfer */ 826 0xb77e0006,
794 0x040e00f8, 827 0xc97e0006,
795 0x03020080, 828 0xf4bd0006,
796 0xbd000ef6, 829 0x0006a87e,
797/* 0x0841: ctx_xfer_idle */ 830 0x0007307e,
798 0x00008e04, 831/* 0x08bc: ctx_xfer_exec */
799 0x00eecf03, 832 0xbd160198,
800 0x2000e4f1, 833 0x05008024,
801 0xf4f51bf4, 834 0x0002f601,
802 0x02f40611, 835 0x1fb204bd,
803/* 0x0855: ctx_xfer_pre */ 836 0x41a5008e,
804 0x7e100f0c,
805 0xf40006b3,
806/* 0x085e: ctx_xfer_pre_load */
807 0x020f1b11,
808 0x0006627e,
809 0x0006717e,
810 0x0006837e,
811 0x627ef4bd,
812 0xea7e0006,
813/* 0x0876: ctx_xfer_exec */
814 0x01980006,
815 0x8024bd16,
816 0xf6010500,
817 0x04bd0002,
818 0x008e1fb2,
819 0x8f7e41a5,
820 0xfcf00000,
821 0x022cf001,
822 0xfd0124b6,
823 0xffb205f2,
824 0x41a5048e,
825 0x00008f7e, 837 0x00008f7e,
826 0x0002167e, 838 0xf001fcf0,
827 0xfc8024bd, 839 0x24b6022c,
828 0x02f60247, 840 0x05f2fd01,
829 0xf004bd00, 841 0x048effb2,
830 0x20b6012c, 842 0x8f7e41a5,
831 0x4afc8003, 843 0x167e0000,
832 0x0002f602, 844 0x24bd0002,
833 0xacf004bd, 845 0x0247fc80,
834 0x06a5f001, 846 0xbd0002f6,
835 0x0c98000b, 847 0x012cf004,
836 0x010d9800, 848 0x800320b6,
837 0x3d7e000e, 849 0xf6024afc,
838 0x080a0001, 850 0x04bd0002,
839 0x0000ec7e, 851 0xf001acf0,
840 0x00020a7e, 852 0x000b06a5,
841 0x0a1201f4, 853 0x98000c98,
842 0x00b87e0c, 854 0x000e010d,
843 0x7e050f00, 855 0x00013d7e,
844 0xf40006d2, 856 0xec7e080a,
845/* 0x08f2: ctx_xfer_post */ 857 0x0a7e0000,
846 0x020f2d02, 858 0x01f40002,
847 0x0006627e, 859 0x7e0c0a12,
848 0xb37ef4bd, 860 0x0f0000b8,
849 0x277e0006, 861 0x07187e05,
850 0x717e0002, 862 0x2d02f400,
863/* 0x0938: ctx_xfer_post */
864 0xa87e020f,
851 0xf4bd0006, 865 0xf4bd0006,
852 0x0006627e, 866 0x0006f97e,
853 0x981011f4, 867 0x0002277e,
854 0x11fd4001, 868 0x0006b77e,
855 0x070bf405, 869 0xa87ef4bd,
856 0x0007e87e, 870 0x11f40006,
857/* 0x091c: ctx_xfer_no_post_mmio */ 871 0x40019810,
858/* 0x091c: ctx_xfer_done */ 872 0xf40511fd,
859 0x000000f8, 873 0x2e7e070b,
860 0x00000000, 874/* 0x0962: ctx_xfer_no_post_mmio */
861 0x00000000, 875/* 0x0962: ctx_xfer_done */
862 0x00000000, 876 0x00f80008,
863 0x00000000,
864 0x00000000,
865 0x00000000,
866 0x00000000,
867 0x00000000,
868 0x00000000,
869 0x00000000,
870 0x00000000,
871 0x00000000,
872 0x00000000,
873 0x00000000,
874 0x00000000,
875 0x00000000,
876 0x00000000,
877 0x00000000, 877 0x00000000,
878 0x00000000, 878 0x00000000,
879 0x00000000, 879 0x00000000,
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnv108.fuc5.h b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnv108.fuc5.h
index 64dfd75192bf..e49b5a877ae4 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnv108.fuc5.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnv108.fuc5.h
@@ -478,10 +478,10 @@ uint32_t nv108_grhub_code[] = {
478 0x01040080, 478 0x01040080,
479 0xbd0001f6, 479 0xbd0001f6,
480 0x01004104, 480 0x01004104,
481 0x627e020f, 481 0xa87e020f,
482 0x717e0006, 482 0xb77e0006,
483 0x100f0006, 483 0x100f0006,
484 0x0006b37e, 484 0x0006f97e,
485 0x98000e98, 485 0x98000e98,
486 0x207e010f, 486 0x207e010f,
487 0x14950001, 487 0x14950001,
@@ -523,8 +523,8 @@ uint32_t nv108_grhub_code[] = {
523 0x800040b7, 523 0x800040b7,
524 0xf40132b6, 524 0xf40132b6,
525 0x000fb41b, 525 0x000fb41b,
526 0x0006b37e, 526 0x0006f97e,
527 0x627e000f, 527 0xa87e000f,
528 0x00800006, 528 0x00800006,
529 0x01f60201, 529 0x01f60201,
530 0xbd04bd00, 530 0xbd04bd00,
@@ -554,7 +554,7 @@ uint32_t nv108_grhub_code[] = {
554 0x0009f602, 554 0x0009f602,
555 0x32f404bd, 555 0x32f404bd,
556 0x0231f401, 556 0x0231f401,
557 0x0008367e, 557 0x00087c7e,
558 0x99f094bd, 558 0x99f094bd,
559 0x17008007, 559 0x17008007,
560 0x0009f602, 560 0x0009f602,
@@ -563,7 +563,7 @@ uint32_t nv108_grhub_code[] = {
563 0x37008006, 563 0x37008006,
564 0x0009f602, 564 0x0009f602,
565 0x31f404bd, 565 0x31f404bd,
566 0x08367e01, 566 0x087c7e01,
567 0xf094bd00, 567 0xf094bd00,
568 0x00800699, 568 0x00800699,
569 0x09f60217, 569 0x09f60217,
@@ -572,7 +572,7 @@ uint32_t nv108_grhub_code[] = {
572 0x20f92f0e, 572 0x20f92f0e,
573 0x32f412b2, 573 0x32f412b2,
574 0x0232f401, 574 0x0232f401,
575 0x0008367e, 575 0x00087c7e,
576 0x008020fc, 576 0x008020fc,
577 0x02f602c0, 577 0x02f602c0,
578 0xf404bd00, 578 0xf404bd00,
@@ -580,7 +580,7 @@ uint32_t nv108_grhub_code[] = {
580 0x23c8130e, 580 0x23c8130e,
581 0x0d0bf41f, 581 0x0d0bf41f,
582 0xf40131f4, 582 0xf40131f4,
583 0x367e0232, 583 0x7c7e0232,
584/* 0x054e: chsw_done */ 584/* 0x054e: chsw_done */
585 0x01020008, 585 0x01020008,
586 0x02c30080, 586 0x02c30080,
@@ -593,7 +593,7 @@ uint32_t nv108_grhub_code[] = {
593 0xb0ff2a0e, 593 0xb0ff2a0e,
594 0x1bf401e4, 594 0x1bf401e4,
595 0x7ef2b20c, 595 0x7ef2b20c,
596 0xf40007d6, 596 0xf400081c,
597/* 0x057a: main_not_ctx_chan */ 597/* 0x057a: main_not_ctx_chan */
598 0xe4b0400e, 598 0xe4b0400e,
599 0x2c1bf402, 599 0x2c1bf402,
@@ -602,7 +602,7 @@ uint32_t nv108_grhub_code[] = {
602 0x0009f602, 602 0x0009f602,
603 0x32f404bd, 603 0x32f404bd,
604 0x0232f401, 604 0x0232f401,
605 0x0008367e, 605 0x00087c7e,
606 0x99f094bd, 606 0x99f094bd,
607 0x17008007, 607 0x17008007,
608 0x0009f602, 608 0x0009f602,
@@ -642,238 +642,238 @@ uint32_t nv108_grhub_code[] = {
642/* 0x061a: ih_no_ctxsw */ 642/* 0x061a: ih_no_ctxsw */
643 0xabe40000, 643 0xabe40000,
644 0x0bf40400, 644 0x0bf40400,
645 0x01004b10, 645 0x07088e56,
646 0x448ebfb2,
647 0x8f7e4001,
648/* 0x062e: ih_no_fwmthd */
649 0x044b0000,
650 0xffb0bd01,
651 0x0bf4b4ab,
652 0x0700800c,
653 0x000bf603,
654/* 0x0642: ih_no_other */
655 0x004004bd,
656 0x000af601,
657 0xf0fc04bd,
658 0xd0fce0fc,
659 0xa0fcb0fc,
660 0x80fc90fc,
661 0xfc0088fe,
662 0x0032f480,
663/* 0x0662: ctx_4170s */
664 0xf5f001f8,
665 0x8effb210,
666 0x7e404170,
667 0xf800008f,
668/* 0x0671: ctx_4170w */
669 0x41708e00,
670 0x00657e40, 646 0x00657e40,
671 0xf0ffb200, 647 0x80ffb200,
672 0x1bf410f4, 648 0xf6020400,
673/* 0x0683: ctx_redswitch */
674 0x4e00f8f3,
675 0xe5f00200,
676 0x20e5f040,
677 0x8010e5f0,
678 0xf6018500,
679 0x04bd000e,
680/* 0x069a: ctx_redswitch_delay */
681 0xf2b6080f,
682 0xfd1bf401,
683 0x0400e5f1,
684 0x0100e5f1,
685 0x01850080,
686 0xbd000ef6,
687/* 0x06b3: ctx_86c */
688 0x8000f804,
689 0xf6022300,
690 0x04bd000f, 649 0x04bd000f,
691 0x148effb2, 650 0x4007048e,
692 0x8f7e408a, 651 0x0000657e,
693 0xffb20000, 652 0x0080ffb2,
694 0x41a88c8e, 653 0x0ff60203,
654 0xc704bd00,
655 0xee9450fe,
656 0x07008f02,
657 0x00efbb40,
658 0x0000657e,
659 0x02020080,
660 0xbd000ff6,
661 0x7e030f04,
662 0x4b0002f8,
663 0xbfb20100,
664 0x4001448e,
695 0x00008f7e, 665 0x00008f7e,
696/* 0x06d2: ctx_mem */ 666/* 0x0674: ih_no_fwmthd */
697 0x008000f8, 667 0xbd05044b,
698 0x0ff60284, 668 0xb4abffb0,
699/* 0x06db: ctx_mem_wait */ 669 0x800c0bf4,
700 0x8f04bd00, 670 0xf6030700,
701 0xcf028400, 671 0x04bd000b,
702 0xfffd00ff, 672/* 0x0688: ih_no_other */
703 0xf61bf405, 673 0xf6010040,
704/* 0x06ea: ctx_load */ 674 0x04bd000a,
705 0x94bd00f8, 675 0xe0fcf0fc,
706 0x800599f0, 676 0xb0fcd0fc,
707 0xf6023700, 677 0x90fca0fc,
708 0x04bd0009, 678 0x88fe80fc,
709 0xb87e0c0a, 679 0xf480fc00,
710 0xf4bd0000, 680 0x01f80032,
711 0x02890080, 681/* 0x06a8: ctx_4170s */
682 0xb210f5f0,
683 0x41708eff,
684 0x008f7e40,
685/* 0x06b7: ctx_4170w */
686 0x8e00f800,
687 0x7e404170,
688 0xb2000065,
689 0x10f4f0ff,
690 0xf8f31bf4,
691/* 0x06c9: ctx_redswitch */
692 0x02004e00,
693 0xf040e5f0,
694 0xe5f020e5,
695 0x85008010,
696 0x000ef601,
697 0x080f04bd,
698/* 0x06e0: ctx_redswitch_delay */
699 0xf401f2b6,
700 0xe5f1fd1b,
701 0xe5f10400,
702 0x00800100,
703 0x0ef60185,
704 0xf804bd00,
705/* 0x06f9: ctx_86c */
706 0x23008000,
707 0x000ff602,
708 0xffb204bd,
709 0x408a148e,
710 0x00008f7e,
711 0x8c8effb2,
712 0x8f7e41a8,
713 0x00f80000,
714/* 0x0718: ctx_mem */
715 0x02840080,
712 0xbd000ff6, 716 0xbd000ff6,
713 0xc1008004, 717/* 0x0721: ctx_mem_wait */
714 0x0002f602, 718 0x84008f04,
715 0x008004bd, 719 0x00ffcf02,
716 0x02f60283, 720 0xf405fffd,
717 0x0f04bd00, 721 0x00f8f61b,
718 0x06d27e07, 722/* 0x0730: ctx_load */
719 0xc0008000, 723 0x99f094bd,
720 0x0002f602, 724 0x37008005,
721 0x0bfe04bd, 725 0x0009f602,
722 0x1f2af000, 726 0x0c0a04bd,
723 0xb60424b6, 727 0x0000b87e,
724 0x94bd0220, 728 0x0080f4bd,
725 0x800899f0, 729 0x0ff60289,
726 0xf6023700, 730 0x8004bd00,
727 0x04bd0009, 731 0xf602c100,
728 0x02810080, 732 0x04bd0002,
729 0xbd0002f6, 733 0x02830080,
730 0x0000d204,
731 0x25f08000,
732 0x88008002,
733 0x0002f602,
734 0x100104bd,
735 0xf0020042,
736 0x12fa0223,
737 0xbd03f805,
738 0x0899f094,
739 0x02170080,
740 0xbd0009f6,
741 0x81019804,
742 0x981814b6,
743 0x25b68002,
744 0x0512fd08,
745 0xbd1601b5,
746 0x0999f094,
747 0x02370080,
748 0xbd0009f6,
749 0x81008004,
750 0x0001f602,
751 0x010204bd,
752 0x02880080,
753 0xbd0002f6, 734 0xbd0002f6,
754 0x01004104, 735 0x7e070f04,
755 0xfa0613f0, 736 0x80000718,
756 0x03f80501, 737 0xf602c000,
738 0x04bd0002,
739 0xf0000bfe,
740 0x24b61f2a,
741 0x0220b604,
757 0x99f094bd, 742 0x99f094bd,
758 0x17008009, 743 0x37008008,
759 0x0009f602, 744 0x0009f602,
760 0x94bd04bd, 745 0x008004bd,
761 0x800599f0, 746 0x02f60281,
747 0xd204bd00,
748 0x80000000,
749 0x800225f0,
750 0xf6028800,
751 0x04bd0002,
752 0x00421001,
753 0x0223f002,
754 0xf80512fa,
755 0xf094bd03,
756 0x00800899,
757 0x09f60217,
758 0x9804bd00,
759 0x14b68101,
760 0x80029818,
761 0xfd0825b6,
762 0x01b50512,
763 0xf094bd16,
764 0x00800999,
765 0x09f60237,
766 0x8004bd00,
767 0xf6028100,
768 0x04bd0001,
769 0x00800102,
770 0x02f60288,
771 0x4104bd00,
772 0x13f00100,
773 0x0501fa06,
774 0x94bd03f8,
775 0x800999f0,
762 0xf6021700, 776 0xf6021700,
763 0x04bd0009, 777 0x04bd0009,
764/* 0x07d6: ctx_chan */ 778 0x99f094bd,
765 0xea7e00f8, 779 0x17008005,
766 0x0c0a0006, 780 0x0009f602,
767 0x0000b87e, 781 0x00f804bd,
768 0xd27e050f, 782/* 0x081c: ctx_chan */
769 0x00f80006, 783 0x0007307e,
770/* 0x07e8: ctx_mmio_exec */ 784 0xb87e0c0a,
771 0x80410398, 785 0x050f0000,
786 0x0007187e,
787/* 0x082e: ctx_mmio_exec */
788 0x039800f8,
789 0x81008041,
790 0x0003f602,
791 0x34bd04bd,
792/* 0x083c: ctx_mmio_loop */
793 0xf4ff34c4,
794 0x00450e1b,
795 0x0653f002,
796 0xf80535fa,
797/* 0x084d: ctx_mmio_pull */
798 0x804e9803,
799 0x7e814f98,
800 0xb600008f,
801 0x12b60830,
802 0xdf1bf401,
803/* 0x0860: ctx_mmio_done */
804 0x80160398,
772 0xf6028100, 805 0xf6028100,
773 0x04bd0003, 806 0x04bd0003,
774/* 0x07f6: ctx_mmio_loop */ 807 0x414000b5,
775 0x34c434bd, 808 0x13f00100,
776 0x0e1bf4ff, 809 0x0601fa06,
777 0xf0020045, 810 0x00f803f8,
778 0x35fa0653, 811/* 0x087c: ctx_xfer */
779/* 0x0807: ctx_mmio_pull */ 812 0x0080040e,
780 0x9803f805, 813 0x0ef60302,
781 0x4f98804e, 814/* 0x0887: ctx_xfer_idle */
782 0x008f7e81, 815 0x8e04bd00,
783 0x0830b600, 816 0xcf030000,
784 0xf40112b6, 817 0xe4f100ee,
785/* 0x081a: ctx_mmio_done */ 818 0x1bf42000,
786 0x0398df1b, 819 0x0611f4f5,
787 0x81008016, 820/* 0x089b: ctx_xfer_pre */
788 0x0003f602, 821 0x0f0c02f4,
789 0x00b504bd, 822 0x06f97e10,
790 0x01004140, 823 0x1b11f400,
791 0xfa0613f0, 824/* 0x08a4: ctx_xfer_pre_load */
792 0x03f80601, 825 0xa87e020f,
793/* 0x0836: ctx_xfer */ 826 0xb77e0006,
794 0x040e00f8, 827 0xc97e0006,
795 0x03020080, 828 0xf4bd0006,
796 0xbd000ef6, 829 0x0006a87e,
797/* 0x0841: ctx_xfer_idle */ 830 0x0007307e,
798 0x00008e04, 831/* 0x08bc: ctx_xfer_exec */
799 0x00eecf03, 832 0xbd160198,
800 0x2000e4f1, 833 0x05008024,
801 0xf4f51bf4, 834 0x0002f601,
802 0x02f40611, 835 0x1fb204bd,
803/* 0x0855: ctx_xfer_pre */ 836 0x41a5008e,
804 0x7e100f0c,
805 0xf40006b3,
806/* 0x085e: ctx_xfer_pre_load */
807 0x020f1b11,
808 0x0006627e,
809 0x0006717e,
810 0x0006837e,
811 0x627ef4bd,
812 0xea7e0006,
813/* 0x0876: ctx_xfer_exec */
814 0x01980006,
815 0x8024bd16,
816 0xf6010500,
817 0x04bd0002,
818 0x008e1fb2,
819 0x8f7e41a5,
820 0xfcf00000,
821 0x022cf001,
822 0xfd0124b6,
823 0xffb205f2,
824 0x41a5048e,
825 0x00008f7e, 837 0x00008f7e,
826 0x0002167e, 838 0xf001fcf0,
827 0xfc8024bd, 839 0x24b6022c,
828 0x02f60247, 840 0x05f2fd01,
829 0xf004bd00, 841 0x048effb2,
830 0x20b6012c, 842 0x8f7e41a5,
831 0x4afc8003, 843 0x167e0000,
832 0x0002f602, 844 0x24bd0002,
833 0xacf004bd, 845 0x0247fc80,
834 0x06a5f001, 846 0xbd0002f6,
835 0x0c98000b, 847 0x012cf004,
836 0x010d9800, 848 0x800320b6,
837 0x3d7e000e, 849 0xf6024afc,
838 0x080a0001, 850 0x04bd0002,
839 0x0000ec7e, 851 0xf001acf0,
840 0x00020a7e, 852 0x000b06a5,
841 0x0a1201f4, 853 0x98000c98,
842 0x00b87e0c, 854 0x000e010d,
843 0x7e050f00, 855 0x00013d7e,
844 0xf40006d2, 856 0xec7e080a,
845/* 0x08f2: ctx_xfer_post */ 857 0x0a7e0000,
846 0x020f2d02, 858 0x01f40002,
847 0x0006627e, 859 0x7e0c0a12,
848 0xb37ef4bd, 860 0x0f0000b8,
849 0x277e0006, 861 0x07187e05,
850 0x717e0002, 862 0x2d02f400,
863/* 0x0938: ctx_xfer_post */
864 0xa87e020f,
851 0xf4bd0006, 865 0xf4bd0006,
852 0x0006627e, 866 0x0006f97e,
853 0x981011f4, 867 0x0002277e,
854 0x11fd4001, 868 0x0006b77e,
855 0x070bf405, 869 0xa87ef4bd,
856 0x0007e87e, 870 0x11f40006,
857/* 0x091c: ctx_xfer_no_post_mmio */ 871 0x40019810,
858/* 0x091c: ctx_xfer_done */ 872 0xf40511fd,
859 0x000000f8, 873 0x2e7e070b,
860 0x00000000, 874/* 0x0962: ctx_xfer_no_post_mmio */
861 0x00000000, 875/* 0x0962: ctx_xfer_done */
862 0x00000000, 876 0x00f80008,
863 0x00000000,
864 0x00000000,
865 0x00000000,
866 0x00000000,
867 0x00000000,
868 0x00000000,
869 0x00000000,
870 0x00000000,
871 0x00000000,
872 0x00000000,
873 0x00000000,
874 0x00000000,
875 0x00000000,
876 0x00000000,
877 0x00000000, 877 0x00000000,
878 0x00000000, 878 0x00000000,
879 0x00000000, 879 0x00000000,
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc.h b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc.h
index f8f7b278a13f..92dfe6a4ac87 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvc0.fuc.h
@@ -528,10 +528,10 @@ uint32_t nvc0_grhub_code[] = {
528 0x0001d001, 528 0x0001d001,
529 0x17f104bd, 529 0x17f104bd,
530 0xf7f00100, 530 0xf7f00100,
531 0xb521f502, 531 0x0d21f502,
532 0xc721f507, 532 0x1f21f508,
533 0x10f7f007, 533 0x10f7f008,
534 0x081421f5, 534 0x086c21f5,
535 0x98000e98, 535 0x98000e98,
536 0x21f5010f, 536 0x21f5010f,
537 0x14950150, 537 0x14950150,
@@ -574,9 +574,9 @@ uint32_t nvc0_grhub_code[] = {
574 0xb6800040, 574 0xb6800040,
575 0x1bf40132, 575 0x1bf40132,
576 0x00f7f0be, 576 0x00f7f0be,
577 0x081421f5, 577 0x086c21f5,
578 0xf500f7f0, 578 0xf500f7f0,
579 0xf107b521, 579 0xf1080d21,
580 0xf0010007, 580 0xf0010007,
581 0x01d00203, 581 0x01d00203,
582 0xbd04bd00, 582 0xbd04bd00,
@@ -610,8 +610,8 @@ uint32_t nvc0_grhub_code[] = {
610 0x09d00203, 610 0x09d00203,
611 0xf404bd00, 611 0xf404bd00,
612 0x31f40132, 612 0x31f40132,
613 0xe821f502, 613 0x4021f502,
614 0xf094bd09, 614 0xf094bd0a,
615 0x07f10799, 615 0x07f10799,
616 0x03f01700, 616 0x03f01700,
617 0x0009d002, 617 0x0009d002,
@@ -621,7 +621,7 @@ uint32_t nvc0_grhub_code[] = {
621 0x0203f00f, 621 0x0203f00f,
622 0xbd0009d0, 622 0xbd0009d0,
623 0x0131f404, 623 0x0131f404,
624 0x09e821f5, 624 0x0a4021f5,
625 0x99f094bd, 625 0x99f094bd,
626 0x0007f106, 626 0x0007f106,
627 0x0203f017, 627 0x0203f017,
@@ -631,7 +631,7 @@ uint32_t nvc0_grhub_code[] = {
631 0x12b920f9, 631 0x12b920f9,
632 0x0132f402, 632 0x0132f402,
633 0xf50232f4, 633 0xf50232f4,
634 0xfc09e821, 634 0xfc0a4021,
635 0x0007f120, 635 0x0007f120,
636 0x0203f0c0, 636 0x0203f0c0,
637 0xbd0002d0, 637 0xbd0002d0,
@@ -640,7 +640,7 @@ uint32_t nvc0_grhub_code[] = {
640 0xf41f23c8, 640 0xf41f23c8,
641 0x31f40d0b, 641 0x31f40d0b,
642 0x0232f401, 642 0x0232f401,
643 0x09e821f5, 643 0x0a4021f5,
644/* 0x063c: chsw_done */ 644/* 0x063c: chsw_done */
645 0xf10127f0, 645 0xf10127f0,
646 0xf0c30007, 646 0xf0c30007,
@@ -654,7 +654,7 @@ uint32_t nvc0_grhub_code[] = {
654/* 0x0660: main_not_ctx_switch */ 654/* 0x0660: main_not_ctx_switch */
655 0xf401e4b0, 655 0xf401e4b0,
656 0xf2b90d1b, 656 0xf2b90d1b,
657 0x7821f502, 657 0xd021f502,
658 0x460ef409, 658 0x460ef409,
659/* 0x0670: main_not_ctx_chan */ 659/* 0x0670: main_not_ctx_chan */
660 0xf402e4b0, 660 0xf402e4b0,
@@ -664,8 +664,8 @@ uint32_t nvc0_grhub_code[] = {
664 0x09d00203, 664 0x09d00203,
665 0xf404bd00, 665 0xf404bd00,
666 0x32f40132, 666 0x32f40132,
667 0xe821f502, 667 0x4021f502,
668 0xf094bd09, 668 0xf094bd0a,
669 0x07f10799, 669 0x07f10799,
670 0x03f01700, 670 0x03f01700,
671 0x0009d002, 671 0x0009d002,
@@ -710,18 +710,40 @@ uint32_t nvc0_grhub_code[] = {
710/* 0x072b: ih_no_ctxsw */ 710/* 0x072b: ih_no_ctxsw */
711 0xe40421f4, 711 0xe40421f4,
712 0xf40400ab, 712 0xf40400ab,
713 0xb7f1140b, 713 0xe7f16c0b,
714 0xe3f00708,
715 0x6821f440,
716 0xf102ffb9,
717 0xf0040007,
718 0x0fd00203,
719 0xf104bd00,
720 0xf00704e7,
721 0x21f440e3,
722 0x02ffb968,
723 0x030007f1,
724 0xd00203f0,
725 0x04bd000f,
726 0x9450fec7,
727 0xf7f102ee,
728 0xf3f00700,
729 0x00efbb40,
730 0xf16821f4,
731 0xf0020007,
732 0x0fd00203,
733 0xf004bd00,
734 0x21f503f7,
735 0xb7f1037e,
714 0xbfb90100, 736 0xbfb90100,
715 0x44e7f102, 737 0x44e7f102,
716 0x40e3f001, 738 0x40e3f001,
717/* 0x0743: ih_no_fwmthd */ 739/* 0x079b: ih_no_fwmthd */
718 0xf19d21f4, 740 0xf19d21f4,
719 0xbd0104b7, 741 0xbd0504b7,
720 0xb4abffb0, 742 0xb4abffb0,
721 0xf10f0bf4, 743 0xf10f0bf4,
722 0xf0070007, 744 0xf0070007,
723 0x0bd00303, 745 0x0bd00303,
724/* 0x075b: ih_no_other */ 746/* 0x07b3: ih_no_other */
725 0xf104bd00, 747 0xf104bd00,
726 0xf0010007, 748 0xf0010007,
727 0x0ad00003, 749 0x0ad00003,
@@ -731,36 +753,36 @@ uint32_t nvc0_grhub_code[] = {
731 0xfc90fca0, 753 0xfc90fca0,
732 0x0088fe80, 754 0x0088fe80,
733 0x32f480fc, 755 0x32f480fc,
734/* 0x077f: ctx_4160s */ 756/* 0x07d7: ctx_4160s */
735 0xf001f800, 757 0xf001f800,
736 0xffb901f7, 758 0xffb901f7,
737 0x60e7f102, 759 0x60e7f102,
738 0x40e3f041, 760 0x40e3f041,
739/* 0x078f: ctx_4160s_wait */ 761/* 0x07e7: ctx_4160s_wait */
740 0xf19d21f4, 762 0xf19d21f4,
741 0xf04160e7, 763 0xf04160e7,
742 0x21f440e3, 764 0x21f440e3,
743 0x02ffb968, 765 0x02ffb968,
744 0xf404ffc8, 766 0xf404ffc8,
745 0x00f8f00b, 767 0x00f8f00b,
746/* 0x07a4: ctx_4160c */ 768/* 0x07fc: ctx_4160c */
747 0xffb9f4bd, 769 0xffb9f4bd,
748 0x60e7f102, 770 0x60e7f102,
749 0x40e3f041, 771 0x40e3f041,
750 0xf89d21f4, 772 0xf89d21f4,
751/* 0x07b5: ctx_4170s */ 773/* 0x080d: ctx_4170s */
752 0x10f5f000, 774 0x10f5f000,
753 0xf102ffb9, 775 0xf102ffb9,
754 0xf04170e7, 776 0xf04170e7,
755 0x21f440e3, 777 0x21f440e3,
756/* 0x07c7: ctx_4170w */ 778/* 0x081f: ctx_4170w */
757 0xf100f89d, 779 0xf100f89d,
758 0xf04170e7, 780 0xf04170e7,
759 0x21f440e3, 781 0x21f440e3,
760 0x02ffb968, 782 0x02ffb968,
761 0xf410f4f0, 783 0xf410f4f0,
762 0x00f8f01b, 784 0x00f8f01b,
763/* 0x07dc: ctx_redswitch */ 785/* 0x0834: ctx_redswitch */
764 0x0200e7f1, 786 0x0200e7f1,
765 0xf040e5f0, 787 0xf040e5f0,
766 0xe5f020e5, 788 0xe5f020e5,
@@ -768,7 +790,7 @@ uint32_t nvc0_grhub_code[] = {
768 0x0103f085, 790 0x0103f085,
769 0xbd000ed0, 791 0xbd000ed0,
770 0x08f7f004, 792 0x08f7f004,
771/* 0x07f8: ctx_redswitch_delay */ 793/* 0x0850: ctx_redswitch_delay */
772 0xf401f2b6, 794 0xf401f2b6,
773 0xe5f1fd1b, 795 0xe5f1fd1b,
774 0xe5f10400, 796 0xe5f10400,
@@ -776,7 +798,7 @@ uint32_t nvc0_grhub_code[] = {
776 0x03f08500, 798 0x03f08500,
777 0x000ed001, 799 0x000ed001,
778 0x00f804bd, 800 0x00f804bd,
779/* 0x0814: ctx_86c */ 801/* 0x086c: ctx_86c */
780 0x1b0007f1, 802 0x1b0007f1,
781 0xd00203f0, 803 0xd00203f0,
782 0x04bd000f, 804 0x04bd000f,
@@ -787,16 +809,16 @@ uint32_t nvc0_grhub_code[] = {
787 0xa86ce7f1, 809 0xa86ce7f1,
788 0xf441e3f0, 810 0xf441e3f0,
789 0x00f89d21, 811 0x00f89d21,
790/* 0x083c: ctx_mem */ 812/* 0x0894: ctx_mem */
791 0x840007f1, 813 0x840007f1,
792 0xd00203f0, 814 0xd00203f0,
793 0x04bd000f, 815 0x04bd000f,
794/* 0x0848: ctx_mem_wait */ 816/* 0x08a0: ctx_mem_wait */
795 0x8400f7f1, 817 0x8400f7f1,
796 0xcf02f3f0, 818 0xcf02f3f0,
797 0xfffd00ff, 819 0xfffd00ff,
798 0xf31bf405, 820 0xf31bf405,
799/* 0x085a: ctx_load */ 821/* 0x08b2: ctx_load */
800 0x94bd00f8, 822 0x94bd00f8,
801 0xf10599f0, 823 0xf10599f0,
802 0xf00f0007, 824 0xf00f0007,
@@ -814,7 +836,7 @@ uint32_t nvc0_grhub_code[] = {
814 0x02d00203, 836 0x02d00203,
815 0xf004bd00, 837 0xf004bd00,
816 0x21f507f7, 838 0x21f507f7,
817 0x07f1083c, 839 0x07f10894,
818 0x03f0c000, 840 0x03f0c000,
819 0x0002d002, 841 0x0002d002,
820 0x0bfe04bd, 842 0x0bfe04bd,
@@ -869,31 +891,31 @@ uint32_t nvc0_grhub_code[] = {
869 0x03f01700, 891 0x03f01700,
870 0x0009d002, 892 0x0009d002,
871 0x00f804bd, 893 0x00f804bd,
872/* 0x0978: ctx_chan */ 894/* 0x09d0: ctx_chan */
873 0x077f21f5, 895 0x07d721f5,
874 0x085a21f5, 896 0x08b221f5,
875 0xf40ca7f0, 897 0xf40ca7f0,
876 0xf7f0d021, 898 0xf7f0d021,
877 0x3c21f505, 899 0x9421f505,
878 0xa421f508, 900 0xfc21f508,
879/* 0x0993: ctx_mmio_exec */ 901/* 0x09eb: ctx_mmio_exec */
880 0x9800f807, 902 0x9800f807,
881 0x07f14103, 903 0x07f14103,
882 0x03f08100, 904 0x03f08100,
883 0x0003d002, 905 0x0003d002,
884 0x34bd04bd, 906 0x34bd04bd,
885/* 0x09a4: ctx_mmio_loop */ 907/* 0x09fc: ctx_mmio_loop */
886 0xf4ff34c4, 908 0xf4ff34c4,
887 0x57f10f1b, 909 0x57f10f1b,
888 0x53f00200, 910 0x53f00200,
889 0x0535fa06, 911 0x0535fa06,
890/* 0x09b6: ctx_mmio_pull */ 912/* 0x0a0e: ctx_mmio_pull */
891 0x4e9803f8, 913 0x4e9803f8,
892 0x814f9880, 914 0x814f9880,
893 0xb69d21f4, 915 0xb69d21f4,
894 0x12b60830, 916 0x12b60830,
895 0xdf1bf401, 917 0xdf1bf401,
896/* 0x09c8: ctx_mmio_done */ 918/* 0x0a20: ctx_mmio_done */
897 0xf1160398, 919 0xf1160398,
898 0xf0810007, 920 0xf0810007,
899 0x03d00203, 921 0x03d00203,
@@ -902,30 +924,30 @@ uint32_t nvc0_grhub_code[] = {
902 0x13f00100, 924 0x13f00100,
903 0x0601fa06, 925 0x0601fa06,
904 0x00f803f8, 926 0x00f803f8,
905/* 0x09e8: ctx_xfer */ 927/* 0x0a40: ctx_xfer */
906 0xf104e7f0, 928 0xf104e7f0,
907 0xf0020007, 929 0xf0020007,
908 0x0ed00303, 930 0x0ed00303,
909/* 0x09f7: ctx_xfer_idle */ 931/* 0x0a4f: ctx_xfer_idle */
910 0xf104bd00, 932 0xf104bd00,
911 0xf00000e7, 933 0xf00000e7,
912 0xeecf03e3, 934 0xeecf03e3,
913 0x00e4f100, 935 0x00e4f100,
914 0xf21bf420, 936 0xf21bf420,
915 0xf40611f4, 937 0xf40611f4,
916/* 0x0a0e: ctx_xfer_pre */ 938/* 0x0a66: ctx_xfer_pre */
917 0xf7f01102, 939 0xf7f01102,
918 0x1421f510, 940 0x6c21f510,
919 0x7f21f508, 941 0xd721f508,
920 0x1c11f407, 942 0x1c11f407,
921/* 0x0a1c: ctx_xfer_pre_load */ 943/* 0x0a74: ctx_xfer_pre_load */
922 0xf502f7f0, 944 0xf502f7f0,
923 0xf507b521, 945 0xf5080d21,
924 0xf507c721, 946 0xf5081f21,
925 0xbd07dc21, 947 0xbd083421,
926 0xb521f5f4, 948 0x0d21f5f4,
927 0x5a21f507, 949 0xb221f508,
928/* 0x0a35: ctx_xfer_exec */ 950/* 0x0a8d: ctx_xfer_exec */
929 0x16019808, 951 0x16019808,
930 0x07f124bd, 952 0x07f124bd,
931 0x03f00500, 953 0x03f00500,
@@ -960,23 +982,65 @@ uint32_t nvc0_grhub_code[] = {
960 0x1301f402, 982 0x1301f402,
961 0xf40ca7f0, 983 0xf40ca7f0,
962 0xf7f0d021, 984 0xf7f0d021,
963 0x3c21f505, 985 0x9421f505,
964 0x3202f408, 986 0x3202f408,
965/* 0x0ac4: ctx_xfer_post */ 987/* 0x0b1c: ctx_xfer_post */
966 0xf502f7f0, 988 0xf502f7f0,
967 0xbd07b521, 989 0xbd080d21,
968 0x1421f5f4, 990 0x6c21f5f4,
969 0x7f21f508, 991 0x7f21f508,
970 0xc721f502, 992 0x1f21f502,
971 0xf5f4bd07, 993 0xf5f4bd08,
972 0xf407b521, 994 0xf4080d21,
973 0x01981011, 995 0x01981011,
974 0x0511fd40, 996 0x0511fd40,
975 0xf5070bf4, 997 0xf5070bf4,
976/* 0x0aef: ctx_xfer_no_post_mmio */ 998/* 0x0b47: ctx_xfer_no_post_mmio */
977 0xf5099321, 999 0xf509eb21,
978/* 0x0af3: ctx_xfer_done */ 1000/* 0x0b4b: ctx_xfer_done */
979 0xf807a421, 1001 0xf807fc21,
1002 0x00000000,
1003 0x00000000,
1004 0x00000000,
1005 0x00000000,
1006 0x00000000,
1007 0x00000000,
1008 0x00000000,
1009 0x00000000,
1010 0x00000000,
1011 0x00000000,
1012 0x00000000,
1013 0x00000000,
1014 0x00000000,
1015 0x00000000,
1016 0x00000000,
1017 0x00000000,
1018 0x00000000,
1019 0x00000000,
1020 0x00000000,
1021 0x00000000,
1022 0x00000000,
1023 0x00000000,
1024 0x00000000,
1025 0x00000000,
1026 0x00000000,
1027 0x00000000,
1028 0x00000000,
1029 0x00000000,
1030 0x00000000,
1031 0x00000000,
1032 0x00000000,
1033 0x00000000,
1034 0x00000000,
1035 0x00000000,
1036 0x00000000,
1037 0x00000000,
1038 0x00000000,
1039 0x00000000,
1040 0x00000000,
1041 0x00000000,
1042 0x00000000,
1043 0x00000000,
980 0x00000000, 1044 0x00000000,
981 0x00000000, 1045 0x00000000,
982 0x00000000, 1046 0x00000000,
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvd7.fuc.h b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvd7.fuc.h
index 624215a005b0..62b0c7601d8b 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvd7.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvd7.fuc.h
@@ -528,10 +528,10 @@ uint32_t nvd7_grhub_code[] = {
528 0x0001d001, 528 0x0001d001,
529 0x17f104bd, 529 0x17f104bd,
530 0xf7f00100, 530 0xf7f00100,
531 0xb521f502, 531 0x0d21f502,
532 0xc721f507, 532 0x1f21f508,
533 0x10f7f007, 533 0x10f7f008,
534 0x081421f5, 534 0x086c21f5,
535 0x98000e98, 535 0x98000e98,
536 0x21f5010f, 536 0x21f5010f,
537 0x14950150, 537 0x14950150,
@@ -574,9 +574,9 @@ uint32_t nvd7_grhub_code[] = {
574 0xb6800040, 574 0xb6800040,
575 0x1bf40132, 575 0x1bf40132,
576 0x00f7f0be, 576 0x00f7f0be,
577 0x081421f5, 577 0x086c21f5,
578 0xf500f7f0, 578 0xf500f7f0,
579 0xf107b521, 579 0xf1080d21,
580 0xf0010007, 580 0xf0010007,
581 0x01d00203, 581 0x01d00203,
582 0xbd04bd00, 582 0xbd04bd00,
@@ -610,8 +610,8 @@ uint32_t nvd7_grhub_code[] = {
610 0x09d00203, 610 0x09d00203,
611 0xf404bd00, 611 0xf404bd00,
612 0x31f40132, 612 0x31f40132,
613 0xe821f502, 613 0x4021f502,
614 0xf094bd09, 614 0xf094bd0a,
615 0x07f10799, 615 0x07f10799,
616 0x03f01700, 616 0x03f01700,
617 0x0009d002, 617 0x0009d002,
@@ -621,7 +621,7 @@ uint32_t nvd7_grhub_code[] = {
621 0x0203f00f, 621 0x0203f00f,
622 0xbd0009d0, 622 0xbd0009d0,
623 0x0131f404, 623 0x0131f404,
624 0x09e821f5, 624 0x0a4021f5,
625 0x99f094bd, 625 0x99f094bd,
626 0x0007f106, 626 0x0007f106,
627 0x0203f017, 627 0x0203f017,
@@ -631,7 +631,7 @@ uint32_t nvd7_grhub_code[] = {
631 0x12b920f9, 631 0x12b920f9,
632 0x0132f402, 632 0x0132f402,
633 0xf50232f4, 633 0xf50232f4,
634 0xfc09e821, 634 0xfc0a4021,
635 0x0007f120, 635 0x0007f120,
636 0x0203f0c0, 636 0x0203f0c0,
637 0xbd0002d0, 637 0xbd0002d0,
@@ -640,7 +640,7 @@ uint32_t nvd7_grhub_code[] = {
640 0xf41f23c8, 640 0xf41f23c8,
641 0x31f40d0b, 641 0x31f40d0b,
642 0x0232f401, 642 0x0232f401,
643 0x09e821f5, 643 0x0a4021f5,
644/* 0x063c: chsw_done */ 644/* 0x063c: chsw_done */
645 0xf10127f0, 645 0xf10127f0,
646 0xf0c30007, 646 0xf0c30007,
@@ -654,7 +654,7 @@ uint32_t nvd7_grhub_code[] = {
654/* 0x0660: main_not_ctx_switch */ 654/* 0x0660: main_not_ctx_switch */
655 0xf401e4b0, 655 0xf401e4b0,
656 0xf2b90d1b, 656 0xf2b90d1b,
657 0x7821f502, 657 0xd021f502,
658 0x460ef409, 658 0x460ef409,
659/* 0x0670: main_not_ctx_chan */ 659/* 0x0670: main_not_ctx_chan */
660 0xf402e4b0, 660 0xf402e4b0,
@@ -664,8 +664,8 @@ uint32_t nvd7_grhub_code[] = {
664 0x09d00203, 664 0x09d00203,
665 0xf404bd00, 665 0xf404bd00,
666 0x32f40132, 666 0x32f40132,
667 0xe821f502, 667 0x4021f502,
668 0xf094bd09, 668 0xf094bd0a,
669 0x07f10799, 669 0x07f10799,
670 0x03f01700, 670 0x03f01700,
671 0x0009d002, 671 0x0009d002,
@@ -710,18 +710,40 @@ uint32_t nvd7_grhub_code[] = {
710/* 0x072b: ih_no_ctxsw */ 710/* 0x072b: ih_no_ctxsw */
711 0xe40421f4, 711 0xe40421f4,
712 0xf40400ab, 712 0xf40400ab,
713 0xb7f1140b, 713 0xe7f16c0b,
714 0xe3f00708,
715 0x6821f440,
716 0xf102ffb9,
717 0xf0040007,
718 0x0fd00203,
719 0xf104bd00,
720 0xf00704e7,
721 0x21f440e3,
722 0x02ffb968,
723 0x030007f1,
724 0xd00203f0,
725 0x04bd000f,
726 0x9450fec7,
727 0xf7f102ee,
728 0xf3f00700,
729 0x00efbb40,
730 0xf16821f4,
731 0xf0020007,
732 0x0fd00203,
733 0xf004bd00,
734 0x21f503f7,
735 0xb7f1037e,
714 0xbfb90100, 736 0xbfb90100,
715 0x44e7f102, 737 0x44e7f102,
716 0x40e3f001, 738 0x40e3f001,
717/* 0x0743: ih_no_fwmthd */ 739/* 0x079b: ih_no_fwmthd */
718 0xf19d21f4, 740 0xf19d21f4,
719 0xbd0104b7, 741 0xbd0504b7,
720 0xb4abffb0, 742 0xb4abffb0,
721 0xf10f0bf4, 743 0xf10f0bf4,
722 0xf0070007, 744 0xf0070007,
723 0x0bd00303, 745 0x0bd00303,
724/* 0x075b: ih_no_other */ 746/* 0x07b3: ih_no_other */
725 0xf104bd00, 747 0xf104bd00,
726 0xf0010007, 748 0xf0010007,
727 0x0ad00003, 749 0x0ad00003,
@@ -731,36 +753,36 @@ uint32_t nvd7_grhub_code[] = {
731 0xfc90fca0, 753 0xfc90fca0,
732 0x0088fe80, 754 0x0088fe80,
733 0x32f480fc, 755 0x32f480fc,
734/* 0x077f: ctx_4160s */ 756/* 0x07d7: ctx_4160s */
735 0xf001f800, 757 0xf001f800,
736 0xffb901f7, 758 0xffb901f7,
737 0x60e7f102, 759 0x60e7f102,
738 0x40e3f041, 760 0x40e3f041,
739/* 0x078f: ctx_4160s_wait */ 761/* 0x07e7: ctx_4160s_wait */
740 0xf19d21f4, 762 0xf19d21f4,
741 0xf04160e7, 763 0xf04160e7,
742 0x21f440e3, 764 0x21f440e3,
743 0x02ffb968, 765 0x02ffb968,
744 0xf404ffc8, 766 0xf404ffc8,
745 0x00f8f00b, 767 0x00f8f00b,
746/* 0x07a4: ctx_4160c */ 768/* 0x07fc: ctx_4160c */
747 0xffb9f4bd, 769 0xffb9f4bd,
748 0x60e7f102, 770 0x60e7f102,
749 0x40e3f041, 771 0x40e3f041,
750 0xf89d21f4, 772 0xf89d21f4,
751/* 0x07b5: ctx_4170s */ 773/* 0x080d: ctx_4170s */
752 0x10f5f000, 774 0x10f5f000,
753 0xf102ffb9, 775 0xf102ffb9,
754 0xf04170e7, 776 0xf04170e7,
755 0x21f440e3, 777 0x21f440e3,
756/* 0x07c7: ctx_4170w */ 778/* 0x081f: ctx_4170w */
757 0xf100f89d, 779 0xf100f89d,
758 0xf04170e7, 780 0xf04170e7,
759 0x21f440e3, 781 0x21f440e3,
760 0x02ffb968, 782 0x02ffb968,
761 0xf410f4f0, 783 0xf410f4f0,
762 0x00f8f01b, 784 0x00f8f01b,
763/* 0x07dc: ctx_redswitch */ 785/* 0x0834: ctx_redswitch */
764 0x0200e7f1, 786 0x0200e7f1,
765 0xf040e5f0, 787 0xf040e5f0,
766 0xe5f020e5, 788 0xe5f020e5,
@@ -768,7 +790,7 @@ uint32_t nvd7_grhub_code[] = {
768 0x0103f085, 790 0x0103f085,
769 0xbd000ed0, 791 0xbd000ed0,
770 0x08f7f004, 792 0x08f7f004,
771/* 0x07f8: ctx_redswitch_delay */ 793/* 0x0850: ctx_redswitch_delay */
772 0xf401f2b6, 794 0xf401f2b6,
773 0xe5f1fd1b, 795 0xe5f1fd1b,
774 0xe5f10400, 796 0xe5f10400,
@@ -776,7 +798,7 @@ uint32_t nvd7_grhub_code[] = {
776 0x03f08500, 798 0x03f08500,
777 0x000ed001, 799 0x000ed001,
778 0x00f804bd, 800 0x00f804bd,
779/* 0x0814: ctx_86c */ 801/* 0x086c: ctx_86c */
780 0x1b0007f1, 802 0x1b0007f1,
781 0xd00203f0, 803 0xd00203f0,
782 0x04bd000f, 804 0x04bd000f,
@@ -787,16 +809,16 @@ uint32_t nvd7_grhub_code[] = {
787 0xa86ce7f1, 809 0xa86ce7f1,
788 0xf441e3f0, 810 0xf441e3f0,
789 0x00f89d21, 811 0x00f89d21,
790/* 0x083c: ctx_mem */ 812/* 0x0894: ctx_mem */
791 0x840007f1, 813 0x840007f1,
792 0xd00203f0, 814 0xd00203f0,
793 0x04bd000f, 815 0x04bd000f,
794/* 0x0848: ctx_mem_wait */ 816/* 0x08a0: ctx_mem_wait */
795 0x8400f7f1, 817 0x8400f7f1,
796 0xcf02f3f0, 818 0xcf02f3f0,
797 0xfffd00ff, 819 0xfffd00ff,
798 0xf31bf405, 820 0xf31bf405,
799/* 0x085a: ctx_load */ 821/* 0x08b2: ctx_load */
800 0x94bd00f8, 822 0x94bd00f8,
801 0xf10599f0, 823 0xf10599f0,
802 0xf00f0007, 824 0xf00f0007,
@@ -814,7 +836,7 @@ uint32_t nvd7_grhub_code[] = {
814 0x02d00203, 836 0x02d00203,
815 0xf004bd00, 837 0xf004bd00,
816 0x21f507f7, 838 0x21f507f7,
817 0x07f1083c, 839 0x07f10894,
818 0x03f0c000, 840 0x03f0c000,
819 0x0002d002, 841 0x0002d002,
820 0x0bfe04bd, 842 0x0bfe04bd,
@@ -869,31 +891,31 @@ uint32_t nvd7_grhub_code[] = {
869 0x03f01700, 891 0x03f01700,
870 0x0009d002, 892 0x0009d002,
871 0x00f804bd, 893 0x00f804bd,
872/* 0x0978: ctx_chan */ 894/* 0x09d0: ctx_chan */
873 0x077f21f5, 895 0x07d721f5,
874 0x085a21f5, 896 0x08b221f5,
875 0xf40ca7f0, 897 0xf40ca7f0,
876 0xf7f0d021, 898 0xf7f0d021,
877 0x3c21f505, 899 0x9421f505,
878 0xa421f508, 900 0xfc21f508,
879/* 0x0993: ctx_mmio_exec */ 901/* 0x09eb: ctx_mmio_exec */
880 0x9800f807, 902 0x9800f807,
881 0x07f14103, 903 0x07f14103,
882 0x03f08100, 904 0x03f08100,
883 0x0003d002, 905 0x0003d002,
884 0x34bd04bd, 906 0x34bd04bd,
885/* 0x09a4: ctx_mmio_loop */ 907/* 0x09fc: ctx_mmio_loop */
886 0xf4ff34c4, 908 0xf4ff34c4,
887 0x57f10f1b, 909 0x57f10f1b,
888 0x53f00200, 910 0x53f00200,
889 0x0535fa06, 911 0x0535fa06,
890/* 0x09b6: ctx_mmio_pull */ 912/* 0x0a0e: ctx_mmio_pull */
891 0x4e9803f8, 913 0x4e9803f8,
892 0x814f9880, 914 0x814f9880,
893 0xb69d21f4, 915 0xb69d21f4,
894 0x12b60830, 916 0x12b60830,
895 0xdf1bf401, 917 0xdf1bf401,
896/* 0x09c8: ctx_mmio_done */ 918/* 0x0a20: ctx_mmio_done */
897 0xf1160398, 919 0xf1160398,
898 0xf0810007, 920 0xf0810007,
899 0x03d00203, 921 0x03d00203,
@@ -902,30 +924,30 @@ uint32_t nvd7_grhub_code[] = {
902 0x13f00100, 924 0x13f00100,
903 0x0601fa06, 925 0x0601fa06,
904 0x00f803f8, 926 0x00f803f8,
905/* 0x09e8: ctx_xfer */ 927/* 0x0a40: ctx_xfer */
906 0xf104e7f0, 928 0xf104e7f0,
907 0xf0020007, 929 0xf0020007,
908 0x0ed00303, 930 0x0ed00303,
909/* 0x09f7: ctx_xfer_idle */ 931/* 0x0a4f: ctx_xfer_idle */
910 0xf104bd00, 932 0xf104bd00,
911 0xf00000e7, 933 0xf00000e7,
912 0xeecf03e3, 934 0xeecf03e3,
913 0x00e4f100, 935 0x00e4f100,
914 0xf21bf420, 936 0xf21bf420,
915 0xf40611f4, 937 0xf40611f4,
916/* 0x0a0e: ctx_xfer_pre */ 938/* 0x0a66: ctx_xfer_pre */
917 0xf7f01102, 939 0xf7f01102,
918 0x1421f510, 940 0x6c21f510,
919 0x7f21f508, 941 0xd721f508,
920 0x1c11f407, 942 0x1c11f407,
921/* 0x0a1c: ctx_xfer_pre_load */ 943/* 0x0a74: ctx_xfer_pre_load */
922 0xf502f7f0, 944 0xf502f7f0,
923 0xf507b521, 945 0xf5080d21,
924 0xf507c721, 946 0xf5081f21,
925 0xbd07dc21, 947 0xbd083421,
926 0xb521f5f4, 948 0x0d21f5f4,
927 0x5a21f507, 949 0xb221f508,
928/* 0x0a35: ctx_xfer_exec */ 950/* 0x0a8d: ctx_xfer_exec */
929 0x16019808, 951 0x16019808,
930 0x07f124bd, 952 0x07f124bd,
931 0x03f00500, 953 0x03f00500,
@@ -960,23 +982,65 @@ uint32_t nvd7_grhub_code[] = {
960 0x1301f402, 982 0x1301f402,
961 0xf40ca7f0, 983 0xf40ca7f0,
962 0xf7f0d021, 984 0xf7f0d021,
963 0x3c21f505, 985 0x9421f505,
964 0x3202f408, 986 0x3202f408,
965/* 0x0ac4: ctx_xfer_post */ 987/* 0x0b1c: ctx_xfer_post */
966 0xf502f7f0, 988 0xf502f7f0,
967 0xbd07b521, 989 0xbd080d21,
968 0x1421f5f4, 990 0x6c21f5f4,
969 0x7f21f508, 991 0x7f21f508,
970 0xc721f502, 992 0x1f21f502,
971 0xf5f4bd07, 993 0xf5f4bd08,
972 0xf407b521, 994 0xf4080d21,
973 0x01981011, 995 0x01981011,
974 0x0511fd40, 996 0x0511fd40,
975 0xf5070bf4, 997 0xf5070bf4,
976/* 0x0aef: ctx_xfer_no_post_mmio */ 998/* 0x0b47: ctx_xfer_no_post_mmio */
977 0xf5099321, 999 0xf509eb21,
978/* 0x0af3: ctx_xfer_done */ 1000/* 0x0b4b: ctx_xfer_done */
979 0xf807a421, 1001 0xf807fc21,
1002 0x00000000,
1003 0x00000000,
1004 0x00000000,
1005 0x00000000,
1006 0x00000000,
1007 0x00000000,
1008 0x00000000,
1009 0x00000000,
1010 0x00000000,
1011 0x00000000,
1012 0x00000000,
1013 0x00000000,
1014 0x00000000,
1015 0x00000000,
1016 0x00000000,
1017 0x00000000,
1018 0x00000000,
1019 0x00000000,
1020 0x00000000,
1021 0x00000000,
1022 0x00000000,
1023 0x00000000,
1024 0x00000000,
1025 0x00000000,
1026 0x00000000,
1027 0x00000000,
1028 0x00000000,
1029 0x00000000,
1030 0x00000000,
1031 0x00000000,
1032 0x00000000,
1033 0x00000000,
1034 0x00000000,
1035 0x00000000,
1036 0x00000000,
1037 0x00000000,
1038 0x00000000,
1039 0x00000000,
1040 0x00000000,
1041 0x00000000,
1042 0x00000000,
1043 0x00000000,
980 0x00000000, 1044 0x00000000,
981 0x00000000, 1045 0x00000000,
982 0x00000000, 1046 0x00000000,
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h
index 6547b3dfc7ed..51c3797d8537 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnve0.fuc.h
@@ -528,10 +528,10 @@ uint32_t nve0_grhub_code[] = {
528 0x0001d001, 528 0x0001d001,
529 0x17f104bd, 529 0x17f104bd,
530 0xf7f00100, 530 0xf7f00100,
531 0x7f21f502, 531 0xd721f502,
532 0x9121f507, 532 0xe921f507,
533 0x10f7f007, 533 0x10f7f007,
534 0x07de21f5, 534 0x083621f5,
535 0x98000e98, 535 0x98000e98,
536 0x21f5010f, 536 0x21f5010f,
537 0x14950150, 537 0x14950150,
@@ -574,9 +574,9 @@ uint32_t nve0_grhub_code[] = {
574 0xb6800040, 574 0xb6800040,
575 0x1bf40132, 575 0x1bf40132,
576 0x00f7f0be, 576 0x00f7f0be,
577 0x07de21f5, 577 0x083621f5,
578 0xf500f7f0, 578 0xf500f7f0,
579 0xf1077f21, 579 0xf107d721,
580 0xf0010007, 580 0xf0010007,
581 0x01d00203, 581 0x01d00203,
582 0xbd04bd00, 582 0xbd04bd00,
@@ -610,8 +610,8 @@ uint32_t nve0_grhub_code[] = {
610 0x09d00203, 610 0x09d00203,
611 0xf404bd00, 611 0xf404bd00,
612 0x31f40132, 612 0x31f40132,
613 0xaa21f502, 613 0x0221f502,
614 0xf094bd09, 614 0xf094bd0a,
615 0x07f10799, 615 0x07f10799,
616 0x03f01700, 616 0x03f01700,
617 0x0009d002, 617 0x0009d002,
@@ -621,7 +621,7 @@ uint32_t nve0_grhub_code[] = {
621 0x0203f00f, 621 0x0203f00f,
622 0xbd0009d0, 622 0xbd0009d0,
623 0x0131f404, 623 0x0131f404,
624 0x09aa21f5, 624 0x0a0221f5,
625 0x99f094bd, 625 0x99f094bd,
626 0x0007f106, 626 0x0007f106,
627 0x0203f017, 627 0x0203f017,
@@ -631,7 +631,7 @@ uint32_t nve0_grhub_code[] = {
631 0x12b920f9, 631 0x12b920f9,
632 0x0132f402, 632 0x0132f402,
633 0xf50232f4, 633 0xf50232f4,
634 0xfc09aa21, 634 0xfc0a0221,
635 0x0007f120, 635 0x0007f120,
636 0x0203f0c0, 636 0x0203f0c0,
637 0xbd0002d0, 637 0xbd0002d0,
@@ -640,7 +640,7 @@ uint32_t nve0_grhub_code[] = {
640 0xf41f23c8, 640 0xf41f23c8,
641 0x31f40d0b, 641 0x31f40d0b,
642 0x0232f401, 642 0x0232f401,
643 0x09aa21f5, 643 0x0a0221f5,
644/* 0x063c: chsw_done */ 644/* 0x063c: chsw_done */
645 0xf10127f0, 645 0xf10127f0,
646 0xf0c30007, 646 0xf0c30007,
@@ -654,7 +654,7 @@ uint32_t nve0_grhub_code[] = {
654/* 0x0660: main_not_ctx_switch */ 654/* 0x0660: main_not_ctx_switch */
655 0xf401e4b0, 655 0xf401e4b0,
656 0xf2b90d1b, 656 0xf2b90d1b,
657 0x4221f502, 657 0x9a21f502,
658 0x460ef409, 658 0x460ef409,
659/* 0x0670: main_not_ctx_chan */ 659/* 0x0670: main_not_ctx_chan */
660 0xf402e4b0, 660 0xf402e4b0,
@@ -664,8 +664,8 @@ uint32_t nve0_grhub_code[] = {
664 0x09d00203, 664 0x09d00203,
665 0xf404bd00, 665 0xf404bd00,
666 0x32f40132, 666 0x32f40132,
667 0xaa21f502, 667 0x0221f502,
668 0xf094bd09, 668 0xf094bd0a,
669 0x07f10799, 669 0x07f10799,
670 0x03f01700, 670 0x03f01700,
671 0x0009d002, 671 0x0009d002,
@@ -710,18 +710,40 @@ uint32_t nve0_grhub_code[] = {
710/* 0x072b: ih_no_ctxsw */ 710/* 0x072b: ih_no_ctxsw */
711 0xe40421f4, 711 0xe40421f4,
712 0xf40400ab, 712 0xf40400ab,
713 0xb7f1140b, 713 0xe7f16c0b,
714 0xe3f00708,
715 0x6821f440,
716 0xf102ffb9,
717 0xf0040007,
718 0x0fd00203,
719 0xf104bd00,
720 0xf00704e7,
721 0x21f440e3,
722 0x02ffb968,
723 0x030007f1,
724 0xd00203f0,
725 0x04bd000f,
726 0x9450fec7,
727 0xf7f102ee,
728 0xf3f00700,
729 0x00efbb40,
730 0xf16821f4,
731 0xf0020007,
732 0x0fd00203,
733 0xf004bd00,
734 0x21f503f7,
735 0xb7f1037e,
714 0xbfb90100, 736 0xbfb90100,
715 0x44e7f102, 737 0x44e7f102,
716 0x40e3f001, 738 0x40e3f001,
717/* 0x0743: ih_no_fwmthd */ 739/* 0x079b: ih_no_fwmthd */
718 0xf19d21f4, 740 0xf19d21f4,
719 0xbd0104b7, 741 0xbd0504b7,
720 0xb4abffb0, 742 0xb4abffb0,
721 0xf10f0bf4, 743 0xf10f0bf4,
722 0xf0070007, 744 0xf0070007,
723 0x0bd00303, 745 0x0bd00303,
724/* 0x075b: ih_no_other */ 746/* 0x07b3: ih_no_other */
725 0xf104bd00, 747 0xf104bd00,
726 0xf0010007, 748 0xf0010007,
727 0x0ad00003, 749 0x0ad00003,
@@ -731,19 +753,19 @@ uint32_t nve0_grhub_code[] = {
731 0xfc90fca0, 753 0xfc90fca0,
732 0x0088fe80, 754 0x0088fe80,
733 0x32f480fc, 755 0x32f480fc,
734/* 0x077f: ctx_4170s */ 756/* 0x07d7: ctx_4170s */
735 0xf001f800, 757 0xf001f800,
736 0xffb910f5, 758 0xffb910f5,
737 0x70e7f102, 759 0x70e7f102,
738 0x40e3f041, 760 0x40e3f041,
739 0xf89d21f4, 761 0xf89d21f4,
740/* 0x0791: ctx_4170w */ 762/* 0x07e9: ctx_4170w */
741 0x70e7f100, 763 0x70e7f100,
742 0x40e3f041, 764 0x40e3f041,
743 0xb96821f4, 765 0xb96821f4,
744 0xf4f002ff, 766 0xf4f002ff,
745 0xf01bf410, 767 0xf01bf410,
746/* 0x07a6: ctx_redswitch */ 768/* 0x07fe: ctx_redswitch */
747 0xe7f100f8, 769 0xe7f100f8,
748 0xe5f00200, 770 0xe5f00200,
749 0x20e5f040, 771 0x20e5f040,
@@ -751,7 +773,7 @@ uint32_t nve0_grhub_code[] = {
751 0xf0850007, 773 0xf0850007,
752 0x0ed00103, 774 0x0ed00103,
753 0xf004bd00, 775 0xf004bd00,
754/* 0x07c2: ctx_redswitch_delay */ 776/* 0x081a: ctx_redswitch_delay */
755 0xf2b608f7, 777 0xf2b608f7,
756 0xfd1bf401, 778 0xfd1bf401,
757 0x0400e5f1, 779 0x0400e5f1,
@@ -759,7 +781,7 @@ uint32_t nve0_grhub_code[] = {
759 0x850007f1, 781 0x850007f1,
760 0xd00103f0, 782 0xd00103f0,
761 0x04bd000e, 783 0x04bd000e,
762/* 0x07de: ctx_86c */ 784/* 0x0836: ctx_86c */
763 0x07f100f8, 785 0x07f100f8,
764 0x03f01b00, 786 0x03f01b00,
765 0x000fd002, 787 0x000fd002,
@@ -770,17 +792,17 @@ uint32_t nve0_grhub_code[] = {
770 0xe7f102ff, 792 0xe7f102ff,
771 0xe3f0a86c, 793 0xe3f0a86c,
772 0x9d21f441, 794 0x9d21f441,
773/* 0x0806: ctx_mem */ 795/* 0x085e: ctx_mem */
774 0x07f100f8, 796 0x07f100f8,
775 0x03f08400, 797 0x03f08400,
776 0x000fd002, 798 0x000fd002,
777/* 0x0812: ctx_mem_wait */ 799/* 0x086a: ctx_mem_wait */
778 0xf7f104bd, 800 0xf7f104bd,
779 0xf3f08400, 801 0xf3f08400,
780 0x00ffcf02, 802 0x00ffcf02,
781 0xf405fffd, 803 0xf405fffd,
782 0x00f8f31b, 804 0x00f8f31b,
783/* 0x0824: ctx_load */ 805/* 0x087c: ctx_load */
784 0x99f094bd, 806 0x99f094bd,
785 0x0007f105, 807 0x0007f105,
786 0x0203f00f, 808 0x0203f00f,
@@ -797,7 +819,7 @@ uint32_t nve0_grhub_code[] = {
797 0x0203f083, 819 0x0203f083,
798 0xbd0002d0, 820 0xbd0002d0,
799 0x07f7f004, 821 0x07f7f004,
800 0x080621f5, 822 0x085e21f5,
801 0xc00007f1, 823 0xc00007f1,
802 0xd00203f0, 824 0xd00203f0,
803 0x04bd0002, 825 0x04bd0002,
@@ -852,29 +874,29 @@ uint32_t nve0_grhub_code[] = {
852 0x170007f1, 874 0x170007f1,
853 0xd00203f0, 875 0xd00203f0,
854 0x04bd0009, 876 0x04bd0009,
855/* 0x0942: ctx_chan */ 877/* 0x099a: ctx_chan */
856 0x21f500f8, 878 0x21f500f8,
857 0xa7f00824, 879 0xa7f0087c,
858 0xd021f40c, 880 0xd021f40c,
859 0xf505f7f0, 881 0xf505f7f0,
860 0xf8080621, 882 0xf8085e21,
861/* 0x0955: ctx_mmio_exec */ 883/* 0x09ad: ctx_mmio_exec */
862 0x41039800, 884 0x41039800,
863 0x810007f1, 885 0x810007f1,
864 0xd00203f0, 886 0xd00203f0,
865 0x04bd0003, 887 0x04bd0003,
866/* 0x0966: ctx_mmio_loop */ 888/* 0x09be: ctx_mmio_loop */
867 0x34c434bd, 889 0x34c434bd,
868 0x0f1bf4ff, 890 0x0f1bf4ff,
869 0x020057f1, 891 0x020057f1,
870 0xfa0653f0, 892 0xfa0653f0,
871 0x03f80535, 893 0x03f80535,
872/* 0x0978: ctx_mmio_pull */ 894/* 0x09d0: ctx_mmio_pull */
873 0x98804e98, 895 0x98804e98,
874 0x21f4814f, 896 0x21f4814f,
875 0x0830b69d, 897 0x0830b69d,
876 0xf40112b6, 898 0xf40112b6,
877/* 0x098a: ctx_mmio_done */ 899/* 0x09e2: ctx_mmio_done */
878 0x0398df1b, 900 0x0398df1b,
879 0x0007f116, 901 0x0007f116,
880 0x0203f081, 902 0x0203f081,
@@ -883,30 +905,30 @@ uint32_t nve0_grhub_code[] = {
883 0x010017f1, 905 0x010017f1,
884 0xfa0613f0, 906 0xfa0613f0,
885 0x03f80601, 907 0x03f80601,
886/* 0x09aa: ctx_xfer */ 908/* 0x0a02: ctx_xfer */
887 0xe7f000f8, 909 0xe7f000f8,
888 0x0007f104, 910 0x0007f104,
889 0x0303f002, 911 0x0303f002,
890 0xbd000ed0, 912 0xbd000ed0,
891/* 0x09b9: ctx_xfer_idle */ 913/* 0x0a11: ctx_xfer_idle */
892 0x00e7f104, 914 0x00e7f104,
893 0x03e3f000, 915 0x03e3f000,
894 0xf100eecf, 916 0xf100eecf,
895 0xf42000e4, 917 0xf42000e4,
896 0x11f4f21b, 918 0x11f4f21b,
897 0x0d02f406, 919 0x0d02f406,
898/* 0x09d0: ctx_xfer_pre */ 920/* 0x0a28: ctx_xfer_pre */
899 0xf510f7f0, 921 0xf510f7f0,
900 0xf407de21, 922 0xf4083621,
901/* 0x09da: ctx_xfer_pre_load */ 923/* 0x0a32: ctx_xfer_pre_load */
902 0xf7f01c11, 924 0xf7f01c11,
903 0x7f21f502, 925 0xd721f502,
904 0x9121f507, 926 0xe921f507,
905 0xa621f507, 927 0xfe21f507,
906 0xf5f4bd07, 928 0xf5f4bd07,
907 0xf5077f21, 929 0xf507d721,
908/* 0x09f3: ctx_xfer_exec */ 930/* 0x0a4b: ctx_xfer_exec */
909 0x98082421, 931 0x98087c21,
910 0x24bd1601, 932 0x24bd1601,
911 0x050007f1, 933 0x050007f1,
912 0xd00103f0, 934 0xd00103f0,
@@ -941,21 +963,21 @@ uint32_t nve0_grhub_code[] = {
941 0xa7f01301, 963 0xa7f01301,
942 0xd021f40c, 964 0xd021f40c,
943 0xf505f7f0, 965 0xf505f7f0,
944 0xf4080621, 966 0xf4085e21,
945/* 0x0a82: ctx_xfer_post */ 967/* 0x0ada: ctx_xfer_post */
946 0xf7f02e02, 968 0xf7f02e02,
947 0x7f21f502, 969 0xd721f502,
948 0xf5f4bd07, 970 0xf5f4bd07,
949 0xf507de21, 971 0xf5083621,
950 0xf5027f21, 972 0xf5027f21,
951 0xbd079121, 973 0xbd07e921,
952 0x7f21f5f4, 974 0xd721f5f4,
953 0x1011f407, 975 0x1011f407,
954 0xfd400198, 976 0xfd400198,
955 0x0bf40511, 977 0x0bf40511,
956 0x5521f507, 978 0xad21f507,
957/* 0x0aad: ctx_xfer_no_post_mmio */ 979/* 0x0b05: ctx_xfer_no_post_mmio */
958/* 0x0aad: ctx_xfer_done */ 980/* 0x0b05: ctx_xfer_done */
959 0x0000f809, 981 0x0000f809,
960 0x00000000, 982 0x00000000,
961 0x00000000, 983 0x00000000,
@@ -977,4 +999,46 @@ uint32_t nve0_grhub_code[] = {
977 0x00000000, 999 0x00000000,
978 0x00000000, 1000 0x00000000,
979 0x00000000, 1001 0x00000000,
1002 0x00000000,
1003 0x00000000,
1004 0x00000000,
1005 0x00000000,
1006 0x00000000,
1007 0x00000000,
1008 0x00000000,
1009 0x00000000,
1010 0x00000000,
1011 0x00000000,
1012 0x00000000,
1013 0x00000000,
1014 0x00000000,
1015 0x00000000,
1016 0x00000000,
1017 0x00000000,
1018 0x00000000,
1019 0x00000000,
1020 0x00000000,
1021 0x00000000,
1022 0x00000000,
1023 0x00000000,
1024 0x00000000,
1025 0x00000000,
1026 0x00000000,
1027 0x00000000,
1028 0x00000000,
1029 0x00000000,
1030 0x00000000,
1031 0x00000000,
1032 0x00000000,
1033 0x00000000,
1034 0x00000000,
1035 0x00000000,
1036 0x00000000,
1037 0x00000000,
1038 0x00000000,
1039 0x00000000,
1040 0x00000000,
1041 0x00000000,
1042 0x00000000,
1043 0x00000000,
980}; 1044};
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvf0.fuc.h b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvf0.fuc.h
index a5aee5a4302f..a0af4b703a8e 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvf0.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/hubnvf0.fuc.h
@@ -528,10 +528,10 @@ uint32_t nvf0_grhub_code[] = {
528 0x0001d001, 528 0x0001d001,
529 0x17f104bd, 529 0x17f104bd,
530 0xf7f00100, 530 0xf7f00100,
531 0x7f21f502, 531 0xd721f502,
532 0x9121f507, 532 0xe921f507,
533 0x10f7f007, 533 0x10f7f007,
534 0x07de21f5, 534 0x083621f5,
535 0x98000e98, 535 0x98000e98,
536 0x21f5010f, 536 0x21f5010f,
537 0x14950150, 537 0x14950150,
@@ -574,9 +574,9 @@ uint32_t nvf0_grhub_code[] = {
574 0xb6800040, 574 0xb6800040,
575 0x1bf40132, 575 0x1bf40132,
576 0x00f7f0be, 576 0x00f7f0be,
577 0x07de21f5, 577 0x083621f5,
578 0xf500f7f0, 578 0xf500f7f0,
579 0xf1077f21, 579 0xf107d721,
580 0xf0010007, 580 0xf0010007,
581 0x01d00203, 581 0x01d00203,
582 0xbd04bd00, 582 0xbd04bd00,
@@ -610,8 +610,8 @@ uint32_t nvf0_grhub_code[] = {
610 0x09d00203, 610 0x09d00203,
611 0xf404bd00, 611 0xf404bd00,
612 0x31f40132, 612 0x31f40132,
613 0xaa21f502, 613 0x0221f502,
614 0xf094bd09, 614 0xf094bd0a,
615 0x07f10799, 615 0x07f10799,
616 0x03f01700, 616 0x03f01700,
617 0x0009d002, 617 0x0009d002,
@@ -621,7 +621,7 @@ uint32_t nvf0_grhub_code[] = {
621 0x0203f037, 621 0x0203f037,
622 0xbd0009d0, 622 0xbd0009d0,
623 0x0131f404, 623 0x0131f404,
624 0x09aa21f5, 624 0x0a0221f5,
625 0x99f094bd, 625 0x99f094bd,
626 0x0007f106, 626 0x0007f106,
627 0x0203f017, 627 0x0203f017,
@@ -631,7 +631,7 @@ uint32_t nvf0_grhub_code[] = {
631 0x12b920f9, 631 0x12b920f9,
632 0x0132f402, 632 0x0132f402,
633 0xf50232f4, 633 0xf50232f4,
634 0xfc09aa21, 634 0xfc0a0221,
635 0x0007f120, 635 0x0007f120,
636 0x0203f0c0, 636 0x0203f0c0,
637 0xbd0002d0, 637 0xbd0002d0,
@@ -640,7 +640,7 @@ uint32_t nvf0_grhub_code[] = {
640 0xf41f23c8, 640 0xf41f23c8,
641 0x31f40d0b, 641 0x31f40d0b,
642 0x0232f401, 642 0x0232f401,
643 0x09aa21f5, 643 0x0a0221f5,
644/* 0x063c: chsw_done */ 644/* 0x063c: chsw_done */
645 0xf10127f0, 645 0xf10127f0,
646 0xf0c30007, 646 0xf0c30007,
@@ -654,7 +654,7 @@ uint32_t nvf0_grhub_code[] = {
654/* 0x0660: main_not_ctx_switch */ 654/* 0x0660: main_not_ctx_switch */
655 0xf401e4b0, 655 0xf401e4b0,
656 0xf2b90d1b, 656 0xf2b90d1b,
657 0x4221f502, 657 0x9a21f502,
658 0x460ef409, 658 0x460ef409,
659/* 0x0670: main_not_ctx_chan */ 659/* 0x0670: main_not_ctx_chan */
660 0xf402e4b0, 660 0xf402e4b0,
@@ -664,8 +664,8 @@ uint32_t nvf0_grhub_code[] = {
664 0x09d00203, 664 0x09d00203,
665 0xf404bd00, 665 0xf404bd00,
666 0x32f40132, 666 0x32f40132,
667 0xaa21f502, 667 0x0221f502,
668 0xf094bd09, 668 0xf094bd0a,
669 0x07f10799, 669 0x07f10799,
670 0x03f01700, 670 0x03f01700,
671 0x0009d002, 671 0x0009d002,
@@ -710,18 +710,40 @@ uint32_t nvf0_grhub_code[] = {
710/* 0x072b: ih_no_ctxsw */ 710/* 0x072b: ih_no_ctxsw */
711 0xe40421f4, 711 0xe40421f4,
712 0xf40400ab, 712 0xf40400ab,
713 0xb7f1140b, 713 0xe7f16c0b,
714 0xe3f00708,
715 0x6821f440,
716 0xf102ffb9,
717 0xf0040007,
718 0x0fd00203,
719 0xf104bd00,
720 0xf00704e7,
721 0x21f440e3,
722 0x02ffb968,
723 0x030007f1,
724 0xd00203f0,
725 0x04bd000f,
726 0x9450fec7,
727 0xf7f102ee,
728 0xf3f00700,
729 0x00efbb40,
730 0xf16821f4,
731 0xf0020007,
732 0x0fd00203,
733 0xf004bd00,
734 0x21f503f7,
735 0xb7f1037e,
714 0xbfb90100, 736 0xbfb90100,
715 0x44e7f102, 737 0x44e7f102,
716 0x40e3f001, 738 0x40e3f001,
717/* 0x0743: ih_no_fwmthd */ 739/* 0x079b: ih_no_fwmthd */
718 0xf19d21f4, 740 0xf19d21f4,
719 0xbd0104b7, 741 0xbd0504b7,
720 0xb4abffb0, 742 0xb4abffb0,
721 0xf10f0bf4, 743 0xf10f0bf4,
722 0xf0070007, 744 0xf0070007,
723 0x0bd00303, 745 0x0bd00303,
724/* 0x075b: ih_no_other */ 746/* 0x07b3: ih_no_other */
725 0xf104bd00, 747 0xf104bd00,
726 0xf0010007, 748 0xf0010007,
727 0x0ad00003, 749 0x0ad00003,
@@ -731,19 +753,19 @@ uint32_t nvf0_grhub_code[] = {
731 0xfc90fca0, 753 0xfc90fca0,
732 0x0088fe80, 754 0x0088fe80,
733 0x32f480fc, 755 0x32f480fc,
734/* 0x077f: ctx_4170s */ 756/* 0x07d7: ctx_4170s */
735 0xf001f800, 757 0xf001f800,
736 0xffb910f5, 758 0xffb910f5,
737 0x70e7f102, 759 0x70e7f102,
738 0x40e3f041, 760 0x40e3f041,
739 0xf89d21f4, 761 0xf89d21f4,
740/* 0x0791: ctx_4170w */ 762/* 0x07e9: ctx_4170w */
741 0x70e7f100, 763 0x70e7f100,
742 0x40e3f041, 764 0x40e3f041,
743 0xb96821f4, 765 0xb96821f4,
744 0xf4f002ff, 766 0xf4f002ff,
745 0xf01bf410, 767 0xf01bf410,
746/* 0x07a6: ctx_redswitch */ 768/* 0x07fe: ctx_redswitch */
747 0xe7f100f8, 769 0xe7f100f8,
748 0xe5f00200, 770 0xe5f00200,
749 0x20e5f040, 771 0x20e5f040,
@@ -751,7 +773,7 @@ uint32_t nvf0_grhub_code[] = {
751 0xf0850007, 773 0xf0850007,
752 0x0ed00103, 774 0x0ed00103,
753 0xf004bd00, 775 0xf004bd00,
754/* 0x07c2: ctx_redswitch_delay */ 776/* 0x081a: ctx_redswitch_delay */
755 0xf2b608f7, 777 0xf2b608f7,
756 0xfd1bf401, 778 0xfd1bf401,
757 0x0400e5f1, 779 0x0400e5f1,
@@ -759,7 +781,7 @@ uint32_t nvf0_grhub_code[] = {
759 0x850007f1, 781 0x850007f1,
760 0xd00103f0, 782 0xd00103f0,
761 0x04bd000e, 783 0x04bd000e,
762/* 0x07de: ctx_86c */ 784/* 0x0836: ctx_86c */
763 0x07f100f8, 785 0x07f100f8,
764 0x03f02300, 786 0x03f02300,
765 0x000fd002, 787 0x000fd002,
@@ -770,17 +792,17 @@ uint32_t nvf0_grhub_code[] = {
770 0xe7f102ff, 792 0xe7f102ff,
771 0xe3f0a88c, 793 0xe3f0a88c,
772 0x9d21f441, 794 0x9d21f441,
773/* 0x0806: ctx_mem */ 795/* 0x085e: ctx_mem */
774 0x07f100f8, 796 0x07f100f8,
775 0x03f08400, 797 0x03f08400,
776 0x000fd002, 798 0x000fd002,
777/* 0x0812: ctx_mem_wait */ 799/* 0x086a: ctx_mem_wait */
778 0xf7f104bd, 800 0xf7f104bd,
779 0xf3f08400, 801 0xf3f08400,
780 0x00ffcf02, 802 0x00ffcf02,
781 0xf405fffd, 803 0xf405fffd,
782 0x00f8f31b, 804 0x00f8f31b,
783/* 0x0824: ctx_load */ 805/* 0x087c: ctx_load */
784 0x99f094bd, 806 0x99f094bd,
785 0x0007f105, 807 0x0007f105,
786 0x0203f037, 808 0x0203f037,
@@ -797,7 +819,7 @@ uint32_t nvf0_grhub_code[] = {
797 0x0203f083, 819 0x0203f083,
798 0xbd0002d0, 820 0xbd0002d0,
799 0x07f7f004, 821 0x07f7f004,
800 0x080621f5, 822 0x085e21f5,
801 0xc00007f1, 823 0xc00007f1,
802 0xd00203f0, 824 0xd00203f0,
803 0x04bd0002, 825 0x04bd0002,
@@ -852,29 +874,29 @@ uint32_t nvf0_grhub_code[] = {
852 0x170007f1, 874 0x170007f1,
853 0xd00203f0, 875 0xd00203f0,
854 0x04bd0009, 876 0x04bd0009,
855/* 0x0942: ctx_chan */ 877/* 0x099a: ctx_chan */
856 0x21f500f8, 878 0x21f500f8,
857 0xa7f00824, 879 0xa7f0087c,
858 0xd021f40c, 880 0xd021f40c,
859 0xf505f7f0, 881 0xf505f7f0,
860 0xf8080621, 882 0xf8085e21,
861/* 0x0955: ctx_mmio_exec */ 883/* 0x09ad: ctx_mmio_exec */
862 0x41039800, 884 0x41039800,
863 0x810007f1, 885 0x810007f1,
864 0xd00203f0, 886 0xd00203f0,
865 0x04bd0003, 887 0x04bd0003,
866/* 0x0966: ctx_mmio_loop */ 888/* 0x09be: ctx_mmio_loop */
867 0x34c434bd, 889 0x34c434bd,
868 0x0f1bf4ff, 890 0x0f1bf4ff,
869 0x020057f1, 891 0x020057f1,
870 0xfa0653f0, 892 0xfa0653f0,
871 0x03f80535, 893 0x03f80535,
872/* 0x0978: ctx_mmio_pull */ 894/* 0x09d0: ctx_mmio_pull */
873 0x98804e98, 895 0x98804e98,
874 0x21f4814f, 896 0x21f4814f,
875 0x0830b69d, 897 0x0830b69d,
876 0xf40112b6, 898 0xf40112b6,
877/* 0x098a: ctx_mmio_done */ 899/* 0x09e2: ctx_mmio_done */
878 0x0398df1b, 900 0x0398df1b,
879 0x0007f116, 901 0x0007f116,
880 0x0203f081, 902 0x0203f081,
@@ -883,30 +905,30 @@ uint32_t nvf0_grhub_code[] = {
883 0x010017f1, 905 0x010017f1,
884 0xfa0613f0, 906 0xfa0613f0,
885 0x03f80601, 907 0x03f80601,
886/* 0x09aa: ctx_xfer */ 908/* 0x0a02: ctx_xfer */
887 0xe7f000f8, 909 0xe7f000f8,
888 0x0007f104, 910 0x0007f104,
889 0x0303f002, 911 0x0303f002,
890 0xbd000ed0, 912 0xbd000ed0,
891/* 0x09b9: ctx_xfer_idle */ 913/* 0x0a11: ctx_xfer_idle */
892 0x00e7f104, 914 0x00e7f104,
893 0x03e3f000, 915 0x03e3f000,
894 0xf100eecf, 916 0xf100eecf,
895 0xf42000e4, 917 0xf42000e4,
896 0x11f4f21b, 918 0x11f4f21b,
897 0x0d02f406, 919 0x0d02f406,
898/* 0x09d0: ctx_xfer_pre */ 920/* 0x0a28: ctx_xfer_pre */
899 0xf510f7f0, 921 0xf510f7f0,
900 0xf407de21, 922 0xf4083621,
901/* 0x09da: ctx_xfer_pre_load */ 923/* 0x0a32: ctx_xfer_pre_load */
902 0xf7f01c11, 924 0xf7f01c11,
903 0x7f21f502, 925 0xd721f502,
904 0x9121f507, 926 0xe921f507,
905 0xa621f507, 927 0xfe21f507,
906 0xf5f4bd07, 928 0xf5f4bd07,
907 0xf5077f21, 929 0xf507d721,
908/* 0x09f3: ctx_xfer_exec */ 930/* 0x0a4b: ctx_xfer_exec */
909 0x98082421, 931 0x98087c21,
910 0x24bd1601, 932 0x24bd1601,
911 0x050007f1, 933 0x050007f1,
912 0xd00103f0, 934 0xd00103f0,
@@ -941,21 +963,21 @@ uint32_t nvf0_grhub_code[] = {
941 0xa7f01301, 963 0xa7f01301,
942 0xd021f40c, 964 0xd021f40c,
943 0xf505f7f0, 965 0xf505f7f0,
944 0xf4080621, 966 0xf4085e21,
945/* 0x0a82: ctx_xfer_post */ 967/* 0x0ada: ctx_xfer_post */
946 0xf7f02e02, 968 0xf7f02e02,
947 0x7f21f502, 969 0xd721f502,
948 0xf5f4bd07, 970 0xf5f4bd07,
949 0xf507de21, 971 0xf5083621,
950 0xf5027f21, 972 0xf5027f21,
951 0xbd079121, 973 0xbd07e921,
952 0x7f21f5f4, 974 0xd721f5f4,
953 0x1011f407, 975 0x1011f407,
954 0xfd400198, 976 0xfd400198,
955 0x0bf40511, 977 0x0bf40511,
956 0x5521f507, 978 0xad21f507,
957/* 0x0aad: ctx_xfer_no_post_mmio */ 979/* 0x0b05: ctx_xfer_no_post_mmio */
958/* 0x0aad: ctx_xfer_done */ 980/* 0x0b05: ctx_xfer_done */
959 0x0000f809, 981 0x0000f809,
960 0x00000000, 982 0x00000000,
961 0x00000000, 983 0x00000000,
@@ -977,4 +999,46 @@ uint32_t nvf0_grhub_code[] = {
977 0x00000000, 999 0x00000000,
978 0x00000000, 1000 0x00000000,
979 0x00000000, 1001 0x00000000,
1002 0x00000000,
1003 0x00000000,
1004 0x00000000,
1005 0x00000000,
1006 0x00000000,
1007 0x00000000,
1008 0x00000000,
1009 0x00000000,
1010 0x00000000,
1011 0x00000000,
1012 0x00000000,
1013 0x00000000,
1014 0x00000000,
1015 0x00000000,
1016 0x00000000,
1017 0x00000000,
1018 0x00000000,
1019 0x00000000,
1020 0x00000000,
1021 0x00000000,
1022 0x00000000,
1023 0x00000000,
1024 0x00000000,
1025 0x00000000,
1026 0x00000000,
1027 0x00000000,
1028 0x00000000,
1029 0x00000000,
1030 0x00000000,
1031 0x00000000,
1032 0x00000000,
1033 0x00000000,
1034 0x00000000,
1035 0x00000000,
1036 0x00000000,
1037 0x00000000,
1038 0x00000000,
1039 0x00000000,
1040 0x00000000,
1041 0x00000000,
1042 0x00000000,
1043 0x00000000,
980}; 1044};
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/macros.fuc b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/macros.fuc
index a47d49db5232..2a0b0f844299 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/macros.fuc
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/macros.fuc
@@ -30,6 +30,12 @@
30#define GK110 0xf0 30#define GK110 0xf0
31#define GK208 0x108 31#define GK208 0x108
32 32
33#define NV_PGRAPH_TRAPPED_ADDR 0x400704
34#define NV_PGRAPH_TRAPPED_DATA_LO 0x400708
35#define NV_PGRAPH_TRAPPED_DATA_HI 0x40070c
36
37#define NV_PGRAPH_FE_OBJECT_TABLE(n) ((n) * 4 + 0x400700)
38
33#define NV_PGRAPH_FECS_INTR_ACK 0x409004 39#define NV_PGRAPH_FECS_INTR_ACK 0x409004
34#define NV_PGRAPH_FECS_INTR 0x409008 40#define NV_PGRAPH_FECS_INTR 0x409008
35#define NV_PGRAPH_FECS_INTR_FWMTHD 0x00000400 41#define NV_PGRAPH_FECS_INTR_FWMTHD 0x00000400
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/os.h b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/os.h
index fd1d380de094..1718ae4e8224 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/fuc/os.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/fuc/os.h
@@ -3,5 +3,6 @@
3 3
4#define E_BAD_COMMAND 0x00000001 4#define E_BAD_COMMAND 0x00000001
5#define E_CMD_OVERFLOW 0x00000002 5#define E_CMD_OVERFLOW 0x00000002
6#define E_BAD_FWMTHD 0x00000003
6 7
7#endif 8#endif
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nv50.c b/drivers/gpu/drm/nouveau/core/engine/graph/nv50.c
index 1a2d56493cf6..20665c21d80e 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nv50.c
@@ -976,7 +976,6 @@ nv50_graph_init(struct nouveau_object *object)
976 break; 976 break;
977 case 0xa0: 977 case 0xa0:
978 default: 978 default:
979 nv_wr32(priv, 0x402cc0, 0x00000000);
980 if (nv_device(priv)->chipset == 0xa0 || 979 if (nv_device(priv)->chipset == 0xa0 ||
981 nv_device(priv)->chipset == 0xaa || 980 nv_device(priv)->chipset == 0xaa ||
982 nv_device(priv)->chipset == 0xac) { 981 nv_device(priv)->chipset == 0xac) {
@@ -991,10 +990,10 @@ nv50_graph_init(struct nouveau_object *object)
991 990
992 /* zero out zcull regions */ 991 /* zero out zcull regions */
993 for (i = 0; i < 8; i++) { 992 for (i = 0; i < 8; i++) {
994 nv_wr32(priv, 0x402c20 + (i * 8), 0x00000000); 993 nv_wr32(priv, 0x402c20 + (i * 0x10), 0x00000000);
995 nv_wr32(priv, 0x402c24 + (i * 8), 0x00000000); 994 nv_wr32(priv, 0x402c24 + (i * 0x10), 0x00000000);
996 nv_wr32(priv, 0x402c28 + (i * 8), 0x00000000); 995 nv_wr32(priv, 0x402c28 + (i * 0x10), 0x00000000);
997 nv_wr32(priv, 0x402c2c + (i * 8), 0x00000000); 996 nv_wr32(priv, 0x402c2c + (i * 0x10), 0x00000000);
998 } 997 }
999 return 0; 998 return 0;
1000} 999}
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
index bf7bdb1f291e..aa0838916354 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
@@ -789,17 +789,40 @@ nvc0_graph_ctxctl_debug(struct nvc0_graph_priv *priv)
789static void 789static void
790nvc0_graph_ctxctl_isr(struct nvc0_graph_priv *priv) 790nvc0_graph_ctxctl_isr(struct nvc0_graph_priv *priv)
791{ 791{
792 u32 ustat = nv_rd32(priv, 0x409c18); 792 u32 stat = nv_rd32(priv, 0x409c18);
793 793
794 if (ustat & 0x00000001) 794 if (stat & 0x00000001) {
795 nv_error(priv, "CTXCTL ucode error\n"); 795 u32 code = nv_rd32(priv, 0x409814);
796 if (ustat & 0x00080000) 796 if (code == E_BAD_FWMTHD) {
797 nv_error(priv, "CTXCTL watchdog timeout\n"); 797 u32 class = nv_rd32(priv, 0x409808);
798 if (ustat & ~0x00080001) 798 u32 addr = nv_rd32(priv, 0x40980c);
799 nv_error(priv, "CTXCTL 0x%08x\n", ustat); 799 u32 subc = (addr & 0x00070000) >> 16;
800 u32 mthd = (addr & 0x00003ffc);
801 u32 data = nv_rd32(priv, 0x409810);
802
803 nv_error(priv, "FECS MTHD subc %d class 0x%04x "
804 "mthd 0x%04x data 0x%08x\n",
805 subc, class, mthd, data);
800 806
801 nvc0_graph_ctxctl_debug(priv); 807 nv_wr32(priv, 0x409c20, 0x00000001);
802 nv_wr32(priv, 0x409c20, ustat); 808 stat &= ~0x00000001;
809 } else {
810 nv_error(priv, "FECS ucode error %d\n", code);
811 }
812 }
813
814 if (stat & 0x00080000) {
815 nv_error(priv, "FECS watchdog timeout\n");
816 nvc0_graph_ctxctl_debug(priv);
817 nv_wr32(priv, 0x409c20, 0x00080000);
818 stat &= ~0x00080000;
819 }
820
821 if (stat) {
822 nv_error(priv, "FECS 0x%08x\n", stat);
823 nvc0_graph_ctxctl_debug(priv);
824 nv_wr32(priv, 0x409c20, stat);
825 }
803} 826}
804 827
805static void 828static void
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h
index 75203a99d902..ffc289198dd8 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h
@@ -38,6 +38,8 @@
38#include <engine/fifo.h> 38#include <engine/fifo.h>
39#include <engine/graph.h> 39#include <engine/graph.h>
40 40
41#include "fuc/os.h"
42
41#define GPC_MAX 32 43#define GPC_MAX 32
42#define TPC_MAX (GPC_MAX * 8) 44#define TPC_MAX (GPC_MAX * 8)
43 45
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h b/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
index db1b39d08013..825f7bb46b67 100644
--- a/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
+++ b/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
@@ -84,6 +84,7 @@ extern struct nouveau_oclass *nv4e_i2c_oclass;
84extern struct nouveau_oclass *nv50_i2c_oclass; 84extern struct nouveau_oclass *nv50_i2c_oclass;
85extern struct nouveau_oclass *nv94_i2c_oclass; 85extern struct nouveau_oclass *nv94_i2c_oclass;
86extern struct nouveau_oclass *nvd0_i2c_oclass; 86extern struct nouveau_oclass *nvd0_i2c_oclass;
87extern struct nouveau_oclass *gf117_i2c_oclass;
87extern struct nouveau_oclass *nve0_i2c_oclass; 88extern struct nouveau_oclass *nve0_i2c_oclass;
88 89
89static inline int 90static inline int
diff --git a/drivers/gpu/drm/nouveau/core/subdev/clock/nve0.c b/drivers/gpu/drm/nouveau/core/subdev/clock/nve0.c
index 4ac1aa30ea11..0e62a3240144 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/clock/nve0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/clock/nve0.c
@@ -307,7 +307,6 @@ calc_clk(struct nve0_clock_priv *priv,
307 info->dsrc = src0; 307 info->dsrc = src0;
308 if (div0) { 308 if (div0) {
309 info->ddiv |= 0x80000000; 309 info->ddiv |= 0x80000000;
310 info->ddiv |= div0 << 8;
311 info->ddiv |= div0; 310 info->ddiv |= div0;
312 } 311 }
313 if (div1D) { 312 if (div1D) {
@@ -352,7 +351,7 @@ nve0_clock_prog_0(struct nve0_clock_priv *priv, int clk)
352{ 351{
353 struct nve0_clock_info *info = &priv->eng[clk]; 352 struct nve0_clock_info *info = &priv->eng[clk];
354 if (!info->ssel) { 353 if (!info->ssel) {
355 nv_mask(priv, 0x1371d0 + (clk * 0x04), 0x80003f3f, info->ddiv); 354 nv_mask(priv, 0x1371d0 + (clk * 0x04), 0x8000003f, info->ddiv);
356 nv_wr32(priv, 0x137160 + (clk * 0x04), info->dsrc); 355 nv_wr32(priv, 0x137160 + (clk * 0x04), info->dsrc);
357 } 356 }
358} 357}
@@ -389,7 +388,10 @@ static void
389nve0_clock_prog_3(struct nve0_clock_priv *priv, int clk) 388nve0_clock_prog_3(struct nve0_clock_priv *priv, int clk)
390{ 389{
391 struct nve0_clock_info *info = &priv->eng[clk]; 390 struct nve0_clock_info *info = &priv->eng[clk];
392 nv_mask(priv, 0x137250 + (clk * 0x04), 0x00003f3f, info->mdiv); 391 if (info->ssel)
392 nv_mask(priv, 0x137250 + (clk * 0x04), 0x00003f00, info->mdiv);
393 else
394 nv_mask(priv, 0x137250 + (clk * 0x04), 0x0000003f, info->mdiv);
393} 395}
394 396
395static void 397static void
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h b/drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h
index 0f57fcfe0bbf..2af9cfd2c60f 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h
+++ b/drivers/gpu/drm/nouveau/core/subdev/fb/ramfuc.h
@@ -26,7 +26,7 @@ ramfuc_reg2(u32 addr1, u32 addr2)
26 }; 26 };
27} 27}
28 28
29static inline struct ramfuc_reg 29static noinline struct ramfuc_reg
30ramfuc_reg(u32 addr) 30ramfuc_reg(u32 addr)
31{ 31{
32 return ramfuc_reg2(addr, addr); 32 return ramfuc_reg2(addr, addr);
@@ -107,7 +107,7 @@ ramfuc_nsec(struct ramfuc *ram, u32 nsec)
107 107
108#define ram_init(s,p) ramfuc_init(&(s)->base, (p)) 108#define ram_init(s,p) ramfuc_init(&(s)->base, (p))
109#define ram_exec(s,e) ramfuc_exec(&(s)->base, (e)) 109#define ram_exec(s,e) ramfuc_exec(&(s)->base, (e))
110#define ram_have(s,r) ((s)->r_##r.addr != 0x000000) 110#define ram_have(s,r) ((s)->r_##r.addr[0] != 0x000000)
111#define ram_rd32(s,r) ramfuc_rd32(&(s)->base, &(s)->r_##r) 111#define ram_rd32(s,r) ramfuc_rd32(&(s)->base, &(s)->r_##r)
112#define ram_wr32(s,r,d) ramfuc_wr32(&(s)->base, &(s)->r_##r, (d)) 112#define ram_wr32(s,r,d) ramfuc_wr32(&(s)->base, &(s)->r_##r, (d))
113#define ram_nuke(s,r) ramfuc_nuke(&(s)->base, &(s)->r_##r) 113#define ram_nuke(s,r) ramfuc_nuke(&(s)->base, &(s)->r_##r)
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c
index 84c7efbc4f38..c5b46e302319 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnve0.c
@@ -200,6 +200,7 @@ r1373f4_init(struct nve0_ramfuc *fuc)
200 /* (re)program mempll, if required */ 200 /* (re)program mempll, if required */
201 if (ram->mode == 2) { 201 if (ram->mode == 2) {
202 ram_mask(fuc, 0x1373f4, 0x00010000, 0x00000000); 202 ram_mask(fuc, 0x1373f4, 0x00010000, 0x00000000);
203 ram_mask(fuc, 0x132000, 0x80000000, 0x80000000);
203 ram_mask(fuc, 0x132000, 0x00000001, 0x00000000); 204 ram_mask(fuc, 0x132000, 0x00000001, 0x00000000);
204 ram_mask(fuc, 0x132004, 0x103fffff, mcoef); 205 ram_mask(fuc, 0x132004, 0x103fffff, mcoef);
205 ram_mask(fuc, 0x132000, 0x00000001, 0x00000001); 206 ram_mask(fuc, 0x132000, 0x00000001, 0x00000001);
@@ -262,8 +263,8 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
262 struct nve0_ram *ram = (void *)pfb->ram; 263 struct nve0_ram *ram = (void *)pfb->ram;
263 struct nve0_ramfuc *fuc = &ram->fuc; 264 struct nve0_ramfuc *fuc = &ram->fuc;
264 struct nouveau_ram_data *next = ram->base.next; 265 struct nouveau_ram_data *next = ram->base.next;
265 int vc = !(next->bios.ramcfg_11_02_08); 266 int vc = !next->bios.ramcfg_11_02_08;
266 int mv = !(next->bios.ramcfg_11_02_04); 267 int mv = !next->bios.ramcfg_11_02_04;
267 u32 mask, data; 268 u32 mask, data;
268 269
269 ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); 270 ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000);
@@ -370,8 +371,8 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
370 } 371 }
371 } 372 }
372 373
373 if ( (next->bios.ramcfg_11_02_40) || 374 if (next->bios.ramcfg_11_02_40 ||
374 (next->bios.ramcfg_11_07_10)) { 375 next->bios.ramcfg_11_07_10) {
375 ram_mask(fuc, 0x132040, 0x00010000, 0x00010000); 376 ram_mask(fuc, 0x132040, 0x00010000, 0x00010000);
376 ram_nsec(fuc, 20000); 377 ram_nsec(fuc, 20000);
377 } 378 }
@@ -417,7 +418,7 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
417 ram_mask(fuc, 0x10f694, 0xff00ff00, data); 418 ram_mask(fuc, 0x10f694, 0xff00ff00, data);
418 } 419 }
419 420
420 if (ram->mode == 2 && (next->bios.ramcfg_11_08_10)) 421 if (ram->mode == 2 && next->bios.ramcfg_11_08_10)
421 data = 0x00000080; 422 data = 0x00000080;
422 else 423 else
423 data = 0x00000000; 424 data = 0x00000000;
@@ -425,13 +426,13 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
425 426
426 mask = 0x00070000; 427 mask = 0x00070000;
427 data = 0x00000000; 428 data = 0x00000000;
428 if (!(next->bios.ramcfg_11_02_80)) 429 if (!next->bios.ramcfg_11_02_80)
429 data |= 0x03000000; 430 data |= 0x03000000;
430 if (!(next->bios.ramcfg_11_02_40)) 431 if (!next->bios.ramcfg_11_02_40)
431 data |= 0x00002000; 432 data |= 0x00002000;
432 if (!(next->bios.ramcfg_11_07_10)) 433 if (!next->bios.ramcfg_11_07_10)
433 data |= 0x00004000; 434 data |= 0x00004000;
434 if (!(next->bios.ramcfg_11_07_08)) 435 if (!next->bios.ramcfg_11_07_08)
435 data |= 0x00000003; 436 data |= 0x00000003;
436 else 437 else
437 data |= 0x74000000; 438 data |= 0x74000000;
@@ -486,7 +487,7 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
486 487
487 data = mask = 0x00000000; 488 data = mask = 0x00000000;
488 if (NOTE00(ramcfg_02_03 != 0)) { 489 if (NOTE00(ramcfg_02_03 != 0)) {
489 data |= (next->bios.ramcfg_11_02_03) << 8; 490 data |= next->bios.ramcfg_11_02_03 << 8;
490 mask |= 0x00000300; 491 mask |= 0x00000300;
491 } 492 }
492 if (NOTE00(ramcfg_01_10)) { 493 if (NOTE00(ramcfg_01_10)) {
@@ -498,7 +499,7 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
498 499
499 data = mask = 0x00000000; 500 data = mask = 0x00000000;
500 if (NOTE00(timing_30_07 != 0)) { 501 if (NOTE00(timing_30_07 != 0)) {
501 data |= (next->bios.timing_20_30_07) << 28; 502 data |= next->bios.timing_20_30_07 << 28;
502 mask |= 0x70000000; 503 mask |= 0x70000000;
503 } 504 }
504 if (NOTE00(ramcfg_01_01)) { 505 if (NOTE00(ramcfg_01_01)) {
@@ -510,7 +511,7 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
510 511
511 data = mask = 0x00000000; 512 data = mask = 0x00000000;
512 if (NOTE00(timing_30_07 != 0)) { 513 if (NOTE00(timing_30_07 != 0)) {
513 data |= (next->bios.timing_20_30_07) << 28; 514 data |= next->bios.timing_20_30_07 << 28;
514 mask |= 0x70000000; 515 mask |= 0x70000000;
515 } 516 }
516 if (NOTE00(ramcfg_01_02)) { 517 if (NOTE00(ramcfg_01_02)) {
@@ -522,16 +523,16 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
522 523
523 mask = 0x33f00000; 524 mask = 0x33f00000;
524 data = 0x00000000; 525 data = 0x00000000;
525 if (!(next->bios.ramcfg_11_01_04)) 526 if (!next->bios.ramcfg_11_01_04)
526 data |= 0x20200000; 527 data |= 0x20200000;
527 if (!(next->bios.ramcfg_11_07_80)) 528 if (!next->bios.ramcfg_11_07_80)
528 data |= 0x12800000; 529 data |= 0x12800000;
529 /*XXX: see note above about there probably being some condition 530 /*XXX: see note above about there probably being some condition
530 * for the 10f824 stuff that uses ramcfg 3... 531 * for the 10f824 stuff that uses ramcfg 3...
531 */ 532 */
532 if ( (next->bios.ramcfg_11_03_f0)) { 533 if (next->bios.ramcfg_11_03_f0) {
533 if (next->bios.rammap_11_08_0c) { 534 if (next->bios.rammap_11_08_0c) {
534 if (!(next->bios.ramcfg_11_07_80)) 535 if (!next->bios.ramcfg_11_07_80)
535 mask |= 0x00000020; 536 mask |= 0x00000020;
536 else 537 else
537 data |= 0x00000020; 538 data |= 0x00000020;
@@ -563,7 +564,7 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
563 ram_wait(fuc, 0x100710, 0x80000000, 0x80000000, 200000); 564 ram_wait(fuc, 0x100710, 0x80000000, 0x80000000, 200000);
564 } 565 }
565 566
566 data = (next->bios.timing_20_30_07) << 8; 567 data = next->bios.timing_20_30_07 << 8;
567 if (next->bios.ramcfg_11_01_01) 568 if (next->bios.ramcfg_11_01_01)
568 data |= 0x80000000; 569 data |= 0x80000000;
569 ram_mask(fuc, 0x100778, 0x00000700, data); 570 ram_mask(fuc, 0x100778, 0x00000700, data);
@@ -588,7 +589,7 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
588 ram_wr32(fuc, 0x10f310, 0x00000001); /* REFRESH */ 589 ram_wr32(fuc, 0x10f310, 0x00000001); /* REFRESH */
589 ram_wr32(fuc, 0x10f210, 0x80000000); /* REFRESH_AUTO = 1 */ 590 ram_wr32(fuc, 0x10f210, 0x80000000); /* REFRESH_AUTO = 1 */
590 591
591 if ((next->bios.ramcfg_11_08_10) && (ram->mode == 2) /*XXX*/) { 592 if (next->bios.ramcfg_11_08_10 && (ram->mode == 2) /*XXX*/) {
592 u32 temp = ram_mask(fuc, 0x10f294, 0xff000000, 0x24000000); 593 u32 temp = ram_mask(fuc, 0x10f294, 0xff000000, 0x24000000);
593 nve0_ram_train(fuc, 0xbc0e0000, 0xa4010000); /*XXX*/ 594 nve0_ram_train(fuc, 0xbc0e0000, 0xa4010000); /*XXX*/
594 ram_nsec(fuc, 1000); 595 ram_nsec(fuc, 1000);
@@ -621,8 +622,8 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
621 data = ram_rd32(fuc, 0x10f978); 622 data = ram_rd32(fuc, 0x10f978);
622 data &= ~0x00046144; 623 data &= ~0x00046144;
623 data |= 0x0000000b; 624 data |= 0x0000000b;
624 if (!(next->bios.ramcfg_11_07_08)) { 625 if (!next->bios.ramcfg_11_07_08) {
625 if (!(next->bios.ramcfg_11_07_04)) 626 if (!next->bios.ramcfg_11_07_04)
626 data |= 0x0000200c; 627 data |= 0x0000200c;
627 else 628 else
628 data |= 0x00000000; 629 data |= 0x00000000;
@@ -636,11 +637,11 @@ nve0_ram_calc_gddr5(struct nouveau_fb *pfb, u32 freq)
636 ram_wr32(fuc, 0x10f830, data); 637 ram_wr32(fuc, 0x10f830, data);
637 } 638 }
638 639
639 if (!(next->bios.ramcfg_11_07_08)) { 640 if (!next->bios.ramcfg_11_07_08) {
640 data = 0x88020000; 641 data = 0x88020000;
641 if ( (next->bios.ramcfg_11_07_04)) 642 if ( next->bios.ramcfg_11_07_04)
642 data |= 0x10000000; 643 data |= 0x10000000;
643 if (!(next->bios.rammap_11_08_10)) 644 if (!next->bios.rammap_11_08_10)
644 data |= 0x00080000; 645 data |= 0x00080000;
645 } else { 646 } else {
646 data = 0xa40e0000; 647 data = 0xa40e0000;
@@ -689,8 +690,8 @@ nve0_ram_calc_sddr3(struct nouveau_fb *pfb, u32 freq)
689 const u32 runk0 = ram->fN1 << 16; 690 const u32 runk0 = ram->fN1 << 16;
690 const u32 runk1 = ram->fN1; 691 const u32 runk1 = ram->fN1;
691 struct nouveau_ram_data *next = ram->base.next; 692 struct nouveau_ram_data *next = ram->base.next;
692 int vc = !(next->bios.ramcfg_11_02_08); 693 int vc = !next->bios.ramcfg_11_02_08;
693 int mv = !(next->bios.ramcfg_11_02_04); 694 int mv = !next->bios.ramcfg_11_02_04;
694 u32 mask, data; 695 u32 mask, data;
695 696
696 ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); 697 ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000);
@@ -705,7 +706,7 @@ nve0_ram_calc_sddr3(struct nouveau_fb *pfb, u32 freq)
705 } 706 }
706 707
707 ram_mask(fuc, 0x10f200, 0x00000800, 0x00000000); 708 ram_mask(fuc, 0x10f200, 0x00000800, 0x00000000);
708 if ((next->bios.ramcfg_11_03_f0)) 709 if (next->bios.ramcfg_11_03_f0)
709 ram_mask(fuc, 0x10f808, 0x04000000, 0x04000000); 710 ram_mask(fuc, 0x10f808, 0x04000000, 0x04000000);
710 711
711 ram_wr32(fuc, 0x10f314, 0x00000001); /* PRECHARGE */ 712 ram_wr32(fuc, 0x10f314, 0x00000001); /* PRECHARGE */
@@ -761,7 +762,7 @@ nve0_ram_calc_sddr3(struct nouveau_fb *pfb, u32 freq)
761 762
762 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00010010); 763 ram_mask(fuc, 0x1373f4, 0x00000000, 0x00010010);
763 data = ram_rd32(fuc, 0x1373ec) & ~0x00030000; 764 data = ram_rd32(fuc, 0x1373ec) & ~0x00030000;
764 data |= (next->bios.ramcfg_11_03_30) << 12; 765 data |= next->bios.ramcfg_11_03_30 << 16;
765 ram_wr32(fuc, 0x1373ec, data); 766 ram_wr32(fuc, 0x1373ec, data);
766 ram_mask(fuc, 0x1373f4, 0x00000003, 0x00000000); 767 ram_mask(fuc, 0x1373f4, 0x00000003, 0x00000000);
767 ram_mask(fuc, 0x1373f4, 0x00000010, 0x00000000); 768 ram_mask(fuc, 0x1373f4, 0x00000010, 0x00000000);
@@ -793,8 +794,8 @@ nve0_ram_calc_sddr3(struct nouveau_fb *pfb, u32 freq)
793 } 794 }
794 } 795 }
795 796
796 if ( (next->bios.ramcfg_11_02_40) || 797 if (next->bios.ramcfg_11_02_40 ||
797 (next->bios.ramcfg_11_07_10)) { 798 next->bios.ramcfg_11_07_10) {
798 ram_mask(fuc, 0x132040, 0x00010000, 0x00010000); 799 ram_mask(fuc, 0x132040, 0x00010000, 0x00010000);
799 ram_nsec(fuc, 20000); 800 ram_nsec(fuc, 20000);
800 } 801 }
@@ -810,13 +811,13 @@ nve0_ram_calc_sddr3(struct nouveau_fb *pfb, u32 freq)
810 811
811 mask = 0x00010000; 812 mask = 0x00010000;
812 data = 0x00000000; 813 data = 0x00000000;
813 if (!(next->bios.ramcfg_11_02_80)) 814 if (!next->bios.ramcfg_11_02_80)
814 data |= 0x03000000; 815 data |= 0x03000000;
815 if (!(next->bios.ramcfg_11_02_40)) 816 if (!next->bios.ramcfg_11_02_40)
816 data |= 0x00002000; 817 data |= 0x00002000;
817 if (!(next->bios.ramcfg_11_07_10)) 818 if (!next->bios.ramcfg_11_07_10)
818 data |= 0x00004000; 819 data |= 0x00004000;
819 if (!(next->bios.ramcfg_11_07_08)) 820 if (!next->bios.ramcfg_11_07_08)
820 data |= 0x00000003; 821 data |= 0x00000003;
821 else 822 else
822 data |= 0x14000000; 823 data |= 0x14000000;
@@ -844,16 +845,16 @@ nve0_ram_calc_sddr3(struct nouveau_fb *pfb, u32 freq)
844 845
845 mask = 0x33f00000; 846 mask = 0x33f00000;
846 data = 0x00000000; 847 data = 0x00000000;
847 if (!(next->bios.ramcfg_11_01_04)) 848 if (!next->bios.ramcfg_11_01_04)
848 data |= 0x20200000; 849 data |= 0x20200000;
849 if (!(next->bios.ramcfg_11_07_80)) 850 if (!next->bios.ramcfg_11_07_80)
850 data |= 0x12800000; 851 data |= 0x12800000;
851 /*XXX: see note above about there probably being some condition 852 /*XXX: see note above about there probably being some condition
852 * for the 10f824 stuff that uses ramcfg 3... 853 * for the 10f824 stuff that uses ramcfg 3...
853 */ 854 */
854 if ( (next->bios.ramcfg_11_03_f0)) { 855 if (next->bios.ramcfg_11_03_f0) {
855 if (next->bios.rammap_11_08_0c) { 856 if (next->bios.rammap_11_08_0c) {
856 if (!(next->bios.ramcfg_11_07_80)) 857 if (!next->bios.ramcfg_11_07_80)
857 mask |= 0x00000020; 858 mask |= 0x00000020;
858 else 859 else
859 data |= 0x00000020; 860 data |= 0x00000020;
@@ -876,7 +877,7 @@ nve0_ram_calc_sddr3(struct nouveau_fb *pfb, u32 freq)
876 data = next->bios.timing_20_2c_1fc0; 877 data = next->bios.timing_20_2c_1fc0;
877 ram_mask(fuc, 0x10f24c, 0x7f000000, data << 24); 878 ram_mask(fuc, 0x10f24c, 0x7f000000, data << 24);
878 879
879 ram_mask(fuc, 0x10f224, 0x001f0000, next->bios.timing_20_30_f8); 880 ram_mask(fuc, 0x10f224, 0x001f0000, next->bios.timing_20_30_f8 << 16);
880 881
881 ram_wr32(fuc, 0x10f090, 0x4000007f); 882 ram_wr32(fuc, 0x10f090, 0x4000007f);
882 ram_nsec(fuc, 1000); 883 ram_nsec(fuc, 1000);
diff --git a/drivers/gpu/drm/nouveau/core/subdev/i2c/gf117.c b/drivers/gpu/drm/nouveau/core/subdev/i2c/gf117.c
new file mode 100644
index 000000000000..fa891c39866b
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/core/subdev/i2c/gf117.c
@@ -0,0 +1,39 @@
1/*
2 * Copyright 2012 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Ben Skeggs
23 */
24
25#include "nv50.h"
26
27struct nouveau_oclass *
28gf117_i2c_oclass = &(struct nouveau_i2c_impl) {
29 .base.handle = NV_SUBDEV(I2C, 0xd7),
30 .base.ofuncs = &(struct nouveau_ofuncs) {
31 .ctor = _nouveau_i2c_ctor,
32 .dtor = _nouveau_i2c_dtor,
33 .init = _nouveau_i2c_init,
34 .fini = _nouveau_i2c_fini,
35 },
36 .sclass = nvd0_i2c_sclass,
37 .pad_x = &nv04_i2c_pad_oclass,
38 .pad_s = &nv04_i2c_pad_oclass,
39}.base;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/ibus/nve0.c b/drivers/gpu/drm/nouveau/core/subdev/ibus/nve0.c
index 7120124dceac..ebef970a0645 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/ibus/nve0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/ibus/nve0.c
@@ -95,6 +95,23 @@ nve0_ibus_intr(struct nouveau_subdev *subdev)
95} 95}
96 96
97static int 97static int
98nve0_ibus_init(struct nouveau_object *object)
99{
100 struct nve0_ibus_priv *priv = (void *)object;
101 int ret = nouveau_ibus_init(&priv->base);
102 if (ret == 0) {
103 nv_mask(priv, 0x122318, 0x0003ffff, 0x00001000);
104 nv_mask(priv, 0x12231c, 0x0003ffff, 0x00000200);
105 nv_mask(priv, 0x122310, 0x0003ffff, 0x00000800);
106 nv_mask(priv, 0x122348, 0x0003ffff, 0x00000100);
107 nv_mask(priv, 0x1223b0, 0x0003ffff, 0x00000fff);
108 nv_mask(priv, 0x122348, 0x0003ffff, 0x00000200);
109 nv_mask(priv, 0x122358, 0x0003ffff, 0x00002880);
110 }
111 return ret;
112}
113
114static int
98nve0_ibus_ctor(struct nouveau_object *parent, struct nouveau_object *engine, 115nve0_ibus_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
99 struct nouveau_oclass *oclass, void *data, u32 size, 116 struct nouveau_oclass *oclass, void *data, u32 size,
100 struct nouveau_object **pobject) 117 struct nouveau_object **pobject)
@@ -117,7 +134,7 @@ nve0_ibus_oclass = {
117 .ofuncs = &(struct nouveau_ofuncs) { 134 .ofuncs = &(struct nouveau_ofuncs) {
118 .ctor = nve0_ibus_ctor, 135 .ctor = nve0_ibus_ctor,
119 .dtor = _nouveau_ibus_dtor, 136 .dtor = _nouveau_ibus_dtor,
120 .init = _nouveau_ibus_init, 137 .init = nve0_ibus_init,
121 .fini = _nouveau_ibus_fini, 138 .fini = _nouveau_ibus_fini,
122 }, 139 },
123}; 140};
diff --git a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/host.fuc b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/host.fuc
index 2284ecb1c9b8..c2bb616a8da5 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/host.fuc
+++ b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/host.fuc
@@ -83,7 +83,7 @@ host_send:
83 // increment GET 83 // increment GET
84 add b32 $r1 0x1 84 add b32 $r1 0x1
85 and $r14 $r1 #fifo_qmaskf 85 and $r14 $r1 #fifo_qmaskf
86 nv_iowr(NV_PPWR_FIFO_GET(0), $r1) 86 nv_iowr(NV_PPWR_FIFO_GET(0), $r14)
87 bra #host_send 87 bra #host_send
88 host_send_done: 88 host_send_done:
89 ret 89 ret
diff --git a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nv108.fuc.h b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nv108.fuc.h
index 4bd43a99fdcc..39a5dc150a05 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nv108.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nv108.fuc.h
@@ -1018,7 +1018,7 @@ uint32_t nv108_pwr_code[] = {
1018 0xb600023f, 1018 0xb600023f,
1019 0x1ec40110, 1019 0x1ec40110,
1020 0x04b0400f, 1020 0x04b0400f,
1021 0xbd0001f6, 1021 0xbd000ef6,
1022 0xc70ef404, 1022 0xc70ef404,
1023/* 0x0328: host_send_done */ 1023/* 0x0328: host_send_done */
1024/* 0x032a: host_recv */ 1024/* 0x032a: host_recv */
diff --git a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nva3.fuc.h b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nva3.fuc.h
index 5a73fa620978..254205cd5166 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nva3.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nva3.fuc.h
@@ -1124,7 +1124,7 @@ uint32_t nva3_pwr_code[] = {
1124 0x0f1ec401, 1124 0x0f1ec401,
1125 0x04b007f1, 1125 0x04b007f1,
1126 0xd00604b6, 1126 0xd00604b6,
1127 0x04bd0001, 1127 0x04bd000e,
1128/* 0x03cb: host_send_done */ 1128/* 0x03cb: host_send_done */
1129 0xf8ba0ef4, 1129 0xf8ba0ef4,
1130/* 0x03cd: host_recv */ 1130/* 0x03cd: host_recv */
diff --git a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvc0.fuc.h b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvc0.fuc.h
index 4dba00d2dd1a..7ac87405d01b 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvc0.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvc0.fuc.h
@@ -1124,7 +1124,7 @@ uint32_t nvc0_pwr_code[] = {
1124 0x0f1ec401, 1124 0x0f1ec401,
1125 0x04b007f1, 1125 0x04b007f1,
1126 0xd00604b6, 1126 0xd00604b6,
1127 0x04bd0001, 1127 0x04bd000e,
1128/* 0x03cb: host_send_done */ 1128/* 0x03cb: host_send_done */
1129 0xf8ba0ef4, 1129 0xf8ba0ef4,
1130/* 0x03cd: host_recv */ 1130/* 0x03cd: host_recv */
diff --git a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvd0.fuc.h b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvd0.fuc.h
index 5e24c6bc041d..cd9ff1a73284 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvd0.fuc.h
+++ b/drivers/gpu/drm/nouveau/core/subdev/pwr/fuc/nvd0.fuc.h
@@ -1033,7 +1033,7 @@ uint32_t nvd0_pwr_code[] = {
1033 0xb6026b21, 1033 0xb6026b21,
1034 0x1ec40110, 1034 0x1ec40110,
1035 0xb007f10f, 1035 0xb007f10f,
1036 0x0001d004, 1036 0x000ed004,
1037 0x0ef404bd, 1037 0x0ef404bd,
1038/* 0x0365: host_send_done */ 1038/* 0x0365: host_send_done */
1039/* 0x0367: host_recv */ 1039/* 0x0367: host_recv */
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 26b5647188ef..47ad74255bf1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -736,6 +736,9 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
736 fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y, 736 fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y,
737 new_bo->bo.offset }; 737 new_bo->bo.offset };
738 738
739 /* Keep vblanks on during flip, for the target crtc of this flip */
740 drm_vblank_get(dev, nouveau_crtc(crtc)->index);
741
739 /* Emit a page flip */ 742 /* Emit a page flip */
740 if (nv_device(drm->device)->card_type >= NV_50) { 743 if (nv_device(drm->device)->card_type >= NV_50) {
741 ret = nv50_display_flip_next(crtc, fb, chan, swap_interval); 744 ret = nv50_display_flip_next(crtc, fb, chan, swap_interval);
@@ -779,6 +782,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
779 return 0; 782 return 0;
780 783
781fail_unreserve: 784fail_unreserve:
785 drm_vblank_put(dev, nouveau_crtc(crtc)->index);
782 ttm_bo_unreserve(&old_bo->bo); 786 ttm_bo_unreserve(&old_bo->bo);
783fail_unpin: 787fail_unpin:
784 mutex_unlock(&chan->cli->mutex); 788 mutex_unlock(&chan->cli->mutex);
@@ -817,6 +821,9 @@ nouveau_finish_page_flip(struct nouveau_channel *chan,
817 drm_send_vblank_event(dev, crtcid, s->event); 821 drm_send_vblank_event(dev, crtcid, s->event);
818 } 822 }
819 823
824 /* Give up ownership of vblank for page-flipped crtc */
825 drm_vblank_put(dev, s->crtc);
826
820 list_del(&s->head); 827 list_del(&s->head);
821 if (ps) 828 if (ps)
822 *ps = *s; 829 *ps = *s;
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index ddd83756b9a2..5425ffe3931d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -652,12 +652,12 @@ int nouveau_pmops_resume(struct device *dev)
652 ret = nouveau_do_resume(drm_dev); 652 ret = nouveau_do_resume(drm_dev);
653 if (ret) 653 if (ret)
654 return ret; 654 return ret;
655 if (drm_dev->mode_config.num_crtc)
656 nouveau_fbcon_set_suspend(drm_dev, 0);
657 655
658 nouveau_fbcon_zfill_all(drm_dev); 656 if (drm_dev->mode_config.num_crtc) {
659 if (drm_dev->mode_config.num_crtc)
660 nouveau_display_resume(drm_dev); 657 nouveau_display_resume(drm_dev);
658 nouveau_fbcon_set_suspend(drm_dev, 0);
659 }
660
661 return 0; 661 return 0;
662} 662}
663 663
@@ -683,11 +683,12 @@ static int nouveau_pmops_thaw(struct device *dev)
683 ret = nouveau_do_resume(drm_dev); 683 ret = nouveau_do_resume(drm_dev);
684 if (ret) 684 if (ret)
685 return ret; 685 return ret;
686 if (drm_dev->mode_config.num_crtc) 686
687 nouveau_fbcon_set_suspend(drm_dev, 0); 687 if (drm_dev->mode_config.num_crtc) {
688 nouveau_fbcon_zfill_all(drm_dev);
689 if (drm_dev->mode_config.num_crtc)
690 nouveau_display_resume(drm_dev); 688 nouveau_display_resume(drm_dev);
689 nouveau_fbcon_set_suspend(drm_dev, 0);
690 }
691
691 return 0; 692 return 0;
692} 693}
693 694
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index 64a42cfd3717..191665ee7f52 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -531,17 +531,10 @@ nouveau_fbcon_set_suspend(struct drm_device *dev, int state)
531 if (state == 1) 531 if (state == 1)
532 nouveau_fbcon_save_disable_accel(dev); 532 nouveau_fbcon_save_disable_accel(dev);
533 fb_set_suspend(drm->fbcon->helper.fbdev, state); 533 fb_set_suspend(drm->fbcon->helper.fbdev, state);
534 if (state == 0) 534 if (state == 0) {
535 nouveau_fbcon_restore_accel(dev); 535 nouveau_fbcon_restore_accel(dev);
536 nouveau_fbcon_zfill(dev, drm->fbcon);
537 }
536 console_unlock(); 538 console_unlock();
537 } 539 }
538} 540}
539
540void
541nouveau_fbcon_zfill_all(struct drm_device *dev)
542{
543 struct nouveau_drm *drm = nouveau_drm(dev);
544 if (drm->fbcon) {
545 nouveau_fbcon_zfill(dev, drm->fbcon);
546 }
547}
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.h b/drivers/gpu/drm/nouveau/nouveau_fbcon.h
index fdfc0c94fbcc..fcff797d2084 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.h
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.h
@@ -61,7 +61,6 @@ void nouveau_fbcon_gpu_lockup(struct fb_info *info);
61int nouveau_fbcon_init(struct drm_device *dev); 61int nouveau_fbcon_init(struct drm_device *dev);
62void nouveau_fbcon_fini(struct drm_device *dev); 62void nouveau_fbcon_fini(struct drm_device *dev);
63void nouveau_fbcon_set_suspend(struct drm_device *dev, int state); 63void nouveau_fbcon_set_suspend(struct drm_device *dev, int state);
64void nouveau_fbcon_zfill_all(struct drm_device *dev);
65void nouveau_fbcon_save_disable_accel(struct drm_device *dev); 64void nouveau_fbcon_save_disable_accel(struct drm_device *dev);
66void nouveau_fbcon_restore_accel(struct drm_device *dev); 65void nouveau_fbcon_restore_accel(struct drm_device *dev);
67 66
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index afdf607df3e6..4c534b7b04da 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -1741,7 +1741,8 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode)
1741 } 1741 }
1742 } 1742 }
1743 1743
1744 mthd = (ffs(nv_encoder->dcb->sorconf.link) - 1) << 2; 1744 mthd = (ffs(nv_encoder->dcb->heads) - 1) << 3;
1745 mthd |= (ffs(nv_encoder->dcb->sorconf.link) - 1) << 2;
1745 mthd |= nv_encoder->or; 1746 mthd |= nv_encoder->or;
1746 1747
1747 if (nv_encoder->dcb->type == DCB_OUTPUT_DP) { 1748 if (nv_encoder->dcb->type == DCB_OUTPUT_DP) {
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 26c12a3fe430..a03c73411a56 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -1052,7 +1052,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
1052 int encoder_mode = atombios_get_encoder_mode(radeon_crtc->encoder); 1052 int encoder_mode = atombios_get_encoder_mode(radeon_crtc->encoder);
1053 1053
1054 /* pass the actual clock to atombios_crtc_program_pll for DCE5,6 for HDMI */ 1054 /* pass the actual clock to atombios_crtc_program_pll for DCE5,6 for HDMI */
1055 if (ASIC_IS_DCE5(rdev) && !ASIC_IS_DCE8(rdev) && 1055 if (ASIC_IS_DCE5(rdev) &&
1056 (encoder_mode == ATOM_ENCODER_MODE_HDMI) && 1056 (encoder_mode == ATOM_ENCODER_MODE_HDMI) &&
1057 (radeon_crtc->bpc > 8)) 1057 (radeon_crtc->bpc > 8))
1058 clock = radeon_crtc->adjusted_clock; 1058 clock = radeon_crtc->adjusted_clock;
@@ -1136,6 +1136,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
1136 u32 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_NONE); 1136 u32 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_NONE);
1137 u32 tmp, viewport_w, viewport_h; 1137 u32 tmp, viewport_w, viewport_h;
1138 int r; 1138 int r;
1139 bool bypass_lut = false;
1139 1140
1140 /* no fb bound */ 1141 /* no fb bound */
1141 if (!atomic && !crtc->primary->fb) { 1142 if (!atomic && !crtc->primary->fb) {
@@ -1174,33 +1175,73 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
1174 radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL); 1175 radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL);
1175 radeon_bo_unreserve(rbo); 1176 radeon_bo_unreserve(rbo);
1176 1177
1177 switch (target_fb->bits_per_pixel) { 1178 switch (target_fb->pixel_format) {
1178 case 8: 1179 case DRM_FORMAT_C8:
1179 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_8BPP) | 1180 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_8BPP) |
1180 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_INDEXED)); 1181 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_INDEXED));
1181 break; 1182 break;
1182 case 15: 1183 case DRM_FORMAT_XRGB4444:
1184 case DRM_FORMAT_ARGB4444:
1185 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) |
1186 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB4444));
1187#ifdef __BIG_ENDIAN
1188 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16);
1189#endif
1190 break;
1191 case DRM_FORMAT_XRGB1555:
1192 case DRM_FORMAT_ARGB1555:
1183 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) | 1193 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) |
1184 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB1555)); 1194 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB1555));
1195#ifdef __BIG_ENDIAN
1196 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16);
1197#endif
1198 break;
1199 case DRM_FORMAT_BGRX5551:
1200 case DRM_FORMAT_BGRA5551:
1201 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) |
1202 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_BGRA5551));
1203#ifdef __BIG_ENDIAN
1204 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16);
1205#endif
1185 break; 1206 break;
1186 case 16: 1207 case DRM_FORMAT_RGB565:
1187 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) | 1208 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_16BPP) |
1188 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB565)); 1209 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB565));
1189#ifdef __BIG_ENDIAN 1210#ifdef __BIG_ENDIAN
1190 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16); 1211 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN16);
1191#endif 1212#endif
1192 break; 1213 break;
1193 case 24: 1214 case DRM_FORMAT_XRGB8888:
1194 case 32: 1215 case DRM_FORMAT_ARGB8888:
1195 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) | 1216 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) |
1196 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB8888)); 1217 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB8888));
1197#ifdef __BIG_ENDIAN 1218#ifdef __BIG_ENDIAN
1198 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN32); 1219 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN32);
1199#endif 1220#endif
1200 break; 1221 break;
1222 case DRM_FORMAT_XRGB2101010:
1223 case DRM_FORMAT_ARGB2101010:
1224 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) |
1225 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB2101010));
1226#ifdef __BIG_ENDIAN
1227 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN32);
1228#endif
1229 /* Greater 8 bpc fb needs to bypass hw-lut to retain precision */
1230 bypass_lut = true;
1231 break;
1232 case DRM_FORMAT_BGRX1010102:
1233 case DRM_FORMAT_BGRA1010102:
1234 fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) |
1235 EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_BGRA1010102));
1236#ifdef __BIG_ENDIAN
1237 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN32);
1238#endif
1239 /* Greater 8 bpc fb needs to bypass hw-lut to retain precision */
1240 bypass_lut = true;
1241 break;
1201 default: 1242 default:
1202 DRM_ERROR("Unsupported screen depth %d\n", 1243 DRM_ERROR("Unsupported screen format %s\n",
1203 target_fb->bits_per_pixel); 1244 drm_get_format_name(target_fb->pixel_format));
1204 return -EINVAL; 1245 return -EINVAL;
1205 } 1246 }
1206 1247
@@ -1329,6 +1370,18 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
1329 WREG32(EVERGREEN_GRPH_CONTROL + radeon_crtc->crtc_offset, fb_format); 1370 WREG32(EVERGREEN_GRPH_CONTROL + radeon_crtc->crtc_offset, fb_format);
1330 WREG32(EVERGREEN_GRPH_SWAP_CONTROL + radeon_crtc->crtc_offset, fb_swap); 1371 WREG32(EVERGREEN_GRPH_SWAP_CONTROL + radeon_crtc->crtc_offset, fb_swap);
1331 1372
1373 /*
1374 * The LUT only has 256 slots for indexing by a 8 bpc fb. Bypass the LUT
1375 * for > 8 bpc scanout to avoid truncation of fb indices to 8 msb's, to
1376 * retain the full precision throughout the pipeline.
1377 */
1378 WREG32_P(EVERGREEN_GRPH_LUT_10BIT_BYPASS_CONTROL + radeon_crtc->crtc_offset,
1379 (bypass_lut ? EVERGREEN_LUT_10BIT_BYPASS_EN : 0),
1380 ~EVERGREEN_LUT_10BIT_BYPASS_EN);
1381
1382 if (bypass_lut)
1383 DRM_DEBUG_KMS("Bypassing hardware LUT due to 10 bit fb scanout.\n");
1384
1332 WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0); 1385 WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0);
1333 WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0); 1386 WREG32(EVERGREEN_GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0);
1334 WREG32(EVERGREEN_GRPH_X_START + radeon_crtc->crtc_offset, 0); 1387 WREG32(EVERGREEN_GRPH_X_START + radeon_crtc->crtc_offset, 0);
@@ -1396,6 +1449,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
1396 u32 fb_swap = R600_D1GRPH_SWAP_ENDIAN_NONE; 1449 u32 fb_swap = R600_D1GRPH_SWAP_ENDIAN_NONE;
1397 u32 tmp, viewport_w, viewport_h; 1450 u32 tmp, viewport_w, viewport_h;
1398 int r; 1451 int r;
1452 bool bypass_lut = false;
1399 1453
1400 /* no fb bound */ 1454 /* no fb bound */
1401 if (!atomic && !crtc->primary->fb) { 1455 if (!atomic && !crtc->primary->fb) {
@@ -1433,18 +1487,30 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
1433 radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL); 1487 radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL);
1434 radeon_bo_unreserve(rbo); 1488 radeon_bo_unreserve(rbo);
1435 1489
1436 switch (target_fb->bits_per_pixel) { 1490 switch (target_fb->pixel_format) {
1437 case 8: 1491 case DRM_FORMAT_C8:
1438 fb_format = 1492 fb_format =
1439 AVIVO_D1GRPH_CONTROL_DEPTH_8BPP | 1493 AVIVO_D1GRPH_CONTROL_DEPTH_8BPP |
1440 AVIVO_D1GRPH_CONTROL_8BPP_INDEXED; 1494 AVIVO_D1GRPH_CONTROL_8BPP_INDEXED;
1441 break; 1495 break;
1442 case 15: 1496 case DRM_FORMAT_XRGB4444:
1497 case DRM_FORMAT_ARGB4444:
1498 fb_format =
1499 AVIVO_D1GRPH_CONTROL_DEPTH_16BPP |
1500 AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444;
1501#ifdef __BIG_ENDIAN
1502 fb_swap = R600_D1GRPH_SWAP_ENDIAN_16BIT;
1503#endif
1504 break;
1505 case DRM_FORMAT_XRGB1555:
1443 fb_format = 1506 fb_format =
1444 AVIVO_D1GRPH_CONTROL_DEPTH_16BPP | 1507 AVIVO_D1GRPH_CONTROL_DEPTH_16BPP |
1445 AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555; 1508 AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555;
1509#ifdef __BIG_ENDIAN
1510 fb_swap = R600_D1GRPH_SWAP_ENDIAN_16BIT;
1511#endif
1446 break; 1512 break;
1447 case 16: 1513 case DRM_FORMAT_RGB565:
1448 fb_format = 1514 fb_format =
1449 AVIVO_D1GRPH_CONTROL_DEPTH_16BPP | 1515 AVIVO_D1GRPH_CONTROL_DEPTH_16BPP |
1450 AVIVO_D1GRPH_CONTROL_16BPP_RGB565; 1516 AVIVO_D1GRPH_CONTROL_16BPP_RGB565;
@@ -1452,8 +1518,8 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
1452 fb_swap = R600_D1GRPH_SWAP_ENDIAN_16BIT; 1518 fb_swap = R600_D1GRPH_SWAP_ENDIAN_16BIT;
1453#endif 1519#endif
1454 break; 1520 break;
1455 case 24: 1521 case DRM_FORMAT_XRGB8888:
1456 case 32: 1522 case DRM_FORMAT_ARGB8888:
1457 fb_format = 1523 fb_format =
1458 AVIVO_D1GRPH_CONTROL_DEPTH_32BPP | 1524 AVIVO_D1GRPH_CONTROL_DEPTH_32BPP |
1459 AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888; 1525 AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888;
@@ -1461,9 +1527,20 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
1461 fb_swap = R600_D1GRPH_SWAP_ENDIAN_32BIT; 1527 fb_swap = R600_D1GRPH_SWAP_ENDIAN_32BIT;
1462#endif 1528#endif
1463 break; 1529 break;
1530 case DRM_FORMAT_XRGB2101010:
1531 case DRM_FORMAT_ARGB2101010:
1532 fb_format =
1533 AVIVO_D1GRPH_CONTROL_DEPTH_32BPP |
1534 AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010;
1535#ifdef __BIG_ENDIAN
1536 fb_swap = R600_D1GRPH_SWAP_ENDIAN_32BIT;
1537#endif
1538 /* Greater 8 bpc fb needs to bypass hw-lut to retain precision */
1539 bypass_lut = true;
1540 break;
1464 default: 1541 default:
1465 DRM_ERROR("Unsupported screen depth %d\n", 1542 DRM_ERROR("Unsupported screen format %s\n",
1466 target_fb->bits_per_pixel); 1543 drm_get_format_name(target_fb->pixel_format));
1467 return -EINVAL; 1544 return -EINVAL;
1468 } 1545 }
1469 1546
@@ -1502,6 +1579,13 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
1502 if (rdev->family >= CHIP_R600) 1579 if (rdev->family >= CHIP_R600)
1503 WREG32(R600_D1GRPH_SWAP_CONTROL + radeon_crtc->crtc_offset, fb_swap); 1580 WREG32(R600_D1GRPH_SWAP_CONTROL + radeon_crtc->crtc_offset, fb_swap);
1504 1581
1582 /* LUT only has 256 slots for 8 bpc fb. Bypass for > 8 bpc scanout for precision */
1583 WREG32_P(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset,
1584 (bypass_lut ? AVIVO_LUT_10BIT_BYPASS_EN : 0), ~AVIVO_LUT_10BIT_BYPASS_EN);
1585
1586 if (bypass_lut)
1587 DRM_DEBUG_KMS("Bypassing hardware LUT due to 10 bit fb scanout.\n");
1588
1505 WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0); 1589 WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_X + radeon_crtc->crtc_offset, 0);
1506 WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0); 1590 WREG32(AVIVO_D1GRPH_SURFACE_OFFSET_Y + radeon_crtc->crtc_offset, 0);
1507 WREG32(AVIVO_D1GRPH_X_START + radeon_crtc->crtc_offset, 0); 1591 WREG32(AVIVO_D1GRPH_X_START + radeon_crtc->crtc_offset, 0);
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
index c5b1f2da3954..b1e11f8434e2 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -127,7 +127,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan,
127 /* flags not zero */ 127 /* flags not zero */
128 if (args.v1.ucReplyStatus == 2) { 128 if (args.v1.ucReplyStatus == 2) {
129 DRM_DEBUG_KMS("dp_aux_ch flags not zero\n"); 129 DRM_DEBUG_KMS("dp_aux_ch flags not zero\n");
130 r = -EBUSY; 130 r = -EIO;
131 goto done; 131 goto done;
132 } 132 }
133 133
@@ -403,16 +403,18 @@ bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
403{ 403{
404 struct radeon_connector_atom_dig *dig_connector = radeon_connector->con_priv; 404 struct radeon_connector_atom_dig *dig_connector = radeon_connector->con_priv;
405 u8 msg[DP_DPCD_SIZE]; 405 u8 msg[DP_DPCD_SIZE];
406 int ret, i; 406 int ret;
407
408 char dpcd_hex_dump[DP_DPCD_SIZE * 3];
407 409
408 ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg, 410 ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg,
409 DP_DPCD_SIZE); 411 DP_DPCD_SIZE);
410 if (ret > 0) { 412 if (ret > 0) {
411 memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE); 413 memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE);
412 DRM_DEBUG_KMS("DPCD: "); 414
413 for (i = 0; i < DP_DPCD_SIZE; i++) 415 hex_dump_to_buffer(dig_connector->dpcd, sizeof(dig_connector->dpcd),
414 DRM_DEBUG_KMS("%02x ", msg[i]); 416 32, 1, dpcd_hex_dump, sizeof(dpcd_hex_dump), false);
415 DRM_DEBUG_KMS("\n"); 417 DRM_DEBUG_KMS("DPCD: %s\n", dpcd_hex_dump);
416 418
417 radeon_dp_probe_oui(radeon_connector); 419 radeon_dp_probe_oui(radeon_connector);
418 420
diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index 10dae4106c08..584090ac3eb9 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -1179,7 +1179,7 @@ static int ci_stop_dpm(struct radeon_device *rdev)
1179 tmp &= ~GLOBAL_PWRMGT_EN; 1179 tmp &= ~GLOBAL_PWRMGT_EN;
1180 WREG32_SMC(GENERAL_PWRMGT, tmp); 1180 WREG32_SMC(GENERAL_PWRMGT, tmp);
1181 1181
1182 tmp = RREG32(SCLK_PWRMGT_CNTL); 1182 tmp = RREG32_SMC(SCLK_PWRMGT_CNTL);
1183 tmp &= ~DYNAMIC_PM_EN; 1183 tmp &= ~DYNAMIC_PM_EN;
1184 WREG32_SMC(SCLK_PWRMGT_CNTL, tmp); 1184 WREG32_SMC(SCLK_PWRMGT_CNTL, tmp);
1185 1185
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index dcd4518a9b08..0b2471107137 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -7676,14 +7676,16 @@ restart_ih:
7676 addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); 7676 addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR);
7677 status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS); 7677 status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS);
7678 mc_client = RREG32(VM_CONTEXT1_PROTECTION_FAULT_MCCLIENT); 7678 mc_client = RREG32(VM_CONTEXT1_PROTECTION_FAULT_MCCLIENT);
7679 /* reset addr and status */
7680 WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1);
7681 if (addr == 0x0 && status == 0x0)
7682 break;
7679 dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data); 7683 dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data);
7680 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n", 7684 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
7681 addr); 7685 addr);
7682 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", 7686 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
7683 status); 7687 status);
7684 cik_vm_decode_fault(rdev, status, addr, mc_client); 7688 cik_vm_decode_fault(rdev, status, addr, mc_client);
7685 /* reset addr and status */
7686 WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1);
7687 break; 7689 break;
7688 case 167: /* VCE */ 7690 case 167: /* VCE */
7689 DRM_DEBUG("IH: VCE int: 0x%08x\n", src_data); 7691 DRM_DEBUG("IH: VCE int: 0x%08x\n", src_data);
diff --git a/drivers/gpu/drm/radeon/cikd.h b/drivers/gpu/drm/radeon/cikd.h
index ae88660f34ea..0c6e1b55d968 100644
--- a/drivers/gpu/drm/radeon/cikd.h
+++ b/drivers/gpu/drm/radeon/cikd.h
@@ -1752,12 +1752,12 @@
1752#define EOP_TC_WB_ACTION_EN (1 << 15) /* L2 */ 1752#define EOP_TC_WB_ACTION_EN (1 << 15) /* L2 */
1753#define EOP_TCL1_ACTION_EN (1 << 16) 1753#define EOP_TCL1_ACTION_EN (1 << 16)
1754#define EOP_TC_ACTION_EN (1 << 17) /* L2 */ 1754#define EOP_TC_ACTION_EN (1 << 17) /* L2 */
1755#define EOP_TCL2_VOLATILE (1 << 24)
1755#define EOP_CACHE_POLICY(x) ((x) << 25) 1756#define EOP_CACHE_POLICY(x) ((x) << 25)
1756 /* 0 - LRU 1757 /* 0 - LRU
1757 * 1 - Stream 1758 * 1 - Stream
1758 * 2 - Bypass 1759 * 2 - Bypass
1759 */ 1760 */
1760#define EOP_TCL2_VOLATILE (1 << 27)
1761#define DATA_SEL(x) ((x) << 29) 1761#define DATA_SEL(x) ((x) << 29)
1762 /* 0 - discard 1762 /* 0 - discard
1763 * 1 - send low 32bit data 1763 * 1 - send low 32bit data
diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c
index 5a9a5f4d7888..47d31e915758 100644
--- a/drivers/gpu/drm/radeon/cypress_dpm.c
+++ b/drivers/gpu/drm/radeon/cypress_dpm.c
@@ -1551,7 +1551,7 @@ int cypress_populate_smc_voltage_tables(struct radeon_device *rdev,
1551 1551
1552 table->voltageMaskTable.highMask[RV770_SMC_VOLTAGEMASK_VDDCI] = 0; 1552 table->voltageMaskTable.highMask[RV770_SMC_VOLTAGEMASK_VDDCI] = 0;
1553 table->voltageMaskTable.lowMask[RV770_SMC_VOLTAGEMASK_VDDCI] = 1553 table->voltageMaskTable.lowMask[RV770_SMC_VOLTAGEMASK_VDDCI] =
1554 cpu_to_be32(eg_pi->vddc_voltage_table.mask_low); 1554 cpu_to_be32(eg_pi->vddci_voltage_table.mask_low);
1555 } 1555 }
1556 1556
1557 return 0; 1557 return 0;
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index e2f605224e8c..f7ece0ff431b 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -189,7 +189,7 @@ static const u32 evergreen_golden_registers[] =
189 0x8c1c, 0xffffffff, 0x00001010, 189 0x8c1c, 0xffffffff, 0x00001010,
190 0x28350, 0xffffffff, 0x00000000, 190 0x28350, 0xffffffff, 0x00000000,
191 0xa008, 0xffffffff, 0x00010000, 191 0xa008, 0xffffffff, 0x00010000,
192 0x5cc, 0xffffffff, 0x00000001, 192 0x5c4, 0xffffffff, 0x00000001,
193 0x9508, 0xffffffff, 0x00000002, 193 0x9508, 0xffffffff, 0x00000002,
194 0x913c, 0x0000000f, 0x0000000a 194 0x913c, 0x0000000f, 0x0000000a
195}; 195};
@@ -476,7 +476,7 @@ static const u32 cedar_golden_registers[] =
476 0x8c1c, 0xffffffff, 0x00001010, 476 0x8c1c, 0xffffffff, 0x00001010,
477 0x28350, 0xffffffff, 0x00000000, 477 0x28350, 0xffffffff, 0x00000000,
478 0xa008, 0xffffffff, 0x00010000, 478 0xa008, 0xffffffff, 0x00010000,
479 0x5cc, 0xffffffff, 0x00000001, 479 0x5c4, 0xffffffff, 0x00000001,
480 0x9508, 0xffffffff, 0x00000002 480 0x9508, 0xffffffff, 0x00000002
481}; 481};
482 482
@@ -635,7 +635,7 @@ static const u32 juniper_mgcg_init[] =
635static const u32 supersumo_golden_registers[] = 635static const u32 supersumo_golden_registers[] =
636{ 636{
637 0x5eb4, 0xffffffff, 0x00000002, 637 0x5eb4, 0xffffffff, 0x00000002,
638 0x5cc, 0xffffffff, 0x00000001, 638 0x5c4, 0xffffffff, 0x00000001,
639 0x7030, 0xffffffff, 0x00000011, 639 0x7030, 0xffffffff, 0x00000011,
640 0x7c30, 0xffffffff, 0x00000011, 640 0x7c30, 0xffffffff, 0x00000011,
641 0x6104, 0x01000300, 0x00000000, 641 0x6104, 0x01000300, 0x00000000,
@@ -719,7 +719,7 @@ static const u32 sumo_golden_registers[] =
719static const u32 wrestler_golden_registers[] = 719static const u32 wrestler_golden_registers[] =
720{ 720{
721 0x5eb4, 0xffffffff, 0x00000002, 721 0x5eb4, 0xffffffff, 0x00000002,
722 0x5cc, 0xffffffff, 0x00000001, 722 0x5c4, 0xffffffff, 0x00000001,
723 0x7030, 0xffffffff, 0x00000011, 723 0x7030, 0xffffffff, 0x00000011,
724 0x7c30, 0xffffffff, 0x00000011, 724 0x7c30, 0xffffffff, 0x00000011,
725 0x6104, 0x01000300, 0x00000000, 725 0x6104, 0x01000300, 0x00000000,
@@ -5066,14 +5066,16 @@ restart_ih:
5066 case 147: 5066 case 147:
5067 addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); 5067 addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR);
5068 status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS); 5068 status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS);
5069 /* reset addr and status */
5070 WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1);
5071 if (addr == 0x0 && status == 0x0)
5072 break;
5069 dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data); 5073 dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data);
5070 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n", 5074 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
5071 addr); 5075 addr);
5072 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", 5076 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
5073 status); 5077 status);
5074 cayman_vm_decode_fault(rdev, status, addr); 5078 cayman_vm_decode_fault(rdev, status, addr);
5075 /* reset addr and status */
5076 WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1);
5077 break; 5079 break;
5078 case 176: /* CP_INT in ring buffer */ 5080 case 176: /* CP_INT in ring buffer */
5079 case 177: /* CP_INT in IB1 */ 5081 case 177: /* CP_INT in IB1 */
diff --git a/drivers/gpu/drm/radeon/evergreen_reg.h b/drivers/gpu/drm/radeon/evergreen_reg.h
index a0f63ff5a5e9..333d143fca2c 100644
--- a/drivers/gpu/drm/radeon/evergreen_reg.h
+++ b/drivers/gpu/drm/radeon/evergreen_reg.h
@@ -116,6 +116,8 @@
116# define EVERGREEN_GRPH_ARRAY_LINEAR_ALIGNED 1 116# define EVERGREEN_GRPH_ARRAY_LINEAR_ALIGNED 1
117# define EVERGREEN_GRPH_ARRAY_1D_TILED_THIN1 2 117# define EVERGREEN_GRPH_ARRAY_1D_TILED_THIN1 2
118# define EVERGREEN_GRPH_ARRAY_2D_TILED_THIN1 4 118# define EVERGREEN_GRPH_ARRAY_2D_TILED_THIN1 4
119#define EVERGREEN_GRPH_LUT_10BIT_BYPASS_CONTROL 0x6808
120# define EVERGREEN_LUT_10BIT_BYPASS_EN (1 << 8)
119#define EVERGREEN_GRPH_SWAP_CONTROL 0x680c 121#define EVERGREEN_GRPH_SWAP_CONTROL 0x680c
120# define EVERGREEN_GRPH_ENDIAN_SWAP(x) (((x) & 0x3) << 0) 122# define EVERGREEN_GRPH_ENDIAN_SWAP(x) (((x) & 0x3) << 0)
121# define EVERGREEN_GRPH_ENDIAN_NONE 0 123# define EVERGREEN_GRPH_ENDIAN_NONE 0
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
index 3f6e817d97ee..9ef8c38f2d66 100644
--- a/drivers/gpu/drm/radeon/kv_dpm.c
+++ b/drivers/gpu/drm/radeon/kv_dpm.c
@@ -2726,7 +2726,7 @@ int kv_dpm_init(struct radeon_device *rdev)
2726 pi->caps_sclk_ds = true; 2726 pi->caps_sclk_ds = true;
2727 pi->enable_auto_thermal_throttling = true; 2727 pi->enable_auto_thermal_throttling = true;
2728 pi->disable_nb_ps3_in_battery = false; 2728 pi->disable_nb_ps3_in_battery = false;
2729 pi->bapm_enable = false; 2729 pi->bapm_enable = true;
2730 pi->voltage_drop_t = 0; 2730 pi->voltage_drop_t = 0;
2731 pi->caps_sclk_throttle_low_notification = false; 2731 pi->caps_sclk_throttle_low_notification = false;
2732 pi->caps_fps = false; /* true? */ 2732 pi->caps_fps = false; /* true? */
diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
index 004c931606c4..01fc4888e6fe 100644
--- a/drivers/gpu/drm/radeon/ni_dpm.c
+++ b/drivers/gpu/drm/radeon/ni_dpm.c
@@ -1315,7 +1315,7 @@ static void ni_populate_smc_voltage_tables(struct radeon_device *rdev,
1315 1315
1316 table->voltageMaskTable.highMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] = 0; 1316 table->voltageMaskTable.highMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] = 0;
1317 table->voltageMaskTable.lowMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] = 1317 table->voltageMaskTable.lowMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] =
1318 cpu_to_be32(eg_pi->vddc_voltage_table.mask_low); 1318 cpu_to_be32(eg_pi->vddci_voltage_table.mask_low);
1319 } 1319 }
1320} 1320}
1321 1321
diff --git a/drivers/gpu/drm/radeon/r500_reg.h b/drivers/gpu/drm/radeon/r500_reg.h
index 1dd0d32993d5..136b7bc7cd20 100644
--- a/drivers/gpu/drm/radeon/r500_reg.h
+++ b/drivers/gpu/drm/radeon/r500_reg.h
@@ -402,6 +402,7 @@
402 * block and vice versa. This applies to GRPH, CUR, etc. 402 * block and vice versa. This applies to GRPH, CUR, etc.
403 */ 403 */
404#define AVIVO_D1GRPH_LUT_SEL 0x6108 404#define AVIVO_D1GRPH_LUT_SEL 0x6108
405# define AVIVO_LUT_10BIT_BYPASS_EN (1 << 8)
405#define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110 406#define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110
406#define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6914 407#define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6914
407#define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6114 408#define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6114
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 4b0bbf88d5c0..29d9cc04c04e 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -102,6 +102,7 @@ extern int radeon_runtime_pm;
102extern int radeon_hard_reset; 102extern int radeon_hard_reset;
103extern int radeon_vm_size; 103extern int radeon_vm_size;
104extern int radeon_vm_block_size; 104extern int radeon_vm_block_size;
105extern int radeon_deep_color;
105 106
106/* 107/*
107 * Copy from radeon_drv.h so we don't have to include both and have conflicting 108 * Copy from radeon_drv.h so we don't have to include both and have conflicting
@@ -749,10 +750,6 @@ union radeon_irq_stat_regs {
749 struct cik_irq_stat_regs cik; 750 struct cik_irq_stat_regs cik;
750}; 751};
751 752
752#define RADEON_MAX_HPD_PINS 7
753#define RADEON_MAX_CRTCS 6
754#define RADEON_MAX_AFMT_BLOCKS 7
755
756struct radeon_irq { 753struct radeon_irq {
757 bool installed; 754 bool installed;
758 spinlock_t lock; 755 spinlock_t lock;
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 30844814c25a..173f378428a9 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1227,11 +1227,19 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
1227 rdev->clock.default_dispclk = 1227 rdev->clock.default_dispclk =
1228 le32_to_cpu(firmware_info->info_21.ulDefaultDispEngineClkFreq); 1228 le32_to_cpu(firmware_info->info_21.ulDefaultDispEngineClkFreq);
1229 if (rdev->clock.default_dispclk == 0) { 1229 if (rdev->clock.default_dispclk == 0) {
1230 if (ASIC_IS_DCE5(rdev)) 1230 if (ASIC_IS_DCE6(rdev))
1231 rdev->clock.default_dispclk = 60000; /* 600 Mhz */
1232 else if (ASIC_IS_DCE5(rdev))
1231 rdev->clock.default_dispclk = 54000; /* 540 Mhz */ 1233 rdev->clock.default_dispclk = 54000; /* 540 Mhz */
1232 else 1234 else
1233 rdev->clock.default_dispclk = 60000; /* 600 Mhz */ 1235 rdev->clock.default_dispclk = 60000; /* 600 Mhz */
1234 } 1236 }
1237 /* set a reasonable default for DP */
1238 if (ASIC_IS_DCE6(rdev) && (rdev->clock.default_dispclk < 53900)) {
1239 DRM_INFO("Changing default dispclk from %dMhz to 600Mhz\n",
1240 rdev->clock.default_dispclk / 100);
1241 rdev->clock.default_dispclk = 60000;
1242 }
1235 rdev->clock.dp_extclk = 1243 rdev->clock.dp_extclk =
1236 le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq); 1244 le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq);
1237 rdev->clock.current_dispclk = rdev->clock.default_dispclk; 1245 rdev->clock.current_dispclk = rdev->clock.default_dispclk;
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 933c5c39654d..44831197e82e 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -199,6 +199,9 @@ int radeon_get_monitor_bpc(struct drm_connector *connector)
199 } 199 }
200 } 200 }
201 201
202 if ((radeon_deep_color == 0) && (bpc > 8))
203 bpc = 8;
204
202 DRM_DEBUG("%s: Display bpc=%d, returned bpc=%d\n", 205 DRM_DEBUG("%s: Display bpc=%d, returned bpc=%d\n",
203 connector->name, connector->display_info.bpc, bpc); 206 connector->name, connector->display_info.bpc, bpc);
204 207
@@ -1288,17 +1291,15 @@ static int radeon_dvi_mode_valid(struct drm_connector *connector,
1288 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || 1291 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) ||
1289 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B)) 1292 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B))
1290 return MODE_OK; 1293 return MODE_OK;
1291 else if (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_A) { 1294 else if (ASIC_IS_DCE6(rdev) && drm_detect_hdmi_monitor(radeon_connector->edid)) {
1292 if (ASIC_IS_DCE6(rdev)) { 1295 /* HDMI 1.3+ supports max clock of 340 Mhz */
1293 /* HDMI 1.3+ supports max clock of 340 Mhz */ 1296 if (mode->clock > 340000)
1294 if (mode->clock > 340000)
1295 return MODE_CLOCK_HIGH;
1296 else
1297 return MODE_OK;
1298 } else
1299 return MODE_CLOCK_HIGH; 1297 return MODE_CLOCK_HIGH;
1300 } else 1298 else
1299 return MODE_OK;
1300 } else {
1301 return MODE_CLOCK_HIGH; 1301 return MODE_CLOCK_HIGH;
1302 }
1302 } 1303 }
1303 1304
1304 /* check against the max pixel clock */ 1305 /* check against the max pixel clock */
@@ -1549,6 +1550,8 @@ out:
1549static int radeon_dp_mode_valid(struct drm_connector *connector, 1550static int radeon_dp_mode_valid(struct drm_connector *connector,
1550 struct drm_display_mode *mode) 1551 struct drm_display_mode *mode)
1551{ 1552{
1553 struct drm_device *dev = connector->dev;
1554 struct radeon_device *rdev = dev->dev_private;
1552 struct radeon_connector *radeon_connector = to_radeon_connector(connector); 1555 struct radeon_connector *radeon_connector = to_radeon_connector(connector);
1553 struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; 1556 struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv;
1554 1557
@@ -1579,14 +1582,23 @@ static int radeon_dp_mode_valid(struct drm_connector *connector,
1579 return MODE_PANEL; 1582 return MODE_PANEL;
1580 } 1583 }
1581 } 1584 }
1582 return MODE_OK;
1583 } else { 1585 } else {
1584 if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || 1586 if ((radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
1585 (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) 1587 (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) {
1586 return radeon_dp_mode_valid_helper(connector, mode); 1588 return radeon_dp_mode_valid_helper(connector, mode);
1587 else 1589 } else {
1588 return MODE_OK; 1590 if (ASIC_IS_DCE6(rdev) && drm_detect_hdmi_monitor(radeon_connector->edid)) {
1591 /* HDMI 1.3+ supports max clock of 340 Mhz */
1592 if (mode->clock > 340000)
1593 return MODE_CLOCK_HIGH;
1594 } else {
1595 if (mode->clock > 165000)
1596 return MODE_CLOCK_HIGH;
1597 }
1598 }
1589 } 1599 }
1600
1601 return MODE_OK;
1590} 1602}
1591 1603
1592static const struct drm_connector_helper_funcs radeon_dp_connector_helper_funcs = { 1604static const struct drm_connector_helper_funcs radeon_dp_connector_helper_funcs = {
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 5ed617056b9c..13896edcf0b6 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -66,7 +66,8 @@ static void avivo_crtc_load_lut(struct drm_crtc *crtc)
66 (radeon_crtc->lut_b[i] << 0)); 66 (radeon_crtc->lut_b[i] << 0));
67 } 67 }
68 68
69 WREG32(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset, radeon_crtc->crtc_id); 69 /* Only change bit 0 of LUT_SEL, other bits are set elsewhere */
70 WREG32_P(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset, radeon_crtc->crtc_id, ~1);
70} 71}
71 72
72static void dce4_crtc_load_lut(struct drm_crtc *crtc) 73static void dce4_crtc_load_lut(struct drm_crtc *crtc)
@@ -284,7 +285,6 @@ static void radeon_unpin_work_func(struct work_struct *__work)
284void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id) 285void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id)
285{ 286{
286 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; 287 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];
287 struct radeon_flip_work *work;
288 unsigned long flags; 288 unsigned long flags;
289 u32 update_pending; 289 u32 update_pending;
290 int vpos, hpos; 290 int vpos, hpos;
@@ -294,8 +294,11 @@ void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id)
294 return; 294 return;
295 295
296 spin_lock_irqsave(&rdev->ddev->event_lock, flags); 296 spin_lock_irqsave(&rdev->ddev->event_lock, flags);
297 work = radeon_crtc->flip_work; 297 if (radeon_crtc->flip_status != RADEON_FLIP_SUBMITTED) {
298 if (work == NULL) { 298 DRM_DEBUG_DRIVER("radeon_crtc->flip_status = %d != "
299 "RADEON_FLIP_SUBMITTED(%d)\n",
300 radeon_crtc->flip_status,
301 RADEON_FLIP_SUBMITTED);
299 spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 302 spin_unlock_irqrestore(&rdev->ddev->event_lock, flags);
300 return; 303 return;
301 } 304 }
@@ -343,12 +346,17 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
343 346
344 spin_lock_irqsave(&rdev->ddev->event_lock, flags); 347 spin_lock_irqsave(&rdev->ddev->event_lock, flags);
345 work = radeon_crtc->flip_work; 348 work = radeon_crtc->flip_work;
346 if (work == NULL) { 349 if (radeon_crtc->flip_status != RADEON_FLIP_SUBMITTED) {
350 DRM_DEBUG_DRIVER("radeon_crtc->flip_status = %d != "
351 "RADEON_FLIP_SUBMITTED(%d)\n",
352 radeon_crtc->flip_status,
353 RADEON_FLIP_SUBMITTED);
347 spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 354 spin_unlock_irqrestore(&rdev->ddev->event_lock, flags);
348 return; 355 return;
349 } 356 }
350 357
351 /* Pageflip completed. Clean up. */ 358 /* Pageflip completed. Clean up. */
359 radeon_crtc->flip_status = RADEON_FLIP_NONE;
352 radeon_crtc->flip_work = NULL; 360 radeon_crtc->flip_work = NULL;
353 361
354 /* wakeup userspace */ 362 /* wakeup userspace */
@@ -357,8 +365,9 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id)
357 365
358 spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 366 spin_unlock_irqrestore(&rdev->ddev->event_lock, flags);
359 367
368 drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id);
360 radeon_fence_unref(&work->fence); 369 radeon_fence_unref(&work->fence);
361 radeon_irq_kms_pflip_irq_get(rdev, work->crtc_id); 370 radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id);
362 queue_work(radeon_crtc->flip_queue, &work->unpin_work); 371 queue_work(radeon_crtc->flip_queue, &work->unpin_work);
363} 372}
364 373
@@ -459,6 +468,12 @@ static void radeon_flip_work_func(struct work_struct *__work)
459 base &= ~7; 468 base &= ~7;
460 } 469 }
461 470
471 r = drm_vblank_get(crtc->dev, radeon_crtc->crtc_id);
472 if (r) {
473 DRM_ERROR("failed to get vblank before flip\n");
474 goto pflip_cleanup;
475 }
476
462 /* We borrow the event spin lock for protecting flip_work */ 477 /* We borrow the event spin lock for protecting flip_work */
463 spin_lock_irqsave(&crtc->dev->event_lock, flags); 478 spin_lock_irqsave(&crtc->dev->event_lock, flags);
464 479
@@ -468,11 +483,22 @@ static void radeon_flip_work_func(struct work_struct *__work)
468 /* do the flip (mmio) */ 483 /* do the flip (mmio) */
469 radeon_page_flip(rdev, radeon_crtc->crtc_id, base); 484 radeon_page_flip(rdev, radeon_crtc->crtc_id, base);
470 485
486 radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED;
471 spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 487 spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
472 up_read(&rdev->exclusive_lock); 488 up_read(&rdev->exclusive_lock);
473 489
474 return; 490 return;
475 491
492pflip_cleanup:
493 if (unlikely(radeon_bo_reserve(work->new_rbo, false) != 0)) {
494 DRM_ERROR("failed to reserve new rbo in error path\n");
495 goto cleanup;
496 }
497 if (unlikely(radeon_bo_unpin(work->new_rbo) != 0)) {
498 DRM_ERROR("failed to unpin new rbo in error path\n");
499 }
500 radeon_bo_unreserve(work->new_rbo);
501
476cleanup: 502cleanup:
477 drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); 503 drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
478 radeon_fence_unref(&work->fence); 504 radeon_fence_unref(&work->fence);
@@ -526,7 +552,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc,
526 /* We borrow the event spin lock for protecting flip_work */ 552 /* We borrow the event spin lock for protecting flip_work */
527 spin_lock_irqsave(&crtc->dev->event_lock, flags); 553 spin_lock_irqsave(&crtc->dev->event_lock, flags);
528 554
529 if (radeon_crtc->flip_work) { 555 if (radeon_crtc->flip_status != RADEON_FLIP_NONE) {
530 DRM_DEBUG_DRIVER("flip queue: crtc already busy\n"); 556 DRM_DEBUG_DRIVER("flip queue: crtc already busy\n");
531 spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 557 spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
532 drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); 558 drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base);
@@ -534,6 +560,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc,
534 kfree(work); 560 kfree(work);
535 return -EBUSY; 561 return -EBUSY;
536 } 562 }
563 radeon_crtc->flip_status = RADEON_FLIP_PENDING;
537 radeon_crtc->flip_work = work; 564 radeon_crtc->flip_work = work;
538 565
539 /* update crtc fb */ 566 /* update crtc fb */
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 6e3017413386..cb1421369e3a 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -175,6 +175,7 @@ int radeon_runtime_pm = -1;
175int radeon_hard_reset = 0; 175int radeon_hard_reset = 0;
176int radeon_vm_size = 4096; 176int radeon_vm_size = 4096;
177int radeon_vm_block_size = 9; 177int radeon_vm_block_size = 9;
178int radeon_deep_color = 0;
178 179
179MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers"); 180MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
180module_param_named(no_wb, radeon_no_wb, int, 0444); 181module_param_named(no_wb, radeon_no_wb, int, 0444);
@@ -248,6 +249,9 @@ module_param_named(vm_size, radeon_vm_size, int, 0444);
248MODULE_PARM_DESC(vm_block_size, "VM page table size in bits (default 9)"); 249MODULE_PARM_DESC(vm_block_size, "VM page table size in bits (default 9)");
249module_param_named(vm_block_size, radeon_vm_block_size, int, 0444); 250module_param_named(vm_block_size, radeon_vm_block_size, int, 0444);
250 251
252MODULE_PARM_DESC(deep_color, "Deep Color support (1 = enable, 0 = disable (default))");
253module_param_named(deep_color, radeon_deep_color, int, 0444);
254
251static struct pci_device_id pciidlist[] = { 255static struct pci_device_id pciidlist[] = {
252 radeon_PCI_IDS 256 radeon_PCI_IDS
253}; 257};
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index ad0e4b8cc7e3..0592ddb0904b 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -46,6 +46,10 @@ struct radeon_device;
46#define to_radeon_encoder(x) container_of(x, struct radeon_encoder, base) 46#define to_radeon_encoder(x) container_of(x, struct radeon_encoder, base)
47#define to_radeon_framebuffer(x) container_of(x, struct radeon_framebuffer, base) 47#define to_radeon_framebuffer(x) container_of(x, struct radeon_framebuffer, base)
48 48
49#define RADEON_MAX_HPD_PINS 7
50#define RADEON_MAX_CRTCS 6
51#define RADEON_MAX_AFMT_BLOCKS 7
52
49enum radeon_rmx_type { 53enum radeon_rmx_type {
50 RMX_OFF, 54 RMX_OFF,
51 RMX_FULL, 55 RMX_FULL,
@@ -233,8 +237,8 @@ struct radeon_mode_info {
233 struct card_info *atom_card_info; 237 struct card_info *atom_card_info;
234 enum radeon_connector_table connector_table; 238 enum radeon_connector_table connector_table;
235 bool mode_config_initialized; 239 bool mode_config_initialized;
236 struct radeon_crtc *crtcs[6]; 240 struct radeon_crtc *crtcs[RADEON_MAX_CRTCS];
237 struct radeon_afmt *afmt[7]; 241 struct radeon_afmt *afmt[RADEON_MAX_AFMT_BLOCKS];
238 /* DVI-I properties */ 242 /* DVI-I properties */
239 struct drm_property *coherent_mode_property; 243 struct drm_property *coherent_mode_property;
240 /* DAC enable load detect */ 244 /* DAC enable load detect */
@@ -302,6 +306,12 @@ struct radeon_atom_ss {
302 uint16_t amount; 306 uint16_t amount;
303}; 307};
304 308
309enum radeon_flip_status {
310 RADEON_FLIP_NONE,
311 RADEON_FLIP_PENDING,
312 RADEON_FLIP_SUBMITTED
313};
314
305struct radeon_crtc { 315struct radeon_crtc {
306 struct drm_crtc base; 316 struct drm_crtc base;
307 int crtc_id; 317 int crtc_id;
@@ -327,6 +337,7 @@ struct radeon_crtc {
327 /* page flipping */ 337 /* page flipping */
328 struct workqueue_struct *flip_queue; 338 struct workqueue_struct *flip_queue;
329 struct radeon_flip_work *flip_work; 339 struct radeon_flip_work *flip_work;
340 enum radeon_flip_status flip_status;
330 /* pll sharing */ 341 /* pll sharing */
331 struct radeon_atom_ss ss; 342 struct radeon_atom_ss ss;
332 bool ss_enabled; 343 bool ss_enabled;
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 12c663e86ca1..e447e390d09a 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -73,8 +73,10 @@ void radeon_pm_acpi_event_handler(struct radeon_device *rdev)
73 rdev->pm.dpm.ac_power = true; 73 rdev->pm.dpm.ac_power = true;
74 else 74 else
75 rdev->pm.dpm.ac_power = false; 75 rdev->pm.dpm.ac_power = false;
76 if (rdev->asic->dpm.enable_bapm) 76 if (rdev->family == CHIP_ARUBA) {
77 radeon_dpm_enable_bapm(rdev, rdev->pm.dpm.ac_power); 77 if (rdev->asic->dpm.enable_bapm)
78 radeon_dpm_enable_bapm(rdev, rdev->pm.dpm.ac_power);
79 }
78 mutex_unlock(&rdev->pm.mutex); 80 mutex_unlock(&rdev->pm.mutex);
79 } else if (rdev->pm.pm_method == PM_METHOD_PROFILE) { 81 } else if (rdev->pm.pm_method == PM_METHOD_PROFILE) {
80 if (rdev->pm.profile == PM_PROFILE_AUTO) { 82 if (rdev->pm.profile == PM_PROFILE_AUTO) {
diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index 899d9126cad6..eecff6bbd341 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -495,7 +495,7 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
495 mutex_unlock(&vm->mutex); 495 mutex_unlock(&vm->mutex);
496 496
497 r = radeon_bo_create(rdev, RADEON_VM_PTE_COUNT * 8, 497 r = radeon_bo_create(rdev, RADEON_VM_PTE_COUNT * 8,
498 RADEON_GPU_PAGE_SIZE, false, 498 RADEON_GPU_PAGE_SIZE, true,
499 RADEON_GEM_DOMAIN_VRAM, NULL, &pt); 499 RADEON_GEM_DOMAIN_VRAM, NULL, &pt);
500 if (r) 500 if (r)
501 return r; 501 return r;
@@ -992,7 +992,7 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
992 return -ENOMEM; 992 return -ENOMEM;
993 } 993 }
994 994
995 r = radeon_bo_create(rdev, pd_size, align, false, 995 r = radeon_bo_create(rdev, pd_size, align, true,
996 RADEON_GEM_DOMAIN_VRAM, NULL, 996 RADEON_GEM_DOMAIN_VRAM, NULL,
997 &vm->page_directory); 997 &vm->page_directory);
998 if (r) 998 if (r)
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c
index da041a43d82e..3c76e1dcdf04 100644
--- a/drivers/gpu/drm/radeon/rv770_dpm.c
+++ b/drivers/gpu/drm/radeon/rv770_dpm.c
@@ -2329,12 +2329,6 @@ void rv770_get_engine_memory_ss(struct radeon_device *rdev)
2329 pi->mclk_ss = radeon_atombios_get_asic_ss_info(rdev, &ss, 2329 pi->mclk_ss = radeon_atombios_get_asic_ss_info(rdev, &ss,
2330 ASIC_INTERNAL_MEMORY_SS, 0); 2330 ASIC_INTERNAL_MEMORY_SS, 0);
2331 2331
2332 /* disable ss, causes hangs on some cayman boards */
2333 if (rdev->family == CHIP_CAYMAN) {
2334 pi->sclk_ss = false;
2335 pi->mclk_ss = false;
2336 }
2337
2338 if (pi->sclk_ss || pi->mclk_ss) 2332 if (pi->sclk_ss || pi->mclk_ss)
2339 pi->dynamic_ss = true; 2333 pi->dynamic_ss = true;
2340 else 2334 else
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 730cee2c34cf..eba0225259a4 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -6376,14 +6376,16 @@ restart_ih:
6376 case 147: 6376 case 147:
6377 addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR); 6377 addr = RREG32(VM_CONTEXT1_PROTECTION_FAULT_ADDR);
6378 status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS); 6378 status = RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS);
6379 /* reset addr and status */
6380 WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1);
6381 if (addr == 0x0 && status == 0x0)
6382 break;
6379 dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data); 6383 dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data);
6380 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n", 6384 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
6381 addr); 6385 addr);
6382 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n", 6386 dev_err(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
6383 status); 6387 status);
6384 si_vm_decode_fault(rdev, status, addr); 6388 si_vm_decode_fault(rdev, status, addr);
6385 /* reset addr and status */
6386 WREG32_P(VM_CONTEXT1_CNTL2, 1, ~1);
6387 break; 6389 break;
6388 case 176: /* RINGID0 CP_INT */ 6390 case 176: /* RINGID0 CP_INT */
6389 radeon_fence_process(rdev, RADEON_RING_TYPE_GFX_INDEX); 6391 radeon_fence_process(rdev, RADEON_RING_TYPE_GFX_INDEX);
diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c
index 2a2822c03329..20da6ff183df 100644
--- a/drivers/gpu/drm/radeon/trinity_dpm.c
+++ b/drivers/gpu/drm/radeon/trinity_dpm.c
@@ -1874,7 +1874,15 @@ int trinity_dpm_init(struct radeon_device *rdev)
1874 for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) 1874 for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++)
1875 pi->at[i] = TRINITY_AT_DFLT; 1875 pi->at[i] = TRINITY_AT_DFLT;
1876 1876
1877 pi->enable_bapm = false; 1877 /* There are stability issues reported on latops with
1878 * bapm installed when switching between AC and battery
1879 * power. At the same time, some desktop boards hang
1880 * if it's not enabled and dpm is enabled.
1881 */
1882 if (rdev->flags & RADEON_IS_MOBILITY)
1883 pi->enable_bapm = false;
1884 else
1885 pi->enable_bapm = true;
1878 pi->enable_nbps_policy = true; 1886 pi->enable_nbps_policy = true;
1879 pi->enable_sclk_ds = true; 1887 pi->enable_sclk_ds = true;
1880 pi->enable_gfx_power_gating = true; 1888 pi->enable_gfx_power_gating = true;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index a89ad938eacf..b031b48dbb3c 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -179,7 +179,6 @@ static int vmw_fb_set_par(struct fb_info *info)
179 vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset); 179 vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset);
180 vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres); 180 vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres);
181 vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres); 181 vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres);
182 vmw_write(vmw_priv, SVGA_REG_BYTES_PER_LINE, info->fix.line_length);
183 vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); 182 vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID);
184 } 183 }
185 184