• John Harrison's avatar
    drm/i915/guc: Add fetch of hwconfig blob · 8781f051
    John Harrison authored
    Implement support for fetching the hardware description table from the
    GuC. The call is made twice - once without a destination buffer to
    query the size and then a second time to fill in the buffer.
    
    The table is stored in the GT structure so that it can be fetched once
    at driver load time. Keeping inside a GuC structure would mean it
    would be release and reloaded on a GuC reset (part of a full GT
    reset). However, the table does not change just because the GT has been
    reset and the GuC reloaded. Also, dynamic memory allocations inside
    the reset path are a problem.
    
    Note that the table is only available on ADL-P and later platforms.
    
    v2 (John's v2 patch):
     * Move to GT level to avoid memory allocation during reset path (and
       unnecessary re-read of the table on a reset).
    
    v5 (of Jordan's posting):
     * Various changes made by Jordan and recommended by Michal
       - Makefile ordering
       - Adjust "struct intel_guc_hwconfig hwconfig" comment
       - Set Copyright year to 2022 in intel_guc_hwconfig.c/.h
       - Drop inline from hwconfig_to_guc()
       - Replace hwconfig param with guc in __guc_action_get_hwconfig()
       - Move zero size check into guc_hwconfig_discover_size()
       - Change comment to say zero size offset/size is needed to get size
       - Add has_guc_hwconfig to devinfo and drop has_table()
       - Change drm_err to notice in __uc_init_hw() and use %pe
    
    v6 (of Jordan's posting):
     * Added a couple more small changes recommended by Michal
     * Merge in John's v2 patch, but note:
       - Using drm_notice as recommended by Michal
       - Reverted Michal's suggestion of using devinfo
    
    v7 (of Jordan's posting):
     * Change back to drm_err as preferred by John
    
    Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
    Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
    Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
    Acked-by: default avatarJon Bloomfield <jon.bloomfield@intel.com>
    Signed-off-by: default avatarJordan Justen <jordan.l.justen@intel.com>
    Reviewed-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
    Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220306232157.1174335-2-jordan.l.justen@intel.com
    8781f051
guc_actions_abi.h 8.63 KB