From mboxrd@z Thu Jan 1 00:00:00 1970 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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 76133C47097 for ; Thu, 3 Jun 2021 15:03:48 +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 4C59C6023D for ; Thu, 3 Jun 2021 15:03:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C59C6023D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 935EE6F498; Thu, 3 Jun 2021 15:03:37 +0000 (UTC) Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 306746F494 for ; Thu, 3 Jun 2021 15:03:36 +0000 (UTC) Received: by mail-ej1-x62e.google.com with SMTP id k25so4217778eja.9 for ; Thu, 03 Jun 2021 08:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c2sMhn9FFyBCT6ijxYFstqFFhQ5iAR+T1N0Su8AmZKc=; b=b5YGKhW67xjkGqardlMLX0byeC1Hyh6KG+XBWd6aJg4q/02YB5hABUkP6RtJgcy9SW fTH71xqlrt5vu9rZqDoRbWmVf8ZlJQ5MxzdttpG2TBLLZVmIsyBV9Qzl9bh4rLJWEGE+ USX+9Msqg+5S7cGjRlEtRnqlWMbVAGZkG+8MI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c2sMhn9FFyBCT6ijxYFstqFFhQ5iAR+T1N0Su8AmZKc=; b=e4uV0zudCzE7t2IkTdS0YtocwLuOV50CSJ2ioQqy35vXO0Ca2ym+y8hUjV11Rp6dSq 50dpLVvNiEamn05GLlAPmNU2mUKbfyyGNtTbczoriWi5UBn0KWlBXjQcNnCAv8LDFUxi GhnpqzkBgB7wfz5V0gjw3RT9p4GAHvON1E3Dmvs9Rm0926AQsJ00+b2WXGJ2OvYZNZU1 8BiUxObpX33MfFlJ1cE6NKVuoiuVrFI6NZkgmooAfcsvoy8jbNiMisQYXjdwkO/ZogYI vXjmYUXMnwwXJ+aVU1Ip0pfLqLYtn3TePwu5YrLdIDN/FWQe8Qzz5W4wPFgEuR6RXStc gp4g== X-Gm-Message-State: AOAM531LlBgt3pcAwBM85mOnzXjN3Cv07Yrg+dcJ5E3am+K+uRpf9WxA Cyb2O+PystNFvjID81VdW25rdw== X-Google-Smtp-Source: ABdhPJx3yZPNIGc9E+54yTxqnviDJ/6ql0UunR/RnTxUjYfQu8JPACwbGAyELgPfSP1+xUfW4uPwDQ== X-Received: by 2002:a17:906:e104:: with SMTP id gj4mr42874ejb.350.1622732614813; Thu, 03 Jun 2021 08:03:34 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id hz10sm1621791ejc.40.2021.06.03.08.03.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 08:03:34 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH v2 3/4] drm/shmem-helper: Align to page size in dumb_create Date: Thu, 3 Jun 2021 17:03:25 +0200 Message-Id: <20210603150326.1326658-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210603150326.1326658-1-daniel.vetter@ffwll.ch> References: <20210603150326.1326658-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Daniel Vetter , DRI Development , Thomas Zimmermann , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" shmem helpers seem a bit sloppy here by automatically rounding up when actually creating the buffer, which results in under-reporting of what we actually have. Caught by igt/vgem_basic tests. Acked-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter --- drivers/gpu/drm/drm_gem_shmem_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 32f1d7601ec6..2985744b4300 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -506,13 +506,13 @@ int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_device *dev, if (!args->pitch || !args->size) { args->pitch = min_pitch; - args->size = args->pitch * args->height; + args->size = PAGE_ALIGN(args->pitch * args->height); } else { /* ensure sane minimum values */ if (args->pitch < min_pitch) args->pitch = min_pitch; if (args->size < args->pitch * args->height) - args->size = args->pitch * args->height; + args->size = PAGE_ALIGN(args->pitch * args->height); } shmem = drm_gem_shmem_create_with_handle(file, dev, args->size, &args->handle); -- 2.31.0 From mboxrd@z Thu Jan 1 00:00:00 1970 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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 AC7BFC47082 for ; Thu, 3 Jun 2021 15:03:47 +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 7BB8A613E3 for ; Thu, 3 Jun 2021 15:03:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BB8A613E3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch 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 738366F49B; Thu, 3 Jun 2021 15:03:37 +0000 (UTC) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40CDD6F495 for ; Thu, 3 Jun 2021 15:03:36 +0000 (UTC) Received: by mail-ej1-x636.google.com with SMTP id a11so9015328ejf.3 for ; Thu, 03 Jun 2021 08:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c2sMhn9FFyBCT6ijxYFstqFFhQ5iAR+T1N0Su8AmZKc=; b=b5YGKhW67xjkGqardlMLX0byeC1Hyh6KG+XBWd6aJg4q/02YB5hABUkP6RtJgcy9SW fTH71xqlrt5vu9rZqDoRbWmVf8ZlJQ5MxzdttpG2TBLLZVmIsyBV9Qzl9bh4rLJWEGE+ USX+9Msqg+5S7cGjRlEtRnqlWMbVAGZkG+8MI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c2sMhn9FFyBCT6ijxYFstqFFhQ5iAR+T1N0Su8AmZKc=; b=ppuJNiYemHIDUtS+RUznOlc/KpFDTe7NvqfPFTpGDWo/mT3ynZ18ayXQqlZpc6AWUT JOxXWyjLLDbUJ9FrKVcvuPtLBjptui1pQqEndW9oHE1WwIcLRUPMzWptGIgpaPxJLFkD 2tYP1XdWD55qQTgfDinIwaTujrbPjstDfmBySdjghkswJIYSYeb2Rsu7+vxqEboq9UQs KqF6jO3/9trLRyzC5m/mD1t8ChtD1p8g5YII9NsWvdo+2Ol6YFkjdPGTpp1P9v7JkFJs gxQ7Hg8+WOhhRiPAD/YpRbW4+lxGz3vaADzZ+LJ9GvKLNAIm8ZUuTwuJ+jqRwbVEhYUD GwOw== X-Gm-Message-State: AOAM531Z/ttPRCx6hdprZBKI+Lo7evLwdBQith/uvjtXZdIwNrw/JvLX MlyTdRnAMrxmWwWCIKemnQjPBEm07BwMNA== X-Google-Smtp-Source: ABdhPJx3yZPNIGc9E+54yTxqnviDJ/6ql0UunR/RnTxUjYfQu8JPACwbGAyELgPfSP1+xUfW4uPwDQ== X-Received: by 2002:a17:906:e104:: with SMTP id gj4mr42874ejb.350.1622732614813; Thu, 03 Jun 2021 08:03:34 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id hz10sm1621791ejc.40.2021.06.03.08.03.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 08:03:34 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 3 Jun 2021 17:03:25 +0200 Message-Id: <20210603150326.1326658-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210603150326.1326658-1-daniel.vetter@ffwll.ch> References: <20210603150326.1326658-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 3/4] drm/shmem-helper: Align to page size in dumb_create 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: , Cc: David Airlie , Daniel Vetter , Maxime Ripard , DRI Development , Thomas Zimmermann , Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" shmem helpers seem a bit sloppy here by automatically rounding up when actually creating the buffer, which results in under-reporting of what we actually have. Caught by igt/vgem_basic tests. Acked-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter --- drivers/gpu/drm/drm_gem_shmem_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 32f1d7601ec6..2985744b4300 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -506,13 +506,13 @@ int drm_gem_shmem_dumb_create(struct drm_file *file, struct drm_device *dev, if (!args->pitch || !args->size) { args->pitch = min_pitch; - args->size = args->pitch * args->height; + args->size = PAGE_ALIGN(args->pitch * args->height); } else { /* ensure sane minimum values */ if (args->pitch < min_pitch) args->pitch = min_pitch; if (args->size < args->pitch * args->height) - args->size = args->pitch * args->height; + args->size = PAGE_ALIGN(args->pitch * args->height); } shmem = drm_gem_shmem_create_with_handle(file, dev, args->size, &args->handle); -- 2.31.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx