Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2791218lqp; Mon, 25 Mar 2024 09:17:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjBtpXLW4ImsHZiHeLLs5DSNWcEm3Yf/ryoC2URd0+L4GzZRWzuX84zScUOeHQRFypDXDALKuWl/YLkXUTb7h/WOqpf1pXnxTqPJa5lA== X-Google-Smtp-Source: AGHT+IEBa9QsfzGSByVdVKT79dzxGTqV0ahqT9FhbEi+8cmUQSJOGXEbsa62Aj1Db+bBC9NDqtpS X-Received: by 2002:a17:902:6507:b0:1e0:e14:b19d with SMTP id b7-20020a170902650700b001e00e14b19dmr7464776plk.18.1711383423347; Mon, 25 Mar 2024 09:17:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711383423; cv=pass; d=google.com; s=arc-20160816; b=oJNFJVZ+Z6BPRWuDEl6w94oaZyWQpds9pCojKQUIa37WpAuK4mWtBTCdslSknvZmPQ nsMHr77H+41I4WT9qKxnPK213IVW8mqeGhBnUCpFCEPQb7de3P7i8uHoir5JAOfJTbm4 4FnTblZfN3k4acDJxGvialjO8U2648U+BMGXFMvXhFCpycAXnpDJjc9X1kG3mRc3of+g me2UxvqXmgcy2mAi6TJU0pxyAeS4/7VXbenpOApyEoYsbn7IjvsHh+/4ge0bVmpAGMrw cOehB//hgpFXlVB7sImSftNS5C5tcfoZbWKB7jjej/mT+nRyQkO5jjnatu85EC5tmecc K/eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=N6AIAxCJz2R5rlggcf2OWr2A/Jt7N68nXNuioW63cJo=; fh=i9sNPhX/uYAfKa2SSBbPdCCHWJxDQsMVog9x4K3Ko04=; b=Jpv/0XrY7T0piSrZnZL9mQUg9zN3hSnEYFEKjaO/lkGYR+Zw0zz7HznRAiBEAOtlrU IU5lVtLO5Qht2+9eab1rQyuVs2SiQiSAFIWj6+WSVH/PH6gXifC2N5buSOmbPILY6kWR j2zDDhFkYholCA8JfOM0T6TaFexCiNBfjqdnddG8uuw+aCpaKBrSIV+u8LWwXwuYQHhN f+j0++Dxi4YTpu12aLnjUnNhQ4A2IeDQNozCl/5/WFhOLW/jMbKg/4HZ1jSnbjfxT0if DMUmV02z3JsM/0iEmAM+TMqR9UAt8STXnh8swfzZpw7LwJTnf5kT/ZZGxITncmlFBCtx RvIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WF9d5NSk; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-116593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116593-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u7-20020a170902e5c700b001dd8b3a397esi5586088plf.55.2024.03.25.09.17.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 09:17:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WF9d5NSk; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-116593-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116593-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 996D2B37FD8 for ; Mon, 25 Mar 2024 12:19:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3631614B096; Mon, 25 Mar 2024 08:53:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WF9d5NSk" Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F16F815F323; Mon, 25 Mar 2024 06:41:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711348885; cv=none; b=SsVsHyidBs4cDJQE14nLrZ0V49f7NYLctlKcocYx0xLYUIvLOg/kUuaOWB50G/W+QaC6E5dAcaQE22gg5ce0CbKZDQLmvf2YD8G9tQlSKU8VXLLXBLhmKLSq9vMOFmgpZdbIVAbrGxL7vCEW1PBzPH5tQVjHjZsHtg1B8RRuKkc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711348885; c=relaxed/simple; bh=qkH1n2ZJ4QVAdDXQQaJsqr3HhVev4kuqL3wJZVBjiJQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L29Gt2IAL3JBUY/mO6FMGqliLLnqlxmnkf0bVeiOp+AMzeExUi1xi/9CdH4JfNJoHdOqsf5198OsjceEM6/l+zmfv1V87WAv1cNhxG0sZNBYuwaUQStDvAeOJ10Z1OUvtCrIe15c5B6Nz/ZK0kikX94aqqYY//XRFNilR4drqSI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WF9d5NSk; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-513e89d0816so4973664e87.0; Sun, 24 Mar 2024 23:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711348881; x=1711953681; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N6AIAxCJz2R5rlggcf2OWr2A/Jt7N68nXNuioW63cJo=; b=WF9d5NSkpwOliSkjpgPn9m1twpCzhCbNdEVW/hSqiIKoFK+wPG41KaIDTsethpj1ob K/ZQC13trZ1P5CG+wlGnmMkpYcE/L20C3EkmKnxpfix/es30T4c4AEdZbfdj7GygZf6T PCWadpoN/S1KxbLGjT7H5WFQKOP6dULObdj6NjrW7bTiMXg9/lgb/ldB1j3dKUVNWqOs Xpm5etOji5SapWcOGUwwBcyiNhKW2XIhdVFCovEcoVZVD72z4+H9QX0+6hDBsJOR+dqT O87cdYBes8e8vLlnjph8HzK/R2MJtEvSKLD3TfYBra/b9+SLK2FFufbbgQVPA+dIO4Hm U1Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711348881; x=1711953681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N6AIAxCJz2R5rlggcf2OWr2A/Jt7N68nXNuioW63cJo=; b=RyqXZZXXcM3CrD4JICAl7K/+qwSH9p1xZoNEYz+q8N3f5NAxE68hhSHL39QkIKjGXz 78stMNnwaoLU3H/kavmuT2LpyqShxlXk6bEcprc4by0qa2500ZMCMzhtvZS3bVW/dePN rMOv3+xjBG35Lu5dw+8k+/yhfseQbxB0ivV0nSXhJ2Lv8w1fJb3YDPH0FFMGGNl+lxfK Y3Kj9YbaWho0J4QB9Dw3U5msMYck+zDybpYc2M9jLB08sF0f6AzrNhkuyv+wYAkRKB9g TPYc2Px6sgfNqsm1hnHMneUcP0+GqHbYx53Oaj3XOMKcbFblS7nGWEhCFONN1lhVtf+5 yohQ== X-Forwarded-Encrypted: i=1; AJvYcCVTuTCiJpJTp3gxISf/b2hxtWF+zfRtCJeqw1w+sC/Zc4aCMNMCmFGKYZwpNGwVpooH9OZ4nduZR/VzVj9oF8rDrIdJx+ecIkAhH/XAf1QiH8LJ9bhU5VBZA2RSZoY5YoDPy4gxMBrXwqs= X-Gm-Message-State: AOJu0YxSFZathlCYP8qBf8k8WkvN4N1WyMf3F6wPmepDQyS57By5OzVo q3i70z72mHugUCBICyTAsKFoO6vZl+8nTu54+IzhrVTElINf4476HmM1S09td5U= X-Received: by 2002:a05:6512:3b12:b0:515:a670:3a6c with SMTP id f18-20020a0565123b1200b00515a6703a6cmr3648059lfv.23.1711348879078; Sun, 24 Mar 2024 23:41:19 -0700 (PDT) Received: from localhost.localdomain ([178.70.43.28]) by smtp.gmail.com with ESMTPSA id h12-20020a0565123c8c00b00515a411fd20sm828229lfv.105.2024.03.24.23.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 23:41:18 -0700 (PDT) From: Ivan Bornyakov To: Nas Chung , Jackson Lee , Mauro Carvalho Chehab , Philipp Zabel Cc: Ivan Bornyakov , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] media: chips-media: wave5: support decoding HEVC Main10 profile Date: Mon, 25 Mar 2024 09:40:56 +0300 Message-ID: <20240325064102.9278-2-brnkv.i1@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240325064102.9278-1-brnkv.i1@gmail.com> References: <20240325064102.9278-1-brnkv.i1@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add support for decoding HEVC Main10 profile by scaling FBC buffer stride and size by the factor of (bitdepth / 8). Signed-off-by: Ivan Bornyakov --- .../chips-media/wave5/wave5-vpu-dec.c | 30 +++++++++++-------- .../platform/chips-media/wave5/wave5-vpuapi.h | 1 + 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c index ef227af72348..5a71a711f2e8 100644 --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c @@ -1055,6 +1055,22 @@ static int wave5_prepare_fb(struct vpu_instance *inst) int ret, i; struct v4l2_m2m_buffer *buf, *n; struct v4l2_m2m_ctx *m2m_ctx = inst->v4l2_fh.m2m_ctx; + u32 bitdepth = inst->codec_info->dec_info.initial_info.luma_bitdepth; + + switch (bitdepth) { + case 8: + break; + case 10: + if (inst->std == W_HEVC_DEC && + inst->dev->attr.support_hevc10bit_dec) + break; + + fallthrough; + default: + dev_err(inst->dev->dev, "no support for %d bit depth\n", bitdepth); + + return -EINVAL; + } linear_num = v4l2_m2m_num_dst_bufs_ready(m2m_ctx); non_linear_num = inst->fbc_buf_count; @@ -1063,7 +1079,7 @@ static int wave5_prepare_fb(struct vpu_instance *inst) struct frame_buffer *frame = &inst->frame_buf[i]; struct vpu_buf *vframe = &inst->frame_vbuf[i]; - fb_stride = inst->dst_fmt.width; + fb_stride = ALIGN(inst->dst_fmt.width * bitdepth / 8, 32); fb_height = ALIGN(inst->dst_fmt.height, 32); luma_size = fb_stride * fb_height; @@ -1408,22 +1424,10 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int count if (ret) goto free_bitstream_vbuf; } else if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { - struct dec_initial_info *initial_info = - &inst->codec_info->dec_info.initial_info; - if (inst->state == VPU_INST_STATE_STOP) ret = switch_state(inst, VPU_INST_STATE_INIT_SEQ); if (ret) goto return_buffers; - - if (inst->state == VPU_INST_STATE_INIT_SEQ) { - if (initial_info->luma_bitdepth != 8) { - dev_info(inst->dev->dev, "%s: no support for %d bit depth", - __func__, initial_info->luma_bitdepth); - ret = -EINVAL; - goto return_buffers; - } - } } return ret; diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h index 352f6e904e50..465ff9dfe8b1 100644 --- a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h +++ b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h @@ -327,6 +327,7 @@ struct vpu_attr { u32 support_backbone: 1; u32 support_avc10bit_enc: 1; u32 support_hevc10bit_enc: 1; + u32 support_hevc10bit_dec: 1; u32 support_vcore_backbone: 1; u32 support_vcpu_backbone: 1; }; -- 2.44.0