From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: allow stolen, pre-allocated objects to avoid GTT allocation
Date: Wed, 8 May 2013 19:59:51 +0300 [thread overview]
Message-ID: <20130508165951.GM14974@intel.com> (raw)
In-Reply-To: <1368030989-4817-1-git-send-email-jbarnes@virtuousgeek.org>
On Wed, May 08, 2013 at 09:36:29AM -0700, Jesse Barnes wrote:
> In some cases, we may not need GTT address space allocated to a stolen
> object, so allow passing -1 to the preallocated function to indicate as
> much.
>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
> drivers/gpu/drm/i915/i915_gem_stolen.c | 4 ++++
> drivers/gpu/drm/i915/intel_pm.c | 2 +-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index 9137fa4c..2e92861 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -360,6 +360,10 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
> return NULL;
> }
>
> + /* Some objects just need physical mem from stolen space */
> + if (gtt_offset == -1)
> + return obj;
Surely that will explode in the BUG_ON(gtt_offset & 4095), or did that
get removed?
> +
> /* To simplify the initialisation sequence between KMS and GTT,
> * we allow construction of the stolen object prior to
> * setting up the GTT space. The actual reservation will occur
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index e60cd3e..081194d 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2877,7 +2877,7 @@ static void valleyview_setup_pctx(struct drm_device *dev)
> pcbr_offset = (pcbr & (~4095)) - dev_priv->mm.stolen_base;
> pctx = i915_gem_object_create_stolen_for_preallocated(dev_priv->dev,
> pcbr_offset,
> - pcbr_offset,
> + -1,
> pctx_size);
> goto out;
> }
> --
> 1.7.10.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
prev parent reply other threads:[~2013-05-08 16:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 16:36 [PATCH] drm/i915: allow stolen, pre-allocated objects to avoid GTT allocation Jesse Barnes
2013-05-08 16:56 ` Chris Wilson
2013-05-08 16:59 ` Ville Syrjälä [this message]
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=20130508165951.GM14974@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jbarnes@virtuousgeek.org \
/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.