Commit b9dcb97b authored by Colin Ian King's avatar Colin Ian King Committed by Chris Wilson

drm/i915: make array hw_engine_mask static, makes object smaller

Don't populate the array hw_engine_mask on the stack but instead make it
static. Makes the object code smaller by 316 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
  34004	   4388	    320	  38712	   9738	gpu/drm/i915/gt/intel_reset.o

After:
   text	   data	    bss	    dec	    hex	filename
  33528	   4548	    320	  38396	   95fc	gpu/drm/i915/gt/intel_reset.o

(gcc version 9.2.1, amd64)
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191007154151.23245-1-colin.king@canonical.com
parent 3aec2c6a
...@@ -282,14 +282,14 @@ static int gen6_reset_engines(struct intel_gt *gt, ...@@ -282,14 +282,14 @@ static int gen6_reset_engines(struct intel_gt *gt,
intel_engine_mask_t engine_mask, intel_engine_mask_t engine_mask,
unsigned int retry) unsigned int retry)
{ {
struct intel_engine_cs *engine; static const u32 hw_engine_mask[] = {
const u32 hw_engine_mask[] = {
[RCS0] = GEN6_GRDOM_RENDER, [RCS0] = GEN6_GRDOM_RENDER,
[BCS0] = GEN6_GRDOM_BLT, [BCS0] = GEN6_GRDOM_BLT,
[VCS0] = GEN6_GRDOM_MEDIA, [VCS0] = GEN6_GRDOM_MEDIA,
[VCS1] = GEN8_GRDOM_MEDIA2, [VCS1] = GEN8_GRDOM_MEDIA2,
[VECS0] = GEN6_GRDOM_VECS, [VECS0] = GEN6_GRDOM_VECS,
}; };
struct intel_engine_cs *engine;
u32 hw_mask; u32 hw_mask;
if (engine_mask == ALL_ENGINES) { if (engine_mask == ALL_ENGINES) {
...@@ -413,7 +413,7 @@ static int gen11_reset_engines(struct intel_gt *gt, ...@@ -413,7 +413,7 @@ static int gen11_reset_engines(struct intel_gt *gt,
intel_engine_mask_t engine_mask, intel_engine_mask_t engine_mask,
unsigned int retry) unsigned int retry)
{ {
const u32 hw_engine_mask[] = { static const u32 hw_engine_mask[] = {
[RCS0] = GEN11_GRDOM_RENDER, [RCS0] = GEN11_GRDOM_RENDER,
[BCS0] = GEN11_GRDOM_BLT, [BCS0] = GEN11_GRDOM_BLT,
[VCS0] = GEN11_GRDOM_MEDIA, [VCS0] = GEN11_GRDOM_MEDIA,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment