V4L/DVB: OMAP_VOUT: Allow omap_vout to build without VRFB
cover V4L/DVB: OMAP_VOUT: Allow omap_vout to build without VRFB
This lets omap_vout driver build and run without VRFB. It works along the lines of the following patch series:
OMAP: DSS2: OMAPFB: Allow FB_OMAP2 to build without VRFB
https://patchwork.kernel.org/patch/105371/
A variable rotation_type is introduced in omapvideo_info like the way in omapfb_info to make both vrfb and non vrfb rotation possible.
Since VRFB is tightly coupled with the omap_vout driver, a handful of vrfb-specific functions have been defined and placed in omap_vout_vrfb.c
This series applies along with the previously submitted patch:
https://patchwork.kernel.org/patch/146401/
Archit Taneja (2):
V4L/DVB: OMAP_VOUT: Create a seperate vrfb functions library V4L/DVB: OMAP_VOUT: Use rotation_type to choose between vrfb and
sdram rotation
drivers/media/video/omap/Kconfig | 1 - drivers/media/video/omap/Makefile | 1 + drivers/media/video/omap/omap_vout.c | 502 ++++++----------------------- drivers/media/video/omap/omap_vout_vrfb.c | 417 ++++++++++++++++++++++++ drivers/media/video/omap/omap_vout_vrfb.h | 40 +++ drivers/media/video/omap/omap_voutdef.h | 26 ++ 6 files changed, 582 insertions(+), 405 deletions(-) create mode 100644 drivers/media/video/omap/omap_vout_vrfb.c create mode 100644 drivers/media/video/omap/omap_vout_vrfb.h
PATCH 1/2 V4L/DVB: OMAP_VOUT: Create a seperate vrfb functions library
Create omap_vout_vrfb.c and omap_vout_vrfb.h, these contain functions which omap_vout will call if the rotation type is set to VRFB rotation. It is essentialy the code in omap_vout which is used for vrfb specific tasks.
Apart from this, some functions and preprocessor defines needed by the new vrfb function's have been moved around.
--- drivers/media/video/omap/omap_vout.c | 32 +-- drivers/media/video/omap/omap_vout_vrfb.c | 417 +++++++++++++++++++++++++++++ drivers/media/video/omap/omap_vout_vrfb.h | 40 +++ drivers/media/video/omap/omap_voutdef.h | 25 ++ 4 files changed, 490 insertions(+), 24 deletions(-) create mode 100644 drivers/media/video/omap/omap_vout_vrfb.c create mode 100644 drivers/media/video/omap/omap_vout_vrfb.h
drivers/media/video/omap/omap_vout.c +8 -24
@@ -56,7 +56,6 @@ MODULE_AUTHOR("Texas Instruments");MODULE_DESCRIPTION ("OMAP Video for Linux Video out driver" );MODULE_LICENSE ("GPL" ); -/* Driver Configuration macros */ #define VOUT_NAME "omap_vout"
@@ -65,28 +64,13 @@ enum omap_vout_channels { OMAP_VIDEO2, }; -enum dma_channel_state { -DMA_CHAN_NOT_ALLOTED , -DMA_CHAN_ALLOTED , -}; -#define QQVGA_WIDTH 160#define QQVGA_HEIGHT 120 -/* Max Resolution supported by the driver */ -#define VID_MAX_WIDTH 1280/* Largest width */ -#define VID_MAX_HEIGHT 720/* Largest height */ -/* Mimimum requirement is 2x2 for DSS */ #define VID_MIN_WIDTH 2#define VID_MIN_HEIGHT 2 -/* 2048 x 2048 is max res supported by OMAP display controller */ -#define MAX_PIXELS_PER_LINE 2048 - -#define VRFB_TX_TIMEOUT 1000 -#define VRFB_NUM_BUFS 4 -/* Max buffer size tobe allocated during init */ #define OMAP_VOUT_MAX_BUF_SIZE (VID_MAX_WIDTH*VID_MAX_HEIGHT*4)
@@ -96,8 +80,8 @@ static u32 video1_numbuffers = 3;static u32 video2_numbuffers =3 ;static u32 video1_bufsize =OMAP_VOUT_MAX_BUF_SIZE ;static u32 video2_bufsize =OMAP_VOUT_MAX_BUF_SIZE ; -static u32 vid1_static_vrfb_alloc; -static u32 vid2_static_vrfb_alloc; +u32 vid1_static_vrfb_alloc; +u32 vid2_static_vrfb_alloc;static int debug;/* Module parameters */
@@ -174,7 +158,7 @@ const static struct v4l2_fmtdesc omap_formats[] = {/* * Allocate buffers */ -static unsigned long omap_vout_alloc_buffer (u32 buf_size,u32 *phys_addr) +unsigned long omap_vout_alloc_buffer (u32 buf_size,u32 *phys_addr) {u32 order, size;unsigned long virt_addr, addr;
@@ -198,7 +182,7 @@ static unsigned long omap_vout_alloc_buffer(u32 buf_size, u32 *phys_addr)/* * Free buffers */ -static void omap_vout_free_buffer (unsigned long virtaddr,u32 buf_size) +void omap_vout_free_buffer (unsigned long virtaddr,u32 buf_size) {u32 order, size;unsigned long addr = virtaddr;
@@ -371,7 +355,7 @@ static void omap_vout_release_vrfb(struct omap_vout_device *vout)/* * Return true if rotation is 90 or 270 */ -static inline int rotate_90_or_270 (const struct omap_vout_device *vout) +int rotate_90_or_270 (const struct omap_vout_device *vout) {return (vout->rotation == dss_rotation_90_degree || vout->rotation == dss_rotation_270_degree);
@@ -380,7 +364,7 @@ static inline int rotate_90_or_270(const struct omap_vout_device *vout)/* * Return true if rotation is enabled */ -static inline int rotation_enabled (const struct omap_vout_device *vout) +int rotation_enabled (const struct omap_vout_device *vout) {return vout->rotation || vout->mirror; }
@@ -388,7 +372,7 @@ static inline int rotation_enabled(const struct omap_vout_device *vout)/* * Reverse the rotation degree if mirroring is enabled */ -static inline int calc_rotation (const struct omap_vout_device *vout) +int calc_rotation (const struct omap_vout_device *vout) {if (!vout->mirror)return vout->rotation;
@@ -408,7 +392,7 @@ static inline int calc_rotation(const struct omap_vout_device *vout)/* * Free the V4L2 buffers */ -static void omap_vout_free_buffers (struct omap_vout_device *vout) +void omap_vout_free_buffers (struct omap_vout_device *vout) {int i, numbuffers;
drivers/media/video/omap/omap_vout_vrfb.c new file +417 -0
417 lines not on this page · raw message
drivers/media/video/omap/omap_vout_vrfb.h new file +40 -0
@@ -0,0 +1,40 @@ +/* +* omap_vout_vrfb.h +* +* Copyright (C) 2010 Texas Instruments. +* +* This file is licensed under the terms of the GNU General Public License +* version 2. This program is licensed "as is" without any warranty of any +* kind, whether express or implied. +* +*/ + +#ifndef OMAP_VOUT_VRFB_H +#define OMAP_VOUT_VRFB_H + +#ifdef CONFIG_OMAP2_VRFB +void omap_vout_free_vrfb_buffers (struct omap_vout_device *vout); +void omap_vout_free_extra_vrfb_buffers (struct omap_vout_device *vout); +int omap_vout_setup_vrfb_bufs (struct platform_device *pdev,int vid_num); +void omap_vout_release_vrfb (struct omap_vout_device *vout); +int omap_vout_vrfb_buffer_setup (struct omap_vout_device *vout, +unsigned int *count,unsigned int startindex); +int omap_vout_prepare_vrfb (struct omap_vout_device *vout, +struct videobuf_buffer *vb); +void omap_vout_calculate_vrfb_offset (struct omap_vout_device *vout); +#else +void omap_vout_free_vrfb_buffers (struct omap_vout_device *vout) { } +void omap_vout_free_extra_vrfb_buffers (struct omap_vout_device *vout) { } +int omap_vout_setup_vrfb_bufs (struct platform_device *pdev,int vid_num) + {return 0 ; } +void omap_vout_release_vrfb (struct omap_vout_device *vout) { } +int omap_vout_vrfb_buffer_setup (struct omap_vout_device *vout, +unsigned int *count,unsigned int startindex) + {return 0 ; } +int omap_vout_prepare_vrfb (struct omap_vout_device *vout, +struct videobuf_buffer *vb) + {return 0 ; } +void omap_vout_calculate_vrfb_offset (struct omap_vout_device *vout) { } +#endif + +#endif
drivers/media/video/omap/omap_voutdef.h +25 -0
@@ -27,6 +27,24 @@#define MAX_DISPLAYS 3#define MAX_MANAGERS 3 +/* Max Resolution supported by the driver */ +#define VID_MAX_WIDTH 1280/* Largest width */ +#define VID_MAX_HEIGHT 720/* Largest height */ + +/* 2048 x 2048 is max res supported by OMAP display controller */ +#define MAX_PIXELS_PER_LINE 2048 + +#define VRFB_TX_TIMEOUT 1000 +#define VRFB_NUM_BUFS 4 + +extern u32 vid1_static_vrfb_alloc; +extern u32 vid2_static_vrfb_alloc; + +enum dma_channel_state { +DMA_CHAN_NOT_ALLOTED , +DMA_CHAN_ALLOTED , +}; +/* Enum for Rotation * DSS understands rotation in 0, 1, 2, 3 context * while V4L2 driver understands it as 0, 90, 180, 270
@@ -144,4 +162,11 @@ struct omap_vout_device { int io_allowed; }; + +unsigned long omap_vout_alloc_buffer (u32 buf_size,u32 *phys_addr); +void omap_vout_free_buffer (unsigned long virtaddr,u32 buf_size); +void omap_vout_free_buffers (struct omap_vout_device *vout); +int rotate_90_or_270 (const struct omap_vout_device *vout); +int rotation_enabled (const struct omap_vout_device *vout); +int calc_rotation (const struct omap_vout_device *vout);#endif /* ifndef OMAP_VOUTDEF_H */
Signature · 1 line
1.7.0.4
PATCH 2/2 V4L/DVB: OMAP_VOUT: Use rotation_type to choose between vrfb and sdram rotation
In reply to Archit TanejaAdd "rotation_type" member to omapvideo_info, this is initialized based on the value "def_vrfb" bootarg parameter, vrfb rotation is chosen by default. The rotation_type var is now used to choose between vrfb and non-vrfb calls.
vrfb specific code in omap_vout has been removed and is present in omap_vout_vrfb.c
--- drivers/media/video/omap/Kconfig | 1 - drivers/media/video/omap/Makefile | 1 + drivers/media/video/omap/omap_vout.c | 470 ++++++------------------------- drivers/media/video/omap/omap_voutdef.h | 1 + 4 files changed, 92 insertions(+), 381 deletions(-)
drivers/media/video/omap/Kconfig +0 -1
@@ -5,7 +5,6 @@ config VIDEO_OMAP2_VOUT select VIDEOBUF_DMA_CONTIG select OMAP2_DSS select OMAP2_VRAM - select OMAP2_VRFB default n ---help--- V4L2 Display driver support for OMAP2/3 based boards.
drivers/media/video/omap/Makefile +1 -0
@@ -5,3 +5,4 @@ # OMAP2/3 Display driver omap-vout-y := omap_vout.o omap_voutlib.o obj-$(CONFIG_VIDEO_OMAP2_VOUT) += omap-vout.o +obj-$(CONFIG_OMAP2_VRFB) += omap_vout_vrfb.o
drivers/media/video/omap/omap_vout.c +90 -380
702 lines not on this page · raw message
drivers/media/video/omap/omap_voutdef.h +1 -0
@@ -71,6 +71,7 @@ struct omapvideo_info {int id;int num_overlays;struct omap_overlay *overlays[MAX_OVLS ]; +enum omap_dss_rotation_type rotation_type; };struct omap2video_device {
Signature · 1 line
1.7.0.4
Quoted 9 lines
-----Original Message-----
From: Taneja, Archit
Sent: Saturday, September 04, 2010 2:12 PM
To: Hiremath, Vaibhav
Cc: [email protected]; [email protected]; Taneja, Archit
Subject: [PATCH 0/2] V4L/DVB:OMAP_VOUT: Allowomap_voutto build without VRFB
Quoted 8 lines
This lets
omap_voutdriver build and run without VRFB. It works along the lines of the following patch series:
OMAP: DSS2: OMAPFB: AllowFB_OMAP2to build without VRFB
https://patchwork.kernel.org/patch/105371/A variable
rotation_typeis introduced inomapvideo_infolike the way inomapfb_infoto make both vrfb and non vrfb rotation possible.
[Hiremath, Vaibhav] Archit,
Currently omap_vout driver only supports VRFB based rotation, it doesn't support SDMA based rotation (unlike OMAPFB) and neither you patch adds it.
Thanks,
Vaibhav
Quoted 21 lines
Since VRFB is tightly coupled with the
omap_voutdriver, a handful of vrfb-specific functions have been defined and placed inomap_vout_vrfb.cThis series applies along with the previously submitted patch:
https://patchwork.kernel.org/patch/146401/Archit Taneja (2):
V4L/DVB:OMAP_VOUT: Create a seperate vrfb functions library V4L/DVB:OMAP_VOUT: Userotation_typeto choose between vrfb and
sdram rotationdrivers/media/video/omap/Kconfig | 1 - drivers/media/video/omap/Makefile | 1 + drivers/media/video/omap/omap_vout.c | 502 ++++++------------------ ----- drivers/media/video/omap/omap_vout_vrfb.c | 417 ++++++++++++++++++++++++ drivers/media/video/omap/omap_vout_vrfb.h | 40 +++ drivers/media/video/omap/omap_voutdef.h | 26 ++ 6 files changed, 582 insertions(+), 405 deletions(-) create mode 100644 drivers/media/video/omap/omap_vout_vrfb.c create mode 100644 drivers/media/video/omap/omap_vout_vrfb.h
Hi,
Quoted 15 lines · Vaibhav
Quoted 5 lines
-----Original Message-----
From: Taneja, Archit
Sent: Saturday, September 04, 2010 2:12 PM
To: Hiremath, Vaibhav
Cc: [email protected];[email protected]; Taneja,
Quoted 9 lines
Archit
Subject: [PATCH 0/2] V4L/DVB:OMAP_VOUT: Allowomap_voutto build without VRFBThis lets
omap_voutdriver build and run without VRFB. It works along the lines of the following patch series:
OMAP: DSS2: OMAPFB: AllowFB_OMAP2to build without VRFB
https://patchwork.kernel.org/patch/105371/
Quoted 8 lines
Quoted 3 lines
A variable
rotation_typeis introduced inomapvideo_infolike the way inomapfb_infoto make both vrfb and non vrfb rotation possible.[Hiremath, Vaibhav] Archit,
Currently
omap_voutdriver only supports VRFB based rotation,
it doesn't support SDMA based rotation (unlike OMAPFB) and neither you patch adds it.
[Archit]The above description in the git commit is a mistake from my end. The main purpose of the patch is to get omap_vout running without VRFB.
I am not sure if we need to enable SDMA rotation for V4L2 though, we would always have vrfb and tiler on omap3 and omap4 respectively.
How do you think things should be handled in the non vrfb case? Should we try to get rotation running or should the driver return an error if userspace tries to enable rotation in a non-vrfb mode?
Thanks,
Archit
Quoted 20 lines
Quoted 20 lines
Since VRFB is tightly coupled with the
omap_voutdriver, a handful of vrfb-specific functions have been defined and placed inomap_vout_vrfb.cThis series applies along with the previously submitted patch:
https://patchwork.kernel.org/patch/146401/Archit Taneja (2):
V4L/DVB:OMAP_VOUT: Create a seperate vrfb functions library
V4L/DVB:OMAP_VOUT: Userotation_typeto choose between vrfb and sdram
rotationdrivers/media/video/omap/Kconfig | 1 - drivers/media/video/omap/Makefile | 1 + drivers/media/video/omap/omap_vout.c | 502 ++++++------------------ ----- drivers/media/video/omap/omap_vout_vrfb.c | 417 ++++++++++++++++++++++++ drivers/media/video/omap/omap_vout_vrfb.h | 40 +++ drivers/media/video/omap/omap_voutdef.h | 26 ++ 6 files changed, 582 insertions(+), 405 deletions(-) create mode 100644 drivers/media/video/omap/omap_vout_vrfb.c create mode 100644 drivers/media/video/omap/omap_vout_vrfb.h
Quoted 37 lines
-----Original Message-----
From: Taneja, Archit
Sent: Monday, September 06, 2010 9:31 AM
To: Hiremath, Vaibhav
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 0/2] V4L/DVB:OMAP_VOUT: Allowomap_voutto build without VRFBHi,
Quoted 8 lines · Vaibhav
Quoted 5 lines
-----Original Message-----
From: Taneja, Archit
Sent: Saturday, September 04, 2010 2:12 PM
To: Hiremath, Vaibhav
Cc: [email protected];[email protected]; Taneja,
Quoted 2 lines
Archit
Subject: [PATCH 0/2] V4L/DVB:OMAP_VOUT: Allowomap_voutto buildwithout
Quoted 7 lines
Quoted 7 lines
VRFB
This lets
omap_voutdriver build and run without VRFB. It works along the lines of the following patch series:
OMAP: DSS2: OMAPFB: AllowFB_OMAP2to build without VRFB
https://patchwork.kernel.org/patch/105371/Quoted 7 lines
Quoted 3 lines
A variable
rotation_typeis introduced inomapvideo_infolike the way inomapfb_infoto make both vrfb and non vrfb rotation possible.[Hiremath, Vaibhav] Archit,
Currently
omap_voutdriver only supports VRFB based rotation, it doesn't support SDMA based rotation (unlike OMAPFB) and neither youpatch
Quoted 1 line
adds it.
Quoted 7 lines
[Archit]The above description in the git commit is a mistake from my end. The main purpose
of the patch is to getomap_voutrunning without VRFB.I am not sure if we need to enable SDMA rotation for V4L2 though, we would always have
vrfb and tiler on omap3 and omap4 respectively.
[Hiremath, Vaibhav] No, for me SDMA based rotation doesn't make sense, since SDMA rotation suffers from bandwidth issue. On OMAPFB it has been observed that, DSS throws FIFO underflow error very frequently in SDMA based rotation.
Quoted 6 lines
How do you think things should be handled in the non vrfb case? Should we try to get
rotation running or should the driver return an error if userspace tries to enable
rotation in a non-vrfb mode?
[Hiremath, Vaibhav] We can handle this in 2 ways,
- Driver can return -ERANGE error, in case of OMAP4 (or non-vrfb platform)
- Driver can choose/fall-down 0 degree rotation gracefully
As per V4L2 spec both options are acceptable.
Thanks,
Vaibhav
Quoted 29 lines
Thanks,
Archit
Quoted 2 lines
Quoted 2 lines
Since VRFB is tightly coupled with the
omap_voutdriver, a handful of vrfb-specific functions have been defined and placed in
omap_vout_vrfb.cQuoted 7 lines
Quoted 7 lines
This series applies along with the previously submitted patch:
https://patchwork.kernel.org/patch/146401/Archit Taneja (2):
V4L/DVB:OMAP_VOUT: Create a seperate vrfb functions library V4L/DVB:OMAP_VOUT: Userotation_typeto choose between vrfb andsdram
Quoted 5 lines
Quoted 5 lines
rotation
drivers/media/video/omap/Kconfig | 1 - drivers/media/video/omap/Makefile | 1 + drivers/media/video/omap/omap_vout.c | 502 ++++++------------------
Quoted 2 lines
Quoted 2 lines
----- drivers/media/video/omap/omap_vout_vrfb.c | 417++++++++++++++++++++++++
drivers/media/video/omap/omap_vout_vrfb.h|40
Quoted 4 lines
Quoted 4 lines
+++ drivers/media/video/omap/omap_voutdef.h | 26 ++ 6 files changed, 582 insertions(+), 405 deletions(-) create mode 100644 drivers/media/video/omap/omap_vout_vrfb.c create mode 100644 drivers/media/video/omap/omap_vout_vrfb.h
Hi,
Quoted 50 lines · Vaibhav
Quoted 35 lines
-----Original Message-----
From: Taneja, Archit
Sent: Monday, September 06, 2010 9:31 AM
To: Hiremath, Vaibhav
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 0/2] V4L/DVB:OMAP_VOUT: Allowomap_voutto build without VRFBHi,
Quoted 15 lines · Vaibhav
Quoted 5 lines
-----Original Message-----
From: Taneja, Archit
Sent: Saturday, September 04, 2010 2:12 PM
To: Hiremath, Vaibhav
Cc: [email protected];[email protected]; Taneja,
Quoted 9 lines
Archit
Subject: [PATCH 0/2] V4L/DVB:OMAP_VOUT: Allowomap_voutto build without VRFBThis lets
omap_voutdriver build and run without VRFB. It works along the lines of the following patch series:
OMAP: DSS2: OMAPFB: AllowFB_OMAP2to build without VRFB
https://patchwork.kernel.org/patch/105371/Quoted 8 lines
Quoted 3 lines
A variable
rotation_typeis introduced inomapvideo_infolike the way inomapfb_infoto make both vrfb and non vrfb rotation possible.[Hiremath, Vaibhav] Archit,
Currently
omap_voutdriver only supports VRFB based rotation, it doesn't support SDMA based rotation (unlike OMAPFB) and neither you patch adds it.Quoted 5 lines
[Archit]The above description in the git commit is a mistake from my end. The main purpose of the patch is to get
omap_voutrunning without VRFB.I am not sure if we need to enable SDMA rotation for V4L2 though, we would always have vrfb and tiler on omap3 and omap4 respectively.
[Hiremath, Vaibhav] No, for me SDMA based rotation doesn't make sense, since SDMA rotation suffers from bandwidth issue. On OMAPFB it has been observed that, DSS throws FIFO underflow error very frequently in SDMA based rotation.
Quoted 4 lines
How do you think things should be handled in the non vrfb case? Should we try to get rotation running or should the driver return an error if userspace tries to enable rotation in a non-vrfb mode?
Quoted 7 lines
[Hiremath, Vaibhav] We can handle this in 2 ways,
- Driver can return
-ERANGEerror, in case of OMAP4 (or non-vrfb platform)- Driver can choose/fall-down 0 degree rotation gracefully
As per V4L2 spec both options are acceptable.
Thanks for the clarification. I will work on this change.
Archit