[igt-dev] [RFC PATCH 2/4] lib/i915/intel_memory_region: Add lib to manage memory regions

Kempczynski, Zbigniew zbigniew.kempczynski at intel.com
Tue Oct 22 06:38:13 UTC 2019


On Wed, 2019-08-14 at 12:21 +0200, Lukasz Kalamarz wrote:

I know it is a little bit outdated review, but I've some comments
as I haven't seen update.

<cut>
> +/**
> + * gem_find_memory_region_in_query:
> + * @query_info: query result of memory regions
> + * @num_regions: number of memory regions from @query_info
> + * @id: memory region id
> + *
> + * This function iterate over @num_regions of memory regions obtained by
> + * @query_info to find if memory region with given @id is available.
> + *
> + * Returns: true if memory region was found. Otherwise false.
> + */
> +bool gem_find_memory_region_in_query(struct
> local_i915_query_memory_region_info *query_info,
> +				     uint8_t num_regions, uint32_t id)
> +{
> +	for (int i = 0; i < num_regions; i++) {
> +		if (query_info->regions[i].id == id)
> +			return true;
> +	}
> +
> +	return false;
> +}

I think this function should be called a little bit different, likely:

bool gem_is_memory_region_exist(...) or sth.

Your name suggest you'll return some region, not bool. 

Zbigniew


More information about the igt-dev mailing list