From patchwork Fri Jul 1 10:52:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 12903154 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24804C43334 for ; Fri, 1 Jul 2022 10:53:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235809AbiGAKxL (ORCPT ); Fri, 1 Jul 2022 06:53:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234628AbiGAKxJ (ORCPT ); Fri, 1 Jul 2022 06:53:09 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC396CFA for ; Fri, 1 Jul 2022 03:53:07 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id c4so2024939plc.8 for ; Fri, 01 Jul 2022 03:53:07 -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=zRI9Gh7/YtjgP8mVgApQyA3GHi/707s2OxZOLEZ9+C4=; b=Hs8XspyQYDCsbTiyxekYNXorFxxz/uNUUV1G6tU7K0S9W/6puaw0ZMpKUGGZs4Tatk hA/iAbm6BPVSQRsQDD02OXTxKoQdFyHteMx9SVYTsFeBrHECss4HdVqLNMsSVkVIWyqy pEuFr4+J80MSXT0OqwAO8+fXVkbGwYjx4fhP0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zRI9Gh7/YtjgP8mVgApQyA3GHi/707s2OxZOLEZ9+C4=; b=fBZ9xRSIgAD/p0iuWuKdn849f2uIQdvpkQV6nR35aRbAA+xOELtWP3jAjokMQ3JBF3 0p1Puqkpal7S7YrN4y1wB6ElhuFImbJS+aarI2cdQX8YJP/8Nv4QPFtfiNxSNvTyfT4d IjmS7dKSdRuKhKaQ/YwJoiGRjzhyq5kahoYLuv0ccSVFv2uZ9lFyQ8iMozSvA6cCg+kU L3hboraE3MYVUojRD5ErOhpuVrUAZy3MLYBDbROpJdQtr3T4+2XrLqLbTkJpA0Mt6Ocg JlCDv9HfI03uQjFhHXoQO3/CZ3a3BSexLGqgvQM13RRqJaWBCaG8SPmnBZbMW99hVv3n bOtQ== X-Gm-Message-State: AJIora9xiiH4Cn3gFxnb/xxksdneOU24B2Uu+gATsgh5Wg9nNktFLjdX xisS4uI2t2MlcCH6u6tCin6Vd8MHKS4hqQ== X-Google-Smtp-Source: AGRyM1thrJAL4fMosshrrxIa9gN4QIMY/Q1Zq8NQRWgztOQpLfQiSsViCjvDYvLI4NRK+Rca0AtsbA== X-Received: by 2002:a17:90a:bc84:b0:1ec:81f4:f86f with SMTP id x4-20020a17090abc8400b001ec81f4f86fmr17714158pjr.29.1656672787210; Fri, 01 Jul 2022 03:53:07 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:59bf:8b47:50a0:b04f]) by smtp.gmail.com with ESMTPSA id j2-20020a170902758200b0016a058b7547sm14906670pll.294.2022.07.01.03.53.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 03:53:06 -0700 (PDT) From: Chen-Yu Tsai To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Hans Verkuil Cc: AngeloGioacchino Del Regno , Nicolas Dufresne , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger Subject: [PATCH 1/6] media: mediatek: vcodec: Revert driver name change in decoder capabilities Date: Fri, 1 Jul 2022 18:52:32 +0800 Message-Id: <20220701105237.932332-2-wenst@chromium.org> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog In-Reply-To: <20220701105237.932332-1-wenst@chromium.org> References: <20220701105237.932332-1-wenst@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This partially reverts commit a8a7a278c56ad3b4ddd4db9a960e0537d032b0b3. This recent change caused ChromeOS's decoder to no longer function. This is due to ChromeOS using the driver name field to match the video device with its accompanying media device. After the change, they no longer matched. The driver name field should contain the actual driver name, not some otherwise unused string macro from the driver. To make this clear, copy the name from the driver's name field. Fixes: a8a7a278c56a ("media: mediatek: vcodec: Change decoder v4l2 capability value") Signed-off-by: Chen-Yu Tsai --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c index 5d6fdf18c3a6..e7ea632a3f94 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c @@ -243,9 +243,11 @@ static int mtk_vcodec_dec_get_chip_name(void *priv) static int vidioc_vdec_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { + struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv); + struct device *dev = &ctx->dev->plat_dev->dev; int platform_name = mtk_vcodec_dec_get_chip_name(priv); - strscpy(cap->driver, MTK_VCODEC_DRV_NAME, sizeof(cap->driver)); + strscpy(cap->driver, dev->driver->name, sizeof(cap->driver)); strscpy(cap->card, MTK_VCODEC_DEC_NAME, sizeof(cap->card)); snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-dec", platform_name); From patchwork Fri Jul 1 10:52:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 12903155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAA9FC43334 for ; Fri, 1 Jul 2022 10:53:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235131AbiGAKxN (ORCPT ); Fri, 1 Jul 2022 06:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235693AbiGAKxL (ORCPT ); Fri, 1 Jul 2022 06:53:11 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B36013EAE for ; Fri, 1 Jul 2022 03:53:10 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id g16-20020a17090a7d1000b001ea9f820449so6022490pjl.5 for ; Fri, 01 Jul 2022 03:53:10 -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=I4MDjjO8BzInQr5TM6t/zvnDVVooHxE4yuX82IM60po=; b=F3QxikYl5N3X8/xOvdJRq17w3/NvwpiHC3GsLbFy1xYBZcDslcuAXxxjAOmbRx+2Da JYZdAUyxWrab4Pt6Qpwnf19kDkkaaul5CO8fcfr5Lszh9rOuNFTCFUMOJl6sDAjDDbeT FnCw6/fhwibl1Y2uUb0unP3OSQTZgVklKjUgA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I4MDjjO8BzInQr5TM6t/zvnDVVooHxE4yuX82IM60po=; b=EqMgxEBk/Q7gTXERZDiaVBPIWWlwkTnU+eBKoEBHg1h3gC9tiduNt/HfdiuJkdTbTB LhLmtCKrg4Zzsy/7fB3qskkxVO2yhIfdagowCwAYDxl/eXtWMUrHbCmeztzYmk03M50U 9iSrp4F8tSChEPTkuh3VwXXdMThl7s5tEddJk7BQ31vD1dw2XoHVzm8C71aHCcrtbHvS Cg3noYvDtaBu2bwna7lAgu+UaGCLORENDqlKeRVniHOycfmgoIY7xvSKrk1H5L+Qp0Uy iqboLu2ZUhjZD7kJKBGd9ASjZXuw/erObEE7bDacyHRrRncM+YgoXH/0qWa7IRPZ3VZE Tklg== X-Gm-Message-State: AJIora9TNTI9xX1/Qz+2Koy/5xJPGHHsDl8F6sopOijFkXHBwmRK675D 9SNPc2O/I9V9P/2hMvSvR6UNyNONI3FyYQ== X-Google-Smtp-Source: AGRyM1vbOP8ZG1cPe69kNtF3atkiQXQM1DFxbicYf1wohz+ZtbE2UYVdKl/eREdjtV/98YWDo3SckQ== X-Received: by 2002:a17:90b:2245:b0:1ed:fef:5656 with SMTP id hk5-20020a17090b224500b001ed0fef5656mr15588223pjb.100.1656672789632; Fri, 01 Jul 2022 03:53:09 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:59bf:8b47:50a0:b04f]) by smtp.gmail.com with ESMTPSA id j2-20020a170902758200b0016a058b7547sm14906670pll.294.2022.07.01.03.53.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 03:53:09 -0700 (PDT) From: Chen-Yu Tsai To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Hans Verkuil Cc: AngeloGioacchino Del Regno , Nicolas Dufresne , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger Subject: [PATCH 2/6] media: mediatek: vcodec: Use meaningful decoder card name including chip name Date: Fri, 1 Jul 2022 18:52:33 +0800 Message-Id: <20220701105237.932332-3-wenst@chromium.org> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog In-Reply-To: <20220701105237.932332-1-wenst@chromium.org> References: <20220701105237.932332-1-wenst@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The card name for the video decoder previously held a static platform name, that was fixed to match MT8173. This obviously doesn't make sense for newer chips. Since commit a8a7a278c56a ("media: mediatek: vcodec: Change decoder v4l2 capability value"), this field was changed to hold the driver's name, or "mtk-vcodec-dec". This doesn't make much sense either, since this still doesn't reflect what chip this is. Instead, fill in the card name with "MTxxxx video decoder" with the proper chip number. Fixes: a8a7a278c56a ("media: mediatek: vcodec: Change decoder v4l2 capability value") Signed-off-by: Chen-Yu Tsai --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c index e7ea632a3f94..7f03dab518a4 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c @@ -248,7 +248,7 @@ static int vidioc_vdec_querycap(struct file *file, void *priv, int platform_name = mtk_vcodec_dec_get_chip_name(priv); strscpy(cap->driver, dev->driver->name, sizeof(cap->driver)); - strscpy(cap->card, MTK_VCODEC_DEC_NAME, sizeof(cap->card)); + snprintf(cap->card, sizeof(cap->card), "MT%d video decoder", platform_name); snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-dec", platform_name); return 0; From patchwork Fri Jul 1 10:52:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 12903156 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBD9AC3F2D4 for ; Fri, 1 Jul 2022 10:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236740AbiGAKxT (ORCPT ); Fri, 1 Jul 2022 06:53:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235958AbiGAKxO (ORCPT ); Fri, 1 Jul 2022 06:53:14 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3060813EAE for ; Fri, 1 Jul 2022 03:53:12 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id g16-20020a17090a7d1000b001ea9f820449so6022616pjl.5 for ; Fri, 01 Jul 2022 03:53:12 -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=tNyMQ++pzshlrdbVzN0h4wlM/fIXVOempzIZ1eG6MMs=; b=R0aOMwa3NeqUy4oQXlLgM0ZB88OAVKA6dYgXtMw93bB6/rs23mPNXNFWvpU0GH4/yc Sb43dmVFsJsUaxYZMZDX+10lSYlhoOSouqkueKVSNJBpG6t7qXpuQD+ZkXbvjk+mCCu5 7pJH8faeJl/CLhn1M3PPjQYQYZkmZZeoZC/cM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tNyMQ++pzshlrdbVzN0h4wlM/fIXVOempzIZ1eG6MMs=; b=IQ1H0MmXCrwpVvc+8Rxbe8R8YG3FQko1uY4ROJKpgtGAgDaRpskXhstgPSRZv2mEIh zkwUnAceRne7kS239MZazbOr8eviYtl5+TYI3AEbrJqtn4qKUMza2co7Gawlg0xv+gE3 NTjL0VKAigZ2qc3/ZfJmpD0tgYH5tO40g7vZAUMEeWK9Ut4gGhN+4Y/kK9KK/NdOUHSB LWiPbV9QtGmNRZ7Ow1DlTRrDFzwmkw1bzEe4EFrhZlUFQN8wNIU3FqUbbQCyfJS+HF/5 AdKqPGlR9KCkJY8YUBJPmDbsGFEHR4Ww3zriG0eFNGjDOVdLi467P1jpaP/j7GbqXGFI mJ3w== X-Gm-Message-State: AJIora8c7LO2vp5ys9WF3vKnbMBYFpKvDfELzxtvY04ZyqtHapsu/JWg IKLzsHbSp3du1oEprEJFiJQzpg== X-Google-Smtp-Source: AGRyM1uQQ52QyYlrWwh7GikfxSqOxRmuspOTO1vfzF1wU6i5Pt26r3/Hv3209Cj778VfSQ4D3XqAYw== X-Received: by 2002:a17:902:db11:b0:16b:9057:8007 with SMTP id m17-20020a170902db1100b0016b90578007mr18154361plx.49.1656672791912; Fri, 01 Jul 2022 03:53:11 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:59bf:8b47:50a0:b04f]) by smtp.gmail.com with ESMTPSA id j2-20020a170902758200b0016a058b7547sm14906670pll.294.2022.07.01.03.53.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 03:53:11 -0700 (PDT) From: Chen-Yu Tsai To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Hans Verkuil Cc: AngeloGioacchino Del Regno , Nicolas Dufresne , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger Subject: [PATCH 3/6] media: mediatek: vcodec: Use default bus_info for decoder capability Date: Fri, 1 Jul 2022 18:52:34 +0800 Message-Id: <20220701105237.932332-4-wenst@chromium.org> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog In-Reply-To: <20220701105237.932332-1-wenst@chromium.org> References: <20220701105237.932332-1-wenst@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Since commit f2d8b6917f3b ("media: v4l: ioctl: Set bus_info in v4l_querycap()"), the V4L2 core provides a default value for the bus_info field for platform and PCI devices. This value will match the default value for media devices added by commit cef699749f37 ("media: mc: Set bus_info in media_device_init()"). These defaults are stable and device-specific. Drop the custom capability bus_info from the mtk-vcodec decoder driver, and use the defaults. This also fixes the long standing issue where the media device used for the stateless decoder didn't have its bus_info set, and would never match its accompanying video device. Signed-off-by: Chen-Yu Tsai --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c index 7f03dab518a4..209de1ec02e4 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c @@ -249,7 +249,6 @@ static int vidioc_vdec_querycap(struct file *file, void *priv, strscpy(cap->driver, dev->driver->name, sizeof(cap->driver)); snprintf(cap->card, sizeof(cap->card), "MT%d video decoder", platform_name); - snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-dec", platform_name); return 0; } From patchwork Fri Jul 1 10:52:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 12903157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED17EC433EF for ; Fri, 1 Jul 2022 10:53:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235792AbiGAKxV (ORCPT ); Fri, 1 Jul 2022 06:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236384AbiGAKxQ (ORCPT ); Fri, 1 Jul 2022 06:53:16 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 921031FCE4 for ; Fri, 1 Jul 2022 03:53:14 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d5so2008123plo.12 for ; Fri, 01 Jul 2022 03:53:14 -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=ljX4VHxLEnJH6CxFcKPCMc5PmhMdDAHdoJtj9hiur4A=; b=ZJnV0EvEevnHaF+V45Jfd/vZCRzSzdRu+irbWKzuk44igljTEEObfiqNT4/id84ew8 7LivaevSw+4G+bwl8ZyCUeOaZp07/xdf0+jrkbHA5CHHEgH33hoqd8rMrihn5oMudQuY aBsMIJICDEJxnECnNaZF0mmMNd3PMDVHVtKOs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ljX4VHxLEnJH6CxFcKPCMc5PmhMdDAHdoJtj9hiur4A=; b=s8zD6V5m8srwiUJme1ghI2+6YCv9VhZ1s9Gevzh95fV37xGDFzaMkbXTQohN3DOZKZ v/+7mrBLajIMcSH3dsh7ejgeNraNCeLBINpXEVyFrZSCHmSu3XqOqg+vEbghETELQYC7 G0ZJrbBrHXOnyAEz7vpgVOejGLxNj4x3k1g8RCsnALD6MoDsL6rine5OGaXRQSEEO+bR 07EgZ00f7HTAR4i1mk0N5Sbb0C8ERvjpMi/qezFi2KP0fg1oXWu67kQS1iY37ftcCiH5 FLkcCjDf2CdsdF7ljqIKX57WhGHLrKn41AoqMPEjQqH1vT1uG44ufpW9Z2gptWL/93zp kqHA== X-Gm-Message-State: AJIora+57G09rTSGRixaD0vvWP/bb/a8ESJ4weEreVSmmg5BJ2gehICp A6PhOFxA9ji7OLqUwcDdhIr4sw== X-Google-Smtp-Source: AGRyM1tgfY+HHtcbLfi96MHFfZj/RaDV0HbBWEhSC7TBeizj9KXzshRAWOyabhIS2FBHMwG4J9iaYg== X-Received: by 2002:a17:902:bb8f:b0:16a:80e7:e5d9 with SMTP id m15-20020a170902bb8f00b0016a80e7e5d9mr20663846pls.25.1656672794162; Fri, 01 Jul 2022 03:53:14 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:59bf:8b47:50a0:b04f]) by smtp.gmail.com with ESMTPSA id j2-20020a170902758200b0016a058b7547sm14906670pll.294.2022.07.01.03.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 03:53:13 -0700 (PDT) From: Chen-Yu Tsai To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Hans Verkuil Cc: AngeloGioacchino Del Regno , Nicolas Dufresne , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger Subject: [PATCH 4/6] media: mediatek: vcodec: Revert driver name change in encoder capabilities Date: Fri, 1 Jul 2022 18:52:35 +0800 Message-Id: <20220701105237.932332-5-wenst@chromium.org> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog In-Reply-To: <20220701105237.932332-1-wenst@chromium.org> References: <20220701105237.932332-1-wenst@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This partially reverts commit fd9f8050e355d7fd1e126cd207b06c96cde7f783. The driver name field should contain the actual driver name, not some otherwise unused string macro from the driver. To make this clear, copy the name from the driver's name field. Fixes: fd9f8050e355 ("media: mediatek: vcodec: Change encoder v4l2 capability value") Signed-off-by: Chen-Yu Tsai --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h | 1 + drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h index 4140b4dd85bf..dc6aada882d9 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h @@ -22,6 +22,7 @@ #define MTK_VCODEC_DRV_NAME "mtk_vcodec_drv" #define MTK_VCODEC_DEC_NAME "mtk-vcodec-dec" #define MTK_VCODEC_ENC_NAME "mtk-vcodec-enc" +#define MTK_PLATFORM_STR "platform:mt8173" #define MTK_VCODEC_MAX_PLANES 3 #define MTK_V4L2_BENCHMARK 0 diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c index ccc753074816..30aac54d97fa 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c @@ -232,11 +232,13 @@ static int mtk_vcodec_enc_get_chip_name(void *priv) static int vidioc_venc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { + struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv); + struct device *dev = &ctx->dev->plat_dev->dev; int platform_name = mtk_vcodec_enc_get_chip_name(priv); - strscpy(cap->driver, MTK_VCODEC_DRV_NAME, sizeof(cap->driver)); - strscpy(cap->card, MTK_VCODEC_ENC_NAME, sizeof(cap->card)); + strscpy(cap->driver, dev->driver->name, sizeof(cap->driver)); snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-enc", platform_name); + strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card)); return 0; } From patchwork Fri Jul 1 10:52:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 12903158 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A5DBC433EF for ; Fri, 1 Jul 2022 10:53:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236825AbiGAKxX (ORCPT ); Fri, 1 Jul 2022 06:53:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236615AbiGAKxS (ORCPT ); Fri, 1 Jul 2022 06:53:18 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C034621827 for ; Fri, 1 Jul 2022 03:53:16 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id g16-20020a17090a7d1000b001ea9f820449so6022800pjl.5 for ; Fri, 01 Jul 2022 03:53:16 -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=NOBWwqnNtZ38dDVIIzLfaocfRAGUVvDLs14+wanTT94=; b=dz2Le1USQnBFFoW4ejZ1CuEd017eDMuliW3CFPa3lyAyzu0tUApEEcCNgYik7mPZ83 WGRUIz00iiW2jbnOEIdxoTZy7nqyK3vTpCsj5KGuCZ39yIdmfqMQ+HB3xw2UNMldOBef vKItRQ0qyTzxsLBAQjWSCRidIpo/X+sh85qfA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NOBWwqnNtZ38dDVIIzLfaocfRAGUVvDLs14+wanTT94=; b=RjyhSmDOcLQQkbMl0bmn0Dq45dgf28lCCapGmA7qTTe18ifEAB3GeEdew8JnDB2Xj1 OHYDZsKoZLnJTzwC6zZkoTIePPy7RxeuecRB5RoLECjqKaKwqF12uvtMXe5oolnS0cE4 sqYhmLIYeIbzv5cM3E77KUUC/mICmVqQFcU6MJU6D0t3ps/+Qvh3VfMGkNAHF+20wbL1 ehAZrY5zrqbZgokJ/8/xJ/HPlNHENG52Bkr44KeC3mTI9VEnYSN9V4E40JHdfCo/+N03 h5kXjBpTaYora0vmt9MS6t2C4YZ6581+FbgISp/cI8nxd+jGwAI1jnjqenLedpdMFN+T K3HQ== X-Gm-Message-State: AJIora9lyrl7hRyQCsQoiC0CPLckWJmDuduNDAmBISNLEZvNpihwcfOi VudzzSJuSS6bD7GJz4b/x0mU2g== X-Google-Smtp-Source: AGRyM1uljxxSPIi8WxVPeVlccyqJ5E8bRD7D8dokyrQyOuYTXJYQrh07tl8mekQZDh2EtQzXh3M3vQ== X-Received: by 2002:a17:90b:4ac9:b0:1ec:9bd1:92ff with SMTP id mh9-20020a17090b4ac900b001ec9bd192ffmr15545625pjb.178.1656672796441; Fri, 01 Jul 2022 03:53:16 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:59bf:8b47:50a0:b04f]) by smtp.gmail.com with ESMTPSA id j2-20020a170902758200b0016a058b7547sm14906670pll.294.2022.07.01.03.53.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 03:53:16 -0700 (PDT) From: Chen-Yu Tsai To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Hans Verkuil Cc: AngeloGioacchino Del Regno , Nicolas Dufresne , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger Subject: [PATCH 5/6] media: mediatek: vcodec: Use meaningful encoder card name including chip name Date: Fri, 1 Jul 2022 18:52:36 +0800 Message-Id: <20220701105237.932332-6-wenst@chromium.org> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog In-Reply-To: <20220701105237.932332-1-wenst@chromium.org> References: <20220701105237.932332-1-wenst@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The card name for the video encoder previously held a static platform name that was fixed to match MT8173. This obviously doesn't make sense for newer chips. Since commit fd9f8050e355 ("media: mediatek: vcodec: Change encoder v4l2 capability value"), this field was changed to hold the driver's name, or "mtk-vcodec-dec". This doesn't make much sense either, since this still doesn't reflect what chip this is. Instead, fill in the card name with "MTxxxx video encoder" with the proper chip number. Fixes: fd9f8050e355 ("media: mediatek: vcodec: Change encoder v4l2 capability value") Signed-off-by: Chen-Yu Tsai --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c index 30aac54d97fa..cc286e59021e 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c @@ -238,7 +238,7 @@ static int vidioc_venc_querycap(struct file *file, void *priv, strscpy(cap->driver, dev->driver->name, sizeof(cap->driver)); snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-enc", platform_name); - strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card)); + snprintf(cap->card, sizeof(cap->card), "MT%d video encoder", platform_name); return 0; } From patchwork Fri Jul 1 10:52:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 12903159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DB29CCA479 for ; Fri, 1 Jul 2022 10:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236869AbiGAKx1 (ORCPT ); Fri, 1 Jul 2022 06:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236570AbiGAKxU (ORCPT ); Fri, 1 Jul 2022 06:53:20 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 278F9237E0 for ; Fri, 1 Jul 2022 03:53:19 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id dw10-20020a17090b094a00b001ed00a16eb4so2326300pjb.2 for ; Fri, 01 Jul 2022 03:53:19 -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=LAb8BhaEnoy6g4TUthkAckgbU5LqWiMd2MpRJwBJ244=; b=iKv4thd0wDQP8anbuEyzEQ+Zqxa2RoLpovoXs077tea1xpsXOBelzTXGmK4y7MqftT 5BJnXPH8YNdKWTHrIlCKk2Y5qhZu1/pNfrnZsu0+Mx5vhh0AMDhG/LEBw6Yr2orVpLpS c9Rif9I0bUJFib7BjpoRdmrjmJJMel7dBcIgE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LAb8BhaEnoy6g4TUthkAckgbU5LqWiMd2MpRJwBJ244=; b=rTun0qcfFvTeXdzAVoDCALa8ExufjOtJj4lRI/iFqrKLMj8NsgMmMeL2N8Ub/BzBup fjdH9Oh02OWI2R388R8slPYWSNXbb9QPVF7+ZRTN1BTbhrEjHJd+7CR62nKP+SauqpZr CkcP56+XqJJ+Mm4x/3aLVWFJUyoYOl2KF2/MhXBLOTtMxAjVDWhUxhzc1QmOzv0/RSfF 1cjAMiOlvsivMdTUM6DQxKbbLDf1Tp08E2JFfAQt0jrqREgbW7E5acyO8sugXItHOtXn bIwVW6x5rViM5o4m6yHkO5ozeAocnGvMgRMe9UkhlBLEoeuhnXiW1W9wzwX0cAnbFkJs MNnw== X-Gm-Message-State: AJIora/Vz0iW1JDpWwt83kf9fIQrBhgVvrW1ZJf3NXYf2YHXxwMq+yzc qIAvPH5HJ7JAcp2Ld/RCpZqEkA== X-Google-Smtp-Source: AGRyM1v7WmL7Uss1HNkKbQMy8M5hpzoThkEh0hNwmVYgcfIBghgHA/BIAT8PEL/BvGq+Wt4ZftbeQQ== X-Received: by 2002:a17:902:9f87:b0:16a:1efc:42fe with SMTP id g7-20020a1709029f8700b0016a1efc42femr20863524plq.124.1656672798693; Fri, 01 Jul 2022 03:53:18 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:59bf:8b47:50a0:b04f]) by smtp.gmail.com with ESMTPSA id j2-20020a170902758200b0016a058b7547sm14906670pll.294.2022.07.01.03.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 03:53:18 -0700 (PDT) From: Chen-Yu Tsai To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Hans Verkuil Cc: AngeloGioacchino Del Regno , Nicolas Dufresne , Chen-Yu Tsai , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger Subject: [PATCH 6/6] media: mediatek: vcodec: Use default bus_info for encoder capability Date: Fri, 1 Jul 2022 18:52:37 +0800 Message-Id: <20220701105237.932332-7-wenst@chromium.org> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog In-Reply-To: <20220701105237.932332-1-wenst@chromium.org> References: <20220701105237.932332-1-wenst@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Since commit f2d8b6917f3b ("media: v4l: ioctl: Set bus_info in v4l_querycap()"), the V4L2 core provides a default value for the bus_info field for platform and PCI devices. This value will match the default value for media devices added by commit cef699749f37 ("media: mc: Set bus_info in media_device_init()"). These defaults are stable and device-specific. Drop the custom capability bus_info from the mtk-vcodec encoder driver, and use the defaults. Signed-off-by: Chen-Yu Tsai --- drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c index cc286e59021e..25e816863597 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c @@ -237,7 +237,6 @@ static int vidioc_venc_querycap(struct file *file, void *priv, int platform_name = mtk_vcodec_enc_get_chip_name(priv); strscpy(cap->driver, dev->driver->name, sizeof(cap->driver)); - snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-enc", platform_name); snprintf(cap->card, sizeof(cap->card), "MT%d video encoder", platform_name); return 0;