[igt-dev] [i-g-t, V2] lib/i915: Use FIXED mapping only for discrete memory

Dixit, Ashutosh ashutosh.dixit at intel.com
Mon Aug 30 17:40:16 UTC 2021


On Mon, 30 Aug 2021 02:22:14 -0700, Tejas Upadhyay wrote:
>
>  bool gem_has_mmap_offset_type(int fd, const struct mmap_offset *t)
>  {
> -	return gem_has_mmap_offset(fd) || t->type == I915_MMAP_OFFSET_GTT;
> +	if (gem_has_mmap_offset(fd))
> +		if (gem_has_lmem(fd))
> +			return t->type == I915_MMAP_OFFSET_FIXED;
> +		else
> +			return t->type != I915_MMAP_OFFSET_FIXED;

The above looks correct to me.

> +	else
> +		return false;

But about this, from the previous logic, shouldn't this be:

		return t->type == I915_MMAP_OFFSET_GTT;


More information about the igt-dev mailing list