media: rockchip: ispp: solving ispp compilation problems

Change-Id: I20a6eee6157eccee6ac117b561a472474ce36b9f
Signed-off-by: Lian Xu <xu.lian@rock-chips.com>
This commit is contained in:
Lian Xu
2021-11-04 14:58:35 +08:00
committed by Tao Huang
parent e3ee3291f7
commit 26d33fa19b
8 changed files with 35 additions and 46 deletions

View File

@@ -155,6 +155,7 @@ source "drivers/media/platform/atmel/Kconfig"
source "drivers/media/platform/sunxi/Kconfig"
source "drivers/media/platform/rockchip/cif/Kconfig"
source "drivers/media/platform/rockchip/isp/Kconfig"
source "drivers/media/platform/rockchip/ispp/Kconfig"
config VIDEO_TI_CAL
tristate "TI CAL (Camera Adaptation Layer) driver"

View File

@@ -55,6 +55,7 @@ obj-$(CONFIG_VIDEO_RENESAS_VSP1) += vsp1/
obj-$(CONFIG_VIDEO_ROCKCHIP_RGA) += rockchip/rga/
obj-$(CONFIG_VIDEO_ROCKCHIP_CIF) += rockchip/cif/
obj-$(CONFIG_VIDEO_ROCKCHIP_ISP) += rockchip/isp/
obj-$(CONFIG_VIDEO_ROCKCHIP_ISPP) += rockchip/ispp/
obj-y += omap/

View File

@@ -454,7 +454,7 @@ int rkispp_register_fec(struct rkispp_hw_dev *hw)
vfd = &fec->vfd;
vfd->lock = &fec->apilock;
vfd->v4l2_dev = v4l2_dev;
ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0);
ret = video_register_device(vfd, VFL_TYPE_VIDEO, 0);
if (ret) {
v4l2_err(v4l2_dev, "Failed to register video device\n");
goto unreg_v4l2;

View File

@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd. */
#include <linux/compat.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/iommu.h>

View File

@@ -8,6 +8,7 @@
#include <media/v4l2-event.h>
#include <media/v4l2-mc.h>
#include <linux/rkisp1-config.h>
#include <uapi/linux/rk-video-format.h>
#include "dev.h"
#include "regs.h"
@@ -743,10 +744,10 @@ rkispp_param_init_fecbuf(struct rkispp_params_vdev *params,
rkispp_write(pp_dev, RKISPP_FEC_MESH_YINT_BASE, val);
}
v4l2_dbg(1, rkispp_debug, &pp_dev->v4l2_dev,
"%s idx:%d fd:%d dma:0x%x offset xf:0x%x yf:0x%x xi:0x%x yi:0x%x\n",
__func__, i, params->buf_fec[i].dma_fd, params->buf_fec[i].dma_addr,
fec_data->meshxf_oft, fec_data->meshyf_oft,
fec_data->meshxi_oft, fec_data->meshyi_oft);
"%s idx:%d fd:%d dma:%pad offset xf:0x%x yf:0x%x xi:0x%x yi:0x%x\n",
__func__, i, params->buf_fec[i].dma_fd, &params->buf_fec[i].dma_addr,
fec_data->meshxf_oft, fec_data->meshyf_oft,
fec_data->meshxi_oft, fec_data->meshyi_oft);
}
return 0;
@@ -878,7 +879,7 @@ rkispp_param_fh_open(struct file *filp)
ret = v4l2_fh_open(filp);
if (!ret) {
ret = v4l2_pipeline_pm_use(&params->vnode.vdev.entity, 1);
ret = v4l2_pipeline_pm_get(&params->vnode.vdev.entity);
if (ret < 0) {
v4l2_err(&isppdev->v4l2_dev,
"pipeline power on failed %d\n", ret);
@@ -898,19 +899,14 @@ rkispp_param_fh_release(struct file *filp)
{
struct rkispp_params_vdev *params = video_drvdata(filp);
struct video_device *vdev = video_devdata(filp);
struct rkispp_device *isppdev = params->dev;
int ret;
if (filp->private_data == vdev->queue->owner)
rkispp_param_deinit_fecbuf(params);
ret = vb2_fop_release(filp);
if (!ret) {
ret = v4l2_pipeline_pm_use(&params->vnode.vdev.entity, 0);
if (ret < 0)
v4l2_err(&isppdev->v4l2_dev,
"pipeline power off failed %d\n", ret);
}
if (!ret)
v4l2_pipeline_pm_put(&params->vnode.vdev.entity);
return ret;
}
@@ -1115,7 +1111,7 @@ int rkispp_register_params_vdev(struct rkispp_device *dev)
ret = media_entity_pads_init(&vdev->entity, 1, &node->pad);
if (ret < 0)
goto err_release_queue;
ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
if (ret < 0) {
dev_err(&vdev->dev,
"could not register Video for Linux device\n");

View File

@@ -119,12 +119,11 @@ static int ispp_open(struct inode *inode, struct file *file)
return single_open(file, ispp_show, data);
}
static const struct file_operations ops = {
.owner = THIS_MODULE,
.open = ispp_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
static const struct proc_ops ops = {
.proc_open = ispp_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
};
int rkispp_proc_init(struct rkispp_device *dev)

View File

@@ -9,6 +9,7 @@
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-dma-sg.h>
#include <media/v4l2-mc.h>
#include <uapi/linux/rk-video-format.h>
#include "dev.h"
#include "regs.h"
#include "stats.h"
@@ -134,7 +135,7 @@ static int rkispp_stats_fh_open(struct file *filp)
ret = v4l2_fh_open(filp);
if (!ret) {
ret = v4l2_pipeline_pm_use(&stats->vnode.vdev.entity, 1);
ret = v4l2_pipeline_pm_get(&stats->vnode.vdev.entity);
if (ret < 0) {
v4l2_err(&isppdev->v4l2_dev,
"pipeline power on failed %d\n", ret);
@@ -147,16 +148,11 @@ static int rkispp_stats_fh_open(struct file *filp)
static int rkispp_stats_fh_release(struct file *filp)
{
struct rkispp_stats_vdev *stats = video_drvdata(filp);
struct rkispp_device *isppdev = stats->dev;
int ret;
ret = vb2_fop_release(filp);
if (!ret) {
ret = v4l2_pipeline_pm_use(&stats->vnode.vdev.entity, 0);
if (ret < 0)
v4l2_err(&isppdev->v4l2_dev,
"pipeline power off failed %d\n", ret);
}
if (!ret)
v4l2_pipeline_pm_put(&stats->vnode.vdev.entity);
return ret;
}
@@ -363,7 +359,7 @@ int rkispp_register_stats_vdev(struct rkispp_device *dev)
if (ret < 0)
goto err_release_queue;
ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
if (ret < 0) {
dev_err(&vdev->dev,
"could not register Video for Linux device\n");

View File

@@ -14,6 +14,7 @@
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-dma-sg.h>
#include <linux/rkisp1-config.h>
#include <uapi/linux/rk-video-format.h>
#include "dev.h"
#include "regs.h"
@@ -2094,7 +2095,7 @@ static int rkispp_fh_open(struct file *filp)
ret = v4l2_fh_open(filp);
if (!ret) {
ret = v4l2_pipeline_pm_use(&stream->vnode.vdev.entity, 1);
ret = v4l2_pipeline_pm_get(&stream->vnode.vdev.entity);
if (ret < 0) {
v4l2_err(&isppdev->v4l2_dev,
"pipeline power on failed %d\n", ret);
@@ -2107,16 +2108,11 @@ static int rkispp_fh_open(struct file *filp)
static int rkispp_fh_release(struct file *filp)
{
struct rkispp_stream *stream = video_drvdata(filp);
struct rkispp_device *isppdev = stream->isppdev;
int ret;
ret = vb2_fop_release(filp);
if (!ret) {
ret = v4l2_pipeline_pm_use(&stream->vnode.vdev.entity, 0);
if (ret < 0)
v4l2_err(&isppdev->v4l2_dev,
"pipeline power off failed %d\n", ret);
}
if (!ret)
v4l2_pipeline_pm_put(&stream->vnode.vdev.entity);
return ret;
}
@@ -2219,11 +2215,10 @@ static const struct v4l2_ioctl_ops rkispp_v4l2_ioctl_ops = {
.vidioc_streamoff = vb2_ioctl_streamoff,
.vidioc_enum_input = rkispp_enum_input,
.vidioc_try_fmt_vid_cap_mplane = rkispp_try_fmt_vid_mplane,
.vidioc_enum_fmt_vid_cap_mplane = rkispp_enum_fmt_vid_mplane,
.vidioc_enum_fmt_vid_cap = rkispp_enum_fmt_vid_mplane,
.vidioc_s_fmt_vid_cap_mplane = rkispp_s_fmt_vid_mplane,
.vidioc_g_fmt_vid_cap_mplane = rkispp_g_fmt_vid_mplane,
.vidioc_try_fmt_vid_out_mplane = rkispp_try_fmt_vid_mplane,
.vidioc_enum_fmt_vid_out_mplane = rkispp_enum_fmt_vid_mplane,
.vidioc_s_fmt_vid_out_mplane = rkispp_s_fmt_vid_mplane,
.vidioc_g_fmt_vid_out_mplane = rkispp_g_fmt_vid_mplane,
.vidioc_querycap = rkispp_querycap,
@@ -2270,7 +2265,7 @@ static int rkispp_register_stream_video(struct rkispp_stream *stream)
rkispp_init_vb2_queue(&node->buf_queue, stream, buf_type);
vdev->queue = &node->buf_queue;
ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
if (ret < 0) {
v4l2_err(v4l2_dev,
"video register failed with error %d\n", ret);
@@ -2325,8 +2320,8 @@ static void dump_file(struct rkispp_device *dev, u32 restart_module)
kernel_write(fp, buf->vaddr[0], vdev->tnr.cur_rd->dbuf[0]->size, &fp->f_pos);
filp_close(fp, NULL);
v4l2_dbg(1, rkispp_debug, &dev->v4l2_dev,
"dump tnr cur_rd dma:0x%x vaddr:%p\n",
buf->dma[0], buf->vaddr[0]);
"dump tnr cur_rd dma:%pad vaddr:%p\n",
&buf->dma[0], buf->vaddr[0]);
}
if (vdev->tnr.nxt_rd && vdev->tnr.nxt_rd != vdev->tnr.cur_rd) {
@@ -2342,8 +2337,8 @@ static void dump_file(struct rkispp_device *dev, u32 restart_module)
kernel_write(fp, buf->vaddr[0], vdev->tnr.nxt_rd->dbuf[0]->size, &fp->f_pos);
filp_close(fp, NULL);
v4l2_dbg(1, rkispp_debug, &dev->v4l2_dev,
"dump tnr nxt_rd dma:0x%x vaddr:%p\n",
buf->dma[0], buf->vaddr[0]);
"dump tnr nxt_rd dma:%pad vaddr:%p\n",
&buf->dma[0], buf->vaddr[0]);
}
}
@@ -2363,8 +2358,8 @@ static void dump_file(struct rkispp_device *dev, u32 restart_module)
kernel_write(fp, dummy->vaddr, dummy->size, &fp->f_pos);
filp_close(fp, NULL);
v4l2_dbg(1, rkispp_debug, &dev->v4l2_dev,
"dump tnr wr dma:0x%x vaddr:%p\n",
dummy->dma_addr, dummy->vaddr);
"dump tnr wr dma:%pad vaddr:%p\n",
&dummy->dma_addr, dummy->vaddr);
}
}
}