From patchwork Fri Feb 10 08:18:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 55312 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp828764wrn; Fri, 10 Feb 2023 00:29:51 -0800 (PST) X-Google-Smtp-Source: AK7set+LsBGqVjON7+HaQmkgRFIF4V6xM8T1LdulpKDaA/Bpt/w61o1YCzj+7Giez+g0daDtIUQb X-Received: by 2002:a05:6a20:e189:b0:bf:58d1:ce97 with SMTP id ks9-20020a056a20e18900b000bf58d1ce97mr4862128pzb.22.1676017790782; Fri, 10 Feb 2023 00:29:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676017790; cv=none; d=google.com; s=arc-20160816; b=WNwt4V58NUYXKarQZXJJYZTgYGGqv3Maiki4V6Yx9NW0HqrictYRPGuE9ye+JYajly rwc5cwo/k6tkoA2McMcv4IEZl3kXStTg2G3V8vx83wQPip0m5di84hM2V5+KSH6Yn2Dk 3Ko+wrVTJu4AsnS9vf2OYOxArCsK2rVTGmEl1ncW15KnSXXccmqowXflCSdoixta5wWe UgCKj9floQ/c9ke4qHSnDZq2Ngo6JA192KHFfGJrTxrxMvP+gLpWy3fO3a8oPVooanFT egBSX++x/DHjVqa3krcZeUDIgJDgViEAkJD7WT1lKXzRYWueH0U92ROnGoNCHsh6YCiC FGXw== 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=iVtYqaaQ7dSvGBX/UdCn76+kv/o4oHmMd0gDTcWP1xU=; b=QX4TJeP078bbYAcqlhuhIteC9Nk/qbbqU6PATAkl8etWCasS+d5cnyfE2Xq2LV9pPx AtvSMjjsHAKK1IQcXuPQ/ZxPXwyXpnuKG7KQPGsxcLK4al2H5yqaHadzVrd639q1X110 Q/lHF3TSQ2OYZMiDT8xMabK8Ak5Ch3vmbyVk0GxgHEy0OviCP44hve+pdju7Ukhgdobj 3CimbTx2sClSlVE5BcR8V0qYYWFkDoLnKTFLVLn8mTCHXGFlGZ3B7g9v3N6t4f3KGvz7 IMFnTHCnKi+a11l2Rn/08y3X5TwCDapOUvY1fOyeLp3cbRrSE50sjrCMBjq7Y8p2NOs3 bf3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XBPhjvGP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d29-20020a63735d000000b004f1c1b3dce3si4238961pgn.635.2023.02.10.00.29.37; Fri, 10 Feb 2023 00:29:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XBPhjvGP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231434AbjBJITd (ORCPT + 99 others); Fri, 10 Feb 2023 03:19:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230522AbjBJITb (ORCPT ); Fri, 10 Feb 2023 03:19:31 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FE6159E76 for ; Fri, 10 Feb 2023 00:18:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676017123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=iVtYqaaQ7dSvGBX/UdCn76+kv/o4oHmMd0gDTcWP1xU=; b=XBPhjvGPU062MqLRiT2rk64/V/rEkVY1o/LUi/67UQN9yHDkFWsfWPIui2h0z/31qLP3+0 bwyeQrne9iZS7BhvL+pnIQF3TBBYKTGb3Hu4T/cK1kmqmB1kr12mNHYB7JEBu6YjWWwmRm sUb2iQT198aPkBTQXopieBDQmDAMaK0= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-189-GnGMlrIIPQO1GDiPGvEhSw-1; Fri, 10 Feb 2023 03:18:42 -0500 X-MC-Unique: GnGMlrIIPQO1GDiPGvEhSw-1 Received: by mail-wm1-f69.google.com with SMTP id l31-20020a05600c1d1f00b003deab30bb8bso2274354wms.2 for ; Fri, 10 Feb 2023 00:18:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iVtYqaaQ7dSvGBX/UdCn76+kv/o4oHmMd0gDTcWP1xU=; b=HverhQO7NLaV+zYArIkU+N9VzJbHQzZibu/1n3SXTXLF8mxsJ4oBysBtbxzIFsg3cl qOrtj4oa1InYw0MZzWDFGlnRok8WlaZbDWLRs7v+PfnHzrByV4HXje4Z60kFwYSaVFE5 Ov9P6Jxov9oiK6OqR34zmTy8a9QS+HP/j3aPuOjOcZzSJaLWl5cwB6fms4kbXSOwVFjb bkdqMpxcMicnz2cqhurde5VEFf8NP299XzienvXbGNA2nY9UhJO7b1mUQ2M31/f8g1SX mYouQ7sYoWsyT4iMyzyuvOzk+WrrDt994DdoqXiSirOIYzVF0EFYBn+cVCR3PG2pINqh JAQA== X-Gm-Message-State: AO0yUKWbJfqlWh+QPjN0qveZzlw1SKhHTplp/8m9pIQv9FVLS3ulMsMD 3uNte3PeNuyJgK1a9m8AFXhwQMQ8/ZbuEIMF85FRC09M6BeJjGXx3OBACzqCx8ZoVqhe/Y2ju2F 3SSd9fB5+Lg6K5+b4A5RZP8m+dnSh5ZSGR7rbUfd/7Q3HzUtTXwjzJo1GSdtk23NF7D9IzgjC6W AIhmfA X-Received: by 2002:a05:600c:2e95:b0:3dc:57e8:1d2f with SMTP id p21-20020a05600c2e9500b003dc57e81d2fmr12059806wmn.9.1676017120987; Fri, 10 Feb 2023 00:18:40 -0800 (PST) X-Received: by 2002:a05:600c:2e95:b0:3dc:57e8:1d2f with SMTP id p21-20020a05600c2e9500b003dc57e81d2fmr12059788wmn.9.1676017120804; Fri, 10 Feb 2023 00:18:40 -0800 (PST) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id t8-20020a05600c2f8800b003ddf2865aeasm7624944wmn.41.2023.02.10.00.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 00:18:40 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Albert Esteve , Stanimir Varbanov , Sergio Lopez , Enric Balletbo i Serra , Javier Martinez Canillas , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mauro Carvalho Chehab , Stanimir Varbanov , Vikash Garodia , linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH] media: venus: dec: Fix capture formats enumeration order Date: Fri, 10 Feb 2023 09:18:35 +0100 Message-Id: <20230210081835.2054482-1-javierm@redhat.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757432030844829692?= X-GMAIL-MSGID: =?utf-8?q?1757432030844829692?= Commit 9593126dae3e ("media: venus: Add a handling of QC08C compressed format") and commit cef92b14e653 ("media: venus: Add a handling of QC10C compressed format") added support for the QC08C and QC10C compressed formats respectively. But these also caused a regression, because the new formats where added at the beginning of the vdec_formats[] array and the vdec_inst_init() function sets the default format output and capture using fixed indexes of that array: static void vdec_inst_init(struct venus_inst *inst) { ... inst->fmt_out = &vdec_formats[8]; inst->fmt_cap = &vdec_formats[0]; ... } Since now V4L2_PIX_FMT_NV12 is not the first entry in the array anymore, the default capture format is not set to that as it was done before. Both commits changed the first index to keep inst->fmt_out default format set to V4L2_PIX_FMT_H264, but did not update the latter to keep .fmt_out default format set to V4L2_PIX_FMT_NV12. Rather than updating the index to the current V4L2_PIX_FMT_NV12 position, let's reorder the entries so that this format is the first entry again. This would also make VIDIOC_ENUM_FMT report the V4L2_PIX_FMT_NV12 format with an index 0 as it did before the QC08C and QC10C formats were added. Fixes: 9593126dae3e ("media: venus: Add a handling of QC08C compressed format") Fixes: cef92b14e653 ("media: venus: Add a handling of QC10C compressed format") Signed-off-by: Javier Martinez Canillas Tested-by: Jordan Crouse Tested-by: Enric Balletbo i Serra --- drivers/media/platform/qcom/venus/vdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 4ceaba37e2e5..bb14bea9fe09 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -31,15 +31,15 @@ */ static const struct venus_format vdec_formats[] = { { - .pixfmt = V4L2_PIX_FMT_QC08C, + .pixfmt = V4L2_PIX_FMT_NV12, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, }, { - .pixfmt = V4L2_PIX_FMT_QC10C, + .pixfmt = V4L2_PIX_FMT_QC08C, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, - },{ - .pixfmt = V4L2_PIX_FMT_NV12, + }, { + .pixfmt = V4L2_PIX_FMT_QC10C, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, }, {