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: 586430 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: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: 586429 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: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: 586428 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; }