Lines Matching refs:tpg
236 void tpg_init(struct tpg_data *tpg, unsigned w, unsigned h);
237 int tpg_alloc(struct tpg_data *tpg, unsigned max_w);
238 void tpg_free(struct tpg_data *tpg);
239 void tpg_reset_source(struct tpg_data *tpg, unsigned width, unsigned height,
241 void tpg_log_status(struct tpg_data *tpg);
244 void tpg_gen_text(const struct tpg_data *tpg,
246 void tpg_calc_text_basep(struct tpg_data *tpg,
248 unsigned tpg_g_interleaved_plane(const struct tpg_data *tpg, unsigned buf_line);
249 void tpg_fill_plane_buffer(struct tpg_data *tpg, v4l2_std_id std,
251 void tpg_fillbuffer(struct tpg_data *tpg, v4l2_std_id std,
253 bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc);
254 void tpg_s_crop_compose(struct tpg_data *tpg, const struct v4l2_rect *crop,
256 const char *tpg_g_color_order(const struct tpg_data *tpg);
258 static inline void tpg_s_pattern(struct tpg_data *tpg, enum tpg_pattern pattern) in tpg_s_pattern() argument
260 if (tpg->pattern == pattern) in tpg_s_pattern()
262 tpg->pattern = pattern; in tpg_s_pattern()
263 tpg->recalc_colors = true; in tpg_s_pattern()
266 static inline void tpg_s_quality(struct tpg_data *tpg, in tpg_s_quality() argument
269 if (tpg->qual == qual && tpg->qual_offset == qual_offset) in tpg_s_quality()
271 tpg->qual = qual; in tpg_s_quality()
272 tpg->qual_offset = qual_offset; in tpg_s_quality()
273 tpg->recalc_colors = true; in tpg_s_quality()
276 static inline enum tpg_quality tpg_g_quality(const struct tpg_data *tpg) in tpg_g_quality() argument
278 return tpg->qual; in tpg_g_quality()
281 static inline void tpg_s_alpha_component(struct tpg_data *tpg, in tpg_s_alpha_component() argument
284 if (tpg->alpha_component == alpha_component) in tpg_s_alpha_component()
286 tpg->alpha_component = alpha_component; in tpg_s_alpha_component()
287 tpg->recalc_colors = true; in tpg_s_alpha_component()
290 static inline void tpg_s_alpha_mode(struct tpg_data *tpg, in tpg_s_alpha_mode() argument
293 if (tpg->alpha_red_only == red_only) in tpg_s_alpha_mode()
295 tpg->alpha_red_only = red_only; in tpg_s_alpha_mode()
296 tpg->recalc_colors = true; in tpg_s_alpha_mode()
299 static inline void tpg_s_brightness(struct tpg_data *tpg, in tpg_s_brightness() argument
302 if (tpg->brightness == brightness) in tpg_s_brightness()
304 tpg->brightness = brightness; in tpg_s_brightness()
305 tpg->recalc_colors = true; in tpg_s_brightness()
308 static inline void tpg_s_contrast(struct tpg_data *tpg, in tpg_s_contrast() argument
311 if (tpg->contrast == contrast) in tpg_s_contrast()
313 tpg->contrast = contrast; in tpg_s_contrast()
314 tpg->recalc_colors = true; in tpg_s_contrast()
317 static inline void tpg_s_saturation(struct tpg_data *tpg, in tpg_s_saturation() argument
320 if (tpg->saturation == saturation) in tpg_s_saturation()
322 tpg->saturation = saturation; in tpg_s_saturation()
323 tpg->recalc_colors = true; in tpg_s_saturation()
326 static inline void tpg_s_hue(struct tpg_data *tpg, in tpg_s_hue() argument
330 if (tpg->hue == hue) in tpg_s_hue()
332 tpg->hue = hue; in tpg_s_hue()
333 tpg->recalc_colors = true; in tpg_s_hue()
336 static inline void tpg_s_rgb_range(struct tpg_data *tpg, in tpg_s_rgb_range() argument
339 if (tpg->rgb_range == rgb_range) in tpg_s_rgb_range()
341 tpg->rgb_range = rgb_range; in tpg_s_rgb_range()
342 tpg->recalc_colors = true; in tpg_s_rgb_range()
345 static inline void tpg_s_real_rgb_range(struct tpg_data *tpg, in tpg_s_real_rgb_range() argument
348 if (tpg->real_rgb_range == rgb_range) in tpg_s_real_rgb_range()
350 tpg->real_rgb_range = rgb_range; in tpg_s_real_rgb_range()
351 tpg->recalc_colors = true; in tpg_s_real_rgb_range()
354 static inline void tpg_s_colorspace(struct tpg_data *tpg, u32 colorspace) in tpg_s_colorspace() argument
356 if (tpg->colorspace == colorspace) in tpg_s_colorspace()
358 tpg->colorspace = colorspace; in tpg_s_colorspace()
359 tpg->recalc_colors = true; in tpg_s_colorspace()
362 static inline u32 tpg_g_colorspace(const struct tpg_data *tpg) in tpg_g_colorspace() argument
364 return tpg->colorspace; in tpg_g_colorspace()
367 static inline void tpg_s_ycbcr_enc(struct tpg_data *tpg, u32 ycbcr_enc) in tpg_s_ycbcr_enc() argument
369 if (tpg->ycbcr_enc == ycbcr_enc) in tpg_s_ycbcr_enc()
371 tpg->ycbcr_enc = ycbcr_enc; in tpg_s_ycbcr_enc()
372 tpg->recalc_colors = true; in tpg_s_ycbcr_enc()
375 static inline u32 tpg_g_ycbcr_enc(const struct tpg_data *tpg) in tpg_g_ycbcr_enc() argument
377 return tpg->ycbcr_enc; in tpg_g_ycbcr_enc()
380 static inline void tpg_s_hsv_enc(struct tpg_data *tpg, u32 hsv_enc) in tpg_s_hsv_enc() argument
382 if (tpg->hsv_enc == hsv_enc) in tpg_s_hsv_enc()
384 tpg->hsv_enc = hsv_enc; in tpg_s_hsv_enc()
385 tpg->recalc_colors = true; in tpg_s_hsv_enc()
388 static inline u32 tpg_g_hsv_enc(const struct tpg_data *tpg) in tpg_g_hsv_enc() argument
390 return tpg->hsv_enc; in tpg_g_hsv_enc()
393 static inline void tpg_s_xfer_func(struct tpg_data *tpg, u32 xfer_func) in tpg_s_xfer_func() argument
395 if (tpg->xfer_func == xfer_func) in tpg_s_xfer_func()
397 tpg->xfer_func = xfer_func; in tpg_s_xfer_func()
398 tpg->recalc_colors = true; in tpg_s_xfer_func()
401 static inline u32 tpg_g_xfer_func(const struct tpg_data *tpg) in tpg_g_xfer_func() argument
403 return tpg->xfer_func; in tpg_g_xfer_func()
406 static inline void tpg_s_quantization(struct tpg_data *tpg, u32 quantization) in tpg_s_quantization() argument
408 if (tpg->quantization == quantization) in tpg_s_quantization()
410 tpg->quantization = quantization; in tpg_s_quantization()
411 tpg->recalc_colors = true; in tpg_s_quantization()
414 static inline u32 tpg_g_quantization(const struct tpg_data *tpg) in tpg_g_quantization() argument
416 return tpg->quantization; in tpg_g_quantization()
419 static inline unsigned tpg_g_buffers(const struct tpg_data *tpg) in tpg_g_buffers() argument
421 return tpg->buffers; in tpg_g_buffers()
424 static inline unsigned tpg_g_planes(const struct tpg_data *tpg) in tpg_g_planes() argument
426 return tpg->interleaved ? 1 : tpg->planes; in tpg_g_planes()
429 static inline bool tpg_g_interleaved(const struct tpg_data *tpg) in tpg_g_interleaved() argument
431 return tpg->interleaved; in tpg_g_interleaved()
434 static inline unsigned tpg_g_twopixelsize(const struct tpg_data *tpg, unsigned plane) in tpg_g_twopixelsize() argument
436 return tpg->twopixelsize[plane]; in tpg_g_twopixelsize()
439 static inline unsigned tpg_hdiv(const struct tpg_data *tpg, in tpg_hdiv() argument
442 return ((x / tpg->hdownsampling[plane]) & tpg->hmask[plane]) * in tpg_hdiv()
443 tpg->twopixelsize[plane] / 2; in tpg_hdiv()
446 static inline unsigned tpg_hscale(const struct tpg_data *tpg, unsigned x) in tpg_hscale() argument
448 return (x * tpg->scaled_width) / tpg->src_width; in tpg_hscale()
451 static inline unsigned tpg_hscale_div(const struct tpg_data *tpg, in tpg_hscale_div() argument
454 return tpg_hdiv(tpg, plane, tpg_hscale(tpg, x)); in tpg_hscale_div()
457 static inline unsigned tpg_g_bytesperline(const struct tpg_data *tpg, unsigned plane) in tpg_g_bytesperline() argument
459 return tpg->bytesperline[plane]; in tpg_g_bytesperline()
462 static inline void tpg_s_bytesperline(struct tpg_data *tpg, unsigned plane, unsigned bpl) in tpg_s_bytesperline() argument
466 if (tpg->buffers > 1) { in tpg_s_bytesperline()
467 tpg->bytesperline[plane] = bpl; in tpg_s_bytesperline()
471 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_s_bytesperline()
472 unsigned plane_w = bpl * tpg->twopixelsize[p] / tpg->twopixelsize[0]; in tpg_s_bytesperline()
474 tpg->bytesperline[p] = plane_w / tpg->hdownsampling[p]; in tpg_s_bytesperline()
476 if (tpg_g_interleaved(tpg)) in tpg_s_bytesperline()
477 tpg->bytesperline[1] = tpg->bytesperline[0]; in tpg_s_bytesperline()
481 static inline unsigned tpg_g_line_width(const struct tpg_data *tpg, unsigned plane) in tpg_g_line_width() argument
486 if (tpg->buffers > 1) in tpg_g_line_width()
487 return tpg_g_bytesperline(tpg, plane); in tpg_g_line_width()
488 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_g_line_width()
489 unsigned plane_w = tpg_g_bytesperline(tpg, p); in tpg_g_line_width()
491 w += plane_w / tpg->vdownsampling[p]; in tpg_g_line_width()
496 static inline unsigned tpg_calc_line_width(const struct tpg_data *tpg, in tpg_calc_line_width() argument
502 if (tpg->buffers > 1) in tpg_calc_line_width()
504 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_calc_line_width()
505 unsigned plane_w = bpl * tpg->twopixelsize[p] / tpg->twopixelsize[0]; in tpg_calc_line_width()
507 plane_w /= tpg->hdownsampling[p]; in tpg_calc_line_width()
508 w += plane_w / tpg->vdownsampling[p]; in tpg_calc_line_width()
513 static inline unsigned tpg_calc_plane_size(const struct tpg_data *tpg, unsigned plane) in tpg_calc_plane_size() argument
515 if (plane >= tpg_g_planes(tpg)) in tpg_calc_plane_size()
518 return tpg_g_bytesperline(tpg, plane) * tpg->buf_height / in tpg_calc_plane_size()
519 tpg->vdownsampling[plane]; in tpg_calc_plane_size()
522 static inline void tpg_s_buf_height(struct tpg_data *tpg, unsigned h) in tpg_s_buf_height() argument
524 tpg->buf_height = h; in tpg_s_buf_height()
527 static inline void tpg_s_field(struct tpg_data *tpg, unsigned field, bool alternate) in tpg_s_field() argument
529 tpg->field = field; in tpg_s_field()
530 tpg->field_alternate = alternate; in tpg_s_field()
533 static inline void tpg_s_perc_fill(struct tpg_data *tpg, in tpg_s_perc_fill() argument
536 tpg->perc_fill = perc_fill; in tpg_s_perc_fill()
539 static inline unsigned tpg_g_perc_fill(const struct tpg_data *tpg) in tpg_g_perc_fill() argument
541 return tpg->perc_fill; in tpg_g_perc_fill()
544 static inline void tpg_s_perc_fill_blank(struct tpg_data *tpg, in tpg_s_perc_fill_blank() argument
547 tpg->perc_fill_blank = perc_fill_blank; in tpg_s_perc_fill_blank()
550 static inline void tpg_s_video_aspect(struct tpg_data *tpg, in tpg_s_video_aspect() argument
553 if (tpg->vid_aspect == vid_aspect) in tpg_s_video_aspect()
555 tpg->vid_aspect = vid_aspect; in tpg_s_video_aspect()
556 tpg->recalc_square_border = true; in tpg_s_video_aspect()
559 static inline enum tpg_video_aspect tpg_g_video_aspect(const struct tpg_data *tpg) in tpg_g_video_aspect() argument
561 return tpg->vid_aspect; in tpg_g_video_aspect()
564 static inline void tpg_s_pixel_aspect(struct tpg_data *tpg, in tpg_s_pixel_aspect() argument
567 if (tpg->pix_aspect == pix_aspect) in tpg_s_pixel_aspect()
569 tpg->pix_aspect = pix_aspect; in tpg_s_pixel_aspect()
570 tpg->recalc_square_border = true; in tpg_s_pixel_aspect()
573 static inline void tpg_s_show_border(struct tpg_data *tpg, in tpg_s_show_border() argument
576 tpg->show_border = show_border; in tpg_s_show_border()
579 static inline void tpg_s_show_square(struct tpg_data *tpg, in tpg_s_show_square() argument
582 tpg->show_square = show_square; in tpg_s_show_square()
585 static inline void tpg_s_insert_sav(struct tpg_data *tpg, bool insert_sav) in tpg_s_insert_sav() argument
587 tpg->insert_sav = insert_sav; in tpg_s_insert_sav()
590 static inline void tpg_s_insert_eav(struct tpg_data *tpg, bool insert_eav) in tpg_s_insert_eav() argument
592 tpg->insert_eav = insert_eav; in tpg_s_insert_eav()
604 static inline void tpg_s_insert_hdmi_video_guard_band(struct tpg_data *tpg, in tpg_s_insert_hdmi_video_guard_band() argument
607 tpg->insert_hdmi_video_guard_band = insert_hdmi_video_guard_band; in tpg_s_insert_hdmi_video_guard_band()
610 void tpg_update_mv_step(struct tpg_data *tpg);
612 static inline void tpg_s_mv_hor_mode(struct tpg_data *tpg, in tpg_s_mv_hor_mode() argument
615 tpg->mv_hor_mode = mv_hor_mode; in tpg_s_mv_hor_mode()
616 tpg_update_mv_step(tpg); in tpg_s_mv_hor_mode()
619 static inline void tpg_s_mv_vert_mode(struct tpg_data *tpg, in tpg_s_mv_vert_mode() argument
622 tpg->mv_vert_mode = mv_vert_mode; in tpg_s_mv_vert_mode()
623 tpg_update_mv_step(tpg); in tpg_s_mv_vert_mode()
626 static inline void tpg_init_mv_count(struct tpg_data *tpg) in tpg_init_mv_count() argument
628 tpg->mv_hor_count = tpg->mv_vert_count = 0; in tpg_init_mv_count()
631 static inline void tpg_update_mv_count(struct tpg_data *tpg, bool frame_is_field) in tpg_update_mv_count() argument
633 tpg->mv_hor_count += tpg->mv_hor_step * (frame_is_field ? 1 : 2); in tpg_update_mv_count()
634 tpg->mv_vert_count += tpg->mv_vert_step * (frame_is_field ? 1 : 2); in tpg_update_mv_count()
637 static inline void tpg_s_hflip(struct tpg_data *tpg, bool hflip) in tpg_s_hflip() argument
639 if (tpg->hflip == hflip) in tpg_s_hflip()
641 tpg->hflip = hflip; in tpg_s_hflip()
642 tpg_update_mv_step(tpg); in tpg_s_hflip()
643 tpg->recalc_lines = true; in tpg_s_hflip()
646 static inline bool tpg_g_hflip(const struct tpg_data *tpg) in tpg_g_hflip() argument
648 return tpg->hflip; in tpg_g_hflip()
651 static inline void tpg_s_vflip(struct tpg_data *tpg, bool vflip) in tpg_s_vflip() argument
653 tpg->vflip = vflip; in tpg_s_vflip()
656 static inline bool tpg_g_vflip(const struct tpg_data *tpg) in tpg_g_vflip() argument
658 return tpg->vflip; in tpg_g_vflip()
661 static inline bool tpg_pattern_is_static(const struct tpg_data *tpg) in tpg_pattern_is_static() argument
663 return tpg->pattern != TPG_PAT_NOISE && in tpg_pattern_is_static()
664 tpg->mv_hor_mode == TPG_MOVE_NONE && in tpg_pattern_is_static()
665 tpg->mv_vert_mode == TPG_MOVE_NONE; in tpg_pattern_is_static()