]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/i915: Check overlay stride errata for i830 and i845
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 12 Jul 2010 18:35:38 +0000 (19:35 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Aug 2010 17:54:15 +0000 (10:54 -0700)
commit a1efd14a99483a4fb9308902397ed86b69454c99 upstream.

Apparently i830 and i845 cannot handle any stride that is not a multiple
of 256, unlike their brethren which do support 64 byte aligned strides.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/gpu/drm/i915/intel_overlay.c

index 6d524a1fc271331939c0e3625e75e08e45376d61..5ca2470b860bf2994ddab2d8cea289fb1989bcd6 100644 (file)
@@ -950,7 +950,7 @@ static int check_overlay_src(struct drm_device *dev,
            || rec->src_width < N_HORIZ_Y_TAPS*4)
                return -EINVAL;
 
-       /* check alingment constrains */
+       /* check alignment constraints */
        switch (rec->flags & I915_OVERLAY_TYPE_MASK) {
                case I915_OVERLAY_RGB:
                        /* not implemented */
@@ -982,7 +982,10 @@ static int check_overlay_src(struct drm_device *dev,
                return -EINVAL;
 
        /* stride checking */
-       stride_mask = 63;
+       if (IS_I830(dev) || IS_845G(dev))
+               stride_mask = 255;
+       else
+               stride_mask = 63;
 
        if (rec->stride_Y & stride_mask || rec->stride_UV & stride_mask)
                return -EINVAL;