All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org,
	Andrzej Turko <andrzej.turko@linux.intel.com>,
	John Harrison <John.C.Harrison@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] Return allocated size in gem_create_in_memory_regions() and friends
Date: Sat, 02 Oct 2021 13:32:08 -0700	[thread overview]
Message-ID: <8735pjf9rr.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20210928065241.GA4608@zkempczy-mobl2>

On Mon, 27 Sep 2021 23:52:41 -0700, Zbigniew Kempczyński wrote:
>
> > diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c
> > index d1395c1605d..52794c1ac10 100644
> > --- a/lib/intel_bufops.c
> > +++ b/lib/intel_bufops.c
> > @@ -819,7 +819,7 @@ static void __intel_buf_init(struct buf_ops *bops,
> >	if (handle)
> >		buf->handle = handle;
> >	else {
> > -		if (!__gem_create_in_memory_regions(bops->fd, &handle, size, region))
> > +		if (!__gem_create_in_memory_regions(bops->fd, &handle, &size, region))
> >			buf->handle = handle;
> >		else
> >			buf->handle = gem_create(bops->fd, size);
>
> As size can be different we pass we should update buf->size accordingly.
> Look at few lines above:
>
>	/* Store real bo size to avoid mistakes in calculating it again */
>	buf->size = size;
>
> I think these lines can be moved at the bottom of the condition.
>
> buf->size is returned as a call to intel_buf_bo_size() and used in
> intel_bb_add_object(). This can be important for no-reloc mode to avoid
> overlapping object on softpin and hitting -ENOSPC.

I have a new patch reverting part of the changes done in 22643ce4014a:

https://patchwork.freedesktop.org/series/95376/

In this context I want to check regarding the above change again: should we
be setting buf->size above to the allocated size or to the requested size,
in case the two are different? Currently the code (even after the new
patch) is setting it to the allocated size which might be >= the requested
size. Thanks.

  reply	other threads:[~2021-10-02 20:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28  3:11 [igt-dev] [PATCH i-g-t] Return allocated size in gem_create_in_memory_regions() and friends Ashutosh Dixit
2021-09-28  5:40 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-09-28  6:52 ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński
2021-10-02 20:32   ` Dixit, Ashutosh [this message]
2021-10-04  3:40     ` Zbigniew Kempczyński
2021-10-07 19:26     ` John Harrison
2021-10-08  5:38       ` Zbigniew Kempczyński
2021-09-28  8:40 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
2021-09-28 18:47 [igt-dev] [PATCH i-g-t] " Ashutosh Dixit
2021-09-29  5:05 ` Zbigniew Kempczyński

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735pjf9rr.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=John.C.Harrison@intel.com \
    --cc=andrzej.turko@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.