omap3isp.h
001:
002:
003:
004:
005:
006:
007:
008:
009: <laurent.pinchart@ideasonboard.com>
010: <sakari.ailus@iki.fi>
011:
012:
013:
014:
015:
016:
017:
018:
019:
020:
021:
022:
023:
024:
025:
026:
027: #ifndef OMAP3_ISP_USER_H
028: #define OMAP3_ISP_USER_H
029:
030: #include <linux/types.h>
031:
032:
033:
034:
035:
036:
037:
038:
039:
040:
041:
042:
043:
044: #define VIDIOC_OMAP3ISP_CCDC_CFG \
045: _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct omap3isp_ccdc_update_config)
046: #define VIDIOC_OMAP3ISP_PRV_CFG \
047: _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct omap3isp_prev_update_config)
048: #define VIDIOC_OMAP3ISP_AEWB_CFG \
049: _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct omap3isp_h3a_aewb_config)
050: #define VIDIOC_OMAP3ISP_HIST_CFG \
051: _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct omap3isp_hist_config)
052: #define VIDIOC_OMAP3ISP_AF_CFG \
053: _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct omap3isp_h3a_af_config)
054: #define VIDIOC_OMAP3ISP_STAT_REQ \
055: _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data)
056: #define VIDIOC_OMAP3ISP_STAT_EN \
057: _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long)
058:
059:
060:
061:
062:
063:
064:
065:
066:
067: #define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100)
068: #define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1)
069: #define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2)
070: #define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3)
071:
072: struct omap3isp_stat_event_status {
073: __u32 frame_number;
074: __u16 config_counter;
075: __u8 buf_err;
076: };
077:
078:
079:
080:
081: #define OMAP3ISP_AEWB_MAX_SATURATION_LIM 1023
082: #define OMAP3ISP_AEWB_MIN_WIN_H 2
083: #define OMAP3ISP_AEWB_MAX_WIN_H 256
084: #define OMAP3ISP_AEWB_MIN_WIN_W 6
085: #define OMAP3ISP_AEWB_MAX_WIN_W 256
086: #define OMAP3ISP_AEWB_MIN_WINVC 1
087: #define OMAP3ISP_AEWB_MIN_WINHC 1
088: #define OMAP3ISP_AEWB_MAX_WINVC 128
089: #define OMAP3ISP_AEWB_MAX_WINHC 36
090: #define OMAP3ISP_AEWB_MAX_WINSTART 4095
091: #define OMAP3ISP_AEWB_MIN_SUB_INC 2
092: #define OMAP3ISP_AEWB_MAX_SUB_INC 32
093: #define OMAP3ISP_AEWB_MAX_BUF_SIZE 83600
094:
095: #define OMAP3ISP_AF_IIRSH_MIN 0
096: #define OMAP3ISP_AF_IIRSH_MAX 4095
097: #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MIN 1
098: #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MAX 36
099: #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MIN 1
100: #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MAX 128
101: #define OMAP3ISP_AF_PAXEL_INCREMENT_MIN 2
102: #define OMAP3ISP_AF_PAXEL_INCREMENT_MAX 32
103: #define OMAP3ISP_AF_PAXEL_HEIGHT_MIN 2
104: #define OMAP3ISP_AF_PAXEL_HEIGHT_MAX 256
105: #define OMAP3ISP_AF_PAXEL_WIDTH_MIN 16
106: #define OMAP3ISP_AF_PAXEL_WIDTH_MAX 256
107: #define OMAP3ISP_AF_PAXEL_HZSTART_MIN 1
108: #define OMAP3ISP_AF_PAXEL_HZSTART_MAX 4095
109: #define OMAP3ISP_AF_PAXEL_VTSTART_MIN 0
110: #define OMAP3ISP_AF_PAXEL_VTSTART_MAX 4095
111: #define OMAP3ISP_AF_THRESHOLD_MAX 255
112: #define OMAP3ISP_AF_COEF_MAX 4095
113: #define OMAP3ISP_AF_PAXEL_SIZE 48
114: #define OMAP3ISP_AF_MAX_BUF_SIZE 221184
115:
116:
117:
118:
119: @win
120: @win
121: @ver
122: @hor
123: @ver
124: @hor
125: @blk
126: @blk
127: @subsample
128:
129: @subsample
130:
131: @alaw
132:
133: struct omap3isp_h3a_aewb_config {
134:
135:
136:
137:
138:
139: __u32 buf_size;
140: __u16 config_counter;
141:
142:
143: __u16 saturation_limit;
144: __u16 win_height;
145: __u16 win_width;
146: __u16 ver_win_count;
147: __u16 hor_win_count;
148: __u16 ver_win_start;
149: __u16 hor_win_start;
150: __u16 blk_ver_win_start;
151: __u16 blk_win_height;
152: __u16 subsample_ver_inc;
153: __u16 subsample_hor_inc;
154: __u8 alaw_enable;
155: };
156:
157:
158:
159: @ts
160: @buf
161: @frame
162: @cur
163: @config
164:
165: struct omap3isp_stat_data {
166: struct timeval ts;
167: void *buf;
168: __u32 buf_size;
169: __u16 frame_number;
170: __u16 cur_frame;
171: __u16 config_counter;
172: };
173:
174:
175:
176:
177:
178: #define OMAP3ISP_HIST_BINS_32 0
179: #define OMAP3ISP_HIST_BINS_64 1
180: #define OMAP3ISP_HIST_BINS_128 2
181: #define OMAP3ISP_HIST_BINS_256 3
182:
183:
184: #define OMAP3ISP_HIST_MEM_SIZE_BINS(n) ((1 << ((n)+5))*4*4)
185:
186: #define OMAP3ISP_HIST_MEM_SIZE 1024
187: #define OMAP3ISP_HIST_MIN_REGIONS 1
188: #define OMAP3ISP_HIST_MAX_REGIONS 4
189: #define OMAP3ISP_HIST_MAX_WB_GAIN 255
190: #define OMAP3ISP_HIST_MIN_WB_GAIN 0
191: #define OMAP3ISP_HIST_MAX_BIT_WIDTH 14
192: #define OMAP3ISP_HIST_MIN_BIT_WIDTH 8
193: #define OMAP3ISP_HIST_MAX_WG 4
194: #define OMAP3ISP_HIST_MAX_BUF_SIZE 4096
195:
196:
197: #define OMAP3ISP_HIST_SOURCE_CCDC 0
198: #define OMAP3ISP_HIST_SOURCE_MEM 1
199:
200:
201: #define OMAP3ISP_HIST_CFA_BAYER 0
202: #define OMAP3ISP_HIST_CFA_FOVEONX3 1
203:
204: struct omap3isp_hist_region {
205: __u16 h_start;
206: __u16 h_end;
207: __u16 v_start;
208: __u16 v_end;
209: };
210:
211: struct omap3isp_hist_config {
212:
213:
214:
215:
216:
217: __u32 buf_size;
218: __u16 config_counter;
219:
220: __u8 num_acc_frames;
221:
222: __u16 hist_bins;
223: __u8 cfa;
224: __u8 wg[OMAP3ISP_HIST_MAX_WG];
225: __u8 num_regions;
226: struct omap3isp_hist_region region[OMAP3ISP_HIST_MAX_REGIONS];
227: };
228:
229:
230:
231: #define OMAP3ISP_AF_NUM_COEF 11
232:
233: enum omap3isp_h3a_af_fvmode {
234: OMAP3ISP_AF_MODE_SUMMED = 0,
235: OMAP3ISP_AF_MODE_PEAK = 1
236: };
237:
238:
239: enum omap3isp_h3a_af_rgbpos {
240: OMAP3ISP_AF_GR_GB_BAYER = 0,
241: OMAP3ISP_AF_RG_GB_BAYER = 1,
242: OMAP3ISP_AF_GR_BG_BAYER = 2,
243: OMAP3ISP_AF_RG_BG_BAYER = 3,
244: OMAP3ISP_AF_GG_RB_CUSTOM = 4,
245: OMAP3ISP_AF_RB_GG_CUSTOM = 5
246: };
247:
248:
249: struct omap3isp_h3a_af_hmf {
250: __u8 enable;
251: __u8 threshold;
252: };
253:
254:
255: struct omap3isp_h3a_af_iir {
256: __u16 h_start;
257: __u16 coeff_set0[OMAP3ISP_AF_NUM_COEF];
258: __u16 coeff_set1[OMAP3ISP_AF_NUM_COEF];
259: };
260:
261:
262: struct omap3isp_h3a_af_paxel {
263: __u16 h_start;
264: __u16 v_start;
265: __u8 width;
266: __u8 height;
267: __u8 h_cnt;
268: __u8 v_cnt;
269: __u8 line_inc;
270: };
271:
272:
273: struct omap3isp_h3a_af_config {
274:
275:
276:
277:
278:
279: __u32 buf_size;
280: __u16 config_counter;
281:
282: struct omap3isp_h3a_af_hmf hmf;
283: struct omap3isp_h3a_af_iir iir;
284: struct omap3isp_h3a_af_paxel paxel;
285: enum omap3isp_h3a_af_rgbpos rgb_pos;
286: enum omap3isp_h3a_af_fvmode fvmode;
287: __u8 alaw_enable;
288: };
289:
290:
291:
292:
293: #define OMAP3ISP_CCDC_ALAW (1 << 0)
294: #define OMAP3ISP_CCDC_LPF (1 << 1)
295: #define OMAP3ISP_CCDC_BLCLAMP (1 << 2)
296: #define OMAP3ISP_CCDC_BCOMP (1 << 3)
297: #define OMAP3ISP_CCDC_FPC (1 << 4)
298: #define OMAP3ISP_CCDC_CULL (1 << 5)
299: #define OMAP3ISP_CCDC_CONFIG_LSC (1 << 7)
300: #define OMAP3ISP_CCDC_TBL_LSC (1 << 8)
301:
302: #define OMAP3ISP_RGB_MAX 3
303:
304:
305: enum omap3isp_alaw_ipwidth {
306: OMAP3ISP_ALAW_BIT12_3 = 0x3,
307: OMAP3ISP_ALAW_BIT11_2 = 0x4,
308: OMAP3ISP_ALAW_BIT10_1 = 0x5,
309: OMAP3ISP_ALAW_BIT9_0 = 0x6
310: };
311:
312:
313:
314: @offset
315: @gain
316: @gain
317: @gain
318: @fmtsph
319: @fmtlnh
320:
321: @fmtslv
322: @fmtlnv
323: @initial
324:
325: @initial
326:
327: @size
328:
329: struct omap3isp_ccdc_lsc_config {
330: __u16 offset;
331: __u8 gain_mode_n;
332: __u8 gain_mode_m;
333: __u8 gain_format;
334: __u16 fmtsph;
335: __u16 fmtlnh;
336: __u16 fmtslv;
337: __u16 fmtlnv;
338: __u8 initial_x;
339: __u8 initial_y;
340: __u32 size;
341: };
342:
343:
344:
345: @obgain
346: @obstpixel
347: @oblines
348: @oblen
349: @dcsubval
350:
351: struct omap3isp_ccdc_bclamp {
352: __u8 obgain;
353: __u8 obstpixel;
354: __u8 oblines;
355: __u8 oblen;
356: __u16 dcsubval;
357: };
358:
359:
360:
361: @fpnum
362: @fpcaddr
363:
364: struct omap3isp_ccdc_fpc {
365: __u16 fpnum;
366: __u32 fpcaddr;
367: };
368:
369:
370:
371: @b
372: @gb
373: @gr
374: @r
375:
376: struct omap3isp_ccdc_blcomp {
377: __u8 b_mg;
378: __u8 gb_g;
379: __u8 gr_cy;
380: __u8 r_ye;
381: };
382:
383:
384:
385: @v
386: @h
387: @h
388:
389: struct omap3isp_ccdc_culling {
390: __u8 v_pattern;
391: __u16 h_odd;
392: __u16 h_even;
393: };
394:
395:
396:
397: @update
398: @flag
399: @alawip
400: @bclamp
401: @blcomp
402: @fpc
403: @cull
404: @lsc
405:
406: struct omap3isp_ccdc_update_config {
407: __u16 update;
408: __u16 flag;
409: enum omap3isp_alaw_ipwidth alawip;
410: struct omap3isp_ccdc_bclamp *bclamp;
411: struct omap3isp_ccdc_blcomp *blcomp;
412: struct omap3isp_ccdc_fpc *fpc;
413: struct omap3isp_ccdc_lsc_config *lsc_cfg;
414: struct omap3isp_ccdc_culling *cull;
415: __u8 *lsc;
416: };
417:
418:
419: #define OMAP3ISP_PREV_LUMAENH (1 << 0)
420: #define OMAP3ISP_PREV_INVALAW (1 << 1)
421: #define OMAP3ISP_PREV_HRZ_MED (1 << 2)
422: #define OMAP3ISP_PREV_CFA (1 << 3)
423: #define OMAP3ISP_PREV_CHROMA_SUPP (1 << 4)
424: #define OMAP3ISP_PREV_WB (1 << 5)
425: #define OMAP3ISP_PREV_BLKADJ (1 << 6)
426: #define OMAP3ISP_PREV_RGB2RGB (1 << 7)
427: #define OMAP3ISP_PREV_COLOR_CONV (1 << 8)
428: #define OMAP3ISP_PREV_YC_LIMIT (1 << 9)
429: #define OMAP3ISP_PREV_DEFECT_COR (1 << 10)
430: #define OMAP3ISP_PREV_GAMMABYPASS (1 << 11)
431: #define OMAP3ISP_PREV_DRK_FRM_CAPTURE (1 << 12)
432: #define OMAP3ISP_PREV_DRK_FRM_SUBTRACT (1 << 13)
433: #define OMAP3ISP_PREV_LENS_SHADING (1 << 14)
434: #define OMAP3ISP_PREV_NF (1 << 15)
435: #define OMAP3ISP_PREV_GAMMA (1 << 16)
436:
437: #define OMAP3ISP_PREV_NF_TBL_SIZE 64
438: #define OMAP3ISP_PREV_CFA_TBL_SIZE 576
439: #define OMAP3ISP_PREV_GAMMA_TBL_SIZE 1024
440: #define OMAP3ISP_PREV_YENH_TBL_SIZE 128
441:
442: #define OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS 4
443:
444:
445:
446: @odddist
447: @evendist
448:
449: @thres
450:
451: struct omap3isp_prev_hmed {
452: __u8 odddist;
453: __u8 evendist;
454: __u8 thres;
455: };
456:
457:
458:
459:
460: enum omap3isp_cfa_fmt {
461: OMAP3ISP_CFAFMT_BAYER,
462: OMAP3ISP_CFAFMT_SONYVGA,
463: OMAP3ISP_CFAFMT_RGBFOVEON,
464: OMAP3ISP_CFAFMT_DNSPL,
465: OMAP3ISP_CFAFMT_HONEYCOMB,
466: OMAP3ISP_CFAFMT_RRGGBBFOVEON
467: };
468:
469:
470:
471: @format
472: @gradthrs
473: @gradthrs
474: @table
475:
476: struct omap3isp_prev_cfa {
477: enum omap3isp_cfa_fmt format;
478: __u8 gradthrs_vert;
479: __u8 gradthrs_horz;
480: __u32 table[OMAP3ISP_PREV_CFA_TBL_SIZE];
481: };
482:
483:
484:
485: @gain
486: @thres
487: @hypf
488:
489: struct omap3isp_prev_csup {
490: __u8 gain;
491: __u8 thres;
492: __u8 hypf_en;
493: };
494:
495:
496:
497: @dgain
498: @coef
499: @coef
500: @coef
501: @coef
502:
503: struct omap3isp_prev_wbal {
504: __u16 dgain;
505: __u8 coef3;
506: __u8 coef2;
507: __u8 coef1;
508: __u8 coef0;
509: };
510:
511:
512:
513: @red
514: @green
515: @blue
516:
517: struct omap3isp_prev_blkadj {
518:
519: __u8 red;
520:
521: __u8 green;
522:
523: __u8 blue;
524: };
525:
526:
527:
528: @matrix
529:
530:
531:
532: @offset
533:
534: struct omap3isp_prev_rgbtorgb {
535: __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX];
536: __u16 offset[OMAP3ISP_RGB_MAX];
537: };
538:
539:
540:
541: @matrix
542:
543:
544:
545: @offset
546:
547: struct omap3isp_prev_csc {
548: __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX];
549: __s16 offset[OMAP3ISP_RGB_MAX];
550: };
551:
552:
553:
554: @minC
555: @maxC
556: @minY
557: @maxY
558:
559: struct omap3isp_prev_yclimit {
560: __u8 minC;
561: __u8 maxC;
562: __u8 minY;
563: __u8 maxY;
564: };
565:
566:
567:
568: @couplet
569: @detect
570:
571: struct omap3isp_prev_dcor {
572: __u8 couplet_mode_en;
573: __u32 detect_correct[OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS];
574: };
575:
576:
577:
578: @spread
579: @table
580:
581: struct omap3isp_prev_nf {
582: __u8 spread;
583: __u32 table[OMAP3ISP_PREV_NF_TBL_SIZE];
584: };
585:
586:
587:
588: @red
589: @green
590: @blue
591:
592: struct omap3isp_prev_gtables {
593: __u32 red[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
594: __u32 green[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
595: __u32 blue[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
596: };
597:
598:
599:
600: @table
601:
602: struct omap3isp_prev_luma {
603: __u32 table[OMAP3ISP_PREV_YENH_TBL_SIZE];
604: };
605:
606:
607:
608: @update
609: @flag
610: @shading
611: @luma
612: @hmed
613:
614: @cfa
615:
616: @csup
617: @wbal
618: @blkadj
619: @rgb
620: @csc
621: @yclimit
622: @dcor
623: @nf
624: @gamma
625:
626: struct omap3isp_prev_update_config {
627: __u32 update;
628: __u32 flag;
629: __u32 shading_shift;
630: struct omap3isp_prev_luma *luma;
631: struct omap3isp_prev_hmed *hmed;
632: struct omap3isp_prev_cfa *cfa;
633: struct omap3isp_prev_csup *csup;
634: struct omap3isp_prev_wbal *wbal;
635: struct omap3isp_prev_blkadj *blkadj;
636: struct omap3isp_prev_rgbtorgb *rgb2rgb;
637: struct omap3isp_prev_csc *csc;
638: struct omap3isp_prev_yclimit *yclimit;
639: struct omap3isp_prev_dcor *dcor;
640: struct omap3isp_prev_nf *nf;
641: struct omap3isp_prev_gtables *gamma;
642: };
643:
644: #endif
645:
© Andrew Scott 2006 -
2025,
All Rights Reserved