From patchwork Mon Apr 18 15:42:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 8873321 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 449FD9F39D for ; Mon, 18 Apr 2016 15:42:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6A9A82026F for ; Mon, 18 Apr 2016 15:42:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 05AE9201DD for ; Mon, 18 Apr 2016 15:42:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7600B6E3FB; Mon, 18 Apr 2016 15:42:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6071A6E3F2 for ; Mon, 18 Apr 2016 15:42:41 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id u3IFgcMY026443; Mon, 18 Apr 2016 10:42:38 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3IFgcfF010165; Mon, 18 Apr 2016 10:42:38 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Mon, 18 Apr 2016 10:42:38 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3IFgZu3004642; Mon, 18 Apr 2016 10:42:37 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCH 2/4] drm/omap: remove unnecessary pitch round-up Date: Mon, 18 Apr 2016 18:42:12 +0300 Message-ID: <1460994134-12587-2-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460994134-12587-1-git-send-email-tomi.valkeinen@ti.com> References: <1460994134-12587-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Cc: Tomi Valkeinen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 omapdrm checks if the pixel stride is divisible by 8. This is meant to ensure that the byte stride is 32, which is required by SGX. The check is not correct, as it checks for pixels, not bytes, and thus needlessly increases the stride for, e.g., NV12. Also, SGX driver is not supported in the mainline, and the TI's SGX driver nowadays does the memory allocation itself and doesn't rely on omapdrm to figure out the correct pitch. So we can just remove the whole roundup. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/omap_drv.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h index 0fbe17d0ec6f..bdce6ec64a07 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/drivers/gpu/drm/omapdrm/omap_drv.h @@ -244,10 +244,7 @@ static inline int align_pitch(int pitch, int width, int bpp) int bytespp = (bpp + 7) / 8; /* in case someone tries to feed us a completely bogus stride: */ pitch = max(pitch, width * bytespp); - /* PVR needs alignment to 8 pixels.. right now that is the most - * restrictive stride requirement.. - */ - return roundup(pitch, 8 * bytespp); + return pitch; } /* map crtc to vblank mask */