aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-07-09 00:59:54 +0100
committerThomas White <taw@bitwiz.org.uk>2009-07-09 00:59:54 +0100
commit29a463f963afcd0da83dff2dfd9f0fdc2720dc35 (patch)
tree81d68b673971af5a1a36bcbeedcb946ac14f6564 /drivers/mfd
parent848ba5dcf46955be02a5ec249a7caacf0615fa79 (diff)
Expose more memory via glamo-kms-fb
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/glamo/glamo-drm-private.h5
-rw-r--r--drivers/mfd/glamo/glamo-kms-fb.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/mfd/glamo/glamo-drm-private.h b/drivers/mfd/glamo/glamo-drm-private.h
index b7a9932e6ca..59030cb2313 100644
--- a/drivers/mfd/glamo/glamo-drm-private.h
+++ b/drivers/mfd/glamo/glamo-drm-private.h
@@ -33,6 +33,11 @@
#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 */
diff --git a/drivers/mfd/glamo/glamo-kms-fb.c b/drivers/mfd/glamo/glamo-kms-fb.c
index b0d46b39a29..4a153fc4857 100644
--- a/drivers/mfd/glamo/glamo-kms-fb.c
+++ b/drivers/mfd/glamo/glamo-kms-fb.c
@@ -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;