From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 902D810EC73 for ; Fri, 28 Apr 2023 07:18:53 +0000 (UTC) From: Bhanuprakash Modem To: igt-dev@lists.freedesktop.org Date: Fri, 28 Apr 2023 12:43:20 +0530 Message-Id: <20230428071350.2561575-18-bhanuprakash.modem@intel.com> In-Reply-To: <20230428071350.2561575-1-bhanuprakash.modem@intel.com> References: <20230428071350.2561575-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [i-g-t V5 17/47] tests/kms_big_fb: Deduce region for xe framebuffer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: From: Zbigniew Kempczyński 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 Reviewed-by: Bhanuprakash Modem --- 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 #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