From patchwork Mon Jan 20 19:26:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 3514191 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8112EC02DC for ; Mon, 20 Jan 2014 19:26:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA6AB2010E for ; Mon, 20 Jan 2014 19:26:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DF38F200FF for ; Mon, 20 Jan 2014 19:26:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 13DA2FADB6; Mon, 20 Jan 2014 11:26:52 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f45.google.com (mail-bk0-f45.google.com [209.85.214.45]) by gabe.freedesktop.org (Postfix) with ESMTP id E5832FADB6 for ; Mon, 20 Jan 2014 11:26:49 -0800 (PST) Received: by mail-bk0-f45.google.com with SMTP id v16so2659248bkz.4 for ; Mon, 20 Jan 2014 11:26:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VlgV5cwfg3WjyH5+wOKhuasO2OztwSbZiYshDMamGKM=; b=zKg60jSnMF3+QRqnPQrmUuTNZwiRaCCifxJj9gAiNHGc0gweIXUiqM2BvU1VNsfHH8 oxPKr+KWa8kfj59ZXZdvLEj2tVqzZjQm5/cPht854ARrFE2f+csCvnoOrG2lGMVN9X7f QMbdbSpHesgeXT8EzueUYkFdTMuecMzTlTxmS7UeJ+O7cflKrbFE1ENvoxYKCgWVR2hP 9pUBAy7ggz38Hob+oNB/7du4h4eZ0wVR5WNbYa2m6Dpz2UzU+ASb8Zp/P8HVKPQwKS/f t4YAxwWB1cFpbp/oq0pHAtB8APjA34AkKrPLgw/9m0z5+/FOx0isycvn/IvlB4rBajtc pCuQ== X-Received: by 10.204.232.8 with SMTP id js8mr20548bkb.76.1390246008948; Mon, 20 Jan 2014 11:26:48 -0800 (PST) Received: from david-ub.localdomain (stgt-5f7292c1.pool.mediaWays.net. [95.114.146.193]) by mx.google.com with ESMTPSA id tf11sm1780282bkb.17.2014.01.20.11.26.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Jan 2014 11:26:48 -0800 (PST) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/7] drm/udl: fix Bpp calculation in dumb_create() Date: Mon, 20 Jan 2014 20:26:24 +0100 Message-Id: <1390245989-13280-2-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1390245989-13280-1-git-send-email-dh.herrmann@gmail.com> References: <1390245989-13280-1-git-send-email-dh.herrmann@gmail.com> Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Probably a typo.. we obviously need "(bpp + 7) / 8" instead of "(bpp + 1) / 8". Unlikely to be hit in any sane code, but lets be safe. Signed-off-by: David Herrmann --- drivers/gpu/drm/udl/udl_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c index 8d67b94..df963a1 100644 --- a/drivers/gpu/drm/udl/udl_gem.c +++ b/drivers/gpu/drm/udl/udl_gem.c @@ -60,7 +60,7 @@ int udl_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args) { - args->pitch = args->width * ((args->bpp + 1) / 8); + args->pitch = args->width * ((args->bpp + 7) / 8); args->size = args->pitch * args->height; return udl_gem_create(file, dev, args->size, &args->handle);