Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794246667; b=CGwzL6sX8gY6r/xg6iBRFoASeOdfYsWHBCvr6eHDdHp0+VzqnYxiZ2/v/YGg2DYn5iRg V2pK6jNoZW5r2dlShur5jx9+H/yx2eCMq7kTb9tC7pgPcaO2N7IA/8ZZF0WVWgUHsAThX Llum4QDT+hwUrdHLMlKwKw6lB571SE8YrXNg7dKK4PWwgoGM86QyLOQEwqxPKe4Y58ipm Aw5bgOzf1ZhQyfyF5eD7Kh9Jdmuhv3YELyXUyGvDfySi0VB2SDRpg2NsS6ur48DguXZBL AR25m81rEZSL/mZh5A+ZX3MAKSO1QuCPcqleSvw98cr8BngkjsN39Lj60tTqd4j4wug== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794246667; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=t2EBWm0WsMjUhoHR6YsRGN60RmHktL80iMChWst02Po=; b=MSYDH4gznKGhyU61zVSDQ8BsZfAGjOxls8j0lpGzIQZljn7jWGFA5HdeSM9dn446dehC dbAI/aP4DTf2eBftS8vd+DcxLjjkRZuftLanZgBFFG2Hnve6L4mr0+Wuecjg8geWaiyIG F3jJwyg6NvEa0u8wj9PNXtZhxhkExHB8fuKNlSryMxT2RLCLZudnow3UkPAWHnTQujnYW ChBd7NCNw7hJmAd/1eG/FgYF3m7Chmk0VXnqadhPct/fBita2WjY9ZxQS9GsRlGm54SQQ E75LyRlAUaKtYEjqxRBqPbYGh5kjnL2auOsi9W4ndaTSp+jC/IzJ7V9H9ZV2cev/95g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=HoaoxZsx; arc=none smtp.remote-ip=209.85.128.47 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6F44606A330 for ; Mon, 9 Nov 2026 17:51:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D6F44606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=HoaoxZsx Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4b4571ff080so14309875e9.1 for ; Mon, 09 Nov 2026 09:51:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794246665; x=1794851465; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=t2EBWm0WsMjUhoHR6YsRGN60RmHktL80iMChWst02Po=; b=HoaoxZsxyVMYO7A9pJFtu/iYFEg+f72EGw9QLVjFJE1HpTzbWLkfVaZ3wfPTwBJOJv LaEed3CGew4U5eVFlkjAjVHOamdVyWk5GjA2Gfj5eS7f6R6NAtznYfDZjriR3oQLSlVq Fjnty9h3WOQhwPENUtwCnQEzVmflcTlIFbUjzotP6r6LNMRQQ56MbJEdFEZW8TvokG6l JEt8F/sl86ZDoxo1T2XeBNU6Mbgd5hAcsIGU/dpAp33L0y2wNchvHTIiHgVbm+NrFOpv Xau7kYeYxJOcELxYfQzRPUlm4kE43KXYNEvwKtOijWSxAdZfiOwp1hfw/vIVcts1S5Zb if1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794246665; x=1794851465; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=t2EBWm0WsMjUhoHR6YsRGN60RmHktL80iMChWst02Po=; b=Kkn9PfNqMFfruOx2RPV0VP22B4/ErfK5Z1T6X1cJct+3p1QyKjylrJXB63x2XIKXOu RqU7rT+OhhsJmhaqn+z6LKW/JSAc9DLgrpxhdK9/n99v7Tg6diTADAqpFsb5j5maGCwD bxYut9rGLeBcgkcJxLZXrTNyVM0Tj0PilZO9d0wMBSMdEhNYVJCobw/hxo1qBpff9z1d c+ZyX2aiZuojXxXETkjt+if4OumxSfjq1QKzg30s3lqqJ30wdanI2fQLHH5R71HKisKq KYbRAv8o0Xfok5WKaeh/b8W/vIGVlFivhTTPUJNu2Sui8v8WpMSBKN82XFseU6XyNcNG uHtQ== X-Forwarded-Encrypted: i=1; AL+hErHzVx0LGY3Rs5JBYiBzubSmZP+lUDHY4U7qKQOoU8IhLWLgH2QiBX9mr9wU+zb9Xd/aHIyh+J40+r/hJA==@vger.kernel.org X-Gm-Message-State: APuU4Z/k6cjQHGrOW688cb6uVisdyTFQyPAnDXtPTmrWUePBdWOElxYV yABcVpDnEtr1T/hju/QgJZrFUl/AUe1FXXm1PvWE8UpZTX+A/0/15Z8x X-Gm-Gg: AYBFou0KqkzGPxHAW8kDOpoUDF2gXniDW99TbNfxyEOcarYP0JCw1Mx02w47gSmkCBS h5FW7L7e9rx9wZPrVEatp3ffQTu3lXfVS63vFDpfU6toQRL4fBhh/HG3+Ig9z1Gx6vNfENxVZk6 VhXlq6CN1cLPKWEyb5f7dGRn6ff9LBT6Co8k00LaC8YwGU/CXc84H01p2PE/3VMR+JNOct5wGgl vhljSGW5UiAoi2oxrKbCM7HbfQRQbPTLw+BlJLAw5BvmOeBJYZhK6h+XdEiHuZKonuPoh2fbUSm pHfD36WF2pJykJ9H1y7kUGK3VUrVH5SVlnCGLqds5zFW2y7dN4DPHuX+AYi7KocOceZWBkbmiof Cxmqyx/otjMWHULtEKDM8cpHR36h93C3FpoLNoPaxDDIES3ZmBjN8gE7egdhXXeS8exV6U9fe8Y 3TuaLfZjtkmbPbhtF71rZwE4CeLEJhpsQCoIRDJGlVri6+WYGjkBePAFJsGKL9RxvkMlfeMs0GP A2tvW4yy1K3zQyfRQ2vlA0lGvsAx+qGsqv7wvrBiqUto1ExkXvrJ/XGtrxVh1r4vVYqJvdeRWnD r+pqvdv1O99HMmxHWNhcjRuxHbIeLmYClDVDWtNJmfnAdSgaqGmrLAgAtyes3+NaeUGIPmEtJDQ h7TwEsaj3pXFsPceJtfFVlO4Y5v8zl5sLt+vZZFHZP6HUZNp0pWVaiZgtC2RDbxNuGoXCEqZwAy 0tXkBLI59clh6df8HgX6ns5dcMlMUeh3Fs4cbfZYLaUjpYzp5h4npvxOec705E40kQATDAuQbOr BsMvfE5QyoAHS6/QbZj3WB1BoZaUymULSMz X-Received: by 2002:a05:6000:3c5:b0:48e:6419:ddf2 with SMTP id ffacd0b85a97d-4982e641f54mr399339f8f.17.1794246665055; Mon, 09 Nov 2026 09:51:05 -0800 (PST) Received: from jernej-laptop (86-58-12-36.dynamic.telemach.net. [86.58.12.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-498369a4238sm200717f8f.54.2026.11.09.09.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 09:51:04 -0800 (PST) From: Jernej Skrabec To: Mauro Carvalho Chehab , Hans Verkuil Cc: Maxime Ripard , Paul Kocialkowski , Greg Kroah-Hartman , Chen-Yu Tsai , Samuel Holland , Nicolas Dufresne , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Jernej Skrabec Subject: [PATCH v2 00/11] staging: media: cedrus: assorted fixes and VP8 4K support Date: Mon, 9 Nov 2026 18:50:05 +0100 Message-ID: <20261109175016.42061-1-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.56.0 X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series fixes a number of bugs in the Cedrus driver, found while running the conformance suites and comparing with the vendor library, mostly on H616. Patches 1-10 are fixes: - patch 1 fixes MV-col buffer leak when the file handle is closed without STREAMOFF, - patches 2 and 7 reject H.264/HEVC SPS and VP8 frame sizes beyond the hardware limits, and fail jobs whose picture doesn't fit the buffers, preventing memory overruns and hardware hangs, - patch 3 marks H.264 long-term references, which fixes MR8_BT_B and MR9_BT_B conformance samples, - patches 4-6 fix MPEG-2 field picture decoding (field height, field order detection and references of the second field), - patch 8 enlarges VP8 probability table to the size used by the vendor libraries, since the hardware uses the area past it as scratch space, - patch 9 switches H616 to the 256-bit DDR mode, which fixes corrupted reference chroma in H.264 and VP8, - patch 10 clears the sizes of the H.264 DRAM buffers on start, which fixes a double free when a narrow H.264 stream follows a wide one on the same file handle. Patch 11 is new functionality: VP8 decoding of frames wider than 2048 pixels. It depends on patch 10. Changes in v2: - patches 2 and 7: check only the hardware limits in try_ctrl. Check whether the picture fits the buffers in the setup callbacks instead, which fail the job with an error buffer. try_ctrl could be bypassed by setting the control before the buffers were allocated (Nicolas, Sashiko). - patch 2: describe what the HEVC decoder takes from the SPS. - patch 7: limit VP8 frames to 4080 pixels in width, as the frame size register holds 8-bit macroblock counts. - patch 3: pass the reference type instead of a bool (Nicolas), and keep the reference type of the first field when the second field of a pair is decoded into the same buffer (Sashiko). - patch 4: halve the macroblock aligned height for the boundary of a field, like the vendor library does (Nicolas). - patch 10: new. - patch 11: set the DRAM buffer sizes only once both buffers are allocated and clear them first, so that a failed allocation or the data of another codec can't leave stale sizes (Sashiko). - collected Reviewed-by tags. v1: https://lore.kernel.org/linux-sunxi/20261102170303.1973892-1-jernej.skrabec@gmail.com/ Please take a look. Best regards, Jernej Jernej Skrabec (11): staging: media: cedrus: free MV-col buffers in buf_cleanup staging: media: cedrus: reject too large H.264/HEVC SPS staging: media: cedrus: h264: mark long-term references in the frame info staging: media: cedrus: mpeg2: use the field height for field pictures staging: media: cedrus: mpeg2: derive the field order of field pictures staging: media: cedrus: mpeg2: fix the references of field pictures staging: media: cedrus: validate VP8 frame size staging: media: cedrus: vp8: use the vendor probability table size staging: media: cedrus: h616: use the 256-bit DDR mode staging: media: cedrus: h264: clear the DRAM buffer sizes on start staging: media: cedrus: vp8: support frames wider than 2048 pixels drivers/staging/media/sunxi/cedrus/cedrus.c | 40 +++++++++- drivers/staging/media/sunxi/cedrus/cedrus.h | 49 ++++++++++++ .../staging/media/sunxi/cedrus/cedrus_h264.c | 66 +++++++++++++---- .../staging/media/sunxi/cedrus/cedrus_h265.c | 32 +++++--- .../staging/media/sunxi/cedrus/cedrus_hw.c | 14 +++- .../staging/media/sunxi/cedrus/cedrus_mpeg2.c | 74 ++++++++++++++++--- .../staging/media/sunxi/cedrus/cedrus_regs.h | 8 ++ .../staging/media/sunxi/cedrus/cedrus_video.c | 15 ++-- .../staging/media/sunxi/cedrus/cedrus_video.h | 5 ++ .../staging/media/sunxi/cedrus/cedrus_vp8.c | 72 +++++++++++++++++- 10 files changed, 329 insertions(+), 46 deletions(-) base-commit: 27285b099fbc5cb2ae3aef20f3bbd7b3c88b3005 -- 2.43.0