diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-05-06 05:40:15 -0700 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2010-05-22 19:01:20 +0200 |
commit | 752dfe99a5e2b361f740f2f986de93f5682b1a8d (patch) | |
tree | 044e461556094c6cbea553b68a673eeacf153ffb | |
parent | 9cd5001fc2f4c817d5614b1ee5445d69af05d483 (diff) |
Fix dynamic command queue allocation
(Not tested...)
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
-rw-r--r-- | drivers/mfd/glamo/glamo-cmdq.c | 10 | ||||
-rw-r--r-- | drivers/mfd/glamo/glamo-cmdq.h | 2 | ||||
-rw-r--r-- | drivers/mfd/glamo/glamo-drm-drv.c | 17 |
3 files changed, 15 insertions, 14 deletions
diff --git a/drivers/mfd/glamo/glamo-cmdq.c b/drivers/mfd/glamo/glamo-cmdq.c index 442963cc876..28c52680398 100644 --- a/drivers/mfd/glamo/glamo-cmdq.c +++ b/drivers/mfd/glamo/glamo-cmdq.c @@ -57,6 +57,7 @@ #include "glamo-core.h" #include "glamo-drm-private.h" #include "glamo-regs.h" +#include "glamo-buffer.h" #define GLAMO_CMDQ_SIZE (128 * 1024) /* 128k ring buffer */ @@ -495,10 +496,11 @@ int glamo_cmdq_setup(struct glamodrm_handle *gdrm) } -int glamo_cmdq_init(struct glamodrm_handle *gdrm) +int glamo_cmdq_init(struct drm_device *dev) { struct drm_gem_object *obj; struct drm_glamo_gem_object *gobj; + struct glamodrm_handle *gdrm = dev->dev_private; int ret = 0; obj = glamo_gem_object_alloc(dev, GLAMO_CMDQ_SIZE, 4); @@ -507,9 +509,10 @@ int glamo_cmdq_init(struct glamodrm_handle *gdrm) ret = -ENOMEM; goto out; } - gobj = fbo->driver_private; + gobj = obj->driver_private; gdrm->cmdq_offs = GLAMO_OFFSET_FB + gobj->block->start; - gdrm->cmdq_base = ioremap(gdrm->vram->start + offs, GLAMO_CMDQ_SIZE); + gdrm->cmdq_base = ioremap(gdrm->vram->start + gdrm->cmdq_offs, + GLAMO_CMDQ_SIZE); /* Set up registers */ glamo_cmdq_setup(gdrm); @@ -521,6 +524,7 @@ out: int glamo_cmdq_shutdown(struct glamodrm_handle *gdrm) { + iounmap(gdrm->cmdq_base); return 0; } diff --git a/drivers/mfd/glamo/glamo-cmdq.h b/drivers/mfd/glamo/glamo-cmdq.h index 510d1954c64..6d7f184b92f 100644 --- a/drivers/mfd/glamo/glamo-cmdq.h +++ b/drivers/mfd/glamo/glamo-cmdq.h @@ -38,7 +38,7 @@ extern int glamo_ioctl_cmdburst(struct drm_device *dev, void *data, extern void glamo_cmdq_blank(struct glamodrm_handle *gdrm, struct drm_gem_object *obj); -extern int glamo_cmdq_init(struct glamodrm_handle *gdrm); +extern int glamo_cmdq_init(struct drm_device *de); extern int glamo_cmdq_shutdown(struct glamodrm_handle *gdrm); extern void glamo_cmdq_suspend(struct glamodrm_handle *gdrm); extern void glamo_cmdq_resume(struct glamodrm_handle *gdrm); diff --git a/drivers/mfd/glamo/glamo-drm-drv.c b/drivers/mfd/glamo/glamo-drm-drv.c index 774eaff867f..ee648c13ac1 100644 --- a/drivers/mfd/glamo/glamo-drm-drv.c +++ b/drivers/mfd/glamo/glamo-drm-drv.c @@ -128,7 +128,7 @@ static int glamodrm_load(struct drm_device *dev, unsigned long flags) gdrm = dev->dev_private; glamo_buffer_init(gdrm); - glamo_cmdq_init(gdrm); + glamo_cmdq_init(dev); glamo_fence_init(gdrm); glamo_display_init(dev); @@ -237,14 +237,14 @@ static int glamodrm_probe(struct platform_device *pdev) if ( !gdrm->vram ) { dev_err(&pdev->dev, "Unable to find VRAM.\n"); rc = -ENOENT; - goto out_unmap_cmdq; + goto out_unmap_regs; } gdrm->vram = request_mem_region(gdrm->vram->start, resource_size(gdrm->vram), pdev->name); if ( !gdrm->vram ) { dev_err(&pdev->dev, "failed to request VRAM region\n"); rc = -ENOENT; - goto out_unmap_cmdq; + goto out_unmap_regs; } /* Find the LCD controller */ @@ -316,10 +316,6 @@ out_release_lcd: resource_size(gdrm->lcd_regs)); out_release_vram: release_mem_region(gdrm->vram->start, resource_size(gdrm->vram)); -out_unmap_cmdq: - iounmap(gdrm->cmdq_base); -out_release_cmdq: - release_mem_region(gdrm->cmdq->start, resource_size(gdrm->cmdq)); out_unmap_regs: iounmap(gdrm->reg_base); out_release_regs: @@ -349,9 +345,10 @@ static int glamodrm_remove(struct platform_device *pdev) /* Release VRAM */ release_mem_region(gdrm->vram->start, resource_size(gdrm->vram)); - /* Release command queue */ - iounmap(gdrm->cmdq_base); - release_mem_region(gdrm->cmdq->start, resource_size(gdrm->cmdq)); + /* Release LCD registers */ + iounmap(gdrm->lcd_base); + release_mem_region(gdrm->lcd_regs->start, + resource_size(gdrm->lcd_regs)); /* Release 2D engine */ iounmap(gdrm->twod_base); |