From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753439AbcEYK1H (ORCPT ); Wed, 25 May 2016 06:27:07 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:38281 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbcEYK1E (ORCPT ); Wed, 25 May 2016 06:27:04 -0400 Message-ID: <1464172019.3545.50.camel@pengutronix.de> Subject: Re: [PATCHv2 2/3] drm/imx: convey the pixelclk-active and de-active flags from DT to the ipu-di driver From: Philipp Zabel To: Lothar =?ISO-8859-1?Q?Wa=DFmann?= Cc: David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Wed, 25 May 2016 12:26:59 +0200 In-Reply-To: <20160525081157.67f51dd5@ipc1.ka-ro> References: <1464071511-16363-1-git-send-email-LW@KARO-electronics.de> <1464071511-16363-3-git-send-email-LW@KARO-electronics.de> <1464099400.3641.60.camel@pengutronix.de> <20160525081157.67f51dd5@ipc1.ka-ro> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:96de:80ff:fec2:9969 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, den 25.05.2016, 08:11 +0200 schrieb Lothar Waßmann: [...] > > > @@ -81,10 +87,27 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector) > > > > > > if (np) { > > > struct drm_display_mode *mode = drm_mode_create(connector->dev); > > > + struct videomode vm; > > > + int ret; > > > > > > if (!mode) > > > return -EINVAL; > > > - of_get_drm_display_mode(np, &imxpd->mode, OF_USE_NATIVE_MODE); > > > + > > > + ret = of_get_videomode(np, &vm, OF_USE_NATIVE_MODE); > > > + if (ret) > > > + return ret; > > > + drm_display_mode_from_videomode(&vm, &imxpd->mode); > > > + drm_mode_debug_printmodeline(&imxpd->mode); > > > + > > > + if (vm.flags & DISPLAY_FLAGS_PIXDATA_POSEDGE) > > > + imxpd->bus_flags |= DRM_BUS_FLAG_PIXDATA_POSEDGE; > > > + if (vm.flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) > > > + imxpd->bus_flags |= DRM_BUS_FLAG_PIXDATA_NEGEDGE; > > > + > > > + if (vm.flags & DISPLAY_FLAGS_DE_LOW) > > > + imxpd->bus_flags |= DRM_BUS_FLAG_DE_LOW; > > > + if (vm.flags & DISPLAY_FLAGS_DE_HIGH) > > > + imxpd->bus_flags |= DRM_BUS_FLAG_DE_HIGH; > > > > This could be shared between ldb and parallel drivers if you extended > > of_get_drm_display_mode to also return bus_flags, for example. The flags > > translation could be put into a drm_bus_flags_from_videomode helper. > > > I had that in mind also, but hesitated to change the generic > of_get_drm_display_mode() to implement some i.MX specific functionality. Since the videomode obtained from DT includes both the timing and pin polarity information, and the drm way to express these are drm_display_mode and bus_flags, respectively, there's nothing i.MX specific about this. regards Philipp