mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-02 08:32:55 +00:00

Video node formats have direct dependency by the sub-device pad formats. Remove dependency for SoC version and move format definitions in device which creates video node. This commit attaches a struct to the VFE resources that holds format description, so it is much easier to assign them to the video node. No need to use a switch-case. NOTE: The mbus_bpp is used to calculate the clock rates and is different from bpp which is the bits per pixel written to memory. We need to keep both values to not break the calcualtions. Signed-off-by: Radoslav Tsvetkov <quic_rtsvetko@quicinc.com> Signed-off-by: Gjorgji Rosikopulos <quic_grosikop@quicinc.com> Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
59 lines
1.4 KiB
C
59 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* camss-video.h
|
|
*
|
|
* Qualcomm MSM Camera Subsystem - V4L2 device node
|
|
*
|
|
* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
|
* Copyright (C) 2015-2018 Linaro Ltd.
|
|
*/
|
|
#ifndef QC_MSM_CAMSS_VIDEO_H
|
|
#define QC_MSM_CAMSS_VIDEO_H
|
|
|
|
#include <linux/mutex.h>
|
|
#include <linux/videodev2.h>
|
|
#include <media/media-entity.h>
|
|
#include <media/v4l2-dev.h>
|
|
#include <media/v4l2-device.h>
|
|
#include <media/v4l2-fh.h>
|
|
#include <media/v4l2-mediabus.h>
|
|
#include <media/videobuf2-v4l2.h>
|
|
|
|
struct camss_buffer {
|
|
struct vb2_v4l2_buffer vb;
|
|
dma_addr_t addr[3];
|
|
struct list_head queue;
|
|
};
|
|
|
|
struct camss_video;
|
|
|
|
struct camss_video_ops {
|
|
int (*queue_buffer)(struct camss_video *vid, struct camss_buffer *buf);
|
|
int (*flush_buffers)(struct camss_video *vid,
|
|
enum vb2_buffer_state state);
|
|
};
|
|
|
|
struct camss_video {
|
|
struct camss *camss;
|
|
struct vb2_queue vb2_q;
|
|
struct video_device vdev;
|
|
struct media_pad pad;
|
|
struct v4l2_format active_fmt;
|
|
enum v4l2_buf_type type;
|
|
struct media_pipeline pipe;
|
|
const struct camss_video_ops *ops;
|
|
struct mutex lock;
|
|
struct mutex q_lock;
|
|
unsigned int bpl_alignment;
|
|
unsigned int line_based;
|
|
const struct camss_format_info *formats;
|
|
unsigned int nformats;
|
|
};
|
|
|
|
int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev,
|
|
const char *name);
|
|
|
|
void msm_video_unregister(struct camss_video *video);
|
|
|
|
#endif /* QC_MSM_CAMSS_VIDEO_H */
|