Received: by 10.223.176.5 with SMTP id f5csp442457wra; Fri, 2 Feb 2018 00:02:33 -0800 (PST) X-Google-Smtp-Source: AH8x2254FDUXk9ZVwhQ/j7DmA2vaC18zZPMX9IqWs3Mpj8FF2QvkPn3imsZbEJo85zd+GzS5XUhz X-Received: by 10.99.36.71 with SMTP id k68mr2134277pgk.345.1517558553455; Fri, 02 Feb 2018 00:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517558553; cv=none; d=google.com; s=arc-20160816; b=SiN+Tmsj3bz4gOwNHVCQNfvb5kVv6nqQtGVbz4F+t6YxuLV3JZfO2T8Bp5ZkkHPX67 vdNpJxH5NkZxj22KA3BT1cHtK7mY5iFKPeKHtmIXwaLXl4bVcxtzWLHr0xn4xtEMX8C8 xWRwlsHggk54QBhT82EhH+0cX7KOMHdUgegz/k9d3rYLxUdn4KbtpjgBs3HkMN9rb4rp 0NaqQwX2/8JWuq6FTZfClB9fHAKYngxgedrAjLlq6MAgIwMGcToWiFrIgB95heAJKgRL O6V5nuBMv6PY2dNhuJXHAB3Me4nITS4vyPiES/TJ0S66kNIDTwm51NSZjMGxqLl0EPuR p00A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=75otP6yBiVqzJe5FlLFVGUGqvfGiUd2OCCt+LrU8BuI=; b=dUAhK7Ae/Po9C+Bd6W3IkrQW34Ft1UYmZGjVxxpB4cyfUb0ucJqhJgtWM431nzIPvc Qmrz+v2WfsNRfRaB2lMSwJwt/Vaikfh8a6j2b0xW9WSA8/ABA3QVge4QhlvKbN1vACb1 kh6lTi5HsCDUlaTH0VINlS9000NULDKGkH4FuMunic8nNSULBNbrCiHyQJfjKL7Nd6QN hmPDCgq5mYMtHzW7vyK70vvU3/CWCmtMJc2ygKwX+mSeDK0SjQ+FFzScK14eezKmjMK6 XWFKeJ5y3AZ47T9sMEXm8sWIHSU/rvXhA0UkHAYDVhOolKjP6XunNxVHleIKi7NfeAIf SMCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l59-v6si1297430plb.391.2018.02.02.00.02.18; Fri, 02 Feb 2018 00:02:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751803AbeBBIAt (ORCPT + 99 others); Fri, 2 Feb 2018 03:00:49 -0500 Received: from lb3-smtp-cloud8.xs4all.net ([194.109.24.29]:47583 "EHLO lb3-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751329AbeBBIAm (ORCPT ); Fri, 2 Feb 2018 03:00:42 -0500 Received: from [192.168.2.10] ([212.251.195.8]) by smtp-cloud8.xs4all.net with ESMTPA id hWGvelaw9ar0whWGyeQMPH; Fri, 02 Feb 2018 09:00:41 +0100 Subject: Re: [RFC PATCH 1/9] media: add request API core and UAPI To: Sakari Ailus , Alexandre Courbot Cc: Sakari Ailus , Mauro Carvalho Chehab , Laurent Pinchart , Pawel Osciak , Marek Szyprowski , Tomasz Figa , Gustavo Padovan , Linux Media Mailing List , linux-kernel@vger.kernel.org References: <20171215075625.27028-1-acourbot@chromium.org> <20171215075625.27028-2-acourbot@chromium.org> <20180126083936.5qxacbdprm6j7pcc@valkosipuli.retiisi.org.uk> <20180202073316.ovee5fbe45npksnt@paasikivi.fi.intel.com> From: Hans Verkuil Message-ID: <6292179f-4b3d-573b-09c9-7a1efc101d44@xs4all.nl> Date: Fri, 2 Feb 2018 09:00:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180202073316.ovee5fbe45npksnt@paasikivi.fi.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfF16G2Y4QK9KDCtiIQEpYQiIJB4+0m2okkLsKiMlQvsKHewebJWiX4gIwtwx8qUKY2ePl8dnZC9bih2mM7JLKB4hMoMOCNYMzrH8NqaCgMmRI65eqMdT RYJZgVqk8hhip1LFE4IhbPxWUIiQO6FQMaYFPHpPyDxw6O7ZxYmEXzyhQq0RusRzEVcLbNflSXX37bN+KewQ3c5dzgsmjs8BFFhm8OVZTvz0JvJIHONjkC9h CmG2Zma7Hc6+m+9lzh4vrbLAFXOXAkIpR3xxeYK28LH1QRacxp2mHcyfrHcS9iVgFS0j1Yo3rM4ycSBw5Fiq82yoNHigw9ZVfbe5xHiDoUGnuHFzKsuyp7GS 7Xhdns7zwi9z12wKWxhLwWA2OhwNmRRZcUVu5Gkxg+Oqs6TY0g4sh26jawkJUYmGsAwB96ABER1sC8f6obcbLmPghaO6u9V0WbmcyAObAQdDVY9+Hb7AUVmf k5blrRYEIkuv2p+Lb16ituV9AxcYmSdeDdWySzczxGgyGVnulSVq9rGSwEESwV1JdWZ1EsAdB/Mtjvvc8l/avgwN3Y1o2FpUvmhWLqu75+kb6Gz7mopsGRJE e29kk5iT4zPgMEfRB2erp8vD Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02/2018 08:33 AM, Sakari Ailus wrote: >>>> +struct media_request_entity_data * >>>> +media_request_get_entity_data(struct media_request *req, >>>> + struct media_entity *entity, void *fh) >>> >>> This makes the assumption that request data is bound to entities. How does >>> this work with links? >>> >>> I wonder if it should rather be bound to graph objects, or certain graph >>> objects. Having a standard way to bind request specific information e.g. to >>> entities is definitely worth having, though. >>> >>> V4L2 framework specific information would be needed across the media graph >>> and it'd be good to store it in a non-driver specific way. What I think >>> you'd need is an interface that allows storing information based on two >>> keys --- the request and e.g. a pointer provided by the caller. The V4L2 >>> framework would have one key, e.g. a pointer to an empty struct defined >>> somewhere in the V4L2 framework could be used for the purpose. >>> >>> Going forward, the entire media graph state will be subject to changing >>> through requests. This includes link state, media bus and pixel formats, >>> cropping and scaling configurations, everything. Let's not try to go there >>> yet in this patchset, but what I'm asking is to keep the goal in mind when >>> implementating the request API. >> >> Yeah, I think a similar idea is brought up in the cover letter of the >> next revision (although for different reasons). Entities are probably >> not a one-fit for all use-cases. >> >> For the case of links though, I believe that the "entity" that would >> control them would be the media controller itself, since it is the one >> that takes the MEDIA_IOC_SETUP_LINK ioctl. But even for this case, we >> cannot use an entity to look up the media_device, so something more >> generic like an opaque key would probably be needed. > > Perhaps in the near future we still need a little less than that. Changing > something that has a state in V4L2 will be troublesome and will require > managing state of what is now stream centric. > > I still think that the framework would need to do the job of managing the > video buffers related to a request as well as controls without necessarily > trying to generalise that right now. But how to store these in a meaningful > way? Putting them to the request itself would be one option: you'll need to > dig the request up anyway when things are associated to it, and the driver > needs it when it is queued. > > I wonder what Hans and Laurent think. I think this is something for the future. I want to avoid delaying the Request API for endless internal design discussions. The public API should be solid, but the internal framework will undoubtedly need to change in the future. That's OK. The reality is that there is a lot of demand for the Request API for stateless codecs, and that is what we should concentrate on. Should the framework manage the buffers? I don't even know what is meant with that exactly, let alone that I can give an answer. Let's stay focused: 1) solid uAPI, 2) stateless codec support. The internal framework shouldn't of course make it harder than it needs to to later extend the support to camera pipelines, but neither should we spend much time on it or we will never get this in. Regards, Hans