• Tvrtko Ursulin's avatar
    drm/i915: Introduce concept of a sub-platform · 805446c8
    Tvrtko Ursulin authored
    Concept of a sub-platform already exist in our code (like ULX and ULT
    platform variants and similar),implemented via the macros which check a
    list of device ids to determine a match.
    
    With this patch we consolidate device ids checking into a single function
    called during early driver load.
    
    A few low bits in the platform mask are reserved for sub-platform
    identification and defined as a per-platform namespace.
    
    At the same time it future proofs the platform_mask handling by preparing
    the code for easy extending, and tidies the very verbose WARN strings
    generated when IS_PLATFORM macros are embedded into a WARN type
    statements.
    
    v2: Fixed IS_SUBPLATFORM. Updated commit msg.
    v3: Chris was right, there is an ordering problem.
    
    v4:
     * Catch-up with new sub-platforms.
     * Rebase for RUNTIME_INFO.
     * Drop subplatform mask union tricks and convert platform_mask to an
       array for extensibility.
    
    v5:
     * Fix subplatform check.
     * Protect against forgetting to expand subplatform bits.
     * Remove platform enum tallying.
     * Add subplatform to error state. (Chris)
     * Drop macros and just use static inlines.
     * Remove redundant IRONLAKE_M. (Ville)
    
    v6:
     * Split out Ironlake change.
     * Optimize subplatform check.
     * Use __always_inline. (Lucas)
     * Add platform_mask comment. (Paulo)
     * Pass stored runtime info in error capture. (Chris)
    
    v7:
     * Rebased for new AML ULX device id.
     * Bump platform mask array size for EHL.
     * Stop mentioning device ids in intel_device_subplatform_init by using
       the trick of splitting macros i915_pciids.h. (Jani)
     * AML seems to be either a subplatform of KBL or CFL so express it like
       that.
    
    v8:
     * Use one device id table per subplatform. (Jani)
    Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
    Suggested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Jani Nikula <jani.nikula@intel.com>
    Cc: Lucas De Marchi <lucas.demarchi@intel.com>
    Cc: Jose Souza <jose.souza@intel.com>
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
    Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20190327142328.31780-1-tvrtko.ursulin@linux.intel.com
    805446c8
i915_pci.c 23.4 KB