From patchwork Tue Oct 3 11:33:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13407507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2914E75451 for ; Tue, 3 Oct 2023 11:34:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B5D6910E2A0; Tue, 3 Oct 2023 11:34:07 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by gabe.freedesktop.org (Postfix) with ESMTP id 702C310E0AB; Tue, 3 Oct 2023 11:34:01 +0000 (UTC) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8Cx2eol_BtlC80uAA--.18988S3; Tue, 03 Oct 2023 19:33:58 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y8k_Btl7JAXAA--.48472S2; Tue, 03 Oct 2023 19:33:56 +0800 (CST) From: Sui Jingfeng To: Lucas Stach Subject: [PATCH v11 0/5] drm/etnaviv: Add pci device driver wrapper Date: Tue, 3 Oct 2023 19:33:51 +0800 Message-Id: <20231003113356.645394-1-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y8k_Btl7JAXAA--.48472S2 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW7Aw47ZF4kKF4rXw4rtFW3XFc_yoW8KryDpF 4fGFyYyrykurW2g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There: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Gmeiner , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This series is add PCI device driver wrapper, to support the Vivante GC1000 GPU in LS2K1000 and LS7A1000. The whole serie have been tested on LS3A5000+LS7A1000 board, with another trivial patchset [1] applied beforehand. [1] https://patchwork.freedesktop.org/series/119825/ 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) * 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. Sui Jingfeng (5): drm/etnaviv: Add a dedicated function to get various clocks drm/etnaviv: Add constructor and destructor function for etnaviv_drm_private drm/etnaviv: Allow bypass component framework drm/etnaviv: Add driver support for the PCI devices drm/etnaviv: Add support for cached coherent caching mode drivers/gpu/drm/etnaviv/Kconfig | 8 ++ drivers/gpu/drm/etnaviv/Makefile | 2 + drivers/gpu/drm/etnaviv/etnaviv_drv.c | 131 ++++++++++++++------- drivers/gpu/drm/etnaviv/etnaviv_drv.h | 12 ++ drivers/gpu/drm/etnaviv/etnaviv_gem.c | 16 ++- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 134 ++++++++++++++-------- drivers/gpu/drm/etnaviv/etnaviv_gpu.h | 7 ++ drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c | 74 ++++++++++++ drivers/gpu/drm/etnaviv/etnaviv_pci_drv.h | 18 +++ include/uapi/drm/etnaviv_drm.h | 1 + 10 files changed, 314 insertions(+), 89 deletions(-) create mode 100644 drivers/gpu/drm/etnaviv/etnaviv_pci_drv.c create mode 100644 drivers/gpu/drm/etnaviv/etnaviv_pci_drv.h