Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1571506pxb; Mon, 8 Mar 2021 00:26:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/hobrkWams4m8q0FhEwpee2VQaRAypmkhQWg1hg4HvQIRTiVVa4tSnfXoeAOD/ve9TpZm X-Received: by 2002:a17:906:3846:: with SMTP id w6mr14039585ejc.190.1615191972238; Mon, 08 Mar 2021 00:26:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615191972; cv=none; d=google.com; s=arc-20160816; b=gBs3oQlkOLPpYlH4Ss8cVFZWmFgzhrHobSa0RWAOlZuNqU2IQScECrWT2PvZaDh+VG FgzSlfqT7fxU0dyjPXsjF5+fuzjdLzOp2edi97Y+AT8B04obBXKc/s4VSUJv8mVaLR48 to8WMzffrScfKf6y+/NWOdJPShZC/vDeR2GjpTeeRuGcL3cRmiEpcwh5G8LXk8Vw2ROP +00zkSSNOfxFbr77tvkjYdPXxu8+0027qhW9R36FxyUcZhLS2MRCnQHBURZnMWppgWYR cTIx1g7JqpyhwYUzyFJosbj/1USgCQv/9a3r2E3iwH2rTaZ5oW0EB1Itof5CwLp6wX8K jmUA== 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 :message-id:date:subject:cc:to:from; bh=msClq3q8lykrm6M+Q+dyhQEpCXEkjDkr0GinfpI0Mtw=; b=CzFfeCaOk7nANQGXyewC/n5zj8YEKwbPTywTmLgqqrQtazJ7czJjUBeQundEor+1CL t3YLF6XfxI0QRnmIIrDKjHIxdd48wlaxxSAXLb59BBuA0VT02HnvdknEJm4uyMBulNsS ucr2SmjPPkMxu/PcGSfulEWFlY9wRIRn5dpirnk4/t9p/isYxg/19Ek/cXf5naSjEkj7 lZ2co5BVyHaKObjDOIHGzdbkXyDdCy6PFt/EZ6f9rWa6rv/EHOHwtMEQ0CPtO6Fpj+p9 jnU7nuo/NmF9BFPWo2PkuGnuQNlhoeBpeUMiaJ0YXEKmW4KqgQAQHxvowp1ZoA5ewcUo cgLg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si6603775edv.220.2021.03.08.00.25.49; Mon, 08 Mar 2021 00:26:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232867AbhCGU3B (ORCPT + 99 others); Sun, 7 Mar 2021 15:29:01 -0500 Received: from aposti.net ([89.234.176.197]:49564 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232858AbhCGU3B (ORCPT ); Sun, 7 Mar 2021 15:29:01 -0500 From: Paul Cercueil To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: Sam Ravnborg , od@zcrc.me, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 0/5] Add option to mmap GEM buffers cached Date: Sun, 7 Mar 2021 20:28:30 +0000 Message-Id: <20210307202835.253907-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rework of my previous patchset which added support for GEM buffers backed by non-coherent memory to the ingenic-drm driver. Having GEM buffers backed by non-coherent memory is interesting in the particular case where it is faster to render to a non-coherent buffer then sync the data cache, than to render to a write-combine buffer, and (by extension) much faster than using a shadow buffer. This is true for instance on some Ingenic SoCs, where even simple blits (e.g. memcpy) are about three times faster using this method. For the record, the previous patchset was accepted for 5.10 then had to be reverted, as it conflicted with some changes made to the DMA API. This new patchset is pretty different as it adds the functionality to the DRM core. The first three patches add variants to existing functions but with the "non-coherent memory" twist, exported as GPL symbols. The fourth patch adds a function to be used with the damage helpers. Finally, the last patch adds support for non-coherent GEM buffers to the ingenic-drm driver. The functionality is enabled through a module parameter, and is disabled by default. Cheers, -Paul Paul Cercueil (5): drm: Add and export function drm_gem_cma_create_noncoherent drm: Add and export function drm_gem_cma_dumb_create_noncoherent drm: Add and export function drm_gem_cma_mmap_noncoherent drm: Add and export function drm_gem_cma_sync_data drm/ingenic: Add option to alloc cached GEM buffers drivers/gpu/drm/drm_gem_cma_helper.c | 223 +++++++++++++++++++--- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 49 ++++- drivers/gpu/drm/ingenic/ingenic-drm.h | 4 + drivers/gpu/drm/ingenic/ingenic-ipu.c | 14 +- include/drm/drm_gem_cma_helper.h | 13 ++ 5 files changed, 273 insertions(+), 30 deletions(-) -- 2.30.1