Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2032214lqo; Sun, 19 May 2024 09:53:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6VY2u2Hn1pUMzsLDlAadCQN5ebQklHtxgK38VNerqzbFjyG4Q97ef3+Ln5SpI2Zt5trDiETBi4b91qiGWg7Z1GdfARzmgL749o0xq6g== X-Google-Smtp-Source: AGHT+IFHXP6Im/eR32dGeZHvGWUjnqdOk3QISnZwaWKub09gwUEMhdPp9i3tpVnZvlWI/iDG8PZ4 X-Received: by 2002:a05:6214:3283:b0:696:8f17:2ccb with SMTP id 6a1803df08f44-6a16815ce2emr282551216d6.17.1716137635853; Sun, 19 May 2024 09:53:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716137635; cv=pass; d=google.com; s=arc-20160816; b=sZQ2mQeuCQBMsMul9UuOf44uqFaOCTCxYsPpO4ncW2fKyxwDcx8JRt1REO3ptbmPV/ TQY7xEOGtkJsD7vyVqze4ztbQG/VESndVFyUyAqnQNSgo2jk5PhGIJm3TH7o2yh2uAIX zt0yayIGxkAAJat0K1JOw6TRNo8pxDZ4GQzDb0wHwUOHgydnms7GvNtoVf+gyWJPR3aC WTD2lTb42HzFjALSvnp4SZHy198kcF+GlTaPhUo67be7irTR4fN0OzobRRf2mjNAROuP Pr9Su9EgBjKhIwQdimARiIzuX6yPx9Y4F+QFownrEHiDrXKX46hud2/rB+HWMBlVdDj0 12+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=FuOak0X2GaG4L1svxVLJRuYwxll44K4jK0Xm/fybtzo=; fh=Mx+BJ0Zegwoq+pIWLfBBdNviDVJx9ufihb/fzE11nms=; b=L97J4GeLQu1g7st+wa9SePYQhEL0tQXauxDCaU2Q7FQJ8GeSRW7cW70ASJAZ7csT21 mJW8nP4TfHjPjr+cZ4XAFlXQ74b+PZyoCT81Yc2aXxUTrJlDH7pbaFO87RTX9IuZ2pxj ck6vn8VGSMojU6VX+0up1uzcLjaxHMOb9ZemjGcxw8iAD9TqfqWSVkjM4iaMirxMsAMg ZVAKM+ZM31PCEOw/CprWez9kRj2uWiLE2otY4IEHYlin2TIy3+Ct4+NvjzVlMG7t/8Vn 6C4mMTxlitfUl2rxuvmMVmc/rx3S7e7HRTXywpG55QqpRuE6CF2xbB8Bm8+mhQtu+rn9 7KTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fX+avRDV; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-183152-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6aaeaa955b3si724646d6.72.2024.05.19.09.53.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 09:53:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183152-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fX+avRDV; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-183152-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9552D1C20E61 for ; Sun, 19 May 2024 16:53:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 910C645BE4; Sun, 19 May 2024 16:53:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="fX+avRDV" Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (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 3E03710957 for ; Sun, 19 May 2024 16:53:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716137629; cv=none; b=s5GFKR2FlFoxl2xfge5JKxGEf9ZpdEz28KaH2vca7iAgBDvkk/H8zRwdAg9bkkuDc7Bb5EDR3Hjd0q+Tr5Okv1TVCMdKsaAK1aNEIGbXTTyhHN0ryrEq0Zznom/jwV+Sdn7OEtS/pPOqXllb3SlSZ+bdf8se8O0vpYpDXg+qEC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716137629; c=relaxed/simple; bh=Po+1KvkPJoTu32T4IF95CT38BZXUTlQe++YziYUSbaU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=M3JgLl0XQOlNNUAlvoH4BfE08uET0VtWTBUlCmh0EVxaI+cJunAYq3Ue1EdvXwQcbYC5jU4xYvEaXtoMj2XaRYZq+FJlWMs/i9HS/JNpOPHB1Hy7AxAZb5vV+fHxwUMvm1BQXQMywSf7lCRewF3TNXKvP4yWn1PcdkRJIKJJi4Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=fX+avRDV; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: l.stach@pengutronix.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716137625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FuOak0X2GaG4L1svxVLJRuYwxll44K4jK0Xm/fybtzo=; b=fX+avRDV73axaKVDoFcR27s4jvjZaOb7pQ9X38faGhAP26IqI4fiMG4SXcIohUHk2+de70 7in4/TWaGNc1FnQ82uqvCajnwLsE99RZICVyd9dBX1ZA48tAK424jRMiEyoiqGaayR8eXn NUbtuc8VNBEycMeRqtrnzCFrg3SmXEA= X-Envelope-To: linux+etnaviv@armlinux.org.uk X-Envelope-To: christian.gmeiner@gmail.com X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: etnaviv@lists.freedesktop.org X-Envelope-To: dri-devel@lists.freedesktop.org X-Envelope-To: sui.jingfeng@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sui Jingfeng To: Lucas Stach Cc: Russell King , Christian Gmeiner , linux-kernel@vger.kernel.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Sui Jingfeng Subject: [etnaviv-next v14 0/8] drm/etnaviv: Add driver wrapper for vivante GPUs attached on PCI(e) device Date: Mon, 20 May 2024 00:53:13 +0800 Message-Id: <20240519165321.2123356-1-sui.jingfeng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT drm/etnaviv use the component framework to bind multiple GPU cores to a virtual master, the virtual master is manually create during driver load time. This works well for various SoCs, yet there are some PCIe card has the vivante GPU cores integrated. The driver lacks the support for PCIe devices currently. Adds PCIe driver wrapper on the top of what drm/etnaviv already has, the component framework is still being used to bind subdevices, even though there is only one GPU core. But the process is going to be reversed, we create virtual platform device for each of the vivante GPU IP core shipped by the PCIe master. The PCIe master is real, bind all the virtual child to the master with component framework. v6: * Fix build issue on system without CONFIG_PCI enabled v7: * Add a separate patch for the platform driver rearrangement (Bjorn) * Switch to runtime check if the GPU is dma coherent or not (Lucas) * Add ETNAVIV_PARAM_GPU_COHERENT to allow userspace to query (Lucas) * Remove etnaviv_gpu.no_clk member (Lucas) * Fix Various typos and coding style fixed (Bjorn) v8: * Fix typos and remove unnecessary header included (Bjorn). * Add a dedicated function to create the virtual master platform device. v9: * Use PCI_VDEVICE() macro (Bjorn) * Add trivial stubs for the PCI driver (Bjorn) * Remove a redundant dev_err() usage (Bjorn) * Clean up etnaviv_pdev_probe() with etnaviv_of_first_available_node() v10: * Add one more cleanup patch * Resolve the conflict with a patch from Rob * Make the dummy PCI stub inlined * Print only if the platform is dma-coherrent V11: * Drop unnecessary changes (Lucas) * Tweak according to other reviews of v10. V12: * Create a virtual platform device for the subcomponent GPU cores * Bind all subordinate GPU cores to the real PCI master via component. V13: * Drop the non-component code path, always use the component framework to bind subcomponent GPU core. Even though there is only one core. * Defer the irq handler register. * Rebase and improve the commit message V14: * Rebase onto etnaviv-next and improve commit message. Tested with JD9230P GPU and LingJiu GP102 GPU. Sui Jingfeng (8): drm/etnaviv: Add a dedicated helper function to get various clocks drm/etnaviv: Add constructor and destructor for the etnaviv_drm_private structure drm/etnaviv: Embed struct drm_device into struct etnaviv_drm_private drm/etnaviv: Fix wrong cache property being used for vmap() drm/etnaviv: Add support for cached coherent caching mode drm/etnaviv: Replace the '&pdev->dev' with 'dev' drm/etnaviv: Allow creating subdevices and pass platform specific data drm/etnaviv: Add support for vivante GPU cores attached via PCIe device drivers/gpu/drm/etnaviv/Kconfig | 8 + drivers/gpu/drm/etnaviv/Makefile | 2 + drivers/gpu/drm/etnaviv/etnaviv_drv.c | 159 ++++++++++------ drivers/gpu/drm/etnaviv/etnaviv_drv.h | 27 +++ drivers/gpu/drm/etnaviv/etnaviv_gem.c | 22 ++- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 144 +++++++++----- drivers/gpu/drm/etnaviv/etnaviv_gpu.h | 4 + drivers/gpu/drm/etnaviv/etnaviv_mmu.c | 4 +- drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c | 187 +++++++++++++++++++ drivers/gpu/drm/etnaviv/etnaviv_pci_drv.h | 18 ++ include/uapi/drm/etnaviv_drm.h | 1 + 12 files changed, 468 insertions(+), 110 deletions(-) create mode 100644 drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c create mode 100644 drivers/gpu/drm/etnaviv/etnaviv_pci_drv.h base-commit: 52272bfff15ee70c7bd5be9368f175948fb8ecfd -- 2.34.1