Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5204467imm; Tue, 16 Oct 2018 06:50:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV621xO/lBaQoCE/tuys5Ztzz5CVWGQYhjG1T3CKtzgVhadIH/Fs8CJa5P+fdndJw9Lv9g5aG X-Received: by 2002:a63:2807:: with SMTP id o7-v6mr20048913pgo.155.1539697852054; Tue, 16 Oct 2018 06:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539697852; cv=none; d=google.com; s=arc-20160816; b=X7ETeStB8jAbLBsVbeuTQ9AOYuGDfao691UMPZTkw0AEw+wmfXmT6OUYUD7LRLdxsh NFuG5gg4dwJ2PD97o9erNpBxhRkyHaa6aY2dWeKuOmB3Li6vpQs+luW59hUO00wK8efw EtLT7WUrVb2WefXftzZocHJDn2ySg9bGYzsJYXPMUWKq+s6mcMXdT5qkoSAw5DaESAfb nHddGwlpuShusYwImRJZHmN1QzvdzW8qsxgWELRdqn2nQ54Y2xwPC/PLJkc5O0jcQcJ2 A+A7VbFjbJ0j/OLEzR+H/bw8JtlzIvO+tLLOm81rcbOWUb1VJa6OS6+nUUU2/zkSd/mu jhQQ== 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; bh=+N3uFZyAUgwnvs5RgxMr0HjKxHYTEsKPoesKZUzjI04=; b=U3wKbW7sLlQHDV9q9DnFvLHwuEuTng7v7ogATfmcBseaIg/skmuFb1Sh+aJJZrT0ch lFCgoG+oT/rJntimLU8F8LgqD9zjGi393eecN4wJI573+SyFdfL0LB1CK8Wv19eGW7wH mm+mwJQl8BIaXldedTiuM1qwp25vAp88L4/CR+6gYS+mSc/28Zo+DBCtSenb2CmCv2XP QSJUbFqiUlHCSonhGHy9y0p6bYs2ABT6qmqtcI/cbKOav3g2Ze5AZftQaO3wuqFK7asy 3cPlxs0jFMRUJPgPAjphp1Xy+q0fACl6nF2Gmy5cS+G07FUdewWT4KIVIUw4dSYNOVNP hf7Q== 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 b4-v6si14391138pfg.90.2018.10.16.06.50.35; Tue, 16 Oct 2018 06:50:52 -0700 (PDT) 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 S1727164AbeJPVko (ORCPT + 99 others); Tue, 16 Oct 2018 17:40:44 -0400 Received: from lb2-smtp-cloud9.xs4all.net ([194.109.24.26]:54021 "EHLO lb2-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbeJPVko (ORCPT ); Tue, 16 Oct 2018 17:40:44 -0400 Received: from [IPv6:2001:420:44c1:2579:9a8:54a0:8ffa:2301] ([IPv6:2001:420:44c1:2579:9a8:54a0:8ffa:2301]) by smtp-cloud9.xs4all.net with ESMTPA id CPjTgGDfxSskCCPjWg8bwr; Tue, 16 Oct 2018 15:50:08 +0200 Subject: Re: [PATCH 2/2] media: docs-rst: Document memory-to-memory video encoder interface To: Tomasz Figa , Philipp Zabel Cc: Linux Media Mailing List , Linux Kernel Mailing List , Stanimir Varbanov , Mauro Carvalho Chehab , Pawel Osciak , Alexandre Courbot , kamil@wypas.org, a.hajda@samsung.com, Kyungmin Park , jtp.park@samsung.com, =?UTF-8?B?VGlmZmFueSBMaW4gKOael+aFp+ePiik=?= , =?UTF-8?B?QW5kcmV3LUNUIENoZW4gKOmZs+aZuui/qik=?= , todor.tomov@linaro.org, nicolas@ndufresne.ca, Paul Kocialkowski , Laurent Pinchart , dave.stevenson@raspberrypi.org, Ezequiel Garcia References: <20180724140621.59624-1-tfiga@chromium.org> <20180724140621.59624-3-tfiga@chromium.org> <4168da98-fa01-ea2f-8162-385501e666be@xs4all.nl> From: Hans Verkuil Message-ID: <7b8b56e7-1617-5de6-9fa9-a10897a8f2f1@xs4all.nl> Date: Tue, 16 Oct 2018 15:49:58 +0200 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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfLpy65hUflpLqKJJD9QesvS+BzueFdFXQnnL6ns7THT21td4E++XJ3rD/RpcdamuyR7Rm1xJTMSKowW0cQy5VxOBOBBYK/qvMBWqD7Uf5N92G4MUtRs2 yVScfVZfYtBssixaHo9V8Fi1J2zQhWBFBlAYZSt6AvmuGAqKwfeU33bGuxkWjFimeepbeOQn5ei4UNiwTcWrk4vqDoBos1PPgj1g38JO1hWx1gY+93nP4MmB sRD8CQ1c8qRW/grl/Yvzn3mhgbf6nhPLLvlhOHMqlMK6TaHUugxtopu70pNBe8zCBfPBxq7IXMuc+6dT/o1BO/6OuTZ+fn8Hnw2TtpMK3toCHtgWIlChwZTX 3QZGgyFoi7u9Hvy9yHvKdTw2fuDITV2q76udIhrkumyPnRwXe6nW9LkUgtxmXFISjTGVklqOKPN3+P24zbvdF0fapEt1jTZFhM2hl7zavkx7JYKtyqJ6WAD+ yO9kbcyTcvZaGBj3E8iwZe4zxJAz0V3kfRpqKvMc5r7zmK8lIWN67sWyeSNgvsXWGImgZKo0nPOOUEj5UgPos1LLLvoc4XNdqNE07ANHoKiHqj9vp83HE4qJ nDzr1MEnTaZ+bVadvcVEZ/nWCUPiSxzuhI3ViDlpYLMYlIEou+NPv1K36iHffF78iU7TE8bHlhbsqYCEI1mplYq582d82fDkVAnHpQzp2J2NhZ28/8/r/iQm qZf3ZnI7C30qmuyvNbv0xji42XP4E+AtdCLurv9HMptppwhJUdtgYnfuDP3hduLGPP+cZz1+ZWwOTe+r0nyYEgZVqE+2aihwVaPUnZrSskSlFpEtNQP5ExUS WncUk1rOqBmDGmLRDCIeOncL3XHixFOi7/TDTTS4w9//96AYXzq9JXDfO4ezkuPvKKdO5AjU4+1KeFIeCuKV5Dd5IUaolJ8QHDNcHEj2Lv00tcFZ8ULkpyyz oy3v+c/IcnjFClVcfzZSeZ4I6xw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/16/18 09:36, Tomasz Figa wrote: > On Tue, Aug 7, 2018 at 3:54 PM Tomasz Figa wrote: >>>> + * The driver must expose following selection targets on ``OUTPUT``: >>>> + >>>> + ``V4L2_SEL_TGT_CROP_BOUNDS`` >>>> + maximum crop bounds within the source buffer supported by the >>>> + encoder >>>> + >>>> + ``V4L2_SEL_TGT_CROP_DEFAULT`` >>>> + suggested cropping rectangle that covers the whole source picture >>>> + >>>> + ``V4L2_SEL_TGT_CROP`` >>>> + rectangle within the source buffer to be encoded into the >>>> + ``CAPTURE`` stream; defaults to ``V4L2_SEL_TGT_CROP_DEFAULT`` >>>> + >>>> + ``V4L2_SEL_TGT_COMPOSE_BOUNDS`` >>>> + maximum rectangle within the coded resolution, which the cropped >>>> + source frame can be output into; always equal to (0, 0)x(width of >>>> + ``V4L2_SEL_TGT_CROP``, height of ``V4L2_SEL_TGT_CROP``), if the >>>> + hardware does not support compose/scaling Re-reading this I would rewrite this a bit: if the hardware does not support composition or scaling, then this is always equal to (0, 0)x(width of ``V4L2_SEL_TGT_CROP``, height of ``V4L2_SEL_TGT_CROP``). >>>> + >>>> + ``V4L2_SEL_TGT_COMPOSE_DEFAULT`` >>>> + equal to ``V4L2_SEL_TGT_CROP`` >>>> + >>>> + ``V4L2_SEL_TGT_COMPOSE`` >>>> + rectangle within the coded frame, which the cropped source frame >>>> + is to be output into; defaults to >>>> + ``V4L2_SEL_TGT_COMPOSE_DEFAULT``; read-only on hardware without >>>> + additional compose/scaling capabilities; resulting stream will >>>> + have this rectangle encoded as the visible rectangle in its >>>> + metadata >>>> + >>>> + ``V4L2_SEL_TGT_COMPOSE_PADDED`` >>>> + always equal to coded resolution of the stream, as selected by the >>>> + encoder based on source resolution and crop/compose rectangles >>> >>> Are there codec drivers that support composition? I can't remember seeing any. >>> >> >> Hmm, I was convinced that MFC could scale and we just lacked support >> in the driver, but I checked the documentation and it doesn't seem to >> be able to do so. I guess we could drop the COMPOSE rectangles for >> now, until we find any hardware that can do scaling or composing on >> the fly. >> > > On the other hand, having them defined already wouldn't complicate > existing drivers too much either, because they would just handle all > of them in the same switch case, i.e. > > case V4L2_SEL_TGT_COMPOSE_BOUNDS: > case V4L2_SEL_TGT_COMPOSE_DEFAULT: > case V4L2_SEL_TGT_COMPOSE: > case V4L2_SEL_TGT_COMPOSE_PADDED: > return visible_rectangle; > > That would need one change, though. We would define > V4L2_SEL_TGT_COMPOSE_DEFAULT to be equal to (0, 0)x(width of > V4L2_SEL_TGT_CROP - 1, height of ``V4L2_SEL_TGT_CROP - 1), which " - 1"? Where does that come from? Usually rectangles are specified as widthxheight@left,top. > makes more sense than current definition, since it would bypass any > compose/scaling by default. I have no problem with drivers optionally implementing these rectangles, even if they don't do scaling or composition. The question is, should it be required for decoders? If there is a good reason, then I'm OK with it. Regards, Hans