Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp370160pxa; Fri, 14 Aug 2020 06:40:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLa88htHepwYauN8KY1XvlcdI3oxY87oN9Z8Ia64DFAG2Ofo0TYYp2kZQa1Ke8rwds5Dlo X-Received: by 2002:a17:907:40bf:: with SMTP id nu23mr2396688ejb.243.1597412401166; Fri, 14 Aug 2020 06:40:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597412401; cv=none; d=google.com; s=arc-20160816; b=g48EK8hq34uaO6DMfwFBa8LCTU1HB2jtBErFdPnQ/ZcYUXGeMC9YCysRVEcW9w6dBz ew3FspGLoYw04+3fr9WN1/88Et/8Rv2D8uEWLk1JDJ9f8oiMWOs47mBSrB3R4VKbyIcO BtvXYmAXincqUGUp72+pCMdd7/9FMO2c0BzlwWJkyZGJSSy/mnddnMyR+OxddmQO2V6L X9CLn3QzdL92jaV9eQ+WnZC5L/w9C91FPKH62JgRpCE9RXQAApFwYtQT6t9Na4/PjBuJ 9HZlq7xjiuekVfvIdENyOJBHdyTkUUk09InKDb8gYVywhECvIr5eXaKfN09JVeAtGsec C1cA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Tov4cCsgtRu645i0agjRqBzgu3SdYS4z7c9Wumw6CQY=; b=jvu1Y/BilpGJlFjfmupGCim9loZmqzTM9fRxyg2lR1trD9qXQ//xCM0zr0FJNu1dm3 Iavg7krzyPTOlFgTiSSQdmDvxuirDezI63M4ZYJtlPzHJnUwZAcvnquyL/1U6cb+4TsW GpDZX6EQ+6J9oeW6YJBKFHCF1csO1xg7MunPfCLN7laWXJpDZIWdk09cAa9qLBop0Yyk 8sH6lOz+5gnaJJZbvEUYBmOKlqjonQ7Sd9R3gkgKcaccw6b8ho2YCeV84PpWcNKSF2rU itZY5RzPe+D2nHdYScx5TIlNbTFR6blSlwcAf/eKNDGHuC+tP0Mmx2nHBSvhfQ/aSd7P 4iuw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si5278843edq.227.2020.08.14.06.39.38; Fri, 14 Aug 2020 06:40: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728803AbgHNNhX (ORCPT + 99 others); Fri, 14 Aug 2020 09:37:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728723AbgHNNhV (ORCPT ); Fri, 14 Aug 2020 09:37:21 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7667AC061384; Fri, 14 Aug 2020 06:37:21 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 61B5129A825 From: Ezequiel Garcia To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tomasz Figa , kernel@collabora.com, Jonas Karlman , Hans Verkuil , Alexandre Courbot , Jeffrey Kardatzke , Nicolas Dufresne , Philipp Zabel , Maxime Ripard , Paul Kocialkowski , Jernej Skrabec , Ezequiel Garcia Subject: [PATCH v3 08/19] media: uapi: h264: Drop SLICE_PARAMS 'size' field Date: Fri, 14 Aug 2020 10:36:23 -0300 Message-Id: <20200814133634.95665-9-ezequiel@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200814133634.95665-1-ezequiel@collabora.com> References: <20200814133634.95665-1-ezequiel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SLICE_PARAMS control is intended for slice-based devices. In this mode, the OUTPUT buffer contains a single slice, and so the buffer's plane payload size can be used to query the slice size. To reduce the API surface drop the size from the SLICE_PARAMS control. A follow-up change will remove other members in SLICE_PARAMS so we don't need to add padding fields here. Signed-off-by: Ezequiel Garcia --- Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 3 --- drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 7 +++---- include/media/h264-ctrls.h | 3 --- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index c0ae7fda803e..e88c207d945b 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -1760,9 +1760,6 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - :stub-columns: 0 :widths: 1 1 2 - * - __u32 - - ``size`` - - * - __u32 - ``start_byte_offset`` Offset (in bytes) from the beginning of the OUTPUT buffer to the start diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c index d5636dbbb622..7d9bd5860a1b 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c @@ -324,17 +324,16 @@ static void cedrus_set_params(struct cedrus_ctx *ctx, struct vb2_buffer *src_buf = &run->src->vb2_buf; struct cedrus_dev *dev = ctx->dev; dma_addr_t src_buf_addr; - u32 len = slice->size * 8; + size_t slice_bytes = vb2_get_plane_payload(src_buf, 0); unsigned int pic_width_in_mbs; bool mbaff_pic; u32 reg; - cedrus_write(dev, VE_H264_VLD_LEN, len); + cedrus_write(dev, VE_H264_VLD_LEN, slice_bytes * 8); cedrus_write(dev, VE_H264_VLD_OFFSET, 0); src_buf_addr = vb2_dma_contig_plane_dma_addr(src_buf, 0); - cedrus_write(dev, VE_H264_VLD_END, - src_buf_addr + vb2_get_plane_payload(src_buf, 0)); + cedrus_write(dev, VE_H264_VLD_END, src_buf_addr + slice_bytes); cedrus_write(dev, VE_H264_VLD_ADDR, VE_H264_VLD_ADDR_VAL(src_buf_addr) | VE_H264_VLD_ADDR_FIRST | VE_H264_VLD_ADDR_VALID | diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h index d178d7ad53b6..afcae3052085 100644 --- a/include/media/h264-ctrls.h +++ b/include/media/h264-ctrls.h @@ -165,9 +165,6 @@ struct v4l2_h264_reference { }; struct v4l2_ctrl_h264_slice_params { - /* Size in bytes, including header */ - __u32 size; - /* Offset in bytes to the start of slice in the OUTPUT buffer. */ __u32 start_byte_offset; -- 2.27.0