Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Put all permanent stolen allocations together
Date: Tue, 11 Sep 2018 18:31:56 +0300	[thread overview]
Message-ID: <20180911153156.GI5565@intel.com> (raw)
In-Reply-To: <20180911151439.10586-1-chris@chris-wilson.co.uk>

On Tue, Sep 11, 2018 at 04:14:39PM +0100, Chris Wilson wrote:
> Whilst reviewing another new user of stolen memory, Ville made the
> observation that we should try to ensure that all permanent allocations
> within stolen memory are clustered together at either end of the stolen
> region, in order to reduce fragmentation. In the depths of
> i915_gem_stolen.c it is not always clear what manner of allocation we
> need, so expose the drm_mm search parameter and push the decision to our
> callers.
> 
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h         | 15 +++++++++------
>  drivers/gpu/drm/i915/i915_gem_stolen.c  | 19 ++++++++++++-------
>  drivers/gpu/drm/i915/intel_engine_cs.c  |  3 ++-
>  drivers/gpu/drm/i915/intel_fbc.c        | 13 ++++++++-----
>  drivers/gpu/drm/i915/intel_fbdev.c      |  3 ++-
>  drivers/gpu/drm/i915/intel_overlay.c    |  3 ++-
>  drivers/gpu/drm/i915/intel_pm.c         |  3 ++-
>  drivers/gpu/drm/i915/intel_ringbuffer.c |  2 +-
>  8 files changed, 38 insertions(+), 23 deletions(-)
> 
<snip>
> diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
> index 72eb7e48e8bc..b134b9cabf93 100644
> --- a/drivers/gpu/drm/i915/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/intel_overlay.c
> @@ -1306,7 +1306,8 @@ static int get_registers(struct intel_overlay *overlay, bool use_phys)
>  	struct i915_vma *vma;
>  	int err;
>  
> -	obj = i915_gem_object_create_stolen(overlay->i915, PAGE_SIZE);
> +	obj = i915_gem_object_create_stolen(overlay->i915,
> +					    PAGE_SIZE, DRM_MM_INSERT_LOW);

Won't these early INSERT_LOWs create problems for the BIOS fb takeover?

>  	if (obj == NULL)
>  		obj = i915_gem_object_create_internal(overlay->i915, PAGE_SIZE);
>  	if (IS_ERR(obj))
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index d99e5fabe93c..5d18301ba079 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -7382,7 +7382,8 @@ static void valleyview_setup_pctx(struct drm_i915_private *dev_priv)
>  	 * overlap with other ranges, such as the frame buffer, protected
>  	 * memory, or any other relevant ranges.
>  	 */
> -	pctx = i915_gem_object_create_stolen(dev_priv, pctx_size);
> +	pctx = i915_gem_object_create_stolen(dev_priv,
> +					     pctx_size, DRM_MM_INSERT_LOW);
>  	if (!pctx) {
>  		DRM_DEBUG("not enough stolen space for PCTX, disabling\n");
>  		goto out;
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 472939f5c18f..e6a23a241cf3 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -1104,7 +1104,7 @@ intel_ring_create_vma(struct drm_i915_private *dev_priv, int size)
>  	struct drm_i915_gem_object *obj;
>  	struct i915_vma *vma;
>  
> -	obj = i915_gem_object_create_stolen(dev_priv, size);
> +	obj = i915_gem_object_create_stolen(dev_priv, size, DRM_MM_INSERT_BEST);
>  	if (!obj)
>  		obj = i915_gem_object_create_internal(dev_priv, size);
>  	if (IS_ERR(obj))
> -- 
> 2.19.0.rc2

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-09-11 15:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 15:14 [PATCH] drm/i915: Put all permanent stolen allocations together Chris Wilson
2018-09-11 15:31 ` Ville Syrjälä [this message]
2018-09-11 15:47   ` Chris Wilson
2018-09-11 16:07     ` Ville Syrjälä
2018-09-11 16:13 ` Ville Syrjälä
2018-09-11 20:23   ` Chris Wilson
2018-09-11 17:03 ` ✗ Fi.CI.SPARSE: warning for " Patchwork
2018-09-11 17:19 ` ✓ Fi.CI.BAT: success " Patchwork
2018-09-11 21:24 ` ✓ Fi.CI.IGT: " 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=20180911153156.GI5565@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox