Commit 7b911adc authored by Tvrtko Ursulin's avatar Tvrtko Ursulin Committed by Daniel Vetter

drm/i915: Use fb modifiers in intel_pin_and_fence_fb_obj

And at the same time replace BUG() with a warning and handle it gracefuly.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 6a418fcd
...@@ -2215,8 +2215,8 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane, ...@@ -2215,8 +2215,8 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
WARN_ON(!mutex_is_locked(&dev->struct_mutex)); WARN_ON(!mutex_is_locked(&dev->struct_mutex));
switch (obj->tiling_mode) { switch (fb->modifier[0]) {
case I915_TILING_NONE: case DRM_FORMAT_MOD_NONE:
if (INTEL_INFO(dev)->gen >= 9) if (INTEL_INFO(dev)->gen >= 9)
alignment = 256 * 1024; alignment = 256 * 1024;
else if (IS_BROADWATER(dev) || IS_CRESTLINE(dev)) else if (IS_BROADWATER(dev) || IS_CRESTLINE(dev))
...@@ -2226,7 +2226,7 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane, ...@@ -2226,7 +2226,7 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
else else
alignment = 64 * 1024; alignment = 64 * 1024;
break; break;
case I915_TILING_X: case I915_FORMAT_MOD_X_TILED:
if (INTEL_INFO(dev)->gen >= 9) if (INTEL_INFO(dev)->gen >= 9)
alignment = 256 * 1024; alignment = 256 * 1024;
else { else {
...@@ -2234,11 +2234,12 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane, ...@@ -2234,11 +2234,12 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
alignment = 0; alignment = 0;
} }
break; break;
case I915_TILING_Y: case I915_FORMAT_MOD_Y_TILED:
WARN(1, "Y tiled bo slipped through, driver bug!\n"); WARN(1, "Y tiled bo slipped through, driver bug!\n");
return -EINVAL; return -EINVAL;
default: default:
BUG(); MISSING_CASE(fb->modifier[0]);
return -EINVAL;
} }
/* Note that the w/a also requires 64 PTE of padding following the /* Note that the w/a also requires 64 PTE of padding following the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment