mirror of
https://github.com/armbian/build.git
synced 2025-08-15 15:46:58 +02:00
71 lines
2.5 KiB
Diff
71 lines
2.5 KiB
Diff
From 304c180d9f6f9cadc42a3ed40b5f82629dd3aeda Mon Sep 17 00:00:00 2001
|
|
From: Vedang Nagar <quic_vnagar@quicinc.com>
|
|
Date: Fri, 7 Feb 2025 13:24:51 +0530
|
|
Subject: [PATCH] media: iris: implement g_selection ioctl
|
|
|
|
Implement the g_selection ioctl op in the driver with the necessary
|
|
hooks.
|
|
|
|
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
|
|
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
Tested-by: Stefan Schmidt <stefan.schmidt@linaro.org> # x1e80100 (Dell XPS 13 9345)
|
|
Reviewed-by: Stefan Schmidt <stefan.schmidt@linaro.org>
|
|
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
|
|
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-HDK
|
|
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
|
|
Link: https://lore.kernel.org/r/20250207-qcom-video-iris-v10-11-ab66eeffbd20@quicinc.com
|
|
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
|
|
---
|
|
drivers/media/platform/qcom/iris/iris_vidc.c | 28 ++++++++++++++++++++
|
|
1 file changed, 28 insertions(+)
|
|
|
|
diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c
|
|
index bec965284b6e..92eb793cbeb7 100644
|
|
--- a/drivers/media/platform/qcom/iris/iris_vidc.c
|
|
+++ b/drivers/media/platform/qcom/iris/iris_vidc.c
|
|
@@ -259,6 +259,33 @@ static int iris_g_fmt_vid_mplane(struct file *filp, void *fh, struct v4l2_format
|
|
return ret;
|
|
}
|
|
|
|
+static int iris_g_selection(struct file *filp, void *fh, struct v4l2_selection *s)
|
|
+{
|
|
+ struct iris_inst *inst = iris_get_inst(filp, NULL);
|
|
+
|
|
+ if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
|
|
+ return -EINVAL;
|
|
+
|
|
+ switch (s->target) {
|
|
+ case V4L2_SEL_TGT_CROP_BOUNDS:
|
|
+ case V4L2_SEL_TGT_CROP_DEFAULT:
|
|
+ case V4L2_SEL_TGT_CROP:
|
|
+ case V4L2_SEL_TGT_COMPOSE_BOUNDS:
|
|
+ case V4L2_SEL_TGT_COMPOSE_PADDED:
|
|
+ case V4L2_SEL_TGT_COMPOSE_DEFAULT:
|
|
+ case V4L2_SEL_TGT_COMPOSE:
|
|
+ s->r.left = inst->crop.left;
|
|
+ s->r.top = inst->crop.top;
|
|
+ s->r.width = inst->crop.width;
|
|
+ s->r.height = inst->crop.height;
|
|
+ break;
|
|
+ default:
|
|
+ return -EINVAL;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static struct v4l2_file_operations iris_v4l2_file_ops = {
|
|
.owner = THIS_MODULE,
|
|
.open = iris_open,
|
|
@@ -280,6 +307,7 @@ static const struct v4l2_ioctl_ops iris_v4l2_ioctl_ops = {
|
|
.vidioc_g_fmt_vid_cap_mplane = iris_g_fmt_vid_mplane,
|
|
.vidioc_g_fmt_vid_out_mplane = iris_g_fmt_vid_mplane,
|
|
.vidioc_reqbufs = v4l2_m2m_ioctl_reqbufs,
|
|
+ .vidioc_g_selection = iris_g_selection,
|
|
};
|
|
|
|
void iris_init_ops(struct iris_core *core)
|
|
--
|
|
2.34.1
|
|
|