Re: [igt-dev] [PATCH i-g-t v2 2/4] lib/i915/intel_memory_region: Add lib to manage memory regions

Zbigniew Kempczyński
2019-11-20T16:27:28Z

On Wed, Nov 20, 2019 at 11:34:50AM +0200, Petri Latvala wrote:
> On Tue, Nov 19, 2019 at 05:02:21PM +0100, Zbigniew Kempczyński wrote:
> > diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
> > new file mode 100644
> > index 00000000..68fd13a9
> > --- /dev/null
> > +++ b/lib/i915/intel_memory_region.h
> > @@ -0,0 +1,139 @@
> > +/*
> > + * Copyright © 2019 Intel Corporation
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a
> > + * copy of this software and associated documentation files (the "Software"),
> > + * to deal in the Software without restriction, including without limitation
> > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice (including the next
> > + * paragraph) shall be included in all copies or substantial portions of the
> > + * Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > + * IN THE SOFTWARE.
> > + */
> > +#include <stdint.h>
> > +#include "benchmarks/ilog2.h"
>
>
> Do not include headers from benchmarks/, especially one that is x86-only.
>

Ok. I've replaced that code to different implementation than kernel side,
but intel_memory_region.[ch] is x86-only. So imo this code should be a part
of some not-benchmark include available for i915 tests.

Zbigniew