From patchwork Fri Sep 3 12:31:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12474353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2BBEC433EF for ; Fri, 3 Sep 2021 12:31:33 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 77AD1604AC for ; Fri, 3 Sep 2021 12:31:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 77AD1604AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B27136E886; Fri, 3 Sep 2021 12:31:32 +0000 (UTC) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by gabe.freedesktop.org (Postfix) with ESMTPS id 80B7C6E883 for ; Fri, 3 Sep 2021 12:31:31 +0000 (UTC) Received: by mail-wm1-x336.google.com with SMTP id j17-20020a05600c1c1100b002e754875260so3444047wms.4 for ; Fri, 03 Sep 2021 05:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=xMf9W+3BOW+KjvHXPRo/PLq0f2n/Vd5osGKCVrb0at0=; b=F5eobai/uCNpGbhS5ttZWYnbmFU0H8H/CBKE6XSwb3w0TO10fMBWUDgZVe9RYmdx48 Ks5KNHrdSfmXGT9E/1812/3AqDbk1zDTbUP6fUqQwBT76W2EGQPETJUHGALo+tcVzmMt 1+1ZDoBLVrCpr99hZYxA/LTp6AyV1kCCqrSLLnlUA8atZhDQtRkMaCtFt6RAHSk6LDNe RR3uwg2ENtG7hAYr0vCdjSeXw6H897nRmyWyM1EbHzrtIlq+j7WzpII6EQcDcGqw7pPs Met3cGFienBCcE4jZ0u+n5/FUg4LMGk/ZDGFiuX1zKN1Az1kDTeFmnZ1BMhYUWpO5zZ9 SzNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=xMf9W+3BOW+KjvHXPRo/PLq0f2n/Vd5osGKCVrb0at0=; b=Fnb06LTVvXuhc3G9Vy37B0zaAkbS4viIk/lK7Gz7XLpvqMASXVN2qVdWXUDHmRC+Dt AYPmeT9M7g8y3nQ+D/dJsEPNV4t76u0GwrdB/SP2D6ECqtp3gKf1ZGykwcqNn8pVoOyr zNUcdaspTizK+hWnzBpT3sAI2d2XMEaEwPDfNtj0PhIytkq5Zpcsu/I1+rOFBjfanyN3 2aPLlXgsO+6S7kPXqPAqlMCmSXCvf82eORM8HVGxCisAyydFXqHqxF7Su+nRnuW6nfun Ms+GrI/k5sqh1eXtmRzeUK8uxlk+IIf/pch15TAkihpITQXfFZKvoXuG/DwaivympD4B DUPA== X-Gm-Message-State: AOAM532F29rizEQw/JudDXae6yy59hY7DXs0hWue4fhwZg+QhuPQKdtN Zq3YaZdxNhmDZhGpjrDDy/Evn3vqVHNSk/g9 X-Google-Smtp-Source: ABdhPJydcJn5d1KgkEXkIPV2iSo3qYpxbQB+lMA1KuelmCbpBc2UGq9euMOGgcOs7r2L3JCiV+FHoQ== X-Received: by 2002:a05:600c:2f90:: with SMTP id t16mr8317957wmn.136.1630672290002; Fri, 03 Sep 2021 05:31:30 -0700 (PDT) Received: from abel.fritz.box (p5b0ea1b5.dip0.t-ipconnect.de. [91.14.161.181]) by smtp.gmail.com with ESMTPSA id x11sm4564873wro.83.2021.09.03.05.31.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 05:31:29 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/5] drm/ttm: remove the outdated kerneldoc section Date: Fri, 3 Sep 2021 14:31:19 +0200 Message-Id: <20210903123123.116575-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Clean up to start over with new and more accurate documentation. Signed-off-by: Christian König Reviewed-by: Matthew Auld --- Documentation/gpu/drm-mm.rst | 49 ------------------------------------ 1 file changed, 49 deletions(-) diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst index 0198fa43d254..8ca981065e1a 100644 --- a/Documentation/gpu/drm-mm.rst +++ b/Documentation/gpu/drm-mm.rst @@ -30,55 +30,6 @@ The Translation Table Manager (TTM) TTM design background and information belongs here. -TTM initialization ------------------- - - **Warning** - This section is outdated. - -Drivers wishing to support TTM must pass a filled :c:type:`ttm_bo_driver -` structure to ttm_bo_device_init, together with an -initialized global reference to the memory manager. The ttm_bo_driver -structure contains several fields with function pointers for -initializing the TTM, allocating and freeing memory, waiting for command -completion and fence synchronization, and memory migration. - -The :c:type:`struct drm_global_reference ` is made -up of several fields: - -.. code-block:: c - - struct drm_global_reference { - enum ttm_global_types global_type; - size_t size; - void *object; - int (*init) (struct drm_global_reference *); - void (*release) (struct drm_global_reference *); - }; - - -There should be one global reference structure for your memory manager -as a whole, and there will be others for each object created by the -memory manager at runtime. Your global TTM should have a type of -TTM_GLOBAL_TTM_MEM. The size field for the global object should be -sizeof(struct ttm_mem_global), and the init and release hooks should -point at your driver-specific init and release routines, which probably -eventually call ttm_mem_global_init and ttm_mem_global_release, -respectively. - -Once your global TTM accounting structure is set up and initialized by -calling ttm_global_item_ref() on it, you need to create a buffer -object TTM to provide a pool for buffer object allocation by clients and -the kernel itself. The type of this object should be -TTM_GLOBAL_TTM_BO, and its size should be sizeof(struct -ttm_bo_global). Again, driver-specific init and release functions may -be provided, likely eventually calling ttm_bo_global_ref_init() and -ttm_bo_global_ref_release(), respectively. Also, like the previous -object, ttm_global_item_ref() is used to create an initial reference -count for the TTM, which will call your initialization function. - -See the radeon_ttm.c file for an example of usage. - The Graphics Execution Manager (GEM) ==================================== From patchwork Fri Sep 3 12:31:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12474355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CA78C433F5 for ; Fri, 3 Sep 2021 12:31:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5B84F604AC for ; Fri, 3 Sep 2021 12:31:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5B84F604AC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ECA626E884; Fri, 3 Sep 2021 12:31:35 +0000 (UTC) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D4376E885 for ; Fri, 3 Sep 2021 12:31:33 +0000 (UTC) Received: by mail-wm1-x32b.google.com with SMTP id x2-20020a1c7c02000000b002e6f1f69a1eso3666488wmc.5 for ; Fri, 03 Sep 2021 05:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=p9/lQtbDU3qwmXaGnetxOrcxbNaLxJtMNDb950Jhzlw=; b=HEj8AJoavXwZgd8XLxDe2/3M0ADmSGa0wrY5SDf57squkCxTie6FECsDgkfl7UoQGS zEswR5sqZ5krZ6TNuG17/HAs/NGCJC+RUVrmZesGbz3FtpMrMU6Wg1YJHSk8CVep/kuf evIW5sxlALLGYVXZhQ0xl3RcmyXLc4KDtxEOrFu7gwStiOrjr2qc/phlMFuIwj7G9hv/ hFIxiULCvU5NkzgyxvIuTpA/pkN5Zyn4rNVsqdCk4kNMad3T6ofJK9gIq2lfYxL47CPV 1/WS53djjoEw1L2LtWMKV3XFOVr+YvkBQH1H6clUvuzEQJpYEaRVyPNfNtO/W3HVk05i 6VZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p9/lQtbDU3qwmXaGnetxOrcxbNaLxJtMNDb950Jhzlw=; b=Un3nmh1hCW0vQM0B9GZzYUlawpBnaxL3fQXx4Ro7+jgmJh3Gt9tNdDHyW9F9HZWo+g PafQ2tx1V/k9WwLUyLR1IMFWQEM9tAbqQHTg3xVmPTq4RheGUxkYqxsZPvrCsUgnjLHk XYv8HBGc4cqMkO9sX8dQO3wAUR7vWubNlvcsGzrDeLlM5o01G9RSffm7JJuHFVlZu0mb mB5WWRdDkuPY6PASu2CGxB120ZvjJOH1w2Oyj/dKtTCtaV3OtHrPVmey6Lku2lYOgh/q FinXvGwvPRuDTbT0Y6yvJaQwmtbVccRv2jEIE0bPzvuyOoKu/k1AahqpaRZlVLmVykR4 3ydg== X-Gm-Message-State: AOAM533yw46OYqRmQSZcNsWZ5BT1tzfNfE0cOHkUX8uNGkrp2LbqUipv F1zZYskQJF1thDEi9ppSmRioW15femUqPnZH X-Google-Smtp-Source: ABdhPJyti/noRTb4nEcV4onzXh6v8+hp6o+fd0fQL8HwBoNN57bDOkeRbrvi5n2R2f5jT4CWI36MaA== X-Received: by 2002:a05:600c:4e8b:: with SMTP id f11mr92809wmq.165.1630672292308; Fri, 03 Sep 2021 05:31:32 -0700 (PDT) Received: from abel.fritz.box (p5b0ea1b5.dip0.t-ipconnect.de. [91.14.161.181]) by smtp.gmail.com with ESMTPSA id x11sm4564873wro.83.2021.09.03.05.31.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 05:31:31 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/5] drm/ttm: enable TTM device object kerneldoc Date: Fri, 3 Sep 2021 14:31:20 +0200 Message-Id: <20210903123123.116575-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210903123123.116575-1-christian.koenig@amd.com> References: <20210903123123.116575-1-christian.koenig@amd.com> MIME-Version: 1.0 X-BeenThere: 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix the remaining warnings, switch to inline structure documentation and finally enable this. Signed-off-by: Christian König --- Documentation/gpu/drm-mm.rst | 9 +++++ include/drm/ttm/ttm_device.h | 73 +++++++++++++++++++++--------------- 2 files changed, 51 insertions(+), 31 deletions(-) diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst index 8ca981065e1a..56b7b581567d 100644 --- a/Documentation/gpu/drm-mm.rst +++ b/Documentation/gpu/drm-mm.rst @@ -30,6 +30,15 @@ The Translation Table Manager (TTM) TTM design background and information belongs here. +TTM device object reference +--------------------------- + +.. kernel-doc:: include/drm/ttm/ttm_device.h + :internal: + +.. kernel-doc:: drivers/gpu/drm/ttm/ttm_device.c + :export: + The Graphics Execution Manager (GEM) ==================================== diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h index 07d722950d5b..0b31ec731e66 100644 --- a/include/drm/ttm/ttm_device.h +++ b/include/drm/ttm/ttm_device.h @@ -39,31 +39,23 @@ struct ttm_operation_ctx; /** * struct ttm_global - Buffer object driver global data. - * - * @dummy_read_page: Pointer to a dummy page used for mapping requests - * of unpopulated pages. - * @shrink: A shrink callback object used for buffer object swap. - * @device_list_mutex: Mutex protecting the device list. - * This mutex is held while traversing the device list for pm options. - * @lru_lock: Spinlock protecting the bo subsystem lru lists. - * @device_list: List of buffer object devices. - * @swap_lru: Lru list of buffer objects used for swapping. */ extern struct ttm_global { /** - * Constant after init. + * @dummy_read_page: Pointer to a dummy page used for mapping requests + * of unpopulated pages. Constant after init. */ - struct page *dummy_read_page; /** - * Protected by ttm_global_mutex. + * @device_list: List of buffer object devices. Protected by + * ttm_global_mutex. */ struct list_head device_list; /** - * Internal protection. + * @bo_count: Number of buffer objects allocated by devices. */ atomic_t bo_count; } ttm_glob; @@ -230,50 +222,69 @@ struct ttm_device_funcs { /** * struct ttm_device - Buffer object driver device-specific data. - * - * @device_list: Our entry in the global device list. - * @funcs: Function table for the device. - * @sysman: Resource manager for the system domain. - * @man_drv: An array of resource_managers. - * @vma_manager: Address space manager. - * @pool: page pool for the device. - * @dev_mapping: A pointer to the struct address_space representing the - * device address space. - * @wq: Work queue structure for the delayed delete workqueue. */ struct ttm_device { - /* + /** + * @device_list: Our entry in the global device list. * Constant after bo device init */ struct list_head device_list; + + /** + * @funcs: Function table for the device. + * Constant after bo device init + */ struct ttm_device_funcs *funcs; - /* + /** + * @sysman: Resource manager for the system domain. * Access via ttm_manager_type. */ struct ttm_resource_manager sysman; + + /** + * @man_drv: An array of resource_managers. + */ struct ttm_resource_manager *man_drv[TTM_NUM_MEM_TYPES]; /* * Protected by internal locks. */ + + /** + * @vma_manager: Address space manager for finding BOs to mmap. + */ struct drm_vma_offset_manager *vma_manager; + + /** + * @pool: page pool for the device. + */ struct ttm_pool pool; - /* - * Protection for the per manager LRU and ddestroy lists. + /** + * @lru_lock: Protection for the per manager LRU and ddestroy lists. */ spinlock_t lru_lock; + + /** + * @ddestroy: Destroyed but not yet cleaned up buffer objects. + */ struct list_head ddestroy; + + /** + * @pinned: Buffer object which are pinned and so not on any LRU list. + */ struct list_head pinned; - /* - * Protected by load / firstopen / lastclose /unload sync. + /** + * @dev_mapping: A pointer to the struct address_space for invalidating + * CPU mappings on buffer move. Protected by load/unload sync. */ struct address_space *dev_mapping; - /* - * Internal protection. + /** + * @wq: Work queue structure for the delayed delete workqueue. Has + * internal protection. */ struct delayed_work wq; }; From patchwork Fri Sep 3 12:31:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12474357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C71F5C433F5 for ; Fri, 3 Sep 2021 12:31:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 95EB661057 for ; Fri, 3 Sep 2021 12:31:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 95EB661057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 590AE6E885; Fri, 3 Sep 2021 12:31:38 +0000 (UTC) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by gabe.freedesktop.org (Postfix) with ESMTPS id F1F0B6E889 for ; Fri, 3 Sep 2021 12:31:36 +0000 (UTC) Received: by mail-wr1-x430.google.com with SMTP id b6so8000206wrh.10 for ; Fri, 03 Sep 2021 05:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=cY7NtM+SRTLS7C7nADWI7MDkvM2i2jB3+VLbOPI5Dow=; b=h1LK6EM81AbFZ922IpS8CBOllXK7C449+Ci/wPvSiFM3deCI/JyR65FXu679EJcq1l iLzGaFDEX/xABdq+C9wo546q7j2YV2UoFyYeKhE7fCJR8j5/F3A9ex/ue50GcnNMfwIU yr8u/jDOauNzOtfdwRw0u0UgwiRhMSCo1595nDgAb4df1mMhdjHSqG2OdPQRdPvI9Rwn ZRCMxc0m793TaMQE8omCrK2xT9Rtbqn22l4TC+rWh+LrzvcCrGBTA6NP3XvWO3E4tXPs Kf4L/SAXyBuHjgmZgByq/Gwzp1HtzNTG1DkUGehj3h6wMHlQiKoayQjCrxC+tAoGWiGt WGeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cY7NtM+SRTLS7C7nADWI7MDkvM2i2jB3+VLbOPI5Dow=; b=hCG7xWjV4XcF+yZUV45l23YuS/8O/Dj1HbgU2dzzjHquqb5BOTtj/mUSlUeW5jnmY3 Ej7/ONvTzodnZqZm0YpStYpcOZo/C8Qjh79shsDq2fj1IRzT9+SHDWbkxYSNfYPj0VTB ds0a/ZWlqEzeqa7Ged6C5B5wYL6sQvqi3hpxHOsgI8KMnoPbLqesKtRITdVvTOYDcqpg 8TPI59I1Z9w56WzPtOrlyzdkR47pdnfvPxdO5S3UVDM4VudGTr7skXTdmyU/kqJxz99d +3/23DmmOrlE3MZSXYLHOg0RYJGbak4jajcyKpFtwKHCW8+KJJMeGJXKWxeQ2cKgHqzh rrpg== X-Gm-Message-State: AOAM5330Hm2kOnIIN5YMYtynfhmBlUs12/cdf8rPKxx6mkgogWGW6L8u Ia9POJUZ857jFiHxhmFypkQJd1MEN20z7gFR X-Google-Smtp-Source: ABdhPJz5IwHmCuevkcXwP5Wmmln+NTW4e2Rr6Gio23aQ67BBzch/CnwQ34hKMLxITt0EYVge/k7nHA== X-Received: by 2002:a5d:69cf:: with SMTP id s15mr3814105wrw.403.1630672294660; Fri, 03 Sep 2021 05:31:34 -0700 (PDT) Received: from abel.fritz.box (p5b0ea1b5.dip0.t-ipconnect.de. [91.14.161.181]) by smtp.gmail.com with ESMTPSA id x11sm4564873wro.83.2021.09.03.05.31.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 05:31:34 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/5] drm/ttm: enable TTM resource object kerneldoc Date: Fri, 3 Sep 2021 14:31:21 +0200 Message-Id: <20210903123123.116575-3-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210903123123.116575-1-christian.koenig@amd.com> References: <20210903123123.116575-1-christian.koenig@amd.com> MIME-Version: 1.0 X-BeenThere: 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix the last two remaining warnings and finally enable this. Signed-off-by: Christian König --- Documentation/gpu/drm-mm.rst | 9 +++++++++ include/drm/ttm/ttm_resource.h | 6 ++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst index 56b7b581567d..094e367130db 100644 --- a/Documentation/gpu/drm-mm.rst +++ b/Documentation/gpu/drm-mm.rst @@ -39,6 +39,15 @@ TTM device object reference .. kernel-doc:: drivers/gpu/drm/ttm/ttm_device.c :export: +TTM resource object reference +----------------------------- + +.. kernel-doc:: include/drm/ttm/ttm_resource.h + :internal: + +.. kernel-doc:: drivers/gpu/drm/ttm/ttm_resource.c + :export: + The Graphics Execution Manager (GEM) ==================================== diff --git a/include/drm/ttm/ttm_resource.h b/include/drm/ttm/ttm_resource.h index 32c5edd9e8b5..255fc8169d9a 100644 --- a/include/drm/ttm/ttm_resource.h +++ b/include/drm/ttm/ttm_resource.h @@ -103,10 +103,7 @@ struct ttm_resource_manager_func { * struct ttm_resource_manager * * @use_type: The memory type is enabled. - * @flags: TTM_MEMTYPE_XX flags identifying the traits of the memory - * managed by this memory type. - * @gpu_offset: If used, the GPU offset of the first managed page of - * fixed memory or the first managed location in an aperture. + * @use_tt: If a TT object should be used for the backing store. * @size: Size of the managed region. * @func: structure pointer implementing the range manager. See above * @move_lock: lock for move fence @@ -144,6 +141,7 @@ struct ttm_resource_manager { * @addr: mapped virtual address * @offset: physical addr * @is_iomem: is this io memory ? + * @caching: What CPU caching should be used * * Structure indicating the bus placement of an object. */ From patchwork Fri Sep 3 12:31:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12474359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 271FFC433F5 for ; Fri, 3 Sep 2021 12:31:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EB7A361057 for ; Fri, 3 Sep 2021 12:31:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EB7A361057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E71D26E888; Fri, 3 Sep 2021 12:31:39 +0000 (UTC) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by gabe.freedesktop.org (Postfix) with ESMTPS id 669806E888 for ; Fri, 3 Sep 2021 12:31:38 +0000 (UTC) Received: by mail-wr1-x429.google.com with SMTP id u9so7994046wrg.8 for ; Fri, 03 Sep 2021 05:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=o3lIvk6NIuWXMfTlmoadGYze9kaAW2h7gefWjYO1hnU=; b=d153tfAhiInNtpwhgPA46R4MqCNkgl2v9bneCxG0/a5FoS1wTvjKYowTUTHgbKa0DR SNenHh+P6t+7WpKjsaiSRp2rrcq5dleKTr9SZf3+y/m2tOAMRLV54pObq976zxoKfbB9 AQVDEWjbzqnCqkMT30iPHBgiI01NgaZ1zic9rYZkNzBtHQpo442N+9OwnVZa8vJRTNWS hDNWtdgqkVuVkjZDdItmobipwvHXK53yxTEC2hCStx8bByfzfy9FW2K+8BKDecwKB461 owspLfKhub9lQToYILRUL2nYR4Sh8IV7elk0lR2fzor0ZZGelDh2O9FzeVSXMzLDohL+ nV+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o3lIvk6NIuWXMfTlmoadGYze9kaAW2h7gefWjYO1hnU=; b=I+ZP2cA0UtJJhTWpmbnZh6lh7/0rFTDL6+pllKjEqp9En4YQtoxHVwzrP0Xp/sRbl6 c0Qvs1wsTwdTDLTWafhaaBBo+sqaevjB8hEv5UjxGcQwqNiZpkO7iPYhoj/iKb/50ubF Clfr/RvwHP1hEwkM5gUcLIEKKnbmS8lf0d59gaTtqXOsspoAIlHAg83CUhcIkaQRKZ4R x8gaULaJgl9usKN3rHLnKQ8y+qoLHPlcOWq+NPAaWt+C/KCBy0HF3DFLNMIFRBwASjjH y+E2YwiUk6xMKRvPsGp8l3iw9Oa1l7d3c+UgCTnRXPuDUIs0BkQrwqxfugJdlO4MTAZs dAzA== X-Gm-Message-State: AOAM533HmN+Ee0T+0v60QVeSIND+69lKgNlpUuahTuxKfse9DQpLMU0D ggAEHdfOQwZ3Y0AMUx3u41ltMnEw690ACimI X-Google-Smtp-Source: ABdhPJw8lhLg+6UcYmS8fsmfSEybHYAFW5yeX+rJCNvROjikx9MoGpvMN+XgIeZyIfOgvPCxWqz+ow== X-Received: by 2002:a05:6000:92:: with SMTP id m18mr3801389wrx.293.1630672297056; Fri, 03 Sep 2021 05:31:37 -0700 (PDT) Received: from abel.fritz.box (p5b0ea1b5.dip0.t-ipconnect.de. [91.14.161.181]) by smtp.gmail.com with ESMTPSA id x11sm4564873wro.83.2021.09.03.05.31.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 05:31:36 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/5] drm/ttm: enable TTM placement kerneldoc Date: Fri, 3 Sep 2021 14:31:22 +0200 Message-Id: <20210903123123.116575-4-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210903123123.116575-1-christian.koenig@amd.com> References: <20210903123123.116575-1-christian.koenig@amd.com> MIME-Version: 1.0 X-BeenThere: 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix the last remaining warning and finally enable this. Signed-off-by: Christian König --- Documentation/gpu/drm-mm.rst | 6 ++++++ include/drm/ttm/ttm_placement.h | 1 + 2 files changed, 7 insertions(+) diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst index 094e367130db..195a857fa1d8 100644 --- a/Documentation/gpu/drm-mm.rst +++ b/Documentation/gpu/drm-mm.rst @@ -39,6 +39,12 @@ TTM device object reference .. kernel-doc:: drivers/gpu/drm/ttm/ttm_device.c :export: +TTM resource placement reference +-------------------------------- + +.. kernel-doc:: include/drm/ttm/ttm_placement.h + :internal: + TTM resource object reference ----------------------------- diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h index 8995c9e4ec1b..76d1b9119a2b 100644 --- a/include/drm/ttm/ttm_placement.h +++ b/include/drm/ttm/ttm_placement.h @@ -58,6 +58,7 @@ * * @fpfn: first valid page frame number to put the object * @lpfn: last valid page frame number to put the object + * @mem_type: One of TTM_PL_* where the resource should be allocated from. * @flags: memory domain and caching flags for the object * * Structure indicating a possible place to put an object. From patchwork Fri Sep 3 12:31:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12474361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BC3BC433F5 for ; Fri, 3 Sep 2021 12:31:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EFDF761057 for ; Fri, 3 Sep 2021 12:31:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EFDF761057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 594CB6E889; Fri, 3 Sep 2021 12:31:41 +0000 (UTC) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA07B6E889 for ; Fri, 3 Sep 2021 12:31:40 +0000 (UTC) Received: by mail-wr1-x434.google.com with SMTP id q11so8006151wrr.9 for ; Fri, 03 Sep 2021 05:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=VsPLsLnCXFpv0vdAq78Xg5X2klUysHtWbTOyQshd/C8=; b=D65VvtizymjC6ofq+PbFJkCrMqguqEqmbFmxKxT7gJv3f8Rb3SCa+DHSGH13DDYXkS fTUEUSF2Rc2wo1q3Ca/LjG96mx+DuUtGak2idEyyjxY0ZLbQNNsmrNXv5imB5AIuQ/za ubxsMb2F6AtzMiAvt5EzOdCXvRcHrtQuZIlmizQgto/40G+0JaX8wRzQDbdnZ/4JZtCe RyFfvmvd7edba4s1iSkOr6/3LCDPI4ynXl75DA+y4b34JmSmfrjpnp3D71mgRFO8tEyW m2zZU2ptzQgMJ/OYFZmp0OiR/UTAiV+A5nD1qpo+vDL9X2ldz8FsnZ384LEO0nEfwCP7 Z3HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VsPLsLnCXFpv0vdAq78Xg5X2klUysHtWbTOyQshd/C8=; b=th9hDrBnaMrQ5P5SDOEHgxhnXz9plxiGHRQf/4+S9OLkFB7gk3K7DCjTTOKJBi0QXr Gmr3uZNRQ9XR9Iva4UQtcHr+D+i66klRAIWeMCcNFJIUIXZda0MNoUz66ZPJPqt46n5I LWZnmnSiPsHDP938SfJgV2oHfK6MimOv+77rDYnkt2kFNCnchBandQxCfWsKL1wUTy2v 6NsJUeoDUWaNw0/BlhrRyF5XKUQWaLw0MLZGUJ/AFL78+877dpyFvkDYsUMnbNaKeRcu MOWRXn8XlFbMJlUSHLal7+Z9N6G1vejXYhzBWu3RQOU6bXqTi9Woigg14tY8Vqi7awP0 jLVg== X-Gm-Message-State: AOAM531+7/RtM6bDSXxqr2tSKTkKqgbFB53Mrae5uQEIzFAUOMG8AAyK qyc1kDgIyJqyzn7HgjFH7Bh90yFa3/UW6aiS X-Google-Smtp-Source: ABdhPJwKT4cb9vAnZNFZ1tZSSZh250zbGsRhaULdpNo2W47tH7DxV1A3T4cko19R8DI/C3LQh0FSYA== X-Received: by 2002:adf:e745:: with SMTP id c5mr3703112wrn.321.1630672299278; Fri, 03 Sep 2021 05:31:39 -0700 (PDT) Received: from abel.fritz.box (p5b0ea1b5.dip0.t-ipconnect.de. [91.14.161.181]) by smtp.gmail.com with ESMTPSA id x11sm4564873wro.83.2021.09.03.05.31.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 05:31:38 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/5] drm/ttm: enable TTM TT object kerneldoc Date: Fri, 3 Sep 2021 14:31:23 +0200 Message-Id: <20210903123123.116575-5-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210903123123.116575-1-christian.koenig@amd.com> References: <20210903123123.116575-1-christian.koenig@amd.com> MIME-Version: 1.0 X-BeenThere: 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix the remaining warnings and finally enable this. Signed-off-by: Christian König --- Documentation/gpu/drm-mm.rst | 9 +++++++++ include/drm/ttm/ttm_tt.h | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst index 195a857fa1d8..aa78e6ffc22e 100644 --- a/Documentation/gpu/drm-mm.rst +++ b/Documentation/gpu/drm-mm.rst @@ -54,6 +54,15 @@ TTM resource object reference .. kernel-doc:: drivers/gpu/drm/ttm/ttm_resource.c :export: +TTM TT object reference +----------------------- + +.. kernel-doc:: include/drm/ttm/ttm_tt.h + :internal: + +.. kernel-doc:: drivers/gpu/drm/ttm/ttm_tt.c + :export: + The Graphics Execution Manager (GEM) ==================================== diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h index e402dab1d0f6..fbc13d69ee73 100644 --- a/include/drm/ttm/ttm_tt.h +++ b/include/drm/ttm/ttm_tt.h @@ -126,8 +126,9 @@ int ttm_sg_tt_init(struct ttm_tt *ttm_dma, struct ttm_buffer_object *bo, void ttm_tt_fini(struct ttm_tt *ttm); /** - * ttm_ttm_destroy: + * ttm_tt_destroy: * + * @bdev: the ttm_device this object belongs to * @ttm: The struct ttm_tt. * * Unbind, unpopulate and destroy common struct ttm_tt. @@ -148,15 +149,19 @@ int ttm_tt_swapout(struct ttm_device *bdev, struct ttm_tt *ttm, /** * ttm_tt_populate - allocate pages for a ttm * + * @bdev: the ttm_device this object belongs to * @ttm: Pointer to the ttm_tt structure + * @ctx: operation context for populating the tt object. * * Calls the driver method to allocate pages for a ttm */ -int ttm_tt_populate(struct ttm_device *bdev, struct ttm_tt *ttm, struct ttm_operation_ctx *ctx); +int ttm_tt_populate(struct ttm_device *bdev, struct ttm_tt *ttm, + struct ttm_operation_ctx *ctx); /** * ttm_tt_unpopulate - free pages from a ttm * + * @bdev: the ttm_device this object belongs to * @ttm: Pointer to the ttm_tt structure * * Calls the driver method to free all pages from a ttm