From patchwork Tue Oct 26 11:34:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Matheus Andrade Torrente X-Patchwork-Id: 12584635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3F2CC433F5 for ; Tue, 26 Oct 2021 11:34:35 +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 7BFC8604E9 for ; Tue, 26 Oct 2021 11:34:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7BFC8604E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0632C89CC4; Tue, 26 Oct 2021 11:34:34 +0000 (UTC) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5B41A89CC4 for ; Tue, 26 Oct 2021 11:34:32 +0000 (UTC) Received: by mail-qt1-x831.google.com with SMTP id v17so13154521qtp.1 for ; Tue, 26 Oct 2021 04:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wqMc7i1j40Y6DJkM28XSTOEIlGNuQurfBNScJR7ESu8=; b=Goj4gTT4O5t+YUsAYs5tnCbkO/VEDkjlieeYIWOKIAEPRUn/SkOfJbSxy04aq1WzEK PF8mUm23zlMbaFjYu5D1j8qebNn+BaxC31yvDgRFwx6kVoCdvjpN561AzgAzYu/nRM+P GaS2F4dDeA4YyjSiXx2KNPtfoxenaP/Qk949evKwoiVBB1IWw++j1oA9MR/NEc8fux24 USLGTNYtVy6MWPEd1dLprhmyGvt1+2iKE1g2PCkfN0wZS8cgsmwlODFibQmzHu2OKsum nERzYk7X8uGpyUoQz9+rmxA6GDyjTLx+IxQCYF/AFJbgh7+8+guT6ZfnikszvbCVQz4J KCYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wqMc7i1j40Y6DJkM28XSTOEIlGNuQurfBNScJR7ESu8=; b=bvU3dyZXF78ciIqMH+f1KKzFOIZmRp1ifBQ4TRvkIB4Szkc9u8Erd7t4WA5JdMcUQH V0PztouWZITKtY31+MK/jomFParzkLeiZgwZXOQHww4nVIZ7I0ZQ7sihNktacV+HYenY SvvTOIQA9QZIby07Bnh+ncWVA7b0ua/Nml5Aet8Num2obmHLz8oVA+N+8jxleNtE3s60 RA2kLE4/nCl/bly3rmHZoWrW+sF0dao5QIEzFmpMZufzAtqzy6dMdtssqEsdJmyDUQsT EH+zIHhxLMWYTcp5l9YotkIgm+Me8PhmrURVxpVcvC2lZ7mLUMU07/Z50TjfdPh7Ncoj dBDQ== X-Gm-Message-State: AOAM533WFMiQAbLI9aCH9V/oc3Q1sISoKHhyJKqkdHzRpSYvBbeCdRCY XE5BF6unrdLNeCrO5rwduyA= X-Google-Smtp-Source: ABdhPJy58bgE5ig1WKtumIXsNvAjAio5QYt9toq4UiCMJEzyf6moIAN9g91DGOK5SQKnlR/OC0ovyg== X-Received: by 2002:a05:622a:1a2a:: with SMTP id f42mr24307335qtb.381.1635248071550; Tue, 26 Oct 2021 04:34:31 -0700 (PDT) Received: from localhost.localdomain ([2804:431:c7f4:5469:b11e:67b8:49d2:1744]) by smtp.googlemail.com with ESMTPSA id f3sm11117691qko.32.2021.10.26.04.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 04:34:31 -0700 (PDT) From: Igor Torrente To: rodrigosiqueiramelo@gmail.com, melissa.srw@gmail.com, ppaalanen@gmail.com, tzimmermann@suse.de Cc: Igor Torrente , hamohammed.sa@gmail.com, daniel@ffwll.ch, airlied@linux.ie, contact@emersion.fr, leandro.ribeiro@collabora.com, dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/8] drm: vkms: Alloc the compose frame using vzalloc Date: Tue, 26 Oct 2021 08:34:02 -0300 Message-Id: <20211026113409.7242-3-igormtorrente@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026113409.7242-1-igormtorrente@gmail.com> References: <20211026113409.7242-1-igormtorrente@gmail.com> MIME-Version: 1.0 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently, the memory to the composition frame is being allocated using the kzmalloc. This comes with the limitation of maximum size of one page size(which in the x86_64 is 4Kb and 4MB for default and hugepage respectively). Somes test of igt (e.g. kms_plane@pixel-format) uses more than 4MB when testing some pixel formats like ARGB16161616. This problem is addessed by allocating the memory using kvzalloc that circunvents this limitation. Signed-off-by: Igor Torrente --- drivers/gpu/drm/vkms/vkms_composer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index 9e8204be9a14..82f79e508f81 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -180,7 +180,7 @@ static int compose_active_planes(void **vaddr_out, int i; if (!*vaddr_out) { - *vaddr_out = kzalloc(gem_obj->size, GFP_KERNEL); + *vaddr_out = kvzalloc(gem_obj->size, GFP_KERNEL); if (!*vaddr_out) { DRM_ERROR("Cannot allocate memory for output frame."); return -ENOMEM; @@ -263,7 +263,7 @@ void vkms_composer_worker(struct work_struct *work) crtc_state); if (ret) { if (ret == -EINVAL && !wb_pending) - kfree(vaddr_out); + kvfree(vaddr_out); return; } @@ -275,7 +275,7 @@ void vkms_composer_worker(struct work_struct *work) crtc_state->wb_pending = false; spin_unlock_irq(&out->composer_lock); } else { - kfree(vaddr_out); + kvfree(vaddr_out); } /*