Lines Matching refs:tpg
190 void tpg_init(struct tpg_data *tpg, unsigned w, unsigned h);
191 int tpg_alloc(struct tpg_data *tpg, unsigned max_w);
192 void tpg_free(struct tpg_data *tpg);
193 void tpg_reset_source(struct tpg_data *tpg, unsigned width, unsigned height,
197 void tpg_gen_text(const struct tpg_data *tpg,
199 void tpg_calc_text_basep(struct tpg_data *tpg,
201 unsigned tpg_g_interleaved_plane(const struct tpg_data *tpg, unsigned buf_line);
202 void tpg_fill_plane_buffer(struct tpg_data *tpg, v4l2_std_id std,
204 void tpg_fillbuffer(struct tpg_data *tpg, v4l2_std_id std,
206 bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc);
207 void tpg_s_crop_compose(struct tpg_data *tpg, const struct v4l2_rect *crop,
210 static inline void tpg_s_pattern(struct tpg_data *tpg, enum tpg_pattern pattern) in tpg_s_pattern() argument
212 if (tpg->pattern == pattern) in tpg_s_pattern()
214 tpg->pattern = pattern; in tpg_s_pattern()
215 tpg->recalc_colors = true; in tpg_s_pattern()
218 static inline void tpg_s_quality(struct tpg_data *tpg, in tpg_s_quality() argument
221 if (tpg->qual == qual && tpg->qual_offset == qual_offset) in tpg_s_quality()
223 tpg->qual = qual; in tpg_s_quality()
224 tpg->qual_offset = qual_offset; in tpg_s_quality()
225 tpg->recalc_colors = true; in tpg_s_quality()
228 static inline enum tpg_quality tpg_g_quality(const struct tpg_data *tpg) in tpg_g_quality() argument
230 return tpg->qual; in tpg_g_quality()
233 static inline void tpg_s_alpha_component(struct tpg_data *tpg, in tpg_s_alpha_component() argument
236 if (tpg->alpha_component == alpha_component) in tpg_s_alpha_component()
238 tpg->alpha_component = alpha_component; in tpg_s_alpha_component()
239 tpg->recalc_colors = true; in tpg_s_alpha_component()
242 static inline void tpg_s_alpha_mode(struct tpg_data *tpg, in tpg_s_alpha_mode() argument
245 if (tpg->alpha_red_only == red_only) in tpg_s_alpha_mode()
247 tpg->alpha_red_only = red_only; in tpg_s_alpha_mode()
248 tpg->recalc_colors = true; in tpg_s_alpha_mode()
251 static inline void tpg_s_brightness(struct tpg_data *tpg, in tpg_s_brightness() argument
254 if (tpg->brightness == brightness) in tpg_s_brightness()
256 tpg->brightness = brightness; in tpg_s_brightness()
257 tpg->recalc_colors = true; in tpg_s_brightness()
260 static inline void tpg_s_contrast(struct tpg_data *tpg, in tpg_s_contrast() argument
263 if (tpg->contrast == contrast) in tpg_s_contrast()
265 tpg->contrast = contrast; in tpg_s_contrast()
266 tpg->recalc_colors = true; in tpg_s_contrast()
269 static inline void tpg_s_saturation(struct tpg_data *tpg, in tpg_s_saturation() argument
272 if (tpg->saturation == saturation) in tpg_s_saturation()
274 tpg->saturation = saturation; in tpg_s_saturation()
275 tpg->recalc_colors = true; in tpg_s_saturation()
278 static inline void tpg_s_hue(struct tpg_data *tpg, in tpg_s_hue() argument
281 if (tpg->hue == hue) in tpg_s_hue()
283 tpg->hue = hue; in tpg_s_hue()
284 tpg->recalc_colors = true; in tpg_s_hue()
287 static inline void tpg_s_rgb_range(struct tpg_data *tpg, in tpg_s_rgb_range() argument
290 if (tpg->rgb_range == rgb_range) in tpg_s_rgb_range()
292 tpg->rgb_range = rgb_range; in tpg_s_rgb_range()
293 tpg->recalc_colors = true; in tpg_s_rgb_range()
296 static inline void tpg_s_real_rgb_range(struct tpg_data *tpg, in tpg_s_real_rgb_range() argument
299 if (tpg->real_rgb_range == rgb_range) in tpg_s_real_rgb_range()
301 tpg->real_rgb_range = rgb_range; in tpg_s_real_rgb_range()
302 tpg->recalc_colors = true; in tpg_s_real_rgb_range()
305 static inline void tpg_s_colorspace(struct tpg_data *tpg, u32 colorspace) in tpg_s_colorspace() argument
307 if (tpg->colorspace == colorspace) in tpg_s_colorspace()
309 tpg->colorspace = colorspace; in tpg_s_colorspace()
310 tpg->recalc_colors = true; in tpg_s_colorspace()
313 static inline u32 tpg_g_colorspace(const struct tpg_data *tpg) in tpg_g_colorspace() argument
315 return tpg->colorspace; in tpg_g_colorspace()
318 static inline void tpg_s_ycbcr_enc(struct tpg_data *tpg, u32 ycbcr_enc) in tpg_s_ycbcr_enc() argument
320 if (tpg->ycbcr_enc == ycbcr_enc) in tpg_s_ycbcr_enc()
322 tpg->ycbcr_enc = ycbcr_enc; in tpg_s_ycbcr_enc()
323 tpg->recalc_colors = true; in tpg_s_ycbcr_enc()
326 static inline u32 tpg_g_ycbcr_enc(const struct tpg_data *tpg) in tpg_g_ycbcr_enc() argument
328 return tpg->ycbcr_enc; in tpg_g_ycbcr_enc()
331 static inline void tpg_s_quantization(struct tpg_data *tpg, u32 quantization) in tpg_s_quantization() argument
333 if (tpg->quantization == quantization) in tpg_s_quantization()
335 tpg->quantization = quantization; in tpg_s_quantization()
336 tpg->recalc_colors = true; in tpg_s_quantization()
339 static inline u32 tpg_g_quantization(const struct tpg_data *tpg) in tpg_g_quantization() argument
341 return tpg->quantization; in tpg_g_quantization()
344 static inline unsigned tpg_g_buffers(const struct tpg_data *tpg) in tpg_g_buffers() argument
346 return tpg->buffers; in tpg_g_buffers()
349 static inline unsigned tpg_g_planes(const struct tpg_data *tpg) in tpg_g_planes() argument
351 return tpg->interleaved ? 1 : tpg->planes; in tpg_g_planes()
354 static inline bool tpg_g_interleaved(const struct tpg_data *tpg) in tpg_g_interleaved() argument
356 return tpg->interleaved; in tpg_g_interleaved()
359 static inline unsigned tpg_g_twopixelsize(const struct tpg_data *tpg, unsigned plane) in tpg_g_twopixelsize() argument
361 return tpg->twopixelsize[plane]; in tpg_g_twopixelsize()
364 static inline unsigned tpg_hdiv(const struct tpg_data *tpg, in tpg_hdiv() argument
367 return ((x / tpg->hdownsampling[plane]) & tpg->hmask[plane]) * in tpg_hdiv()
368 tpg->twopixelsize[plane] / 2; in tpg_hdiv()
371 static inline unsigned tpg_hscale(const struct tpg_data *tpg, unsigned x) in tpg_hscale() argument
373 return (x * tpg->scaled_width) / tpg->src_width; in tpg_hscale()
376 static inline unsigned tpg_hscale_div(const struct tpg_data *tpg, in tpg_hscale_div() argument
379 return tpg_hdiv(tpg, plane, tpg_hscale(tpg, x)); in tpg_hscale_div()
382 static inline unsigned tpg_g_bytesperline(const struct tpg_data *tpg, unsigned plane) in tpg_g_bytesperline() argument
384 return tpg->bytesperline[plane]; in tpg_g_bytesperline()
387 static inline void tpg_s_bytesperline(struct tpg_data *tpg, unsigned plane, unsigned bpl) in tpg_s_bytesperline() argument
391 if (tpg->buffers > 1) { in tpg_s_bytesperline()
392 tpg->bytesperline[plane] = bpl; in tpg_s_bytesperline()
396 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_s_bytesperline()
397 unsigned plane_w = bpl * tpg->twopixelsize[p] / tpg->twopixelsize[0]; in tpg_s_bytesperline()
399 tpg->bytesperline[p] = plane_w / tpg->hdownsampling[p]; in tpg_s_bytesperline()
404 static inline unsigned tpg_g_line_width(const struct tpg_data *tpg, unsigned plane) in tpg_g_line_width() argument
409 if (tpg->buffers > 1) in tpg_g_line_width()
410 return tpg_g_bytesperline(tpg, plane); in tpg_g_line_width()
411 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_g_line_width()
412 unsigned plane_w = tpg_g_bytesperline(tpg, p); in tpg_g_line_width()
414 w += plane_w / tpg->vdownsampling[p]; in tpg_g_line_width()
419 static inline unsigned tpg_calc_line_width(const struct tpg_data *tpg, in tpg_calc_line_width() argument
425 if (tpg->buffers > 1) in tpg_calc_line_width()
427 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_calc_line_width()
428 unsigned plane_w = bpl * tpg->twopixelsize[p] / tpg->twopixelsize[0]; in tpg_calc_line_width()
430 plane_w /= tpg->hdownsampling[p]; in tpg_calc_line_width()
431 w += plane_w / tpg->vdownsampling[p]; in tpg_calc_line_width()
436 static inline unsigned tpg_calc_plane_size(const struct tpg_data *tpg, unsigned plane) in tpg_calc_plane_size() argument
438 if (plane >= tpg_g_planes(tpg)) in tpg_calc_plane_size()
441 return tpg_g_bytesperline(tpg, plane) * tpg->buf_height / in tpg_calc_plane_size()
442 tpg->vdownsampling[plane]; in tpg_calc_plane_size()
445 static inline void tpg_s_buf_height(struct tpg_data *tpg, unsigned h) in tpg_s_buf_height() argument
447 tpg->buf_height = h; in tpg_s_buf_height()
450 static inline void tpg_s_field(struct tpg_data *tpg, unsigned field, bool alternate) in tpg_s_field() argument
452 tpg->field = field; in tpg_s_field()
453 tpg->field_alternate = alternate; in tpg_s_field()
456 static inline void tpg_s_perc_fill(struct tpg_data *tpg, in tpg_s_perc_fill() argument
459 tpg->perc_fill = perc_fill; in tpg_s_perc_fill()
462 static inline unsigned tpg_g_perc_fill(const struct tpg_data *tpg) in tpg_g_perc_fill() argument
464 return tpg->perc_fill; in tpg_g_perc_fill()
467 static inline void tpg_s_perc_fill_blank(struct tpg_data *tpg, in tpg_s_perc_fill_blank() argument
470 tpg->perc_fill_blank = perc_fill_blank; in tpg_s_perc_fill_blank()
473 static inline void tpg_s_video_aspect(struct tpg_data *tpg, in tpg_s_video_aspect() argument
476 if (tpg->vid_aspect == vid_aspect) in tpg_s_video_aspect()
478 tpg->vid_aspect = vid_aspect; in tpg_s_video_aspect()
479 tpg->recalc_square_border = true; in tpg_s_video_aspect()
482 static inline enum tpg_video_aspect tpg_g_video_aspect(const struct tpg_data *tpg) in tpg_g_video_aspect() argument
484 return tpg->vid_aspect; in tpg_g_video_aspect()
487 static inline void tpg_s_pixel_aspect(struct tpg_data *tpg, in tpg_s_pixel_aspect() argument
490 if (tpg->pix_aspect == pix_aspect) in tpg_s_pixel_aspect()
492 tpg->pix_aspect = pix_aspect; in tpg_s_pixel_aspect()
493 tpg->recalc_square_border = true; in tpg_s_pixel_aspect()
496 static inline void tpg_s_show_border(struct tpg_data *tpg, in tpg_s_show_border() argument
499 tpg->show_border = show_border; in tpg_s_show_border()
502 static inline void tpg_s_show_square(struct tpg_data *tpg, in tpg_s_show_square() argument
505 tpg->show_square = show_square; in tpg_s_show_square()
508 static inline void tpg_s_insert_sav(struct tpg_data *tpg, bool insert_sav) in tpg_s_insert_sav() argument
510 tpg->insert_sav = insert_sav; in tpg_s_insert_sav()
513 static inline void tpg_s_insert_eav(struct tpg_data *tpg, bool insert_eav) in tpg_s_insert_eav() argument
515 tpg->insert_eav = insert_eav; in tpg_s_insert_eav()
518 void tpg_update_mv_step(struct tpg_data *tpg);
520 static inline void tpg_s_mv_hor_mode(struct tpg_data *tpg, in tpg_s_mv_hor_mode() argument
523 tpg->mv_hor_mode = mv_hor_mode; in tpg_s_mv_hor_mode()
524 tpg_update_mv_step(tpg); in tpg_s_mv_hor_mode()
527 static inline void tpg_s_mv_vert_mode(struct tpg_data *tpg, in tpg_s_mv_vert_mode() argument
530 tpg->mv_vert_mode = mv_vert_mode; in tpg_s_mv_vert_mode()
531 tpg_update_mv_step(tpg); in tpg_s_mv_vert_mode()
534 static inline void tpg_init_mv_count(struct tpg_data *tpg) in tpg_init_mv_count() argument
536 tpg->mv_hor_count = tpg->mv_vert_count = 0; in tpg_init_mv_count()
539 static inline void tpg_update_mv_count(struct tpg_data *tpg, bool frame_is_field) in tpg_update_mv_count() argument
541 tpg->mv_hor_count += tpg->mv_hor_step * (frame_is_field ? 1 : 2); in tpg_update_mv_count()
542 tpg->mv_vert_count += tpg->mv_vert_step * (frame_is_field ? 1 : 2); in tpg_update_mv_count()
545 static inline void tpg_s_hflip(struct tpg_data *tpg, bool hflip) in tpg_s_hflip() argument
547 if (tpg->hflip == hflip) in tpg_s_hflip()
549 tpg->hflip = hflip; in tpg_s_hflip()
550 tpg_update_mv_step(tpg); in tpg_s_hflip()
551 tpg->recalc_lines = true; in tpg_s_hflip()
554 static inline bool tpg_g_hflip(const struct tpg_data *tpg) in tpg_g_hflip() argument
556 return tpg->hflip; in tpg_g_hflip()
559 static inline void tpg_s_vflip(struct tpg_data *tpg, bool vflip) in tpg_s_vflip() argument
561 tpg->vflip = vflip; in tpg_s_vflip()
564 static inline bool tpg_g_vflip(const struct tpg_data *tpg) in tpg_g_vflip() argument
566 return tpg->vflip; in tpg_g_vflip()
569 static inline bool tpg_pattern_is_static(const struct tpg_data *tpg) in tpg_pattern_is_static() argument
571 return tpg->pattern != TPG_PAT_NOISE && in tpg_pattern_is_static()
572 tpg->mv_hor_mode == TPG_MOVE_NONE && in tpg_pattern_is_static()
573 tpg->mv_vert_mode == TPG_MOVE_NONE; in tpg_pattern_is_static()