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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 94634C433ED for ; Tue, 18 May 2021 13:06:09 +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 5E1B360FF0 for ; Tue, 18 May 2021 13:06:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E1B360FF0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF7456EB61; Tue, 18 May 2021 13:06:08 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id B01E16EB61; Tue, 18 May 2021 13:06:05 +0000 (UTC) IronPort-SDR: HeJlBocQsFeOxR44ZxnZCa47vjKqPKbT8z6fs7djiEjLqfvyfZoUe8ebekm9U8zat90j6rvJyL zRC/RBIC2ZfQ== X-IronPort-AV: E=McAfee;i="6200,9189,9987"; a="198754014" X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="198754014" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2021 06:06:05 -0700 IronPort-SDR: J3O8coO30SNUe+MOJEe/x2gRUPB21dxPslGRmw9lBMT7K9AKXtnvqmlaR94rDNIw39259tF9P9 BNQzn5o5yJMA== X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="438657089" Received: from cmutgix-mobl.gar.corp.intel.com (HELO [10.249.254.195]) ([10.249.254.195]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2021 06:06:04 -0700 Subject: Re: [PATCH v2 04/15] drm/ttm: Export functions to initialize and finalize the ttm range manager standalone To: =?UTF-8?Q?Christian_K=c3=b6nig?= , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org References: <20210518082701.997251-1-thomas.hellstrom@linux.intel.com> <20210518082701.997251-5-thomas.hellstrom@linux.intel.com> <3feacf02-0854-68d4-f26b-88ed0528e9ff@amd.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= Message-ID: <00ada105-d0f4-f556-3eba-8503ea73c408@linux.intel.com> Date: Tue, 18 May 2021 15:06:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <3feacf02-0854-68d4-f26b-88ed0528e9ff@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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" On 5/18/21 1:51 PM, Christian König wrote: > Am 18.05.21 um 10:26 schrieb Thomas Hellström: >> i915 mock selftests are run without the device set up. In order to be >> able >> to run the region related mock selftests, export functions in order >> for the >> TTM range manager to be set up without a device to attach it to. > > From the code it looks good, but to be honest I don't think that this > makes much sense from the organizational point of view. > > If a self test exercises internals of TTM it should be moved into TTM > as well. This particular selftest actually exercises i915 memory regions which is a level above TTM, but the memory regions are backed by TTM. Since they are mock selftests they don't have a TTM device. For the buddy allocator the situation would be the same, but there we have selftests that exercise the allocator standalone, and those would probably fit best into a TTM selftest infrastructure. Although in this particular case, we could of course add a mock TTM device and be done. Pls let me know what you think. /Thomas