Skip to content
Commit d47d29a6 authored by Matt Roper's avatar Matt Roper
Browse files

drm/i915/display: Convert gen5/gen6 tests to IS_IRONLAKE/IS_SANDYBRIDGE



ILK is the only platform that we consider "gen5" and SNB is the only
platform we consider "gen6."  Add an IS_SANDYBRIDGE() macro and then
replace numeric platform tests for these two generations with direct
platform tests with the following Coccinelle semantic patch:

        @@ expression dev_priv; @@
        - IS_GEN(dev_priv, 5)
        + IS_IRONLAKE(dev_priv)

        @@ expression dev_priv; @@
        - IS_GEN(dev_priv, 6)
        + IS_SANDYBRIDGE(dev_priv)

        @@ expression dev_priv; @@
        - IS_GEN_RANGE(dev_priv, 5, 6)
        + IS_IRONLAKE(dev_priv) || IS_SANDYBRIDGE(dev_priv)

This will simplify our upcoming patches which eliminate INTEL_GEN()
usage in the display code.

v2:
 - Reverse ilk/snb order for IS_GEN_RANGE conversion.  (Ville)
 - Rebase + regenerate from semantic patch

Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210320044245.3920043-2-matthew.d.roper@intel.com
parent 5706d028
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