aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/gvt/handlers.c15
-rw-r--r--drivers/gpu/drm/i915/intel_display.c38
2 files changed, 38 insertions, 15 deletions
diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
index a6ade66349bd..25f78196b964 100644
--- a/drivers/gpu/drm/i915/gvt/handlers.c
+++ b/drivers/gpu/drm/i915/gvt/handlers.c
@@ -1254,18 +1254,15 @@ static int send_display_ready_uevent(struct intel_vgpu *vgpu, int ready)
1254static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, 1254static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
1255 void *p_data, unsigned int bytes) 1255 void *p_data, unsigned int bytes)
1256{ 1256{
1257 u32 data; 1257 u32 data = *(u32 *)p_data;
1258 int ret; 1258 bool invalid_write = false;
1259
1260 write_vreg(vgpu, offset, p_data, bytes);
1261 data = vgpu_vreg(vgpu, offset);
1262 1259
1263 switch (offset) { 1260 switch (offset) {
1264 case _vgtif_reg(display_ready): 1261 case _vgtif_reg(display_ready):
1265 send_display_ready_uevent(vgpu, data ? 1 : 0); 1262 send_display_ready_uevent(vgpu, data ? 1 : 0);
1266 break; 1263 break;
1267 case _vgtif_reg(g2v_notify): 1264 case _vgtif_reg(g2v_notify):
1268 ret = handle_g2v_notification(vgpu, data); 1265 handle_g2v_notification(vgpu, data);
1269 break; 1266 break;
1270 /* add xhot and yhot to handled list to avoid error log */ 1267 /* add xhot and yhot to handled list to avoid error log */
1271 case _vgtif_reg(cursor_x_hot): 1268 case _vgtif_reg(cursor_x_hot):
@@ -1282,13 +1279,19 @@ static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
1282 case _vgtif_reg(execlist_context_descriptor_hi): 1279 case _vgtif_reg(execlist_context_descriptor_hi):
1283 break; 1280 break;
1284 case _vgtif_reg(rsv5[0])..._vgtif_reg(rsv5[3]): 1281 case _vgtif_reg(rsv5[0])..._vgtif_reg(rsv5[3]):
1282 invalid_write = true;
1285 enter_failsafe_mode(vgpu, GVT_FAILSAFE_INSUFFICIENT_RESOURCE); 1283 enter_failsafe_mode(vgpu, GVT_FAILSAFE_INSUFFICIENT_RESOURCE);
1286 break; 1284 break;
1287 default: 1285 default:
1286 invalid_write = true;
1288 gvt_vgpu_err("invalid pvinfo write offset %x bytes %x data %x\n", 1287 gvt_vgpu_err("invalid pvinfo write offset %x bytes %x data %x\n",
1289 offset, bytes, data); 1288 offset, bytes, data);
1290 break; 1289 break;
1291 } 1290 }
1291
1292 if (!invalid_write)
1293 write_vreg(vgpu, offset, p_data, bytes);
1294
1292 return 0; 1295 return 0;
1293} 1296}
1294 1297
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b69440cf41ea..75105a2c59ea 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12005,9 +12005,6 @@ intel_compare_link_m_n(const struct intel_link_m_n *m_n,
12005 m2_n2->gmch_m, m2_n2->gmch_n, !adjust) && 12005 m2_n2->gmch_m, m2_n2->gmch_n, !adjust) &&
12006 intel_compare_m_n(m_n->link_m, m_n->link_n, 12006 intel_compare_m_n(m_n->link_m, m_n->link_n,
12007 m2_n2->link_m, m2_n2->link_n, !adjust)) { 12007 m2_n2->link_m, m2_n2->link_n, !adjust)) {
12008 if (adjust)
12009 *m2_n2 = *m_n;
12010
12011 return true; 12008 return true;
12012 } 12009 }
12013 12010
@@ -13149,6 +13146,33 @@ static int calc_watermark_data(struct intel_atomic_state *state)
13149 return 0; 13146 return 0;
13150} 13147}
13151 13148
13149static void intel_crtc_check_fastset(struct intel_crtc_state *old_crtc_state,
13150 struct intel_crtc_state *new_crtc_state)
13151{
13152 struct drm_i915_private *dev_priv =
13153 to_i915(new_crtc_state->base.crtc->dev);
13154
13155 if (!intel_pipe_config_compare(dev_priv, old_crtc_state,
13156 new_crtc_state, true))
13157 return;
13158
13159 new_crtc_state->base.mode_changed = false;
13160 new_crtc_state->update_pipe = true;
13161
13162 /*
13163 * If we're not doing the full modeset we want to
13164 * keep the current M/N values as they may be
13165 * sufficiently different to the computed values
13166 * to cause problems.
13167 *
13168 * FIXME: should really copy more fuzzy state here
13169 */
13170 new_crtc_state->fdi_m_n = old_crtc_state->fdi_m_n;
13171 new_crtc_state->dp_m_n = old_crtc_state->dp_m_n;
13172 new_crtc_state->dp_m2_n2 = old_crtc_state->dp_m2_n2;
13173 new_crtc_state->has_drrs = old_crtc_state->has_drrs;
13174}
13175
13152/** 13176/**
13153 * intel_atomic_check - validate state object 13177 * intel_atomic_check - validate state object
13154 * @dev: drm device 13178 * @dev: drm device
@@ -13197,12 +13221,8 @@ static int intel_atomic_check(struct drm_device *dev,
13197 return ret; 13221 return ret;
13198 } 13222 }
13199 13223
13200 if (intel_pipe_config_compare(dev_priv, 13224 intel_crtc_check_fastset(to_intel_crtc_state(old_crtc_state),
13201 to_intel_crtc_state(old_crtc_state), 13225 pipe_config);
13202 pipe_config, true)) {
13203 crtc_state->mode_changed = false;
13204 pipe_config->update_pipe = true;
13205 }
13206 13226
13207 if (needs_modeset(crtc_state)) 13227 if (needs_modeset(crtc_state))
13208 any_ms = true; 13228 any_ms = true;