aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/glamo/glamo-cmdq.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2009-08-22 17:25:31 +0100
committerThomas White <taw@bitwiz.org.uk>2009-08-22 17:25:31 +0100
commitc2c4dbb6513bd938f5009e7b6293782dea37887d (patch)
treea5664e699b19983852b8fcfc45f841e74fa6a371 /drivers/mfd/glamo/glamo-cmdq.c
parentb7629bbd863a3de9c7d8c2e699437d517bbd6f1d (diff)
Zero VRAM before passing to userspace
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
Diffstat (limited to 'drivers/mfd/glamo/glamo-cmdq.c')
-rw-r--r--drivers/mfd/glamo/glamo-cmdq.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mfd/glamo/glamo-cmdq.c b/drivers/mfd/glamo/glamo-cmdq.c
index 6f14244af11..a96adc3cbd2 100644
--- a/drivers/mfd/glamo/glamo-cmdq.c
+++ b/drivers/mfd/glamo/glamo-cmdq.c
@@ -440,3 +440,21 @@ void glamo_cmdq_resume(struct glamodrm_handle *gdrm)
{
glamo_cmdq_init(gdrm);
}
+
+
+/* Initialise an object's contents to zero.
+ * This is in glamo-cmdq.c in the hope that we can accelerate it later. */
+void glamo_cmdq_blank(struct glamodrm_handle *gdrm, struct drm_gem_object *obj)
+{
+ char __iomem *cookie;
+ struct drm_glamo_gem_object *gobj;
+ int i;
+
+ gobj = obj->driver_private;
+
+ cookie = ioremap(gdrm->vram->start + gobj->block->start, obj->size);
+ for ( i=0; i<obj->size; i+=2 ) {
+ iowrite16(0, cookie+i);
+ }
+ iounmap(cookie);
+}