Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [i-g-t] tests/i915/kms_psr: Fix to use proper API to support XE
@ 2023-08-04  8:42 Bhanuprakash Modem
  2023-08-04 10:13 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Bhanuprakash Modem @ 2023-08-04  8:42 UTC (permalink / raw)
  To: igt-dev

As old API is not aware of XE memory reason, update the
subtest with the new one to create the buffer for XE driver.

intel_buf_create_using_handle() --> intel_buf_create_full()

Fixes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/337
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/i915/kms_psr.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/i915/kms_psr.c b/tests/i915/kms_psr.c
index 3f8f83b42..57a749ffb 100644
--- a/tests/i915/kms_psr.c
+++ b/tests/i915/kms_psr.c
@@ -35,6 +35,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "xe/xe_ioctl.h"
+#include "xe/xe_query.h"
 
 enum operations {
 	PAGE_FLIP,
@@ -144,6 +145,9 @@ static struct intel_buf *create_buf_from_fb(data_t *data,
 {
 	uint32_t name, handle, tiling, stride, width, height, bpp, size;
 	struct intel_buf *buf;
+	enum intel_driver driver = buf_ops_get_driver(data->bops);
+	uint64_t region = (driver == INTEL_DRIVER_XE) ?
+				vram_if_possible(data->drm_fd, 0) : -1;
 
 	igt_assert_eq(fb->offsets[0], 0);
 
@@ -159,8 +163,8 @@ static struct intel_buf *create_buf_from_fb(data_t *data,
 
 	name = gem_flink(data->drm_fd, fb->gem_handle);
 	handle = gem_open(data->drm_fd, name);
-	buf = intel_buf_create_using_handle(data->bops, handle,
-					    width, height, bpp, 0, tiling, 0);
+	buf = intel_buf_create_full(data->bops, handle, width, height,
+				    bpp, 0, tiling, 0, size, stride, region);
 	intel_buf_set_ownership(buf, true);
 
 	return buf;
-- 
2.40.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-07  4:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-04  8:42 [igt-dev] [i-g-t] tests/i915/kms_psr: Fix to use proper API to support XE Bhanuprakash Modem
2023-08-04 10:13 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-08-04 10:20 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-08-04 14:34 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-08-07  3:36 ` [igt-dev] [i-g-t] " Zbigniew Kempczyński
2023-08-07  4:41 ` Hogander, Jouni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox