Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1160478pxb; Fri, 21 Jan 2022 11:08:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwoY3kwjeCbX0PeMkorKSCZwmE91TcLtG4rM0DSEQNQSLiXn6RJ2JeE8YCoM1/3MqrRprVO X-Received: by 2002:a63:bf4b:: with SMTP id i11mr3848114pgo.214.1642792090246; Fri, 21 Jan 2022 11:08:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642792090; cv=none; d=google.com; s=arc-20160816; b=veTnjhc7y42WZTJSvypWOouAlTh8boJaWnf8ny9FKHfFLOke0jk8q8j51dLj8PEDHr gbUNQqphJgbeDxEw3i3etiXh7zBal5Odh27aTUiqXxoSPXbkrIuzOIeD17M4WNuf4KZI ibx+BrFG/sTKVIqWjFwXN6Izr7wlfpgCtzn53UebBKdg9oz9PZz9PwP9Wpt/A0MqDCL6 MxtxYX7bK3bvoEX8HBYKXDSHpJu3d/vcwcpFPrDiaxTibsIYCBg1cdXMH/kJEWunsAa+ aWK+EObHca3nzgsgqpYpbRZPdqZzFLMccQHTFdkEixlXTsKiKXvpFp0/qdVL6/Osol8w 4CSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=3V1hkQQ8p02w19W2KJ4UIkOLnzPRTwmn+qldd2MXUPQ=; b=tJFaWujsNEIPXAvjbmBCctrJiWS3v8sPug1/jWfLpNhkYcwJbJZ/SKVi1C2wA3SsH2 0dR7ZX3tCI/9isi37sJSqiXtODITB+8KxIxMg+6kKmocvNJno4EsVFo0HP4ox5TLOuko ey2f4mGowOK7EgC8W2YgvSij+ob7O7ST8hXLzhsh3ISHC00/UUDB9TxypbBrugOr2nwD hdqhMjmw/3HQFb3d8HL58frT8PhL/Q23AtZ3dtgp5Uy9T50phshtjSH7XZlqSXloW2gE JqYI7RiE7u4z+x0r/lXv5vITijpIzTwyHt0lUK8cAjL5gaskaySEG1/ULGvmh0+YoKN2 Iy5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UTo4S6Cn; 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 m4si6554827plx.120.2022.01.21.11.07.57; Fri, 21 Jan 2022 11:08:10 -0800 (PST) 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=UTo4S6Cn; 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 S1346790AbiASKXm (ORCPT + 99 others); Wed, 19 Jan 2022 05:23:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345318AbiASKXl (ORCPT ); Wed, 19 Jan 2022 05:23:41 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D304C061574; Wed, 19 Jan 2022 02:23:41 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id cx27so9060791edb.1; Wed, 19 Jan 2022 02:23:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=3V1hkQQ8p02w19W2KJ4UIkOLnzPRTwmn+qldd2MXUPQ=; b=UTo4S6CngQrJK8inLCfGWdWffEF0VzWr1c/MOQ1tFDrsrVrZ2mAB2ipU4q8se7EDgP DxrG+gFyvjHymumc0w0C//05G17T8pZn00KF0kHUFN3nScd5YTzTsp0NRNrs3heL5Bvi y9yUHhEmCCkO4RvvhAe2HcFBhB746ja7VQVbcwmtCU/SOFj97PFDVCmtw36MYYcibD2l veksT8cLoWJVeyInIBAHfIt+ZBYyAP36ijhiDIIFVLjpaiw8DvoQSB9SNqZoAcnTYyok 0SVy87GQx60xuhIfksZdK6fDIhjU1RPGsKzP6rU4hFH3Msz9Vu8056eqeSAmLWw2S+qj 92gA== 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; bh=3V1hkQQ8p02w19W2KJ4UIkOLnzPRTwmn+qldd2MXUPQ=; b=Dj3BZZTLaGLRYohW0D+FJuCAxM5aNmYGHan7W5+n8V4wFj8GxcrpRT8pVo0HmUBZUt HzIyBQIwWz+QDZe5sGhBTGtDrTtlKAD6ifptcS9NjgRunjbbNkg6qpDqgS+7duhoLSdX Ga3PX7YiHaOMCxIpHqqgDiRPj12sCrEH4E6S0HEkb8ky6VGGCw2LYW1JsEODbU87i8Bl IoB61oQ6TfSUtL6SK9no9S3VnilFOJu2ORvOrUwmVbtJT4+uftq5By6RIkXMZNlrT7CQ a+edvTvAnN5XwY5f/Yb48eRrblMkDjtQOSdPVQQ3Zyfc+WGGkW4pRpSdRbFUDSRzgKpy pQ4g== X-Gm-Message-State: AOAM5326ekMhJlozU9/wiBTO0HRFgG5uWYrdtICw0e1GP40ivVJowxb3 hEbsRVQHn3uER9Ppw5vQop/FXpkvYV0= X-Received: by 2002:a17:906:4fd6:: with SMTP id i22mr23777188ejw.484.1642587819967; Wed, 19 Jan 2022 02:23:39 -0800 (PST) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id b4sm3456546ejb.131.2022.01.19.02.23.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jan 2022 02:23:39 -0800 (PST) From: Ivaylo Dimitrov To: tomba@kernel.org, airlied@linux.ie, daniel@ffwll.ch Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, merlijn@wizzup.org, tony@atomide.com, Ivaylo Dimitrov Subject: [PATCH 0/3] drm: omapdrm: Fix excessive GEM buffers DMM/CMA usage Date: Wed, 19 Jan 2022 12:23:08 +0200 Message-Id: <1642587791-13222-1-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series fixes excessive DMM or CMA usage of GEM buffers leading to various runtime allocation failures. The series enables daily usage of devices without exausting limited resources like CMA or DMM space if GPU rendering is needed. The first patch doesn't bring any functional changes, it just moves some TILER/DMM related code to a separate function, to simplify the review of the next two patches. The second patch allows off-CPU rendering to non-scanout buffers. Without that patch, it is basically impossible to use the driver allocated GEM buffers on OMAP3 for anything else but a basic CPU rendered examples as if we want GPU rendering, we must allocate buffers as scanout buffers, which are CMA allocated. CMA soon gets fragmented and we start seeing allocation failures. Such failres in Xorg cannot be handeled gracefully, so the system is basically unusable. Third patch fixes similar issue on OMAP4/5, where DMM/TILER spaces get fragmented with time, leading to allocation failures. Series were tested on Motolola Droid4 and Nokia N900, with OMAP DDX and PVR EXA from https://github.com/maemo-leste/xf86-video-omap Ivaylo Dimitrov (3): drm: omapdrm: simplify omap_gem_pin drm: omapdrm: Support exporting of non-contiguous GEM BOs drm: omapdrm: Do no allocate non-scanout GEMs through DMM/TILER drivers/gpu/drm/omapdrm/omap_gem.c | 198 +++++++++++++++++------------- drivers/gpu/drm/omapdrm/omap_gem.h | 3 +- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 5 +- 3 files changed, 116 insertions(+), 90 deletions(-) -- 1.9.1