Snap for 8514048 from 658429a028
to android12-5.10-keystone-qcom-release
Change-Id: Iddc7731481623690a252ab9d021698639d59ec45
This commit is contained in:
@@ -585,19 +585,14 @@ int v4l2_m2m_reqbufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(v4l2_m2m_reqbufs);
|
EXPORT_SYMBOL_GPL(v4l2_m2m_reqbufs);
|
||||||
|
|
||||||
int v4l2_m2m_querybuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
|
static void v4l2_m2m_adjust_mem_offset(struct vb2_queue *vq,
|
||||||
struct v4l2_buffer *buf)
|
struct v4l2_buffer *buf)
|
||||||
{
|
{
|
||||||
struct vb2_queue *vq;
|
|
||||||
int ret = 0;
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
vq = v4l2_m2m_get_vq(m2m_ctx, buf->type);
|
|
||||||
ret = vb2_querybuf(vq, buf);
|
|
||||||
|
|
||||||
/* Adjust MMAP memory offsets for the CAPTURE queue */
|
/* Adjust MMAP memory offsets for the CAPTURE queue */
|
||||||
if (buf->memory == V4L2_MEMORY_MMAP && V4L2_TYPE_IS_CAPTURE(vq->type)) {
|
if (buf->memory == V4L2_MEMORY_MMAP && V4L2_TYPE_IS_CAPTURE(vq->type)) {
|
||||||
if (V4L2_TYPE_IS_MULTIPLANAR(vq->type)) {
|
if (V4L2_TYPE_IS_MULTIPLANAR(vq->type)) {
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < buf->length; ++i)
|
for (i = 0; i < buf->length; ++i)
|
||||||
buf->m.planes[i].m.mem_offset
|
buf->m.planes[i].m.mem_offset
|
||||||
+= DST_QUEUE_OFF_BASE;
|
+= DST_QUEUE_OFF_BASE;
|
||||||
@@ -605,8 +600,23 @@ int v4l2_m2m_querybuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
|
|||||||
buf->m.offset += DST_QUEUE_OFF_BASE;
|
buf->m.offset += DST_QUEUE_OFF_BASE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
int v4l2_m2m_querybuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
|
||||||
|
struct v4l2_buffer *buf)
|
||||||
|
{
|
||||||
|
struct vb2_queue *vq;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
vq = v4l2_m2m_get_vq(m2m_ctx, buf->type);
|
||||||
|
ret = vb2_querybuf(vq, buf);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
/* Adjust MMAP memory offsets for the CAPTURE queue */
|
||||||
|
v4l2_m2m_adjust_mem_offset(vq, buf);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(v4l2_m2m_querybuf);
|
EXPORT_SYMBOL_GPL(v4l2_m2m_querybuf);
|
||||||
|
|
||||||
@@ -763,6 +773,9 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/* Adjust MMAP memory offsets for the CAPTURE queue */
|
||||||
|
v4l2_m2m_adjust_mem_offset(vq, buf);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the capture queue is streaming, but streaming hasn't started
|
* If the capture queue is streaming, but streaming hasn't started
|
||||||
* on the device, but was asked to stop, mark the previously queued
|
* on the device, but was asked to stop, mark the previously queued
|
||||||
@@ -784,9 +797,17 @@ int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
|
|||||||
struct v4l2_buffer *buf)
|
struct v4l2_buffer *buf)
|
||||||
{
|
{
|
||||||
struct vb2_queue *vq;
|
struct vb2_queue *vq;
|
||||||
|
int ret;
|
||||||
|
|
||||||
vq = v4l2_m2m_get_vq(m2m_ctx, buf->type);
|
vq = v4l2_m2m_get_vq(m2m_ctx, buf->type);
|
||||||
return vb2_dqbuf(vq, buf, file->f_flags & O_NONBLOCK);
|
ret = vb2_dqbuf(vq, buf, file->f_flags & O_NONBLOCK);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
/* Adjust MMAP memory offsets for the CAPTURE queue */
|
||||||
|
v4l2_m2m_adjust_mem_offset(vq, buf);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(v4l2_m2m_dqbuf);
|
EXPORT_SYMBOL_GPL(v4l2_m2m_dqbuf);
|
||||||
|
|
||||||
@@ -795,9 +816,17 @@ int v4l2_m2m_prepare_buf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
|
|||||||
{
|
{
|
||||||
struct video_device *vdev = video_devdata(file);
|
struct video_device *vdev = video_devdata(file);
|
||||||
struct vb2_queue *vq;
|
struct vb2_queue *vq;
|
||||||
|
int ret;
|
||||||
|
|
||||||
vq = v4l2_m2m_get_vq(m2m_ctx, buf->type);
|
vq = v4l2_m2m_get_vq(m2m_ctx, buf->type);
|
||||||
return vb2_prepare_buf(vq, vdev->v4l2_dev->mdev, buf);
|
ret = vb2_prepare_buf(vq, vdev->v4l2_dev->mdev, buf);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
/* Adjust MMAP memory offsets for the CAPTURE queue */
|
||||||
|
v4l2_m2m_adjust_mem_offset(vq, buf);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(v4l2_m2m_prepare_buf);
|
EXPORT_SYMBOL_GPL(v4l2_m2m_prepare_buf);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user