@@ -7729,6 +7729,7 @@ int intel_framebuffer_init(struct drm_device *dev,
struct drm_i915_gem_object *obj)
{
int ret;
+ unsigned int align = drm_format_plane_cpp(mode_cmd->pixel_format, 0);
if (obj->tiling_mode == I915_TILING_Y)
return -EINVAL;
@@ -7768,6 +7769,7 @@ int intel_framebuffer_init(struct drm_device *dev,
case DRM_FORMAT_UYVY:
case DRM_FORMAT_YVYU:
case DRM_FORMAT_VYUY:
+ align <<= 1;
if (INTEL_INFO(dev)->gen < 6)
return -EINVAL;
break;
@@ -7776,6 +7778,9 @@ int intel_framebuffer_init(struct drm_device *dev,
return -EINVAL;
}
+ if (mode_cmd->offsets[0] % align)
+ return -EINVAL;
+
ret = drm_framebuffer_init(dev, &intel_fb->base, &intel_fb_funcs);
if (ret) {
DRM_ERROR("framebuffer init failed %d\n", ret);