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 808BB6E8C2 for ; Thu, 19 Aug 2021 12:00:18 +0000 (UTC) From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Date: Thu, 19 Aug 2021 13:59:42 +0200 Message-Id: <20210819115942.23920-4-thomas.hellstrom@linux.intel.com> In-Reply-To: <20210819115942.23920-1-thomas.hellstrom@linux.intel.com> References: <20210819115942.23920-1-thomas.hellstrom@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t 3/3] lib/igt_fb: Support fbs backed by local memory List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org Cc: apoorva1.singh@intel.com, zbigniew.kempczynski@intel.com, Ramalingam C , Janusz Krzysztofik , Ashutosh Dixit , Dominik Grzegorzek List-ID: From: Ramalingam C When local memory is supported, buffer object, backing the framebuffer should be allocated from local memory. Dumb buffer allocation takes care of this requirement from kernel itself. So when we allocate BO through gem_create we make sure that BO is from local memory. Cc: Janusz Krzysztofik Cc: Ashutosh Dixit Cc: Dominik Grzegorzek Signed-off-by: Ramalingam C --- lib/igt_fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 2e53d922..618842df 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -49,6 +49,7 @@ #include "intel_batchbuffer.h" #include "intel_chipset.h" #include "intel_bufops.h" +#include "i915/intel_memory_region.h" /** * SECTION:igt_fb @@ -1102,9 +1103,10 @@ static int create_bo_for_fb(struct igt_fb *fb, bool prefer_sysmem) fb->is_dumb = false; if (is_i915_device(fd)) { + uint32_t region = gem_has_lmem(fd) ? REGION_LMEM(0) : REGION_SMEM; int err; - fb->gem_handle = gem_create(fd, fb->size); + fb->gem_handle = gem_create_in_memory_regions(fd, fb->size, region); err = __gem_set_tiling(fd, fb->gem_handle, igt_fb_mod_to_tiling(fb->modifier), fb->strides[0]); -- 2.31.1