Lines Matching refs:tpg

235 void tpg_init(struct tpg_data *tpg, unsigned w, unsigned h);
236 int tpg_alloc(struct tpg_data *tpg, unsigned max_w);
237 void tpg_free(struct tpg_data *tpg);
238 void tpg_reset_source(struct tpg_data *tpg, unsigned width, unsigned height,
240 void tpg_log_status(struct tpg_data *tpg);
243 void tpg_gen_text(const struct tpg_data *tpg,
245 void tpg_calc_text_basep(struct tpg_data *tpg,
247 unsigned tpg_g_interleaved_plane(const struct tpg_data *tpg, unsigned buf_line);
248 void tpg_fill_plane_buffer(struct tpg_data *tpg, v4l2_std_id std,
250 void tpg_fillbuffer(struct tpg_data *tpg, v4l2_std_id std,
252 bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc);
253 void tpg_s_crop_compose(struct tpg_data *tpg, const struct v4l2_rect *crop,
255 const char *tpg_g_color_order(const struct tpg_data *tpg);
257 static inline void tpg_s_pattern(struct tpg_data *tpg, enum tpg_pattern pattern) in tpg_s_pattern() argument
259 if (tpg->pattern == pattern) in tpg_s_pattern()
261 tpg->pattern = pattern; in tpg_s_pattern()
262 tpg->recalc_colors = true; in tpg_s_pattern()
265 static inline void tpg_s_quality(struct tpg_data *tpg, in tpg_s_quality() argument
268 if (tpg->qual == qual && tpg->qual_offset == qual_offset) in tpg_s_quality()
270 tpg->qual = qual; in tpg_s_quality()
271 tpg->qual_offset = qual_offset; in tpg_s_quality()
272 tpg->recalc_colors = true; in tpg_s_quality()
275 static inline enum tpg_quality tpg_g_quality(const struct tpg_data *tpg) in tpg_g_quality() argument
277 return tpg->qual; in tpg_g_quality()
280 static inline void tpg_s_alpha_component(struct tpg_data *tpg, in tpg_s_alpha_component() argument
283 if (tpg->alpha_component == alpha_component) in tpg_s_alpha_component()
285 tpg->alpha_component = alpha_component; in tpg_s_alpha_component()
286 tpg->recalc_colors = true; in tpg_s_alpha_component()
289 static inline void tpg_s_alpha_mode(struct tpg_data *tpg, in tpg_s_alpha_mode() argument
292 if (tpg->alpha_red_only == red_only) in tpg_s_alpha_mode()
294 tpg->alpha_red_only = red_only; in tpg_s_alpha_mode()
295 tpg->recalc_colors = true; in tpg_s_alpha_mode()
298 static inline void tpg_s_brightness(struct tpg_data *tpg, in tpg_s_brightness() argument
301 if (tpg->brightness == brightness) in tpg_s_brightness()
303 tpg->brightness = brightness; in tpg_s_brightness()
304 tpg->recalc_colors = true; in tpg_s_brightness()
307 static inline void tpg_s_contrast(struct tpg_data *tpg, in tpg_s_contrast() argument
310 if (tpg->contrast == contrast) in tpg_s_contrast()
312 tpg->contrast = contrast; in tpg_s_contrast()
313 tpg->recalc_colors = true; in tpg_s_contrast()
316 static inline void tpg_s_saturation(struct tpg_data *tpg, in tpg_s_saturation() argument
319 if (tpg->saturation == saturation) in tpg_s_saturation()
321 tpg->saturation = saturation; in tpg_s_saturation()
322 tpg->recalc_colors = true; in tpg_s_saturation()
325 static inline void tpg_s_hue(struct tpg_data *tpg, in tpg_s_hue() argument
329 if (tpg->hue == hue) in tpg_s_hue()
331 tpg->hue = hue; in tpg_s_hue()
332 tpg->recalc_colors = true; in tpg_s_hue()
335 static inline void tpg_s_rgb_range(struct tpg_data *tpg, in tpg_s_rgb_range() argument
338 if (tpg->rgb_range == rgb_range) in tpg_s_rgb_range()
340 tpg->rgb_range = rgb_range; in tpg_s_rgb_range()
341 tpg->recalc_colors = true; in tpg_s_rgb_range()
344 static inline void tpg_s_real_rgb_range(struct tpg_data *tpg, in tpg_s_real_rgb_range() argument
347 if (tpg->real_rgb_range == rgb_range) in tpg_s_real_rgb_range()
349 tpg->real_rgb_range = rgb_range; in tpg_s_real_rgb_range()
350 tpg->recalc_colors = true; in tpg_s_real_rgb_range()
353 static inline void tpg_s_colorspace(struct tpg_data *tpg, u32 colorspace) in tpg_s_colorspace() argument
355 if (tpg->colorspace == colorspace) in tpg_s_colorspace()
357 tpg->colorspace = colorspace; in tpg_s_colorspace()
358 tpg->recalc_colors = true; in tpg_s_colorspace()
361 static inline u32 tpg_g_colorspace(const struct tpg_data *tpg) in tpg_g_colorspace() argument
363 return tpg->colorspace; in tpg_g_colorspace()
366 static inline void tpg_s_ycbcr_enc(struct tpg_data *tpg, u32 ycbcr_enc) in tpg_s_ycbcr_enc() argument
368 if (tpg->ycbcr_enc == ycbcr_enc) in tpg_s_ycbcr_enc()
370 tpg->ycbcr_enc = ycbcr_enc; in tpg_s_ycbcr_enc()
371 tpg->recalc_colors = true; in tpg_s_ycbcr_enc()
374 static inline u32 tpg_g_ycbcr_enc(const struct tpg_data *tpg) in tpg_g_ycbcr_enc() argument
376 return tpg->ycbcr_enc; in tpg_g_ycbcr_enc()
379 static inline void tpg_s_hsv_enc(struct tpg_data *tpg, u32 hsv_enc) in tpg_s_hsv_enc() argument
381 if (tpg->hsv_enc == hsv_enc) in tpg_s_hsv_enc()
383 tpg->hsv_enc = hsv_enc; in tpg_s_hsv_enc()
384 tpg->recalc_colors = true; in tpg_s_hsv_enc()
387 static inline u32 tpg_g_hsv_enc(const struct tpg_data *tpg) in tpg_g_hsv_enc() argument
389 return tpg->hsv_enc; in tpg_g_hsv_enc()
392 static inline void tpg_s_xfer_func(struct tpg_data *tpg, u32 xfer_func) in tpg_s_xfer_func() argument
394 if (tpg->xfer_func == xfer_func) in tpg_s_xfer_func()
396 tpg->xfer_func = xfer_func; in tpg_s_xfer_func()
397 tpg->recalc_colors = true; in tpg_s_xfer_func()
400 static inline u32 tpg_g_xfer_func(const struct tpg_data *tpg) in tpg_g_xfer_func() argument
402 return tpg->xfer_func; in tpg_g_xfer_func()
405 static inline void tpg_s_quantization(struct tpg_data *tpg, u32 quantization) in tpg_s_quantization() argument
407 if (tpg->quantization == quantization) in tpg_s_quantization()
409 tpg->quantization = quantization; in tpg_s_quantization()
410 tpg->recalc_colors = true; in tpg_s_quantization()
413 static inline u32 tpg_g_quantization(const struct tpg_data *tpg) in tpg_g_quantization() argument
415 return tpg->quantization; in tpg_g_quantization()
418 static inline unsigned tpg_g_buffers(const struct tpg_data *tpg) in tpg_g_buffers() argument
420 return tpg->buffers; in tpg_g_buffers()
423 static inline unsigned tpg_g_planes(const struct tpg_data *tpg) in tpg_g_planes() argument
425 return tpg->interleaved ? 1 : tpg->planes; in tpg_g_planes()
428 static inline bool tpg_g_interleaved(const struct tpg_data *tpg) in tpg_g_interleaved() argument
430 return tpg->interleaved; in tpg_g_interleaved()
433 static inline unsigned tpg_g_twopixelsize(const struct tpg_data *tpg, unsigned plane) in tpg_g_twopixelsize() argument
435 return tpg->twopixelsize[plane]; in tpg_g_twopixelsize()
438 static inline unsigned tpg_hdiv(const struct tpg_data *tpg, in tpg_hdiv() argument
441 return ((x / tpg->hdownsampling[plane]) & tpg->hmask[plane]) * in tpg_hdiv()
442 tpg->twopixelsize[plane] / 2; in tpg_hdiv()
445 static inline unsigned tpg_hscale(const struct tpg_data *tpg, unsigned x) in tpg_hscale() argument
447 return (x * tpg->scaled_width) / tpg->src_width; in tpg_hscale()
450 static inline unsigned tpg_hscale_div(const struct tpg_data *tpg, in tpg_hscale_div() argument
453 return tpg_hdiv(tpg, plane, tpg_hscale(tpg, x)); in tpg_hscale_div()
456 static inline unsigned tpg_g_bytesperline(const struct tpg_data *tpg, unsigned plane) in tpg_g_bytesperline() argument
458 return tpg->bytesperline[plane]; in tpg_g_bytesperline()
461 static inline void tpg_s_bytesperline(struct tpg_data *tpg, unsigned plane, unsigned bpl) in tpg_s_bytesperline() argument
465 if (tpg->buffers > 1) { in tpg_s_bytesperline()
466 tpg->bytesperline[plane] = bpl; in tpg_s_bytesperline()
470 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_s_bytesperline()
471 unsigned plane_w = bpl * tpg->twopixelsize[p] / tpg->twopixelsize[0]; in tpg_s_bytesperline()
473 tpg->bytesperline[p] = plane_w / tpg->hdownsampling[p]; in tpg_s_bytesperline()
475 if (tpg_g_interleaved(tpg)) in tpg_s_bytesperline()
476 tpg->bytesperline[1] = tpg->bytesperline[0]; in tpg_s_bytesperline()
480 static inline unsigned tpg_g_line_width(const struct tpg_data *tpg, unsigned plane) in tpg_g_line_width() argument
485 if (tpg->buffers > 1) in tpg_g_line_width()
486 return tpg_g_bytesperline(tpg, plane); in tpg_g_line_width()
487 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_g_line_width()
488 unsigned plane_w = tpg_g_bytesperline(tpg, p); in tpg_g_line_width()
490 w += plane_w / tpg->vdownsampling[p]; in tpg_g_line_width()
495 static inline unsigned tpg_calc_line_width(const struct tpg_data *tpg, in tpg_calc_line_width() argument
501 if (tpg->buffers > 1) in tpg_calc_line_width()
503 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_calc_line_width()
504 unsigned plane_w = bpl * tpg->twopixelsize[p] / tpg->twopixelsize[0]; in tpg_calc_line_width()
506 plane_w /= tpg->hdownsampling[p]; in tpg_calc_line_width()
507 w += plane_w / tpg->vdownsampling[p]; in tpg_calc_line_width()
512 static inline unsigned tpg_calc_plane_size(const struct tpg_data *tpg, unsigned plane) in tpg_calc_plane_size() argument
514 if (plane >= tpg_g_planes(tpg)) in tpg_calc_plane_size()
517 return tpg_g_bytesperline(tpg, plane) * tpg->buf_height / in tpg_calc_plane_size()
518 tpg->vdownsampling[plane]; in tpg_calc_plane_size()
521 static inline void tpg_s_buf_height(struct tpg_data *tpg, unsigned h) in tpg_s_buf_height() argument
523 tpg->buf_height = h; in tpg_s_buf_height()
526 static inline void tpg_s_field(struct tpg_data *tpg, unsigned field, bool alternate) in tpg_s_field() argument
528 tpg->field = field; in tpg_s_field()
529 tpg->field_alternate = alternate; in tpg_s_field()
532 static inline void tpg_s_perc_fill(struct tpg_data *tpg, in tpg_s_perc_fill() argument
535 tpg->perc_fill = perc_fill; in tpg_s_perc_fill()
538 static inline unsigned tpg_g_perc_fill(const struct tpg_data *tpg) in tpg_g_perc_fill() argument
540 return tpg->perc_fill; in tpg_g_perc_fill()
543 static inline void tpg_s_perc_fill_blank(struct tpg_data *tpg, in tpg_s_perc_fill_blank() argument
546 tpg->perc_fill_blank = perc_fill_blank; in tpg_s_perc_fill_blank()
549 static inline void tpg_s_video_aspect(struct tpg_data *tpg, in tpg_s_video_aspect() argument
552 if (tpg->vid_aspect == vid_aspect) in tpg_s_video_aspect()
554 tpg->vid_aspect = vid_aspect; in tpg_s_video_aspect()
555 tpg->recalc_square_border = true; in tpg_s_video_aspect()
558 static inline enum tpg_video_aspect tpg_g_video_aspect(const struct tpg_data *tpg) in tpg_g_video_aspect() argument
560 return tpg->vid_aspect; in tpg_g_video_aspect()
563 static inline void tpg_s_pixel_aspect(struct tpg_data *tpg, in tpg_s_pixel_aspect() argument
566 if (tpg->pix_aspect == pix_aspect) in tpg_s_pixel_aspect()
568 tpg->pix_aspect = pix_aspect; in tpg_s_pixel_aspect()
569 tpg->recalc_square_border = true; in tpg_s_pixel_aspect()
572 static inline void tpg_s_show_border(struct tpg_data *tpg, in tpg_s_show_border() argument
575 tpg->show_border = show_border; in tpg_s_show_border()
578 static inline void tpg_s_show_square(struct tpg_data *tpg, in tpg_s_show_square() argument
581 tpg->show_square = show_square; in tpg_s_show_square()
584 static inline void tpg_s_insert_sav(struct tpg_data *tpg, bool insert_sav) in tpg_s_insert_sav() argument
586 tpg->insert_sav = insert_sav; in tpg_s_insert_sav()
589 static inline void tpg_s_insert_eav(struct tpg_data *tpg, bool insert_eav) in tpg_s_insert_eav() argument
591 tpg->insert_eav = insert_eav; in tpg_s_insert_eav()
594 void tpg_update_mv_step(struct tpg_data *tpg);
596 static inline void tpg_s_mv_hor_mode(struct tpg_data *tpg, in tpg_s_mv_hor_mode() argument
599 tpg->mv_hor_mode = mv_hor_mode; in tpg_s_mv_hor_mode()
600 tpg_update_mv_step(tpg); in tpg_s_mv_hor_mode()
603 static inline void tpg_s_mv_vert_mode(struct tpg_data *tpg, in tpg_s_mv_vert_mode() argument
606 tpg->mv_vert_mode = mv_vert_mode; in tpg_s_mv_vert_mode()
607 tpg_update_mv_step(tpg); in tpg_s_mv_vert_mode()
610 static inline void tpg_init_mv_count(struct tpg_data *tpg) in tpg_init_mv_count() argument
612 tpg->mv_hor_count = tpg->mv_vert_count = 0; in tpg_init_mv_count()
615 static inline void tpg_update_mv_count(struct tpg_data *tpg, bool frame_is_field) in tpg_update_mv_count() argument
617 tpg->mv_hor_count += tpg->mv_hor_step * (frame_is_field ? 1 : 2); in tpg_update_mv_count()
618 tpg->mv_vert_count += tpg->mv_vert_step * (frame_is_field ? 1 : 2); in tpg_update_mv_count()
621 static inline void tpg_s_hflip(struct tpg_data *tpg, bool hflip) in tpg_s_hflip() argument
623 if (tpg->hflip == hflip) in tpg_s_hflip()
625 tpg->hflip = hflip; in tpg_s_hflip()
626 tpg_update_mv_step(tpg); in tpg_s_hflip()
627 tpg->recalc_lines = true; in tpg_s_hflip()
630 static inline bool tpg_g_hflip(const struct tpg_data *tpg) in tpg_g_hflip() argument
632 return tpg->hflip; in tpg_g_hflip()
635 static inline void tpg_s_vflip(struct tpg_data *tpg, bool vflip) in tpg_s_vflip() argument
637 tpg->vflip = vflip; in tpg_s_vflip()
640 static inline bool tpg_g_vflip(const struct tpg_data *tpg) in tpg_g_vflip() argument
642 return tpg->vflip; in tpg_g_vflip()
645 static inline bool tpg_pattern_is_static(const struct tpg_data *tpg) in tpg_pattern_is_static() argument
647 return tpg->pattern != TPG_PAT_NOISE && in tpg_pattern_is_static()
648 tpg->mv_hor_mode == TPG_MOVE_NONE && in tpg_pattern_is_static()
649 tpg->mv_vert_mode == TPG_MOVE_NONE; in tpg_pattern_is_static()