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: 65358 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1jtZSz-008HFT-9g; Thu, 09 Jul 2020 16:32:09 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726885AbgGIQgp (ORCPT + 1 other); Thu, 9 Jul 2020 12:36:45 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60282 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbgGIQgo (ORCPT ); Thu, 9 Jul 2020 12:36:44 -0400 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 Cc: Hans Verkuil , Philipp Zabel , Jonas Karlman , Nicolas Dufresne , Ezequiel Garcia , kernel@collabora.com 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.4 (--) X-LSpam-Report: No, score=-2.4 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no 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(-)