From patchwork Thu Sep 7 02:59:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 111846 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp200708qge; Wed, 6 Sep 2017 20:00:57 -0700 (PDT) X-Received: by 10.99.126.84 with SMTP id o20mr1224791pgn.183.1504753257324; Wed, 06 Sep 2017 20:00:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504753257; cv=none; d=google.com; s=arc-20160816; b=DabUrrqXzmLgsVtDYqOvkk4v9AnE6v5AEh/MGyBcnCKnOOx9f+aOYlo5CkXMnWOli4 NTmWfi65ZCQo8oRRvPv3V/ZYFGjfM47H0ZFic1jGbfKD2KVuDmUmxFBqhGRq+AkNaQTn LGD1VfpxkPYdnGcr2MnEg3OiwKsoBytt2GTtwldWaGhzU3mL3QPrZ9JBkfEAGR/GQkvy kZWLCn4jbsyhaUQ8HBUkz6uZgwb6EZVeJRpe8pMGOvjzLtfmIO117zRqq2+nYnch+E4D HGcHHIPCO+bJ14f0dhytGiWhQvgfzmXNs2tSlDYNHpBOA0iIqGgBpQuakyA5op8oEmWQ JOog== 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=sPdtv56C1FviIiqWoVvkGErRp1vv4cL5BOfH+Mgj+SYYMb5O9R6xQie7CaXZ6VOVwJ b8ip6brdD6Qu5gkJFLGxVXWgFWOq8D3k8rDY4qgp0a3SP11nL7HWYeg0q9kkclgccdpS vNatJMiP6kht0OTnYudPcgJnY5S71smQuPKF7Tvafx4+862FQyLXqk5aJKtdubnmKdE7 fgWiseq9b/SLOTE8wHKVFtV+Degp24B8qHYqHbccco7ucPBk6FTp3x06Qlj2OdTFx5hv ppLoMZw3hd2ZHvAT+dcLi37HCxR1kvZMrTCwbtPTPyV5C3ULYXqZEAgu9gbec2lWs+iO TgSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PY+lAz27; 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 l3si1113599pld.51.2017.09.06.20.00.56; Wed, 06 Sep 2017 20:00:57 -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=PY+lAz27; 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 S1752353AbdIGDAx (ORCPT + 4 others); Wed, 6 Sep 2017 23:00:53 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:34612 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751985AbdIGDAw (ORCPT ); Wed, 6 Sep 2017 23:00:52 -0400 Received: by mail-pg0-f42.google.com with SMTP id q68so2739007pgq.1 for ; Wed, 06 Sep 2017 20:00:52 -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=PY+lAz27Ds/MYP5NuWT+RrV/49FvtO35QHxMGfbRdzoF0zh7vISW0aDZV2XOliC+NR yB23Y6MTI/oYpjSmL+bwzfA1/+FZgEXHJbe21CPI2FbjrkTm4W2wTIoXnpjfWxkw+IOv V5hniDk6JK+0Xhz4k3vdoMxdq1UpDIYEg13Vw= 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=GFOqB9Lwps/4CuZXtCeB9c/SFwq9uR5hUhHY6rycCJVcryjtgz8Ydnf5JHyspAXWPb E+z9e8Xsf5cJyAjJUNQ/7RHRL/pKtF/cyHxaRQBRxqNWNxGKlonpnKBtH5iVDZFpGA6n J3A9nsZTzvYdtdgtiU3mmOsTXMGCG9rF7LiGsHQpVNHbkQ+cw8/3kdnqgEqSBy9/c9NH 1mLJaNtE/nUXuWJ6bVVVpHp/wFGV9ITGY1lyez2y57iI3PGl0IhkJ3rBwmDXMCmImcQC Z11/beWNh8ZizZezsL8blRB7FcjksbpIF9YcHXLiiHA8rq5WizACrpOM4MtTojYQPEwa 5tIg== X-Gm-Message-State: AHPjjUghooYLQuq/3yyYYLuvW/yiED7VPYfggu7vjSw3QVzzRRyJKrTy 4zOpJx2sYTGJ70CB X-Google-Smtp-Source: ADKCNb4VgKm5b1mhqj0peB/HIPJNu4bew6ry1hZXySPOb9AyBiDbLhz1E+F1algWdjYx7uffvV4rZg== X-Received: by 10.98.210.8 with SMTP id c8mr1258178pfg.109.1504753252274; Wed, 06 Sep 2017 20:00:52 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.91]) by smtp.gmail.com with ESMTPSA id f3sm1421214pfa.93.2017.09.06.20.00.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Sep 2017 20:00:51 -0700 (PDT) From: Baoyou Xie To: laurent.pinchart@ideasonboard.com, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, baoyou.xie@gmail.com, xie.baoyou@zte.com.cn, Baoyou Xie Subject: [PATCH v1] [media] uvcvideo: mark buffer error where overflow Date: Thu, 7 Sep 2017 10:59:48 +0800 Message-Id: <1504753188-8766-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; } }