From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id ADC2D10E79F for ; Mon, 13 Dec 2021 16:55:16 +0000 (UTC) Date: Mon, 13 Dec 2021 08:55:15 -0800 Message-ID: <875yrsa1ho.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20211209200453.15885-2-zbigniew.kempczynski@intel.com> References: <20211209200453.15885-1-zbigniew.kempczynski@intel.com> <20211209200453.15885-2-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib/i915/intel_memory_region: Provide system memory region stub List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Zbigniew =?ISO-8859-2?Q?Kempczy=F1ski?= Cc: igt-dev@lists.freedesktop.org, Petri Latvala List-ID: On Thu, 09 Dec 2021 12:04:52 -0800, Zbigniew Kempczy=F1ski wrote: > > diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_regio= n.c > index 058b273dc..fd29eec90 100644 > --- a/lib/i915/intel_memory_region.c > +++ b/lib/i915/intel_memory_region.c > @@ -123,9 +123,17 @@ struct drm_i915_query_memory_regions *gem_get_query_= memory_regions(int fd) > * Any DRM_I915_QUERY_MEMORY_REGIONS specific errors are encoded in the > * item.length, even though the ioctl might still return success. > */ > + > if (item.length < 0) { > - igt_critical("DRM_I915_QUERY_MEMORY_REGIONS failed with %d\n", > - item.length); > + /* > + * If kernel supports query but not memory regions query > + * just return predefined system memory region only. > + */ > + size_t sys_qi_size =3D offsetof(typeof(*query_info), regions[1]); > + > + query_info =3D calloc(1, sys_qi_size); > + query_info->num_regions =3D 1; > + query_info->regions[0].region.memory_class =3D I915_MEMORY_CLASS_SYSTE= M; Should there be another check here that DRM_I915_QUERY_MEMORY_REGIONS query was not recognized? Otherwise the query could have failed for some other reason?