From patchwork Tue Jun 1 14:28:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 12291459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97EAEC47092 for ; Tue, 1 Jun 2021 14:37:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55A656124B for ; Tue, 1 Jun 2021 14:37:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55A656124B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFEF06EA80; Tue, 1 Jun 2021 14:37:22 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id A1A766EA80 for ; Tue, 1 Jun 2021 14:37:21 +0000 (UTC) IronPort-SDR: kDzCnK60zstCtHclgJDn3UdU4WfOzYYAKXLtAj27IZx6H/cdKfOK4qKXAdpYSkpIKh7ov7aHzu fuGD6xInSB8w== X-IronPort-AV: E=McAfee;i="6200,9189,10002"; a="289179090" X-IronPort-AV: E=Sophos;i="5.83,240,1616482800"; d="scan'208";a="289179090" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2021 07:37:16 -0700 IronPort-SDR: Z4x05s+R3wTNeCiK9nNcyFozOGRDBDclv+s+jc9ew9MDB6982ZekRGeK4MwPu4wGrjo0a/4lsJ mjX0RoHR+Scw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,240,1616482800"; d="scan'208";a="467076145" Received: from vsrini4-xps-8920.iind.intel.com (HELO localhost.localdomain) ([10.223.163.28]) by fmsmga004.fm.intel.com with ESMTP; 01 Jun 2021 07:37:14 -0700 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org Date: Tue, 1 Jun 2021 19:58:14 +0530 Message-Id: <1622557694-9777-1-git-send-email-vidya.srinivas@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH] [RFC] drm/vgem: Fix the pitch to be 64 byte aligned for Intel platforms X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" User space like igt/kms_prime use vgem_gem_dumb_create before reaching i915_gem_dumb_create (which has 64 byte alignment done). For panel resolutions like 1366x768, the pitch calculated by vgem is not 64 byte aligned. This results in frame buffer not being created by intel_framebuffer_init. Test: igt/kms_prime with panel resolution 1366x768 Change-Id: If68914421b1a9432a73af96c8b426045772629eb Signed-off-by: Vidya Srinivas --- drivers/gpu/drm/vgem/vgem_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index fa54a6d1403d..48535c88aa27 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -215,7 +215,7 @@ static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_gem_object *gem_object; u64 pitch, size; - pitch = args->width * DIV_ROUND_UP(args->bpp, 8); + pitch = ALIGN(args->width * DIV_ROUND_UP(args->bpp, 8), 64); size = args->height * pitch; if (size == 0) return -EINVAL;