From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 04/15] drm/i915: honour forced connector modes Date: Wed, 6 Aug 2014 10:15:56 +0200 Message-ID: <20140806081556.GS8727@phenom.ffwll.local> References: <1407250286-1801-1-git-send-email-rodrigo.vivi@intel.com> <1407250286-1801-5-git-send-email-rodrigo.vivi@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by gabe.freedesktop.org (Postfix) with ESMTP id 60CC46E5B2 for ; Wed, 6 Aug 2014 01:15:45 -0700 (PDT) Received: by mail-wi0-f170.google.com with SMTP id f8so9210549wiw.5 for ; Wed, 06 Aug 2014 01:15:44 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1407250286-1801-5-git-send-email-rodrigo.vivi@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Aug 05, 2014 at 07:51:15AM -0700, Rodrigo Vivi wrote: > From: Chris Wilson > = > In the move over to use BIOS connector configs, we lost the ability to > force a specific set of connectors on or off. Try to remedy that by > dropping back to the old behavior if we detect a hard coded connector > config that tries to enable a connector (disabling is easy!). > = > Based on earlier patches by Jesse Barnes. > = > v2: Remove Jesse's patch > = > Reported-by: Ville Syrj=E4l=E4 > Signed-off-by: Chris Wilson > Cc: Jesse Barnes > Cc: Ville Syrj=E4l=E4 > Signed-off-by: Rodrigo Vivi Queued for -next, thanks for the patch. I've also pulled in the drm cmdline mode parsing rework. Is that all that's been straggling wrt our own initial config juggling? -Daniel > --- > drivers/gpu/drm/i915/intel_fbdev.c | 33 ++++++++++++--------------------- > 1 file changed, 12 insertions(+), 21 deletions(-) > = > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/in= tel_fbdev.c > index f475414..5d879d18 100644 > --- a/drivers/gpu/drm/i915/intel_fbdev.c > +++ b/drivers/gpu/drm/i915/intel_fbdev.c > @@ -331,24 +331,6 @@ static bool intel_fb_initial_config(struct drm_fb_he= lper *fb_helper, > int num_connectors_enabled =3D 0; > int num_connectors_detected =3D 0; > = > - /* > - * If the user specified any force options, just bail here > - * and use that config. > - */ > - for (i =3D 0; i < fb_helper->connector_count; i++) { > - struct drm_fb_helper_connector *fb_conn; > - struct drm_connector *connector; > - > - fb_conn =3D fb_helper->connector_info[i]; > - connector =3D fb_conn->connector; > - > - if (!enabled[i]) > - continue; > - > - if (connector->force !=3D DRM_FORCE_UNSPECIFIED) > - return false; > - } > - > save_enabled =3D kcalloc(dev->mode_config.num_connector, sizeof(bool), > GFP_KERNEL); > if (!save_enabled) > @@ -374,8 +356,18 @@ static bool intel_fb_initial_config(struct drm_fb_he= lper *fb_helper, > continue; > } > = > + if (connector->force =3D=3D DRM_FORCE_OFF) { > + DRM_DEBUG_KMS("connector %s is disabled by user, skipping\n", > + connector->name); > + enabled[i] =3D false; > + continue; > + } > + > encoder =3D connector->encoder; > if (!encoder || WARN_ON(!encoder->crtc)) { > + if (connector->force > DRM_FORCE_OFF) > + goto bail; > + > DRM_DEBUG_KMS("connector %s has no encoder or crtc, skipping\n", > connector->name); > enabled[i] =3D false; > @@ -394,8 +386,7 @@ static bool intel_fb_initial_config(struct drm_fb_hel= per *fb_helper, > for (j =3D 0; j < fb_helper->connector_count; j++) { > if (crtcs[j] =3D=3D new_crtc) { > DRM_DEBUG_KMS("fallback: cloned configuration\n"); > - fallback =3D true; > - goto out; > + goto bail; > } > } > = > @@ -466,8 +457,8 @@ static bool intel_fb_initial_config(struct drm_fb_hel= per *fb_helper, > fallback =3D true; > } > = > -out: > if (fallback) { > +bail: > DRM_DEBUG_KMS("Not using firmware configuration\n"); > memcpy(enabled, save_enabled, dev->mode_config.num_connector); > kfree(save_enabled); > -- = > 1.9.3 > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch