Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp56611pxj; Fri, 7 May 2021 03:41:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS8aVJq4/t80Zqj3Jlj3+pJ6ta6LJlviT3P1XF+MOMH6x4LtHsFMwiGUcQYM/3Ao/499B7 X-Received: by 2002:aa7:c495:: with SMTP id m21mr10499448edq.123.1620384094817; Fri, 07 May 2021 03:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620384094; cv=none; d=google.com; s=arc-20160816; b=QpAwjpkKCDo1XodJrhZnPvahQJLlXiD7z7l1Mf/hxXRDOFs2nYy0WeerdoFWuEkcz0 iZd1i/l0ub5w0c/SnNw/IsWmSdgla3HVVzZZJwf0AJUFnc0oD8NzSDiHikNHDfg03VdF Pkql5WB8virSVtwjvXNVKnyEKQyL42m3nlmK/ZdKXyXt5Ig4ozvoeCdgFhFU07h7IcvU GBWasSAWcSApCq85EA/v8/DXEp5T6qZc3M63vPkMiXN794DqYRWtIzW5L6wX+eTcUhHw MjHN+c9hI2MEjyYy6THzyL3okd4DU8HwO6zrUp/m0ZmD5D9H5Q9hx0qi0LqbUlmcCO8u CP3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=UgRh5KfDDbFRI/wQ89elAN7IBzMdn9AriNkbP2tyFJk=; b=Fw5jwjygP/+efKG0Lg3UIn0WS2Hln3+uZShqsQ7PgFbZUhJ+vtQrub1j7Aij8PX9Yt N4PQwP5GZeYKcbxpk0HTSop9LSeIkDPe277JkY8TGTbulKEunE39kpMZH6EEf7b7fVyo w38aLwl8h3/VrzmFidF8obuzQbwi6K2Ps1IqS73UMyu4z/0qf+hSavEiMNSrv31TkyNr V8WIhl90deBK2dCo8TPTK90no1u80evLdCLMqoQSK/7m87kJRsQ7by2pdOM9W1jsLYLF 5Oz4jWWOTnkQCUXJC1F0c1e/q66tCWbzpTGUwFwx+lcvoFTCKGpbU5bs9Gh0YKTdXEJ3 jBQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si4570049ejq.537.2021.05.07.03.41.10; Fri, 07 May 2021 03:41:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235637AbhEGHrR (ORCPT + 99 others); Fri, 7 May 2021 03:47:17 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:51490 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231165AbhEGHrQ (ORCPT ); Fri, 7 May 2021 03:47:16 -0400 X-UUID: dabb758a172b4f50a8b0f6e7c7624a13-20210507 X-UUID: dabb758a172b4f50a8b0f6e7c7624a13-20210507 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 213113289; Fri, 07 May 2021 15:46:12 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 15:46:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 May 2021 15:46:10 +0800 From: Louis Kuo To: , , , , , , , , , , CC: , , , , Subject: [RESENT PATCH V0 0/4] media: some framework interface extension for new feature of Mediatek Camsys driver Date: Fri, 7 May 2021 15:46:00 +0800 Message-ID: <20210507074604.15079-1-louis.kuo@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This is the first version of the patch series extending V4L2 and media framework to support some advanced camera function, for example, to change the sensor when ISP is still streaming. A typical scenario is the wide-angle sensor and telephoto sensor switching in camera application. When the user is using the zooming UI, the application needs to switch the sensor from wide-angle sensor to telephoto sensor smoothly. To finish the function, we may need to modify the links of a pipeline and the format of pad and video device per request. Currently, the link, pad and video device format and selection settings are not involved in media request's design. Therefore, we try to extend the related interface to support the request-based operations. In the early version, we added request fd to the parameters of MEDIA_IOC_SETUP_LINK, VIDIOC_S_FMT, VIDIOC_SUBDEV_S_SELECTION, VIDIOC_SUBDEV_S_FMT. The driver uses media_request_get_by_fd() to retrieve the media request and save the pending change in it, so that we can apply the pending change in req_queue() callback then. Here is an example: int mtk_cam_vidioc_s_selection(struct file *file, void *fh, struct v4l2_selection *s) { struct mtk_cam_device *cam = video_drvdata(file); struct mtk_cam_video_device *node = file_to_mtk_cam_node(file); struct mtk_cam_request_stream_data *stream_data; struct mtk_cam_request *cam_req; struct media_request *req; s32 fd; fd = s->request_fd; if (fd < 0) return -EINVAL; req = media_request_get_by_fd(&cam->media_dev, fd); /* .... */ cam_req = to_mtk_cam_req(req); stream_data = &cam_req->stream_data[node->uid.pipe_id]; stream_data->vdev_selection_update |= (1 << node->desc.id); stream_data->vdev_selection[node->desc.id] = *s; /* .... */ media_request_put(req); return 0; } I posted interface change to discuss first and would like some review comments. Thank you very much. media: v4l2-core: extend the v4l2 format to support request media: subdev: support which in v4l2_subdev_frame_interval media: v4l2-ctrl: Add ISP Camsys user control media: pixfmt: Add ISP Camsys formats drivers/media/mc/mc-device.c | 7 +- drivers/media/v4l2-core/v4l2-ioctl.c | 153 ++++++++++++++++++++++++++- include/media/media-entity.h | 3 + include/uapi/linux/media.h | 3 +- include/uapi/linux/v4l2-controls.h | 4 + include/uapi/linux/v4l2-subdev.h | 8 +- include/uapi/linux/videodev2.h | 109 ++++++++++++++++++- 7 files changed, 275 insertions(+), 12 deletions(-)