diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-26 09:24:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-08 13:08:53 -0400 |
commit | b0b29e1e29ee5357f36f27411b5881e470484da5 (patch) | |
tree | 70a2b1cf6c6e61b0ab8af8d6a3d59a9a05d69582 /drivers/media/video/omap3isp/isppreview.h | |
parent | bac387efbb88cf0e8df6f46a38387897cea464ee (diff) |
[media] omap3isp: preview: Shorten shadow update delay
When applications modify preview engine parameters, the new values are
applied to the hardware by the preview engine interrupt handler during
vertical blanking. If the parameters are being changed when the
interrupt handler is called, it just delays applying the parameters
until the next frame.
If an application modifies the parameters for every frame, and the
preview engine interrupt is triggerred synchronously, the parameters are
never applied to the hardware.
Fix this by storing new parameters in a shadow copy, and switch the
active parameters with the shadow values atomically.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/omap3isp/isppreview.h')
-rw-r--r-- | drivers/media/video/omap3isp/isppreview.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/media/video/omap3isp/isppreview.h b/drivers/media/video/omap3isp/isppreview.h index 6ee830623d5d..6663ab64e4b1 100644 --- a/drivers/media/video/omap3isp/isppreview.h +++ b/drivers/media/video/omap3isp/isppreview.h | |||
@@ -69,6 +69,8 @@ enum preview_ycpos_mode { | |||
69 | 69 | ||
70 | /* | 70 | /* |
71 | * struct prev_params - Structure for all configuration | 71 | * struct prev_params - Structure for all configuration |
72 | * @busy: Bitmask of busy parameters (being updated or used) | ||
73 | * @update: Bitmask of the parameters to be updated | ||
72 | * @features: Set of features enabled. | 74 | * @features: Set of features enabled. |
73 | * @cfa: CFA coefficients. | 75 | * @cfa: CFA coefficients. |
74 | * @csup: Chroma suppression coefficients. | 76 | * @csup: Chroma suppression coefficients. |
@@ -86,6 +88,8 @@ enum preview_ycpos_mode { | |||
86 | * @brightness: Brightness. | 88 | * @brightness: Brightness. |
87 | */ | 89 | */ |
88 | struct prev_params { | 90 | struct prev_params { |
91 | u32 busy; | ||
92 | u32 update; | ||
89 | u32 features; | 93 | u32 features; |
90 | struct omap3isp_prev_cfa cfa; | 94 | struct omap3isp_prev_cfa cfa; |
91 | struct omap3isp_prev_csup csup; | 95 | struct omap3isp_prev_csup csup; |
@@ -118,12 +122,11 @@ struct prev_params { | |||
118 | * @output: Bitmask of the active output | 122 | * @output: Bitmask of the active output |
119 | * @video_in: Input video entity | 123 | * @video_in: Input video entity |
120 | * @video_out: Output video entity | 124 | * @video_out: Output video entity |
121 | * @params: Module configuration data | 125 | * @params.params : Active and shadow parameters sets |
122 | * @shadow_update: If set, update the hardware configured in the next interrupt | 126 | * @params.active: Bitmask of parameters active in set 0 |
127 | * @params.lock: Parameters lock, protects params.active and params.shadow | ||
123 | * @underrun: Whether the preview entity has queued buffers on the output | 128 | * @underrun: Whether the preview entity has queued buffers on the output |
124 | * @state: Current preview pipeline state | 129 | * @state: Current preview pipeline state |
125 | * @lock: Shadow update lock | ||
126 | * @update: Bitmask of the parameters to be updated | ||
127 | * | 130 | * |
128 | * This structure is used to store the OMAP ISP Preview module Information. | 131 | * This structure is used to store the OMAP ISP Preview module Information. |
129 | */ | 132 | */ |
@@ -140,13 +143,15 @@ struct isp_prev_device { | |||
140 | struct isp_video video_in; | 143 | struct isp_video video_in; |
141 | struct isp_video video_out; | 144 | struct isp_video video_out; |
142 | 145 | ||
143 | struct prev_params params; | 146 | struct { |
144 | unsigned int shadow_update:1; | 147 | struct prev_params params[2]; |
148 | u32 active; | ||
149 | spinlock_t lock; | ||
150 | } params; | ||
151 | |||
145 | enum isp_pipeline_stream_state state; | 152 | enum isp_pipeline_stream_state state; |
146 | wait_queue_head_t wait; | 153 | wait_queue_head_t wait; |
147 | atomic_t stopping; | 154 | atomic_t stopping; |
148 | spinlock_t lock; | ||
149 | u32 update; | ||
150 | }; | 155 | }; |
151 | 156 | ||
152 | struct isp_device; | 157 | struct isp_device; |