12 #include <linux/sched.h>
14 #include <linux/videodev2.h>
29 unsigned int *
count,
int startindex)
33 for (i = 0; i < *
count; i++) {
44 for (j = 0; j <
i; j++) {
63 static void omap_vout_vrfb_dma_tx_callback(
int lch,
u16 ch_status,
void *
data)
87 bool static_vrfb_allocation)
92 int image_width, image_height;
94 struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev);
98 vout = vid_dev->
vouts[vid_num];
103 dev_info(&pdev->
dev,
": VRFB allocation failed\n");
104 for (j = 0; j <
i; j++)
133 omap_vout_vrfb_dma_tx_callback,
137 dev_info(&pdev->
dev,
": failed to allocate DMA Channel for"
138 " video%d\n", vfd->
minor);
144 if (static_vrfb_allocation) {
145 if (omap_vout_allocate_vrfb_buffers(vout, &vrfb_num_bufs, -1)) {
147 goto release_vrfb_ctx;
183 unsigned int *count,
unsigned int startindex)
188 if (!is_rotation_enabled(vout))
198 if (omap_vout_allocate_vrfb_buffers(vout, count, startindex))
207 for (i = 0; i < *
count; i++)
210 vout->
pix.height, vout->
bpp, yuv_mode);
221 u32 dest_frame_index = 0, src_element_index = 0;
222 u32 dest_element_index = 0, src_frame_index = 0;
225 if (!is_rotation_enabled(vout))
241 (vout->
pix.width * vout->
bpp)) + 1;
244 src_element_index = 0;
246 dest_element_index = 1;
248 elem_count = vout->
pix.width * vout->
bpp;
257 dmabuf, src_element_index, src_frame_index);
260 rotation = calc_rotation(vout);
292 bool mirroring = vout->
mirror;
296 int vr_ps = 1,
ps = 2, temp_ps = 2;
297 int offset = 0, ctop = 0, cleft = 0, line_length = 0;
299 rotation = calc_rotation(vout);
303 if (is_rotation_enabled(vout)) {
323 if (is_rotation_enabled(vout)) {
328 line_length = pix->
width;
335 temp_ps =
ps / vr_ps;
336 if (mirroring == 0) {
337 *cropped_offset = offset + line_length *
338 temp_ps * cleft + crop->
top * temp_ps;
340 *cropped_offset = offset + line_length * temp_ps *
341 cleft + crop->
top * temp_ps + (line_length *
342 ((crop->
width / (vr_ps)) - 1) *
ps);
350 if (mirroring == 0) {
351 *cropped_offset = offset + (line_length *
ps * ctop) +
352 (cleft / vr_ps) *
ps;
355 *cropped_offset = offset + (line_length *
ps * ctop) +
356 (cleft / vr_ps) *
ps + (line_length *
363 temp_ps =
ps / vr_ps;
364 if (mirroring == 0) {
365 *cropped_offset = offset + line_length *
366 temp_ps * crop->
left + ctop *
ps;
368 *cropped_offset = offset + line_length *
369 temp_ps * crop->
left + ctop *
ps +
370 (line_length * ((crop->
width / vr_ps) - 1) *
375 if (mirroring == 0) {
376 *cropped_offset = (line_length *
ps) *
379 *cropped_offset = (line_length *
ps) *
381 (line_length * (crop->
height - 1) *
ps);
385 *cropped_offset = (line_length *
ps * crop->
top) /
386 vr_ps + (crop->
left *
ps) / vr_ps +
387 ((crop->
width / vr_ps) - 1) *
ps;