From patchwork Tue Oct 21 11:06:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar K X-Patchwork-Id: 5114111 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1CDB29F374 for ; Tue, 21 Oct 2014 11:07:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8CF4E20136 for ; Tue, 21 Oct 2014 11:07:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B347F20123 for ; Tue, 21 Oct 2014 11:07:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755241AbaJULHj (ORCPT ); Tue, 21 Oct 2014 07:07:39 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:36688 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755052AbaJULHj (ORCPT ); Tue, 21 Oct 2014 07:07:39 -0400 Received: by mail-pd0-f172.google.com with SMTP id ft15so1133628pdb.31 for ; Tue, 21 Oct 2014 04:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VL8nX8oE0BXYuruyZewVl1Tz6vZKBpIxml0wUplHTNg=; b=FtTzeeurFdT+G4rSEucyH/hCkZxi2WjNInGyy7ZAO6ZrBSnMCjNlRZLLai7ZU2YIWN RHOkA8oRY7P/uLxz3/y7rzL2KFR6LO6NIegfRThjC6inn+WUGlYj2joLSEZK5IPMaw9i CgQbmnGZf71oFXRHpgysQFxAUaX6J71Wk1y8Nv9nDodQaqjRAFlTxlulBr9BPvZ51yeF oMcjzNGeqICXIi73ToK+g/c/0G88dFsa34q99CUYuW1wzObILf68RaAzGb7hwUuzkHlS UgsXSbUQu9LfWKzfg8FPIE7mdjDNrp+sfSuF1fHV2Fjxhgp90PcMCaRVVWORHHYYIKHl WO3A== X-Received: by 10.66.124.130 with SMTP id mi2mr15787944pab.104.1413889658455; Tue, 21 Oct 2014 04:07:38 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id s9sm11680849pdp.1.2014.10.21.04.07.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 04:07:37 -0700 (PDT) From: Arun Kumar K To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: k.debski@samsung.com, wuchengli@chromium.org, posciak@chromium.org, arun.m@samsung.com, ihf@chromium.org, prathyush.k@samsung.com, kiran@chromium.org, arunkk.samsung@gmail.com Subject: [PATCH v3 04/13] [media] s5p-mfc: Only set timestamp/timecode for new frames. Date: Tue, 21 Oct 2014 16:36:58 +0530 Message-Id: <1413889627-8431-5-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1413889627-8431-1-git-send-email-arun.kk@samsung.com> References: <1413889627-8431-1-git-send-email-arun.kk@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ilja Friedel Timestamp i of a previously decoded buffer was overwritten for some H.264 streams with timestamp i+1 of the next buffer. This happened when encountering frame_type S5P_FIMV_DECODE_FRAME_SKIPPED, indicating no new frame. In most cases this wrong indexing might not have been noticed except for a one frame delay in frame presentation. For H.264 streams though that require reordering of frames for presentation, it caused a slightly erratic presentation time lookup and consequently dropped frames in the Pepper Flash plugin. Signed-off-by: Ilja H. Friedel Signed-off-by: Kiran AVND Signed-off-by: Arun Kumar K --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 79c9537..eb71055 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -220,11 +220,14 @@ static void s5p_mfc_handle_frame_copy_time(struct s5p_mfc_ctx *ctx) size_t dec_y_addr; unsigned int frame_type; - dec_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dec_y_adr, dev); + /* Make sure we actually have a new frame before continuing. */ frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_dec_frame_type, dev); + if (frame_type == S5P_FIMV_DECODE_FRAME_SKIPPED) + return; + dec_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dec_y_adr, dev); /* Copy timestamp / timecode from decoded src to dst and set - appropriate flags */ + appropriate flags. */ src_buf = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list); list_for_each_entry(dst_buf, &ctx->dst_queue, list) { if (vb2_dma_contig_plane_dma_addr(dst_buf->b, 0) == dec_y_addr) { @@ -250,6 +253,11 @@ static void s5p_mfc_handle_frame_copy_time(struct s5p_mfc_ctx *ctx) dst_buf->b->v4l2_buf.flags |= V4L2_BUF_FLAG_BFRAME; break; + default: + /* Don't know how to handle + S5P_FIMV_DECODE_FRAME_OTHER_FRAME. */ + mfc_debug(2, "Unexpected frame type: %d\n", + frame_type); } break; }