• Gustavo Sousa's avatar
    drm/xe/mmio: Move xe_mmio_wait32() to xe_mmio.c · 5c09bd6c
    Gustavo Sousa authored
    This function is big enough, let's move it to a shared compilation unit.
    
    While at it, document it.
    
    Here is the output of running bloat-o-metter on the new and old module
    (execution provided by Lucas):
    
        $ ./scripts/bloat-o-meter build64/drivers/gpu/drm/xe/xe.ko{.old,}
        add/remove: 2/0 grow/shrink: 0/58 up/down: 554/-15645 (-15091)
        (...) # Lines in between omitted
        Total: Before=2181322, After=2166231, chg -0.69%
    
    The overall reduction in the size is not that significant. Nevertheless,
    keeping the function as inline arguably does not bring too much benefit
    as well.
    
    As noted by Lucas, we would probably benefit from an inline
    function that did the fast-path check: do an optimistic first check
    before entering the wait-logic, which itself would go to a compilation
    unit. We might come back to implement this in the future if we have data
    to justify it.
    
    v2:
      - Add note in documentation for @timeout_us regarding the exponential
        backoff strategy. (Lucas)
      - Share output of bloat-o-meter in the commit message. (Lucas)
    Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
    Link: https://lore.kernel.org/r/20231116214000.70573-2-gustavo.sousa@intel.comSigned-off-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
    Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    5c09bd6c
xe_mmio.h 2.45 KB