aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c90
1 files changed, 60 insertions, 30 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5fb305840db8..be79f477a38f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8269,9 +8269,11 @@ check_crtc_state(struct drm_device *dev)
8269 8269
8270 list_for_each_entry(encoder, &dev->mode_config.encoder_list, 8270 list_for_each_entry(encoder, &dev->mode_config.encoder_list,
8271 base.head) { 8271 base.head) {
8272 enum pipe pipe;
8272 if (encoder->base.crtc != &crtc->base) 8273 if (encoder->base.crtc != &crtc->base)
8273 continue; 8274 continue;
8274 if (encoder->get_config) 8275 if (encoder->get_config &&
8276 encoder->get_hw_state(encoder, &pipe))
8275 encoder->get_config(encoder, &pipe_config); 8277 encoder->get_config(encoder, &pipe_config);
8276 } 8278 }
8277 8279
@@ -10040,6 +10042,8 @@ struct intel_display_error_state {
10040 10042
10041 u32 power_well_driver; 10043 u32 power_well_driver;
10042 10044
10045 int num_transcoders;
10046
10043 struct intel_cursor_error_state { 10047 struct intel_cursor_error_state {
10044 u32 control; 10048 u32 control;
10045 u32 position; 10049 u32 position;
@@ -10048,16 +10052,7 @@ struct intel_display_error_state {
10048 } cursor[I915_MAX_PIPES]; 10052 } cursor[I915_MAX_PIPES];
10049 10053
10050 struct intel_pipe_error_state { 10054 struct intel_pipe_error_state {
10051 enum transcoder cpu_transcoder;
10052 u32 conf;
10053 u32 source; 10055 u32 source;
10054
10055 u32 htotal;
10056 u32 hblank;
10057 u32 hsync;
10058 u32 vtotal;
10059 u32 vblank;
10060 u32 vsync;
10061 } pipe[I915_MAX_PIPES]; 10056 } pipe[I915_MAX_PIPES];
10062 10057
10063 struct intel_plane_error_state { 10058 struct intel_plane_error_state {
@@ -10069,6 +10064,19 @@ struct intel_display_error_state {
10069 u32 surface; 10064 u32 surface;
10070 u32 tile_offset; 10065 u32 tile_offset;
10071 } plane[I915_MAX_PIPES]; 10066 } plane[I915_MAX_PIPES];
10067
10068 struct intel_transcoder_error_state {
10069 enum transcoder cpu_transcoder;
10070
10071 u32 conf;
10072
10073 u32 htotal;
10074 u32 hblank;
10075 u32 hsync;
10076 u32 vtotal;
10077 u32 vblank;
10078 u32 vsync;
10079 } transcoder[4];
10072}; 10080};
10073 10081
10074struct intel_display_error_state * 10082struct intel_display_error_state *
@@ -10076,9 +10084,17 @@ intel_display_capture_error_state(struct drm_device *dev)
10076{ 10084{
10077 drm_i915_private_t *dev_priv = dev->dev_private; 10085 drm_i915_private_t *dev_priv = dev->dev_private;
10078 struct intel_display_error_state *error; 10086 struct intel_display_error_state *error;
10079 enum transcoder cpu_transcoder; 10087 int transcoders[] = {
10088 TRANSCODER_A,
10089 TRANSCODER_B,
10090 TRANSCODER_C,
10091 TRANSCODER_EDP,
10092 };
10080 int i; 10093 int i;
10081 10094
10095 if (INTEL_INFO(dev)->num_pipes == 0)
10096 return NULL;
10097
10082 error = kmalloc(sizeof(*error), GFP_ATOMIC); 10098 error = kmalloc(sizeof(*error), GFP_ATOMIC);
10083 if (error == NULL) 10099 if (error == NULL)
10084 return NULL; 10100 return NULL;
@@ -10087,9 +10103,6 @@ intel_display_capture_error_state(struct drm_device *dev)
10087 error->power_well_driver = I915_READ(HSW_PWR_WELL_DRIVER); 10103 error->power_well_driver = I915_READ(HSW_PWR_WELL_DRIVER);
10088 10104
10089 for_each_pipe(i) { 10105 for_each_pipe(i) {
10090 cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv, i);
10091 error->pipe[i].cpu_transcoder = cpu_transcoder;
10092
10093 if (INTEL_INFO(dev)->gen <= 6 || IS_VALLEYVIEW(dev)) { 10106 if (INTEL_INFO(dev)->gen <= 6 || IS_VALLEYVIEW(dev)) {
10094 error->cursor[i].control = I915_READ(CURCNTR(i)); 10107 error->cursor[i].control = I915_READ(CURCNTR(i));
10095 error->cursor[i].position = I915_READ(CURPOS(i)); 10108 error->cursor[i].position = I915_READ(CURPOS(i));
@@ -10113,14 +10126,25 @@ intel_display_capture_error_state(struct drm_device *dev)
10113 error->plane[i].tile_offset = I915_READ(DSPTILEOFF(i)); 10126 error->plane[i].tile_offset = I915_READ(DSPTILEOFF(i));
10114 } 10127 }
10115 10128
10116 error->pipe[i].conf = I915_READ(PIPECONF(cpu_transcoder));
10117 error->pipe[i].source = I915_READ(PIPESRC(i)); 10129 error->pipe[i].source = I915_READ(PIPESRC(i));
10118 error->pipe[i].htotal = I915_READ(HTOTAL(cpu_transcoder)); 10130 }
10119 error->pipe[i].hblank = I915_READ(HBLANK(cpu_transcoder)); 10131
10120 error->pipe[i].hsync = I915_READ(HSYNC(cpu_transcoder)); 10132 error->num_transcoders = INTEL_INFO(dev)->num_pipes;
10121 error->pipe[i].vtotal = I915_READ(VTOTAL(cpu_transcoder)); 10133 if (HAS_DDI(dev_priv->dev))
10122 error->pipe[i].vblank = I915_READ(VBLANK(cpu_transcoder)); 10134 error->num_transcoders++; /* Account for eDP. */
10123 error->pipe[i].vsync = I915_READ(VSYNC(cpu_transcoder)); 10135
10136 for (i = 0; i < error->num_transcoders; i++) {
10137 enum transcoder cpu_transcoder = transcoders[i];
10138
10139 error->transcoder[i].cpu_transcoder = cpu_transcoder;
10140
10141 error->transcoder[i].conf = I915_READ(PIPECONF(cpu_transcoder));
10142 error->transcoder[i].htotal = I915_READ(HTOTAL(cpu_transcoder));
10143 error->transcoder[i].hblank = I915_READ(HBLANK(cpu_transcoder));
10144 error->transcoder[i].hsync = I915_READ(HSYNC(cpu_transcoder));
10145 error->transcoder[i].vtotal = I915_READ(VTOTAL(cpu_transcoder));
10146 error->transcoder[i].vblank = I915_READ(VBLANK(cpu_transcoder));
10147 error->transcoder[i].vsync = I915_READ(VSYNC(cpu_transcoder));
10124 } 10148 }
10125 10149
10126 /* In the code above we read the registers without checking if the power 10150 /* In the code above we read the registers without checking if the power
@@ -10142,22 +10166,16 @@ intel_display_print_error_state(struct drm_i915_error_state_buf *m,
10142{ 10166{
10143 int i; 10167 int i;
10144 10168
10169 if (!error)
10170 return;
10171
10145 err_printf(m, "Num Pipes: %d\n", INTEL_INFO(dev)->num_pipes); 10172 err_printf(m, "Num Pipes: %d\n", INTEL_INFO(dev)->num_pipes);
10146 if (HAS_POWER_WELL(dev)) 10173 if (HAS_POWER_WELL(dev))
10147 err_printf(m, "PWR_WELL_CTL2: %08x\n", 10174 err_printf(m, "PWR_WELL_CTL2: %08x\n",
10148 error->power_well_driver); 10175 error->power_well_driver);
10149 for_each_pipe(i) { 10176 for_each_pipe(i) {
10150 err_printf(m, "Pipe [%d]:\n", i); 10177 err_printf(m, "Pipe [%d]:\n", i);
10151 err_printf(m, " CPU transcoder: %c\n",
10152 transcoder_name(error->pipe[i].cpu_transcoder));
10153 err_printf(m, " CONF: %08x\n", error->pipe[i].conf);
10154 err_printf(m, " SRC: %08x\n", error->pipe[i].source); 10178 err_printf(m, " SRC: %08x\n", error->pipe[i].source);
10155 err_printf(m, " HTOTAL: %08x\n", error->pipe[i].htotal);
10156 err_printf(m, " HBLANK: %08x\n", error->pipe[i].hblank);
10157 err_printf(m, " HSYNC: %08x\n", error->pipe[i].hsync);
10158 err_printf(m, " VTOTAL: %08x\n", error->pipe[i].vtotal);
10159 err_printf(m, " VBLANK: %08x\n", error->pipe[i].vblank);
10160 err_printf(m, " VSYNC: %08x\n", error->pipe[i].vsync);
10161 10179
10162 err_printf(m, "Plane [%d]:\n", i); 10180 err_printf(m, "Plane [%d]:\n", i);
10163 err_printf(m, " CNTR: %08x\n", error->plane[i].control); 10181 err_printf(m, " CNTR: %08x\n", error->plane[i].control);
@@ -10178,5 +10196,17 @@ intel_display_print_error_state(struct drm_i915_error_state_buf *m,
10178 err_printf(m, " POS: %08x\n", error->cursor[i].position); 10196 err_printf(m, " POS: %08x\n", error->cursor[i].position);
10179 err_printf(m, " BASE: %08x\n", error->cursor[i].base); 10197 err_printf(m, " BASE: %08x\n", error->cursor[i].base);
10180 } 10198 }
10199
10200 for (i = 0; i < error->num_transcoders; i++) {
10201 err_printf(m, " CPU transcoder: %c\n",
10202 transcoder_name(error->transcoder[i].cpu_transcoder));
10203 err_printf(m, " CONF: %08x\n", error->transcoder[i].conf);
10204 err_printf(m, " HTOTAL: %08x\n", error->transcoder[i].htotal);
10205 err_printf(m, " HBLANK: %08x\n", error->transcoder[i].hblank);
10206 err_printf(m, " HSYNC: %08x\n", error->transcoder[i].hsync);
10207 err_printf(m, " VTOTAL: %08x\n", error->transcoder[i].vtotal);
10208 err_printf(m, " VBLANK: %08x\n", error->transcoder[i].vblank);
10209 err_printf(m, " VSYNC: %08x\n", error->transcoder[i].vsync);
10210 }
10181} 10211}
10182#endif 10212#endif