aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-12-27 09:44:11 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-12-27 09:44:11 -0500
commita44dca1717ce2c2381339e21c07d1731a63a7888 (patch)
tree3d0b3bd26492f9fa1f1f1c1ad838315b266da7c1 /drivers/media/platform/omap
parent30ebc5e44d057a1619ad63fe32c8c1670c37c4b8 (diff)
parenta49f0d1ea3ec94fc7cf33a7c36a16343b74bd565 (diff)
Merge tag 'v3.8-rc1' into staging/for_v3.9
Linux 3.8-rc1 * tag 'v3.8-rc1': (10696 commits) Linux 3.8-rc1 Revert "nfsd: warn on odd reply state in nfsd_vfs_read" ARM: dts: fix duplicated build target and alphabetical sort out for exynos dm stripe: add WRITE SAME support dm: remove map_info dm snapshot: do not use map_context dm thin: dont use map_context dm raid1: dont use map_context dm flakey: dont use map_context dm raid1: rename read_record to bio_record dm: move target request nr to dm_target_io dm snapshot: use per_bio_data dm verity: use per_bio_data dm raid1: use per_bio_data dm: introduce per_bio_data dm kcopyd: add WRITE SAME support to dm_kcopyd_zero dm linear: add WRITE SAME support dm: add WRITE SAME support dm: prepare to support WRITE SAME dm ioctl: use kmalloc if possible ... Conflicts: MAINTAINERS
Diffstat (limited to 'drivers/media/platform/omap')
-rw-r--r--drivers/media/platform/omap/omap_vout.c23
-rw-r--r--drivers/media/platform/omap/omap_vout_vrfb.c6
-rw-r--r--drivers/media/platform/omap/omap_voutdef.h2
-rw-r--r--drivers/media/platform/omap/omap_voutlib.c38
-rw-r--r--drivers/media/platform/omap/omap_voutlib.h3
5 files changed, 52 insertions, 20 deletions
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
index c74b0d48dcd6..dade3ceab092 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -44,9 +44,7 @@
44#include <media/v4l2-device.h> 44#include <media/v4l2-device.h>
45#include <media/v4l2-ioctl.h> 45#include <media/v4l2-ioctl.h>
46 46
47#include <plat/cpu.h> 47#include <video/omapvrfb.h>
48#include <plat/dma.h>
49#include <plat/vrfb.h>
50#include <video/omapdss.h> 48#include <video/omapdss.h>
51 49
52#include "omap_voutlib.h" 50#include "omap_voutlib.h"
@@ -2027,7 +2025,7 @@ static int __init omap_vout_create_video_devices(struct platform_device *pdev)
2027 vout->vid_info.id = k + 1; 2025 vout->vid_info.id = k + 1;
2028 2026
2029 /* Set VRFB as rotation_type for omap2 and omap3 */ 2027 /* Set VRFB as rotation_type for omap2 and omap3 */
2030 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 2028 if (omap_vout_dss_omap24xx() || omap_vout_dss_omap34xx())
2031 vout->vid_info.rotation_type = VOUT_ROT_VRFB; 2029 vout->vid_info.rotation_type = VOUT_ROT_VRFB;
2032 2030
2033 /* Setup the default configuration for the video devices 2031 /* Setup the default configuration for the video devices
@@ -2144,14 +2142,23 @@ static int __init omap_vout_probe(struct platform_device *pdev)
2144 struct omap_dss_device *def_display; 2142 struct omap_dss_device *def_display;
2145 struct omap2video_device *vid_dev = NULL; 2143 struct omap2video_device *vid_dev = NULL;
2146 2144
2145 ret = omapdss_compat_init();
2146 if (ret) {
2147 dev_err(&pdev->dev, "failed to init dss\n");
2148 return ret;
2149 }
2150
2147 if (pdev->num_resources == 0) { 2151 if (pdev->num_resources == 0) {
2148 dev_err(&pdev->dev, "probed for an unknown device\n"); 2152 dev_err(&pdev->dev, "probed for an unknown device\n");
2149 return -ENODEV; 2153 ret = -ENODEV;
2154 goto err_dss_init;
2150 } 2155 }
2151 2156
2152 vid_dev = kzalloc(sizeof(struct omap2video_device), GFP_KERNEL); 2157 vid_dev = kzalloc(sizeof(struct omap2video_device), GFP_KERNEL);
2153 if (vid_dev == NULL) 2158 if (vid_dev == NULL) {
2154 return -ENOMEM; 2159 ret = -ENOMEM;
2160 goto err_dss_init;
2161 }
2155 2162
2156 vid_dev->num_displays = 0; 2163 vid_dev->num_displays = 0;
2157 for_each_dss_dev(dssdev) { 2164 for_each_dss_dev(dssdev) {
@@ -2246,6 +2253,8 @@ probe_err1:
2246 } 2253 }
2247probe_err0: 2254probe_err0:
2248 kfree(vid_dev); 2255 kfree(vid_dev);
2256err_dss_init:
2257 omapdss_compat_uninit();
2249 return ret; 2258 return ret;
2250} 2259}
2251 2260
diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c b/drivers/media/platform/omap/omap_vout_vrfb.c
index 4be26abf6cea..cf1c437a8687 100644
--- a/drivers/media/platform/omap/omap_vout_vrfb.c
+++ b/drivers/media/platform/omap/omap_vout_vrfb.c
@@ -16,12 +16,14 @@
16#include <media/videobuf-dma-contig.h> 16#include <media/videobuf-dma-contig.h>
17#include <media/v4l2-device.h> 17#include <media/v4l2-device.h>
18 18
19#include <plat/dma.h> 19#include <linux/omap-dma.h>
20#include <plat/vrfb.h> 20#include <video/omapvrfb.h>
21 21
22#include "omap_voutdef.h" 22#include "omap_voutdef.h"
23#include "omap_voutlib.h" 23#include "omap_voutlib.h"
24 24
25#define OMAP_DMA_NO_DEVICE 0
26
25/* 27/*
26 * Function for allocating video buffers 28 * Function for allocating video buffers
27 */ 29 */
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 @@
12#define OMAP_VOUTDEF_H 12#define OMAP_VOUTDEF_H
13 13
14#include <video/omapdss.h> 14#include <video/omapdss.h>
15#include <plat/vrfb.h> 15#include <video/omapvrfb.h>
16 16
17#define YUYV_BPP 2 17#define YUYV_BPP 2
18#define RGB565_BPP 2 18#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 @@
26 26
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28 28
29#include <plat/cpu.h> 29#include <video/omapdss.h>
30 30
31#include "omap_voutlib.h" 31#include "omap_voutlib.h"
32 32
@@ -124,7 +124,7 @@ int omap_vout_new_window(struct v4l2_rect *crop,
124 win->chromakey = new_win->chromakey; 124 win->chromakey = new_win->chromakey;
125 125
126 /* Adjust the cropping window to allow for resizing limitation */ 126 /* Adjust the cropping window to allow for resizing limitation */
127 if (cpu_is_omap24xx()) { 127 if (omap_vout_dss_omap24xx()) {
128 /* For 24xx limit is 8x to 1/2x scaling. */ 128 /* For 24xx limit is 8x to 1/2x scaling. */
129 if ((crop->height/win->w.height) >= 2) 129 if ((crop->height/win->w.height) >= 2)
130 crop->height = win->w.height * 2; 130 crop->height = win->w.height * 2;
@@ -140,7 +140,7 @@ int omap_vout_new_window(struct v4l2_rect *crop,
140 if (crop->height != win->w.height) 140 if (crop->height != win->w.height)
141 crop->width = 768; 141 crop->width = 768;
142 } 142 }
143 } else if (cpu_is_omap34xx()) { 143 } else if (omap_vout_dss_omap34xx()) {
144 /* For 34xx limit is 8x to 1/4x scaling. */ 144 /* For 34xx limit is 8x to 1/4x scaling. */
145 if ((crop->height/win->w.height) >= 4) 145 if ((crop->height/win->w.height) >= 4)
146 crop->height = win->w.height * 4; 146 crop->height = win->w.height * 4;
@@ -196,7 +196,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
196 if (try_crop.width <= 0 || try_crop.height <= 0) 196 if (try_crop.width <= 0 || try_crop.height <= 0)
197 return -EINVAL; 197 return -EINVAL;
198 198
199 if (cpu_is_omap24xx()) { 199 if (omap_vout_dss_omap24xx()) {
200 if (try_crop.height != win->w.height) { 200 if (try_crop.height != win->w.height) {
201 /* If we're resizing vertically, we can't support a 201 /* If we're resizing vertically, we can't support a
202 * crop width wider than 768 pixels. 202 * crop width wider than 768 pixels.
@@ -207,9 +207,9 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
207 } 207 }
208 /* vertical resizing */ 208 /* vertical resizing */
209 vresize = (1024 * try_crop.height) / win->w.height; 209 vresize = (1024 * try_crop.height) / win->w.height;
210 if (cpu_is_omap24xx() && (vresize > 2048)) 210 if (omap_vout_dss_omap24xx() && (vresize > 2048))
211 vresize = 2048; 211 vresize = 2048;
212 else if (cpu_is_omap34xx() && (vresize > 4096)) 212 else if (omap_vout_dss_omap34xx() && (vresize > 4096))
213 vresize = 4096; 213 vresize = 4096;
214 214
215 win->w.height = ((1024 * try_crop.height) / vresize) & ~1; 215 win->w.height = ((1024 * try_crop.height) / vresize) & ~1;
@@ -226,9 +226,9 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
226 } 226 }
227 /* horizontal resizing */ 227 /* horizontal resizing */
228 hresize = (1024 * try_crop.width) / win->w.width; 228 hresize = (1024 * try_crop.width) / win->w.width;
229 if (cpu_is_omap24xx() && (hresize > 2048)) 229 if (omap_vout_dss_omap24xx() && (hresize > 2048))
230 hresize = 2048; 230 hresize = 2048;
231 else if (cpu_is_omap34xx() && (hresize > 4096)) 231 else if (omap_vout_dss_omap34xx() && (hresize > 4096))
232 hresize = 4096; 232 hresize = 4096;
233 233
234 win->w.width = ((1024 * try_crop.width) / hresize) & ~1; 234 win->w.width = ((1024 * try_crop.width) / hresize) & ~1;
@@ -243,7 +243,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
243 if (try_crop.width == 0) 243 if (try_crop.width == 0)
244 try_crop.width = 2; 244 try_crop.width = 2;
245 } 245 }
246 if (cpu_is_omap24xx()) { 246 if (omap_vout_dss_omap24xx()) {
247 if ((try_crop.height/win->w.height) >= 2) 247 if ((try_crop.height/win->w.height) >= 2)
248 try_crop.height = win->w.height * 2; 248 try_crop.height = win->w.height * 2;
249 249
@@ -258,7 +258,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
258 if (try_crop.height != win->w.height) 258 if (try_crop.height != win->w.height)
259 try_crop.width = 768; 259 try_crop.width = 768;
260 } 260 }
261 } else if (cpu_is_omap34xx()) { 261 } else if (omap_vout_dss_omap34xx()) {
262 if ((try_crop.height/win->w.height) >= 4) 262 if ((try_crop.height/win->w.height) >= 4)
263 try_crop.height = win->w.height * 4; 263 try_crop.height = win->w.height * 4;
264 264
@@ -337,3 +337,21 @@ void omap_vout_free_buffer(unsigned long virtaddr, u32 buf_size)
337 } 337 }
338 free_pages((unsigned long) virtaddr, order); 338 free_pages((unsigned long) virtaddr, order);
339} 339}
340
341bool omap_vout_dss_omap24xx(void)
342{
343 return omapdss_get_version() == OMAPDSS_VER_OMAP24xx;
344}
345
346bool omap_vout_dss_omap34xx(void)
347{
348 switch (omapdss_get_version()) {
349 case OMAPDSS_VER_OMAP34xx_ES1:
350 case OMAPDSS_VER_OMAP34xx_ES3:
351 case OMAPDSS_VER_OMAP3630:
352 case OMAPDSS_VER_AM35xx:
353 return true;
354 default:
355 return false;
356 }
357}
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,
32 struct v4l2_window *win); 32 struct v4l2_window *win);
33unsigned long omap_vout_alloc_buffer(u32 buf_size, u32 *phys_addr); 33unsigned long omap_vout_alloc_buffer(u32 buf_size, u32 *phys_addr);
34void omap_vout_free_buffer(unsigned long virtaddr, u32 buf_size); 34void omap_vout_free_buffer(unsigned long virtaddr, u32 buf_size);
35
36bool omap_vout_dss_omap24xx(void);
37bool omap_vout_dss_omap34xx(void);
35#endif /* #ifndef OMAP_VOUTLIB_H */ 38#endif /* #ifndef OMAP_VOUTLIB_H */
36 39