[PATCHv16 0/7] of: add display helper

Marek Vasut marex at denx.de
Thu Jan 10 06:12:01 EST 2013


Dear Steffen Trumtrar,

> Hi!
> 
> Finally, right in time before the end of the world on friday, v16 of the
> display helpers.

I tested this on 3.8-rc1 (next 20130103) with the imx drm driver. After adding 
the following piece of code (quick hack), this works just fine. Thanks!

diff --git a/drivers/staging/imx-drm/parallel-display.c b/drivers/staging/imx-
drm/parallel-display.c
index a8064fc..e45002a 100644
--- a/drivers/staging/imx-drm/parallel-display.c
+++ b/drivers/staging/imx-drm/parallel-display.c
@@ -57,6 +57,7 @@ static void imx_pd_connector_destroy(struct drm_connector 
*connector)
 static int imx_pd_connector_get_modes(struct drm_connector *connector)
 {
        struct imx_parallel_display *imxpd = con_to_imxpd(connector);
+       struct device_node *np = imxpd->dev->of_node;
        int num_modes = 0;
 
        if (imxpd->edid) {
@@ -72,6 +73,15 @@ static int imx_pd_connector_get_modes(struct drm_connector 
*connector)
                num_modes++;
        }
 
+       if (np) {
+               struct drm_display_mode *mode = drm_mode_create(connector->dev);
+               of_get_drm_display_mode(np, &imxpd->mode, 0);
+               drm_mode_copy(mode, &imxpd->mode);
+               mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
+               drm_mode_probed_add(connector, mode);
+               num_modes++;
+       }
+
        return num_modes;
 }

Best regards,
Marek Vasut


More information about the devicetree-discuss mailing list