Commit | Line | Data |
---|---|---|
26e0ca22 LP |
1 | /* |
2 | * vsp1_rwpf.h -- R-Car VSP1 Read and Write Pixel Formatters | |
3 | * | |
8a1edc55 | 4 | * Copyright (C) 2013-2014 Renesas Electronics Corporation |
26e0ca22 LP |
5 | * |
6 | * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; either version 2 of the License, or | |
11 | * (at your option) any later version. | |
12 | */ | |
13 | #ifndef __VSP1_RWPF_H__ | |
14 | #define __VSP1_RWPF_H__ | |
15 | ||
16 | #include <media/media-entity.h> | |
7578c204 | 17 | #include <media/v4l2-ctrls.h> |
26e0ca22 LP |
18 | #include <media/v4l2-subdev.h> |
19 | ||
20 | #include "vsp1.h" | |
21 | #include "vsp1_entity.h" | |
26e0ca22 LP |
22 | |
23 | #define RWPF_PAD_SINK 0 | |
24 | #define RWPF_PAD_SOURCE 1 | |
25 | ||
3dbb6100 | 26 | struct v4l2_ctrl; |
b6af10cd | 27 | struct vsp1_rwpf; |
faf2644d | 28 | struct vsp1_video; |
b58faa95 LP |
29 | |
30 | struct vsp1_rwpf_memory { | |
31 | unsigned int num_planes; | |
32 | dma_addr_t addr[3]; | |
33 | unsigned int length[3]; | |
34 | }; | |
b6af10cd LP |
35 | |
36 | struct vsp1_rwpf_operations { | |
b58faa95 LP |
37 | void (*set_memory)(struct vsp1_rwpf *rwpf, |
38 | struct vsp1_rwpf_memory *mem); | |
b6af10cd LP |
39 | }; |
40 | ||
26e0ca22 LP |
41 | struct vsp1_rwpf { |
42 | struct vsp1_entity entity; | |
7578c204 | 43 | struct v4l2_ctrl_handler ctrls; |
3dbb6100 | 44 | struct v4l2_ctrl *alpha; |
26e0ca22 | 45 | |
faf2644d LP |
46 | struct vsp1_video *video; |
47 | ||
b6af10cd LP |
48 | const struct vsp1_rwpf_operations *ops; |
49 | ||
26e0ca22 LP |
50 | unsigned int max_width; |
51 | unsigned int max_height; | |
e5ad37b6 | 52 | |
86960eec LP |
53 | struct v4l2_pix_format_mplane format; |
54 | const struct vsp1_format_info *fmtinfo; | |
629bb6d4 LP |
55 | struct { |
56 | unsigned int left; | |
57 | unsigned int top; | |
58 | } location; | |
e5ad37b6 LP |
59 | struct v4l2_rect crop; |
60 | ||
61 | unsigned int offsets[2]; | |
857161fc | 62 | dma_addr_t buf_addr[3]; |
26e0ca22 LP |
63 | }; |
64 | ||
65 | static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev) | |
66 | { | |
67 | return container_of(subdev, struct vsp1_rwpf, entity.subdev); | |
68 | } | |
69 | ||
70 | struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index); | |
71 | struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index); | |
72 | ||
73 | int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev, | |
f7234138 | 74 | struct v4l2_subdev_pad_config *cfg, |
26e0ca22 LP |
75 | struct v4l2_subdev_mbus_code_enum *code); |
76 | int vsp1_rwpf_enum_frame_size(struct v4l2_subdev *subdev, | |
f7234138 | 77 | struct v4l2_subdev_pad_config *cfg, |
26e0ca22 | 78 | struct v4l2_subdev_frame_size_enum *fse); |
f7234138 | 79 | int vsp1_rwpf_get_format(struct v4l2_subdev *subdev, struct v4l2_subdev_pad_config *cfg, |
26e0ca22 | 80 | struct v4l2_subdev_format *fmt); |
f7234138 | 81 | int vsp1_rwpf_set_format(struct v4l2_subdev *subdev, struct v4l2_subdev_pad_config *cfg, |
26e0ca22 | 82 | struct v4l2_subdev_format *fmt); |
e5ad37b6 | 83 | int vsp1_rwpf_get_selection(struct v4l2_subdev *subdev, |
f7234138 | 84 | struct v4l2_subdev_pad_config *cfg, |
e5ad37b6 LP |
85 | struct v4l2_subdev_selection *sel); |
86 | int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev, | |
f7234138 | 87 | struct v4l2_subdev_pad_config *cfg, |
e5ad37b6 | 88 | struct v4l2_subdev_selection *sel); |
26e0ca22 LP |
89 | |
90 | #endif /* __VSP1_RWPF_H__ */ |