intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ramalingam C <ramalingam.c@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/5] drm/i915: Shrink eDRAM ways/sets arrays
Date: Thu, 17 Oct 2019 15:54:46 +0300	[thread overview]
Message-ID: <20191017125446.GS1208@intel.com> (raw)
In-Reply-To: <20191017075828.GE4730@intel.com>

On Thu, Oct 17, 2019 at 01:28:29PM +0530, Ramalingam C wrote:
> On 2019-10-10 at 17:51:23 +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Make the ways/sets arrays static cosnt u8 to shrink things a bit.
> > 
> >     text	   data	    bss	    dec	    hex	filename
> > -  23935	    629	    128	  24692	   6074	i915_drv.o
> > +  23818	    629	    128	  24575	   5fff	i915_drv.o
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index f02a34722217..0b8c13ae4857 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -1073,8 +1073,8 @@ intel_get_dram_info(struct drm_i915_private *dev_priv)
> >  
> >  static u32 gen9_edram_size_mb(struct drm_i915_private *dev_priv, u32 cap)
> >  {
> > -	const unsigned int ways[8] = { 4, 8, 12, 16, 16, 16, 16, 16 };
> > -	const unsigned int sets[4] = { 1, 1, 2, 2 };
> > +	static const u8 ways[8] = { 4, 8, 12, 16, 16, 16, 16, 16 };
> > +	static const u8 sets[4] = { 1, 1, 2, 2 };
> Asking for my understanding. unsigned int -> u8 make sense to shrink the
> size. Could you please add reasoning for adding static? moving it into
> data segment hence reducing the stack?

Possibly. My usual approach is to just make all such things
static const unless there is a real reason not to.

> 
> -Ram
> >  
> >  	return EDRAM_NUM_BANKS(cap) *
> >  		ways[EDRAM_WAYS_IDX(cap)] *
> > -- 
> > 2.21.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

  reply	other threads:[~2019-10-17 12:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 14:51 [PATCH 1/5] drm/i915: Shrink eDRAM ways/sets arrays Ville Syrjala
2019-10-10 14:51 ` [PATCH 2/5] drm/i915: s/hdcp2_hdmi_msg_data/hdcp2_hdmi_msg_timeout/ Ville Syrjala
2019-10-17  6:55   ` Ramalingam C
2019-10-10 14:51 ` [PATCH 3/5] drm/i915: Remove dead weight from hdcp2_msg_timeout[] Ville Syrjala
2019-10-17  7:02   ` Ramalingam C
2019-10-10 14:51 ` [PATCH 4/5] drm/i915: Remove hdcp2_hdmi_msg_timeout.timeout2 Ville Syrjala
2019-10-17  7:05   ` Ramalingam C
2019-10-10 14:51 ` [PATCH 5/5] drm/i915: Make hdcp2_msg_timeout.timeout u16 Ville Syrjala
2019-10-17  7:08   ` Ramalingam C
2019-10-10 16:57 ` ✗ Fi.CI.BAT: failure for series starting with [1/5] drm/i915: Shrink eDRAM ways/sets arrays Patchwork
2019-10-17  7:58 ` [PATCH 1/5] " Ramalingam C
2019-10-17 12:54   ` Ville Syrjälä [this message]
2019-10-17 13:26     ` Ramalingam C

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=20191017125446.GS1208@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ramalingam.c@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;
as well as URLs for NNTP newsgroup(s).