drm/i915: Use fb modifiers in intel_pin_and_fence_fb_obj
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 10 Feb 2015 17:16:15 +0000 (17:16 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 13 Feb 2015 22:28:21 +0000 (23:28 +0100)
And at the same time replace BUG() with a warning and handle it gracefuly.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index ddf890767461eddc4cab319a3ca27993b3f718d1..e0e9348442e7fecdc796c7064dafc6c84e7b450e 100644 (file)
@@ -2215,8 +2215,8 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
 
        WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
-       switch (obj->tiling_mode) {
-       case I915_TILING_NONE:
+       switch (fb->modifier[0]) {
+       case DRM_FORMAT_MOD_NONE:
                if (INTEL_INFO(dev)->gen >= 9)
                        alignment = 256 * 1024;
                else if (IS_BROADWATER(dev) || IS_CRESTLINE(dev))
@@ -2226,7 +2226,7 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
                else
                        alignment = 64 * 1024;
                break;
-       case I915_TILING_X:
+       case I915_FORMAT_MOD_X_TILED:
                if (INTEL_INFO(dev)->gen >= 9)
                        alignment = 256 * 1024;
                else {
@@ -2234,11 +2234,12 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
                        alignment = 0;
                }
                break;
-       case I915_TILING_Y:
+       case I915_FORMAT_MOD_Y_TILED:
                WARN(1, "Y tiled bo slipped through, driver bug!\n");
                return -EINVAL;
        default:
-               BUG();
+               MISSING_CASE(fb->modifier[0]);
+               return -EINVAL;
        }
 
        /* Note that the w/a also requires 64 PTE of padding following the