.. | .. |
---|
246 | 246 | struct v4l2_rect rect; |
---|
247 | 247 | dma_addr_t phys0; |
---|
248 | 248 | dma_addr_t phys1; |
---|
| 249 | + /* chroma plane offset overrides */ |
---|
| 250 | + u32 u_offset; |
---|
| 251 | + u32 v_offset; |
---|
249 | 252 | }; |
---|
250 | 253 | |
---|
251 | 254 | void ipu_cpmem_zero(struct ipuv3_channel *ch); |
---|
.. | .. |
---|
255 | 258 | void ipu_cpmem_set_high_priority(struct ipuv3_channel *ch); |
---|
256 | 259 | void ipu_cpmem_set_buffer(struct ipuv3_channel *ch, int bufnum, dma_addr_t buf); |
---|
257 | 260 | void ipu_cpmem_set_uv_offset(struct ipuv3_channel *ch, u32 u_off, u32 v_off); |
---|
258 | | -void ipu_cpmem_interlaced_scan(struct ipuv3_channel *ch, int stride); |
---|
| 261 | +void ipu_cpmem_interlaced_scan(struct ipuv3_channel *ch, int stride, |
---|
| 262 | + u32 pixelformat); |
---|
259 | 263 | void ipu_cpmem_set_axi_id(struct ipuv3_channel *ch, u32 id); |
---|
260 | 264 | int ipu_cpmem_get_burstsize(struct ipuv3_channel *ch); |
---|
261 | 265 | void ipu_cpmem_set_burstsize(struct ipuv3_channel *ch, int burstsize); |
---|
.. | .. |
---|
345 | 349 | unsigned int axi_id, unsigned int width, |
---|
346 | 350 | unsigned int height, unsigned int stride, |
---|
347 | 351 | u32 format, uint64_t modifier, unsigned long *eba); |
---|
| 352 | +bool ipu_prg_channel_configure_pending(struct ipuv3_channel *ipu_chan); |
---|
348 | 353 | |
---|
349 | 354 | /* |
---|
350 | 355 | * IPU CMOS Sensor Interface (csi) functions |
---|
351 | 356 | */ |
---|
352 | 357 | struct ipu_csi; |
---|
353 | 358 | int ipu_csi_init_interface(struct ipu_csi *csi, |
---|
354 | | - struct v4l2_mbus_config *mbus_cfg, |
---|
355 | | - struct v4l2_mbus_framefmt *mbus_fmt); |
---|
| 359 | + const struct v4l2_mbus_config *mbus_cfg, |
---|
| 360 | + const struct v4l2_mbus_framefmt *infmt, |
---|
| 361 | + const struct v4l2_mbus_framefmt *outfmt); |
---|
356 | 362 | bool ipu_csi_is_interlaced(struct ipu_csi *csi); |
---|
357 | 363 | void ipu_csi_get_window(struct ipu_csi *csi, struct v4l2_rect *w); |
---|
358 | 364 | void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w); |
---|
.. | .. |
---|
381 | 387 | IC_NUM_TASKS, |
---|
382 | 388 | }; |
---|
383 | 389 | |
---|
| 390 | +/* |
---|
| 391 | + * The parameters that describe a colorspace according to the |
---|
| 392 | + * Image Converter: |
---|
| 393 | + * - Y'CbCr encoding |
---|
| 394 | + * - quantization |
---|
| 395 | + * - "colorspace" (RGB or YUV). |
---|
| 396 | + */ |
---|
| 397 | +struct ipu_ic_colorspace { |
---|
| 398 | + enum v4l2_ycbcr_encoding enc; |
---|
| 399 | + enum v4l2_quantization quant; |
---|
| 400 | + enum ipu_color_space cs; |
---|
| 401 | +}; |
---|
| 402 | + |
---|
| 403 | +static inline void |
---|
| 404 | +ipu_ic_fill_colorspace(struct ipu_ic_colorspace *ic_cs, |
---|
| 405 | + enum v4l2_ycbcr_encoding enc, |
---|
| 406 | + enum v4l2_quantization quant, |
---|
| 407 | + enum ipu_color_space cs) |
---|
| 408 | +{ |
---|
| 409 | + ic_cs->enc = enc; |
---|
| 410 | + ic_cs->quant = quant; |
---|
| 411 | + ic_cs->cs = cs; |
---|
| 412 | +} |
---|
| 413 | + |
---|
| 414 | +struct ipu_ic_csc_params { |
---|
| 415 | + s16 coeff[3][3]; /* signed 9-bit integer coefficients */ |
---|
| 416 | + s16 offset[3]; /* signed 11+2-bit fixed point offset */ |
---|
| 417 | + u8 scale:2; /* scale coefficients * 2^(scale-1) */ |
---|
| 418 | + bool sat:1; /* saturate to (16, 235(Y) / 240(U, V)) */ |
---|
| 419 | +}; |
---|
| 420 | + |
---|
| 421 | +struct ipu_ic_csc { |
---|
| 422 | + struct ipu_ic_colorspace in_cs; |
---|
| 423 | + struct ipu_ic_colorspace out_cs; |
---|
| 424 | + struct ipu_ic_csc_params params; |
---|
| 425 | +}; |
---|
| 426 | + |
---|
384 | 427 | struct ipu_ic; |
---|
| 428 | + |
---|
| 429 | +int __ipu_ic_calc_csc(struct ipu_ic_csc *csc); |
---|
| 430 | +int ipu_ic_calc_csc(struct ipu_ic_csc *csc, |
---|
| 431 | + enum v4l2_ycbcr_encoding in_enc, |
---|
| 432 | + enum v4l2_quantization in_quant, |
---|
| 433 | + enum ipu_color_space in_cs, |
---|
| 434 | + enum v4l2_ycbcr_encoding out_enc, |
---|
| 435 | + enum v4l2_quantization out_quant, |
---|
| 436 | + enum ipu_color_space out_cs); |
---|
385 | 437 | int ipu_ic_task_init(struct ipu_ic *ic, |
---|
| 438 | + const struct ipu_ic_csc *csc, |
---|
386 | 439 | int in_width, int in_height, |
---|
387 | | - int out_width, int out_height, |
---|
388 | | - enum ipu_color_space in_cs, |
---|
389 | | - enum ipu_color_space out_cs); |
---|
| 440 | + int out_width, int out_height); |
---|
| 441 | +int ipu_ic_task_init_rsc(struct ipu_ic *ic, |
---|
| 442 | + const struct ipu_ic_csc *csc, |
---|
| 443 | + int in_width, int in_height, |
---|
| 444 | + int out_width, int out_height, |
---|
| 445 | + u32 rsc); |
---|
390 | 446 | int ipu_ic_task_graphics_init(struct ipu_ic *ic, |
---|
391 | | - enum ipu_color_space in_g_cs, |
---|
| 447 | + const struct ipu_ic_colorspace *g_in_cs, |
---|
392 | 448 | bool galpha_en, u32 galpha, |
---|
393 | 449 | bool colorkey_en, u32 colorkey); |
---|
394 | 450 | void ipu_ic_task_enable(struct ipu_ic *ic); |
---|
.. | .. |
---|
428 | 484 | |
---|
429 | 485 | enum ipu_color_space ipu_drm_fourcc_to_colorspace(u32 drm_fourcc); |
---|
430 | 486 | enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat); |
---|
431 | | -enum ipu_color_space ipu_mbus_code_to_colorspace(u32 mbus_code); |
---|
432 | | -int ipu_stride_to_bytes(u32 pixel_stride, u32 pixelformat); |
---|
433 | | -bool ipu_pixelformat_is_planar(u32 pixelformat); |
---|
434 | 487 | int ipu_degrees_to_rot_mode(enum ipu_rotate_mode *mode, int degrees, |
---|
435 | 488 | bool hflip, bool vflip); |
---|
436 | 489 | int ipu_rot_mode_to_degrees(int *degrees, enum ipu_rotate_mode mode, |
---|