diff mbox

drm/imx: parallel-display: allow to determine bus format from the connected panel

Message ID 1448023599-28918-1-git-send-email-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Philipp Zabel Nov. 20, 2015, 12:46 p.m. UTC
Similarly to commit 5e501ed7253b3 ("drm/imx: imx-ldb: allow to determine
bus format from the connected panel"), if a panel is connected to the ldb
output port via the of_graph bindings, the data mapping is determined from
the display_info.bus_format field provided by the panel instead of from the
optional interface_pix_fmt device tree property.

Reported-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/gpu/drm/imx/parallel-display.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Gary Bisson Nov. 23, 2015, 3:46 p.m. UTC | #1
Philipp, All,

On Fri, Nov 20, 2015 at 01:46:39PM +0100, Philipp Zabel wrote:
> Similarly to commit 5e501ed7253b3 ("drm/imx: imx-ldb: allow to determine
> bus format from the connected panel"), if a panel is connected to the ldb
> output port via the of_graph bindings, the data mapping is determined from
> the display_info.bus_format field provided by the panel instead of from the
> optional interface_pix_fmt device tree property.

Tested with a SabreLite + Okaya rs800480t LCD display on 4.4-rc1 kernel.

Tested-by: Gary Bisson <gary.bisson@boundarydevices.com>

One question though, do you want people to remove the interface_pix_fmt
property from the device trees to make it clear the interface depends on
the panel selected?

Regards,
Gary
Philipp Zabel Nov. 24, 2015, 10:30 a.m. UTC | #2
Hi Gary,

Am Montag, den 23.11.2015, 16:46 +0100 schrieb Gary Bisson:
> Tested with a SabreLite + Okaya rs800480t LCD display on 4.4-rc1 kernel.
> 
> Tested-by: Gary Bisson <gary.bisson@boundarydevices.com>

Thank you.

> One question though, do you want people to remove the interface_pix_fmt
> property from the device trees to make it clear the interface depends on
> the panel selected?

Yes, once this property is not needed anymore I'd prefer it to be
removed from the device tree.

The driver will keep supporting the property for backwards compatibility
and in case creative wiring causes the bus format to be different at the
panel and SoC ends of the bus.

regards
Philipp
diff mbox

Patch

diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index b4deb9c..2e9b9f1 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -54,7 +54,11 @@  static int imx_pd_connector_get_modes(struct drm_connector *connector)
 
 	if (imxpd->panel && imxpd->panel->funcs &&
 	    imxpd->panel->funcs->get_modes) {
+		struct drm_display_info *di = &connector->display_info;
+
 		num_modes = imxpd->panel->funcs->get_modes(imxpd->panel);
+		if (!imxpd->bus_format && di->num_bus_formats)
+			imxpd->bus_format = di->bus_formats[0];
 		if (num_modes > 0)
 			return num_modes;
 	}