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 73120CD6E72 for ; Wed, 11 Oct 2023 13:59:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FEE010E504; Wed, 11 Oct 2023 13:59:41 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7B87F10E4FE for ; Wed, 11 Oct 2023 13:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697032778; x=1728568778; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lOnB/sa3AmvxDLrNNpLKUNbffsCmMeQ5ZvQKGYT4YzU=; b=Vu9VDxqHzJbL6Mn0BGaszDrqtuixisoWs0hnV8+NlYIyAm8j+n12rwWE okTX2WKbb5H819Jl6Sb5vm66vq4zmwuKT9mco690lvpJ11PDQzEdrbRkF qbqTF1AE172oYPNBMAX5AVztOJ1n8m2zrO3ApAnjx5MzRU3ghxlAOxNn3 WaeUDC0cWPD3ksSz8hihwd9mBkNn19Mc+aaY5MJ7fn6lKgabexeNu5Ibl +z6ev4zqWkpBEx86DY1R/f5y3t5+0TsEd+OsltzuoadfuLoZgby4McAPA 1lOQJVdoXWi4TupTpcTP/DYA+LwSXCK3mmnQ7TWeZEkQ9/OxwJEn0UOkW A==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="451156191" X-IronPort-AV: E=Sophos;i="6.03,216,1694761200"; d="scan'208";a="451156191" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 06:59:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="753828998" X-IronPort-AV: E=Sophos;i="6.03,216,1694761200"; d="scan'208";a="753828998" Received: from stahadie-mobl4.amr.corp.intel.com (HELO localhost.localdomain) ([10.249.36.91]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 06:59:37 -0700 From: Francois Dugast To: intel-xe@lists.freedesktop.org Date: Wed, 11 Oct 2023 13:59:11 +0000 Message-Id: <20231011135926.7-3-francois.dugast@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011135926.7-1-francois.dugast@intel.com> References: <20231011135926.7-1-francois.dugast@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Intel-xe] [RFC v1 02/17] drm/xe/uapi: Add documentation for query 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: , Cc: Francois Dugast , Rodrigo Vivi Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Provide a description of the keys used the struct drm_xe_query_config info array. Document the behavior of the driver for IOCTL DRM_IOCTL_XE_DEVICE_QUERY depending on the size value provided in struct drm_xe_device_query. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/637 Signed-off-by: Francois Dugast Signed-off-by: Rodrigo Vivi --- include/uapi/drm/xe_drm.h | 41 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h index 24bf8f0f52e8..a7b10cc33df3 100644 --- a/include/uapi/drm/xe_drm.h +++ b/include/uapi/drm/xe_drm.h @@ -321,14 +321,43 @@ struct drm_xe_query_config { /** @pad: MBZ */ __u32 pad; + /* + * Device ID (lower 16 bits) and the device revision (next + * 8 bits) + */ #define XE_QUERY_CONFIG_REV_AND_DEVICE_ID 0 + /* + * Flags describing the device configuration, see list below + */ #define XE_QUERY_CONFIG_FLAGS 1 + /* + * Flag is set if the device has usable VRAM + */ #define XE_QUERY_CONFIG_FLAGS_HAS_VRAM (0x1 << 0) + /* + * Minimal memory alignment required by this device, + * typically SZ_4K or SZ_64K + */ #define XE_QUERY_CONFIG_MIN_ALIGNMENT 2 + /* + * Maximum bits of a virtual address + */ #define XE_QUERY_CONFIG_VA_BITS 3 + /* + * Total number of GTs for the entire device + */ #define XE_QUERY_CONFIG_GT_COUNT 4 + /* + * Total number of accessible memory regions + */ #define XE_QUERY_CONFIG_MEM_REGION_COUNT 5 + /* + * Value of the highest available exec queue priority + */ #define XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 6 + /* + * Number of elements in the info array + */ #define XE_QUERY_CONFIG_NUM_PARAM (XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY + 1) /** @info: array of elements containing the config info */ __u64 info[]; @@ -440,9 +469,15 @@ struct drm_xe_query_topology_mask { /** * struct drm_xe_device_query - main structure to query device information * - * If size is set to 0, the driver fills it with the required size for the - * requested type of data to query. If size is equal to the required size, - * the queried information is copied into data. + * The user selects the type of data to query among DRM_XE_DEVICE_QUERY_* + * and sets the value in the query member. This determines the type of + * the structure provided by the driver in data, among struct drm_xe_query_*. + * + * If size is set to 0, the driver fills it with the required size for + * the requested type of data to query. If size is equal to the required + * size, the queried information is copied into data. If size is set to + * a value different from 0 and different from the required size, the + * IOCTL call returns -EINVAL. * * For example the following code snippet allows retrieving and printing * information about the device engines with DRM_XE_DEVICE_QUERY_ENGINES: -- 2.34.1