diff options
author | Thomas White <taw@bitwiz.org.uk> | 2009-06-28 22:14:17 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2009-06-28 22:14:17 +0100 |
commit | ee66b72542a996ee8f161221713125ef93f8e105 (patch) | |
tree | 87dbcb62f62b3f8291b6ea4ac663942254d7f4e8 | |
parent | bfdf7016e915a89f381d6d8da342ad974681736e (diff) |
KMS bits and pieces
This adds some missing bits and pieces to make most of the KMS
initialisation flow work.`
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
-rw-r--r-- | drivers/mfd/glamo/glamo-display.c | 23 | ||||
-rw-r--r-- | drivers/mfd/glamo/glamo-kms-fb.c | 5 |
2 files changed, 21 insertions, 7 deletions
diff --git a/drivers/mfd/glamo/glamo-display.c b/drivers/mfd/glamo/glamo-display.c index 2110e19732d..debcd0706f9 100644 --- a/drivers/mfd/glamo/glamo-display.c +++ b/drivers/mfd/glamo/glamo-display.c @@ -297,8 +297,17 @@ static void glamo_connector_destroy(struct drm_connector *connector) static int glamo_connector_get_modes(struct drm_connector *connector) { + struct drm_display_mode *mode; printk(KERN_CRIT "glamo_connector_get_modes\n"); - return false; + + mode = drm_mode_create(connector->dev); + if (!mode) + return 0; + /* Fill in 'mode' here */ + mode->type = DRM_MODE_TYPE_DEFAULT | DRM_MODE_TYPE_PREFERRED; + drm_mode_probed_add(connector, mode); + + return 1; /* one mode, for now */ } @@ -315,11 +324,12 @@ static int glamo_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { printk(KERN_CRIT "glamo_connector_mode_valid\n"); - if (mode->flags & DRM_MODE_FLAG_DBLSCAN) + if (mode->flags & DRM_MODE_FLAG_DBLSCAN) { + printk(KERN_CRIT "Doublescan is not allowed\n"); return MODE_NO_DBLESCAN; - - if (mode->clock > 400000 || mode->clock < 25000) - return MODE_CLOCK_RANGE; + } + + printk(KERN_CRIT "Ok!\n"); return MODE_OK; } @@ -606,6 +616,7 @@ int glamo_display_init(struct drm_device *dev) /* Initialise the encoder */ drm_encoder_init(dev, &glamo_output->enc, &glamo_encoder_funcs, DRM_MODE_ENCODER_DAC); + glamo_output->enc.possible_crtcs = 1 << 0; drm_mode_connector_attach_encoder(&glamo_output->base, &glamo_output->enc); @@ -633,7 +644,7 @@ int glamo_display_init(struct drm_device *dev) modeset->fb = &glamo_fb->base; modeset->connectors[0] = connector; - //par->crtc_ids[0] = glamo_crtc->base.id; + par->crtc_ids[0] = glamo_crtc->base.base.id; modeset->num_connectors = 1; modeset->mode = modeset->crtc->desired_mode; diff --git a/drivers/mfd/glamo/glamo-kms-fb.c b/drivers/mfd/glamo/glamo-kms-fb.c index 2ae361c5604..918b5febfee 100644 --- a/drivers/mfd/glamo/glamo-kms-fb.c +++ b/drivers/mfd/glamo/glamo-kms-fb.c @@ -148,7 +148,8 @@ static int glamofb_check_var(struct fb_var_screeninfo *var, /* Need to resize the fb object !!! */ if (var->xres > fb->width || var->yres > fb->height) { - DRM_ERROR("Requested width/height is greater than current fb object %dx%d > %dx%d\n",var->xres,var->yres,fb->width,fb->height); + DRM_ERROR("Cannot resize framebuffer object (%dx%d > %dx%d)\n", + var->xres,var->yres,fb->width,fb->height); DRM_ERROR("Need resizing code.\n"); return -EINVAL; } @@ -192,6 +193,8 @@ static int glamofb_set_par(struct fb_info *info) struct fb_var_screeninfo *var = &info->var; int i; + printk(KERN_CRIT "glamofb_set_par\n"); + DRM_DEBUG("%d %d\n", var->xres, var->pixclock); if (var->pixclock != -1) { |