diff options
-rw-r--r-- | arch/arm/plat-omap/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/dsscomp.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap_dsscomp.c | 56 | ||||
-rw-r--r-- | drivers/video/omap2/dsscomp/device.c | 10 | ||||
-rw-r--r-- | drivers/video/omap2/dsscomp/dsscomp.h | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dsscomp/gralloc.c | 15 |
6 files changed, 75 insertions, 13 deletions
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index 476d817..954ace3 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile @@ -34,3 +34,4 @@ obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o obj-$(CONFIG_OMAP_PM_NOOP) += omap-pm-interface.o obj-$(CONFIG_OMAP_PM) += omap-pm-interface.o omap-pm-helper.o +obj-$(CONFIG_DSSCOMP) += omap_dsscomp.o diff --git a/arch/arm/plat-omap/include/plat/dsscomp.h b/arch/arm/plat-omap/include/plat/dsscomp.h index 06c6ce6..55d93d8 100644 --- a/arch/arm/plat-omap/include/plat/dsscomp.h +++ b/arch/arm/plat-omap/include/plat/dsscomp.h @@ -4,6 +4,10 @@ #include <video/omapdss.h> #include <video/dsscomp.h> +struct dsscomp_platform_data { + unsigned int tiler1d_slotsz; +}; + /* queuing operations */ typedef struct dsscomp_data *dsscomp_t; /* handle */ diff --git a/arch/arm/plat-omap/omap_dsscomp.c b/arch/arm/plat-omap/omap_dsscomp.c new file mode 100644 index 0000000..418ea91 --- /dev/null +++ b/arch/arm/plat-omap/omap_dsscomp.c @@ -0,0 +1,56 @@ +/* + * File: arch/arm/plat-omap/omap_dsscomp.c + * + * dsscomp resources registration for TI OMAP platforms + * + * Copyright (C) 2012 Texas Instruments + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <linux/kernel.h> +#include <linux/mm.h> +#include <linux/init.h> +#include <linux/platform_device.h> +#include <plat/board.h> + +#include <video/dsscomp.h> +#include <plat/dsscomp.h> + +static struct dsscomp_platform_data dsscomp_config = { + .tiler1d_slotsz = SZ_32M, +}; + +static struct platform_device omap_dsscomp_device = { + .name = "dsscomp", + .id = -1, + .dev = { + .platform_data = &dsscomp_config, + }, + .num_resources = 0, +}; + +void dsscomp_set_platform_data(struct dsscomp_platform_data *data) +{ + dsscomp_config = *data; +} + +static int __init omap_init_dsscomp(void) +{ + return platform_device_register(&omap_dsscomp_device); +} + +arch_initcall(omap_init_dsscomp); + diff --git a/drivers/video/omap2/dsscomp/device.c b/drivers/video/omap2/dsscomp/device.c index 448b756..86f47b4 100644 --- a/drivers/video/omap2/dsscomp/device.c +++ b/drivers/video/omap2/dsscomp/device.c @@ -558,6 +558,7 @@ static int dsscomp_probe(struct platform_device *pdev) #endif } + cdev->pdev = &pdev->dev; platform_set_drvdata(pdev, cdev); pr_info("dsscomp: initializing.\n"); @@ -589,26 +590,17 @@ static struct platform_driver dsscomp_pdriver = { .driver = { .name = MODULE_NAME, .owner = THIS_MODULE } }; -static struct platform_device dsscomp_pdev = { - .name = MODULE_NAME, - .id = -1 -}; - static int __init dsscomp_init(void) { int err = platform_driver_register(&dsscomp_pdriver); if (err) return err; - err = platform_device_register(&dsscomp_pdev); - if (err) - platform_driver_unregister(&dsscomp_pdriver); return err; } static void __exit dsscomp_exit(void) { - platform_device_unregister(&dsscomp_pdev); platform_driver_unregister(&dsscomp_pdriver); } diff --git a/drivers/video/omap2/dsscomp/dsscomp.h b/drivers/video/omap2/dsscomp/dsscomp.h index 0bf0089..7b63cce 100644 --- a/drivers/video/omap2/dsscomp/dsscomp.h +++ b/drivers/video/omap2/dsscomp/dsscomp.h @@ -49,10 +49,12 @@ /** * DSS Composition Device Driver * + * @pdev: hook for platform device data * @dev: misc device base * @dbgfs: debugfs hook */ struct dsscomp_dev { + struct device *pdev; struct miscdevice dev; struct dentry *dbgfs; diff --git a/drivers/video/omap2/dsscomp/gralloc.c b/drivers/video/omap2/dsscomp/gralloc.c index 7dc8159..f3da23b 100644 --- a/drivers/video/omap2/dsscomp/gralloc.c +++ b/drivers/video/omap2/dsscomp/gralloc.c @@ -33,7 +33,6 @@ static bool blanked; #define NUM_TILER1D_SLOTS 2 -#define TILER1D_SLOT_SIZE (16 << 20) static struct tiler1d_slot { struct list_head q; @@ -67,6 +66,13 @@ static LIST_HEAD(flip_queue); static u32 ovl_use_mask[MAX_MANAGERS]; +static unsigned int tiler1d_slot_size(struct dsscomp_dev *cdev) +{ + struct dsscomp_platform_data *pdata; + pdata = (struct dsscomp_platform_data *)cdev->pdev->platform_data; + return pdata->tiler1d_slotsz; +} + static void unpin_tiler_blocks(struct list_head *slots) { struct tiler1d_slot *slot; @@ -432,7 +438,7 @@ skip_map1d: if (r) dev_err(DEV(cdev), "failed to pin %d pages into" " %d-pg slots (%d)\n", slot_used, - TILER1D_SLOT_SIZE >> PAGE_SHIFT, r); + tiler1d_slot_size(cdev) >> PAGE_SHIFT, r); } for (ch = 0; ch < MAX_MANAGERS; ch++) { @@ -609,14 +615,15 @@ void dsscomp_gralloc_init(struct dsscomp_dev *cdev_) u32 phys; tiler_blk_handle slot = tiler_alloc_block_area(TILFMT_PAGE, - TILER1D_SLOT_SIZE, 1, &phys, NULL); + tiler1d_slot_size(cdev_), 1, &phys, + NULL); if (IS_ERR_OR_NULL(slot)) { pr_err("could not allocate slot"); break; } slots[i].slot = slot; slots[i].phys = phys; - slots[i].size = TILER1D_SLOT_SIZE >> PAGE_SHIFT; + slots[i].size = tiler1d_slot_size(cdev_) >> PAGE_SHIFT; slots[i].page_map = vmalloc(sizeof(*slots[i].page_map) * slots[i].size); if (!slots[i].page_map) { |