diff options
author | Thomas White <taw@bitwiz.org.uk> | 2009-07-29 00:36:55 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2009-07-29 00:36:55 +0100 |
commit | 694fdde90e4705c70b5daf8bbc275137b47340b6 (patch) | |
tree | cdce53457b164fd3f53373a7f284c8db118337e2 | |
parent | b4123b2bbf6c35c51af2ab00c1099c53b9bf08b6 (diff) |
Implement glamo_crtc_mode_set_base()
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
-rw-r--r-- | drivers/mfd/glamo/glamo-display.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/mfd/glamo/glamo-display.c b/drivers/mfd/glamo/glamo-display.c index 3fee800daa9..5e0e9434146 100644 --- a/drivers/mfd/glamo/glamo-display.c +++ b/drivers/mfd/glamo/glamo-display.c @@ -371,7 +371,37 @@ static void glamo_crtc_mode_set(struct drm_crtc *crtc, static void glamo_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { + struct glamodrm_handle *gdrm; + struct glamo_crtc *gcrtc; + struct glamo_framebuffer *gfb; + struct drm_gem_object *obj; + struct drm_glamo_gem_object *gobj; + u32 addr; + u16 addr_low, addr_high; + printk(KERN_CRIT "glamo_crtc_mode_set_base\n"); + + if (!crtc->fb) { + DRM_DEBUG("No FB bound\n"); + return; + } + + /* Dig out our handle */ + gcrtc = to_glamo_crtc(crtc); + gdrm = gcrtc->gdrm; /* Here it is! */ + + gfb = to_glamo_framebuffer(crtc->fb); + obj = gfb->obj; + gobj = obj->driver_private; + + addr = GLAMO_OFFSET_FB + gobj->block->start; + addr_low = addr & 0xffff; + addr_high = (addr >> 16) & 0x7f; + + glamo_lcd_cmd_mode(gdrm, 1); + reg_write_lcd(gdrm, GLAMO_REG_LCD_A_BASE1, addr_low); + reg_write_lcd(gdrm, GLAMO_REG_LCD_A_BASE2, addr_high); + glamo_lcd_cmd_mode(gdrm, 0); } |