From: Keith Packard Subject: Re: [PATCH 07/14] drm/i915: add PLL sharing support to handle 3 pipes Date: Thu, 20 Oct 2011 23:18:06 -0700 Message-ID: References: <1319037135-14907-1-git-send-email-jbarnes@virtuousgeek.org> <1319037135-14907-8-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2103087976==" Return-path: Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id CAEE49F501 for ; Thu, 20 Oct 2011 23:18:10 -0700 (PDT) In-Reply-To: <1319037135-14907-8-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jesse Barnes , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============2103087976== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Wed, 19 Oct 2011 08:12:08 -0700, Jesse Barnes = wrote: > /* PCH eDP needs FDI, but CPU eDP does not */ > - if (!has_edp_encoder || intel_encoder_is_pch_edp(&has_edp_encoder->base= )) { > + if (!intel_crtc->no_pll && > + (!has_edp_encoder || > + intel_encoder_is_pch_edp(&has_edp_encoder->base))) { > I915_WRITE(PCH_FP0(pipe), fp); > I915_WRITE(PCH_DPLL(pipe), dpll & ~DPLL_VCO_ENABLE); >=20=20 > POSTING_READ(PCH_DPLL(pipe)); > udelay(150); > + } else { > + if (dpll =3D=3D (I915_READ(PCH_DPLL(0)) & 0x7fffffff) && > + fp =3D=3D I915_READ(PCH_FP0(0))) { > + intel_crtc->use_pll_a =3D true; > + DRM_DEBUG_KMS("using pipe a dpll\n"); > + } else if (dpll =3D=3D (I915_READ(PCH_DPLL(1)) & 0x7fffffff) && > + fp =3D=3D I915_READ(PCH_FP0(1))) { > + intel_crtc->use_pll_a =3D false; > + DRM_DEBUG_KMS("using pipe b dpll\n"); > + } else { > + DRM_DEBUG_KMS("no matching PLL configuration for pipe 2\n"); > + return -EINVAL; > + } This hunk breaks eDP nicely -- you end up in the 'else' clause still looking for a DPLL to use. Here's my suggested replacement: /* PCH eDP needs FDI, but CPU eDP does not */ =2D if (!has_edp_encoder || intel_encoder_is_pch_edp(&has_edp_encoder->base= )) { =2D I915_WRITE(PCH_FP0(pipe), fp); =2D I915_WRITE(PCH_DPLL(pipe), dpll & ~DPLL_VCO_ENABLE); =2D =2D POSTING_READ(PCH_DPLL(pipe)); =2D udelay(150); + if (!intel_crtc->no_pll) { + if (!has_edp_encoder || + intel_encoder_is_pch_edp(&has_edp_encoder->base)) { + I915_WRITE(PCH_FP0(pipe), fp); + I915_WRITE(PCH_DPLL(pipe), dpll & ~DPLL_VCO_ENABLE); + + POSTING_READ(PCH_DPLL(pipe)); + udelay(150); + } + } else { + if (dpll =3D=3D (I915_READ(PCH_DPLL(0)) & 0x7fffffff) && + fp =3D=3D I915_READ(PCH_FP0(0))) { + intel_crtc->use_pll_a =3D true; + DRM_DEBUG_KMS("using pipe a dpll\n"); + } else if (dpll =3D=3D (I915_READ(PCH_DPLL(1)) & 0x7fffffff) && + fp =3D=3D I915_READ(PCH_FP0(1))) { + intel_crtc->use_pll_a =3D false; + DRM_DEBUG_KMS("using pipe b dpll\n"); + } else { + DRM_DEBUG_KMS("no matching PLL configuration for pipe 2\n"); + return -EINVAL; + } } =2D-=20 keith.packard@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIVAwUBTqEOnzYtFsjWk68qAQizIQ/9HiyRic80wTWqQ/0JDJRer56uAG/tK907 cQhh+3vj7ed4h7Ml/bHkK5uTHpiOM9TWzUH+Dz7hU9t4suXVihFvnD0mhFASERXG kBQkxiIxeto+FlB0zOocI7UDDbTH7CKjSTWWgu7sOfND6h6LiiHjf7xSSWbnI462 5Lr08n5nuEB4POrSkjruck+AWUsOBuYCh9Oqcx+i8V1V9nfbJQIEiJwPlpkm3Ncq iTxtoJEbuCap2nzLNLltjNWg4r1powukeFGSQh/456DkpypCKEnhm6zSFRIJ4BK0 RsSzIaKwqneX4pMBfh+m4SDyw5/EdLbGpWrMVOJf/hDHc5LfjfNxpRZNv1BWlbWB nr+aPkL59015cNDCQ6rri/iYboeKvVACcricO6dyXWGiq2RKD1T+HOzpcfKHBtj/ 0tiTuHrSE9aBjjNu7+C0VF4p7JZFtLOADLXuBj3pkXj3JO2LUcUgOWbqDZZSIGTU tQbPhtx+cn43sd6iVtDUc5uoz3KVyr6Ut7nLzF85xpVPCzt4w5OwYXzb5UDtRHH5 baRi3utW7LlwOYlHZd1jQEUQTRnidS7ZbhefGLtYTSE+9/uXeP65S99zmTpSkxfS GhTRQM8SlRfezchaCvZdAqqhYP/MICf8QiNf5wLcotaNOU9J74/kKH/Mx+WoV1Ej d+jrV6/QS6c= =F62N -----END PGP SIGNATURE----- --=-=-=-- --===============2103087976== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============2103087976==--