diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-12-13 16:30:56 +0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-12-13 16:30:56 +0400 |
commit | e7f5c9a16ea2648a3e85af8e34191026bf3dcb62 (patch) | |
tree | ad79eb6b57058e69013408d8ae4267ea06536ca6 /drivers/media | |
parent | a240af2eb24679f4d27d87281b25faee0a25df1a (diff) | |
parent | bd0f5cc3641cb76ae8fa2cc4924c29da157f8b2d (diff) | |
download | linux-e7f5c9a16ea2648a3e85af8e34191026bf3dcb62.tar.xz |
Merge tag 'omapdss-for-3.8' of git://gitorious.org/linux-omap-dss2/linux into for-linus
OMAPDSS changes for 3.8, including:
- use dynanic debug prints
- OMAP platform dependency removals
- Creation of compat-layer, helping us to improve omapdrm
- Misc cleanups, aiming to make omadss more in line with the upcoming common
display framework
* tag 'omapdss-for-3.8' of git://gitorious.org/linux-omap-dss2/linux: (140 commits)
OMAPDSS: fix TV-out issue with DSI PLL
Revert "OMAPFB: simplify locking"
OMAPFB: remove silly loop in fb2display()
OMAPFB: fix error handling in omapfb_find_best_mode()
OMAPFB: use devm_kzalloc to allocate omapfb2_device
OMAPDSS: DISPC: remove dispc fck uses
OMAPDSS: DISPC: get dss clock rate from dss driver
OMAPDSS: use omapdss_compat_init() in other drivers
OMAPDSS: export dispc functions
OMAPDSS: export dss_feat functions
OMAPDSS: export dss_mgr_ops functions
OMAPDSS: separate compat files in the Makefile
OMAPDSS: move display sysfs init to compat layer
OMAPDSS: DPI: use dispc's check_timings
OMAPDSS: DISPC: add dispc_ovl_check()
OMAPDSS: move irq handling to dispc-compat
OMAPDSS: move omap_dispc_wait_for_irq_interruptible_timeout to dispc-compat.c
OMAPDSS: move blocking mgr enable/disable to compat layer
OMAPDSS: manage framedone irq with mgr ops
OMAPDSS: add manager ops
...
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/omap/omap_vout.c | 23 | ||||
-rw-r--r-- | drivers/media/platform/omap/omap_vout_vrfb.c | 2 | ||||
-rw-r--r-- | drivers/media/platform/omap/omap_voutdef.h | 2 | ||||
-rw-r--r-- | drivers/media/platform/omap/omap_voutlib.c | 38 | ||||
-rw-r--r-- | drivers/media/platform/omap/omap_voutlib.h | 3 |
5 files changed, 49 insertions, 19 deletions
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index a3b1a34c896d..e8cac9e55bc9 100644 --- a/drivers/media/platform/omap/omap_vout.c +++ b/drivers/media/platform/omap/omap_vout.c @@ -44,9 +44,7 @@ #include <media/v4l2-device.h> #include <media/v4l2-ioctl.h> -#include <plat/cpu.h> -#include <plat/dma.h> -#include <plat/vrfb.h> +#include <video/omapvrfb.h> #include <video/omapdss.h> #include "omap_voutlib.h" @@ -2064,7 +2062,7 @@ static int __init omap_vout_create_video_devices(struct platform_device *pdev) vout->vid_info.id = k + 1; /* Set VRFB as rotation_type for omap2 and omap3 */ - if (cpu_is_omap24xx() || cpu_is_omap34xx()) + if (omap_vout_dss_omap24xx() || omap_vout_dss_omap34xx()) vout->vid_info.rotation_type = VOUT_ROT_VRFB; /* Setup the default configuration for the video devices @@ -2186,14 +2184,23 @@ static int __init omap_vout_probe(struct platform_device *pdev) struct omap_dss_device *def_display; struct omap2video_device *vid_dev = NULL; + ret = omapdss_compat_init(); + if (ret) { + dev_err(&pdev->dev, "failed to init dss\n"); + return ret; + } + if (pdev->num_resources == 0) { dev_err(&pdev->dev, "probed for an unknown device\n"); - return -ENODEV; + ret = -ENODEV; + goto err_dss_init; } vid_dev = kzalloc(sizeof(struct omap2video_device), GFP_KERNEL); - if (vid_dev == NULL) - return -ENOMEM; + if (vid_dev == NULL) { + ret = -ENOMEM; + goto err_dss_init; + } vid_dev->num_displays = 0; for_each_dss_dev(dssdev) { @@ -2288,6 +2295,8 @@ probe_err1: } probe_err0: kfree(vid_dev); +err_dss_init: + omapdss_compat_uninit(); return ret; } diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c b/drivers/media/platform/omap/omap_vout_vrfb.c index 4be26abf6cea..6c37f9240ddf 100644 --- a/drivers/media/platform/omap/omap_vout_vrfb.c +++ b/drivers/media/platform/omap/omap_vout_vrfb.c @@ -17,7 +17,7 @@ #include <media/v4l2-device.h> #include <plat/dma.h> -#include <plat/vrfb.h> +#include <video/omapvrfb.h> #include "omap_voutdef.h" #include "omap_voutlib.h" diff --git a/drivers/media/platform/omap/omap_voutdef.h b/drivers/media/platform/omap/omap_voutdef.h index 27a95d23b913..9ccfe1f475a4 100644 --- a/drivers/media/platform/omap/omap_voutdef.h +++ b/drivers/media/platform/omap/omap_voutdef.h @@ -12,7 +12,7 @@ #define OMAP_VOUTDEF_H #include <video/omapdss.h> -#include <plat/vrfb.h> +#include <video/omapvrfb.h> #define YUYV_BPP 2 #define RGB565_BPP 2 diff --git a/drivers/media/platform/omap/omap_voutlib.c b/drivers/media/platform/omap/omap_voutlib.c index 115408b9274f..80b0d88f125c 100644 --- a/drivers/media/platform/omap/omap_voutlib.c +++ b/drivers/media/platform/omap/omap_voutlib.c @@ -26,7 +26,7 @@ #include <linux/dma-mapping.h> -#include <plat/cpu.h> +#include <video/omapdss.h> #include "omap_voutlib.h" @@ -124,7 +124,7 @@ int omap_vout_new_window(struct v4l2_rect *crop, win->chromakey = new_win->chromakey; /* Adjust the cropping window to allow for resizing limitation */ - if (cpu_is_omap24xx()) { + if (omap_vout_dss_omap24xx()) { /* For 24xx limit is 8x to 1/2x scaling. */ if ((crop->height/win->w.height) >= 2) crop->height = win->w.height * 2; @@ -140,7 +140,7 @@ int omap_vout_new_window(struct v4l2_rect *crop, if (crop->height != win->w.height) crop->width = 768; } - } else if (cpu_is_omap34xx()) { + } else if (omap_vout_dss_omap34xx()) { /* For 34xx limit is 8x to 1/4x scaling. */ if ((crop->height/win->w.height) >= 4) crop->height = win->w.height * 4; @@ -196,7 +196,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, if (try_crop.width <= 0 || try_crop.height <= 0) return -EINVAL; - if (cpu_is_omap24xx()) { + if (omap_vout_dss_omap24xx()) { if (try_crop.height != win->w.height) { /* If we're resizing vertically, we can't support a * crop width wider than 768 pixels. @@ -207,9 +207,9 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, } /* vertical resizing */ vresize = (1024 * try_crop.height) / win->w.height; - if (cpu_is_omap24xx() && (vresize > 2048)) + if (omap_vout_dss_omap24xx() && (vresize > 2048)) vresize = 2048; - else if (cpu_is_omap34xx() && (vresize > 4096)) + else if (omap_vout_dss_omap34xx() && (vresize > 4096)) vresize = 4096; win->w.height = ((1024 * try_crop.height) / vresize) & ~1; @@ -226,9 +226,9 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, } /* horizontal resizing */ hresize = (1024 * try_crop.width) / win->w.width; - if (cpu_is_omap24xx() && (hresize > 2048)) + if (omap_vout_dss_omap24xx() && (hresize > 2048)) hresize = 2048; - else if (cpu_is_omap34xx() && (hresize > 4096)) + else if (omap_vout_dss_omap34xx() && (hresize > 4096)) hresize = 4096; win->w.width = ((1024 * try_crop.width) / hresize) & ~1; @@ -243,7 +243,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, if (try_crop.width == 0) try_crop.width = 2; } - if (cpu_is_omap24xx()) { + if (omap_vout_dss_omap24xx()) { if ((try_crop.height/win->w.height) >= 2) try_crop.height = win->w.height * 2; @@ -258,7 +258,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix, if (try_crop.height != win->w.height) try_crop.width = 768; } - } else if (cpu_is_omap34xx()) { + } else if (omap_vout_dss_omap34xx()) { if ((try_crop.height/win->w.height) >= 4) try_crop.height = win->w.height * 4; @@ -337,3 +337,21 @@ void omap_vout_free_buffer(unsigned long virtaddr, u32 buf_size) } free_pages((unsigned long) virtaddr, order); } + +bool omap_vout_dss_omap24xx(void) +{ + return omapdss_get_version() == OMAPDSS_VER_OMAP24xx; +} + +bool omap_vout_dss_omap34xx(void) +{ + switch (omapdss_get_version()) { + case OMAPDSS_VER_OMAP34xx_ES1: + case OMAPDSS_VER_OMAP34xx_ES3: + case OMAPDSS_VER_OMAP3630: + case OMAPDSS_VER_AM35xx: + return true; + default: + return false; + } +} diff --git a/drivers/media/platform/omap/omap_voutlib.h b/drivers/media/platform/omap/omap_voutlib.h index e51750a597e3..f9d1c0779f33 100644 --- a/drivers/media/platform/omap/omap_voutlib.h +++ b/drivers/media/platform/omap/omap_voutlib.h @@ -32,5 +32,8 @@ void omap_vout_new_format(struct v4l2_pix_format *pix, struct v4l2_window *win); unsigned long omap_vout_alloc_buffer(u32 buf_size, u32 *phys_addr); void omap_vout_free_buffer(unsigned long virtaddr, u32 buf_size); + +bool omap_vout_dss_omap24xx(void); +bool omap_vout_dss_omap34xx(void); #endif /* #ifndef OMAP_VOUTLIB_H */ |