From: Chris Wilson Subject: Re: [PATCH] drm: Only create a cmdline mode if no probed modes match Date: Mon, 20 Apr 2015 14:16:02 +0100 Message-ID: <20150420131602.GD17348@nuc-i3427.alporthouse.com> References: <1429507593-21172-1-git-send-email-rd@radekdostal.com> <1429532795-3922-1-git-send-email-chris@chris-wilson.co.uk> <5534F9D6.4080908@radekdostal.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <5534F9D6.4080908@radekdostal.com> Sender: stable-owner@vger.kernel.org To: Radek =?iso-8859-1?Q?Dost=E1l?= Cc: dri-devel@lists.freedesktop.org, Jesse Barnes , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Daniel Vetter , Julia Lemire , Dave Airlie , stable@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org On Mon, Apr 20, 2015 at 03:06:30PM +0200, Radek Dost=E1l wrote: > Hi Chris, >=20 > On 04/20/2015 02:26 PM, Chris Wilson wrote: > > The intention of using video=3D: > the user's preferred resolution at startup. Currently we always cre= ate a > > GTF mode irrespective of whether the monitor has a native mode at t= he > > desired resolution. This has the issue that we may then select the = fake > > GTF mode rather the native mode during fb_helper->inital_config() a= nd so > > on a non-GTF monitor we then end up with a loss of signal. Oops. Th= is > > invalid fake mode would also be exported to userspace, who potentia= lly > > may make the same mistake. > >=20 > > To avoid this issue, we filter out the added command line mode if w= e > > detect the desired resolution (and clock if specified) amongst the > > probed modes. This fixes the immediate problem of adding a duplicat= e > > mode, but perhaps more generically we should avoid adding a GTF mod= e if > > the monitor has an EDID that is not GTF-compatible... > >=20 > > A second issue sneaked into this patch is to add the cmdline mode m= ode > > ahead of the absolute fallback 1024x768 mode. That is if the user h= as > > specified a mode that we create as a fallback, we do not need to ad= d a > > second unused fallback mode. > >=20 > > Fixes regression from > >=20 > > commit eaf99c749d43ae74ac7ffece5512f3c73f01dfd2 > > Author: Chris Wilson > > Date: Wed Aug 6 10:08:32 2014 +0200 > >=20 > > drm: Perform cmdline mode parsing during connector initialisati= on > >=20 > > that breaks HDMI output on BeagleBone Black with LG TV (model 19LS4= R-ZA). > >=20 > > Reported-by: Radek Dost=E1l > > Signed-off-by: Chris Wilson > > Cc: Radek Dost=E1l > > Cc: Jesse Barnes > > Cc: Ville Syrj=E4l=E4 > > Cc: Daniel Vetter > > Cc: dri-devel@lists.freedesktop.org > > Cc: Julia Lemire > > Cc: Dave Airlie > > Cc: stable@vger.kernel.org >=20 > NAKed-by: Radek Dost=E1l >=20 > sorry to let you know, but this patch does NOT work :( Attached is th= e > original.patch which you provided previously and it did work, but one= of > the last minute changes had to break it :( The original patch relied on the MODE_UNVERIFIED being retained by the unwanted cmdline mode. This patch relies on overwriting the existing unwanted mode->status with MODE_BAD by drm_mode_connector_list_update()= =2E I made that change because the first version would have deleted all use= r modes and not just our fake cmdline mode. Alternatively we could do a loop over the old modes, remove the fake then loops over probed modes and only add if it we don't match. Let's try that... -Chris --=20 Chris Wilson, Intel Open Source Technology Centre