Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4898348pxu; Tue, 13 Oct 2020 09:38:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzttga34xijVejeOhTDz/g3OejpZEE0zQMbtUTUAZkb2/845Juye8/luCgrhRL+XhLmTuIS X-Received: by 2002:a17:906:350d:: with SMTP id r13mr604981eja.117.1602607081703; Tue, 13 Oct 2020 09:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602607081; cv=none; d=google.com; s=arc-20160816; b=0zF2kfpCNIjdXJJtM+gNG7drhlomGYUWD+FQmhHG7kTDtkOV8YKIUjqSv5MJS179JJ SCThMoZrmXMx37PIJ+/1Kj1KHzAEYAtNaMqBvsZpQWDYfp/kabd9is8mCKjUNP7fupq+ jXGOB6I5ND24cADNh+pdfAsKMpx7V+HY3zyU7V/5svBjkvgyiiplv/Gk0SSCq3u0TRO4 OB21RM5zo557HR6+3Ot8kq4WrhPNMMaYY2cMZ7ifSSmxHM7XH8IDWsExZlHBzReBBi41 z+VKstu1NDt0c1jeaaFDhGpR70kYUYxnbEx/7xz08r/Fremc4tIcrqUgOf3O1Ux3imB+ mkgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2V2YTRVuSVOcGPhuuh1GlQcD4dmudUyuY+buEnTGJbM=; b=WKQq8WfXskrkOCDkWpcs5/RBW6LEkq0Z5l2YkkJwNUcSt2bcTL9qOUZXUcX+UKHCKc pPDIOVPdobZdxho9tPZ+0iyKddEdW/Vn99wr0mkorH+Z5xDEUv4r6sCjssqX5oV6HZ/E DT6VCvsnHJpsKsJEvZePQgmTeSdQNjj48sk+T3U90DNRhRUJAHi47BlZsLkJ2aRY2O68 ceC0xnEH4jaO+QgSXK4sL5psish0oUBVFQa+BpOE1krno6ZZg49GZixYJgOt1OSZyzlR u7R3FbF65p9zLVlgc27Q7FeD8HkGtOWM+OFpRZWOpCp+WJ3LuQf8O6xnd464wb+jpNzh 3Wrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=K7WctOIr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si154626ejg.216.2020.10.13.09.37.38; Tue, 13 Oct 2020 09:38:01 -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; dkim=pass header.i=@chromium.org header.s=google header.b=K7WctOIr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728989AbgJMNlN (ORCPT + 99 others); Tue, 13 Oct 2020 09:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728980AbgJMNlM (ORCPT ); Tue, 13 Oct 2020 09:41:12 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B6E4C0613D2 for ; Tue, 13 Oct 2020 06:41:11 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id u21so28348067eja.2 for ; Tue, 13 Oct 2020 06:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2V2YTRVuSVOcGPhuuh1GlQcD4dmudUyuY+buEnTGJbM=; b=K7WctOIrky5wpsEU/mhzhXk48ILrN6QzRpAF8OFAR9mN1lByK2/acaz6Hmaxql36YG ug6a/B7r6IMHN/+3a8rwT+s6ARMi2wAvxWOmYYWRyubb7ZtNf2d+q6G1gb8yTF5P0LQI y42bqFItBMpEXnUTvBad1QOKkN8aRH6RYU90I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2V2YTRVuSVOcGPhuuh1GlQcD4dmudUyuY+buEnTGJbM=; b=QcriFsVs3FDphP6E4cakV95iqXUabpKnrw74BNJ+JvlPodn/HNJbsrxRtjekuUFhNA VWBpC3FqxIq9oUw4mcAx2yJeCgrvTwleN35oUYFfEkOG5k0dZ6hZ38Upw8+SyPQLix+u jaakfpFNjRDbcmHHJjK9Pe3gKzYZghimjBYmkEV/wHAeX4pTQZlpmBmrzDByFz2yb6pO y3bZzx2Rxq17pd4e/2WzDZchetObPOQZ70NvwU6uyYmpJAfOP5hC64ME6Zku9mpr6FEv vt6niRRo4V4qzezG41zbqU6Nr0S8Hs+cYsAxaWhWloZjJUjGWryAASFaghvoMhdQ6B9A clbQ== X-Gm-Message-State: AOAM533C+KM2s3iLd5vPsj/gPGcv0qgrB4Hcmk9IeCyaIHM1n4ElUhi8 Mrg4+/DIwYfz6coKv6XA3c6NEiFEgEQP4sdt X-Received: by 2002:a17:907:212b:: with SMTP id qo11mr32933819ejb.107.1602596469069; Tue, 13 Oct 2020 06:41:09 -0700 (PDT) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com. [209.85.221.52]) by smtp.gmail.com with ESMTPSA id k26sm2097eji.22.2020.10.13.06.41.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Oct 2020 06:41:08 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id h7so24135974wre.4 for ; Tue, 13 Oct 2020 06:41:07 -0700 (PDT) X-Received: by 2002:adf:8290:: with SMTP id 16mr38164627wrc.103.1602596467217; Tue, 13 Oct 2020 06:41:07 -0700 (PDT) MIME-Version: 1.0 References: <20200702100017.24700-1-stanimir.varbanov@linaro.org> <8dafbb4b-4626-5191-c57a-f3ef19c14618@linaro.org> In-Reply-To: From: Tomasz Figa Date: Tue, 13 Oct 2020 15:40:56 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] v4l: Add source change event for colorimetry To: Stanimir Varbanov Cc: Linux Media Mailing List , Linux Kernel Mailing List , Hans Verkuil , Mauro Carvalho Chehab , Nicolas Dufresne Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 13, 2020 at 11:03 AM Stanimir Varbanov wrote: > > Hi, > > On 7/2/20 2:52 PM, Stanimir Varbanov wrote: > > Hi, > > > > Once we have this event there is still open question how the client will > > know the data buffer on which the new colorspace is valid/applied. > > > > The options could be: > > * a new buffer flag and > > * some information in the v4l2_event structure. > > > > Thoughts? > > Kindly ping. > The event itself sounds good to me, but how do we know which buffer is the first to have the new colorimetry? Best regards, Tomasz > > > > On 7/2/20 1:00 PM, Stanimir Varbanov wrote: > >> This event indicate that the source colorspace is changed > >> during run-time. The client has to retrieve the new colorspace > >> identifiers by getting the format (G_FMT). > >> > >> Signed-off-by: Stanimir Varbanov > >> --- > >> .../userspace-api/media/v4l/vidioc-dqevent.rst | 11 ++++++++++- > >> .../userspace-api/media/videodev2.h.rst.exceptions | 1 + > >> include/uapi/linux/videodev2.h | 1 + > >> 3 files changed, 12 insertions(+), 1 deletion(-) > >> > >> diff --git a/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst b/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst > >> index a9a176d5256d..3f69c753db58 100644 > >> --- a/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst > >> +++ b/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst > >> @@ -381,7 +381,16 @@ call. > >> that many Video Capture 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_COLORIMETRY`` > >> + - 0x0002 > >> + - This event gets triggered when a colorspace change is detected at > >> + an input. By colorspace change here we include also changes in the > >> + colorspace specifiers (transfer function, Y'CbCr encoding and > >> + quantization). This event can come from an input or from video decoder. > >> + Once the event has been send to the client the driver has to update > >> + the colorspace specifiers internally so that they could be retrieved by > >> + client. In that case queue re-negotiation is not needed as this change > >> + only reflects on the interpretation of the data. > >> > >> Return Value > >> ============ > >> diff --git a/Documentation/userspace-api/media/videodev2.h.rst.exceptions b/Documentation/userspace-api/media/videodev2.h.rst.exceptions > >> index ca05e4e126b2..54fc21af852d 100644 > >> --- a/Documentation/userspace-api/media/videodev2.h.rst.exceptions > >> +++ b/Documentation/userspace-api/media/videodev2.h.rst.exceptions > >> @@ -492,6 +492,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_COLORIMETRY 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 303805438814..b5838bc4e3a3 100644 > >> --- a/include/uapi/linux/videodev2.h > >> +++ b/include/uapi/linux/videodev2.h > >> @@ -2351,6 +2351,7 @@ struct v4l2_event_frame_sync { > >> }; > >> > >> #define V4L2_EVENT_SRC_CH_RESOLUTION (1 << 0) > >> +#define V4L2_EVENT_SRC_CH_COLORIMETRY (1 << 1) > >> > >> struct v4l2_event_src_change { > >> __u32 changes; > >> > > > > -- > regards, > Stan