All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>,
	Art Runyan <arthur.j.runyan@intel.com>,
	Ben Widawsky <ben@bwidawsk.net>
Subject: Re: [PATCH] drm/i915/bdw: Don't allow the FBC base to be 0
Date: Fri, 2 May 2014 11:19:27 +0300	[thread overview]
Message-ID: <20140502081927.GR18465@intel.com> (raw)
In-Reply-To: <1398995274-1317-1-git-send-email-benjamin.widawsky@intel.com>

On Thu, May 01, 2014 at 06:47:54PM -0700, Ben Widawsky wrote:
> "Restriction :
> The offset must be greater than 4K bytes, avoiding the first 4KB of
> stolen memory."

Isn't this a more generic issue that we must avoid the first 4k? If so
I think we should just reserve the first 4k permanently at driver init
time.

> 
> Since it looks like we currently allocate an overlay out of stolen
> before we get the compressed framebuffer, I believe this is not
> currently an issue which fixes anything. We simply want to make the code
> as future-proof, and as clear as possible, by match the spec.
> 
> Cc: Art Runyan <arthur.j.runyan@intel.com>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> ---
>  drivers/gpu/drm/i915/i915_gem_stolen.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index 62ef55b..65016b0 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -107,19 +107,24 @@ static int i915_setup_compression(struct drm_device *dev, int size)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct drm_mm_node *compressed_fb, *uninitialized_var(compressed_llb);
> +	unsigned long start = 0;
>  	int ret;
>  
>  	compressed_fb = kzalloc(sizeof(*compressed_fb), GFP_KERNEL);
>  	if (!compressed_fb)
>  		goto err_llb;
>  
> +	if (IS_BROADWELL(dev))
> +		start = 0x1000;
> +
>  	/* Try to over-allocate to reduce reallocations and fragmentation */
> -	ret = drm_mm_insert_node(&dev_priv->mm.stolen, compressed_fb,
> -				 size <<= 1, 4096, DRM_MM_SEARCH_DEFAULT);
> +	ret = drm_mm_insert_node_in_range(&dev_priv->mm.stolen, compressed_fb,
> +					  size <<= 1, 4096, start, dev_priv->gtt.stolen_size,
> +					  DRM_MM_SEARCH_DEFAULT);
>  	if (ret)
> -		ret = drm_mm_insert_node(&dev_priv->mm.stolen, compressed_fb,
> -					 size >>= 1, 4096,
> -					 DRM_MM_SEARCH_DEFAULT);
> +		ret = drm_mm_insert_node_in_range(&dev_priv->mm.stolen, compressed_fb,
> +						  size >>= 1, 4096, start, dev_priv->gtt.stolen_size,
> +						  DRM_MM_SEARCH_DEFAULT);
>  	if (ret)
>  		goto err_llb;
>  
> -- 
> 1.9.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2014-05-02  8:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-02  1:47 [PATCH] drm/i915/bdw: Don't allow the FBC base to be 0 Ben Widawsky
2014-05-02  8:19 ` Ville Syrjälä [this message]
2014-05-02  8:38   ` Chris Wilson
2014-05-02 13:00     ` Ville Syrjälä
2014-05-02 17:00       ` Ben Widawsky
2014-05-02 20:35         ` Chris Wilson
2014-05-03  1:48           ` Ben Widawsky
2014-05-15 14:05             ` Ville Syrjälä
2014-05-15 14:45               ` Damien Lespiau

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=20140502081927.GR18465@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=arthur.j.runyan@intel.com \
    --cc=ben@bwidawsk.net \
    --cc=benjamin.widawsky@intel.com \
    --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 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.