From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH v2] drm/i915: Fix new_config and new_enabled for load detect Date: Fri, 17 Jan 2014 16:10:49 +0200 Message-ID: <1389967849.13051.0.camel@intelbox> References: <1389884379-21821-1-git-send-email-ville.syrjala@linux.intel.com> <1389967179-28203-1-git-send-email-ville.syrjala@linux.intel.com> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0825130264==" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A55A105E30 for ; Fri, 17 Jan 2014 06:10:51 -0800 (PST) In-Reply-To: <1389967179-28203-1-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0825130264== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-bnVLDZgMY4eT6c6ofPSP" --=-bnVLDZgMY4eT6c6ofPSP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2014-01-17 at 15:59 +0200, ville.syrjala@linux.intel.com wrote: > From: Ville Syrj=C3=A4l=C3=A4 >=20 > I forgot to set new_config and new_enabled appropriately in the load > detect code. Fix it up. >=20 > v2: Handle the other error path in intel_get_load_detect_pipe() too (Imre= ) >=20 > Signed-off-by: Ville Syrj=C3=A4l=C3=A4 Reviewed-by: Imre Deak > --- > drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/= intel_display.c > index dde98020..15f55e8 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -7825,6 +7825,8 @@ bool intel_get_load_detect_pipe(struct drm_connecto= r *connector, > to_intel_connector(connector)->new_encoder =3D intel_encoder; > =20 > intel_crtc =3D to_intel_crtc(crtc); > + intel_crtc->new_enabled =3D true; > + intel_crtc->new_config =3D &intel_crtc->config; > old->dpms_mode =3D connector->dpms; > old->load_detect_temp =3D true; > old->release_fb =3D NULL; > @@ -7848,21 +7850,28 @@ bool intel_get_load_detect_pipe(struct drm_connec= tor *connector, > DRM_DEBUG_KMS("reusing fbdev for load-detection framebuffer\n"); > if (IS_ERR(fb)) { > DRM_DEBUG_KMS("failed to allocate framebuffer for load-detection\n"); > - mutex_unlock(&crtc->mutex); > - return false; > + goto fail; > } > =20 > if (intel_set_mode(crtc, mode, 0, 0, fb)) { > DRM_DEBUG_KMS("failed to set mode on load-detect pipe\n"); > if (old->release_fb) > old->release_fb->funcs->destroy(old->release_fb); > - mutex_unlock(&crtc->mutex); > - return false; > + goto fail; > } > =20 > /* let the connector get through one full cycle before testing */ > intel_wait_for_vblank(dev, intel_crtc->pipe); > return true; > + > + fail: > + intel_crtc->new_enabled =3D crtc->enabled; > + if (intel_crtc->new_enabled) > + intel_crtc->new_config =3D &intel_crtc->config; > + else > + intel_crtc->new_config =3D NULL; > + mutex_unlock(&crtc->mutex); > + return false; > } > =20 > void intel_release_load_detect_pipe(struct drm_connector *connector, > @@ -7872,6 +7881,7 @@ void intel_release_load_detect_pipe(struct drm_conn= ector *connector, > intel_attached_encoder(connector); > struct drm_encoder *encoder =3D &intel_encoder->base; > struct drm_crtc *crtc =3D encoder->crtc; > + struct intel_crtc *intel_crtc =3D to_intel_crtc(crtc); > =20 > DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n", > connector->base.id, drm_get_connector_name(connector), > @@ -7880,6 +7890,8 @@ void intel_release_load_detect_pipe(struct drm_conn= ector *connector, > if (old->load_detect_temp) { > to_intel_connector(connector)->new_encoder =3D NULL; > intel_encoder->new_crtc =3D NULL; > + intel_crtc->new_enabled =3D false; > + intel_crtc->new_config =3D NULL; > intel_set_mode(crtc, NULL, 0, 0, NULL); > =20 > if (old->release_fb) { --=-bnVLDZgMY4eT6c6ofPSP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAABAgAGBQJS2TnpAAoJEORIIAnNuWDFaOEH/1Kl/0KkvTawJ8B19LoB5kAQ yl/3WLGFXoMO+Be/nCmuzMEttF+DRHcT15qw7Sh0cWewSnT9H4nj0YlJuYPXSeSa bAnKyviagQdMS4W/DNzgs5FgCfyPXNgbYDPu9ITZ0/5TcSFkwymrWRW/XE852490 k1WBhK7S2EmOfxcmPetspwJIYsVOELYM2ZRVrW8xKRDh/ln/fDxZ1z1/um3ucbDB m8bX0ecaEjcAVGAPJgsE7NAl6JT0Js74IrS1K/T/z3zvwtsbojuMJ+021gBYdJeK G9gsPomHswJdI/mtk/3cwOxv0Hv9wPsEEePLbMI5ARb43Mjr50JA5Vg7Q+bqnzQ= =6GfS -----END PGP SIGNATURE----- --=-bnVLDZgMY4eT6c6ofPSP-- --===============0825130264== 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 --===============0825130264==--