[igt-dev] [i-g-t V4 16/46] tests/kms_big_fb: Deduce region for xe framebuffer
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Fri Apr 28 06:07:48 UTC 2023
From: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
For discrete framebuffer reside on vram/device memory and for
integrated on system memory. Due to xe requirement regarding
size and alignment on different memory regions during intel_buf
creation pass deduced memory region.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
tests/i915/kms_big_fb.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/i915/kms_big_fb.c b/tests/i915/kms_big_fb.c
index a29a05a28..a0d5ef730 100644
--- a/tests/i915/kms_big_fb.c
+++ b/tests/i915/kms_big_fb.c
@@ -28,6 +28,7 @@
#include <string.h>
#include "i915/gem_create.h"
+#include "xe/xe_query.h"
IGT_TEST_DESCRIPTION("Test big framebuffers");
@@ -62,7 +63,10 @@ static struct intel_buf *init_buf(data_t *data,
const char *buf_name)
{
struct intel_buf *buf;
+ enum intel_driver driver = buf_ops_get_driver(data->bops);
uint32_t name, handle, tiling, stride, width, height, bpp, size;
+ uint64_t region = driver == INTEL_DRIVER_XE ?
+ vram_if_possible(data->drm_fd, 0) : -1;
igt_assert_eq(fb->offsets[0], 0);
@@ -75,8 +79,10 @@ static struct intel_buf *init_buf(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, 0,
+ region);
+
intel_buf_set_name(buf, buf_name);
intel_buf_set_ownership(buf, true);
--
2.40.0
More information about the igt-dev
mailing list