aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-07-17 10:39:53 -0400
committerSinclair Yeh <syeh@vmware.com>2017-07-18 02:40:57 -0400
commit9036f8c7cf42af2c0d50e8bbc493323239a30423 (patch)
tree7125a339aaed2d21191c9a36923e27111e40fa3c
parent8bd6287ffdb95a623bdbad37e49d1c12c60970ed (diff)
drm/vmwgfx: dma-buf: Constify ttm_place structures.
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> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
index 35bf781e418e..c7056322211c 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
@@ -30,49 +30,49 @@
30#include <drm/ttm/ttm_placement.h> 30#include <drm/ttm/ttm_placement.h>
31#include <drm/ttm/ttm_page_alloc.h> 31#include <drm/ttm/ttm_page_alloc.h>
32 32
33static struct ttm_place vram_placement_flags = { 33static const struct ttm_place vram_placement_flags = {
34 .fpfn = 0, 34 .fpfn = 0,
35 .lpfn = 0, 35 .lpfn = 0,
36 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED 36 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
37}; 37};
38 38
39static struct ttm_place vram_ne_placement_flags = { 39static const struct ttm_place vram_ne_placement_flags = {
40 .fpfn = 0, 40 .fpfn = 0,
41 .lpfn = 0, 41 .lpfn = 0,
42 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT 42 .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
43}; 43};
44 44
45static struct ttm_place sys_placement_flags = { 45static const struct ttm_place sys_placement_flags = {
46 .fpfn = 0, 46 .fpfn = 0,
47 .lpfn = 0, 47 .lpfn = 0,
48 .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED 48 .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED
49}; 49};
50 50
51static struct ttm_place sys_ne_placement_flags = { 51static const struct ttm_place sys_ne_placement_flags = {
52 .fpfn = 0, 52 .fpfn = 0,
53 .lpfn = 0, 53 .lpfn = 0,
54 .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT 54 .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
55}; 55};
56 56
57static struct ttm_place gmr_placement_flags = { 57static const struct ttm_place gmr_placement_flags = {
58 .fpfn = 0, 58 .fpfn = 0,
59 .lpfn = 0, 59 .lpfn = 0,
60 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED 60 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
61}; 61};
62 62
63static struct ttm_place gmr_ne_placement_flags = { 63static const struct ttm_place gmr_ne_placement_flags = {
64 .fpfn = 0, 64 .fpfn = 0,
65 .lpfn = 0, 65 .lpfn = 0,
66 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT 66 .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
67}; 67};
68 68
69static struct ttm_place mob_placement_flags = { 69static const struct ttm_place mob_placement_flags = {
70 .fpfn = 0, 70 .fpfn = 0,
71 .lpfn = 0, 71 .lpfn = 0,
72 .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED 72 .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED
73}; 73};
74 74
75static struct ttm_place mob_ne_placement_flags = { 75static const struct ttm_place mob_ne_placement_flags = {
76 .fpfn = 0, 76 .fpfn = 0,
77 .lpfn = 0, 77 .lpfn = 0,
78 .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT 78 .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
@@ -85,7 +85,7 @@ struct ttm_placement vmw_vram_placement = {
85 .busy_placement = &vram_placement_flags 85 .busy_placement = &vram_placement_flags
86}; 86};
87 87
88static struct ttm_place vram_gmr_placement_flags[] = { 88static const struct ttm_place vram_gmr_placement_flags[] = {
89 { 89 {
90 .fpfn = 0, 90 .fpfn = 0,
91 .lpfn = 0, 91 .lpfn = 0,
@@ -97,7 +97,7 @@ static struct ttm_place vram_gmr_placement_flags[] = {
97 } 97 }
98}; 98};
99 99
100static struct ttm_place gmr_vram_placement_flags[] = { 100static const struct ttm_place gmr_vram_placement_flags[] = {
101 { 101 {
102 .fpfn = 0, 102 .fpfn = 0,
103 .lpfn = 0, 103 .lpfn = 0,
@@ -116,7 +116,7 @@ struct ttm_placement vmw_vram_gmr_placement = {
116 .busy_placement = &gmr_placement_flags 116 .busy_placement = &gmr_placement_flags
117}; 117};
118 118
119static struct ttm_place vram_gmr_ne_placement_flags[] = { 119static const struct ttm_place vram_gmr_ne_placement_flags[] = {
120 { 120 {
121 .fpfn = 0, 121 .fpfn = 0,
122 .lpfn = 0, 122 .lpfn = 0,
@@ -165,7 +165,7 @@ struct ttm_placement vmw_sys_ne_placement = {
165 .busy_placement = &sys_ne_placement_flags 165 .busy_placement = &sys_ne_placement_flags
166}; 166};
167 167
168static struct ttm_place evictable_placement_flags[] = { 168static const struct ttm_place evictable_placement_flags[] = {
169 { 169 {
170 .fpfn = 0, 170 .fpfn = 0,
171 .lpfn = 0, 171 .lpfn = 0,