From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE1A410E18E for ; Fri, 2 Dec 2022 07:53:28 +0000 (UTC) Message-ID: Date: Fri, 2 Dec 2022 08:53:24 +0100 MIME-Version: 1.0 Content-Language: en-US To: Alex Hung , igt-dev@lists.freedesktop.org References: <20221129220309.1472045-1-alex.hung@amd.com> From: Andrzej Hajda In-Reply-To: <20221129220309.1472045-1-alex.hung@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [igt-dev] [PATCH] tests/kms_plane: check before calling i915 libraries List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On 29.11.2022 23:03, Alex Hung wrote: > for_each_memory_region calls functions in lib/i915/ and let's > check is_i915_device first. > > Fixes: db2bdd3a (tests/kms_plane: skip memory demanding modes in test_plane_panning) > Signed-off-by: Alex Hung Reviewed-by: Andrzej Hajda Regards Andrzej > --- > tests/kms_plane.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/tests/kms_plane.c b/tests/kms_plane.c > index fc530d2c..164dacf4 100644 > --- a/tests/kms_plane.c > +++ b/tests/kms_plane.c > @@ -391,9 +391,12 @@ test_plane_panning(data_t *data, enum pipe pipe) > > test_init(data, pipe); > > - for_each_memory_region(r, data->drm_fd) > - if (r->ci.memory_class == I915_MEMORY_CLASS_DEVICE) > - mem_size = r->cpu_size; > + if (is_i915_device(data->drm_fd)) { > + for_each_memory_region(r, data->drm_fd) > + if (r->ci.memory_class == I915_MEMORY_CLASS_DEVICE) > + mem_size = r->cpu_size; > + > + } > > for_each_connector_mode(output) { > drmModeModeInfo *m = &output->config.connector->modes[j__];