diff options
Diffstat (limited to 'recipes/linux/linux-openmoko-2.6.32/0012-Report-all-FB-modes-given-by-the-lower-levels.patch')
-rw-r--r-- | recipes/linux/linux-openmoko-2.6.32/0012-Report-all-FB-modes-given-by-the-lower-levels.patch | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/recipes/linux/linux-openmoko-2.6.32/0012-Report-all-FB-modes-given-by-the-lower-levels.patch b/recipes/linux/linux-openmoko-2.6.32/0012-Report-all-FB-modes-given-by-the-lower-levels.patch new file mode 100644 index 0000000000..ac19dbd5d2 --- /dev/null +++ b/recipes/linux/linux-openmoko-2.6.32/0012-Report-all-FB-modes-given-by-the-lower-levels.patch @@ -0,0 +1,102 @@ +From f8448d2b08c1e2cfd0faba0e3f3c4c58e4ecaa9f Mon Sep 17 00:00:00 2001 +From: Thomas White <taw@bitwiz.org.uk> +Date: Mon, 1 Mar 2010 22:02:26 +0100 +Subject: [PATCH 12/13] Report all FB modes given by the lower levels + +Signed-off-by: Thomas White <taw@bitwiz.org.uk> +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + drivers/mfd/glamo/glamo-display.c | 70 +++++++++++++++++++++---------------- + 1 files changed, 40 insertions(+), 30 deletions(-) + +diff --git a/drivers/mfd/glamo/glamo-display.c b/drivers/mfd/glamo/glamo-display.c +index a384c8b..bc3a2ea 100644 +--- a/drivers/mfd/glamo/glamo-display.c ++++ b/drivers/mfd/glamo/glamo-display.c +@@ -456,43 +456,53 @@ static void glamo_connector_destroy(struct drm_connector *connector) + + static int glamo_connector_get_modes(struct drm_connector *connector) + { +- struct drm_display_mode *mode; + struct glamo_fb_platform_data *fb_info; + struct glamo_output *goutput = to_glamo_output(connector); + struct glamodrm_handle *gdrm = goutput->gdrm; ++ int i; + + /* Dig out the record which will tell us about the hardware */ + fb_info = gdrm->glamo_core->pdata->fb_data; + +- mode = drm_mode_create(connector->dev); +- if (!mode) +- return 0; +- /* Fill in 'mode' here */ +- mode->type = DRM_MODE_TYPE_DEFAULT | DRM_MODE_TYPE_PREFERRED; +- +- /* Convert framebuffer timings into KMS timings */ +- mode->clock = 1000000000UL / fb_info->modes[0].pixclock; /* ps -> kHz */ +- mode->clock *= 1000; /* kHz -> Hz */ +- mode->hdisplay = fb_info->modes[0].xres; +- mode->hsync_start = fb_info->modes[0].right_margin + mode->hdisplay; +- mode->hsync_end = mode->hsync_start + fb_info->modes[0].hsync_len; +- mode->htotal = mode->hsync_end + fb_info->modes[0].left_margin; +- mode->hskew = 0; +- +- mode->vdisplay = fb_info->modes[0].yres; +- mode->vsync_start = fb_info->modes[0].lower_margin + mode->vdisplay; +- mode->vsync_end = mode->vsync_start + fb_info->modes[0].vsync_len; +- mode->vtotal = mode->vsync_end + fb_info->modes[0].upper_margin; +- mode->vscan = 0; +- +- /* Physical size */ +- mode->width_mm = fb_info->width; +- mode->height_mm = fb_info->height; +- +- drm_mode_set_name(mode); +- drm_mode_probed_add(connector, mode); +- +- return 1; /* one mode, for now */ ++ for ( i=0; i<fb_info->num_modes; i++ ) { ++ ++ struct drm_display_mode *mode; ++ ++ mode = drm_mode_create(connector->dev); ++ if ( !mode ) continue; ++ ++ mode->type = DRM_MODE_TYPE_DEFAULT | DRM_MODE_TYPE_PREFERRED; ++ ++ /* Convert framebuffer timings into KMS timings. ++ * First: ps -> kHz */ ++ mode->clock = 1000000000UL / fb_info->modes[i].pixclock; ++ mode->clock *= 1000; /* then kHz -> Hz */ ++ mode->hdisplay = fb_info->modes[i].xres; ++ mode->hsync_start = fb_info->modes[i].right_margin ++ + mode->hdisplay; ++ mode->hsync_end = mode->hsync_start ++ + fb_info->modes[i].hsync_len; ++ mode->htotal = mode->hsync_end + fb_info->modes[i].left_margin; ++ mode->hskew = 0; ++ ++ mode->vdisplay = fb_info->modes[i].yres; ++ mode->vsync_start = fb_info->modes[i].lower_margin ++ + mode->vdisplay; ++ mode->vsync_end = mode->vsync_start ++ + fb_info->modes[i].vsync_len; ++ mode->vtotal = mode->vsync_end + fb_info->modes[i].upper_margin; ++ mode->vscan = 0; ++ ++ /* Physical size */ ++ mode->width_mm = fb_info->width; ++ mode->height_mm = fb_info->height; ++ ++ drm_mode_set_name(mode); ++ drm_mode_probed_add(connector, mode); ++ ++ } ++ ++ return fb_info->num_modes; + } + + +-- +1.7.0 + |