Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1932403imm; Thu, 24 May 2018 03:09:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqgz2AYd6Wgq4O92u3CtiWMW1225BZAubDQp/t8dMthwshFm2AOABQMCeNI7YmUWWP+uGey X-Received: by 2002:a63:7d43:: with SMTP id m3-v6mr5368793pgn.117.1527156558415; Thu, 24 May 2018 03:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527156558; cv=none; d=google.com; s=arc-20160816; b=uVlw6c2XyhyKT1zsnSqi4vhpNFBdyV0iQAKHUTgZwG73FuXo3FCytByNqux/vBxVYk TimHxf9m1EPbl78gpwmRVhLiPS6iZPcqwt2kbsee8aTsL80IqgF5OV35cS0aAIQY5JSG Odr1JNO4z748QNZbmh7EEx4Q1iniyVZnoUpr1NASb+GuYYGm2MfdoUa6I1Ocl1N8u59T gAkUm7U/rRPsbHn6lNTlBlBpB1lxRKphik3tuOEiDpuqV6aQ5Kg+MOe4zpWvx5JxBkBD vX91om4gRkkpw4AyYhJQ0JSB5VOuy1WEnm/5lmCQ5l3AfYSI2iS6iiBINr2G40WbdW19 C5aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=riW6Epxj6DOS9Pqj+o1MFJbMdcx8Jd9ckDtMUcv9Uf0=; b=Z76UEO5cJcfBOprZsT1pa0/VuIX9O++U7qnEDcHzlWOsm2OaIZQ05j8V1TCaMqilup fap7t2eiHhplie+JP1EN0B/p/Wp43p7g3qts0gRlFWVAgOqcmxSfQqp0elQ3PRPgJbrm dHpjV33xnT3rVuTwy5uhoT52iwibul055buyfss3UGiRSaDtUTdtmKn+f0c9q/bEhzX0 wTZOGOvNUgcY1NSW/RNvYm/NKEmbeD3KRXDli+b+Etlsx6auE+rYrxWjc6BoPITW4JUf gMc22hsEPdrrGYzwVBeRibSa6YNOjh+etJ5jZtizUSJcRbNYLxMum5mYYc7sxuaEQaSs mKyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O6coU3ZE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g77-v6si20931266pfa.304.2018.05.24.03.09.03; Thu, 24 May 2018 03:09:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=O6coU3ZE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031741AbeEXKGe (ORCPT + 99 others); Thu, 24 May 2018 06:06:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:55314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031705AbeEXKGS (ORCPT ); Thu, 24 May 2018 06:06:18 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 75E76208B2; Thu, 24 May 2018 10:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156378; bh=FOOaqwRlme9919dKscoWaABNspnRmmC6nYVV8yjlnyo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O6coU3ZEZXv2hGGgQ/P08tjlAptO3TcDkCwKpQNsaRqLyoynicVXU4wsUaJNG4b40 20QFszOb9J4IpBBQ01d0u8mUKcD8P78CHGvnkZRZmw9F9ycM+DG+HIH42wtpQ4EmnU PWPIy51cpwKdQ1ZFCk0NQDB2KNKIdXqthAj8UQWs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Laurent Pinchart , Kieran Bingham , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.16 140/161] media: v4l: vsp1: Fix display stalls when requesting too many inputs Date: Thu, 24 May 2018 11:39:25 +0200 Message-Id: <20180524093035.126474183@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Laurent Pinchart [ Upstream commit 5e3e4cb5e24b92773b194aa90066170b12133bc6 ] Make sure we don't accept more inputs than the hardware can handle. This is a temporary fix to avoid display stall, we need to instead allocate the BRU or BRS to display pipelines dynamically based on the number of planes they each use. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/vsp1/vsp1_drm.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/media/platform/vsp1/vsp1_drm.c +++ b/drivers/media/platform/vsp1/vsp1_drm.c @@ -530,6 +530,15 @@ void vsp1_du_atomic_flush(struct device struct vsp1_rwpf *rpf = vsp1->rpf[i]; unsigned int j; + /* + * Make sure we don't accept more inputs than the hardware can + * handle. This is a temporary fix to avoid display stall, we + * need to instead allocate the BRU or BRS to display pipelines + * dynamically based on the number of planes they each use. + */ + if (pipe->num_inputs >= pipe->bru->source_pad) + pipe->inputs[i] = NULL; + if (!pipe->inputs[i]) continue;