drm/i915: Fix computation of pitch for dumb bo creator
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 19 Mar 2011 08:21:45 +0000 (08:21 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 23 Mar 2011 09:17:00 +0000 (09:17 +0000)
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem.c

index c5dfb59e13d3448288516e25a3ebf82d5a531f18..0b99c30bb19c2d13a7515c29517e5072d154a87d 100644 (file)
@@ -224,7 +224,7 @@ i915_gem_dumb_create(struct drm_file *file,
                     struct drm_mode_create_dumb *args)
 {
        /* have to work out size/pitch and return them */
-       args->pitch = ALIGN(args->width & ((args->bpp + 1) / 8), 64);
+       args->pitch = ALIGN(args->width * ((args->bpp + 7) / 8), 64);
        args->size = args->pitch * args->height;
        return i915_gem_create(file, dev,
                               args->size, &args->handle);