mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sinclair Yeh <syeh@vmware.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: linux-graphics-maintainer@vmware.com, thellstrom@vmware.com,
	airlied@linux.ie, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: ttm: vmwgfx: dma-buf: Constify ttm_place structures.
Date: Tue, 4 Jul 2017 15:19:04 +0200	[thread overview]
Message-ID: <20170704131903.GB23574@pc24.home> (raw)
In-Reply-To: <0ddb7e25e1b2584c62726afb4d087e2039d12639.1498981853.git.arvind.yadav.cs@gmail.com>

Looks good.  Thanks.

I've queued this for my next pull request.

On Sun, Jul 02, 2017 at 01:26:55PM +0530, Arvind Yadav wrote:
> ttm_place are not supposed to change at runtime. All functions
> working with ttm_place provided by <drm/ttm/ttm_placement.h> work
> with const ttm_place. So mark the non-const structs as const.
> 
> File size before:
>    text	   data	    bss	    dec	    hex	filename
>    3172	    796	     16	   3984	    f90 drivers/gpu/drm/vmwgfx/vmwgfx_buffer.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>    3456	    512	     16	   3984	    f90 drivers/gpu/drm/vmwgfx/vmwgfx_buffer.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
> index 35bf781..c705632 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
> @@ -30,49 +30,49 @@
>  #include <drm/ttm/ttm_placement.h>
>  #include <drm/ttm/ttm_page_alloc.h>
>  
> -static struct ttm_place vram_placement_flags = {
> +static const struct ttm_place vram_placement_flags = {
>  	.fpfn = 0,
>  	.lpfn = 0,
>  	.flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
>  };
>  
> -static struct ttm_place vram_ne_placement_flags = {
> +static const struct ttm_place vram_ne_placement_flags = {
>  	.fpfn = 0,
>  	.lpfn = 0,
>  	.flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
>  };
>  
> -static struct ttm_place sys_placement_flags = {
> +static const struct ttm_place sys_placement_flags = {
>  	.fpfn = 0,
>  	.lpfn = 0,
>  	.flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED
>  };
>  
> -static struct ttm_place sys_ne_placement_flags = {
> +static const struct ttm_place sys_ne_placement_flags = {
>  	.fpfn = 0,
>  	.lpfn = 0,
>  	.flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
>  };
>  
> -static struct ttm_place gmr_placement_flags = {
> +static const struct ttm_place gmr_placement_flags = {
>  	.fpfn = 0,
>  	.lpfn = 0,
>  	.flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
>  };
>  
> -static struct ttm_place gmr_ne_placement_flags = {
> +static const struct ttm_place gmr_ne_placement_flags = {
>  	.fpfn = 0,
>  	.lpfn = 0,
>  	.flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
>  };
>  
> -static struct ttm_place mob_placement_flags = {
> +static const struct ttm_place mob_placement_flags = {
>  	.fpfn = 0,
>  	.lpfn = 0,
>  	.flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED
>  };
>  
> -static struct ttm_place mob_ne_placement_flags = {
> +static const struct ttm_place mob_ne_placement_flags = {
>  	.fpfn = 0,
>  	.lpfn = 0,
>  	.flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
> @@ -85,7 +85,7 @@ struct ttm_placement vmw_vram_placement = {
>  	.busy_placement = &vram_placement_flags
>  };
>  
> -static struct ttm_place vram_gmr_placement_flags[] = {
> +static const struct ttm_place vram_gmr_placement_flags[] = {
>  	{
>  		.fpfn = 0,
>  		.lpfn = 0,
> @@ -97,7 +97,7 @@ static struct ttm_place vram_gmr_placement_flags[] = {
>  	}
>  };
>  
> -static struct ttm_place gmr_vram_placement_flags[] = {
> +static const struct ttm_place gmr_vram_placement_flags[] = {
>  	{
>  		.fpfn = 0,
>  		.lpfn = 0,
> @@ -116,7 +116,7 @@ struct ttm_placement vmw_vram_gmr_placement = {
>  	.busy_placement = &gmr_placement_flags
>  };
>  
> -static struct ttm_place vram_gmr_ne_placement_flags[] = {
> +static const struct ttm_place vram_gmr_ne_placement_flags[] = {
>  	{
>  		.fpfn = 0,
>  		.lpfn = 0,
> @@ -165,7 +165,7 @@ struct ttm_placement vmw_sys_ne_placement = {
>  	.busy_placement = &sys_ne_placement_flags
>  };
>  
> -static struct ttm_place evictable_placement_flags[] = {
> +static const struct ttm_place evictable_placement_flags[] = {
>  	{
>  		.fpfn = 0,
>  		.lpfn = 0,
> -- 
> 2.7.4
> 

      reply	other threads:[~2017-07-04 13:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-02  7:56 Arvind Yadav
2017-07-04 13:19 ` Sinclair Yeh [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=20170704131903.GB23574@pc24.home \
    --to=syeh@vmware.com \
    --cc=airlied@linux.ie \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thellstrom@vmware.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

all inboxes | Powered by JetHome®