Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1593103imd; Sun, 4 Nov 2018 06:00:51 -0800 (PST) X-Google-Smtp-Source: AJdET5fivUbFOvg2mspZ4HIQP/uYECY9pVanu3Pv+hXB2lKQxyzprCqtijLeH4Fi2eS/9SP+3VYx X-Received: by 2002:a17:902:8f94:: with SMTP id z20-v6mr18393068plo.175.1541340051863; Sun, 04 Nov 2018 06:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541340051; cv=none; d=google.com; s=arc-20160816; b=sIo05TDLny9SfmGyvkcJtjY2nEn7oiYgKinn59IKXKcMemIjUq0iVneYtKgf8F0teL TFEvbkH42Hmdp0MYw89aTgX9Pdrbo2557AfC8TfhKEl2n0YXGSfNvURPfl+NNHrQTI5e X6a35ImCqHyL7Z1kpy4D5gabbGZTPeA/fofpu/+KKANCprHtmokH5646iprLycPBP3Md +Rf9UxNqXw0HHckA3FExyzHncMAFOfUYVlWPHpewa1wlrR3aaPAeQuAhz+UcGgnwFzlC C+TF8NQO6eiypFLbsWs1GNfZ6OhM2wNSvMel1MMdSz+94VAnTxvuJA84JwJxmSOEcwLR 28rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=tXwmRUoWL0EVFsgz+gIXJckp6RfT6CkYr+WB5TLUsS0=; b=pCaxXRGLCzDXrM5GKGipzBNFfRo/sjj1cLgwTX20NztR+SLn0aQwgsBP4lSzCcBGAd qe0QJ+gQhnDNOVD3iALDcPwk5pb+DS9musO1CEh7cUmFjlLkcYXBZaUgDx9YrxC3FzWg 8+tP00hDh2oqEzxqq3VgSCTzEVpxdpulFcCkmCGytNlM5pqfDeQ8sNroD9CGZeJDDX0q dDn1zBWjm3CnA/Nn+KyFosSH3HdOWTe4Vsg2jMgAi3Imj+26MYCYPF+15bPeiqHV+kn8 0/1dRycoh22HNc2DbeaZPMKB+2l+8HE7SPUiZcZONn82Rprg71lHshF0IwJGScVz9D7d rdcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Nsu06Eh8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l123-v6si7125238pfl.200.2018.11.04.06.00.37; Sun, 04 Nov 2018 06:00:51 -0800 (PST) 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=Nsu06Eh8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731332AbeKDXIu (ORCPT + 99 others); Sun, 4 Nov 2018 18:08:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:47924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731227AbeKDXIt (ORCPT ); Sun, 4 Nov 2018 18:08:49 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6092120989; Sun, 4 Nov 2018 13:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541339625; bh=8D3rTrk6fgYBT4ek2LS7azP6GbwNVyLMFQSOOEEz0C4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nsu06Eh81nam+aO0/2TgelDUR8qnL0DacrtFQaVEHlRFOpchb5gEJ0ymfS8zwKfC5 9V9Pu5JFcQo5SnAt6czBhngB4pmLkyXnF1oPnsR+HHe1JTxWWv2PPNJwWyohzTg+0g D2nW6ay5irR5pPBTAPEN7hgLC6tgqNuUf2ipI/a0= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lucas Stach , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH AUTOSEL 4.14 19/30] media: coda: don't overwrite h.264 profile_idc on decoder instance Date: Sun, 4 Nov 2018 08:53:14 -0500 Message-Id: <20181104135325.88524-19-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181104135325.88524-1-sashal@kernel.org> References: <20181104135325.88524-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lucas Stach [ Upstream commit 1f32061e843205f6fe8404d5100d5adcec334e75 ] On a decoder instance, after the profile has been parsed from the stream __v4l2_ctrl_s_ctrl() is called to notify userspace about changes in the read-only profile control. This ends up calling back into the CODA driver where a missing check on the s_ctrl caused the profile information that has just been parsed from the stream to be overwritten with the default baseline profile. Later on the driver fails to enable frame reordering, based on the wrong profile information. Fixes: 347de126d1da (media: coda: add read-only h.264 decoder profile/level controls) Signed-off-by: Lucas Stach Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/coda/coda-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 15eb5dc4dff9..99d138d3f87f 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -1686,7 +1686,8 @@ static int coda_s_ctrl(struct v4l2_ctrl *ctrl) break; case V4L2_CID_MPEG_VIDEO_H264_PROFILE: /* TODO: switch between baseline and constrained baseline */ - ctx->params.h264_profile_idc = 66; + if (ctx->inst_type == CODA_INST_ENCODER) + ctx->params.h264_profile_idc = 66; break; case V4L2_CID_MPEG_VIDEO_H264_LEVEL: /* nothing to do, this is set by the encoder */ -- 2.17.1