From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1947A367F46 for ; Fri, 3 Apr 2026 19:28:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775244483; cv=pass; b=NmNjvCoILsdquNGeYC81V2sb/VIHo/yB0d+ZGra1TqPRcpvwtd/Im92fOfGxDDoIEGmzOFpF/K0H+4F0hrNj7WiyiglEIetmx0M9Ka706w66wjfSqOq8iRsOyO80Ru7z/Tc3HeckEOJu5HlhXiUFrjUV/0sQwqRC6X1lZIHSsTY= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775244483; c=relaxed/simple; bh=POHFwaEJajX1sw22hfIEigFUTWC2qKJNz2idCvzKH50=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=YcEbiPZwuB106kja5cdEtq/X/5xd9plcgpHT3uXSFFOE0hB3gzFK0SV3uQShmgM20qVbp3NXLqzc7C+HszLuVHEOtNM9bp0Gv8uWxFEk5CeV7J0RULD0CTRQ5SQC57c5O2/hqAFwXJ6GQrw3MkHdtnJOujcc3Is6r2x83cTBYPQ= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=adrian.larumbe@collabora.com header.b=KennmJpO; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=adrian.larumbe@collabora.com header.b="KennmJpO" ARC-Seal: i=1; a=rsa-sha256; t=1775244474; cv=none; d=zohomail.com; s=zohoarc; b=IKx1D68Xs22+1ox40ETv6CP2AfrHouCZoBfNhM9S14WzhpHM35BQkj6yrOWqj9xWG2ex1dlaO9JKqDzrPUv/I6Y80VDaAMUjtV5NntRyFhcyNRRjnzSmXHKr2qxs1s2sq2rs56Dd8CGB0LROvotMk2ti8gCPACqMAaqdmVJonRU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775244474; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=AYvGjtKva0N6ran81n6b72nE/DZIBp3sxKPoTrYA9CY=; b=V/7L9dlrlexjLSDnquUGC5J8aJHQi3CiNn/eULmo0bPM3H/SewUeCDZ0/co/Dy5YHjgIMXTpPm65fQM6RLByzsX58ioF8lsSPPXnrv1JEAUZOq0oBp8vOTXUQTczkK3e69EwSNcloLZckpXDxucvRpMFCddNQVV13SBRH+4PJ6I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=adrian.larumbe@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1775244474; s=zohomail; d=collabora.com; i=adrian.larumbe@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=AYvGjtKva0N6ran81n6b72nE/DZIBp3sxKPoTrYA9CY=; b=KennmJpO/G9aRItqPHf/8i2cP2i6wRGPOiwqeFrAS2LePDzCL9I9ZfhL5FHgIJtA ppIgBYAVnBhZmXWD+KGyvDD+HsHkxATapPiN6Iuqu90FDtEq24ztvgIRHo145o/Azdk UTpakiTUNrigSe5rsubulT6X6I+/oAFbJFq3cUwM= Received: by mx.zohomail.com with SMTPS id 1775244473574194.23858108648938; Fri, 3 Apr 2026 12:27:53 -0700 (PDT) From: =?UTF-8?q?Adri=C3=A1n=20Larumbe?= To: linux-kernel@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, Steven Price , Boris Brezillon , kernel@collabora.com, =?UTF-8?q?Adri=C3=A1n=20Larumbe?= Subject: [PATCH v6 0/4] Support sparse mappings in Panthor Date: Fri, 3 Apr 2026 20:27:25 +0100 Message-ID: <20260403192743.3572062-1-adrian.larumbe@collabora.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch series implements sparse mappings in Panthor. Owing to the lack of HW MMU features for sparse page table entries, this had to be implemented using a dummy object over which sparse mappings requested over VM_BIND are mapped cyclically. To that end, a new VM_BIND flag was added in the driver's uAPI. The end goal of this patch series is to improve support of Vulkan sparse resources. At the moment, to implement this feature on Mali hardware, Vulkan sparse map is implemented by mapping the specified region to a "dummy bo" so that the accesses do not fault. A newly created sparse resource starts off unmapped, and therefore also has to be mapped to the "dummy bo". This "dummy bo" is small (a page size) in comparison to the sizes of va ranges that we might want to map to it, and a large number of vm_bind ops can be necessary. For example, if the user were to create a 100e6-byte sparse resident resource, we'd have to poke VM_BIND with ceil(100e6/0x1000)=24415 map operations. The new VM_BIND sparse mapping feature addresses this particular inefficiency by letting us implement a single Vulkan sparse map operation and sparse resident resource initialization with just one map operation. Link to the conversation for the previous patch series revision at: https://lore.kernel.org/dri-devel/20260313150956.1618635-1-adrian.larumbe@collabora.com/ Potential improvements in a v7 iteration: - Introduce lifetime management for sparse mappings' dummy backing pages. - Add Panfrost support for reporting available page sizes through query param ioctl. Changes in v6: - Moved all the GPUVM core code into the driver backend. - Discarded commits that touch on the gpuvm core too. - Redesigned the uAPI so that no repeat range or user BO is supplied for sparse mappings. - Replaced user-supplied BO with a kernel-allocated array of raw pages. Changes in v5: - Minor fixes to drm_gpuvm.c. - Add panthor MMU page sizes device queriable param. - Add helper to make sure unmaps of repeated regions are correct. - Some fixes to Panthor's repeat mappings implementation. - Lump arguments to panthor_vm_prepare_map_op_ctx into a single struct. Changes in v4: - Fixed the warnings reported by the kernel test robot. https://lore.kernel.org/oe-kbuild-all/202507041635.WyDu3TQ1-lkp@intel.com/ - Fixed the warnings reported by the CI. https://patchwork.freedesktop.org/series/151264/ No changes in v3. Changes in v2: - Make panthor use this stuff. - Make it possible to express a repeated mappina of any suitably sized and aligned range of a BO, rather than strictly the page size -sized prefix, generalizing the API. Rename DRM_GPUVA_SINGLE_PAGE to DRM_GPUVA_REPEAT. - Clean up parts of drm/gpuvm affected by these changes. Adrián Larumbe (4): drm/panthor: Expose GPU page sizes to UM drm/panthor: Pass vm_bind_op to vm_prepare_map_op_ctx drm/panthor: Support sparse mappings drm/panthor: Bump the driver version to 1.9 drivers/gpu/drm/panthor/panthor_device.h | 3 + drivers/gpu/drm/panthor/panthor_drv.c | 10 + drivers/gpu/drm/panthor/panthor_mmu.c | 299 ++++++++++++++++------- include/uapi/drm/panthor_drm.h | 26 +- 4 files changed, 253 insertions(+), 85 deletions(-) -- 2.53.0