From patchwork Sat Nov 19 20:44:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 23325 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp861437wrr; Sat, 19 Nov 2022 12:46:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf4fWIBQP+VulzeRRllAIJiYaAsPyAhhx/GIcGp6HjGl4nCgGKC+LVPG7z539LO1xFOviMX9 X-Received: by 2002:a17:902:e8d5:b0:16e:e703:2186 with SMTP id v21-20020a170902e8d500b0016ee7032186mr5290369plg.90.1668890793418; Sat, 19 Nov 2022 12:46:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668890793; cv=none; d=google.com; s=arc-20160816; b=KLfgaoHSp+gZewXSsFEiy67NmoTxwYDbh2wTmdxUew1y1lQQbKBEj/dw17UosP0EjW hLaIY6eDk+nIs5xdHFi5/f9jRHbp8O2dbvGGaCoeUaep8HZCSQac8KDeYsEJgQmEVzYS G4uFs2eX1byZAdIA9NHzy6DqDH6yml4jolSdM8wKirNePz4mLfseTDNqJkMjkyJjuWnj Q4SFGNoFW2YnsnSM9GOlSI2RZeEndYxzGRZ0pr6DSc9twPU3uGfF7A3gF4Qi2EBmRReB zkvcX8T8ZvunutFI8Q4yBIz5yhkCyYwZvPOsQnjwe9aTJ3T7YRoeLfWClm5iLThBUyE1 Teew== 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=ScpFgzbKqWzWu1HdiIuEP9KtD6ldfEf5o2I5M0QgRYU=; b=JKlqr0xiL3Hcc0Yq4LnyUYYPaAFzbSdcuCia+4YTV0nF5BnMGZayHnQMEPI2K55Wi/ 5mtgZrby/ZM5YsMLEeGq4zumyRpecJkWu5R7A5/PRf2CLhLbTyIpa/poXtxERiet4/yR Y6gGjKT6EdgYrV69zFf/IEfQ7aZzGzIKm1COrqRao8Ao0Vtdfx5I3oIcny7O09oURkYY wfw5gjlM9LNDiVC0LtaUwZ73nS31dz7krQUyTrHOkJd7sJ7/D1xk/kzbHadcXxjFkriW n2zfjByCBpjSHrx648PeOfRXurUy5V+/zRW13IoTERK6VU8P4FgNwkEinisEkAnxSTgB Oghg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AnsvhKmc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 136-20020a62198e000000b0056bcb93e983si6573969pfz.17.2022.11.19.12.46.20; Sat, 19 Nov 2022 12:46:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AnsvhKmc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234723AbiKSUpC (ORCPT + 99 others); Sat, 19 Nov 2022 15:45:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234517AbiKSUoy (ORCPT ); Sat, 19 Nov 2022 15:44:54 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5708E13D35 for ; Sat, 19 Nov 2022 12:44:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E539460BA2 for ; Sat, 19 Nov 2022 20:44:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2CCBC43144; Sat, 19 Nov 2022 20:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668890691; bh=+qLD/Tk2ZKcMqNy7BvCXDXY0lmH6jmR0kHJc5m1PAJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AnsvhKmcmC5+c/9aj+z8Soh42zQS4XZqRVGb/WOK2xGHLquGW4vbr+1wVGXKbMIjj 5Cu9AnLbtMXNkag1J08IxkdnfZva9KTZ8qhCDk4Q8QOLJCUSlF5wxN3Bu7KoWKqd9H 4mFA2JxqEXY9HbPVmfK131bDfMAVAENC9ra8YDIsiCRrJOYhPU9K1V2BT98vVIlAzG Ysbq19GgWDtp1u6QU4vXNT4elOS4GGreHXAwiwPdEd/xEFzg851cuNRXxiR6ZkxG/S 3H81QGtVGVJhQoOiggFvRK2lk9sGuxGvjpkjYBii+9smT1X1dmtFfocchidT9MCVgS mwhdq0j8XrHMA== From: Oded Gabbay To: David Airlie , Daniel Vetter , Greg Kroah-Hartman Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Yuji Ishikawa , Jiho Chu , Daniel Stone , Tvrtko Ursulin , Jason Gunthorpe , Jeffrey Hugo , Christoph Hellwig , Kevin Hilman , Jagan Teki , John Hubbard , Alex Deucher , Jacek Lawrynowicz , Maciej Kwapulinski , Christopher Friedt Subject: [PATCH v4 1/4] drivers/accel: define kconfig and register a new major Date: Sat, 19 Nov 2022 22:44:32 +0200 Message-Id: <20221119204435.97113-2-ogabbay@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221119204435.97113-1-ogabbay@kernel.org> References: <20221119204435.97113-1-ogabbay@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749958832165806014?= X-GMAIL-MSGID: =?utf-8?q?1749958832165806014?= Add a new Kconfig for the accel subsystem. The Kconfig currently contains only the basic CONFIG_DRM_ACCEL option that will be used to decide whether to compile the accel registration code. Therefore, the kconfig option is defined as bool. The accel code will be compiled as part of drm.ko and will be called directly from the DRM core code. The reason we compile it as part of drm.ko and not as a separate module is because of cyclic dependency between drm.ko and the separate module (if it would have existed). This is due to the fact that DRM core code calls accel functions and vice-versa. The accelerator devices will be exposed to the user space with a new, dedicated major number - 261. The accel init function registers the new major number as a char device and create corresponding sysfs and debugfs root entries, similar to what is done in DRM init function. I added a new header called drm_accel.h to include/drm/, that will hold the prototypes of the drm_accel.c functions. In case CONFIG_DRM_ACCEL is set to 'N', that header will contain empty inline implementations of those functions, to allow DRM core code to compile successfully without dependency on CONFIG_DRM_ACCEL. I Updated the MAINTAINERS file accordingly with the newly added folder and I have taken the liberty to appropriate the dri-devel mailing list and the dri-devel IRC channel for the accel subsystem. Signed-off-by: Oded Gabbay --- Changes in v4: - Fix comment style - Remove useless goto - Fix indentation of major define - Move comment from next patch to this patch Documentation/admin-guide/devices.txt | 5 ++ MAINTAINERS | 8 +++ drivers/Kconfig | 2 + drivers/accel/Kconfig | 24 ++++++++ drivers/accel/drm_accel.c | 83 +++++++++++++++++++++++++++ drivers/gpu/drm/Makefile | 1 + include/drm/drm_accel.h | 32 +++++++++++ 7 files changed, 155 insertions(+) create mode 100644 drivers/accel/Kconfig create mode 100644 drivers/accel/drm_accel.c create mode 100644 include/drm/drm_accel.h -- 2.25.1 diff --git a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt index 9764d6edb189..06c525e01ea5 100644 --- a/Documentation/admin-guide/devices.txt +++ b/Documentation/admin-guide/devices.txt @@ -3080,6 +3080,11 @@ ... 255 = /dev/osd255 256th OSD Device + 261 char Compute Acceleration Devices + 0 = /dev/accel/accel0 First acceleration device + 1 = /dev/accel/accel1 Second acceleration device + ... + 384-511 char RESERVED FOR DYNAMIC ASSIGNMENT Character devices that request a dynamic allocation of major number will take numbers starting from 511 and downward, diff --git a/MAINTAINERS b/MAINTAINERS index 178a7a383b5f..4d752aac3ec0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6831,6 +6831,14 @@ F: include/drm/drm* F: include/linux/vga* F: include/uapi/drm/drm* +DRM COMPUTE ACCELERATORS DRIVERS AND FRAMEWORK +M: Oded Gabbay +L: dri-devel@lists.freedesktop.org +S: Maintained +C: irc://irc.oftc.net/dri-devel +T: git https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/accel.git +F: drivers/accel/ + DRM DRIVERS FOR ALLWINNER A10 M: Maxime Ripard M: Chen-Yu Tsai diff --git a/drivers/Kconfig b/drivers/Kconfig index 19ee995bd0ae..968bd0a6fd78 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -99,6 +99,8 @@ source "drivers/media/Kconfig" source "drivers/video/Kconfig" +source "drivers/accel/Kconfig" + source "sound/Kconfig" source "drivers/hid/Kconfig" diff --git a/drivers/accel/Kconfig b/drivers/accel/Kconfig new file mode 100644 index 000000000000..c9ce849b2984 --- /dev/null +++ b/drivers/accel/Kconfig @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Compute Acceleration device configuration +# +# This framework provides support for compute acceleration devices, such +# as, but not limited to, Machine-Learning and Deep-Learning acceleration +# devices +# +menuconfig DRM_ACCEL + bool "Compute Acceleration Framework" + depends on DRM + help + Framework for device drivers of compute acceleration devices, such + as, but not limited to, Machine-Learning and Deep-Learning + acceleration devices. + If you say Y here, you need to select the module that's right for + your acceleration device from the list below. + This framework is integrated with the DRM subsystem as compute + accelerators and GPUs share a lot in common and can use almost the + same infrastructure code. + Having said that, acceleration devices will have a different + major number than GPUs, and will be exposed to user-space using + different device files, called accel/accel* (in /dev, sysfs + and debugfs). diff --git a/drivers/accel/drm_accel.c b/drivers/accel/drm_accel.c new file mode 100644 index 000000000000..fac6ad6ac28e --- /dev/null +++ b/drivers/accel/drm_accel.c @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * Copyright 2022 HabanaLabs, Ltd. + * All Rights Reserved. + * + */ + +#include +#include + +#include +#include +#include + +static struct dentry *accel_debugfs_root; +static struct class *accel_class; + +static char *accel_devnode(struct device *dev, umode_t *mode) +{ + return kasprintf(GFP_KERNEL, "accel/%s", dev_name(dev)); +} + +static int accel_sysfs_init(void) +{ + accel_class = class_create(THIS_MODULE, "accel"); + if (IS_ERR(accel_class)) + return PTR_ERR(accel_class); + + accel_class->devnode = accel_devnode; + + return 0; +} + +static void accel_sysfs_destroy(void) +{ + if (IS_ERR_OR_NULL(accel_class)) + return; + class_destroy(accel_class); + accel_class = NULL; +} + +static int accel_stub_open(struct inode *inode, struct file *filp) +{ + return -EOPNOTSUPP; +} + +static const struct file_operations accel_stub_fops = { + .owner = THIS_MODULE, + .open = accel_stub_open, + .llseek = noop_llseek, +}; + +void accel_core_exit(void) +{ + unregister_chrdev(ACCEL_MAJOR, "accel"); + debugfs_remove(accel_debugfs_root); + accel_sysfs_destroy(); +} + +int __init accel_core_init(void) +{ + int ret; + + ret = accel_sysfs_init(); + if (ret < 0) { + DRM_ERROR("Cannot create ACCEL class: %d\n", ret); + goto error; + } + + accel_debugfs_root = debugfs_create_dir("accel", NULL); + + ret = register_chrdev(ACCEL_MAJOR, "accel", &accel_stub_fops); + if (ret < 0) + DRM_ERROR("Cannot register ACCEL major: %d\n", ret); + +error: + /* + * Any cleanup due to errors will be done in drm_core_exit() that + * will call accel_core_exit() + */ + return ret; +} diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index c44a54cadb61..2773e1ad1b6b 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -70,6 +70,7 @@ drm-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o drm-$(CONFIG_DRM_PRIVACY_SCREEN) += \ drm_privacy_screen.o \ drm_privacy_screen_x86.o +drm-$(CONFIG_DRM_ACCEL) += ../../accel/drm_accel.o obj-$(CONFIG_DRM) += drm.o obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o diff --git a/include/drm/drm_accel.h b/include/drm/drm_accel.h new file mode 100644 index 000000000000..e1758f484278 --- /dev/null +++ b/include/drm/drm_accel.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0 + * + * Copyright 2022 HabanaLabs, Ltd. + * All Rights Reserved. + * + */ + +#ifndef DRM_ACCEL_H_ +#define DRM_ACCEL_H_ + +#define ACCEL_MAJOR 261 + +#if IS_ENABLED(CONFIG_DRM_ACCEL) + +void accel_core_exit(void); +int accel_core_init(void); + +#else + +static inline void accel_core_exit(void) +{ +} + +static inline int __init accel_core_init(void) +{ + /* Return 0 to allow drm_core_init to complete successfully */ + return 0; +} + +#endif /* IS_ENABLED(CONFIG_DRM_ACCEL) */ + +#endif /* DRM_ACCEL_H_ */ From patchwork Sat Nov 19 20:44:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 23326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp861497wrr; Sat, 19 Nov 2022 12:46:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf5hpdtSFH+XlawUanFZwRSihz3I53ajzBFzD5sBqQIIz7eWT0FNJBK+iFLxsS2AEwd1477a X-Received: by 2002:a17:90b:4d84:b0:212:9b3f:dee5 with SMTP id oj4-20020a17090b4d8400b002129b3fdee5mr19440074pjb.62.1668890801263; Sat, 19 Nov 2022 12:46:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668890801; cv=none; d=google.com; s=arc-20160816; b=Nh3MdfAyIv33puoFN59KBpXeOGwjQX+DxWuhXf3hFBO4wwkCK2xY7nO0ACZIllED+h Gj+gNEyOObKoK3PZjA29Ly9Ixh7zVkQpzFZFwEIjAZc0IdzqO6YvTHBKKSM7H0+lDRY/ GWasANByILgDn1EVdxZQ7SG4amK1c0z2pgeib7MOJtfymCPC7WuKJWGIM54WfQJz8T8E PBQOVcjc6f5j9KWu21CQPtS39ICQKhmD1IBfV2oGJ1IK8y8C+05KZgI/z/nTueNIne53 ckoXA3gWMm3crlgCg0Rh3elml4c/wtACzdv0CGnQD0dsIdO7eEfrs2Ia8DFpGbuRCUkh D8Ng== 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=KdoShOT9h0PdVV9rJzLxqZH5luhmi/K1trX5Tdphews=; b=uQ6v+OKjBXEbvFfVxC8fm4Mn3m1aVNBRnvUN+Hq2kHBuUZaZFJT8+hEUhA50st53aY HiJYzBI1yd/Af5pE0CuvshTAZf72ZN6KttEYkYjRNSkgzh0FrkA1ShzPKr2/2Rn0ICMv i7nUZdQmsMw1eKIPLUEzAo9p8ND0K7Kc6AacHBTfCi74m93+W9jPmu/GhNWcDyfK5vUv WaTxzn3TMUZLOjgWa00witAmBdE3MvoR032q5YaR/VBExehAZVvNPFnhY46x0OVxVy+5 gPmOGFv2XBzsg33IPKP6NGMzvvLTdVU+KK+4XMNgJ/RuROzhi3nxYRAc6g90ZThOcs1l YrHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GogcisPi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 36-20020a631364000000b004704b5453cbsi7399241pgt.557.2022.11.19.12.46.28; Sat, 19 Nov 2022 12:46:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GogcisPi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234686AbiKSUpF (ORCPT + 99 others); Sat, 19 Nov 2022 15:45:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234807AbiKSUpA (ORCPT ); Sat, 19 Nov 2022 15:45:00 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACF0D1209D for ; Sat, 19 Nov 2022 12:44:58 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3A63060BC8 for ; Sat, 19 Nov 2022 20:44:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D91BEC433C1; Sat, 19 Nov 2022 20:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668890697; bh=qwaNk3oY8j9YVSJlLPbF+WHW39uW1KEbhouKbnaZRas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GogcisPiU/Yy3gHgNh31Ad0ZI7sAtNY3VgDsg1+HeicvaxJab2eQ+qZe+tGMDxCrm IZGReTkoH4pf3GfO3+WIyXNI2hHOUg0fN5pM6s0HGcVijzHBZa87liRQag15SGd0wV qGPzYmeQe/l7xfOpbMzSu3VJPyUkc/oJyodrhPehaSinHmVgjdGwKNoXmHh1FryHvR Lmd3UZBpS4KSejoC8lQEhk/hQB1YIZDYbvexHUI2HXlmLgxUi6Zk/A4uKhuhBSj7KV JYUM7iWg7fqEi/9AU5JIdjgJ3ofem09We9eDrRhzQI+aMuagejr4Vxax8Vo3EwWUZG Axj5YR2l3SP/g== From: Oded Gabbay To: David Airlie , Daniel Vetter , Greg Kroah-Hartman Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Yuji Ishikawa , Jiho Chu , Daniel Stone , Tvrtko Ursulin , Jason Gunthorpe , Jeffrey Hugo , Christoph Hellwig , Kevin Hilman , Jagan Teki , John Hubbard , Alex Deucher , Jacek Lawrynowicz , Maciej Kwapulinski , Christopher Friedt Subject: [PATCH v4 2/4] accel: add dedicated minor for accelerator devices Date: Sat, 19 Nov 2022 22:44:33 +0200 Message-Id: <20221119204435.97113-3-ogabbay@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221119204435.97113-1-ogabbay@kernel.org> References: <20221119204435.97113-1-ogabbay@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749958840891971714?= X-GMAIL-MSGID: =?utf-8?q?1749958840891971714?= The accelerator devices are exposed to user-space using a dedicated major. In addition, they are represented in /dev with new, dedicated device char names: /dev/accel/accel*. This is done to make sure any user-space software that tries to open a graphic card won't open the accelerator device by mistake. The above implies that the minor numbering should be separated from the rest of the DRM devices. However, to avoid code duplication, we want the drm_minor structure to be able to represent the accelerator device. To achieve this, we add a new drm_minor* to drm_device that represents the accelerator device. This pointer is initialized for drivers that declare they handle compute accelerator, using a new driver feature flag called DRIVER_COMPUTE_ACCEL. It is important to note that this driver feature is mutually exclusive with DRIVER_RENDER. Devices that want to expose both graphics and compute device char files should be handled by two drivers that are connected using the auxiliary bus framework. In addition, we define a different IDR to handle the accelerators minors. This is done to make the minor's index be identical to the device index in /dev/. Any access to the IDR is done solely by functions in accel_drv.c, as the IDR is define as static. The DRM core functions call those functions in case they detect the minor's type is DRM_MINOR_ACCEL. We define a separate accel_open function (from drm_open) that the accel drivers should set as their open callback function. Both these functions eventually call the same drm_open_helper(), which had to be changed to be non-static so it can be called from accel_drv.c. accel_open() only partially duplicates drm_open as I removed some code from it that handles legacy devices. To help new drivers, I defined DEFINE_DRM_ACCEL_FOPS macro to easily set the required function operations pointers structure. Signed-off-by: Oded Gabbay --- Changes in v4: - Fix spelling - Remove comment and move it to previous patch drivers/accel/drm_accel.c | 242 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/drm_file.c | 2 +- include/drm/drm_accel.h | 65 ++++++++++ include/drm/drm_device.h | 3 + include/drm/drm_drv.h | 8 ++ include/drm/drm_file.h | 21 +++- 6 files changed, 338 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/drivers/accel/drm_accel.c b/drivers/accel/drm_accel.c index fac6ad6ac28e..703d40c4ff45 100644 --- a/drivers/accel/drm_accel.c +++ b/drivers/accel/drm_accel.c @@ -8,14 +8,25 @@ #include #include +#include #include +#include +#include +#include #include #include +static DEFINE_SPINLOCK(accel_minor_lock); +static struct idr accel_minors_idr; + static struct dentry *accel_debugfs_root; static struct class *accel_class; +static struct device_type accel_sysfs_device_minor = { + .name = "accel_minor" +}; + static char *accel_devnode(struct device *dev, umode_t *mode) { return kasprintf(GFP_KERNEL, "accel/%s", dev_name(dev)); @@ -40,9 +51,235 @@ static void accel_sysfs_destroy(void) accel_class = NULL; } +static int accel_name_info(struct seq_file *m, void *data) +{ + struct drm_info_node *node = (struct drm_info_node *) m->private; + struct drm_minor *minor = node->minor; + struct drm_device *dev = minor->dev; + struct drm_master *master; + + mutex_lock(&dev->master_mutex); + master = dev->master; + seq_printf(m, "%s", dev->driver->name); + if (dev->dev) + seq_printf(m, " dev=%s", dev_name(dev->dev)); + if (master && master->unique) + seq_printf(m, " master=%s", master->unique); + if (dev->unique) + seq_printf(m, " unique=%s", dev->unique); + seq_puts(m, "\n"); + mutex_unlock(&dev->master_mutex); + + return 0; +} + +static const struct drm_info_list accel_debugfs_list[] = { + {"name", accel_name_info, 0} +}; +#define ACCEL_DEBUGFS_ENTRIES ARRAY_SIZE(accel_debugfs_list) + +/** + * accel_debugfs_init() - Initialize debugfs for accel minor + * @minor: Pointer to the drm_minor instance. + * @minor_id: The minor's id + * + * This function initializes the drm minor's debugfs members and creates + * a root directory for the minor in debugfs. It also creates common files + * for accelerators and calls the driver's debugfs init callback. + */ +void accel_debugfs_init(struct drm_minor *minor, int minor_id) +{ + struct drm_device *dev = minor->dev; + char name[64]; + + INIT_LIST_HEAD(&minor->debugfs_list); + mutex_init(&minor->debugfs_lock); + sprintf(name, "%d", minor_id); + minor->debugfs_root = debugfs_create_dir(name, accel_debugfs_root); + + drm_debugfs_create_files(accel_debugfs_list, ACCEL_DEBUGFS_ENTRIES, + minor->debugfs_root, minor); + + if (dev->driver->debugfs_init) + dev->driver->debugfs_init(minor); +} + +/** + * accel_set_device_instance_params() - Set some device parameters for accel device + * @kdev: Pointer to the device instance. + * @index: The minor's index + * + * This function creates the dev_t of the device using the accel major and + * the device's minor number. In addition, it sets the class and type of the + * device instance to the accel sysfs class and device type, respectively. + */ +void accel_set_device_instance_params(struct device *kdev, int index) +{ + kdev->devt = MKDEV(ACCEL_MAJOR, index); + kdev->class = accel_class; + kdev->type = &accel_sysfs_device_minor; +} + +/** + * accel_minor_alloc() - Allocates a new accel minor + * + * This function access the accel minors idr and allocates from it + * a new id to represent a new accel minor + * + * Return: A new id on success or error code in case idr_alloc failed + */ +int accel_minor_alloc(void) +{ + unsigned long flags; + int r; + + spin_lock_irqsave(&accel_minor_lock, flags); + r = idr_alloc(&accel_minors_idr, NULL, 0, ACCEL_MAX_MINORS, GFP_NOWAIT); + spin_unlock_irqrestore(&accel_minor_lock, flags); + + return r; +} + +/** + * accel_minor_remove() - Remove an accel minor + * @index: The minor id to remove. + * + * This function access the accel minors idr and removes from + * it the member with the id that is passed to this function. + */ +void accel_minor_remove(int index) +{ + unsigned long flags; + + spin_lock_irqsave(&accel_minor_lock, flags); + idr_remove(&accel_minors_idr, index); + spin_unlock_irqrestore(&accel_minor_lock, flags); +} + +/** + * accel_minor_replace() - Replace minor pointer in accel minors idr. + * @minor: Pointer to the new minor. + * @index: The minor id to replace. + * + * This function access the accel minors idr structure and replaces the pointer + * that is associated with an existing id. Because the minor pointer can be + * NULL, we need to explicitly pass the index. + * + * Return: 0 for success, negative value for error + */ +void accel_minor_replace(struct drm_minor *minor, int index) +{ + unsigned long flags; + + spin_lock_irqsave(&accel_minor_lock, flags); + idr_replace(&accel_minors_idr, minor, index); + spin_unlock_irqrestore(&accel_minor_lock, flags); +} + +/* + * Looks up the given minor-ID and returns the respective DRM-minor object. The + * refence-count of the underlying device is increased so you must release this + * object with accel_minor_release(). + * + * The object can be only a drm_minor that represents an accel device. + * + * As long as you hold this minor, it is guaranteed that the object and the + * minor->dev pointer will stay valid! However, the device may get unplugged and + * unregistered while you hold the minor. + */ +static struct drm_minor *accel_minor_acquire(unsigned int minor_id) +{ + struct drm_minor *minor; + unsigned long flags; + + spin_lock_irqsave(&accel_minor_lock, flags); + minor = idr_find(&accel_minors_idr, minor_id); + if (minor) + drm_dev_get(minor->dev); + spin_unlock_irqrestore(&accel_minor_lock, flags); + + if (!minor) { + return ERR_PTR(-ENODEV); + } else if (drm_dev_is_unplugged(minor->dev)) { + drm_dev_put(minor->dev); + return ERR_PTR(-ENODEV); + } + + return minor; +} + +static void accel_minor_release(struct drm_minor *minor) +{ + drm_dev_put(minor->dev); +} + +/** + * accel_open - open method for ACCEL file + * @inode: device inode + * @filp: file pointer. + * + * This function must be used by drivers as their &file_operations.open method. + * It looks up the correct ACCEL device and instantiates all the per-file + * resources for it. It also calls the &drm_driver.open driver callback. + * + * Return: 0 on success or negative errno value on failure. + */ +int accel_open(struct inode *inode, struct file *filp) +{ + struct drm_device *dev; + struct drm_minor *minor; + int retcode; + + minor = accel_minor_acquire(iminor(inode)); + if (IS_ERR(minor)) + return PTR_ERR(minor); + + dev = minor->dev; + + atomic_fetch_inc(&dev->open_count); + + /* share address_space across all char-devs of a single device */ + filp->f_mapping = dev->anon_inode->i_mapping; + + retcode = drm_open_helper(filp, minor); + if (retcode) + goto err_undo; + + return 0; + +err_undo: + atomic_dec(&dev->open_count); + accel_minor_release(minor); + return retcode; +} +EXPORT_SYMBOL_GPL(accel_open); + static int accel_stub_open(struct inode *inode, struct file *filp) { - return -EOPNOTSUPP; + const struct file_operations *new_fops; + struct drm_minor *minor; + int err; + + minor = accel_minor_acquire(iminor(inode)); + if (IS_ERR(minor)) + return PTR_ERR(minor); + + new_fops = fops_get(minor->dev->driver->fops); + if (!new_fops) { + err = -ENODEV; + goto out; + } + + replace_fops(filp, new_fops); + if (filp->f_op->open) + err = filp->f_op->open(inode, filp); + else + err = 0; + +out: + accel_minor_release(minor); + + return err; } static const struct file_operations accel_stub_fops = { @@ -56,12 +293,15 @@ void accel_core_exit(void) unregister_chrdev(ACCEL_MAJOR, "accel"); debugfs_remove(accel_debugfs_root); accel_sysfs_destroy(); + idr_destroy(&accel_minors_idr); } int __init accel_core_init(void) { int ret; + idr_init(&accel_minors_idr); + ret = accel_sysfs_init(); if (ret < 0) { DRM_ERROR("Cannot create ACCEL class: %d\n", ret); diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index a8b4d918e9a3..64b4a3a87fbb 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -326,7 +326,7 @@ static int drm_cpu_valid(void) * Creates and initializes a drm_file structure for the file private data in \p * filp and add it into the double linked list in \p dev. */ -static int drm_open_helper(struct file *filp, struct drm_minor *minor) +int drm_open_helper(struct file *filp, struct drm_minor *minor) { struct drm_device *dev = minor->dev; struct drm_file *priv; diff --git a/include/drm/drm_accel.h b/include/drm/drm_accel.h index e1758f484278..b0c20367faad 100644 --- a/include/drm/drm_accel.h +++ b/include/drm/drm_accel.h @@ -8,12 +8,56 @@ #ifndef DRM_ACCEL_H_ #define DRM_ACCEL_H_ +#include + #define ACCEL_MAJOR 261 +#define ACCEL_MAX_MINORS 256 + +/** + * DRM_ACCEL_FOPS - Default drm accelerators file operations + * + * This macro provides a shorthand for setting the accelerator file ops in the + * &file_operations structure. If all you need are the default ops, use + * DEFINE_DRM_ACCEL_FOPS instead. + */ +#define DRM_ACCEL_FOPS \ + .open = accel_open,\ + .release = drm_release,\ + .unlocked_ioctl = drm_ioctl,\ + .compat_ioctl = drm_compat_ioctl,\ + .poll = drm_poll,\ + .read = drm_read,\ + .llseek = noop_llseek + +/** + * DEFINE_DRM_ACCEL_FOPS() - macro to generate file operations for accelerators drivers + * @name: name for the generated structure + * + * This macro autogenerates a suitable &struct file_operations for accelerators based + * drivers, which can be assigned to &drm_driver.fops. Note that this structure + * cannot be shared between drivers, because it contains a reference to the + * current module using THIS_MODULE. + * + * Note that the declaration is already marked as static - if you need a + * non-static version of this you're probably doing it wrong and will break the + * THIS_MODULE reference by accident. + */ +#define DEFINE_DRM_ACCEL_FOPS(name) \ + static const struct file_operations name = {\ + .owner = THIS_MODULE,\ + DRM_ACCEL_FOPS,\ + } #if IS_ENABLED(CONFIG_DRM_ACCEL) void accel_core_exit(void); int accel_core_init(void); +void accel_minor_remove(int index); +int accel_minor_alloc(void); +void accel_minor_replace(struct drm_minor *minor, int index); +void accel_set_device_instance_params(struct device *kdev, int index); +int accel_open(struct inode *inode, struct file *filp); +void accel_debugfs_init(struct drm_minor *minor, int minor_id); #else @@ -27,6 +71,27 @@ static inline int __init accel_core_init(void) return 0; } +static inline void accel_minor_remove(int index) +{ +} + +static inline int accel_minor_alloc(void) +{ + return -EOPNOTSUPP; +} + +static inline void accel_minor_replace(struct drm_minor *minor, int index) +{ +} + +static inline void accel_set_device_instance_params(struct device *kdev, int index) +{ +} + +static inline void accel_debugfs_init(struct drm_minor *minor, int minor_id) +{ + + #endif /* IS_ENABLED(CONFIG_DRM_ACCEL) */ #endif /* DRM_ACCEL_H_ */ diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h index 9923c7a6885e..933ce2048e20 100644 --- a/include/drm/drm_device.h +++ b/include/drm/drm_device.h @@ -93,6 +93,9 @@ struct drm_device { /** @render: Render node */ struct drm_minor *render; + /** @accel: Compute Acceleration node */ + struct drm_minor *accel; + /** * @registered: * diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index f6159acb8856..cb35db7093c8 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -94,6 +94,14 @@ enum drm_driver_feature { * synchronization of command submission. */ DRIVER_SYNCOBJ_TIMELINE = BIT(6), + /** + * @DRIVER_COMPUTE_ACCEL: + * + * Driver supports compute acceleration devices. This flag is mutually exclusive with + * @DRIVER_RENDER and @DRIVER_MODESET. Devices that support both graphics and compute + * acceleration should be handled by two drivers that are connected using auxiliary bus. + */ + DRIVER_COMPUTE_ACCEL = BIT(7), /* IMPORTANT: Below are all the legacy flags, add new ones above. */ diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index d780fd151789..0d1f853092ab 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -51,11 +51,15 @@ struct file; /* Note that the order of this enum is ABI (it determines * /dev/dri/renderD* numbers). + * + * Setting DRM_MINOR_ACCEL to 32 gives enough space for more drm minors to + * be implemented before we hit any future */ enum drm_minor_type { DRM_MINOR_PRIMARY, DRM_MINOR_CONTROL, DRM_MINOR_RENDER, + DRM_MINOR_ACCEL = 32, }; /** @@ -70,7 +74,7 @@ enum drm_minor_type { struct drm_minor { /* private: */ int index; /* Minor device number */ - int type; /* Control or render */ + int type; /* Control or render or accel */ struct device *kdev; /* Linux device */ struct drm_device *dev; @@ -397,7 +401,22 @@ static inline bool drm_is_render_client(const struct drm_file *file_priv) return file_priv->minor->type == DRM_MINOR_RENDER; } +/** + * drm_is_accel_client - is this an open file of the compute acceleration node + * @file_priv: DRM file + * + * Returns true if this is an open file of the compute acceleration node, i.e. + * &drm_file.minor of @file_priv is a accel minor. + * + * See also the :ref:`section on accel nodes `. + */ +static inline bool drm_is_accel_client(const struct drm_file *file_priv) +{ + return file_priv->minor->type == DRM_MINOR_ACCEL; +} + int drm_open(struct inode *inode, struct file *filp); +int drm_open_helper(struct file *filp, struct drm_minor *minor); ssize_t drm_read(struct file *filp, char __user *buffer, size_t count, loff_t *offset); int drm_release(struct inode *inode, struct file *filp); From patchwork Sat Nov 19 20:44:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 23327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp861562wrr; Sat, 19 Nov 2022 12:46:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf5m0wUQaVaZxFkSILwvo9tFpNcBTNzk9dEkSXzPKm6T6ODnJURNqbRc+6yIzy+gZudp/NXi X-Received: by 2002:a17:903:2582:b0:188:758f:f45e with SMTP id jb2-20020a170903258200b00188758ff45emr389613plb.12.1668890816181; Sat, 19 Nov 2022 12:46:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668890816; cv=none; d=google.com; s=arc-20160816; b=zcz5UP4jbZ2L8fAiXKQ6aoPmFwUA1JkMZXVZjdWxRvw6yqWdwDCFig+25mS53tWoce WWDte4q8OwU+e1emTBHCOWPQPvAtuESz5xXWA3WQV3HcwW72OM9i1Mt80KzoqD0/g4r7 Y/Vkc6HO59q8kUu2kFJVA62JzwUHo/BRTjau6CxPUzCduv+myiyosGowfe7HFDhyz79S 3g02FavVphlPHZqZ36uq/I8hKqWlqeMJgo/P2u7A9h6j64RdhbPTn3JDgIgNCzaEkS2+ iSZEFuIACdzNjqiO75VkOSmB3/M4qCH4OZQEqkDdG8ePiEZvNEDiWF2UzZY6vC/LCjTN +6ZQ== 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=inItD80LLBQ/LJS/QvEzA3jBHnte0zDf5370MU7IJtw=; b=EdMrPph6uu5axnXDrpw0G4pKBwbNHLRkhtCX7PzfBxSentoYY4sO6+0HCivBvclRTJ fPGvgqAhFeMc6zAsRGDPfdB35HT6t2dfgMdJGzFT3eEischAkTKiXM/u/slI8zLwgX7c zy1sRJ+SWbpHwzzFtVYOC22sgCDUgqNDQwrM7EWkFuqYa2/dnNGMsu1aH6QHH29+J3mF kn4qdPkZTEip1l2VJWMKh0IblZ/AAs0jvqjkcippPP7fYoHlIga0OzyZXJbC6AFJQwIX Lyav0FYhI+SiUCafJ4K9GqlKE41h9cDRmSD2gRk+WVK4kPffBxEavZdmKU9n3VLY+990 fJvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f2NEXGh6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s36-20020a056a0017a400b0053652e1c0b6si8268230pfg.12.2022.11.19.12.46.43; Sat, 19 Nov 2022 12:46:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f2NEXGh6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234833AbiKSUpT (ORCPT + 99 others); Sat, 19 Nov 2022 15:45:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234764AbiKSUpK (ORCPT ); Sat, 19 Nov 2022 15:45:10 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4A5B13DF0 for ; Sat, 19 Nov 2022 12:45:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1E6F0B80881 for ; Sat, 19 Nov 2022 20:45:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EFDAC433D7; Sat, 19 Nov 2022 20:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668890703; bh=x8lGYDn9NFmqVJtumKwmzsrFD5VVbJMslBuQbFaO9io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f2NEXGh6JcoUDqF9UdTVqfeRfestW21R7J7JPniO6r8qZ70dstO+gZlUl3KftvZhs gjUEd+oekzsWc+u3qxY/dbZkM79VHPFSjzDBJYIK/frgSPfGMe/YHGP7NyRR9x0xZ4 ge9SfKkmGVwbCjLMd9ZA4jexRaJQTC4+i22nMPQs74VkYzPVTzQJT8uaa8j7laFHy7 TM+//Fwnut7XJneOfmGWaw4f0mQvuBPKdkEg+PBGCxdThsLVv4UsbHMSbY/dog1gAE wdt4s6jQqyfssPzaZld9u05oCuz/noIgT1mgK1yilduC67B5H0NM5peBlR1sVUij2A /LxHfpZ37HSaQ== From: Oded Gabbay To: David Airlie , Daniel Vetter , Greg Kroah-Hartman Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Yuji Ishikawa , Jiho Chu , Daniel Stone , Tvrtko Ursulin , Jason Gunthorpe , Jeffrey Hugo , Christoph Hellwig , Kevin Hilman , Jagan Teki , John Hubbard , Alex Deucher , Jacek Lawrynowicz , Maciej Kwapulinski , Christopher Friedt Subject: [PATCH v4 3/4] drm: initialize accel framework Date: Sat, 19 Nov 2022 22:44:34 +0200 Message-Id: <20221119204435.97113-4-ogabbay@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221119204435.97113-1-ogabbay@kernel.org> References: <20221119204435.97113-1-ogabbay@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749958856550626905?= X-GMAIL-MSGID: =?utf-8?q?1749958856550626905?= Now that we have the accel framework code ready, let's call the accel functions from all the appropriate places. These places are the drm module init/exit functions, and all the drm_minor handling functions. Signed-off-by: Oded Gabbay Reviewed-by: Melissa Wen --- drivers/gpu/drm/drm_drv.c | 102 ++++++++++++++++++++++++++---------- drivers/gpu/drm/drm_sysfs.c | 24 ++++++--- 2 files changed, 91 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 8214a0b1ab7f..1aec019f6389 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -90,6 +91,8 @@ static struct drm_minor **drm_minor_get_slot(struct drm_device *dev, return &dev->primary; case DRM_MINOR_RENDER: return &dev->render; + case DRM_MINOR_ACCEL: + return &dev->accel; default: BUG(); } @@ -104,9 +107,13 @@ static void drm_minor_alloc_release(struct drm_device *dev, void *data) put_device(minor->kdev); - spin_lock_irqsave(&drm_minor_lock, flags); - idr_remove(&drm_minors_idr, minor->index); - spin_unlock_irqrestore(&drm_minor_lock, flags); + if (minor->type == DRM_MINOR_ACCEL) { + accel_minor_remove(minor->index); + } else { + spin_lock_irqsave(&drm_minor_lock, flags); + idr_remove(&drm_minors_idr, minor->index); + spin_unlock_irqrestore(&drm_minor_lock, flags); + } } static int drm_minor_alloc(struct drm_device *dev, unsigned int type) @@ -123,13 +130,17 @@ static int drm_minor_alloc(struct drm_device *dev, unsigned int type) minor->dev = dev; idr_preload(GFP_KERNEL); - spin_lock_irqsave(&drm_minor_lock, flags); - r = idr_alloc(&drm_minors_idr, - NULL, - 64 * type, - 64 * (type + 1), - GFP_NOWAIT); - spin_unlock_irqrestore(&drm_minor_lock, flags); + if (type == DRM_MINOR_ACCEL) { + r = accel_minor_alloc(); + } else { + spin_lock_irqsave(&drm_minor_lock, flags); + r = idr_alloc(&drm_minors_idr, + NULL, + 64 * type, + 64 * (type + 1), + GFP_NOWAIT); + spin_unlock_irqrestore(&drm_minor_lock, flags); + } idr_preload_end(); if (r < 0) @@ -161,10 +172,14 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) if (!minor) return 0; - ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root); - if (ret) { - DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); - goto err_debugfs; + if (minor->type == DRM_MINOR_ACCEL) { + accel_debugfs_init(minor, minor->index); + } else { + ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root); + if (ret) { + DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); + goto err_debugfs; + } } ret = device_add(minor->kdev); @@ -172,9 +187,13 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) goto err_debugfs; /* replace NULL with @minor so lookups will succeed from now on */ - spin_lock_irqsave(&drm_minor_lock, flags); - idr_replace(&drm_minors_idr, minor, minor->index); - spin_unlock_irqrestore(&drm_minor_lock, flags); + if (minor->type == DRM_MINOR_ACCEL) { + accel_minor_replace(minor, minor->index); + } else { + spin_lock_irqsave(&drm_minor_lock, flags); + idr_replace(&drm_minors_idr, minor, minor->index); + spin_unlock_irqrestore(&drm_minor_lock, flags); + } DRM_DEBUG("new minor registered %d\n", minor->index); return 0; @@ -194,9 +213,13 @@ static void drm_minor_unregister(struct drm_device *dev, unsigned int type) return; /* replace @minor with NULL so lookups will fail from now on */ - spin_lock_irqsave(&drm_minor_lock, flags); - idr_replace(&drm_minors_idr, NULL, minor->index); - spin_unlock_irqrestore(&drm_minor_lock, flags); + if (minor->type == DRM_MINOR_ACCEL) { + accel_minor_replace(NULL, minor->index); + } else { + spin_lock_irqsave(&drm_minor_lock, flags); + idr_replace(&drm_minors_idr, NULL, minor->index); + spin_unlock_irqrestore(&drm_minor_lock, flags); + } device_del(minor->kdev); dev_set_drvdata(minor->kdev, NULL); /* safety belt */ @@ -603,6 +626,14 @@ static int drm_dev_init(struct drm_device *dev, /* no per-device feature limits by default */ dev->driver_features = ~0u; + if (drm_core_check_feature(dev, DRIVER_COMPUTE_ACCEL) && + (drm_core_check_feature(dev, DRIVER_RENDER) || + drm_core_check_feature(dev, DRIVER_MODESET))) { + + DRM_ERROR("DRM driver can't be both a compute acceleration and graphics driver\n"); + return -EINVAL; + } + drm_legacy_init_members(dev); INIT_LIST_HEAD(&dev->filelist); INIT_LIST_HEAD(&dev->filelist_internal); @@ -628,15 +659,21 @@ static int drm_dev_init(struct drm_device *dev, dev->anon_inode = inode; - if (drm_core_check_feature(dev, DRIVER_RENDER)) { - ret = drm_minor_alloc(dev, DRM_MINOR_RENDER); + if (drm_core_check_feature(dev, DRIVER_COMPUTE_ACCEL)) { + ret = drm_minor_alloc(dev, DRM_MINOR_ACCEL); if (ret) goto err; - } + } else { + if (drm_core_check_feature(dev, DRIVER_RENDER)) { + ret = drm_minor_alloc(dev, DRM_MINOR_RENDER); + if (ret) + goto err; + } - ret = drm_minor_alloc(dev, DRM_MINOR_PRIMARY); - if (ret) - goto err; + ret = drm_minor_alloc(dev, DRM_MINOR_PRIMARY); + if (ret) + goto err; + } ret = drm_legacy_create_map_hash(dev); if (ret) @@ -883,6 +920,10 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) if (ret) goto err_minors; + ret = drm_minor_register(dev, DRM_MINOR_ACCEL); + if (ret) + goto err_minors; + ret = create_compat_control_link(dev); if (ret) goto err_minors; @@ -902,12 +943,13 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) driver->name, driver->major, driver->minor, driver->patchlevel, driver->date, dev->dev ? dev_name(dev->dev) : "virtual device", - dev->primary->index); + dev->primary ? dev->primary->index : dev->accel->index); goto out_unlock; err_minors: remove_compat_control_link(dev); + drm_minor_unregister(dev, DRM_MINOR_ACCEL); drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); out_unlock: @@ -950,6 +992,7 @@ void drm_dev_unregister(struct drm_device *dev) drm_legacy_rmmaps(dev); remove_compat_control_link(dev); + drm_minor_unregister(dev, DRM_MINOR_ACCEL); drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); } @@ -1034,6 +1077,7 @@ static const struct file_operations drm_stub_fops = { static void drm_core_exit(void) { drm_privacy_screen_lookup_exit(); + accel_core_exit(); unregister_chrdev(DRM_MAJOR, "drm"); debugfs_remove(drm_debugfs_root); drm_sysfs_destroy(); @@ -1061,6 +1105,10 @@ static int __init drm_core_init(void) if (ret < 0) goto error; + ret = accel_core_init(); + if (ret < 0) + goto error; + drm_privacy_screen_lookup_init(); drm_core_init_complete = true; diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 430e00b16eec..b8da978d85bb 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -471,19 +472,26 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor) struct device *kdev; int r; - if (minor->type == DRM_MINOR_RENDER) - minor_str = "renderD%d"; - else - minor_str = "card%d"; - kdev = kzalloc(sizeof(*kdev), GFP_KERNEL); if (!kdev) return ERR_PTR(-ENOMEM); device_initialize(kdev); - kdev->devt = MKDEV(DRM_MAJOR, minor->index); - kdev->class = drm_class; - kdev->type = &drm_sysfs_device_minor; + + if (minor->type == DRM_MINOR_ACCEL) { + minor_str = "accel%d"; + accel_set_device_instance_params(kdev, minor->index); + } else { + if (minor->type == DRM_MINOR_RENDER) + minor_str = "renderD%d"; + else + minor_str = "card%d"; + + kdev->devt = MKDEV(DRM_MAJOR, minor->index); + kdev->class = drm_class; + kdev->type = &drm_sysfs_device_minor; + } + kdev->parent = minor->dev->dev; kdev->release = drm_sysfs_release; dev_set_drvdata(kdev, minor); From patchwork Sat Nov 19 20:44:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 23328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp861572wrr; Sat, 19 Nov 2022 12:46:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf57YQqm6StvEuNKwKal3CuvdM5Tm+fdtTvKnOHJ0qfbwF1086/GotFy1K/Tz9ql/2i4qsIZ X-Received: by 2002:a63:e30c:0:b0:470:8098:f0de with SMTP id f12-20020a63e30c000000b004708098f0demr1409215pgh.527.1668890819166; Sat, 19 Nov 2022 12:46:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668890819; cv=none; d=google.com; s=arc-20160816; b=h7tY5eMt9m7SN4TPpl+WAM7BjnWZLOX1TnvPFlXmKPrxVD/BlrAYYurjZqXWnxBfo4 aGjg7fJFT8mfr1HHXgRZFKQ21aoDP6dS8c4cXKsNxDopFH6+gYLEvPO/7m+uariG3kgC D14LYil/TVN2hCxW1ro03eVHeWkO0Z8jlq5YxUEBfVHGPPFTj5AZy9srpavboFV/5gMo yOHAboo2MtAtPzd+HpH9yBZnoj+/qNbmdtQ0i5+7Jyyy+u2LczjGd7OJ4T2RYMJP37ru tlYc/YBK2810slkTbgtqrx+kI2Eg4aJIGIJPrLS8oPm49r1X7OhdI0sUeocgN+8c0Lh0 V9Sw== 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=zW7Nhaln0RaGY+7oU+iEgvRkTEELth5rKtWjMHq0Fv8=; b=GT/yxXEW+bC9ywwXnIa8PZqNpzmswTXXQmdZbB8AYiTqYj4cxcbYL4czw1FPj49/1Q kpK9JQz5ogTzCGfJIO/9CGxgHWYbeNAJ2WxdM8sUayVqDDV1bqe7/ZNjoidnIfUZViui jg+JdJUxFQcKy7w0q590k2DOVQbbhASHQ36vkX+ye/LKes7u0h+RBvB1CiH98631iJg/ nkH6TQnftxIciIOWfXaRHk8Du1bVepv4i2wIJr7aNMCXiUU5cUgP0UzfC5oQmGc4y8rV PUtprfx+HFF7GdnZvreE0scMK7ZqUALn/ZjLOr7Kd+ChPwh6mfrFbaP9ljNALe4MCcEU EISg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BTlKETCB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n17-20020a170902f61100b001869de3edcasi6993100plg.466.2022.11.19.12.46.44; Sat, 19 Nov 2022 12:46:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BTlKETCB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234451AbiKSUpZ (ORCPT + 99 others); Sat, 19 Nov 2022 15:45:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234911AbiKSUpQ (ORCPT ); Sat, 19 Nov 2022 15:45:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 978421A38D for ; Sat, 19 Nov 2022 12:45:12 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1B48CB801BA for ; Sat, 19 Nov 2022 20:45:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48A10C433B5; Sat, 19 Nov 2022 20:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668890709; bh=CBD8OmSr5rPgSjZyuyDPRILXCnJ2vLZOKnkTF8abduY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BTlKETCBlC50W1bvIe0y4agSrAnfuz4DL+MDlTFJ4+4EqNgd8uPqna8IjWw0CYK1V Rdtwfu8CFpacTMPvonQD20+USLFQVW2WW2AYtUeVFCNwej/ry6MOIgo2Zd98+36bpX hLJGbz1X9Nke7pc5a4Z7d1J7kJ1tau+B3MRnnlo4aVa3N5RrWJcCaNo0H9MzpPuUWZ 1Z3p1Y3n/Faekbmm4ZLRYSVsMFXHFWKeZc/1olwYCVmBHkcataTpwakiPtwFSAupnp 2LtKKyciT8BytNUi8MDg3QuJnd8A1oUppwKFIrbWBRDhCpf7EZWFZi0hSGIPNtZx9v rAtVePdAyFk/g== From: Oded Gabbay To: David Airlie , Daniel Vetter , Greg Kroah-Hartman Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Yuji Ishikawa , Jiho Chu , Daniel Stone , Tvrtko Ursulin , Jason Gunthorpe , Jeffrey Hugo , Christoph Hellwig , Kevin Hilman , Jagan Teki , John Hubbard , Alex Deucher , Jacek Lawrynowicz , Maciej Kwapulinski , Christopher Friedt Subject: [PATCH v4 4/4] doc: add documentation for accel subsystem Date: Sat, 19 Nov 2022 22:44:35 +0200 Message-Id: <20221119204435.97113-5-ogabbay@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221119204435.97113-1-ogabbay@kernel.org> References: <20221119204435.97113-1-ogabbay@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749958859570664944?= X-GMAIL-MSGID: =?utf-8?q?1749958859570664944?= Add an introduction section for the accel subsystem. Most of the relevant data is in the DRM documentation, so the introduction only presents the why of the new subsystem, how are the compute accelerators exposed to user-space and what changes need to be done in a standard DRM driver to register it to the new accel subsystem. Signed-off-by: Oded Gabbay --- Documentation/accel/index.rst | 17 +++++ Documentation/accel/introduction.rst | 109 +++++++++++++++++++++++++++ Documentation/subsystem-apis.rst | 1 + MAINTAINERS | 1 + 4 files changed, 128 insertions(+) create mode 100644 Documentation/accel/index.rst create mode 100644 Documentation/accel/introduction.rst diff --git a/Documentation/accel/index.rst b/Documentation/accel/index.rst new file mode 100644 index 000000000000..2b43c9a7f67b --- /dev/null +++ b/Documentation/accel/index.rst @@ -0,0 +1,17 @@ +.. SPDX-License-Identifier: GPL-2.0 + +==================== +Compute Accelerators +==================== + +.. toctree:: + :maxdepth: 1 + + introduction + +.. only:: subproject and html + + Indices + ======= + + * :ref:`genindex` diff --git a/Documentation/accel/introduction.rst b/Documentation/accel/introduction.rst new file mode 100644 index 000000000000..5a3963eae973 --- /dev/null +++ b/Documentation/accel/introduction.rst @@ -0,0 +1,109 @@ +.. SPDX-License-Identifier: GPL-2.0 + +============ +Introduction +============ + +The Linux compute accelerators subsystem is designed to expose compute +accelerators in a common way to user-space and provide a common set of +functionality. + +These devices can be either stand-alone ASICs or IP blocks inside an SoC/GPU. +Although these devices are typically designed to accelerate Machine-Learning +and/or Deep-Learning computations, the accel layer is not limited to handling +these types of accelerators. + +typically, a compute accelerator will belong to one of the following +categories: + +- Edge AI - doing inference at an edge device. It can be an embedded ASIC/FPGA, + or an IP inside a SoC (e.g. laptop web camera). These devices + are typically configured using registers and can work with or without DMA. + +- Inference data-center - single/multi user devices in a large server. This + type of device can be stand-alone or an IP inside a SoC or a GPU. It will + have on-board DRAM (to hold the DL topology), DMA engines and + command submission queues (either kernel or user-space queues). + It might also have an MMU to manage multiple users and might also enable + virtualization (SR-IOV) to support multiple VMs on the same device. In + addition, these devices will usually have some tools, such as profiler and + debugger. + +- Training data-center - Similar to Inference data-center cards, but typically + have more computational power and memory b/w (e.g. HBM) and will likely have + a method of scaling-up/out, i.e. connecting to other training cards inside + the server or in other servers, respectively. + +All these devices typically have different runtime user-space software stacks, +that are tailored-made to their h/w. In addition, they will also probably +include a compiler to generate programs to their custom-made computational +engines. Typically, the common layer in user-space will be the DL frameworks, +such as PyTorch and TensorFlow. + +Sharing code with DRM +===================== + +Because this type of devices can be an IP inside GPUs or have similar +characteristics as those of GPUs, the accel subsystem will use the +DRM subsystem's code and functionality. i.e. the accel core code will +be part of the DRM subsystem and an accel device will be a new type of DRM +device. + +This will allow us to leverage the extensive DRM code-base and +collaborate with DRM developers that have experience with this type of +devices. In addition, new features that will be added for the accelerator +drivers can be of use to GPU drivers as well. + +Differentiation from GPUs +========================= + +Because we want to prevent the extensive user-space graphic software stack +from trying to use an accelerator as a GPU, the compute accelerators will be +differentiated from GPUs by using a new major number and new device char files. + +Furthermore, the drivers will be located in a separate place in the kernel +tree - drivers/accel/. + +The accelerator devices will be exposed to the user space with the dedicated +261 major number and will have the following convention: + +- device char files - /dev/accel/accel* +- sysfs - /sys/class/accel/accel*/ +- debugfs - /sys/kernel/debug/accel/accel*/ + +Getting Started +=============== + +First, read the DRM documentation. Not only it will explain how to write a new +DRM driver but it will also contain all the information on how to contribute, +the Code Of Conduct and what is the coding style/documentation. All of that +is the same for the accel subsystem. + +Second, make sure the kernel is configured with CONFIG_DRM_ACCEL. + +To expose your device as an accelerator, two changes are needed to +be done in your driver (as opposed to a standard DRM driver): + +- Add the DRIVER_COMPUTE_ACCEL feature flag in your drm_driver's + driver_features field. It is important to note that this driver feature is + mutually exclusive with DRIVER_RENDER and DRIVER_MODESET. Devices that want + to expose both graphics and compute device char files should be handled by + two drivers that are connected using the auxiliary bus framework. + +- Change the open callback in your driver fops structure to accel_open(). + Alternatively, your driver can use DEFINE_DRM_ACCEL_FOPS macro to easily + set the correct function operations pointers structure. + +External References +=================== + +email threads +------------- + +* `Initial discussion on the New subsystem for acceleration devices `_ - Oded Gabbay (2022) +* `patch-set to add the new subsystem `_ - Oded Gabbay (2022) + +Conference talks +---------------- + +* `LPC 2022 Accelerators BOF outcomes summary `_ - Dave Airlie (2022) diff --git a/Documentation/subsystem-apis.rst b/Documentation/subsystem-apis.rst index af65004a80aa..b51f38527e14 100644 --- a/Documentation/subsystem-apis.rst +++ b/Documentation/subsystem-apis.rst @@ -43,6 +43,7 @@ needed). input/index hwmon/index gpu/index + accel/index security/index sound/index crypto/index diff --git a/MAINTAINERS b/MAINTAINERS index 4d752aac3ec0..6ba7bb35208a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6837,6 +6837,7 @@ L: dri-devel@lists.freedesktop.org S: Maintained C: irc://irc.oftc.net/dri-devel T: git https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/accel.git +F: Documentation/accel/ F: drivers/accel/ DRM DRIVERS FOR ALLWINNER A10