From patchwork Fri Nov 1 11:25:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 11222929 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFC9813BD for ; Fri, 1 Nov 2019 11:25:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95688217F9 for ; Fri, 1 Nov 2019 11:25:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572607531; bh=f7z50vaHptEB/IsdALtjYC+75XPYhMyFj3b0kyhw/kE=; h=From:To:Cc:Subject:Date:List-ID:From; b=GLcXSBZzNU+5qtGiOm3sGcD5HpyBN/6ZrvEyfpscqUPhwI7+EkM9r1nu76dINdMga o+9pNRsLeyyfwr8+cO/XqD8xXCE7X9TCo5nC1XBStZ1vWsxf7ld4jPKSt1/qCec3ju bYYzeJI2cGErvUc/U9q7Tvpr/BBxa+54DomPTpTM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbfKALZO (ORCPT ); Fri, 1 Nov 2019 07:25:14 -0400 Received: from mail-lf1-f47.google.com ([209.85.167.47]:37674 "EHLO mail-lf1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbfKALZO (ORCPT ); Fri, 1 Nov 2019 07:25:14 -0400 Received: by mail-lf1-f47.google.com with SMTP id b20so6991737lfp.4; Fri, 01 Nov 2019 04:25:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vUQnbyGeROcbfx3shdHmEtVSfcZgw+KlZ0MXbPBb4sU=; b=ho8lgjddR2BzrrljLsqjcmCNttQHQlUGepjQShW8k7o0pmsa6NpF1nauFGh4RdRtVP osCjnqBBlImBSg/QbwhMHFw8/P+x1wVDh+i8H+nrDnBFr+HktNu5vhK3WeyyWX/suYFB pAx2S6dkKE5K0LOI8uAfzJXEXan0EHZwWM3mCoRIcDHOp53FU4aW9pDMGT9McPMWr/7R pM5X1CKlWnhHs/fFHbetfh0oEJaIKAsrJ/CXZkKOpSZzSj2dKHlzYet8KTsFZYSNJwNz ZyPkIspsIUvVEXlZO16Q0FVg3MVz+dc+3hTNVQyJr3JAGsi/kaPItkgjsrYc9suajmAX ya5A== X-Gm-Message-State: APjAAAUrMMFe4EQ1sBJl8ZN9NAVcG7J6hXWSXj5qikDxg3AiydC2Vb28 +Ti8UcHEEf9hh1CnUt9xIJV1QFrXy10= X-Google-Smtp-Source: APXvYqwFqJsvRt95nTuIgux0lgecAnc4aTglAav6UTMlfC+qmYRzbvc6khqU7ehvt8SJCfxN5gZpCA== X-Received: by 2002:a19:ac48:: with SMTP id r8mr7289820lfc.181.1572607511591; Fri, 01 Nov 2019 04:25:11 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id u13sm1851775ljl.71.2019.11.01.04.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 04:25:10 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 1/4] HEADERS, do not merge!!!! Date: Fri, 1 Nov 2019 12:25:06 +0100 Message-Id: <20191101112509.29723-1-ribalda@kernel.org> X-Mailer: git-send-email 2.24.0.rc1 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org --- contrib/freebsd/include/linux/videodev2.h | 1 + include/linux/videodev2.h | 1 + 2 files changed, 2 insertions(+) diff --git a/contrib/freebsd/include/linux/videodev2.h b/contrib/freebsd/include/linux/videodev2.h index 85fa80f7..e90c8912 100644 --- a/contrib/freebsd/include/linux/videodev2.h +++ b/contrib/freebsd/include/linux/videodev2.h @@ -1713,6 +1713,7 @@ struct v4l2_ext_control { uint16_t *p_u16; uint32_t *p_u32; void *ptr; + struct v4l2_area *p_area; }; } __attribute__ ((packed)); diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 6d66a789..7bafe5cd 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1678,6 +1678,7 @@ struct v4l2_ext_control { __u8 *p_u8; __u16 *p_u16; __u32 *p_u32; + struct v4l2_area *p_area; void *ptr; }; } __attribute__ ((packed)); From patchwork Fri Nov 1 11:25:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 11222927 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 76E4913BD for ; Fri, 1 Nov 2019 11:25:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AD8320656 for ; Fri, 1 Nov 2019 11:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572607529; bh=nkoLVbNAWfBTTQ+apmIvIdYF3l3ZZ2bPV+p+EbUGX88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=W9EJR/E4kyIF5thvo9rrLCAyHoEAORda/9yVVchCVyG3NzWYsWGFm6PM2QwLimM4R ZNvtcWwFw8kV4eXr+ANBTR6TLhImMshYQk4RyzXE3f0df1EvO9LwVpTjH8CTMlWz4P l99jSWEtluOXNh+3ytVXJRHCPbzRU/xJ8Nj50UHM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730451AbfKALZP (ORCPT ); Fri, 1 Nov 2019 07:25:15 -0400 Received: from mail-lf1-f46.google.com ([209.85.167.46]:46004 "EHLO mail-lf1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727184AbfKALZP (ORCPT ); Fri, 1 Nov 2019 07:25:15 -0400 Received: by mail-lf1-f46.google.com with SMTP id v8so6945762lfa.12; Fri, 01 Nov 2019 04:25:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T+OjJ+6/I6gUD391Oea+4W1UmtPnSSXB5pb5k146uYU=; b=fvJr7Y4CS1qIN32RvWTw6FTxmABdWAh5puUmSeaxWlV+S9quZgBbce7XaTl1FztFU8 HF0EVOnlh6iPw6PLl72kxQxgT4pQ+f1HyIpZW0rfACQNe4qwpeWKPZov+YlDo9iM4m9a MfcKM2RNzMa59hLPDpJcyNHQthFvvo5xp7glPkcuH9kj5KMENRyPglUR7fGYPyMNXQXS ChtgTNpMjip6pkyPu3ACvKpOdYJAb02UVuMIRhHyjTnTccyfEAS0/V3NmL9144pgaBYX Y9oenpeYyKMZNtmwK/tzmPN5/rhAeDz1tHKYsA1eTmuAVGj35/KAOjV0a/3iP6w8kcSW heUA== X-Gm-Message-State: APjAAAUoRkUp3eLND9B1lbmId56R215ncQpinfx3SedZswFhu2peLYpO c4Ai4lj/wLBe39Wb6j9rEpQ= X-Google-Smtp-Source: APXvYqxVT0p8cgPj+Lcwa9qVKd/R1TvqPheEiF0FEbi4THkyKtdMRRyaUpc5oRuimc8RHdbotDulBQ== X-Received: by 2002:a19:f107:: with SMTP id p7mr6745585lfh.91.1572607512894; Fri, 01 Nov 2019 04:25:12 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id u13sm1851775ljl.71.2019.11.01.04.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 04:25:11 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 2/4] v4l2-ctl: Support query V4L2_CTRL_TYPE_AREA controls Date: Fri, 1 Nov 2019 12:25:07 +0100 Message-Id: <20191101112509.29723-2-ribalda@kernel.org> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191101112509.29723-1-ribalda@kernel.org> References: <20191101112509.29723-1-ribalda@kernel.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Tested with vivid: $ v4l2-ctl -l | grep area area 0x0098f90b (area) : flags=has-payload Signed-off-by: Ricardo Ribalda Delgado --- utils/v4l2-ctl/v4l2-ctl-common.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index 651917e7..b1c12b35 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -458,6 +458,9 @@ static void print_qctrl(int fd, struct v4l2_query_ext_ctrl *queryctrl, queryctrl->minimum, queryctrl->maximum, queryctrl->step, queryctrl->default_value); break; + case V4L2_CTRL_TYPE_AREA: + printf("%31s %#8.8x (area) :", s.c_str(), queryctrl->id); + break; default: printf("%31s %#8.8x (unknown): type=%x", s.c_str(), queryctrl->id, queryctrl->type); From patchwork Fri Nov 1 11:25:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 11222923 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3194C1390 for ; Fri, 1 Nov 2019 11:25:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FB6421924 for ; Fri, 1 Nov 2019 11:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572607519; bh=h8Z3AnF7vXRAjXwVMTjLA3c0ADxJJIgEzh9hlBOMfGM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Dh+1X3J9mB5k2owES7hOk/26O4TrDCU04hKMHZJxAh+8G7OHxiwU6IddSCAL3cnHQ TzPMzK1PRTThNSjNk6YCClbUotOWlIDXul2ja4psrwJSHZFQSEVGA77A23231b52ZQ BmsKOPe7OnDQwxC14MAb2UO1ZILa5F2/5RdfUryQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730465AbfKALZR (ORCPT ); Fri, 1 Nov 2019 07:25:17 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:36406 "EHLO mail-lf1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbfKALZR (ORCPT ); Fri, 1 Nov 2019 07:25:17 -0400 Received: by mail-lf1-f49.google.com with SMTP id a6so3582090lfo.3; Fri, 01 Nov 2019 04:25:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DaGUTMZTPvVQG7pcnt9rSBQcYcHWYKS+V0DM0nxl4Tk=; b=Tjsuln41GeTOgFG04574mENjFrqY/q3z7YCR8BplyHC0vLZe99gRZwjydnO3QuSQRp XarI/uxLc6+rsmY+w5+fkKBMAQjBDFtlpYS9df1TbcJpatrwDYg8r+Sjngss0tnn4yaU 7NfKa2StWHVkkNJ6yfRCN5I127X9pBCqkH0KXYWNeTJMawftDajWjwjJHIDxyUAMqTW1 leajHJ9uDTZwSjU0HaH6Dzcsek5VBh4nyjmG80o9+sLshs2ulal3kw4k9arCtlONh5jL 2BBt/u08uD2JUQqKCpa5g0keb9Qb0gIRZ2olzgE9xB9QFb7GiSKjHCSPkHeesESIgPPl wiww== X-Gm-Message-State: APjAAAUXW6u8kKgwz0tpDkbzHUWfERyEZGB9XATDsRkEnu1BXFcPKMCn CELYc6a/OZfmb+eJ28/Gb+JO/ZAm5YI= X-Google-Smtp-Source: APXvYqz+YjmninMzPqS69q3MgmriaCnuS7fq6E4ALGEiKcz8M9m2fNDZGYklmVmjEFrlCHMy9/C/+g== X-Received: by 2002:a19:f811:: with SMTP id a17mr6870785lff.132.1572607514427; Fri, 01 Nov 2019 04:25:14 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id u13sm1851775ljl.71.2019.11.01.04.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 04:25:13 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 3/4] v4l2-ctl: Support getting V4L2_CTRL_TYPE_AREA controls Date: Fri, 1 Nov 2019 12:25:08 +0100 Message-Id: <20191101112509.29723-3-ribalda@kernel.org> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191101112509.29723-1-ribalda@kernel.org> References: <20191101112509.29723-1-ribalda@kernel.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Tested with vivid: v4l2-ctl -C area -d /dev/video1 area: 51966x727837 Signed-off-by: Ricardo Ribalda Delgado --- utils/v4l2-ctl/v4l2-ctl-common.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index b1c12b35..95339561 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -1150,6 +1150,11 @@ void common_get(cv4l_fd &_fd) printf("%s: '%s'\n", name.c_str(), safename(ctrl.string).c_str()); break; + case V4L2_CTRL_TYPE_AREA: + printf("%s: %dx%d\n", name.c_str(), + ctrl.p_area->width, + ctrl.p_area->height); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name); From patchwork Fri Nov 1 11:25:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 11222925 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 576921390 for ; Fri, 1 Nov 2019 11:25:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 36445217F9 for ; Fri, 1 Nov 2019 11:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572607526; bh=RU9q8ka5yatkwB8tYsXYbor8yQ6cjlMn5UspP2r6s5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cXSUNG2yrfzTEAp2ZxNjQppWYq01Kee/N10STwQmjOx6/izN6xgZ6kE93nRpewPBL M8AyIMH8JEPEwvhQfy0qYke6cOkY/goCQngOZnETFysTWA6XICn0x0seYQQudbpKQK YFutafoS7oRdO/7/G8mF6pz7XHl7muTmJm5UVjmQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730473AbfKALZT (ORCPT ); Fri, 1 Nov 2019 07:25:19 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:42382 "EHLO mail-lf1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730466AbfKALZT (ORCPT ); Fri, 1 Nov 2019 07:25:19 -0400 Received: by mail-lf1-f41.google.com with SMTP id z12so6983062lfj.9; Fri, 01 Nov 2019 04:25:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5kOelELcbXNl2QfySB87h5inDfmG0cvnFxe50Mfnt8I=; b=BdFeAvn9UjHW1sa0tGN7V7K/SghzgYjlNFB/6LQMlM8R1L9gI0+Q1oWbh7wj79YGOo xDmIoeAG6uVQfw3FhmJRLHJiaU6howi2Q2gb2wWbJwNXzKvetRjXqcAvusP6fKXj6vdk MUUbrMyYfLvNO1VxJ4TBW8Xa71NN9jrh6A0h8u68/sHhgeUc2EfkU5JHtvQ0/OCCE9Zr ByELvkwh6lfqxWfQQ95umIn0q4eKw+wQWYQdEkpJavdwfxNQoBeylKyq7UeupwV4vxZq auwyhDfC1b7OiC1GW7+RHmS7eQai41lFJxa3Kv3COl8opHOE+e91PT2ND9iSml8a+cUc k32g== X-Gm-Message-State: APjAAAWo++6lFl7hxIi0rafIQ2crrdY78LFoS6Db5n/FKy0oMB/phfwh nFhaJlFGIzCmR31/UOd7pfinft5Q5ao= X-Google-Smtp-Source: APXvYqzyHO4lw/uDSRxi0ex1uHhQ2LSYh+wW2n6CmhlyTe9rjftXKO3e86KTDS63od8GYoiGwL1z5w== X-Received: by 2002:ac2:57cb:: with SMTP id k11mr6885656lfo.87.1572607516680; Fri, 01 Nov 2019 04:25:16 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id u13sm1851775ljl.71.2019.11.01.04.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 04:25:14 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 4/4] v4l2-ctl: Support setting V4L2_CTRL_TYPE_AREA controls Date: Fri, 1 Nov 2019 12:25:09 +0100 Message-Id: <20191101112509.29723-4-ribalda@kernel.org> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191101112509.29723-1-ribalda@kernel.org> References: <20191101112509.29723-1-ribalda@kernel.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org $ v4l2-ctl -d /dev/video1 -c area=123123x233 Signed-off-by: Ricardo Ribalda Delgado --- utils/v4l2-ctl/v4l2-ctl-common.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index 95339561..676b05e0 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -973,6 +973,10 @@ void common_set(cv4l_fd &_fd) strncpy(ctrl.string, iter->second.c_str(), qc.maximum); ctrl.string[qc.maximum] = 0; break; + case V4L2_CTRL_TYPE_AREA: + sscanf(iter->second.c_str(), "%dx%d", + &ctrl.p_area->width, &ctrl.p_area->height); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name);