Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Francois Dugast <francois.dugast@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [igt-dev] [RFC v1 13/20] drm/xe_query: Remove backward compatibility of vram_visible_size.
Date: Wed, 11 Oct 2023 14:18:34 +0000	[thread overview]
Message-ID: <20231011141841.7-14-francois.dugast@intel.com> (raw)
In-Reply-To: <20231011141841.7-1-francois.dugast@intel.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>

We are breaking the uapi compatibility at this time, so this
is useless anyway.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 lib/xe/xe_query.c | 42 +++++++-----------------------------------
 1 file changed, 7 insertions(+), 35 deletions(-)

diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c
index 76e245f9c..87841e8a3 100644
--- a/lib/xe/xe_query.c
+++ b/lib/xe/xe_query.c
@@ -397,16 +397,6 @@ uint64_t vram_memory(int fd, int gt)
 	return xe_has_vram(fd) ? native_region_for_gt(xe_dev->gt_list, gt) : 0;
 }
 
-static uint64_t __xe_visible_vram_size(int fd, int gt)
-{
-	struct xe_device *xe_dev;
-
-	xe_dev = find_in_cache(fd);
-	igt_assert(xe_dev);
-
-	return xe_dev->visible_vram_size[gt];
-}
-
 /**
  * visible_vram_memory:
  * @fd: xe device fd
@@ -418,14 +408,7 @@ static uint64_t __xe_visible_vram_size(int fd, int gt)
  */
 uint64_t visible_vram_memory(int fd, int gt)
 {
-	/*
-	 * TODO: Keep it backwards compat for now. Fixup once the kernel side
-	 * has landed.
-	 */
-	if (__xe_visible_vram_size(fd, gt))
-		return vram_memory(fd, gt) | DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM;
-	else
-		return vram_memory(fd, gt); /* older kernel */
+	return vram_memory(fd, gt) | DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM;
 }
 
 /**
@@ -457,14 +440,7 @@ uint64_t visible_vram_if_possible(int fd, int gt)
 	uint64_t system_memory = regions & 0x1;
 	uint64_t vram = regions & (0x2 << gt);
 
-	/*
-	 * TODO: Keep it backwards compat for now. Fixup once the kernel side
-	 * has landed.
-	 */
-	if (__xe_visible_vram_size(fd, gt))
-		return vram ? vram | DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM : system_memory;
-	else
-		return vram ? vram : system_memory; /* older kernel */
+	return vram ? vram | DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM : system_memory;
 }
 
 /**
@@ -616,18 +592,14 @@ uint64_t xe_vram_size(int fd, int gt)
  */
 uint64_t xe_visible_vram_size(int fd, int gt)
 {
-	uint64_t visible_size;
+	struct xe_device *xe_dev;
 
-	/*
-	 * TODO: Keep it backwards compat for now. Fixup once the kernel side
-	 * has landed.
-	 */
-	visible_size = __xe_visible_vram_size(fd, gt);
-	if (!visible_size) /* older kernel */
-		visible_size = xe_vram_size(fd, gt);
+	xe_dev = find_in_cache(fd);
+	igt_assert(xe_dev);
 
-	return visible_size;
+	return xe_dev->visible_vram_size[gt];
 }
+
 /**
  * xe_vram_available:
  * @fd: xe device fd
-- 
2.34.1

  parent reply	other threads:[~2023-10-11 14:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11 14:18 [igt-dev] [RFC v1 00/20] uAPI Alignment - take 2 Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 01/20] drm-uapi/xe: Add documentation for query Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 02/20] drm-uapi/xe: Extend drm_xe_vm_bind_op Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 03/20] drm-uapi/xe: Add uAPI to query micro-controler firmware version Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 04/20] drm-uapi/xe: Document DRM_XE_DEVICE_QUERY_HWCONFIG Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 05/20] drm-uapi/xe: Extend uAPI to query HuC micro-controler firmware version Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 06/20] drm-uapi/xe: Remove useless query config num_params Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 07/20] drm-uapi/xe: Add missing DRM_ prefix in uAPI constants Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 08/20] drm-uapi/xe: Add _FLAG to uAPI constants usable for flags Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 09/20] drm-uapi/xe: Make constant comments visible in kernel doc Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 10/20] fixup! tests/intel/xe_query: Add a test for querying engine cycles Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 11/20] drm-uapi/xe: Remove GT_TYPE_REMOTE Francois Dugast
2023-10-12 18:36   ` Kamil Konieczny
2023-10-11 14:18 ` [igt-dev] [RFC v1 12/20] drm-uapi/xe: Kill VM_MADVISE IOCTL and the atomic tests Francois Dugast
2023-10-11 14:18 ` Francois Dugast [this message]
2023-10-12 18:39   ` [igt-dev] [RFC v1 13/20] drm/xe_query: Remove backward compatibility of vram_visible_size Kamil Konieczny
2023-10-11 14:18 ` [igt-dev] [RFC v1 14/20] xe_ioctl: Converge bo_create to the most used version Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 15/20] xe_ioctl: Rename *xe_bo_create_flags to simply xe_bo_create Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 16/20] xe_query: Add missing include Francois Dugast
2023-10-12 18:44   ` Kamil Konieczny
2023-10-11 14:18 ` [igt-dev] [RFC v1 17/20] xe_query: Kill visible_vram_if_possible Francois Dugast
2023-10-12 18:46   ` Kamil Konieczny
2023-10-11 14:18 ` [igt-dev] [RFC v1 18/20] drm-uapi/xe: Separate bo_create placement from flags Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 19/20] drm-uapi/xe: Align with GuC version type update Francois Dugast
2023-10-11 14:18 ` [igt-dev] [RFC v1 20/20] drm-uapi/xe: Remove unused inaccessible memory region Francois Dugast
2023-10-12  0:20 ` [igt-dev] ✗ Fi.CI.BUILD: failure for uAPI Alignment - take 2 Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231011141841.7-14-francois.dugast@intel.com \
    --to=francois.dugast@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox