[igt-dev] [PATCH i-g-t v3 02/52] lib/intel_allocator: Add few helper functions for common use

Dixit, Ashutosh ashutosh.dixit at intel.com
Tue Aug 3 21:01:24 UTC 2021


On Mon, 26 Jul 2021 12:59:36 -0700, Zbigniew Kempczyński wrote:
>
> +static inline uint64_t get_simple_ahnd(int fd, uint32_t ctx)
> +{
> +	bool do_relocs = gem_has_relocations(fd);
> +
> +	return do_relocs ? 0 : intel_allocator_open(fd, ctx, INTEL_ALLOCATOR_SIMPLE);

Should this function be e.g.

    return intel_allocator_open(fd, 0, do_relocs ?
                                INTEL_ALLOCATOR_RELOC : INTEL_ALLOCATOR_SIMPLE);

Similarly for others.


More information about the igt-dev mailing list