Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1086690pxb; Fri, 26 Feb 2021 02:05:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYCTDrfPGbnb1d0wbn9aMTsJBanvSuMhE+JuBmRFgd6OEnYArNnbMM2Ao98KWkzN8DsnGG X-Received: by 2002:a17:906:4c8b:: with SMTP id q11mr2459990eju.270.1614333948997; Fri, 26 Feb 2021 02:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614333948; cv=none; d=google.com; s=arc-20160816; b=L5oBfksWPiWXElMTTCaVd7rsUoHtkcSyrBvMJ9DGaEBdhioDl8z4rhEhzERyua2cZp laFnOOpAmDT/71DowQrtY5Als9RIReiKw8mmJZRW/JjF4rcrLz19Tgcp1Ht8suxwcC1R RVfHWzNZrweus7azuWcrV8bcvk8I0twkzXQFyIKTgHf+LwPHVhoxqu1sTIoK13gMpruS YGxtzCfyeg5vjYD6Xoad0qO78Xqk3uq8bYRwMBwvS2zYmaZl9b+NQU4ooF5iTG/mbYCj haypP446e3z4I3RQr4wpwC96ZiTo8EF1b3fQR1QnGBpUxy8F1i3zMsUPq3GmRvnzOwaZ bkmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rdHQrIoRBZis59jo/BlYAHJNjsS+NHQ7VVed8ginGb0=; b=XQByhvHagNYXHu5nbZWml0AP9KqRqQ03hCYuLXZdJA/+KOVb+amdu7m/yZSa4bvvC1 8UdowRb92314w4wTMDuzZU+thmv21x2Wzz9YMjkNBMbYTvB36KIn3nnuKD6eHqKlhQBD fLgdo8CzYosIf+wmu4z6ExvB1kZSNYOCYuUfrDklfdw2mBDIT0Jr8MG6dQeqlYioFeTI SrXlNgAgxD3UYSWJQ2MysA1aNy2Ucuc742YsTY8q/fF4t5lqKYJGhT3feApZTbp9imi4 x8Dd7xNUyZGUD57s7Y/Jkhit0fykfYSVd2rcD2CXiOQ89RgjllNtax/yYdL0JnnbA7ZA j/vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="MsQ/EITi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j19si5454623edw.355.2021.02.26.02.05.26; Fri, 26 Feb 2021 02:05:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="MsQ/EITi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbhBZKCq (ORCPT + 99 others); Fri, 26 Feb 2021 05:02:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbhBZKCk (ORCPT ); Fri, 26 Feb 2021 05:02:40 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A06C06174A for ; Fri, 26 Feb 2021 02:02:00 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id e9so3031277pjs.2 for ; Fri, 26 Feb 2021 02:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rdHQrIoRBZis59jo/BlYAHJNjsS+NHQ7VVed8ginGb0=; b=MsQ/EITikSwmceNc01UidROuZO8i86fefQVWuDj88ZnuaRnex8jZbEqMBSj7xJf3vk 4MS4W+RN09mFDHeWU1V+lzeZfBb3IKOUdtA19n09rxA3lFEfiL0bWn0xbd9GXQ0NHTJH rCmhueTb2eC3VliCroGN3UeXgb2iCmHbps2jw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rdHQrIoRBZis59jo/BlYAHJNjsS+NHQ7VVed8ginGb0=; b=uS2/D2N4zMTbtu4nw7LwMyfeEjs89ITMihihA+HvAtp9LWDK//31rRKRDF4A4UY7Dz jFVgPlPV3HjavDxr7+4h8Q65gjukS1KohOk8GHvv9ZsSdhKQAc5gNjCq0g/+JZkmxG8W j4ap/RCRrd4fh7S+auJtg1YVUyIGGmZfbOhSiiLJVbQQmAAxXPDMlFUP9MeDY9ET1nfB 8G4opzvhJENxx1lQPYgIC4VladKAD3x8KqpvMhlN537lILZtURzFgGPLDM8Lclm0wcql VHkqwII4EqxZcdY2jFA5wP/qgyOzj7Ijcxh7TMGXgBwkszPSAImS+y1D7pvZhEvYcEP2 BJAw== X-Gm-Message-State: AOAM530Ck/HJUGZ/kLE5cOOK/CFP9LmJ52+OhmPjx9iaOGJUpE5z4RN6 i1ULj+ddqcPwQKeiQygagzaM3w== X-Received: by 2002:a17:90a:ce88:: with SMTP id g8mr2635720pju.107.1614333719701; Fri, 26 Feb 2021 02:01:59 -0800 (PST) Received: from acourbot.tok.corp.google.com ([2401:fa00:8f:203:5c91:233c:dd5b:b1b0]) by smtp.gmail.com with ESMTPSA id o23sm9201565pfp.89.2021.02.26.02.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 02:01:59 -0800 (PST) From: Alexandre Courbot To: Tiffany Lin , Andrew-CT Chen , Rob Herring , Yunfei Dong Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Alexandre Courbot Subject: [PATCH v3 00/15] media: mtk-vcodec: support for MT8183 decoder Date: Fri, 26 Feb 2021 19:01:33 +0900 Message-Id: <20210226100148.1663389-1-acourbot@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please ignore the v2 of this series since I neglected a final check on it and realized later it did not compile. >_< This series adds support for the stateless API into mtk-vcodec, by first separating the stateful ops into their own source file, and introducing a new set of ops suitable for stateless decoding. As such, support for stateful decoders should remain completely unaffected. This series has been tested with both MT8183 and MT8173. Decoding was working for both chips, and in the case of MT8173 no regression has been spotted. Patches 1-9 add MT8183 support to the decoder using the stateless API. MT8183 only support H.264 acceleration. Patches 10-15 are follow-ups that further improve compliance for the decoder and encoder, by fixing support for commands on both. Patch 11 also makes sure that supported H.264 profiles are exported on MT8173. Changes since v2: * Actually compiles (duh), * Add follow-up patches fixing support for START/STOP commands for the encoder, and stateful decoder. Alexandre Courbot (8): media: mtk-vcodec: vdec: handle firmware version field media: mtk-vcodec: support version 2 of decoder firmware ABI media: add Mediatek's MM21 format dt-bindings: media: document mediatek,mt8183-vcodec-dec media: mtk-vcodec: vdec: use helpers in VIDIOC_(TRY_)DECODER_CMD media: mtk-vcodec: vdec: clamp OUTPUT resolution to hardware limits media: mtk-vcodec: make flush buffer reusable by encoder media: mtk-vcodec: venc: support START and STOP commands Hirokazu Honda (1): media: mtk-vcodec: vdec: Support H264 profile control Hsin-Yi Wang (1): media: mtk-vcodec: venc: make sure buffer exists in list before removing Yunfei Dong (5): media: mtk-vcodec: vdec: move stateful ops into their own file media: mtk-vcodec: vdec: support stateless API media: mtk-vcodec: vdec: support stateless H.264 decoding media: mtk-vcodec: vdec: add media device if using stateless api media: mtk-vcodec: enable MT8183 decoder .../bindings/media/mediatek-vcodec.txt | 1 + .../media/v4l/pixfmt-reserved.rst | 7 + drivers/media/platform/Kconfig | 2 + drivers/media/platform/mtk-vcodec/Makefile | 3 + .../platform/mtk-vcodec/mtk_vcodec_dec.c | 800 +++-------------- .../platform/mtk-vcodec/mtk_vcodec_dec.h | 30 +- .../platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 66 +- .../mtk-vcodec/mtk_vcodec_dec_stateful.c | 647 ++++++++++++++ .../mtk-vcodec/mtk_vcodec_dec_stateless.c | 427 +++++++++ .../platform/mtk-vcodec/mtk_vcodec_drv.h | 58 +- .../platform/mtk-vcodec/mtk_vcodec_enc.c | 135 ++- .../platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 4 + .../mtk-vcodec/vdec/vdec_h264_req_if.c | 807 ++++++++++++++++++ .../media/platform/mtk-vcodec/vdec_drv_if.c | 3 + .../media/platform/mtk-vcodec/vdec_drv_if.h | 1 + .../media/platform/mtk-vcodec/vdec_ipi_msg.h | 23 +- .../media/platform/mtk-vcodec/vdec_vpu_if.c | 43 +- .../media/platform/mtk-vcodec/vdec_vpu_if.h | 5 + drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 20 files changed, 2360 insertions(+), 704 deletions(-) create mode 100644 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateful.c create mode 100644 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateless.c create mode 100644 drivers/media/platform/mtk-vcodec/vdec/vdec_h264_req_if.c -- 2.30.1.766.gb4fecdf3b7-goog