From 22a1cc6ef8c82c485136be49eeca90777e8ac85c Mon Sep 17 00:00:00 2001 From: Jorge Zapata Date: Thu, 19 Feb 2009 16:42:54 +0100 Subject: Import part of Thomas White DRM tree: Handle new memory layout. The "not-needed" memory should not be taken by the framebuffer driver. Use that for the DRM driver. Add the cmdq platform device Set aside 4k for hardware cursor, reject cursors that don't fit. --- drivers/mfd/glamo/glamo-fb.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/mfd/glamo/glamo-fb.c') diff --git a/drivers/mfd/glamo/glamo-fb.c b/drivers/mfd/glamo/glamo-fb.c index 4eb81a508e5..77725a370e9 100644 --- a/drivers/mfd/glamo/glamo-fb.c +++ b/drivers/mfd/glamo/glamo-fb.c @@ -595,6 +595,12 @@ static int glamofb_cursor(struct fb_info *info, struct fb_cursor *cursor) struct glamofb_handle *glamo = info->par; unsigned long flags; + /* Reject if the cursor is too big to fit in the memory allocated in + * glamo-core.h */ + + if ((cursor->image.width * cursor->image.height) > GLAMO_CURSOR_SIZE ) + return -EINVAL; + spin_lock_irqsave(&glamo->lock_cmd, flags); reg_write(glamo, GLAMO_REG_LCD_CURSOR_X_SIZE, @@ -847,6 +853,8 @@ static int __init glamofb_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to request mmio region\n"); goto out_free; } + if (mach_info->fb_mem_size != RESSIZE(glamofb->fb_res)) + dev_warn(&pdev->dev, "different vram sizes\n"); glamofb->fb_res = request_mem_region(glamofb->fb_res->start, mach_info->fb_mem_size, -- cgit v1.2.3