2013-06-04 22:22:30 +08:00
|
|
|
/*
|
|
|
|
* vsp1_rwpf.h -- R-Car VSP1 Read and Write Pixel Formatters
|
|
|
|
*
|
2014-02-07 01:42:31 +08:00
|
|
|
* Copyright (C) 2013-2014 Renesas Electronics Corporation
|
2013-06-04 22:22:30 +08:00
|
|
|
*
|
|
|
|
* Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
#ifndef __VSP1_RWPF_H__
|
|
|
|
#define __VSP1_RWPF_H__
|
|
|
|
|
|
|
|
#include <media/media-entity.h>
|
2014-05-22 06:00:05 +08:00
|
|
|
#include <media/v4l2-ctrls.h>
|
2013-06-04 22:22:30 +08: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-06 03:57:35 +08:00
|
|
|
struct v4l2_ctrl;
|
2015-11-15 08:27:52 +08:00
|
|
|
struct vsp1_dl_manager;
|
2015-07-29 01:05:56 +08:00
|
|
|
struct vsp1_rwpf;
|
2015-08-03 01:58:43 +08:00
|
|
|
struct vsp1_video;
|
2015-07-29 03:04:47 +08:00
|
|
|
|
|
|
|
struct vsp1_rwpf_memory {
|
|
|
|
dma_addr_t addr[3];
|
|
|
|
};
|
2015-07-29 01:05:56 +08:00
|
|
|
|
2013-06-04 22:22:30 +08:00
|
|
|
struct vsp1_rwpf {
|
|
|
|
struct vsp1_entity entity;
|
2014-05-22 06:00:05 +08:00
|
|
|
struct v4l2_ctrl_handler ctrls;
|
2013-06-04 22:22:30 +08:00
|
|
|
|
2015-08-03 01:58:43 +08:00
|
|
|
struct vsp1_video *video;
|
|
|
|
|
2013-06-04 22:22:30 +08:00
|
|
|
unsigned int max_width;
|
|
|
|
unsigned int max_height;
|
2013-08-25 07:49:58 +08:00
|
|
|
|
2015-07-29 01:00:43 +08:00
|
|
|
struct v4l2_pix_format_mplane format;
|
|
|
|
const struct vsp1_format_info *fmtinfo;
|
2015-11-16 05:14:22 +08:00
|
|
|
unsigned int bru_input;
|
2013-08-25 07:49:58 +08:00
|
|
|
|
2015-11-01 22:19:42 +08:00
|
|
|
unsigned int alpha;
|
|
|
|
|
2013-08-25 07:49:58 +08:00
|
|
|
unsigned int offsets[2];
|
2015-11-02 01:18:56 +08:00
|
|
|
struct vsp1_rwpf_memory mem;
|
2015-11-15 08:27:52 +08:00
|
|
|
|
|
|
|
struct vsp1_dl_manager *dlm;
|
2013-06-04 22:22:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev)
|
|
|
|
{
|
|
|
|
return container_of(subdev, struct vsp1_rwpf, entity.subdev);
|
|
|
|
}
|
|
|
|
|
2015-11-17 22:23:23 +08:00
|
|
|
static inline struct vsp1_rwpf *entity_to_rwpf(struct vsp1_entity *entity)
|
|
|
|
{
|
|
|
|
return container_of(entity, struct vsp1_rwpf, entity);
|
|
|
|
}
|
|
|
|
|
2013-06-04 22:22:30 +08: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);
|
|
|
|
|
2015-11-01 22:19:42 +08:00
|
|
|
int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf);
|
|
|
|
|
2015-11-22 23:37:45 +08:00
|
|
|
extern const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops;
|
2013-06-04 22:22:30 +08:00
|
|
|
|
2015-11-16 05:14:22 +08:00
|
|
|
struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
|
|
|
|
struct v4l2_subdev_pad_config *config);
|
2015-11-02 01:18:56 +08:00
|
|
|
/**
|
|
|
|
* vsp1_rwpf_set_memory - Configure DMA addresses for a [RW]PF
|
|
|
|
* @rwpf: the [RW]PF instance
|
2015-11-23 06:29:25 +08:00
|
|
|
* @dl: the display list
|
2015-11-02 01:18:56 +08:00
|
|
|
*
|
2015-11-23 06:29:25 +08:00
|
|
|
* This function applies the cached memory buffer address to the display list.
|
2015-11-02 01:18:56 +08:00
|
|
|
*/
|
2015-11-23 06:29:25 +08:00
|
|
|
static inline void vsp1_rwpf_set_memory(struct vsp1_rwpf *rwpf,
|
|
|
|
struct vsp1_dl_list *dl)
|
2015-11-02 01:18:56 +08:00
|
|
|
{
|
2015-11-23 06:29:25 +08:00
|
|
|
rwpf->entity.ops->set_memory(&rwpf->entity, dl);
|
2015-11-02 01:18:56 +08:00
|
|
|
}
|
2015-11-01 23:48:11 +08:00
|
|
|
|
2013-06-04 22:22:30 +08:00
|
|
|
#endif /* __VSP1_RWPF_H__ */
|