mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
Isp video implements v4l2 video interface and supports NV12 and YUYV. It manages buffers, pipeline power and state. Cherry-picked Sultan's DMA buffer related fix from branch v6.16-drm-tip-isp4-for-amd on https://github.com/kerneltoast/kernel_x86_laptop.git Co-developed-by: Sultan Alsawaf <sultan@kerneltoast.com> Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Co-developed-by: Svetoslav Stoilov <Svetoslav.Stoilov@amd.com> Signed-off-by: Svetoslav Stoilov <Svetoslav.Stoilov@amd.com> Signed-off-by: Bin Du <Bin.Du@amd.com> Reviewed-by: Sultan Alsawaf <sultan@kerneltoast.com> Tested-by: Alexey Zagorodnikov <xglooom@gmail.com> Tested-by: Kate Hsuan <hpa@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
58 lines
1.3 KiB
C
58 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Copyright (C) 2025 Advanced Micro Devices, Inc.
|
|
*/
|
|
|
|
#ifndef _ISP4_VIDEO_H_
|
|
#define _ISP4_VIDEO_H_
|
|
|
|
#include <media/v4l2-dev.h>
|
|
#include <media/videobuf2-memops.h>
|
|
|
|
#include "isp4_interface.h"
|
|
|
|
struct isp4vid_capture_buffer {
|
|
/*
|
|
* struct vb2_v4l2_buffer must be the first element
|
|
* the videobuf2 framework will allocate this struct based on
|
|
* buf_struct_size and use the first sizeof(struct vb2_buffer) bytes of
|
|
* memory as a vb2_buffer
|
|
*/
|
|
struct vb2_v4l2_buffer vb2;
|
|
struct isp4if_img_buf_info img_buf;
|
|
struct list_head list;
|
|
struct dma_buf *dbuf;
|
|
void *bo;
|
|
u64 gpu_addr;
|
|
};
|
|
|
|
struct isp4vid_dev {
|
|
struct video_device vdev;
|
|
struct media_pad vdev_pad;
|
|
struct v4l2_pix_format format;
|
|
|
|
/* mutex that protects vbq */
|
|
struct mutex vbq_lock;
|
|
struct vb2_queue vbq;
|
|
|
|
/* mutex that protects buf_list */
|
|
struct mutex buf_list_lock;
|
|
struct list_head buf_list;
|
|
|
|
u32 sequence;
|
|
bool stream_started;
|
|
|
|
struct device *dev;
|
|
struct v4l2_subdev *isp_sdev;
|
|
struct v4l2_fract timeperframe;
|
|
};
|
|
|
|
int isp4vid_dev_init(struct isp4vid_dev *isp_vdev, struct v4l2_subdev *isp_sd);
|
|
|
|
void isp4vid_dev_deinit(struct isp4vid_dev *isp_vdev);
|
|
|
|
void isp4vid_handle_frame_done(struct isp4vid_dev *isp_vdev,
|
|
const struct isp4if_img_buf_info *img_buf);
|
|
|
|
#endif /* _ISP4_VIDEO_H_ */
|