]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - drivers/media/platform/vsp1/vsp1_rwpf.h
[media] v4l: vsp1: Pass display list explicitly to configure functions
[mirror_ubuntu-zesty-kernel.git] / drivers / media / platform / vsp1 / vsp1_rwpf.h
CommitLineData
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 26struct v4l2_ctrl;
ef9621bc 27struct vsp1_dl_manager;
b6af10cd 28struct vsp1_rwpf;
faf2644d 29struct vsp1_video;
b58faa95
LP
30
31struct vsp1_rwpf_memory {
b58faa95 32 dma_addr_t addr[3];
b58faa95 33};
b6af10cd 34
26e0ca22
LP
35struct vsp1_rwpf {
36 struct vsp1_entity entity;
7578c204 37 struct v4l2_ctrl_handler ctrls;
26e0ca22 38
faf2644d
LP
39 struct vsp1_video *video;
40
26e0ca22
LP
41 unsigned int max_width;
42 unsigned int max_height;
e5ad37b6 43
86960eec
LP
44 struct v4l2_pix_format_mplane format;
45 const struct vsp1_format_info *fmtinfo;
b7e5107e 46 unsigned int bru_input;
e5ad37b6 47
bd2fdd5a
LP
48 unsigned int alpha;
49
e5ad37b6 50 unsigned int offsets[2];
351bbf99 51 struct vsp1_rwpf_memory mem;
ef9621bc
LP
52
53 struct vsp1_dl_manager *dlm;
26e0ca22
LP
54};
55
56static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev)
57{
58 return container_of(subdev, struct vsp1_rwpf, entity.subdev);
59}
60
52434534
LP
61static inline struct vsp1_rwpf *entity_to_rwpf(struct vsp1_entity *entity)
62{
63 return container_of(entity, struct vsp1_rwpf, entity);
64}
65
26e0ca22
LP
66struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index);
67struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index);
68
bd2fdd5a
LP
69int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf);
70
c6c8efb6 71extern const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops;
26e0ca22 72
b7e5107e
LP
73struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
74 struct v4l2_subdev_pad_config *config);
351bbf99
LP
75/**
76 * vsp1_rwpf_set_memory - Configure DMA addresses for a [RW]PF
77 * @rwpf: the [RW]PF instance
5e8dbbf3 78 * @dl: the display list
351bbf99 79 *
5e8dbbf3 80 * This function applies the cached memory buffer address to the display list.
351bbf99 81 */
5e8dbbf3
LP
82static inline void vsp1_rwpf_set_memory(struct vsp1_rwpf *rwpf,
83 struct vsp1_dl_list *dl)
351bbf99 84{
5e8dbbf3 85 rwpf->entity.ops->set_memory(&rwpf->entity, dl);
351bbf99 86}
4d346be5 87
26e0ca22 88#endif /* __VSP1_RWPF_H__ */