From patchwork Tue Oct 9 06:47:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Bobrowicz X-Patchwork-Id: 10632015 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 1114E112B for ; Tue, 9 Oct 2018 06:48:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03BAB28827 for ; Tue, 9 Oct 2018 06:48:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECA172891C; Tue, 9 Oct 2018 06:48:27 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 8734C28827 for ; Tue, 9 Oct 2018 06:48:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725947AbeJIODv (ORCPT ); Tue, 9 Oct 2018 10:03:51 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39317 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbeJIODv (ORCPT ); Tue, 9 Oct 2018 10:03:51 -0400 Received: by mail-pl1-f194.google.com with SMTP id w14-v6so319918plp.6 for ; Mon, 08 Oct 2018 23:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elite-embedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LaVzmS2KYAFhhbZorwVeub9CQoT9j1KBTo27cQVYiSA=; b=M0oaekJIKhrg1DwFI62sgw/X+W95k+GG+rWG7AJH+jjnDiBbgL0+e+/sDjXasO0iO4 U0G+kY9wDRNK7Rbo/sYQF8sLz8LGGeDgLttH4l3c1J55f10KvO34jVVLuoQ/+6aCtRQj BgWaHJ9Dan2QaT8+iVwsxcoHus0y2LDSBU7JJGv/DmZckoBJ7neNBj+nQYnaIB4Qo3gI tpMuZXTiaXqHvwdV+sTFMn2yv/YdOtF22BallP4Mb7ZTr+E7f/NzbKHSx6Q6YxRMuDLB wI5ZWnZP1q1PkQaxGxtkEH8PijquqPdNPK+GUPE8I3sv2eZDMH7JrOAE4NoauK6N66A0 sWXA== 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=LaVzmS2KYAFhhbZorwVeub9CQoT9j1KBTo27cQVYiSA=; b=JYTUp4YRWYFQTWMGMeP0oC7o8hJULej9r5s8jOQP1vNGzcymmWaax8tZwgvL2gXX/h 4hsz+0zURwDQEx4ieUqKUlnpcmmJCt21CfPkG1qanVPyhC/3of8GCuQe1fyo7yEVleU0 rcZe1bBmpU9Tm3rHfljg+af60wDlqJuwd/tnOYiHvxQz6+HLtRvAXmAxjur9NIZYKkZ+ WrxLKLXJIhnorb9fxLr61saapd50PqbFO0pGvmzHtU91FmTM1R7aFPT7qZ/PbFSBmzvv PZlE1c/xXpYBfgH5jp2jCnANwuAMZx/hURcuR3cLsEo5QpF8ogGEcAYd7cwpXZN0FFmQ HqAQ== X-Gm-Message-State: ABuFfohRIsFpT19//XHXpdbaz+MZcEhj3VAIBLMs/ShGSPUdrMlhSx3R 3YRXCfct+3M5SjMHYolM5Nrwtq6qm4Sm X-Google-Smtp-Source: ACcGV63kUqFCLpY5ZiklBdynmUrXZYKY6zcMFbD2YoBgp5xJ+SkmKvlZVRc30qxmD6gPfOORt+tq9w== X-Received: by 2002:a17:902:b109:: with SMTP id q9-v6mr27255525plr.83.1539067706103; Mon, 08 Oct 2018 23:48:26 -0700 (PDT) Received: from ubuntu.localdomain (97-113-94-157.tukw.qwest.net. [97.113.94.157]) by smtp.gmail.com with ESMTPSA id h77-v6sm38960457pfh.13.2018.10.08.23.48.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Oct 2018 23:48:25 -0700 (PDT) From: Sam Bobrowicz To: linux-media@vger.kernel.org Cc: Sam Bobrowicz Subject: [PATCH 1/4] media: ov5640: fix resolution update Date: Mon, 8 Oct 2018 23:47:59 -0700 Message-Id: <1539067682-60604-2-git-send-email-sam@elite-embedded.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539067682-60604-1-git-send-email-sam@elite-embedded.com> References: <1539067682-60604-1-git-send-email-sam@elite-embedded.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 set_fmt was not properly triggering a mode change when a new mode was set that happened to have the same format as the previous mode (for example, when only changing the frame dimensions). Fix this. Signed-off-by: Sam Bobrowicz --- drivers/media/i2c/ov5640.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index eaefdb5..5031aab 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -2045,12 +2045,12 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, goto out; } - if (new_mode != sensor->current_mode) { + + if (new_mode != sensor->current_mode || + mbus_fmt->code != sensor->fmt.code) { + sensor->fmt = *mbus_fmt; sensor->current_mode = new_mode; sensor->pending_mode_change = true; - } - if (mbus_fmt->code != sensor->fmt.code) { - sensor->fmt = *mbus_fmt; sensor->pending_fmt_change = true; } out: