aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-26 07:42:24 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-26 09:25:23 -0400
commit88595ac9ad199fc2e09270ec92e1ff0806033b83 (patch)
tree020898f0c672b06012dd247dda2520324b7184c6 /drivers/gpu/drm/i915/intel_display.c
parentf6936e2902a7a6be52112e735a280aa2155b2c71 (diff)
drm/i915: always preserve bios swizzling
Currently we only set preserve_bios_swizzling when the initial fb is shared and totally miss the single-screen case. Fix this by consolidating all the logic for both cases. This seems to go back to when swizzle preservation was originally merged in commit d9ceb8163339134bd3ffb9fb87a0db4698283e32 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Thu Oct 9 12:57:43 2014 -0700 drm/i915: preserve swizzle settings if necessary v4 Cc: Kristian Høgsberg <hoegsberg@gmail.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1142ffce66ea..9d314f889613 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2543,14 +2543,11 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
2543 mode_cmd.flags = DRM_MODE_FB_MODIFIERS; 2543 mode_cmd.flags = DRM_MODE_FB_MODIFIERS;
2544 2544
2545 mutex_lock(&dev->struct_mutex); 2545 mutex_lock(&dev->struct_mutex);
2546
2547 if (intel_framebuffer_init(dev, to_intel_framebuffer(fb), 2546 if (intel_framebuffer_init(dev, to_intel_framebuffer(fb),
2548 &mode_cmd, obj)) { 2547 &mode_cmd, obj)) {
2549 DRM_DEBUG_KMS("intel fb init failed\n"); 2548 DRM_DEBUG_KMS("intel fb init failed\n");
2550 goto out_unref_obj; 2549 goto out_unref_obj;
2551 } 2550 }
2552
2553 obj->frontbuffer_bits = INTEL_FRONTBUFFER_PRIMARY(crtc->pipe);
2554 mutex_unlock(&dev->struct_mutex); 2551 mutex_unlock(&dev->struct_mutex);
2555 2552
2556 DRM_DEBUG_KMS("initial plane fb obj %p\n", obj); 2553 DRM_DEBUG_KMS("initial plane fb obj %p\n", obj);
@@ -2585,19 +2582,15 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
2585 struct drm_crtc *c; 2582 struct drm_crtc *c;
2586 struct intel_crtc *i; 2583 struct intel_crtc *i;
2587 struct drm_i915_gem_object *obj; 2584 struct drm_i915_gem_object *obj;
2585 struct drm_plane *primary = intel_crtc->base.primary;
2586 struct drm_framebuffer *fb;
2588 2587
2589 if (!plane_config->fb) 2588 if (!plane_config->fb)
2590 return; 2589 return;
2591 2590
2592 if (intel_alloc_initial_plane_obj(intel_crtc, plane_config)) { 2591 if (intel_alloc_initial_plane_obj(intel_crtc, plane_config)) {
2593 struct drm_plane *primary = intel_crtc->base.primary; 2592 fb = &plane_config->fb->base;
2594 2593 goto valid_fb;
2595 primary->fb = &plane_config->fb->base;
2596 primary->state->crtc = &intel_crtc->base;
2597 primary->crtc = &intel_crtc->base;
2598 update_state_fb(primary);
2599
2600 return;
2601 } 2594 }
2602 2595
2603 kfree(plane_config->fb); 2596 kfree(plane_config->fb);
@@ -2615,25 +2608,29 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
2615 if (!i->active) 2608 if (!i->active)
2616 continue; 2609 continue;
2617 2610
2618 obj = intel_fb_obj(c->primary->fb); 2611 fb = c->primary->fb;
2619 if (obj == NULL) 2612 if (!fb)
2620 continue; 2613 continue;
2621 2614
2615 obj = intel_fb_obj(fb);
2622 if (i915_gem_obj_ggtt_offset(obj) == plane_config->base) { 2616 if (i915_gem_obj_ggtt_offset(obj) == plane_config->base) {
2623 struct drm_plane *primary = intel_crtc->base.primary; 2617 drm_framebuffer_reference(fb);
2624 2618 goto valid_fb;
2625 if (obj->tiling_mode != I915_TILING_NONE)
2626 dev_priv->preserve_bios_swizzle = true;
2627
2628 drm_framebuffer_reference(c->primary->fb);
2629 primary->fb = c->primary->fb;
2630 primary->state->crtc = &intel_crtc->base;
2631 primary->crtc = &intel_crtc->base;
2632 update_state_fb(intel_crtc->base.primary);
2633 obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
2634 break;
2635 } 2619 }
2636 } 2620 }
2621
2622 return;
2623
2624valid_fb:
2625 obj = intel_fb_obj(fb);
2626 if (obj->tiling_mode != I915_TILING_NONE)
2627 dev_priv->preserve_bios_swizzle = true;
2628
2629 primary->fb = fb;
2630 primary->state->crtc = &intel_crtc->base;
2631 primary->crtc = &intel_crtc->base;
2632 update_state_fb(primary);
2633 obj->frontbuffer_bits |= INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
2637} 2634}
2638 2635
2639static void i9xx_update_primary_plane(struct drm_crtc *crtc, 2636static void i9xx_update_primary_plane(struct drm_crtc *crtc,