From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [i-g-t] tests/i915/kms_psr: Fix to use proper API to support XE
Date: Fri, 4 Aug 2023 14:12:37 +0530 [thread overview]
Message-ID: <20230804084237.3940595-1-bhanuprakash.modem@intel.com> (raw)
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
next reply other threads:[~2023-08-04 8:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 8:42 Bhanuprakash Modem [this message]
2023-08-04 10:13 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/kms_psr: Fix to use proper API to support XE 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
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=20230804084237.3940595-1-bhanuprakash.modem@intel.com \
--to=bhanuprakash.modem@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