From patchwork Fri Feb 15 13:05:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 10814937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3DA5922 for ; Fri, 15 Feb 2019 13:06:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1C1D2F1F6 for ; Fri, 15 Feb 2019 13:06:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A62062F20F; Fri, 15 Feb 2019 13:06:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 536DF2F231 for ; Fri, 15 Feb 2019 13:06:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394897AbfBONGW (ORCPT ); Fri, 15 Feb 2019 08:06:22 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:45073 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394896AbfBONGW (ORCPT ); Fri, 15 Feb 2019 08:06:22 -0500 Received: by mail-wr1-f67.google.com with SMTP id w17so10237533wrn.12 for ; Fri, 15 Feb 2019 05:06:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7bC/P9l8kovwO03XgdMHc6Ed9Tt0+DuapeIPpqcOpJU=; b=ovff6fDMdf2MZ1SXypWQKxXpZPjbGHoRhXJPOIIX7jkXWTXS1qAWlYDhIZ+N4skrZ3 3DwPNSRZTy5sMrtscSuqTCXV6SC9Z1PrPr/V3EHhEhax2pYtOTPHTocJLvoUXaUkBqO1 ig8hoj6AI5TP+09VX1tBAb5brTMxKti15tfM/1i3zl0Ljk9uP1hL6goQ2/wV5yz/rKdD jqLeQjEHwKTjRopqcmHtYs3dszL8I47trcYbbPj+6kJ9lVYLueMomiegzCo5Y1vnG43/ y2HSbonnOghJKiiZ3v5mfx/rT5/9HyG+Jz0Gyw1otgBk0vn8T0kukMy8pEuA4NDMydp0 ZMuA== 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:in-reply-to :references; bh=7bC/P9l8kovwO03XgdMHc6Ed9Tt0+DuapeIPpqcOpJU=; b=rOB697T3bXgHsUKKwRTcPyygX9vynmyF4dqQ83zBz8++UQb2c69j+HJQIz7rtbECeh jbunbNN9UMkFLhc/fwJIs0gCIuhSwpcsFlszIcvvFH3as6GFjtp+lU4F4cpMNSNtAuyd dmnZNeNpXMLPuVg5SMyyOpHXa+rTiLAVFShv2PG8bnQDBOsctgtHatZ3Wdb6XShFDOvf 0XRlS/z3hV6SBK/nQEirKHoz2sqLPt2bN613ZOhm0rYBEW8XKY48RFN5zpJOpLC2mJgi TR4855mZYmuDzDiCZpCMh+7ZhN6JOIuH5DcSbAca4u1NPhVrDFnTNkLkfsVs4hbxEmnK xfPQ== X-Gm-Message-State: AHQUAuZJ9hI4izMPpnlxKiOcwi6z8Fln1DKP8glD4CSiewnqoTNyoEpF 1g3XbZw1YddcXBajZujsjL30yXk6AuQ= X-Google-Smtp-Source: AHgI3IbPuSLjSJrL0pwyt0N6t+YPPLXvfr5QJ6aUd9MWZNHv26z7M7oDllDHwyrXGEV1rbJqddYQUQ== X-Received: by 2002:adf:dc10:: with SMTP id t16mr7068704wri.40.1550235980329; Fri, 15 Feb 2019 05:06:20 -0800 (PST) Received: from localhost.localdomain ([37.26.146.189]) by smtp.gmail.com with ESMTPSA id n6sm2091065wrt.23.2019.02.15.05.06.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Feb 2019 05:06:19 -0800 (PST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, helen.koike@collabora.com, Dafna Hirschfeld Subject: [PATCH v2 03/10] media: vicodec: add field 'buf' to fwht_raw_frame Date: Fri, 15 Feb 2019 05:05:03 -0800 Message-Id: <20190215130509.86290-4-dafna3@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190215130509.86290-1-dafna3@gmail.com> References: <20190215130509.86290-1-dafna3@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the field 'buf' to fwht_raw_frame to indicate the start of the raw frame buffer. This field will be used to copy the capture buffer to the reference buffer in the next patch. Signed-off-by: Dafna Hirschfeld --- drivers/media/platform/vicodec/codec-fwht.h | 1 + drivers/media/platform/vicodec/vicodec-core.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/vicodec/codec-fwht.h b/drivers/media/platform/vicodec/codec-fwht.h index 60d71d9dacb3..8a4f07d466cb 100644 --- a/drivers/media/platform/vicodec/codec-fwht.h +++ b/drivers/media/platform/vicodec/codec-fwht.h @@ -123,6 +123,7 @@ struct fwht_raw_frame { unsigned int luma_alpha_step; unsigned int chroma_step; unsigned int components_num; + u8 *buf; u8 *luma, *cb, *cr, *alpha; }; diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c index 9d739ea5542d..8d38bc1ef079 100644 --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -1364,7 +1364,8 @@ static int vicodec_start_streaming(struct vb2_queue *q, state->stride = q_data->coded_width * info->bytesperline_mult; - state->ref_frame.luma = kvmalloc(total_planes_size, GFP_KERNEL); + state->ref_frame.buf = kvmalloc(total_planes_size, GFP_KERNEL); + state->ref_frame.luma = state->ref_frame.buf; ctx->comp_max_size = total_planes_size; new_comp_frame = kvmalloc(ctx->comp_max_size, GFP_KERNEL); @@ -1413,7 +1414,9 @@ static void vicodec_stop_streaming(struct vb2_queue *q) if ((!V4L2_TYPE_IS_OUTPUT(q->type) && !ctx->is_enc) || (V4L2_TYPE_IS_OUTPUT(q->type) && ctx->is_enc)) { - kvfree(ctx->state.ref_frame.luma); + kvfree(ctx->state.ref_frame.buf); + ctx->state.ref_frame.buf = NULL; + ctx->state.ref_frame.luma = NULL; ctx->comp_max_size = 0; ctx->source_changed = false; }