Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752538AbbD3Orx (ORCPT ); Thu, 30 Apr 2015 10:47:53 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:23566 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbbD3Orw (ORCPT ); Thu, 30 Apr 2015 10:47:52 -0400 Message-ID: <55424057.60707@atmel.com> Date: Thu, 30 Apr 2015 16:46:47 +0200 From: Nicolas Ferre Organization: atmel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Boris Brezillon , Thierry Reding , CC: David Airlie , Jean-Christophe Plagniol-Villard , Alexandre Belloni , Subject: Re: [PATCH] drm: panel: simple-panel: set appropriate mode type References: <1430404770-29704-1-git-send-email-boris.brezillon@free-electrons.com> In-Reply-To: <1430404770-29704-1-git-send-email-boris.brezillon@free-electrons.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.161.30.18] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1847 Lines: 55 Le 30/04/2015 16:39, Boris Brezillon a ?crit : > All modes exposed by simple panels should be tagged as driver defined > modes. > Moreover, if a panel supports only one mode, this mode is obviously the > preferred one. > > Doing this also fix a problem occurring when a 'video=' parameter is passed > on the kernel cmdline. In some cases the user provided mode is preferred > over the simple panel ones, which might result in unpredictable behavior. > > Signed-off-by: Boris Brezillon Tested-by: Nicolas Ferre On Atmel sama5d3xek board. > --- > drivers/gpu/drm/panel/panel-simple.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c > index d14b904..95ae390 100644 > --- a/drivers/gpu/drm/panel/panel-simple.c > +++ b/drivers/gpu/drm/panel/panel-simple.c > @@ -111,6 +111,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel) > continue; > } > > + mode->type |= DRM_MODE_TYPE_DRIVER; > + if (panel->desc->num_modes == 1) > + mode->type |= DRM_MODE_TYPE_PREFERRED; > + > drm_display_mode_from_videomode(&vm, mode); > > drm_mode_probed_add(connector, mode); > @@ -127,6 +131,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel) > continue; > } > > + mode->type |= DRM_MODE_TYPE_DRIVER; > + if (panel->desc->num_modes == 1) > + mode->type |= DRM_MODE_TYPE_PREFERRED; > + > drm_mode_set_name(mode); > > drm_mode_probed_add(connector, mode); > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/