From patchwork Fri Aug 18 07:17:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 110361 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp550002qge; Fri, 18 Aug 2017 00:19:04 -0700 (PDT) X-Received: by 10.99.133.65 with SMTP id u62mr6843625pgd.100.1503040744066; Fri, 18 Aug 2017 00:19:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503040744; cv=none; d=google.com; s=arc-20160816; b=q1JNlS1ImDRFKqu1wQ0VyWtoz7nxD/YkFNn7gcjvHTOO1KRnQ5/slL2UQIHNbG+MI0 vwLiwZ4xCq9lDPkHReG1NP7XCkmc/wxDavMzYo2lxY03nt3cw71WHyWq6/bEBB1i1R1H pmX/HADx+uJ0W09k9puBUE7FYRIY7mUM1w2T+o5cnCK0cZiN4F+Fi6b4k2qc8KfYnWqA +QSPy/0UBGOk3ZN5AcDVIIQSxFw5h2jdZo8LU8TqINsMiHVfLdktTbHAh2K/A4y3BCfz j7dGU1R0zLFMpTcxIlXbd08CFHTdlTlXustx1cNNpsY00+hulFTcCrFB8GV+tpfZFxE+ byBg== 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:arc-authentication-results; bh=WZma9/FVx+4ujRq49xwt1lLa1OfmilkWR60UbzRTIL0=; b=shDu+30k1JxieMRRDShN59Fg6PEZDt9vJpfsuXzrwkoFfz+hApNgHwPMKJGI2mklcX rgWEUIa29ystQkhXd4hLD5krDj0TJwX7nv/9bgpSjHUol0r/n/EkhOxeTpdMubzyLTV0 tWV3Tn5ipvS/rke0e/OWZh2F1LJqD5Fis8D17hIMl67U+yxDRJIi9F78RDXwPAv9ralQ +mHvuynFymU4nQzIh9OqL9mhqKt9EuK0Pdh7KTeaFpglOxGDROO1zaKA0b1Mq5w4LM2k xcuT4bKrcicxS83sUuRYXNd9db6jMUtJAnv+jupIM1PuVHs6nDreweCqpj1W8WtNAPyb bjDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YoRZ76KV; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 o64si2107580pfk.249.2017.08.18.00.19.03; Fri, 18 Aug 2017 00:19:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-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=YoRZ76KV; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 S1750927AbdHRHTB (ORCPT + 4 others); Fri, 18 Aug 2017 03:19:01 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:36934 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709AbdHRHTA (ORCPT ); Fri, 18 Aug 2017 03:19:00 -0400 Received: by mail-pg0-f50.google.com with SMTP id y129so58821257pgy.4 for ; Fri, 18 Aug 2017 00:19:00 -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=WZma9/FVx+4ujRq49xwt1lLa1OfmilkWR60UbzRTIL0=; b=YoRZ76KVuuXVQrMuA/vhxIiw2HvI8Vy6Txb8afLSbiuMh/fWMnydcN7xJm6NDagD4z VkNuaw2xDs8U5l08+XTUevzDQzHIJqap3bDHqEnVjmStkIw10QaI7u52p5sMliGx0LBI 2MYF5Z/cpAIzZg+XvITM3Za8ijI4wWkscBvro= 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=WZma9/FVx+4ujRq49xwt1lLa1OfmilkWR60UbzRTIL0=; b=R6efZM1vaCo0t1KFMAykCBppRIE8EHIccZtKsUHtzwMWKQ0S2Sc+dFh3M1fzKXV8yz gtbSToIHs2B7mJapngaOSxdaHfov1hmQGgxtpY0PAhtW5HSIJ+tAdM65727Oza+NPdGb GoTlqMFBgsoCxtAvnxIV9KAq+zzTDzBL7PaddxPgrqpoaPAoBbSMJUXsZTuQhbtKN92c PCLWU73WEf2oEfeLSPX/6PcnHMvi8BpZpvgsqa2FX81FiqedSEEd8BNR1HezWR0brQ3P cNZ4M6GKV0PcQ0iUsjT3YLKDQlXP4qbngiChXvtlsR24Z/L9crOM8UzQEr+lAhxN0y1w zyYA== X-Gm-Message-State: AHYfb5hJAfDErEeU6B2CbkOin/j1+YvYrUVNp8mq4THFLkn7Ps4fCTDj 2u2MR44dWdjM3DUnHGlVcg== X-Received: by 10.99.174.11 with SMTP id q11mr5932467pgf.111.1503040739992; Fri, 18 Aug 2017 00:18:59 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.15]) by smtp.gmail.com with ESMTPSA id v9sm1359746pgb.30.2017.08.18.00.18.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Aug 2017 00:18:59 -0700 (PDT) From: Baoyou Xie To: laurent.pinchart@ideasonboard.com, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, shawnguo@kernel.org, baoyou.xie@gmail.com, baoyou.xie@zte.com.cn, jun.nie@linaro.org, broonie@kernel.org, arnd@arndb.de, Baoyou Xie Subject: [PATCH v1] [media] uvcvideo: mark buffer error where overflow Date: Fri, 18 Aug 2017 15:17:56 +0800 Message-Id: <1503040676-28802-1-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Some cameras post inaccurate frame where next frame data overlap it. this results in screen flicker, and it need to be prevented. So this patch marks the buffer error to discard the frame where buffer overflow. Signed-off-by: Baoyou Xie --- drivers/media/usb/uvc/uvc_video.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index fb86d6a..81a3530 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -1077,6 +1077,7 @@ static void uvc_video_decode_data(struct uvc_streaming *stream, /* Complete the current frame if the buffer size was exceeded. */ if (len > maxlen) { uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n"); + buf->error = 1; buf->state = UVC_BUF_STATE_READY; } }