From patchwork Thu May 9 09:50:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 163699 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:142:0:0:0:0 with SMTP id j2csp735146ilr; Thu, 9 May 2019 02:50:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzA7w5u4BCz+klgzjLXERyevU6ZBtwLF2cpGaBmpMVgfjKIgVQWuN6DMUqSYAaH0qoAJWgv X-Received: by 2002:aa7:8458:: with SMTP id r24mr3580020pfn.231.1557395413067; Thu, 09 May 2019 02:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557395413; cv=none; d=google.com; s=arc-20160816; b=Nt+YqtHL6Jb7criKsajjvmSaUnaMGHYWnwi+fN9bR+MHCXlSpEmnCiz+7+jiubYIpp cgn/Icqahb2nELZWexwA+3X61CdArObfXU69X3oW79Z+3983YTC0LiNeCeOPuI6P9OCH qTYNLG7hED/bcgTxtEWFmor7/uDTpT3ua77Yu0S3JBfbM7TkwlwF0RB1hzAlpVJuJ4OG 6LsLE2jDxQSZsq3Vs6MamS1mp7xZa/hzqLucBlYw4nRjO9xfIPvvWOns+SUA4CXRAm+Z 299TfoH/GAvI2vcFhzUy+9rpnzvjlUlwNZ+fGWM0sVV+P2X5A0eMX43HnfvIh/1sq5Rx D5Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=hhS2+d0xP4GgHZNmcPpMkZwGucayXgjly3bXfhyzlK8=; b=OTAOEMoAXLw5PH43kG6L5anAsYRJCVoLCui8GSh5U+G2PX5uW+7ay4DmfUO5Hdpn+m vpaqfQKUBQCFgnFwMTGkMGgx2RTdLAe6Uepursfr9+p0UwQTTr2KTtSHmFRMNA/3unK1 8RlZwA5W0O+FLtBsBROdKKu9HklTxEWVBFdAHDI76nY3XwzOe1LuHQ1Cxyi1X9ItvxwD TmccqjCAtlEjgooy82RFnPYe5akguCsD1TZbYu586tTJ58iFM9De0UyWFd5091kK+yX0 v66DdQFkzWbMRmZ4AFzfZuMCo8I5nZq2ubNyOsY2YW+lcCWuTNFxeiU58fzgihGQBMHb dCEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ED/kZ9I9"; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d92si2187612pld.84.2019.05.09.02.50.12; Thu, 09 May 2019 02:50:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ED/kZ9I9"; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726415AbfEIJuM (ORCPT + 3 others); Thu, 9 May 2019 05:50:12 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38844 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbfEIJuM (ORCPT ); Thu, 9 May 2019 05:50:12 -0400 Received: by mail-wr1-f66.google.com with SMTP id v11so2110824wru.5 for ; Thu, 09 May 2019 02:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=hhS2+d0xP4GgHZNmcPpMkZwGucayXgjly3bXfhyzlK8=; b=ED/kZ9I9eq0+WF8uJUG0ZOnviVIDgjrf4KeRNdLJ6OQqMzq5xwbeRsvZmYyCW3arjc 7cJgTprycCsiHmmVozTaFQlncETUkynpAItO4/5Rl7rX7tttResOcM+nKeuJZGnfVEFl xlQRLc65LIOYRY/l8dwr0THTapBDGOzSxm8LHFLrp+t/QIvq5zlXztpPNR4zOT3ZOYcX xkAT3P3bDm6A6yHfBqN8tdYaE/T4qddsleLy71EKEkIMzEdqSs1xkkkQQvqhpCnCaO5A iMtHze0VsRRKSmg0XNl2B7HIDSamxn1S2vfCP4/01F2p665EwyH2RmHahbxRQbl3fTlW 5H+Q== 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; bh=hhS2+d0xP4GgHZNmcPpMkZwGucayXgjly3bXfhyzlK8=; b=LesbHR2Gx18knsoDCAbRpWd07lmIQCxFCWyConMywjuLjgCAn9MakKTzTWKWRYnlGl +wYsUo2cq3Y7v3gF9Eum8CJNg5ExJs76uDurHNha15sJlPnd6ZWUqwHOpnwD8xWZK1oe pC+vCbTeyEonV9Cx7HQbLlHXOVA6R9czaQDaC9yFw2DHjoYHouhKazf9GcuqONgA8CTI /5DtM+tm2VY7Qc7xl/2NPgahaXADz2ICbtqUSuBBiAHjv2gwUPiXFhZzLAHPpRNXtKti yrvtZzZNvuJfHe90k+lQJii49Gd39KlIoHMHyOgj6P6wx1VH6tuhUUHwbB1cKle1YxfI hQTA== X-Gm-Message-State: APjAAAXw+4BRlFn7Vr1xZsK3NhBA5LWQq70P/91MjIdRFEGworGSxi0o vgY/dgEnvFxwgy/Cakrpy8u/ypRRviE= X-Received: by 2002:adf:83c6:: with SMTP id 64mr2365983wre.81.1557395410924; Thu, 09 May 2019 02:50:10 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id l21sm1257039wmh.35.2019.05.09.02.50.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 02:50:09 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Sakari Ailus , Stanimir Varbanov Subject: [PATCH v3] v4l: Add source event change for bit-depth Date: Thu, 9 May 2019 12:50:02 +0300 Message-Id: <20190509095002.31253-1-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This event indicate that the source color bit-depth is changed during run-time. The client must get the new format and re-allocate buffers for it. This can usually happens with video decoder (encoders) when the bit-stream color bit-depth is changed from 8 to 10bits or vice versa. Acked-by: Sakari Ailus Signed-off-by: Stanimir Varbanov --- Change since v2: renamed BIT_DEPTH to COLOR_DEPTH Documentation/media/uapi/v4l/vidioc-dqevent.rst | 7 +++++++ Documentation/media/videodev2.h.rst.exceptions | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 9 insertions(+) -- 2.17.1 diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst b/Documentation/media/uapi/v4l/vidioc-dqevent.rst index dea9c0cc00ab..7eb6451e6a81 100644 --- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst +++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst @@ -397,6 +397,13 @@ call. that many devices are not able to recover from a temporary loss of signal and so restarting streaming I/O is required in order for the hardware to synchronize to the video signal. + * - ``V4L2_EVENT_SRC_CH_COLOR_DEPTH`` + - 0x0002 + - This event gets triggered when color bit-depth change is detected + from a video decoder. Applications will have to query the new pixel + format and re-negotiate the queue. In most cases the streaming must be + stopped and restarted (:ref:`VIDIOC_STREAMOFF ` + followed by :ref:`VIDIOC_STREAMON `). Return Value diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions index 64d348e67df9..69acf5959972 100644 --- a/Documentation/media/videodev2.h.rst.exceptions +++ b/Documentation/media/videodev2.h.rst.exceptions @@ -478,6 +478,7 @@ replace define V4L2_EVENT_CTRL_CH_FLAGS ctrl-changes-flags replace define V4L2_EVENT_CTRL_CH_RANGE ctrl-changes-flags replace define V4L2_EVENT_SRC_CH_RESOLUTION src-changes-flags +replace define V4L2_EVENT_SRC_CH_COLOR_DEPTH src-changes-flags replace define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ :c:type:`v4l2_event_motion_det` diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 1050a75fb7ef..9410f9e186a1 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -2287,6 +2287,7 @@ struct v4l2_event_frame_sync { }; #define V4L2_EVENT_SRC_CH_RESOLUTION (1 << 0) +#define V4L2_EVENT_SRC_CH_COLOR_DEPTH (1 << 1) struct v4l2_event_src_change { __u32 changes;