2018-04-23 00:33:20 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2013-06-04 18:22:30 +04:00
|
|
|
/*
|
|
|
|
* vsp1_rwpf.h -- R-Car VSP1 Read and Write Pixel Formatters
|
|
|
|
*
|
2014-02-06 21:42:31 +04:00
|
|
|
* Copyright (C) 2013-2014 Renesas Electronics Corporation
|
2013-06-04 18:22:30 +04:00
|
|
|
*
|
|
|
|
* Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
|
|
|
|
*/
|
|
|
|
#ifndef __VSP1_RWPF_H__
|
|
|
|
#define __VSP1_RWPF_H__
|
|
|
|
|
2016-05-26 11:14:22 +03:00
|
|
|
#include <linux/spinlock.h>
|
|
|
|
|
2013-06-04 18:22:30 +04:00
|
|
|
#include <media/media-entity.h>
|
2014-05-22 02:00:05 +04:00
|
|
|
#include <media/v4l2-ctrls.h>
|
2013-06-04 18:22:30 +04:00
|
|
|
#include <media/v4l2-subdev.h>
|
|
|
|
|
|
|
|
#include "vsp1.h"
|
|
|
|
#include "vsp1_entity.h"
|
|
|
|
|
|
|
|
#define RWPF_PAD_SINK 0
|
|
|
|
#define RWPF_PAD_SOURCE 1
|
|
|
|
|
2015-08-05 22:57:35 +03:00
|
|
|
struct v4l2_ctrl;
|
2015-11-15 03:27:52 +03:00
|
|
|
struct vsp1_dl_manager;
|
2015-07-28 20:05:56 +03:00
|
|
|
struct vsp1_rwpf;
|
2015-08-02 20:58:43 +03:00
|
|
|
struct vsp1_video;
|
2015-07-28 22:04:47 +03:00
|
|
|
|
|
|
|
struct vsp1_rwpf_memory {
|
|
|
|
dma_addr_t addr[3];
|
|
|
|
};
|
2015-07-28 20:05:56 +03:00
|
|
|
|
2013-06-04 18:22:30 +04:00
|
|
|
struct vsp1_rwpf {
|
|
|
|
struct vsp1_entity entity;
|
2014-05-22 02:00:05 +04:00
|
|
|
struct v4l2_ctrl_handler ctrls;
|
2013-06-04 18:22:30 +04:00
|
|
|
|
2015-08-02 20:58:43 +03:00
|
|
|
struct vsp1_video *video;
|
|
|
|
|
2013-06-04 18:22:30 +04:00
|
|
|
unsigned int max_width;
|
|
|
|
unsigned int max_height;
|
2013-08-25 03:49:58 +04:00
|
|
|
|
2015-07-28 20:00:43 +03:00
|
|
|
struct v4l2_pix_format_mplane format;
|
|
|
|
const struct vsp1_format_info *fmtinfo;
|
2018-02-26 19:06:21 +03:00
|
|
|
unsigned int brx_input;
|
2013-08-25 03:49:58 +04:00
|
|
|
|
2015-11-01 17:19:42 +03:00
|
|
|
unsigned int alpha;
|
|
|
|
|
2016-06-20 11:04:38 +03:00
|
|
|
u32 mult_alpha;
|
|
|
|
u32 outfmt;
|
|
|
|
|
2016-05-26 11:14:22 +03:00
|
|
|
struct {
|
|
|
|
spinlock_t lock;
|
2016-06-20 12:07:08 +03:00
|
|
|
struct {
|
|
|
|
struct v4l2_ctrl *vflip;
|
|
|
|
struct v4l2_ctrl *hflip;
|
|
|
|
struct v4l2_ctrl *rotate;
|
|
|
|
} ctrls;
|
2016-05-26 11:14:22 +03:00
|
|
|
unsigned int pending;
|
|
|
|
unsigned int active;
|
2016-06-20 12:07:08 +03:00
|
|
|
bool rotate;
|
2016-05-26 11:14:22 +03:00
|
|
|
} flip;
|
|
|
|
|
2015-11-01 20:18:56 +03:00
|
|
|
struct vsp1_rwpf_memory mem;
|
2015-11-15 03:27:52 +03:00
|
|
|
|
|
|
|
struct vsp1_dl_manager *dlm;
|
2013-06-04 18:22:30 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev)
|
|
|
|
{
|
|
|
|
return container_of(subdev, struct vsp1_rwpf, entity.subdev);
|
|
|
|
}
|
|
|
|
|
2015-11-17 17:23:23 +03:00
|
|
|
static inline struct vsp1_rwpf *entity_to_rwpf(struct vsp1_entity *entity)
|
|
|
|
{
|
|
|
|
return container_of(entity, struct vsp1_rwpf, entity);
|
|
|
|
}
|
|
|
|
|
2013-06-04 18:22:30 +04:00
|
|
|
struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index);
|
|
|
|
struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index);
|
|
|
|
|
2016-05-26 11:14:22 +03:00
|
|
|
int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf, unsigned int ncontrols);
|
2015-11-01 17:19:42 +03:00
|
|
|
|
2015-11-22 18:37:45 +03:00
|
|
|
extern const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops;
|
2013-06-04 18:22:30 +04:00
|
|
|
|
2015-11-16 00:14:22 +03:00
|
|
|
struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
|
|
|
|
struct v4l2_subdev_pad_config *config);
|
2015-11-01 18:48:11 +03:00
|
|
|
|
2013-06-04 18:22:30 +04:00
|
|
|
#endif /* __VSP1_RWPF_H__ */
|