Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4919429pxb; Tue, 5 Oct 2021 13:18:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtLODeLph1SeBHwP/dmnu2ku6VJMp/CoH2MXRinFF6jSqaMUIyckorA5defk1uuRsKd71x X-Received: by 2002:a17:90a:3fc4:: with SMTP id u4mr6049308pjm.127.1633465132765; Tue, 05 Oct 2021 13:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633465132; cv=none; d=google.com; s=arc-20160816; b=uo0CesPH1UZE6NhxSlSRqNqJcrMcISbSCWgCG8r9ap4z548dWARFI0HoyIc4CACmsk OLgV+1qz3ERbl7GQdRh9wch0MHPm1DF/lWb82cGWavCuDq+g9Mq3i5xsUXL8d84TXgnJ w6shqMwbpvXZrpVv0EbyqXxcFOAs6XKP4MlakK3O/VwizE1FRZUoeaFhWiS79T4YME0h /Nflfjv73eYC37hQpPmNEXVX5HN9f0rS1tKyYaSh4NSlWap0dsOt7S5U+eAOVC6bbazv +WUah2X1Bsyx+iNcfOj0liAYBevubK93qNJn9wOchtG9VwnjMiCq5R4PRehpgGra6oOC 8qgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BiKFws1LTfnXE8+X4ABwTgmNjXHoNfEwbCSS8ItVQas=; b=G27knOuu7LaTpIrKf8Jv6jrwfI6MobR0wZnvhHuV/t2sAQutA8YyLij0KaBDHQPIW/ fwFZd4kP/RCAyAT4rT2sI4KHUs6dfceIPHycTEZIu/ZmOeyNRC51pEiOjpTMUrPlKowL WcKMUnWa8bjVPMuQxVy5g2xTdRZXZx4KRVIX/ub58H3P02kl+c6Rwb8+4KtiH9L4DBCH nIMXGprm1Yx9SbsMC7Hy431LK0MLEjijwX59DhQZCvMP6a5UrtkcQnKL1ccrJ1gWmqaq xjSUiLaHxyhgIKtToOvqpt4igkw23YLFzFD7JtPDytLZr3KS0u7yQUGimorPbEhcx11w VsnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=co4EnEkf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si33680867pfj.172.2021.10.05.13.18.38; Tue, 05 Oct 2021 13:18:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=co4EnEkf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231181AbhJEUTU (ORCPT + 99 others); Tue, 5 Oct 2021 16:19:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233700AbhJEUTP (ORCPT ); Tue, 5 Oct 2021 16:19:15 -0400 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 016A2C06174E for ; Tue, 5 Oct 2021 13:17:25 -0700 (PDT) Received: by mail-qv1-xf36.google.com with SMTP id d20so458304qvm.8 for ; Tue, 05 Oct 2021 13:17:24 -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=BiKFws1LTfnXE8+X4ABwTgmNjXHoNfEwbCSS8ItVQas=; b=co4EnEkfrgrh7fi6J4fu/8uhxJYKeXyHmth9reo9jbIBZbS+fSN/s8x2BbsDKciN7U PKafyY2LqLULq3yg6bbKD/RzLNdPdqAxvt5+IwTSD7kmQWpCXtrjerrzI/RmwSuHpi5n thMYBJMtNrz/hx0XzHIZY8wj4wXK/EzXVBc+2hj8fjgy1fCv+WnbdoOGp0rO8oXUGD7d uQlaGj69Gk1I34xp3N+T7dDrgwi0J9fHHNiJns3abwigQAA+2dSc0+zBqPFSDwWa8z7f ll8aciJHLnIoJoWh8IL7AaN/oQdYnzjv3rbstXUaummgWw0AK3AjQ8wv66d/+Rn6zTMX GQEg== 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=BiKFws1LTfnXE8+X4ABwTgmNjXHoNfEwbCSS8ItVQas=; b=dC/2G3dFo7KYuhPoj90/cA1gKjbK0psHtFsrIRHv0NyaJWwk1FXlx0qC7x3dqGolyH hVJhjwbrPhxXU4vHV1OVa5D24K4Hr8v3D3Eog/8mbW/9cEpDDYU5oznOodWZcgxByMBE uMZ+ebFdZJz90VFrznN4nEDWrBJUc/ZjtmG2sNSWr72J9kSHBItddCRQE6X+49ppm6qB oX+v8bYD2mptmeQZLA7Z0iloRQWEfQXrbLnAH9KX5uEtG5ao3++ku0xbYawD5okPXnq4 uxYw7FEssfpIceMgZfU349IxFjZvOUMhUtF7OwL49edhRY0l1wnkdoPWMeuWmZ5R9tlQ fAjA== X-Gm-Message-State: AOAM532ZsvATrOHgL/4l5cfajZVU3C1VsssH+EhLa2fb29dddtnAc08Y vEdCQZ8nWIh/iJSPrliJJao3jlT/+JQaAg== X-Received: by 2002:ad4:4d07:: with SMTP id l7mr2128853qvl.32.1633465044206; Tue, 05 Oct 2021 13:17:24 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:125:9b98::1007]) by smtp.googlemail.com with ESMTPSA id j2sm13056905qta.84.2021.10.05.13.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 13:17:24 -0700 (PDT) From: Igor Matheus Andrade Torrente To: rodrigosiqueiramelo@gmail.com, melissa.srw@gmail.com Cc: Igor Matheus Andrade Torrente , hamohammed.sa@gmail.com, daniel@ffwll.ch, airlied@linux.ie, contact@emersion.fr, leandro.ribeiro@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, lkcamp@lists.libreplanetbr.org Subject: [PATCH 2/6] drm: vkms: Alloc the compose frame using vzalloc Date: Tue, 5 Oct 2021 17:16:33 -0300 Message-Id: <20211005201637.58563-3-igormtorrente@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211005201637.58563-1-igormtorrente@gmail.com> References: <20211005201637.58563-1-igormtorrente@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Matheus Andrade 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); } /* -- 2.30.2