• Lucas De Marchi's avatar
    drm/i915: split gen11_irq_handler to make it shareable · 7be8782a
    Lucas De Marchi authored
    Split gen11_irq_handler() to receive as parameter the function
    pointers. This allows to share the interrupt handler even if the enable/disable
    functions are different.
    
    Make sure it's always inlined to avoid the extra indirect call on the
    hot path. Checking with gcc 9 this produce the exact same code as of
    now:
    
    $ size drivers/gpu/drm/i915/i915_irq*.o
       text	   data	    bss	    dec	    hex	filename
      47511	    560	      0	  48071	   bbc7	drivers/gpu/drm/i915/i915_irq.o
      47511	    560	      0	  48071	   bbc7	drivers/gpu/drm/i915/i915_irq_new.o
    
    $ gdb -batch -ex 'file drivers/gpu/drm/i915/i915_irq.o' -ex 'disassemble gen11_irq_handler' > /tmp/old.s
    $ gdb -batch -ex 'file drivers/gpu/drm/i915/i915_irq_new.o' -ex 'disassemble gen11_irq_handler' > /tmp/new.s
    $ git diff --no-index /tmp/{old,new}.s
    $
    
    So, no change in behavior, just a simple refactor.
    
    Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
    Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
    Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Link: https://patchwork.freedesktop.org/patch/msgid/20191024195122.22877-4-lucas.demarchi@intel.com
    7be8782a
i915_irq.c 125 KB