diff options
author | David Sin <davidsin@ti.com> | 2012-04-11 15:18:26 -0700 |
---|---|---|
committer | Dmytro Kedrovskyi <x0169235@ti.com> | 2012-05-03 16:35:20 +0300 |
commit | ca2dffc5209144a55fe205a8b73204da2b6fb120 (patch) | |
tree | ba78cdfa69cf613e8186654893f49545375e254e | |
parent | 23bbad0f173dec4fee3497089e3f53a98cd16b64 (diff) | |
download | kernel_samsung_espresso10-ca2dffc5209144a55fe205a8b73204da2b6fb120.zip kernel_samsung_espresso10-ca2dffc5209144a55fe205a8b73204da2b6fb120.tar.gz kernel_samsung_espresso10-ca2dffc5209144a55fe205a8b73204da2b6fb120.tar.bz2 |
gcx: driver cleanup.
Remove unused flush pages function.
Replace hardcoded irq value with proper method.
Remove hardcoded 2d base address & direct allocation.
Change-Id: I79c1089db935bfddc17e85f761113e3f709738b6
Signed-off-by: David Sin <davidsin@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/omap_gcxxx.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_gcx.h | 1 | ||||
-rw-r--r-- | drivers/misc/gcx/gccore/gccmdbuf.c | 2 | ||||
-rw-r--r-- | drivers/misc/gcx/gccore/gcmain.c | 92 | ||||
-rw-r--r-- | drivers/misc/gcx/gccore/gcmain.h | 1 | ||||
-rw-r--r-- | drivers/misc/gcx/gccore/gcmmu.c | 8 |
6 files changed, 26 insertions, 79 deletions
diff --git a/arch/arm/mach-omap2/omap_gcxxx.c b/arch/arm/mach-omap2/omap_gcxxx.c index c536660..8a4b317 100644 --- a/arch/arm/mach-omap2/omap_gcxxx.c +++ b/arch/arm/mach-omap2/omap_gcxxx.c @@ -70,6 +70,7 @@ int __init gcxxx_init(void) if (oh == NULL) return -EINVAL; + omap_gcxxx.regbase = omap_hwmod_get_mpu_rt_va(oh); od = omap_device_build(dev_name, 0, oh, &omap_gcxxx, sizeof(omap_gcxxx), omap_gcxxx_latency, ARRAY_SIZE(omap_gcxxx_latency), false); diff --git a/arch/arm/plat-omap/include/plat/omap_gcx.h b/arch/arm/plat-omap/include/plat/omap_gcx.h index fde0f16..2547689 100644 --- a/arch/arm/plat-omap/include/plat/omap_gcx.h +++ b/arch/arm/plat-omap/include/plat/omap_gcx.h @@ -20,6 +20,7 @@ #define OMAP_GCX_H struct omap_gcx_platform_data { + void *regbase; u32 (*prcm_bb2d_idlest)(void); }; diff --git a/drivers/misc/gcx/gccore/gccmdbuf.c b/drivers/misc/gcx/gccore/gccmdbuf.c index bd335ed..1fb6b38 100644 --- a/drivers/misc/gcx/gccore/gccmdbuf.c +++ b/drivers/misc/gcx/gccore/gccmdbuf.c @@ -262,8 +262,6 @@ int cmdbuf_flush(void *logical) GCDUMPBUFFER(GCDBGFILTER, GCZONE_BUFFER, cmdbuf.page.logical, base, cmdbuf.data_size); - gc_flush_pages(&cmdbuf.page); - /* Enable all events. */ gc_write_reg(GCREG_INTR_ENBL_Address, ~0U); diff --git a/drivers/misc/gcx/gccore/gcmain.c b/drivers/misc/gcx/gccore/gcmain.c index 321e832..cb9ce37 100644 --- a/drivers/misc/gcx/gccore/gcmain.c +++ b/drivers/misc/gcx/gccore/gcmain.c @@ -46,9 +46,6 @@ #include "gcmmu.h" #include <linux/gcdebug.h> -#define DEVICE_INT (32 + 125) -#define DEVICE_REG_BASE 0x59000000 -#define DEVICE_REG_SIZE (32 * 1024) #define GC_POLL_PRCM_STBY 100 /* Driver context structure. */ @@ -63,6 +60,7 @@ struct gccore { static struct gccore gcdevice; static bool g_irqinstalled; +static unsigned int gcirq; static struct mutex mtx; static struct dentry *g_debugRoot; @@ -379,29 +377,6 @@ void gc_free_pages(struct gcpage *p) p->size = 0; } -void gc_flush_pages(struct gcpage *p) -{ - GCPRINT(GCDBGFILTER, GCZONE_PAGE, GC_MOD_PREFIX - "container = 0x%08X\n", - __func__, __LINE__, (unsigned int) p); - - GCPRINT(GCDBGFILTER, GCZONE_PAGE, GC_MOD_PREFIX - "page array=0x%08X\n", - __func__, __LINE__, (unsigned int) p->pages); - - GCPRINT(GCDBGFILTER, GCZONE_PAGE, GC_MOD_PREFIX - "logical=0x%08X\n", - __func__, __LINE__, (unsigned int) p->logical); - - GCPRINT(GCDBGFILTER, GCZONE_PAGE, GC_MOD_PREFIX - "physical=0x%08X\n", - __func__, __LINE__, (unsigned int) p->physical); - - GCPRINT(GCDBGFILTER, GCZONE_PAGE, GC_MOD_PREFIX - "size=%d\n", - __func__, __LINE__, p->size); -} - /******************************************************************************* * Interrupt handling. */ @@ -676,7 +651,7 @@ enum gcerror gc_set_power(enum gcpower gcpower) gcpwr_disable_pulse_skipping(g_gcpower); if (!g_irqenabled) { - enable_irq(DEVICE_INT); + enable_irq(gcirq); g_irqenabled = true; } break; @@ -688,7 +663,7 @@ enum gcerror gc_set_power(enum gcpower gcpower) case GCPWR_OFF: gcpwr_disable_clock(g_gcpower); if (g_irqenabled) { - disable_irq(DEVICE_INT); + disable_irq(gcirq); g_irqenabled = false; } break; @@ -975,7 +950,27 @@ EXPORT_SYMBOL(gc_unmap); static int gc_probe(struct platform_device *pdev) { + int ret; + g_gcxplat = (struct omap_gcx_platform_data *)pdev->dev.platform_data; + g_reg_base = g_gcxplat->regbase; + gcirq = platform_get_irq(pdev, pdev->id); + + ret = request_irq(gcirq, gc_irq, IRQF_SHARED, + GC_DEV_NAME, &gcdevice); + if (ret < 0) { + GCPRINT(NULL, 0, GC_MOD_PREFIX + "failed to install IRQ (%d).\n", + __func__, __LINE__, ret); + return -ENODEV; + } + + g_irqinstalled = true; + + /* Disable IRQ. */ + disable_irq(gcirq); + g_irqenabled = false; + return 0; } @@ -1049,8 +1044,6 @@ static struct early_suspend early_suspend_info = { static int __init gc_init(void) { - int ret; - /* check if hardware is available */ if (!cpu_is_omap447x()) return 0; @@ -1081,31 +1074,6 @@ static int __init gc_init(void) goto fail; } - /* Map GPU registers. */ - g_reg_base = ioremap_nocache(DEVICE_REG_BASE, DEVICE_REG_SIZE); - if (g_reg_base == NULL) { - GCPRINT(NULL, 0, GC_MOD_PREFIX - "failed to map registers.\n", - __func__, __LINE__); - goto fail; - } - - /* Install IRQ. */ - ret = request_irq(DEVICE_INT, gc_irq, IRQF_SHARED, - GC_DEV_NAME, &gcdevice); - if (ret < 0) { - GCPRINT(NULL, 0, GC_MOD_PREFIX - "failed to install IRQ (%d).\n", - __func__, __LINE__, ret); - goto fail; - } - - g_irqinstalled = true; - - /* Disable IRQ. */ - disable_irq(DEVICE_INT); - g_irqenabled = false; - /* Initialize the command buffer. */ if (cmdbuf_init() != GCERR_NONE) { GCPRINT(NULL, 0, GC_MOD_PREFIX @@ -1127,13 +1095,6 @@ static int __init gc_init(void) return platform_driver_register(&plat_drv); fail: - if (g_irqinstalled) - free_irq(DEVICE_INT, &gcdevice); - - if (g_reg_base != NULL) { - iounmap(g_reg_base); - g_reg_base = NULL; - } if (g_bb2d_clk) clk_put(g_bb2d_clk); @@ -1154,11 +1115,6 @@ static void __exit gc_exit(void) mutex_destroy(&g_maplock); gc_set_power(GCPWR_OFF); - if (g_reg_base != NULL) { - iounmap(g_reg_base); - g_reg_base = NULL; - } - if (g_bb2d_clk) clk_put(g_bb2d_clk); @@ -1168,7 +1124,7 @@ static void __exit gc_exit(void) mutex_destroy(&mtx); if (g_irqinstalled) - free_irq(DEVICE_INT, &gcdevice); + free_irq(gcirq, &gcdevice); } MODULE_LICENSE("GPL v2"); diff --git a/drivers/misc/gcx/gccore/gcmain.h b/drivers/misc/gcx/gccore/gcmain.h index c09b16a..947cbb1 100644 --- a/drivers/misc/gcx/gccore/gcmain.h +++ b/drivers/misc/gcx/gccore/gcmain.h @@ -40,7 +40,6 @@ struct gcpage { enum gcerror gc_alloc_pages(struct gcpage *p, unsigned int size); void gc_free_pages(struct gcpage *p); -void gc_flush_pages(struct gcpage *p); /* * Power management. diff --git a/drivers/misc/gcx/gccore/gcmmu.c b/drivers/misc/gcx/gccore/gcmmu.c index 9abcf50..808697c 100644 --- a/drivers/misc/gcx/gccore/gcmmu.c +++ b/drivers/misc/gcx/gccore/gcmmu.c @@ -369,8 +369,6 @@ static void flush_user_buffer(struct mmu2darena *arena) __func__, __LINE__, i); continue; } - - gc_flush_pages(&gcpage); } } #endif @@ -736,18 +734,12 @@ enum gcerror mmu2d_map(struct mmu2dcontext *ctxt, struct mmu2dphysmem *mem, parray += 1; } - - gc_flush_pages(&stlb_array[i]->pages); #endif count -= available; stlb_idx = next_idx; } -#if MMU_ENABLE - gc_flush_pages(&ctxt->master); -#endif - /* * Claim arena. */ |