Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4633320pxv; Tue, 6 Jul 2021 05:48:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM3cF/DYRVz99L7T0i5yVvNPYvDyZ8gRbtMcGmVAk/VDdg2uM2pBAViBjx/zVlM3LSNetL X-Received: by 2002:a17:906:6acd:: with SMTP id q13mr12260339ejs.377.1625575701312; Tue, 06 Jul 2021 05:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625575701; cv=none; d=google.com; s=arc-20160816; b=bQszF2ZlcUCVc4VmHBTFU6f6xM3lGgWlAktca1USDpJX5UaUovYV0Q4UwD3/F4Phcj 4Qp19gOElknKHGNw/MM0zVRnkKHRoCX+eeedbeHhQGqq4iIDkxUnPb/upnRLYQpf1jHI cvG9pV9h/I7H5fuItbZkpztxWbH0tnQhfqigUue58T/Tkp44ySQzQxUT48pK0tQ/CrCa Flp+IR8KfrE0cK4B68TBcnGVlf7jDM1onXsQ12tiTarDZuGhzd11aEn5SMT2kBJLHooP 35lmff9b2qn7mB+gacf/+PdTizEGse+bUs4nyaFvgwy5mIbjHKQfBwkRyHg+PvNARaKq wpDQ== 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=ecjW3cRWAEIfndFoVo8BkYktDhdK0gMxQVqk7QqJZj0=; b=Gi7P1bc8ICIZvaSLjJbpaZg5lx+s8M5UbmpotZ2RqGy70f+UiEOJVB4q4/muK9S2cU P/MFO3zBc67YJL4HbdR3sRarwABt6szYQlbGar+F86KMCDa9ugyz9CUNx95SerXkhOzO uXxIvJ6kpBHttGrg6EWHiPLvTgradGr1RfgUOklcp03QAbZgS1KgwYP6ifSguqDw/YsZ tHpCAcSmyk7YP7BK5Zaok8xjFoiM7SOsPm8dd9o8Vtx2FhxmadsjNiPLzCzTMG38gT41 I4aW1LWJhAQzJho3thZ8Khh6XqeWaYQ9vUWmNa1qtLvVyFn6vps6Mb80mBK3YjrE6327 edvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SM3N6mKr; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x4si14255072edd.296.2021.07.06.05.47.57; Tue, 06 Jul 2021 05:48:21 -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=@linaro.org header.s=google header.b=SM3N6mKr; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240814AbhGFMs4 (ORCPT + 99 others); Tue, 6 Jul 2021 08:48:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240813AbhGFMsl (ORCPT ); Tue, 6 Jul 2021 08:48:41 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD56C08E88F for ; Tue, 6 Jul 2021 05:41:10 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id d2so2279684wrn.0 for ; Tue, 06 Jul 2021 05:41:10 -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=ecjW3cRWAEIfndFoVo8BkYktDhdK0gMxQVqk7QqJZj0=; b=SM3N6mKrFJk7cd4eql+zVJ3BOe/UnA9Das8uViuXyhODKR80MNDJFZJanZStMVvJpk r8RRG9bUGR1fFTOmLpQbRBoumGQC63LBe2A1RnHZoQnxbQhymxtxikH2NVZsoY4MaoA9 sqyoZI627kQEc0sc/LrSo29XoLeoUrg028GTSrOlw9tfX7gjq6hAKf3isu4cP5toBchM 5AN5ISa/BOazTUMWYHirDsLIC7eNeorzOt/SWbILOMMlg7hnhp5+81/P/0pSPtK5SKxq ODvrrGe6PEMpclgZrIonMs0i5Y39dLbCAkx9ztnrSgXORgpVNrOtjp/Rt2BphRhv1/C8 pPlQ== 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=ecjW3cRWAEIfndFoVo8BkYktDhdK0gMxQVqk7QqJZj0=; b=dTb4je6wRSJ3mYIReyVXxxe5lT3k8px43sjtoCmDITbc8xcl9XYJcKusHbBqGliKw9 TUe+ljpQvhYmbPt5Tv9I3oz6G1xbdybrOw70aRXNZunkMzSAwXpAbuMhQ9R027VDZOu6 oD5JiDOC21jYtufUv006xAmpWSZ7/113Ud1sJfnVWvo3utWYZuKrMU38NwrnuYTa6oNK +GQ7OTIi3KffXslHFm/Q5UfoakcWnl7gCLIFwMFAHBXWjYYHETfMWPhuF6d4jSj0iEop wo+OyBAxjaQTkpQnMaak9KgmLOnKOv2DvyvsDKmjz/L+Ax+43ne7Oa60FNWfl7MNo1Zw tA2Q== X-Gm-Message-State: AOAM530huVu94A+cKZfEaHj8IM6aSPOhIGuqcXruBMON2WxVmsceA13w wyeHi/VSjL24CZ7V+PKsfp9uCA== X-Received: by 2002:a5d:530f:: with SMTP id e15mr21151955wrv.217.1625575268875; Tue, 06 Jul 2021 05:41:08 -0700 (PDT) Received: from localhost.localdomain (hst-221-27.medicom.bg. [84.238.221.27]) by smtp.gmail.com with ESMTPSA id n18sm2585979wms.3.2021.07.06.05.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 05:41:08 -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 , Stanimir Varbanov Subject: [PATCH v2 3/5] venus: Add a handling of QC08C compressed format Date: Tue, 6 Jul 2021 15:40:32 +0300 Message-Id: <20210706124034.773503-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210706124034.773503-1-stanimir.varbanov@linaro.org> References: <20210706124034.773503-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds QC08C compressed pixel format in the Venus driver, and make it possible to discover from v4l2 clients. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 2 ++ drivers/media/platform/qcom/venus/vdec.c | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 48da88d21ccd..49d720fd9a9d 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_QC08C: + 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 198e47eb63f4..989a75dc5bf0 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_QC08C, + .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, @@ -106,6 +110,10 @@ find_format(struct venus_inst *inst, u32 pixfmt, u32 type) !venus_helper_check_codec(inst, fmt[i].pixfmt)) return NULL; + if (V4L2_TYPE_IS_CAPTURE(type) && + !venus_helper_check_format(inst, fmt[i].pixfmt)) + return NULL; + return &fmt[i]; } @@ -124,8 +132,12 @@ find_format_by_index(struct venus_inst *inst, unsigned int index, u32 type) if (fmt[i].type != type) continue; - valid = type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE || - venus_helper_check_codec(inst, fmt[i].pixfmt); + + if (V4L2_TYPE_IS_OUTPUT(type)) + valid = venus_helper_check_codec(inst, fmt[i].pixfmt); + else if (V4L2_TYPE_IS_CAPTURE(type)) + valid = venus_helper_check_format(inst, fmt[i].pixfmt); + if (k == index && valid) break; if (valid) @@ -1484,7 +1496,7 @@ static const struct hfi_inst_ops vdec_hfi_ops = { static void vdec_inst_init(struct venus_inst *inst) { inst->hfi_codec = HFI_VIDEO_CODEC_H264; - inst->fmt_out = &vdec_formats[6]; + inst->fmt_out = &vdec_formats[7]; inst->fmt_cap = &vdec_formats[0]; inst->width = frame_width_min(inst); inst->height = ALIGN(frame_height_min(inst), 32); -- 2.25.1