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 54B3710EC73 for ; Fri, 28 Apr 2023 07:18:51 +0000 (UTC) From: Bhanuprakash Modem To: igt-dev@lists.freedesktop.org Date: Fri, 28 Apr 2023 12:43:18 +0530 Message-Id: <20230428071350.2561575-16-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 15/47] lib/igt_fb: For xe assume vram is used on discrete 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 Assume fb bo's were created on vram on discrete, otherwise use system memory. Signed-off-by: Zbigniew Kempczyński Reviewed-by: Bhanuprakash Modem --- lib/igt_fb.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 7379b99aa..df3d7d91a 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -2545,6 +2545,7 @@ igt_fb_create_intel_buf(int fd, struct buf_ops *bops, { struct intel_buf *buf; uint32_t bo_name, handle, compression; + uint64_t region; int num_surfaces; int i; @@ -2571,12 +2572,16 @@ igt_fb_create_intel_buf(int fd, struct buf_ops *bops, bo_name = gem_flink(fd, fb->gem_handle); handle = gem_open(fd, bo_name); - buf = intel_buf_create_using_handle_and_size(bops, handle, - fb->width, fb->height, - fb->plane_bpp[0], 0, - igt_fb_mod_to_tiling(fb->modifier), - compression, fb->size, - fb->strides[0]); + /* For i915 region doesn't matter, for xe does */ + region = buf_ops_get_driver(bops) == INTEL_DRIVER_XE ? + vram_if_possible(fd, 0) : -1; + buf = intel_buf_create_full(bops, handle, + fb->width, fb->height, + fb->plane_bpp[0], 0, + igt_fb_mod_to_tiling(fb->modifier), + compression, fb->size, + fb->strides[0], + region); intel_buf_set_name(buf, name); /* Make sure we close handle on destroy path */ -- 2.40.0