public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: Michel Thierry <michel.thierry@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH v2] drm/i915: limit PPGTT size to 2GB in 32-bit platforms
Date: Thu, 28 May 2015 18:47:31 +0100	[thread overview]
Message-ID: <20150528174731.GE24676@strange.ger.corp.intel.com> (raw)
In-Reply-To: <1432832974-5658-1-git-send-email-michel.thierry@intel.com>

On Thu, May 28, 2015 at 06:09:34PM +0100, Michel Thierry wrote:
> And prevent overflow warning during compilation. We already set this limit
> for the GGTT.
> 
> This is a temporary patch until a full replacement of size_t variables
> (inadequate in 32-bit kernel) is in place.
> 
> Regression from:
> 	commit a4e0bedca678c81eea4cd79a4bd502335639f73a
> 	Author: Michel Thierry <michel.thierry@intel.com>
> 	Date:   Wed Apr 8 12:13:35 2015 +0100
> 
> 		drm/i915: Use complete address space in true PPGTT
> 
> v2: Prettify code and explain why this is needed. (Chris)
> 
> Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 17b7df0..0653c28 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -951,7 +951,16 @@ static int gen8_ppgtt_init(struct i915_hw_ppgtt *ppgtt)
>  	gen8_initialize_pd(&ppgtt->base, ppgtt->scratch_pd);
>  
>  	ppgtt->base.start = 0;
> -	ppgtt->base.total = 1ULL << 32;
> +#ifdef CONFIG_X86_32

FWIW, this is somewhat frowned upon (which is why Chris was using
IS_ENABLED(). It's documented in Documentation/CodingStyle, Chapter 20.

  Within code, where possible, use the IS_ENABLED macro to convert a Kconfig
  symbol into a C boolean expression, and use it in a normal C conditional: 
   
          if (IS_ENABLED(CONFIG_SOMETHING)) { 
                  ... 
          } 
   
  The compiler will constant-fold the conditional away, and include or exclude 
  the block of code just as with an #ifdef, so this will not add any runtime 
  overhead.  However, this approach still allows the C compiler to see the code 
  inside the block, and check it for correctness (syntax, types, symbol
  references, etc).  Thus, you still have to use an #ifdef if the code inside the
  block references symbols that will not exist if the condition is not met.

-- 
Damien
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-05-28 17:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 15:24 [PATCH] drm/i915: limit PPGTT size to 2GB in 32-bit platforms Michel Thierry
2015-05-28 15:39 ` Chris Wilson
2015-05-28 15:59   ` Michel Thierry
2015-05-28 17:09 ` [PATCH v2] " Michel Thierry
2015-05-28 17:47   ` Damien Lespiau [this message]
2015-05-28 21:14   ` Chris Wilson
2015-05-29  8:58     ` Michel Thierry
2015-05-29 12:41       ` Chris Wilson
2015-05-29 13:15 ` [PATCH v3] " Michel Thierry
2015-05-29 17:08   ` Daniel Vetter

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=20150528174731.GE24676@strange.ger.corp.intel.com \
    --to=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michel.thierry@intel.com \
    --cc=mika.kuoppala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox