Lines Matching refs:tpg

196 void tpg_init(struct tpg_data *tpg, unsigned w, unsigned h);
197 int tpg_alloc(struct tpg_data *tpg, unsigned max_w);
198 void tpg_free(struct tpg_data *tpg);
199 void tpg_reset_source(struct tpg_data *tpg, unsigned width, unsigned height,
201 void tpg_log_status(struct tpg_data *tpg);
204 void tpg_gen_text(const struct tpg_data *tpg,
206 void tpg_calc_text_basep(struct tpg_data *tpg,
208 unsigned tpg_g_interleaved_plane(const struct tpg_data *tpg, unsigned buf_line);
209 void tpg_fill_plane_buffer(struct tpg_data *tpg, v4l2_std_id std,
211 void tpg_fillbuffer(struct tpg_data *tpg, v4l2_std_id std,
213 bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc);
214 void tpg_s_crop_compose(struct tpg_data *tpg, const struct v4l2_rect *crop,
217 static inline void tpg_s_pattern(struct tpg_data *tpg, enum tpg_pattern pattern) in tpg_s_pattern() argument
219 if (tpg->pattern == pattern) in tpg_s_pattern()
221 tpg->pattern = pattern; in tpg_s_pattern()
222 tpg->recalc_colors = true; in tpg_s_pattern()
225 static inline void tpg_s_quality(struct tpg_data *tpg, in tpg_s_quality() argument
228 if (tpg->qual == qual && tpg->qual_offset == qual_offset) in tpg_s_quality()
230 tpg->qual = qual; in tpg_s_quality()
231 tpg->qual_offset = qual_offset; in tpg_s_quality()
232 tpg->recalc_colors = true; in tpg_s_quality()
235 static inline enum tpg_quality tpg_g_quality(const struct tpg_data *tpg) in tpg_g_quality() argument
237 return tpg->qual; in tpg_g_quality()
240 static inline void tpg_s_alpha_component(struct tpg_data *tpg, in tpg_s_alpha_component() argument
243 if (tpg->alpha_component == alpha_component) in tpg_s_alpha_component()
245 tpg->alpha_component = alpha_component; in tpg_s_alpha_component()
246 tpg->recalc_colors = true; in tpg_s_alpha_component()
249 static inline void tpg_s_alpha_mode(struct tpg_data *tpg, in tpg_s_alpha_mode() argument
252 if (tpg->alpha_red_only == red_only) in tpg_s_alpha_mode()
254 tpg->alpha_red_only = red_only; in tpg_s_alpha_mode()
255 tpg->recalc_colors = true; in tpg_s_alpha_mode()
258 static inline void tpg_s_brightness(struct tpg_data *tpg, in tpg_s_brightness() argument
261 if (tpg->brightness == brightness) in tpg_s_brightness()
263 tpg->brightness = brightness; in tpg_s_brightness()
264 tpg->recalc_colors = true; in tpg_s_brightness()
267 static inline void tpg_s_contrast(struct tpg_data *tpg, in tpg_s_contrast() argument
270 if (tpg->contrast == contrast) in tpg_s_contrast()
272 tpg->contrast = contrast; in tpg_s_contrast()
273 tpg->recalc_colors = true; in tpg_s_contrast()
276 static inline void tpg_s_saturation(struct tpg_data *tpg, in tpg_s_saturation() argument
279 if (tpg->saturation == saturation) in tpg_s_saturation()
281 tpg->saturation = saturation; in tpg_s_saturation()
282 tpg->recalc_colors = true; in tpg_s_saturation()
285 static inline void tpg_s_hue(struct tpg_data *tpg, in tpg_s_hue() argument
288 if (tpg->hue == hue) in tpg_s_hue()
290 tpg->hue = hue; in tpg_s_hue()
291 tpg->recalc_colors = true; in tpg_s_hue()
294 static inline void tpg_s_rgb_range(struct tpg_data *tpg, in tpg_s_rgb_range() argument
297 if (tpg->rgb_range == rgb_range) in tpg_s_rgb_range()
299 tpg->rgb_range = rgb_range; in tpg_s_rgb_range()
300 tpg->recalc_colors = true; in tpg_s_rgb_range()
303 static inline void tpg_s_real_rgb_range(struct tpg_data *tpg, in tpg_s_real_rgb_range() argument
306 if (tpg->real_rgb_range == rgb_range) in tpg_s_real_rgb_range()
308 tpg->real_rgb_range = rgb_range; in tpg_s_real_rgb_range()
309 tpg->recalc_colors = true; in tpg_s_real_rgb_range()
312 static inline void tpg_s_colorspace(struct tpg_data *tpg, u32 colorspace) in tpg_s_colorspace() argument
314 if (tpg->colorspace == colorspace) in tpg_s_colorspace()
316 tpg->colorspace = colorspace; in tpg_s_colorspace()
317 tpg->recalc_colors = true; in tpg_s_colorspace()
320 static inline u32 tpg_g_colorspace(const struct tpg_data *tpg) in tpg_g_colorspace() argument
322 return tpg->colorspace; in tpg_g_colorspace()
325 static inline void tpg_s_ycbcr_enc(struct tpg_data *tpg, u32 ycbcr_enc) in tpg_s_ycbcr_enc() argument
327 if (tpg->ycbcr_enc == ycbcr_enc) in tpg_s_ycbcr_enc()
329 tpg->ycbcr_enc = ycbcr_enc; in tpg_s_ycbcr_enc()
330 tpg->recalc_colors = true; in tpg_s_ycbcr_enc()
333 static inline u32 tpg_g_ycbcr_enc(const struct tpg_data *tpg) in tpg_g_ycbcr_enc() argument
335 return tpg->ycbcr_enc; in tpg_g_ycbcr_enc()
338 static inline void tpg_s_xfer_func(struct tpg_data *tpg, u32 xfer_func) in tpg_s_xfer_func() argument
340 if (tpg->xfer_func == xfer_func) in tpg_s_xfer_func()
342 tpg->xfer_func = xfer_func; in tpg_s_xfer_func()
343 tpg->recalc_colors = true; in tpg_s_xfer_func()
346 static inline u32 tpg_g_xfer_func(const struct tpg_data *tpg) in tpg_g_xfer_func() argument
348 return tpg->xfer_func; in tpg_g_xfer_func()
351 static inline void tpg_s_quantization(struct tpg_data *tpg, u32 quantization) in tpg_s_quantization() argument
353 if (tpg->quantization == quantization) in tpg_s_quantization()
355 tpg->quantization = quantization; in tpg_s_quantization()
356 tpg->recalc_colors = true; in tpg_s_quantization()
359 static inline u32 tpg_g_quantization(const struct tpg_data *tpg) in tpg_g_quantization() argument
361 return tpg->quantization; in tpg_g_quantization()
364 static inline unsigned tpg_g_buffers(const struct tpg_data *tpg) in tpg_g_buffers() argument
366 return tpg->buffers; in tpg_g_buffers()
369 static inline unsigned tpg_g_planes(const struct tpg_data *tpg) in tpg_g_planes() argument
371 return tpg->interleaved ? 1 : tpg->planes; in tpg_g_planes()
374 static inline bool tpg_g_interleaved(const struct tpg_data *tpg) in tpg_g_interleaved() argument
376 return tpg->interleaved; in tpg_g_interleaved()
379 static inline unsigned tpg_g_twopixelsize(const struct tpg_data *tpg, unsigned plane) in tpg_g_twopixelsize() argument
381 return tpg->twopixelsize[plane]; in tpg_g_twopixelsize()
384 static inline unsigned tpg_hdiv(const struct tpg_data *tpg, in tpg_hdiv() argument
387 return ((x / tpg->hdownsampling[plane]) & tpg->hmask[plane]) * in tpg_hdiv()
388 tpg->twopixelsize[plane] / 2; in tpg_hdiv()
391 static inline unsigned tpg_hscale(const struct tpg_data *tpg, unsigned x) in tpg_hscale() argument
393 return (x * tpg->scaled_width) / tpg->src_width; in tpg_hscale()
396 static inline unsigned tpg_hscale_div(const struct tpg_data *tpg, in tpg_hscale_div() argument
399 return tpg_hdiv(tpg, plane, tpg_hscale(tpg, x)); in tpg_hscale_div()
402 static inline unsigned tpg_g_bytesperline(const struct tpg_data *tpg, unsigned plane) in tpg_g_bytesperline() argument
404 return tpg->bytesperline[plane]; in tpg_g_bytesperline()
407 static inline void tpg_s_bytesperline(struct tpg_data *tpg, unsigned plane, unsigned bpl) in tpg_s_bytesperline() argument
411 if (tpg->buffers > 1) { in tpg_s_bytesperline()
412 tpg->bytesperline[plane] = bpl; in tpg_s_bytesperline()
416 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_s_bytesperline()
417 unsigned plane_w = bpl * tpg->twopixelsize[p] / tpg->twopixelsize[0]; in tpg_s_bytesperline()
419 tpg->bytesperline[p] = plane_w / tpg->hdownsampling[p]; in tpg_s_bytesperline()
424 static inline unsigned tpg_g_line_width(const struct tpg_data *tpg, unsigned plane) in tpg_g_line_width() argument
429 if (tpg->buffers > 1) in tpg_g_line_width()
430 return tpg_g_bytesperline(tpg, plane); in tpg_g_line_width()
431 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_g_line_width()
432 unsigned plane_w = tpg_g_bytesperline(tpg, p); in tpg_g_line_width()
434 w += plane_w / tpg->vdownsampling[p]; in tpg_g_line_width()
439 static inline unsigned tpg_calc_line_width(const struct tpg_data *tpg, in tpg_calc_line_width() argument
445 if (tpg->buffers > 1) in tpg_calc_line_width()
447 for (p = 0; p < tpg_g_planes(tpg); p++) { in tpg_calc_line_width()
448 unsigned plane_w = bpl * tpg->twopixelsize[p] / tpg->twopixelsize[0]; in tpg_calc_line_width()
450 plane_w /= tpg->hdownsampling[p]; in tpg_calc_line_width()
451 w += plane_w / tpg->vdownsampling[p]; in tpg_calc_line_width()
456 static inline unsigned tpg_calc_plane_size(const struct tpg_data *tpg, unsigned plane) in tpg_calc_plane_size() argument
458 if (plane >= tpg_g_planes(tpg)) in tpg_calc_plane_size()
461 return tpg_g_bytesperline(tpg, plane) * tpg->buf_height / in tpg_calc_plane_size()
462 tpg->vdownsampling[plane]; in tpg_calc_plane_size()
465 static inline void tpg_s_buf_height(struct tpg_data *tpg, unsigned h) in tpg_s_buf_height() argument
467 tpg->buf_height = h; in tpg_s_buf_height()
470 static inline void tpg_s_field(struct tpg_data *tpg, unsigned field, bool alternate) in tpg_s_field() argument
472 tpg->field = field; in tpg_s_field()
473 tpg->field_alternate = alternate; in tpg_s_field()
476 static inline void tpg_s_perc_fill(struct tpg_data *tpg, in tpg_s_perc_fill() argument
479 tpg->perc_fill = perc_fill; in tpg_s_perc_fill()
482 static inline unsigned tpg_g_perc_fill(const struct tpg_data *tpg) in tpg_g_perc_fill() argument
484 return tpg->perc_fill; in tpg_g_perc_fill()
487 static inline void tpg_s_perc_fill_blank(struct tpg_data *tpg, in tpg_s_perc_fill_blank() argument
490 tpg->perc_fill_blank = perc_fill_blank; in tpg_s_perc_fill_blank()
493 static inline void tpg_s_video_aspect(struct tpg_data *tpg, in tpg_s_video_aspect() argument
496 if (tpg->vid_aspect == vid_aspect) in tpg_s_video_aspect()
498 tpg->vid_aspect = vid_aspect; in tpg_s_video_aspect()
499 tpg->recalc_square_border = true; in tpg_s_video_aspect()
502 static inline enum tpg_video_aspect tpg_g_video_aspect(const struct tpg_data *tpg) in tpg_g_video_aspect() argument
504 return tpg->vid_aspect; in tpg_g_video_aspect()
507 static inline void tpg_s_pixel_aspect(struct tpg_data *tpg, in tpg_s_pixel_aspect() argument
510 if (tpg->pix_aspect == pix_aspect) in tpg_s_pixel_aspect()
512 tpg->pix_aspect = pix_aspect; in tpg_s_pixel_aspect()
513 tpg->recalc_square_border = true; in tpg_s_pixel_aspect()
516 static inline void tpg_s_show_border(struct tpg_data *tpg, in tpg_s_show_border() argument
519 tpg->show_border = show_border; in tpg_s_show_border()
522 static inline void tpg_s_show_square(struct tpg_data *tpg, in tpg_s_show_square() argument
525 tpg->show_square = show_square; in tpg_s_show_square()
528 static inline void tpg_s_insert_sav(struct tpg_data *tpg, bool insert_sav) in tpg_s_insert_sav() argument
530 tpg->insert_sav = insert_sav; in tpg_s_insert_sav()
533 static inline void tpg_s_insert_eav(struct tpg_data *tpg, bool insert_eav) in tpg_s_insert_eav() argument
535 tpg->insert_eav = insert_eav; in tpg_s_insert_eav()
538 void tpg_update_mv_step(struct tpg_data *tpg);
540 static inline void tpg_s_mv_hor_mode(struct tpg_data *tpg, in tpg_s_mv_hor_mode() argument
543 tpg->mv_hor_mode = mv_hor_mode; in tpg_s_mv_hor_mode()
544 tpg_update_mv_step(tpg); in tpg_s_mv_hor_mode()
547 static inline void tpg_s_mv_vert_mode(struct tpg_data *tpg, in tpg_s_mv_vert_mode() argument
550 tpg->mv_vert_mode = mv_vert_mode; in tpg_s_mv_vert_mode()
551 tpg_update_mv_step(tpg); in tpg_s_mv_vert_mode()
554 static inline void tpg_init_mv_count(struct tpg_data *tpg) in tpg_init_mv_count() argument
556 tpg->mv_hor_count = tpg->mv_vert_count = 0; in tpg_init_mv_count()
559 static inline void tpg_update_mv_count(struct tpg_data *tpg, bool frame_is_field) in tpg_update_mv_count() argument
561 tpg->mv_hor_count += tpg->mv_hor_step * (frame_is_field ? 1 : 2); in tpg_update_mv_count()
562 tpg->mv_vert_count += tpg->mv_vert_step * (frame_is_field ? 1 : 2); in tpg_update_mv_count()
565 static inline void tpg_s_hflip(struct tpg_data *tpg, bool hflip) in tpg_s_hflip() argument
567 if (tpg->hflip == hflip) in tpg_s_hflip()
569 tpg->hflip = hflip; in tpg_s_hflip()
570 tpg_update_mv_step(tpg); in tpg_s_hflip()
571 tpg->recalc_lines = true; in tpg_s_hflip()
574 static inline bool tpg_g_hflip(const struct tpg_data *tpg) in tpg_g_hflip() argument
576 return tpg->hflip; in tpg_g_hflip()
579 static inline void tpg_s_vflip(struct tpg_data *tpg, bool vflip) in tpg_s_vflip() argument
581 tpg->vflip = vflip; in tpg_s_vflip()
584 static inline bool tpg_g_vflip(const struct tpg_data *tpg) in tpg_g_vflip() argument
586 return tpg->vflip; in tpg_g_vflip()
589 static inline bool tpg_pattern_is_static(const struct tpg_data *tpg) in tpg_pattern_is_static() argument
591 return tpg->pattern != TPG_PAT_NOISE && in tpg_pattern_is_static()
592 tpg->mv_hor_mode == TPG_MOVE_NONE && in tpg_pattern_is_static()
593 tpg->mv_vert_mode == TPG_MOVE_NONE; in tpg_pattern_is_static()