[igt-dev] [PATCH i-g-t 2/2] tests/i915/api_intel_allocator: Fixed start offset
Piatkowski, Dominik Karol
dominik.karol.piatkowski at intel.com
Wed Dec 21 06:51:52 UTC 2022
> -----Original Message-----
> From: Kempczynski, Zbigniew <zbigniew.kempczynski at intel.com>
> Sent: Tuesday, December 20, 2022 21:40
> To: Piatkowski, Dominik Karol <dominik.karol.piatkowski at intel.com>
> Cc: igt-dev at lists.freedesktop.org
> Subject: Re: [PATCH i-g-t 2/2] tests/i915/api_intel_allocator: Fixed start
> offset
>
> On Tue, Dec 20, 2022 at 08:07:17AM +0100, Dominik Karol Piatkowski wrote:
> > It is safer to use intel_allocator_get_address_range than arbitrary
> > hardcoded start offset that may be too low.
> >
> > Signed-off-by: Dominik Karol Piatkowski
> > <dominik.karol.piatkowski at intel.com>
> ^
> +----- why there's missing ą?
I didn't notice that until now; it can be changed, though.
Dominik Karol
>
> --
> Zbigniew
>
> > Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> > ---
> > tests/i915/api_intel_allocator.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/i915/api_intel_allocator.c
> > b/tests/i915/api_intel_allocator.c
> > index 87abd900..e9039a21 100644
> > --- a/tests/i915/api_intel_allocator.c
> > +++ b/tests/i915/api_intel_allocator.c
> > @@ -96,9 +96,10 @@ static void reserve_simple(int fd) static void
> > reserve(int fd, uint8_t type) {
> > struct test_obj obj;
> > - uint64_t ahnd, offset = 0x40000, size = 0x1000;
> > + uint64_t ahnd, offset, size = 0x1000;
> >
> > ahnd = intel_allocator_open(fd, 0, type);
> > + intel_allocator_get_address_range(ahnd, &offset, NULL);
> >
> > igt_assert_eq(intel_allocator_reserve(ahnd, 0, size, offset), true);
> > /* try overlapping won't succeed */
> > --
> > 2.34.1
> >
More information about the igt-dev
mailing list