Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1459231rda; Mon, 23 Oct 2023 13:19:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBJmgKVSa+d2OLWdqLT60xQKQl5ETop5Nppp4O2nNZq73XKZZ4mD5E+2iY91XqRPXj8Rud X-Received: by 2002:a05:6a00:1704:b0:68a:4bef:5f9a with SMTP id h4-20020a056a00170400b0068a4bef5f9amr9912640pfc.0.1698092350900; Mon, 23 Oct 2023 13:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698092350; cv=none; d=google.com; s=arc-20160816; b=AsIWcK4rg9xFZqoZxecdE++PZggJrpWb3lGKnaJmDWcYCdMtZfA/oZo1X0TYM0ti/Z qakY6gPqxXCYKaL+lgroN1UmnszFGhGSPkZV4DUAC5LZs6zYI2f8Bb92ap8sfiuTcaem dDuLPgkLCPOZs7EEMTDh3Q+PTC8b6EFiF+eHRyoovkq4lVtzC/S9OG5n2JX7GrOhOCcw I1ZN/FbLlPoe0rWtOMmdxR9WDWRvJ+SRHbwwY0EVgiPVP4v421Ggy40cqEhwWudXHkqy eu8EcnlPiox0kavf0H6Po1Da+Kpg9CArtx1IrmFqmAKaot/THAXBtfUPHqnRiJI92FFJ r+Ug== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y4IDjkZdqgdBcw5A4oSL2XiqaLDDM8Cwc0CxsGkOjRs=; fh=8dtrvlz6eC1As92HJPwYWdp8qGhbMzdOhqcu6vG4iUM=; b=vZMQVf8/p6XOxUpFzpmbvwjoW6KvgVOyFAGUHHccF1/RTDIu18Z1cPlj9ojG/Vg8ql E530aKgA6l54gdeyfkjOh62tDjMbykL2DLfQxDUXj6AgJSXZ93U0ixQRV4asFG6cDcDz GAaQzijEAPYoaAdRKFPIhoF1ing6ZuGiYwME76quqz9WvpLTC/Nm4Qod60yCyio73bhO zJMGmmRM1ABrlGXPuqoybsW5CYMg5SKKwepaQFBmcg8jkf+jE7DnFpcr4AWQd0X65UVK mN2v34TFSRkNtBTAozV4aNTQ2mJUrzpiO86voumeYA1xVF+y8jiOawiqj5SDzpWBOVAg 2PXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b277WKJV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id q37-20020a631f65000000b0056a1a149034si7184723pgm.650.2023.10.23.13.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 13:19:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b277WKJV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B76A28032171; Mon, 23 Oct 2023 13:19:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231313AbjJWUS2 (ORCPT + 99 others); Mon, 23 Oct 2023 16:18:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231172AbjJWUSW (ORCPT ); Mon, 23 Oct 2023 16:18:22 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F0B1D73 for ; Mon, 23 Oct 2023 13:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698092253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y4IDjkZdqgdBcw5A4oSL2XiqaLDDM8Cwc0CxsGkOjRs=; b=b277WKJVp3VHvabGFSdSk5lqlDFeXOWsP8wIjrFgrWiGKEygyAFgH4XnAD4Up44aClMsY5 24lgD5KRM3SO/p8A0uliv6xjJoxfLrOKER2d3KCeCFQ5F3PLvW6sApYF30Wj5D7PbkuwDI rjdU/arDgOF8uVrQvym1+KBnvROvhlo= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-85-NVn2gZfcP9So3AQYgnTbjA-1; Mon, 23 Oct 2023 16:17:16 -0400 X-MC-Unique: NVn2gZfcP9So3AQYgnTbjA-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-9b97f1b493dso224436066b.3 for ; Mon, 23 Oct 2023 13:17:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698092235; x=1698697035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y4IDjkZdqgdBcw5A4oSL2XiqaLDDM8Cwc0CxsGkOjRs=; b=SL7OHf3ajtFXWoZJZmoxjUwINpqB5Qat6vj+ynT2evHJIM9S0e6SLBD2shvUhUgQ3D G00mRSRIlcurFShwUML57xd7cCiKXCrB2bP0v37T9pRCC/Us1KCc4kX0Zh33KO8fVB3w U/yo+BQ8xxPsqAz89iGyTbioPf9bH2VqaJ0E4ZRJ74rZPEMPEH1I4VLTzXb1T0jDJ2y3 pUsEgeW0oSJxXT2XqByCd+UWebn+scp1ZIC3CST+UMMzw/pYH2ID3ouyGuysmVUZz725 VzKXt2c/ra1Ox6oqrx1xmR8mSQ1SZNN1n6dr1Uq26/ehpZsfR8YpCktkCOFA42d87u9v uL2A== X-Gm-Message-State: AOJu0Yxv4ut4V6+aISZDEpHrY2m3nM6HwrzdWM9G3EUiy3+2jFyxFbMC z3gKGjwvP/8loU/7tO0WUAk3sRpnUw2jZ9oHJJOhNDGrlPTfhgnVO0/ctQPRV+fAQfqdanBCaHH xLCNmxzFpUAYkdikoqv0V1qwe X-Received: by 2002:a17:907:9618:b0:9a2:139:f45d with SMTP id gb24-20020a170907961800b009a20139f45dmr7227295ejc.43.1698092235516; Mon, 23 Oct 2023 13:17:15 -0700 (PDT) X-Received: by 2002:a17:907:9618:b0:9a2:139:f45d with SMTP id gb24-20020a170907961800b009a20139f45dmr7227282ejc.43.1698092235278; Mon, 23 Oct 2023 13:17:15 -0700 (PDT) Received: from cassiopeiae.. ([2a02:810d:4b3f:de9c:642:1aff:fe31:a19f]) by smtp.gmail.com with ESMTPSA id 16-20020a170906225000b0098921e1b064sm7138162ejr.181.2023.10.23.13.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 13:17:14 -0700 (PDT) From: Danilo Krummrich To: airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com, thomas.hellstrom@linux.intel.com, sarah.walker@imgtec.com, donald.robson@imgtec.com, boris.brezillon@collabora.com, christian.koenig@amd.com, faith@gfxstrand.net Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Danilo Krummrich Subject: [PATCH drm-misc-next v7 3/7] drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm Date: Mon, 23 Oct 2023 22:16:49 +0200 Message-ID: <20231023201659.25332-4-dakr@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231023201659.25332-1-dakr@redhat.com> References: <20231023201659.25332-1-dakr@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 13:19:07 -0700 (PDT) Introduce flags for struct drm_gpuvm, this required by subsequent commits. Reviewed-by: Thomas Hellström Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/drm_gpuvm.c | 3 +++ drivers/gpu/drm/nouveau/nouveau_uvmm.c | 2 +- include/drm/drm_gpuvm.h | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index b9742742a0e8..c03332883432 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -702,6 +702,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_resv_object_alloc); * drm_gpuvm_init() - initialize a &drm_gpuvm * @gpuvm: pointer to the &drm_gpuvm to initialize * @name: the name of the GPU VA space + * @flags: the &drm_gpuvm_flags for this GPUVM * @drm: the &drm_device this VM resides in * @r_obj: the resv &drm_gem_object providing the GPUVM's common &dma_resv * @start_offset: the start offset of the GPU VA space @@ -717,6 +718,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_resv_object_alloc); */ void drm_gpuvm_init(struct drm_gpuvm *gpuvm, const char *name, + enum drm_gpuvm_flags flags, struct drm_device *drm, struct drm_gem_object *r_obj, u64 start_offset, u64 range, @@ -727,6 +729,7 @@ drm_gpuvm_init(struct drm_gpuvm *gpuvm, const char *name, INIT_LIST_HEAD(&gpuvm->rb.list); gpuvm->name = name ? name : "unknown"; + gpuvm->flags = flags; gpuvm->ops = ops; gpuvm->drm = drm; gpuvm->r_obj = r_obj; diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c index b4e7d662961a..ed439bf4032f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -1844,7 +1844,7 @@ nouveau_uvmm_init(struct nouveau_uvmm *uvmm, struct nouveau_cli *cli, uvmm->kernel_managed_addr = kernel_managed_addr; uvmm->kernel_managed_size = kernel_managed_size; - drm_gpuvm_init(&uvmm->base, cli->name, drm, r_obj, + drm_gpuvm_init(&uvmm->base, cli->name, 0, drm, r_obj, NOUVEAU_VA_SPACE_START, NOUVEAU_VA_SPACE_END, kernel_managed_addr, kernel_managed_size, diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h index 5f43a224d0f4..47cbacb244b9 100644 --- a/include/drm/drm_gpuvm.h +++ b/include/drm/drm_gpuvm.h @@ -184,6 +184,16 @@ static inline bool drm_gpuva_invalidated(struct drm_gpuva *va) return va->flags & DRM_GPUVA_INVALIDATED; } +/** + * enum drm_gpuvm_flags - flags for struct drm_gpuvm + */ +enum drm_gpuvm_flags { + /** + * @DRM_GPUVM_USERBITS: user defined bits + */ + DRM_GPUVM_USERBITS = BIT(0), +}; + /** * struct drm_gpuvm - DRM GPU VA Manager * @@ -202,6 +212,11 @@ struct drm_gpuvm { */ const char *name; + /** + * @flags: the &drm_gpuvm_flags of this GPUVM + */ + enum drm_gpuvm_flags flags; + /** * @drm: the &drm_device this VM lives in */ @@ -252,6 +267,7 @@ struct drm_gpuvm { }; void drm_gpuvm_init(struct drm_gpuvm *gpuvm, const char *name, + enum drm_gpuvm_flags flags, struct drm_device *drm, struct drm_gem_object *r_obj, u64 start_offset, u64 range, -- 2.41.0