Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2649008pxb; Fri, 17 Sep 2021 15:04:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFSViJes3pPTsLnor9gjxH3Ge2ghbDQv1nEh9CeyE0jFqAAIu87BA0JpfeBjqQfuhxt4ge X-Received: by 2002:a5d:959a:: with SMTP id a26mr10243038ioo.154.1631916240523; Fri, 17 Sep 2021 15:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631916240; cv=none; d=google.com; s=arc-20160816; b=pELQITgoVFN+azrkutfCbQJxbH/o5S9CDjo/u1co8FDyLUh4/LRFAK40aUz2xd0idL 5QGd0lII3L05JWw3D7GNLVX6+nHV8dfbKVQwP4dpek41/flengRb/2+8rnx0pC+XRZ8F KAjKxPES1Rl7j9FlAXcGV4LOxb6w4ViJkChDbDlP/yrLbGhXvXzLwGDUom0f2ADV3OQL 8baQ3ZPQKUgNdXNimBu4cJWSlL9RY2j2J1XeQ/O065x6akLYszuAGkpDCNqO/aoKys5J Uhtktxco3Mvqtr2w+lNJ10+3O8ReYBErF857I2SU6tYR2bqHWthsosWIhtIoMvVM86GO MwYQ== 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:dkim-signature; bh=TmSUd1g256AwM6GPkCVL8KzZlMuiVA8rcald4HgLdWY=; b=HEZ+AttC9wNkRybstSyzacsZbb1H5FVSX3TMZiRbR/YuLzw/aatwPHyExkVtOOy68s OeKRZnDWpVvEbaQlpZ+kuliO7LrEwxtFZ1VU2BZytxGIvvNtptG6VPdikZLbwT8KiuBi cBY/QCu/4kJCOQADJSEjqI0r7jZVRgJ9xO5W9lyRNLZE39MopMmuKCAGyAsmkjh2Oy4s ntqVL5C9oZtT0IX+wTqPQWSCwjeWiJ38YsmXfm2QsQFS2tWnzhLy2WfOZzhQikNTOjYz eB4NvrZPkM7vOvmztukbF0LOmN07h6ZSdBgGVByk4OhEdVrJr7DPUoO+1T5poGcBDBfq 2opg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b="Vojsq/qA"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s17si1277229ios.107.2021.09.17.15.03.08; Fri, 17 Sep 2021 15:04:00 -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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b="Vojsq/qA"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244828AbhIQM7S (ORCPT + 99 others); Fri, 17 Sep 2021 08:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244814AbhIQM7S (ORCPT ); Fri, 17 Sep 2021 08:59:18 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 091B4C061764 for ; Fri, 17 Sep 2021 05:57:56 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id q26so15030281wrc.7 for ; Fri, 17 Sep 2021 05:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TmSUd1g256AwM6GPkCVL8KzZlMuiVA8rcald4HgLdWY=; b=Vojsq/qATfqaLlBx4GBlzY1M3WQZBkET3/mYiL3HkeYBMyHzWtJbjHthyfck3N2imY cOchlbwuXK/iJL6FTVNRR4N6LsDzg5ueKC6Q/busloEZbIggqb55XCgGJc5u+W6/q1Sc C3F2brFPLgR81rImVQ/fzY1R8cBgz8gBVfsLVqJeh3G9HxBG0VqAwdbdGikzpDS42CE9 ofZWBpM1Dyv1TFNfej7D0ZCxUYMFOKLR0gPEgxl3cicBjY9FSggM8IL0jVct8KiT/Ctm 6Dr2o3sqhUQ9wRKHM2Se+EoGr+ehAxcbcAFY6nNObaZgFuVZTxRftv90jKjlNW6Xwtc/ fmig== 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:mime-version :content-transfer-encoding; bh=TmSUd1g256AwM6GPkCVL8KzZlMuiVA8rcald4HgLdWY=; b=UV0/6JNBY+mVFBlGqyDq8UvH7paFby2ZZh5JJLolevOjk6m9hDJu2zjrZhLBHHZutu zwb36s73Z6Na2dtWUTmxtCNxE8s02rK2xzKUgnnejTUXnXfgpBTzHiNqu0h2niHVNGKQ wyO6Ewp1d1Wx1oK5L+0UkCMiiutDMpTQzBcUGH2kCNSsxpnb/AuJ9I2wypaAWAlU/jSB n5VIZwXwxVDl4ejXnrswIFLsISIgVVauLEyNIeFWle7Gi/AQOdrLSBAoEntWmDitCirC tOz/Y9m/6R/yFlubfk7E4feH9acRsz37k0FBGK3xkudlxDUgkbseL3snS7xdrr4KQyJi h93Q== X-Gm-Message-State: AOAM530PBkT6cWPUQi+H+oEcsxrBWNM5+snfXYK3qImxXTJ2I/ZL1xgZ DLXdLTCo/iWVUK0IgfWnh1OHdQ== X-Received: by 2002:adf:b781:: with SMTP id s1mr11968492wre.165.1631883474593; Fri, 17 Sep 2021 05:57:54 -0700 (PDT) Received: from localhost.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id f3sm6358636wmj.28.2021.09.17.05.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Sep 2021 05:57:53 -0700 (PDT) From: Alexandre Bailon To: airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, matthias.bgg@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, sumit.semwal@linaro.org Cc: christian.koenig@amd.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, khilman@baylibre.com, gpain@baylibre.com, Alexandre Bailon Subject: [RFC PATCH 0/4] Add a DRM driver to support AI Processing Unit (APU) Date: Fri, 17 Sep 2021 14:59:41 +0200 Message-Id: <20210917125945.620097-1-abailon@baylibre.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds a DRM driver that implements communication between the CPU and an APU. This uses VirtIO buffer to exchange messages. For the data, we allocate a GEM object and map it using IOMMU to make it available to the APU. The driver is relatively generic, and should work with any SoC implementing hardware accelerator for AI if they use support remoteproc and VirtIO. For the people interested by the firmware or userspace library, the sources are available here: https://github.com/BayLibre/open-amp/tree/v2020.01-mtk/apps/examples/apu This RFC is a rewrite of a previous RFC that was not using DRM: https://patchwork.kernel.org/project/linux-remoteproc/cover/20200930115350.5272-1-abailon@baylibre.com/ Alexandre Bailon (4): dt-bindings: Add bidings for mtk,apu-drm DRM: Add support of AI Processor Unit (APU) rpmsg: Add support of AI Processor Unit (APU) ARM64: mt8183-pumpkin: Add the APU DRM device .../devicetree/bindings/gpu/mtk,apu-drm.yaml | 38 ++ .../boot/dts/mediatek/mt8183-pumpkin.dts | 6 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/apu/Kconfig | 10 + drivers/gpu/drm/apu/Makefile | 7 + drivers/gpu/drm/apu/apu_drm_drv.c | 238 +++++++ drivers/gpu/drm/apu/apu_gem.c | 232 +++++++ drivers/gpu/drm/apu/apu_internal.h | 89 +++ drivers/gpu/drm/apu/apu_sched.c | 634 ++++++++++++++++++ drivers/rpmsg/Kconfig | 10 + drivers/rpmsg/Makefile | 1 + drivers/rpmsg/apu_rpmsg.c | 184 +++++ include/drm/apu_drm.h | 59 ++ include/uapi/drm/apu_drm.h | 106 +++ 15 files changed, 1617 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpu/mtk,apu-drm.yaml create mode 100644 drivers/gpu/drm/apu/Kconfig create mode 100644 drivers/gpu/drm/apu/Makefile create mode 100644 drivers/gpu/drm/apu/apu_drm_drv.c create mode 100644 drivers/gpu/drm/apu/apu_gem.c create mode 100644 drivers/gpu/drm/apu/apu_internal.h create mode 100644 drivers/gpu/drm/apu/apu_sched.c create mode 100644 drivers/rpmsg/apu_rpmsg.c create mode 100644 include/drm/apu_drm.h create mode 100644 include/uapi/drm/apu_drm.h -- 2.31.1