From patchwork Thu Jul 9 16:36:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 11654723 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 534886C1 for ; Thu, 9 Jul 2020 16:36:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 26B192077D for ; Thu, 9 Jul 2020 16:36:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SJdPIE4e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26B192077D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=WK83AJirr91RD0YSiJ6IJ6rQiZmlQXFsAMxOtxbNfI8=; b=SJdPIE4eeeYFBzOT7zinxw7RSX 7FCmQjYO7g+/dp4SRU3SX5DJtMBDpp30Ga4FoX+2MOEs3Tu4dtzmPGrIDp4fuYcABmZPxmogc8Odq pTlTSjl9H7qdMgvvCZfgmIhTzsfKk6prOZfilC9HxSsfw3Y+8MN97tgOBkRPMLoiQ12tz73hwCLTz o3OdfhtHIdjEVUNGJrbyMan9vLDLsS4+IuG2SSNfyAGtvfYEy2mCKNGcPlIfrRKs4u9PRnfM/v8SI TWCrVjIHSXRXqPJzq+RFChSFWOxLKBQXqeqe1W09y1I2C4DD+QrCwSvYThxBiXTCUqs/1m7wexAdZ xRwjp+vw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtZXT-0005ot-BD; Thu, 09 Jul 2020 16:36:47 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtZXR-0005oT-AJ for linux-rockchip@lists.infradead.org; Thu, 09 Jul 2020 16:36:46 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id C6C5F26D012 From: Ezequiel Garcia To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v2 0/2] media: hantro/rkvdec handle unsupported H.264 bitstreams Date: Thu, 9 Jul 2020 13:36:33 -0300 Message-Id: <20200709163635.42996-1-ezequiel@collabora.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200709_123645_445005_3D1CB88F X-CRM114-Status: UNSURE ( 5.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel@collabora.com, Jonas Karlman , Hans Verkuil , Philipp Zabel , Nicolas Dufresne , Ezequiel Garcia Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Hi all, Small patchset to add a check at TRY_EXT_CTRLS time, via the H264 SPS control and reject unsupported bitstreams. Properly refusing to decode unsupported bitstreams allows applications to cleanly fallback to software decoding. Note that Rockchip VDEC hardware is capable of decoding High-10 and High-422 bitstreams. This needs more work, so for now they are refused. The same approach can be use on Cedrus, but since I'm not very familiar there, I'll leave that to others. Applies on top of media master. v2: * Use p_new instead of p_cur. * s/PPS/SPS in commit log. Ezequiel Garcia (2): rkvdec: h264: Refuse to decode unsupported bitstream hantro: h264: Refuse to decode unsupported bitstream drivers/staging/media/hantro/hantro_drv.c | 29 ++++++++++++++++++++--- drivers/staging/media/rkvdec/rkvdec.c | 27 +++++++++++++++++++++ 2 files changed, 53 insertions(+), 3 deletions(-)