From: "Li, Weinan Z" <weinan.z.li@intel.com>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Chris Wilson <chris@chris-wilson.co.uk>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"intel-gvt-dev@lists.freedesktop.org"
<intel-gvt-dev@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/gvt: return the actual aperture size under gvt environment
Date: Thu, 13 Apr 2017 01:01:19 +0000 [thread overview]
Message-ID: <9BD218709B5F2A4F96F08B4A3B98A89768549112@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1491992363.3274.21.camel@linux.intel.com>
> -----Original Message-----
> From: Joonas Lahtinen [mailto:joonas.lahtinen@linux.intel.com]
> Sent: Wednesday, April 12, 2017 6:19 PM
> To: Chris Wilson <chris@chris-wilson.co.uk>; Li, Weinan Z
> <weinan.z.li@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; intel-gvt-dev@lists.freedesktop.org
> Subject: Re: [Intel-gfx] [PATCH] drm/i915/gvt: return the actual aperture size
> under gvt environment
>
> On ke, 2017-04-12 at 09:53 +0100, Chris Wilson wrote:
> > On Wed, Apr 12, 2017 at 04:36:57PM +0800, Weinan Li wrote:
> > >
> > > I915_GEM_GET_APERTURE ioctl is used to probe aperture size from
> userspace.
> > > Some applications like OpenCL use this information to know how much
> > > GM resource can it use.
> >
> > That's a userspace bug.
>
> Yes, a new property might be in place. I don't think we can go and change the
> meaning of a parameter just like that.
>
> <SNIP>
>
Here I don’t want to change the meaning of I915_GEM_GET_APERTURE, but for the ioctl,
We need to return the actual available aperture size exclude the reserved space by GVT balloon.
> > > @@ -116,6 +121,14 @@ void intel_vgt_deballoon(struct drm_i915_private
> *dev_priv)
> > > memset(&bl_info, 0, sizeof(bl_info));
> > > }
> > >
> > > +size_t intel_vgt_reserved_size_by_balloon(struct drm_i915_private
> > > +*dev_priv) {
> > > + if (!intel_vgpu_active(dev_priv))
> > > + return 0;
> > > +
> > > + return bl_info.reserved_total;
> > > +}
> >
> > Or just return bl_info.reserved_total.
> >
> > Why is there a global here anyway?
> >
> > Better would be to track dev_priv->ggtt.reserved
> >
> > Then the core code becomes
> > gtt_size = dev_priv->ggtt.total - dev_priv->ggtt.reserved;
> >
> > and doesn't need to know the identity of every possible consumer.
>
> I was writing an e-mail about the same thing. So +1 on the idea.
>
Agreed.
> Regards, Joonas
> --
> Joonas Lahtinen
> Open Source Technology Center
> Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-04-13 1:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-12 8:36 [PATCH] drm/i915/gvt: return the actual aperture size under gvt environment Weinan Li
2017-04-12 8:53 ` Chris Wilson
2017-04-12 10:19 ` Joonas Lahtinen
2017-04-13 1:01 ` Li, Weinan Z [this message]
2017-04-13 10:11 ` Joonas Lahtinen
2017-04-14 7:33 ` Li, Weinan Z
2017-04-12 10:13 ` ✗ Fi.CI.BAT: failure for " Patchwork
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=9BD218709B5F2A4F96F08B4A3B98A89768549112@SHSMSX101.ccr.corp.intel.com \
--to=weinan.z.li@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.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.