[Intel-gfx] [PATCH 01/56] drm/i915/display: Convert gen5/gen6 tests to IS_IRONLAKE/IS_SANDYBRIDGE
Ville Syrjälä
ville.syrjala at linux.intel.com
Fri Mar 12 16:50:00 UTC 2021
On Thu, Mar 11, 2021 at 02:35:37PM -0800, Matt Roper wrote:
> 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_SANDYBRIDGE(dev_priv) || IS_IRONLAKE(dev_priv)
I'd probably make this IS_ILK||IS_SNB. Looks like we tend to use
the old->new order in most of the cases this touches.
> @@ -7439,7 +7439,7 @@ int intel_plane_atomic_calc_changes(const struct intel_crtc_state *old_crtc_stat
> * plane, not only sprite plane.
> */
> if (plane->id != PLANE_CURSOR &&
> - (IS_GEN_RANGE(dev_priv, 5, 6) ||
> + (IS_SANDYBRIDGE(dev_priv) || IS_IRONLAKE(dev_priv) ||
> IS_IVYBRIDGE(dev_priv)) &&
> (turn_on || (!needs_scaling(old_plane_state) &&
> needs_scaling(plane_state))))
This is at least one case where the IS_SNB||IS_ILK order
makes things look confusing.
Apart from that I like it.
Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
--
Ville Syrjälä
Intel
More information about the Intel-gfx
mailing list