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 12783E7071F for ; Thu, 21 Sep 2023 11:42:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E010910E5D5; Thu, 21 Sep 2023 11:42:28 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0EAD210E5D1 for ; Thu, 21 Sep 2023 11:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695296534; x=1726832534; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HNJJV+uGofeWUcP/qPEfgBkcBPa8dkpyTrJh4UAsNAs=; b=QDsDbScJwWKw7qP+wwKT73iYM6IFJc/eT9NhivgvVPbRV0lq4A8LceOR yQCyWb4RI6c4aAVUuIJafkchcYgm9fwUE6CRFS+EbNv3maaUE2jZ0SIgF SG3kXz1lD3x7m2+7nfl5a7YTz+iaiYb6CVtcZH3F6L9Iv3TW6DMNXWtvq fgPJ23zAWqS7CK8nM/gCQdk+IreeqGBSIhwT5WoL7sW5A5w7rcJjfaBgW PysIP4eZMEPWFtz7bYGbH8OG0YBBT9scP0rihpgCXOAZum+tYZvMKJBf6 JHitdPcIEBNjNUELcba3RE63EwtdfpFlbxV+3tM2T44/8isSwvhHot3Z5 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="370812834" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="370812834" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2023 04:42:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="696697337" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="696697337" Received: from tejas-super-server.iind.intel.com ([10.145.169.166]) by orsmga003.jf.intel.com with ESMTP; 21 Sep 2023 04:42:12 -0700 From: Tejas Upadhyay To: intel-xe@lists.freedesktop.org Date: Thu, 21 Sep 2023 17:19:59 +0530 Message-Id: <20230921115002.22884-5-tejas.upadhyay@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230921115002.22884-1-tejas.upadhyay@intel.com> References: <20230921115002.22884-1-tejas.upadhyay@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Intel-xe] [PATCH V5 4/7] drm/xe: Record each drm client with its VM X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Enable accounting of indirect client memory usage. Reviewed-by: Himal Prasad Ghimiray Signed-off-by: Tejas Upadhyay --- drivers/gpu/drm/xe/xe_vm.c | 1 + drivers/gpu/drm/xe/xe_vm_types.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index 2b225c0692a6..9a993dff98c1 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -2056,6 +2056,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data, } args->vm_id = id; + vm->xef = xef; #if IS_ENABLED(CONFIG_DRM_XE_DEBUG_MEM) /* Warning: Security issue - never enable by default */ diff --git a/drivers/gpu/drm/xe/xe_vm_types.h b/drivers/gpu/drm/xe/xe_vm_types.h index 52e5eaed91c3..af2ba4acf1f9 100644 --- a/drivers/gpu/drm/xe/xe_vm_types.h +++ b/drivers/gpu/drm/xe/xe_vm_types.h @@ -336,6 +336,8 @@ struct xe_vm { /** @batch_invalidate_tlb: Always invalidate TLB before batch start */ bool batch_invalidate_tlb; + /** @xef: XE file handle for tracking this VM's drm client */ + struct xe_file *xef; }; /** struct xe_vma_op_map - VMA map operation */ -- 2.25.1