From patchwork Fri Apr 12 15:59:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 162123 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp804628jan; Fri, 12 Apr 2019 08:59:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxKmwDKH3SzG+KlTa31wXg7XfXTHx9bS72OimbTvYJzqUJVtr9N1CXKjSZvkeOpm5muwKI X-Received: by 2002:a63:df12:: with SMTP id u18mr54542439pgg.135.1555084772327; Fri, 12 Apr 2019 08:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555084772; cv=none; d=google.com; s=arc-20160816; b=fJCCtQXLIX9Wu8/wWMSRA3Z7nWpNNqWmgvZH2yU+S21qpvDFaYp8BGfPEYmhtDuBdN pX7pIGl9LLWkNmStvg5s7lpOYG1rlY4FHtC00Um2eeFpmx5jEZ0UV4Cb5ocRR8oz9k0m JzrDGQtOd9r/aP4ETrHBWyE+0vIIddYTe34Gtf2IIVYH1FkwX2GBBdcdiFtv9tmiTr9U smjEY/elRYNcLe0rXrQ+mEAScaXyEeRxJD6342NtrCUvsgnsmZ0FzN/bt7a/zJTnpS3/ oC1IFJmDqmPgod1e0hFmlcorsrFFYeatXcIsSTQDTTkh9/OYQ7ARSda9DSEUvPc+rj8W gAfg== 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=90rwpXEXFGoNt9j8MqywsjEPW+NzjmMm6jkw8wsUGVA=; b=S/+fbboFXQ8N1BHj/iXQ/Xz9mWiPrtGCGQLZgthUEC9Jj0hkhhLLw1CFFeEXefelhD rNK1wma8u1i5wDfAdlrtyWaftfHQOqkUYBQYCaUSQR6JsPPhSUCjjZ/PM1eCp7Nele0b 0tomTIuTXJjUScBzvSb34SGdAyJvD0KusynxOHsIolPsWiTtSq/+7vMk1MZt/lV3kFRv zvyuXBH3Ciong+1w8BoM58YQ6TV+5w1T8nN3nUBWjLmk5j7da5o+XgWyD9/59s+Sz6ET po8Zgx7azHDG5MX0VviiWSVlIUOPb0AWq5h129PmFQfLL7/ElJK2VEDbCK9cMhW5ajbs krBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s+ifSMih; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 a33si1330370plc.213.2019.04.12.08.59.31; Fri, 12 Apr 2019 08:59:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=s+ifSMih; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1726914AbfDLP7b (ORCPT + 15 others); Fri, 12 Apr 2019 11:59:31 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42057 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726755AbfDLP7b (ORCPT ); Fri, 12 Apr 2019 11:59:31 -0400 Received: by mail-wr1-f67.google.com with SMTP id g3so12581319wrx.9 for ; Fri, 12 Apr 2019 08:59:30 -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=90rwpXEXFGoNt9j8MqywsjEPW+NzjmMm6jkw8wsUGVA=; b=s+ifSMihs8ddL09X415RQy/hlbE8x22tzAPwKBQ71Nc7WSkPJXiXi4aNMcdlRItpQB 6HQYeA702yfHyVRTvUiIV0tN+XQHPRlo58QIMtt6ENDVgc63ViF9YfRj1w7+5j/P2qxe 2howVQi3eI14kMTWwM6/iqB6wIUD9ulWOdaLIt3oJprpM65dzpwccSfTplmdXibJbHud Wuoy123UmX7qB6pgOolOl11GwKta3U3Y8VGFowm6UeniM8Ove+DeErJ6IIhej1O9Fqek gR9zL5brBEfgc41syQd3vZGZ/kKatGYFh78HfFYV/hoqsFM1EUr9TAYsSYWQVNZEzbtC FoiA== 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=90rwpXEXFGoNt9j8MqywsjEPW+NzjmMm6jkw8wsUGVA=; b=PfKHjICETDhYRhCXrFWc273Cl3Mxmia+lmtY3pWPxw9hi3D7j/nLxLiarrXsydDRqX Lx0UyYOdTLGN437RzuGLOhMdP1E0XtWngWs5HuqgjnqyyAppx91aSQDQGGiCBcnzTI6v h8f7ulwA/rgzFICy+8Ac43lvlf+rW3VYRvx9YzD8esRwbKWn7wjYoVFn6rrQdpEM7Ls1 R3hNMSIqCSts7ZZ/W/pWUpJtFEvN5U2JPmBfIwHRCsKbtWe+P+qdaH1b15tPwhGYcYO2 r1sbJ4L04AYtiSXQu1QxRV2J2x4otGsqdb+S6Cyux30qYY5uI85HxnMbtih2OsY3++yh YivQ== X-Gm-Message-State: APjAAAWXA8Ei5xz1XfJg/Y0atLO8c+GpvJ1ChslxAk4DRsRwG+IKN5aC RqlCh+yu7QPZH9+oWcaMUC4gkA== X-Received: by 2002:adf:db0c:: with SMTP id s12mr36574749wri.184.1555084769753; Fri, 12 Apr 2019 08:59:29 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id b134sm15745440wmd.26.2019.04.12.08.59.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 08:59:29 -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, Stanimir Varbanov Subject: [PATCH v2] media/doc: Allow sizeimage to be set by v4l clients Date: Fri, 12 Apr 2019 18:59:15 +0300 Message-Id: <20190412155915.16849-1-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This changes v4l2_pix_format and v4l2_plane_pix_format sizeimage field description to allow v4l clients to set bigger image size in case of variable length compressed data. Signed-off-by: Stanimir Varbanov --- Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst | 13 ++++++++++++- Documentation/media/uapi/v4l/pixfmt-v4l2.rst | 11 ++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst b/Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst index 5688c816e334..005428a8121e 100644 --- a/Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst +++ b/Documentation/media/uapi/v4l/pixfmt-v4l2-mplane.rst @@ -31,7 +31,18 @@ describing all planes of that format. * - __u32 - ``sizeimage`` - - Maximum size in bytes required for image data in this plane. + - Maximum size in bytes required for image data in this plane, + set by the driver. When the image consists of variable length + compressed data this is the number of bytes required by the + codec to support the worst-case compression scenario. + + For uncompressed images the driver will set the value. For + variable length compressed data clients are allowed to set + the sizeimage field, but the driver may ignore it and set the + value itself, or it may modify the provided value based on + alignment requirements or minimum/maximum size requirements. + If the client wants to leave this to the driver, then it should + set sizeimage to 0. * - __u32 - ``bytesperline`` - Distance in bytes between the leftmost pixels in two adjacent diff --git a/Documentation/media/uapi/v4l/pixfmt-v4l2.rst b/Documentation/media/uapi/v4l/pixfmt-v4l2.rst index 71eebfc6d853..0f7771151db9 100644 --- a/Documentation/media/uapi/v4l/pixfmt-v4l2.rst +++ b/Documentation/media/uapi/v4l/pixfmt-v4l2.rst @@ -89,7 +89,16 @@ Single-planar format structure - Size in bytes of the buffer to hold a complete image, set by the driver. Usually this is ``bytesperline`` times ``height``. When the image consists of variable length compressed data this is the - maximum number of bytes required to hold an image. + number of bytes required by the codec to support the worst-case + compression scenario. + + For uncompressed images the driver will set the value. For + variable length compressed data clients are allowed to set + the sizeimage field, but the driver may ignore it and set the + value itself, or it may modify the provided value based on + alignment requirements or minimum/maximum size requirements. + If the client wants to leave this to the driver, then it should + set sizeimage to 0. * - __u32 - ``colorspace`` - Image colorspace, from enum :c:type:`v4l2_colorspace`.