From: "Souza, Jose" Subject: Re: [PATCH] drm/i915: extract AUX mask assignment to separate function Date: Sat, 23 Feb 2019 00:07:09 +0000 Message-ID: <76df1e5d00dde3d2d2ed64a9549e67528d150138.camel@intel.com> References: <20190222235954.9795-1-lucas.demarchi@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1466899195==" Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id CA84A8999C for ; Sat, 23 Feb 2019 00:07:10 +0000 (UTC) In-Reply-To: <20190222235954.9795-1-lucas.demarchi@intel.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: "intel-gfx@lists.freedesktop.org" , "De Marchi, Lucas" List-Id: intel-gfx@lists.freedesktop.org --===============1466899195== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-Um2UxQ/k86QpvSin9Tor" --=-Um2UxQ/k86QpvSin9Tor Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2019-02-22 at 15:59 -0800, Lucas De Marchi wrote: > No change in behavior, this only allows to more easily follow the > flow > of gen8_de_irq_handler without the mask assignments for each > platform. > This also re-organizes the branches a little bit, so the one-off case > for CNL_WITH_PORT_F is separate from the generic gen >=3D 11. Reviewed-by: Jos=C3=A9 Roberto de Souza >=20 > Cc: Ville Syrj=C3=A4l=C3=A4 > Cc: Jose Souza > Signed-off-by: Lucas De Marchi > --- > drivers/gpu/drm/i915/i915_irq.c | 34 +++++++++++++++++++---------- > ---- > 1 file changed, 20 insertions(+), 14 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/i915_irq.c > b/drivers/gpu/drm/i915/i915_irq.c > index 7c7e84e86c6a..524caf168a01 100644 > --- a/drivers/gpu/drm/i915/i915_irq.c > +++ b/drivers/gpu/drm/i915/i915_irq.c > @@ -2676,6 +2676,25 @@ static void gen11_hpd_irq_handler(struct > drm_i915_private *dev_priv, u32 iir) > DRM_ERROR("Unexpected DE HPD interrupt 0x%08x\n", iir); > } > =20 > +static u32 de_port_iir_aux_mask(struct drm_i915_private *dev_priv) > +{ > + u32 mask =3D GEN8_AUX_CHANNEL_A; > + > + if (INTEL_GEN(dev_priv) >=3D 9) > + mask |=3D GEN9_AUX_CHANNEL_B | > + GEN9_AUX_CHANNEL_C | > + GEN9_AUX_CHANNEL_D; > + > + if (IS_CNL_WITH_PORT_F(dev_priv)) > + mask |=3D CNL_AUX_CHANNEL_F; > + > + if (INTEL_GEN(dev_priv) >=3D 11) > + mask |=3D ICL_AUX_CHANNEL_E | > + CNL_AUX_CHANNEL_F; > + > + return mask; > +} > + > static irqreturn_t > gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 > master_ctl) > { > @@ -2731,20 +2750,7 @@ gen8_de_irq_handler(struct drm_i915_private > *dev_priv, u32 master_ctl) > I915_WRITE(GEN8_DE_PORT_IIR, iir); > ret =3D IRQ_HANDLED; > =20 > - tmp_mask =3D GEN8_AUX_CHANNEL_A; > - if (INTEL_GEN(dev_priv) >=3D 9) > - tmp_mask |=3D GEN9_AUX_CHANNEL_B | > - GEN9_AUX_CHANNEL_C | > - GEN9_AUX_CHANNEL_D; > - > - if (INTEL_GEN(dev_priv) >=3D 11) > - tmp_mask |=3D ICL_AUX_CHANNEL_E; > - > - if (IS_CNL_WITH_PORT_F(dev_priv) || > - INTEL_GEN(dev_priv) >=3D 11) > - tmp_mask |=3D CNL_AUX_CHANNEL_F; > - > - if (iir & tmp_mask) { > + if (iir & de_port_iir_aux_mask(dev_priv)) { > dp_aux_irq_handler(dev_priv); > found =3D true; > } --=-Um2UxQ/k86QpvSin9Tor Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEVNG051EijGa0MiaQVenbO/mOWkkFAlxwjqsACgkQVenbO/mO WkkwaQgAnO7frklUNES5iGiKPV95JSp8GYPuztFdEZMzbNUvWZnvyLq5WrIV5DPv ACJqd/QpgB1/4JSxzHakrIkpPOMIxV1C1dK06SYM8Z4qFgUkFBLfyJcfcXXh8DL3 tewoWXhwGR6baC+Krb4obKWPpBmyxsih5YOiQk4IJr3StWGCEXOKgPOMAWslpPYy CgMBpUP5q0eFHGsRgksa5lycpf/e4rjz62dlILAj3MZ3PnqTOvyvaTi/G412Q9lP Qa6XFuJQZr2MvbsoF0leNX6/sw1yJ8DHkpaCDXp2nmSaWzomSbjnSnTs4YzfIXYb IGJNAUqrwhoRFjJUuDefkSIsJbZzcQ== =n626 -----END PGP SIGNATURE----- --=-Um2UxQ/k86QpvSin9Tor-- --===============1466899195== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4 --===============1466899195==--