From patchwork Thu Apr 29 10:58:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 429221 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp1461996jao; Thu, 29 Apr 2021 03:58:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwElQOwZxazEpCTUvx1v3XCsIHMkt1tt8JKvvXrv47207VcUyjy33/dUnzg2CqWUob9VlAl X-Received: by 2002:a17:906:c1c9:: with SMTP id bw9mr34600425ejb.239.1619693916356; Thu, 29 Apr 2021 03:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619693916; cv=none; d=google.com; s=arc-20160816; b=DNMmstQMmdlWU64Xe8PD/F6f1DSccgjs5EAlsrWfh1njrUGcZnJLjrmjvEX1hDUS0a nRuqQkFtHmKkBPwFqBL05LSPLOkj2mqtqZSNXr+jbIPeAjFka2pse3KaG+pDUS5SW3I0 9zCqxThEjGWPNGz7hCoPD/d8aKYhGjg+LjYtUwTA0+LIq7LYMWJTlAC6VAUYmqtIPDNE kqkk3bVv2Hv3o3GIBwjWD98TCU9/hglySqx9AHyO/iDCrnFwsaMaIUMelHaJBmUQKSyG b9lGCfonmcnD9q9lO22GJzYMI5+JT0JVavWkOEaqIQxiZsxORG3aYjxIMhbnTuPAq9BD vX+g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jYGJrgcD3VZ6SXpUQWlC7sPvB5W5iGe6cdJ7Wlftem4=; b=w62IYA3HSjQyGrMTxQhG3IHRzVuTu7bMprJoMWJSC689jOrKh9D7+bdSDs+KlSyS1T M0y0W+nJyRDIg4L/f01jD0Ln4MojFaTx2UAP43sWircSUqs/uycDzFTF1r7Hef9ix870 L4Z+HSiEmnP9Rw+m3uJsfmN1yLA+dV1RlAjiYsQ5YxiTM7aSFucpaBayA+cCsD+VvmrJ s2NjEjyn7G8Q+OQnmWw3I6AolRPZ28PAtl5lClWo5kdH0lR+Pb6KN22fmLqL+QYghd4f bcajlJmPxoToOf6rXTFrKMMAFVhp0Pnwrpny7+aZCZgQWbTxwoPyip2p0hCu1qoWt8q4 CsXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ADIoes40; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si2712416edv.186.2021.04.29.03.58.36; Thu, 29 Apr 2021 03:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-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=@linaro.org header.s=google header.b=ADIoes40; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240561AbhD2K7N (ORCPT + 17 others); Thu, 29 Apr 2021 06:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240469AbhD2K7L (ORCPT ); Thu, 29 Apr 2021 06:59:11 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AE18C061343 for ; Thu, 29 Apr 2021 03:58:23 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id k14so16497964wrv.5 for ; Thu, 29 Apr 2021 03:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jYGJrgcD3VZ6SXpUQWlC7sPvB5W5iGe6cdJ7Wlftem4=; b=ADIoes40mv9HPIIbqdGFoDHMemrLKFIIoekd16bjNbrdN0jTPOABBHL6aVDrZtbFQu 7yk3Ot02f5nje4Dfdavqy/n6jXkmJhVsKKM6ODhMiL4XHbz18aF6X0PQo9i6ImbgrUyD OjgKTI+8ledcS6TazyTztiodS79qw9g4xLDhe69oI54YQ33KjU2eGgHAXnqiXBDxJDja lTDSTikmPZZFnJLmwdgeHTAuOzpg6iUEsfE5yipAg1HwUKST/Iud/WqweIL2UAP4Ih7C P2s0cC/MdYNPRPMR19Z782MZ2QXyr0NLZjHVfHlld6ZW9Vn3zqkRax4EK4gJaM0rJfOX 4uNg== 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=jYGJrgcD3VZ6SXpUQWlC7sPvB5W5iGe6cdJ7Wlftem4=; b=iNQ2QIxD/xP1Wwegms5HoG3fviqJ1UFl3X7c9vNv5psudXN/dKL6yFIr1/xrS6rugq Sv0ANLZqyiu3K7x+vCe9pXs3uB5aYLvjX+m/OzEIIK5+65NH2uPvz8+hKbwaFdiMmsoB gevvu9dmag8Vbta/wsH+RH6/dEukpH+GbwbF61VSZ5dKlPtTTYNJk8T/RYpP4+hZyX2E IjBJHY/NbGcNe4u8sa5QBClbxmXBFpKAGmrmJwl2+4hTJqv39WvlqDtEOLhs32J16gZP ndwiSQ5Ao2pAzG5SXEOJNkgJ9koMYOLxmZ4Gc1nulwTaFEgrIV3358Wb42lSmqmf4H61 ywqA== X-Gm-Message-State: AOAM530EsPEeEwgXf2C8VneoaGjRsAadwOIpK4X2LvtobPlS/OZKyVtn RG1pj4eRlO5VKEp9KioC3Jn49w== X-Received: by 2002:a05:6000:2c6:: with SMTP id o6mr164098wry.203.1619693902137; Thu, 29 Apr 2021 03:58:22 -0700 (PDT) Received: from localhost.localdomain (hst-221-29.medicom.bg. [84.238.221.29]) by smtp.gmail.com with ESMTPSA id a9sm3372903wmj.1.2021.04.29.03.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 03:58:21 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-api@vger.kernel.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Stanimir Varbanov Subject: [PATCH 2/3] venus: Add a handling of QC8C compressed format Date: Thu, 29 Apr 2021 13:58:14 +0300 Message-Id: <20210429105815.2790770-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210429105815.2790770-1-stanimir.varbanov@linaro.org> References: <20210429105815.2790770-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This adds QC8C compressed pixel format in the Venus driver, and make it enumeratable from v4l2 clients. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 2 ++ drivers/media/platform/qcom/venus/vdec.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 9b8ff76e3c43..3a0b07d237a5 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -561,6 +561,8 @@ static u32 to_hfi_raw_fmt(u32 v4l2_fmt) return HFI_COLOR_FORMAT_NV12; case V4L2_PIX_FMT_NV21: return HFI_COLOR_FORMAT_NV21; + case V4L2_PIX_FMT_QC8C: + return HFI_COLOR_FORMAT_NV12_UBWC; default: break; } diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 5e5584fc21e9..d4cc51fc019c 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -31,6 +31,10 @@ */ static const struct venus_format vdec_formats[] = { { + .pixfmt = V4L2_PIX_FMT_QC8C, + .num_planes = 1, + .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, + }, { .pixfmt = V4L2_PIX_FMT_NV12, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, @@ -696,7 +700,13 @@ static int vdec_output_conf(struct venus_inst *inst) inst->output2_buf_size = venus_helper_get_framesz_raw(out2_fmt, width, height); - if (is_ubwc_fmt(out_fmt)) { + if (is_ubwc_fmt(out_fmt) && is_ubwc_fmt(out2_fmt)) { + inst->output2_buf_size = 0; + inst->opb_buftype = HFI_BUFFER_OUTPUT; + inst->opb_fmt = out_fmt; + inst->dpb_buftype = 0; + inst->dpb_fmt = 0; + } else if (is_ubwc_fmt(out_fmt)) { inst->opb_buftype = HFI_BUFFER_OUTPUT2; inst->opb_fmt = out2_fmt; inst->dpb_buftype = HFI_BUFFER_OUTPUT;