From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] lib/xe_query: Recover original vram_* macros semantics
Date: Mon, 20 Mar 2023 17:32:59 +0100 [thread overview]
Message-ID: <20230320163259.67310-1-zbigniew.kempczynski@intel.com> (raw)
On multi tile vram_possible() semantics was changed what was wrong
and must be recover.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
lib/xe/xe_query.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c
index 1835232804..4598c0d5a1 100644
--- a/lib/xe/xe_query.c
+++ b/lib/xe/xe_query.c
@@ -356,13 +356,9 @@ uint64_t system_memory(int fd)
*/
uint64_t vram_memory(int fd, int gt)
{
- struct xe_device *xe_dev;
-
- xe_dev = find_in_cache(fd);
- igt_assert(xe_dev);
- igt_assert(gt >= 0 && gt < xe_dev->number_gt);
+ uint64_t regions = all_memory_regions(fd);
- return native_region_for_gt(xe_dev->gts, gt);
+ return regions & (0x2 << gt);
}
/**
@@ -375,11 +371,10 @@ uint64_t vram_memory(int fd, int gt)
*/
uint64_t vram_if_possible(int fd, int gt)
{
- uint64_t regions = all_memory_regions(fd);
- uint64_t system_memory = regions & 0x1;
- uint64_t vram = regions & (~0x1);
+ uint64_t smemory = system_memory(fd);
+ uint64_t vram = vram_memory(fd, gt);
- return vram ? vram : system_memory;
+ return vram ? vram : smemory;
}
/**
--
2.34.1
next reply other threads:[~2023-03-20 16:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 16:32 Zbigniew Kempczyński [this message]
2023-03-20 17:04 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/xe_query: Recover original vram_* macros semantics Patchwork
2023-03-20 20:53 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-03-22 5:05 ` [igt-dev] [PATCH i-g-t] " Matthew Brost
2023-03-22 5:16 ` Matthew Brost
2023-03-22 7:36 ` Zbigniew Kempczyński
2023-03-22 5:17 ` [igt-dev] ✗ Fi.CI.BUILD: failure for lib/xe_query: Recover original vram_* macros semantics (rev2) 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=20230320163259.67310-1-zbigniew.kempczynski@intel.com \
--to=zbigniew.kempczynski@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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