Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3503441rdh; Thu, 28 Sep 2023 13:45:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGb7ZdvsfTPSJa1N6awx05iaJcB01ExSsLG30wXQEEpHCYMuaUuaGzSXiY6usmg5Kuh/pCK X-Received: by 2002:a81:848f:0:b0:59b:50ed:82ec with SMTP id u137-20020a81848f000000b0059b50ed82ecmr2335566ywf.17.1695933909089; Thu, 28 Sep 2023 13:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695933909; cv=none; d=google.com; s=arc-20160816; b=0NdIa6RpzAZhclwhAVCn9Rjw/+oSl5lKQfEvkk5Vy0/f3jjfWsuN3efcQzv4AC//Ks ZZS2GsTmeq18BZSIuwLQwONRdCgMg8+kqKP0s9OqzXMK8dVPHPcH9weU3NEpoINBpeVR byx/kEoTd5Ui79UF1skGv3wGqeXsBBdcmL2Fy6NsF95H1uxDTFzvlaTJd1AVylnYUmlB C1tRInGR0lbLyo5iPOigLAONZ/UGUHekSBsV5PyycCQxk971tgzasHZVStqPMulV1/0w ex+jze30cooWCJmG+2UfHupW+ZmaN6/8ni/7NVnYgSBo6jOnWaFfX+h9bvUe/+n8ad1N VKLA== 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=RJphU8IGhvgwUi2yl/XNO6bryXEecRsbCtSU17bPD/8=; fh=8dtrvlz6eC1As92HJPwYWdp8qGhbMzdOhqcu6vG4iUM=; b=LD/VyCj8hRHNU+LOv6Oit9W8c3c+L176UEZpZxkkJgxT7Syx74H7OhfkjGA6gsbMbk 7YAKXxN8eSCQq4kQfb/Dyld6uXAoEMLQAZNGyoo6rU5Qt1XPtsa6ImD6S+zn6UDWlK/H 4ZZf7k5XcKyWPHnrpdsO550PFju+G8DPm2GZknZEk2fiQldE3IKy+1+SEo2nl1XLo9F0 s4HPvWXt/P7097GHN1a56NCXT035tUmHUtfzTtFvN7MgjXstcYjC1boFeBXX2p3hzOPE 26k8sjjKPY9i+s89zYVDSXY6nESFIN6l+H/ZLigrHjrmIHTSK8FO/mlpsQa1oPgvkbXi EoWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DPvEyCqi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id v10-20020a63610a000000b00578e3b73c49si19924506pgb.507.2023.09.28.13.45.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 13:45:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DPvEyCqi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 759C983C2395; Thu, 28 Sep 2023 12:18:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232073AbjI1TRf (ORCPT + 99 others); Thu, 28 Sep 2023 15:17:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231971AbjI1TR3 (ORCPT ); Thu, 28 Sep 2023 15:17:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A730A19E for ; Thu, 28 Sep 2023 12:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695928598; 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: in-reply-to:in-reply-to:references:references; bh=RJphU8IGhvgwUi2yl/XNO6bryXEecRsbCtSU17bPD/8=; b=DPvEyCqiA2rJK4bP4FNat8x3jhcMdhe0iTHjJFOqNe6EUjLwBL69DMZCZFDjgCJLPWuLuc c516jtGJvrLMoB8VDeZpKbzTs5CGsOVliRB6OXZYH2DkQF6251IaSHu2x6l7dia9A6ajHL /VAMJQYujKCW4k+6ts0r8pFwUTqIxOw= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-422-SQQZWTFvP9qZ_YBM6779Qg-1; Thu, 28 Sep 2023 15:16:37 -0400 X-MC-Unique: SQQZWTFvP9qZ_YBM6779Qg-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-99bcb13d8ddso1129728466b.0 for ; Thu, 28 Sep 2023 12:16:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695928596; x=1696533396; 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=RJphU8IGhvgwUi2yl/XNO6bryXEecRsbCtSU17bPD/8=; b=leY1YWepnjtaKif+F8d7Kk3mSfW788uF9AiECq3q2+9z+D4EQE3hMTVqtCoJN2do3d ahpLGNiRzVOxtbkD0waB3Gpz0QUj5SIRqCqemJFZfqimZIzIHv87IwAuF5eCLT+WYNYV tyGYnI2OP/1yJmGtRnA1dfvYORqs8bIiMw/I9VAfgqytNRPtzemx9SV9kUOusNjvAN7o xCF67WF7AJtB/7vnqf4GVb6X/J8r0O09FJAKY39JdjL9xRYi2iTQd2TIeGnRh2jyiowv CvKOGNo1bg+CGFYCH8ZD5rSlFTX8N+XGVS8QxI2EQb4oz8Ml3KITKJ8OLeS9+WmP/m05 7LVQ== X-Gm-Message-State: AOJu0YwpvKk8BWGIT2dYWcAw3nAOmDi7wRLqDYT7b2mM8jlrVl8z9ARF uHE6wTwHgMPYLE6et64sfTRLFajykuZAml1rVfklkJmXXLinn+hcg3EPEcl/Fa+7pjptpv8JZiu hTh97xbNa74of3NprJMJXGWQV X-Received: by 2002:aa7:c6cd:0:b0:533:310b:a8aa with SMTP id b13-20020aa7c6cd000000b00533310ba8aamr2057027eds.13.1695928595966; Thu, 28 Sep 2023 12:16:35 -0700 (PDT) X-Received: by 2002:aa7:c6cd:0:b0:533:310b:a8aa with SMTP id b13-20020aa7c6cd000000b00533310ba8aamr2057014eds.13.1695928595618; Thu, 28 Sep 2023 12:16:35 -0700 (PDT) Received: from cassiopeiae.. ([2a02:810d:4b3f:de9c:642:1aff:fe31:a19f]) by smtp.gmail.com with ESMTPSA id v10-20020aa7cd4a000000b0052ff9bae873sm10068453edw.5.2023.09.28.12.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 12:16:35 -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 v5 2/6] drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm Date: Thu, 28 Sep 2023 21:16:16 +0200 Message-ID: <20230928191624.13703-3-dakr@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928191624.13703-1-dakr@redhat.com> References: <20230928191624.13703-1-dakr@redhat.com> MIME-Version: 1.0 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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 12:18:17 -0700 (PDT) Introduce flags for struct drm_gpuvm, this required by subsequent commits. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/drm_gpuvm.c | 4 +++- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 2 +- include/drm/drm_gpuvm.h | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index ebda9d594165..6368dfdbe9dd 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -703,6 +703,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_root_object_alloc); * @gpuvm: pointer to the &drm_gpuvm to initialize * @r_obj: the root &drm_gem_object providing the GPUVM's common &dma_resv * @name: the name of the GPU VA space + * @flags: the &drm_gpuvm_flags for this GPUVM * @start_offset: the start offset of the GPU VA space * @range: the size of the GPU VA space * @reserve_offset: the start of the kernel reserved GPU VA area @@ -716,7 +717,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_root_object_alloc); */ void drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object *r_obj, - const char *name, + const char *name, enum drm_gpuvm_flags flags, u64 start_offset, u64 range, u64 reserve_offset, u64 reserve_range, const struct drm_gpuvm_ops *ops) @@ -729,6 +730,7 @@ drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object *r_obj, gpuvm->mm_range = range; gpuvm->name = name ? name : "unknown"; + gpuvm->flags = flags; gpuvm->ops = ops; gpuvm->r_obj = r_obj; diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c index 4dea847ef989..93ad2ba7ec8b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -1843,7 +1843,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, r_obj, cli->name, + drm_gpuvm_init(&uvmm->base, r_obj, cli->name, 0, 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 0aec14d8b259..13539f32c2e2 100644 --- a/include/drm/drm_gpuvm.h +++ b/include/drm/drm_gpuvm.h @@ -183,6 +183,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 = (1 << 0), +}; + /** * struct drm_gpuvm - DRM GPU VA Manager * @@ -201,6 +211,11 @@ struct drm_gpuvm { */ const char *name; + /** + * @flags: the &drm_gpuvm_flags of this GPUVM + */ + enum drm_gpuvm_flags flags; + /** * @mm_start: start of the VA space */ @@ -246,7 +261,7 @@ struct drm_gpuvm { }; void drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object *r_obj, - const char *name, + const char *name, enum drm_gpuvm_flags flags, u64 start_offset, u64 range, u64 reserve_offset, u64 reserve_range, const struct drm_gpuvm_ops *ops); -- 2.41.0