aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2015-02-05 14:24:25 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-13 17:28:05 -0500
commitfb9981aa675eb7b398849915364916fd98833cfa (patch)
tree3b9aa71f002020b8eb2f5462806617d84c4af84b
parent2d14030b1a9d0e89cfdca6f16851e2eac8cb4de0 (diff)
drm/i915: Fix atomic state when reusing the firmware fb
Right now, we get a warning when taking over the firmware fb: [drm:drm_atomic_plane_check] FB set but no CRTC with the following backtrace: [<ffffffffa010339d>] drm_atomic_check_only+0x35d/0x510 [drm] [<ffffffffa0103567>] drm_atomic_commit+0x17/0x60 [drm] [<ffffffffa00a6ccd>] drm_atomic_helper_plane_set_property+0x8d/0xd0 [drm_kms_helper] [<ffffffffa00f1fed>] drm_mode_plane_set_obj_prop+0x2d/0x90 [drm] [<ffffffffa00a8a1b>] restore_fbdev_mode+0x6b/0xf0 [drm_kms_helper] [<ffffffffa00aa969>] drm_fb_helper_restore_fbdev_mode_unlocked+0x29/0x80 [drm_kms_helper] [<ffffffffa00aa9e2>] drm_fb_helper_set_par+0x22/0x50 [drm_kms_helper] [<ffffffffa050a71a>] intel_fbdev_set_par+0x1a/0x60 [i915] [<ffffffff813ad444>] fbcon_init+0x4f4/0x580 That's because we update the plane state with the fb from the firmware, but we never associate the plane to that CRTC. We don't quite have the full DRM take over from HW state just yet, so fake enough of the plane atomic state to pass the checks. v2: Fix the state on which we set the CRTC in the case we're sharing the initial fb with another pipe. (Matt) Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 86cbc771bce6..074f204fdc35 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2439,8 +2439,12 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc,
2439 return; 2439 return;
2440 2440
2441 if (intel_alloc_plane_obj(intel_crtc, plane_config)) { 2441 if (intel_alloc_plane_obj(intel_crtc, plane_config)) {
2442 intel_crtc->base.primary->fb = &plane_config->fb->base; 2442 struct drm_plane *primary = intel_crtc->base.primary;
2443 update_state_fb(intel_crtc->base.primary); 2443
2444 primary->fb = &plane_config->fb->base;
2445 primary->state->crtc = &intel_crtc->base;
2446 update_state_fb(primary);
2447
2444 return; 2448 return;
2445 } 2449 }
2446 2450
@@ -2464,11 +2468,14 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc,
2464 continue; 2468 continue;
2465 2469
2466 if (i915_gem_obj_ggtt_offset(obj) == plane_config->base) { 2470 if (i915_gem_obj_ggtt_offset(obj) == plane_config->base) {
2471 struct drm_plane *primary = intel_crtc->base.primary;
2472
2467 if (obj->tiling_mode != I915_TILING_NONE) 2473 if (obj->tiling_mode != I915_TILING_NONE)
2468 dev_priv->preserve_bios_swizzle = true; 2474 dev_priv->preserve_bios_swizzle = true;
2469 2475
2470 drm_framebuffer_reference(c->primary->fb); 2476 drm_framebuffer_reference(c->primary->fb);
2471 intel_crtc->base.primary->fb = c->primary->fb; 2477 primary->fb = c->primary->fb;
2478 primary->state->crtc = &intel_crtc->base;
2472 update_state_fb(intel_crtc->base.primary); 2479 update_state_fb(intel_crtc->base.primary);
2473 obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe); 2480 obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
2474 break; 2481 break;