Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp745036ybh; Sun, 12 Jul 2020 23:10:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0Pr90W4ZUHk57xJxYwQcWKlTO1Hf/ZwC1MYMbKHt2GOBZPwhDMBwnbbTONm7RwJjbScY/ X-Received: by 2002:a17:906:c1c3:: with SMTP id bw3mr73343057ejb.8.1594620634385; Sun, 12 Jul 2020 23:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594620634; cv=none; d=google.com; s=arc-20160816; b=SJ5WW9sv2ZTHpeGlwxAPjCy9QT9/BvlKu1M+wf2CtNdQICl1sorZPESOfr0UfZyuLN afpYCsP1ciQjPUQIKrtfT4jTBlb47nQtZWrTmTOzAyb+n88xLvYWv5f3LFOhbvdxSMfK kRUrCq/kqRR3/YBR2dvhFwU4UDE1EHu7IVFqArO6Sd6IfMuPgYSfFxu7IvSSCJHccjCq KlyAokYMY9E17Ffgf+cXwpNnBPZB1i/jolCczucixUbW+CRIXyqLh5yO6Xdja8kRe+4Q XpxqvaTVFgHDsqAvMq8rPhXQBlVIloLC0wBWvJO2EfxJuDQEIyANZM3vfE71kWt5T1nV DrLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=emr/NGqj2O214H2RbodqJQHnJMZ9UzU1pc+xV9IRc4I=; b=JIfuQ2drLt3pfEmzJU9XPkWXF2Gy8u7wpP4kH7U8Mi4Rn71erH/HxpFlBjZHP/DotD l4nv7qXBqR9NtpmtHrDoj/bztiWCwQGXXb1CseArI1FZjMzVXCoWxzXnrBZYB6wFZ8jJ seH5NYB7P5oqGQOMZAwr4/nz7W8WNXev8bxCIz+KpgMlE4br3aWH7Y+9mvzDJFEQFN4V jhUjr6dTywVBNEXy6uBgGeT5arlI26meJRNklwDsEN4/9ZS3SckvhEnRdAn37E1TvtVC WMHzv5WwoxMh1Ivy4FDG9QtDuzj7SSeIhn4UiOFkv9OPpWhGNbD+HLvWkevyM3QvJD+E /cWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MJI0XNhB; 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 v28si9521075edi.456.2020.07.12.23.10.11; Sun, 12 Jul 2020 23:10:34 -0700 (PDT) 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=MJI0XNhB; 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 S1729013AbgGMGJl (ORCPT + 99 others); Mon, 13 Jul 2020 02:09:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729269AbgGMGJi (ORCPT ); Mon, 13 Jul 2020 02:09:38 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0BA6C061794 for ; Sun, 12 Jul 2020 23:09:38 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id gc15so6134108pjb.0 for ; Sun, 12 Jul 2020 23:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=emr/NGqj2O214H2RbodqJQHnJMZ9UzU1pc+xV9IRc4I=; b=MJI0XNhBy7D66xtLNgM0JoF5yJyBliChbZhl+Ewb7Rxb0zXallIaPeV0iHxOcHqBMM foYz0ZreIMkRc8Pto9PpxS3ZTignfJ5HuqD+fs1zRlIBgymv2Xph23P9lNGblMZGfR8U EdINi2IIzILZ9kdLXxkMo1GtL0K/6kbFSHy7w= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=emr/NGqj2O214H2RbodqJQHnJMZ9UzU1pc+xV9IRc4I=; b=nNaYcdEvW4pNXYXJRG9SE+PU3FYTEiHgeT0Jr72grj07s9X0sVdMZZuJr33XEFCAS4 F4ED4zZBWCRnJegjQ7okklsqT+Imov2KF+cOSMoJVqmxcZEcwkOYvk9H5A2FhQqrGFiK NxOJCfOXgNlXSTKcGVnLHkmMm1VWk0HQJ0fSK1JA/NCkqvR4Iyf2bGEZhDrM9I61r95t 5OQafmVSX+iIX6lr9a6YIKOgFXWmrE2RfT+dAwHF1541pUHBunDYY0ztWV7jfQV1o0I/ KySAGbnc0iQwG8cAfGHmP4OJuha4tU9IV9fhKJg5yF+0QnVKcXndc5hwl9RmLTBWQH8C VnQg== X-Gm-Message-State: AOAM532ZlcY/0uGneddjF5bfpDk14JzMYCKu2IA+gHWqEx1jMIPfzkbQ RwJpy+A/EIsPN8NajqDw7GUk4Q== X-Received: by 2002:a17:90b:2348:: with SMTP id ms8mr17509414pjb.5.1594620578321; Sun, 12 Jul 2020 23:09:38 -0700 (PDT) Received: from acourbot.tok.corp.google.com ([2401:fa00:8f:203:eeb1:d7ff:fe57:b7e5]) by smtp.gmail.com with ESMTPSA id c134sm13134934pfc.115.2020.07.12.23.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2020 23:09:37 -0700 (PDT) From: Alexandre Courbot To: Tiffany Lin , Andrew-CT Chen , Hans Verkuil , Yunfei Dong , Maoguang Meng Cc: linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [PATCH v3 09/16] media: mtk-vcodec: add support for MT8183 encoder Date: Mon, 13 Jul 2020 15:08:35 +0900 Message-Id: <20200713060842.471356-10-acourbot@chromium.org> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog In-Reply-To: <20200713060842.471356-1-acourbot@chromium.org> References: <20200713060842.471356-1-acourbot@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunfei Dong Now that all the supporting blocks are present, enable encoder for MT8183. Signed-off-by: Yunfei Dong [acourbot: refactor, cleanup and split] Co-developed-by: Alexandre Courbot Signed-off-by: Alexandre Courbot Acked-by: Tiffany Lin --- .../platform/mtk-vcodec/mtk_vcodec_drv.h | 1 + .../platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index 59b4b750666b..a271611750ad 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -302,6 +302,7 @@ struct mtk_vcodec_ctx { enum mtk_chip { MTK_MT8173, + MTK_MT8183, }; /** diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c index c8a4b85a81c4..b8fe408dd6c7 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c @@ -62,6 +62,14 @@ static const struct mtk_video_fmt mtk_video_formats_capture_mt8173[] = { }, }; +static const struct mtk_video_fmt mtk_video_formats_capture_mt8183[] = { + { + .fourcc = V4L2_PIX_FMT_H264, + .type = MTK_FMT_ENC, + .num_planes = 1, + }, +}; + /* Wake up context wait_queue */ static void wake_up_ctx(struct mtk_vcodec_ctx *ctx, unsigned int reason) { @@ -424,8 +432,22 @@ static const struct mtk_vcodec_enc_pdata mt8173_pdata = { .max_bitrate = 4000000, }; +static const struct mtk_vcodec_enc_pdata mt8183_pdata = { + .chip = MTK_MT8183, + .has_lt_irq = false, + .uses_ext = true, + .capture_formats = mtk_video_formats_capture_mt8183, + .num_capture_formats = ARRAY_SIZE(mtk_video_formats_capture_mt8183), + /* MT8183 supports the same output formats as MT8173 */ + .output_formats = mtk_video_formats_output_mt8173, + .num_output_formats = ARRAY_SIZE(mtk_video_formats_output_mt8173), + .min_bitrate = 64, + .max_bitrate = 40000000, +}; + static const struct of_device_id mtk_vcodec_enc_match[] = { {.compatible = "mediatek,mt8173-vcodec-enc", .data = &mt8173_pdata}, + {.compatible = "mediatek,mt8183-vcodec-enc", .data = &mt8183_pdata}, {}, }; MODULE_DEVICE_TABLE(of, mtk_vcodec_enc_match); -- 2.27.0.383.g050319c2ae-goog