Expose more memory via glamo-kms-fb
authorThomas White <taw@bitwiz.org.uk>
Wed, 8 Jul 2009 23:59:54 +0000 (00:59 +0100)
committerThomas White <taw@bitwiz.org.uk>
Wed, 8 Jul 2009 23:59:54 +0000 (00:59 +0100)
This increases the amount of memory exposed via the framebuffer.
This should eventually allow an fbdev-based DDX or a KMS DDX to
run on the same kernel, albeit suboptimally.

Signed-off-by: Thomas White <taw@bitwiz.org.uk>
drivers/mfd/glamo/glamo-drm-private.h
drivers/mfd/glamo/glamo-kms-fb.c

index b7a9932..59030cb 100644 (file)
 #include "glamo-core.h"
 
 
+/* Memory to allocate for the framebuffer.
+ * The rest is reserved for the DRM memory manager */
+#define GLAMO_FRAMEBUFFER_ALLOCATION (4*1024*1024)
+
+
 struct glamodrm_handle {
 
        /* This device */
index b0d46b3..4a153fc 100644 (file)
@@ -396,7 +396,12 @@ int glamofb_create(struct drm_device *dev, uint32_t fb_width,
 
        size = mode_cmd.pitch * mode_cmd.height;
        size = ALIGN(size, PAGE_SIZE);
-       fbo = glamo_gem_object_alloc(dev, size, 2);
+       if ( size > GLAMO_FRAMEBUFFER_ALLOCATION ) {
+               printk(KERN_ERR "[glamo-drm] Not enough memory for fb\n");
+               ret = -ENOMEM;
+               goto out;
+       }
+       fbo = glamo_gem_object_alloc(dev, GLAMO_FRAMEBUFFER_ALLOCATION, 2);
        if (!fbo) {
                printk(KERN_ERR "[glamo-drm] Failed to allocate framebuffer\n");
                ret = -ENOMEM;