From: Takashi Iwai Subject: Re: [PATCH] drm: Prefer noninterlace cmdline mode unless explicitly specified Date: Tue, 01 Apr 2014 09:14:29 +0200 Message-ID: References: <1395237193-12850-1-git-send-email-tiwai@suse.de> <20140319141750.GC30571@phenom.ffwll.local> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTP id C2D6C6E4D1 for ; Tue, 1 Apr 2014 00:14:30 -0700 (PDT) In-Reply-To: <20140319141750.GC30571@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: David Airlie Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org At Wed, 19 Mar 2014 15:17:50 +0100, Daniel Vetter wrote: > > On Wed, Mar 19, 2014 at 02:53:13PM +0100, Takashi Iwai wrote: > > Currently drm_pick_cmdline_mode() doesn't care about the interlace > > when the given mode line has no "i" suffix. That is, when there are > > multiple entries for the same resolution, an interlace mode might be > > picked up just depending on the assigned order, and there is no way to > > exclude it. > > > > This patch changes the logic for the mode selection, to prefer the > > noninterlace mode unless the interlace mode is explicitly given. > > When no matching mode is found, it still tries the interlace mode as > > fallback. > > > > Signed-off-by: Takashi Iwai > > Yeah, makes sense. Do you have some bz or something for reference? > > Reviewed-by: Daniel Vetter > > Cheers, Daniel Dave, could you check this patch for 3.15? I can resend if needed. thanks, Takashi > > --- > > drivers/gpu/drm/drm_fb_helper.c | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > > index 98a03639b413..0a4b0a24359f 100644 > > --- a/drivers/gpu/drm/drm_fb_helper.c > > +++ b/drivers/gpu/drm/drm_fb_helper.c > > @@ -1162,6 +1162,7 @@ static struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_conne > > { > > struct drm_cmdline_mode *cmdline_mode; > > struct drm_display_mode *mode = NULL; > > + bool prefer_non_interlace; > > > > cmdline_mode = &fb_helper_conn->cmdline_mode; > > if (cmdline_mode->specified == false) > > @@ -1173,6 +1174,8 @@ static struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_conne > > if (cmdline_mode->rb || cmdline_mode->margins) > > goto create_mode; > > > > + prefer_non_interlace = !cmdline_mode->interlace; > > + again: > > list_for_each_entry(mode, &fb_helper_conn->connector->modes, head) { > > /* check width/height */ > > if (mode->hdisplay != cmdline_mode->xres || > > @@ -1187,10 +1190,18 @@ static struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_conne > > if (cmdline_mode->interlace) { > > if (!(mode->flags & DRM_MODE_FLAG_INTERLACE)) > > continue; > > + } else if (prefer_non_interlace) { > > + if (mode->flags & DRM_MODE_FLAG_INTERLACE) > > + continue; > > } > > return mode; > > } > > > > + if (prefer_non_interlace) { > > + prefer_non_interlace = false; > > + goto again; > > + } > > + > > create_mode: > > mode = drm_mode_create_from_cmdline_mode(fb_helper_conn->connector->dev, > > cmdline_mode); > > -- > > 1.9.0 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch >