From nobody Sun May 24 21:38:47 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 D8C79366541 for ; Thu, 21 May 2026 09:25:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355504; cv=none; b=HfMurJkrylO6/vc2neefSNBfWNauriPNcMMEZPcPLDxaim/zbMxpHMIlRqM8UYwqqxeFRD9dNVXZv7Ae7j+WcZaM7WTsp64/ScDB6yRpSM8liVmEGPAAjBxh9Iu7vHtNK3Zsr/O4x76OVY0S4QYrFbSywRsLoBXvep65MKY2/ZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355504; c=relaxed/simple; bh=ZCk+J4g24plDJu1Jqy1cbqmqbJkUp4JW+dFod0WTtNw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CGB0//TowGzP06295Oa/xL2PkTn9o49j7fG+sX4Xfy2nfpLruZiuOK9Z6ZfkC+Mf0b61sl7rw4ehfcvAjhiuOur0BU52qNNgAHih2+ckPekklzwO0Urlmt2yb6N/08eb3rP2YX5WFyKtI54428IIA7uai2yFfi4wMAv5AvXwgTI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Jq7osm9F; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Jq7osm9F" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4891e86fabeso77493995e9.1 for ; Thu, 21 May 2026 02:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779355501; x=1779960301; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2NlukUVuN+EDZ32q8KcVk1YwnxmllTh0MP2KcXJ/bnM=; b=Jq7osm9Fu//Yb6OkPHMtml4Jk2uBR15W7CBWVdFwn/0MIuiBiU9HCNoMXhAQ07V/ob gUjPvJtZ6sIQYkNu3YhQwP0V+vwGKC8WgzihmoxVmqtaPoRj3ntX7PUSyThiIvxAqylR 5FJjWl3BwWG1UUsP5Pnx2y8HPIpzzbx9QCdtRHszuswZeOvE1Lv3KRRPXhY63pZH0yOs 8PRpcXLPz486+Qgt6cutXo+MfxKT7u2TcHS7MNZKJnK6uirSyS8FkgEgCY1US7heBpss +cHcMfuvfPNYMGTdqoNkEEBg4gLMHC9iW3TKaLp5EfSWoV+5jOQKYJYDIUZFTiln1B7g wE0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779355501; x=1779960301; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2NlukUVuN+EDZ32q8KcVk1YwnxmllTh0MP2KcXJ/bnM=; b=lh1VOzJ/GDVHHq1nEyrWzlI574016er2zemLnj4JyyvJpBCsDfavmvP4+EOrwTFTDn KSydp0yURRvCgzBuPRxelBr9hTGB2y5Voy93+1qZBdViwJEorhvb6kBuKPo4nNO17u04 boP9rO0M+5OYa2PBgNC8yj9IDSokYzONDr7nz1LGRLVPfSN6hMfSuL/5aysgONgq8e8W z5cUOX9akZot938JZf6pV05tbO9MfgFYvqRYACCBYgJWo6vwrNSlF+Uh+wmU7ZQxaK6q 9HhfDT1TdVig+ZWbDtMvz29wwg1OHopY9gO8Wgq/uwZOux3Y1+rBdgQanqf780TIeYtX zWWA== X-Forwarded-Encrypted: i=1; AFNElJ8a9/E7WSI+wl8cnkeOCyZ1m2lVr3kWOjZaXV+wo9yvWm2pPQRoboJ435957GqczwBuAv1NgzDF6/FdPuU=@vger.kernel.org X-Gm-Message-State: AOJu0Yzpn4JuVNHGVWHBqoICduJWtUlONwSVuOB0Y//ph3gpkk4EZbhA fK3pmmTDIA/CIJrpVWtKWSwLnEIE55smeNrHuGlRsQCpQq/ZPvozQPPCjkuXgQRRXoc= X-Gm-Gg: Acq92OEfMTLf9of5ndKqaoE9KbQm0CkZMN2RDJ8FZbIHZwxKUeqWX0/GZZK8OdtGPUE 2GdeezA9nJeWjdmTP5+OdwlL7VP4K8RiPZbelJd8oOYTBs2MgdLiP4WB51Z4+ab6ipXrmIcLUuq SgFX4R39Bay/CMGwILiYbHdj0UJnlgZuFG1DHRYBtBQQPOCxyfFIBfUAK6oqPOUWcVezDsxQjS+ OdYuBM7ZaFhoySGFv27mXEQDmv8ZVXkbiE/T9FzKub9+2u487ioAleCvmXMQQ3wADhN+cqoDCtb Wdo6mIi0ls+XZx7YZIT8+LvNyZKlI3NWykGwpnNyC4BEIdDb9rRvM/Cnsi2jKfP100PiZ410H75 /7W1hTDm1usHQbeLhyGtStHM7XKtRN1io6zJjv0Qsc8hoYCaIh67mw6ZEAlWA7JSzSxIBalNnEZ nudX1zk4o36zSYzUcOyQ9iv2DaNJZLqqPovJkXP4Mf0iSk X-Received: by 2002:a05:600c:4649:b0:488:78f2:6b0 with SMTP id 5b1f17b1804b1-490360e68f6mr15793835e9.29.1779355501368; Thu, 21 May 2026 02:25:01 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49033d8e25bsm54945595e9.11.2026.05.21.02.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 02:25:00 -0700 (PDT) From: Neil Armstrong Date: Thu, 21 May 2026 11:24:54 +0200 Subject: [PATCH v4 1/6] media: qcom: iris: add helpers for 8bit and 10bit formats Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-topic-sm8x50-iris-10bit-decoding-v4-1-8ff8fce3f904@linaro.org> References: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> In-Reply-To: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Dmitry Baryshkov X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2010; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=ZCk+J4g24plDJu1Jqy1cbqmqbJkUp4JW+dFod0WTtNw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqDs9o8TkCfX8EOqYXTwQuNcVLtrplIQcQK2jzTu9a 8L8beL2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCag7PaAAKCRB33NvayMhJ0XFoEA C7GHWYqKzeRD6C7Ti5fLWXu1iypOByttwNm9eVAit6A/mWD8NcTpmsbs1SardNJ52v3bRn9PHyUOKg WjfLjEdCv9XmhrQPTLVAhBMlidpT/RgO6vw6qPkxSKXXMKcfQxe495Bailq7G93+W4GPrXflOCJHXa 3FHAimJttx1AqGjHwYdBJqVw1pXRQ74sKS29WrEe+pswZDvRcFx42UDa947GKl7ZAW+v1aidizf8m6 omLkWDd4hbT70TAiMgub0YjypkZXaNhSqv0IjCTct0QtLHe5zeA/GYZaK8dDNlBiCuZ/q/ofCCL8K9 0OQut8JfX92v5BF+MCtu66MqhoaiuybHovrh4DqhAhmQTsaaPhEaaBodYvOUu1EVv3wGdph3UMwOD0 XpriBlVpdm3X/vUQFo2eZy+/4V6uIFc+P2wq2OwefXEsoSVkM19I7q0GbhSKVyVHWSvNp53fJnYVn0 Pw4W8qDFm3UpsWC3ewnHG3cIFlUEzu2UKiYhYO/cP1fJMutCxsngW/DdedGZyzCj9+jNGKIj1Lp4jX AR+RFnqRGomcCkRoZut7gNY+dUAvWKtaLJrGpZxsvg6COdxVmGaXePL8sGAt4iqaNWothMdKKDpxvD 01s6ZuzJDeueUDcHzyY3VaZ9u6o9dHdwmViE8Rud5kNnuqG1NSinMNGy9EcQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE To simplify code checking for pixel formats, add helpers to check for 8bit and 10bit formats. Reviewed-by: Dikshita Agarwal Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_utils.c | 12 ++++++++++++ drivers/media/platform/qcom/iris/iris_utils.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_utils.c b/drivers/media/= platform/qcom/iris/iris_utils.c index 29b07d88507e..085665cd74ff 100644 --- a/drivers/media/platform/qcom/iris/iris_utils.c +++ b/drivers/media/platform/qcom/iris/iris_utils.c @@ -38,6 +38,18 @@ bool iris_split_mode_enabled(struct iris_inst *inst) inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_QC08C; } =20 +bool iris_fmt_is_8bit(u32 pixelformat) +{ + return pixelformat =3D=3D V4L2_PIX_FMT_NV12 || + pixelformat =3D=3D V4L2_PIX_FMT_QC08C; +} + +bool iris_fmt_is_10bit(u32 pixelformat) +{ + return pixelformat =3D=3D V4L2_PIX_FMT_P010 || + pixelformat =3D=3D V4L2_PIX_FMT_QC10C; +} + void iris_helper_buffers_done(struct iris_inst *inst, unsigned int type, enum vb2_buffer_state state) { diff --git a/drivers/media/platform/qcom/iris/iris_utils.h b/drivers/media/= platform/qcom/iris/iris_utils.h index b5705d156431..228a5f963812 100644 --- a/drivers/media/platform/qcom/iris/iris_utils.h +++ b/drivers/media/platform/qcom/iris/iris_utils.h @@ -45,6 +45,8 @@ bool iris_res_is_less_than(u32 width, u32 height, u32 ref_width, u32 ref_height); int iris_get_mbpf(struct iris_inst *inst); bool iris_split_mode_enabled(struct iris_inst *inst); +bool iris_fmt_is_8bit(u32 pixelformat); +bool iris_fmt_is_10bit(u32 pixelformat); struct iris_inst *iris_get_instance(struct iris_core *core, u32 session_id= ); void iris_helper_buffers_done(struct iris_inst *inst, unsigned int type, enum vb2_buffer_state state); --=20 2.34.1 From nobody Sun May 24 21:38:47 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.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 F07DE374722 for ; Thu, 21 May 2026 09:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355507; cv=none; b=V+IHnZAwpgwda90NMVLkh6bpZbO/J3mbWob9lCUjmOwSyl+qHurFvqg7YGPeU0FKuqKUeA7Thk4xiB9N/eDpeR9iu+3GMtI21Hp2UIl93fAPNUOIrq3og8zzcogFDsvKeLxQPYlkCAVnH34qIZFwsa9KeJToRd+Owio8mfpJ/eA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355507; c=relaxed/simple; bh=1YwTc1u9GV8fmhP1+J0vFa20RmdKpvYjpawvaFU/zAc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aRJi67RMtstd6FseeBzQWwSVH5Wyu9vNTJoFKiq1kwco7yvwc10/C1tllc94Igit4DXeh0i+dyyLWmW2k4MTVNYMmsNoSa1gLO0lfPBWsw4QO327IVtFh9yiUDi3UGWQdleSq851lKLuG7R5Rs6123mJkN7fxO9z245Y40WSSFg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=mffafI2C; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mffafI2C" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-48a7fe4f40bso69289075e9.0 for ; Thu, 21 May 2026 02:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779355502; x=1779960302; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Z+V645Hcn7ev2MWMZW7amLtyehEhpvkwVi07UuZWarg=; b=mffafI2CNSeT8CcIRWT+TLnjQ7aHUt8tWu+WcbOQhMpy7M9QsVYOQnZNsXyFqx6vSl HJqzAZMmalzz4YSzJGW3203ua9arF9derSXOG6s+zeQl6N8n8KzikoCagUZrhsyMVK1t rYgAA/bpSvxtxWXLU1IZnmD6AJVScL7CSrbdLO9aLXWf1gV8sZhLb3nGTLv37mrqbhBX uUyJ4UZE8ileQiEgDQ58xtIhYOxGmxHZTtXlXtsLn95brzY4PdBw2Gzejtw9BxpQjLLY Q541RyZ4YZox00UO+zJ+dnz/R3wHmFczHKjlbGHo410bsqDX/BKjppwEMkzVqwxr4zch 5Ung== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779355502; x=1779960302; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Z+V645Hcn7ev2MWMZW7amLtyehEhpvkwVi07UuZWarg=; b=RtJ1TFENtEkNJKGkpuoBfaFJz4nrCqFRPZVMgydTEDgqdxQgzJ6kcVouh5fAo5caUa OPiXmMIORMheOVel/BIUYbfWG3W2M0pRzRKVfWYWBiCuklkUbnSV/pNezzAlIMzV5Yt+ CEYGFuIYu9He29tPaiGRMXRYAmlZvU/U3+XpnzIXKww/9N+vHwG9/k7uBpD5nWzqMmF3 Glkls8oLreL1LSEHR+gzDQhmURkmLMixDBgO1WPyod/G6vc1/DveUrajvFSua6LB/F08 d899S2AkWNj1NDA95Z4dVwcStlMne0Q/vsPrLW0CL+Y2Ijd19hDjT4hXEQbZbdhkOBm8 dLDQ== X-Forwarded-Encrypted: i=1; AFNElJ8fFm86xQxAMsX3bzT+72tQ4CLwSNCJnwqIC6ZQtSbUBoUAkRlCM94ro6CKvOo9RON5j7wzTmsDVefAki4=@vger.kernel.org X-Gm-Message-State: AOJu0YzhIC6P33O51dbdLcPTRDRCtOu4EMiH9sTtIgoX60uPg3KIYHzm dp+SRUQIsXU53EfwqjhlAq8k8ON1sqh8JxIozew/v6aywEATDCgmEiQFIpa9tBiDjm8= X-Gm-Gg: Acq92OHDFD92OGNkUwOeKcUbI+9jNowe+3d+BupUFp8w0NzjdbwADhtF2LbbqRXJVRO tGG8Vd4vbUmEEeZigUBSoydShpWDlpzSU9O/GfHgRZigAlawakoIWPpwuRFDnHV32z85DYyUf9D ejDKm/z2IUeloBt8Iui3/cJiPpQMmpa0PNNt42yz0xsAgxZPwRmnd2LCIW9oHqxb5EYSDWfAln5 EcSHRlOWkrqzsU6j/O5O2VM3ebhOCWRecGhV72uatJEJ1BF7akCH60PxERudeOUBQ1SCDFfHAfw KhxEgBa3jOc9zAoALFK18eEE+Hc4qwSWwxHTM8uS/tSdLLG4S4dzlA3JZ3RDDLGkV5VE3ivkLD0 0Afp+Mq2y6FpP1P/0rcwsxHSlYkf4gsloAU0EGxvN0GiZmld6Kfa+sGT2QLWqYopwiuLxXQTaC9 jsK3sQ2sP5OvyGQJrUhBF80IvYw31ZH2zkgyV5+60QOpqY X-Received: by 2002:a05:600c:34c3:b0:48f:d0f7:78f1 with SMTP id 5b1f17b1804b1-4903604d089mr32061235e9.4.1779355502136; Thu, 21 May 2026 02:25:02 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49033d8e25bsm54945595e9.11.2026.05.21.02.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 02:25:01 -0700 (PDT) From: Neil Armstrong Date: Thu, 21 May 2026 11:24:55 +0200 Subject: [PATCH v4 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-topic-sm8x50-iris-10bit-decoding-v4-2-8ff8fce3f904@linaro.org> References: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> In-Reply-To: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=10212; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=1YwTc1u9GV8fmhP1+J0vFa20RmdKpvYjpawvaFU/zAc=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqDs9ptCdEJXyL3D7hLO/ub5ICBqKYZM88ttkChLBk u9qugkGJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCag7PaQAKCRB33NvayMhJ0QDPEA CWJ/ado+BDndc+xc2yVyWSyvJy1ZuqsPor9NZI//hnqjsqu7+6t6gnntk/Izj6vOPMfv9HL0FtjpQN IJ4A8hJ+5iUGqFrOalJyEsgSIk8i6sjWuXi7/Cdu+/lZGjrbhf9vhC89C4bu94MYsAGPhOyFB5xAqS 0JHj/JUanFH7337To7LzyEcntrsyeGAWhCKEDV9blSW9o0tkgcN3D0MB42Y0Wg2Xtfmr9egfrniH8A V7sWvoXSL7e2cJV6B/v74XPKLiSzFJuEUI6jNfkzuC4W76T/eksp+kQZ+Ezr+HgNqBEiIQabhZYYKd NFpC9AQByF1/ERAl/vbJ/YsFD0Lq28aQiu6JtCpbKCKCQSsLY1+m5qz19o5X1ZKeYa560eTOM1BUq0 hN+ZN67ueKZcAkgdBvUkiTd8MO2LlYGtFOcaEhTs7DYYzLJmeriaAktUsI2yFeYWY0Mfowp/hqUcSK tzPUfN3K56yzb7e36gPZirG6fnOMZ+egykdfOIw8MfTjHOJeHQG5nfQvn/3ivlC/lQyfbY6Lp+SNYP bTf2QkxLtxfo93WhJormxwzSeT2aZyfCMtwggeOvjYck4MqNCJqS4bU76wXRr8o1MLPqICfPVXbV2L vPLt0tPUZDtBxhKRo0sqMtbTa4KjKvbwkJ8SFDj3oIs5suBor9Ou5Yt7DnqQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The P010 (YUV format with 16-bits per pixel with interleaved UV) and QC10C (P010 compressed mode similar to QC08C) requires specific buffer calculations to allocate the right buffer size for the DPB (decoded picture buffer) frames and frames consumed by userspace. Similar to 8bit, the 10bit DPB frames uses QC10C format. Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_buffer.c | 195 +++++++++++++++++++++= +++- 1 file changed, 194 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media= /platform/qcom/iris/iris_buffer.c index ef7f6f931557..fbe2dd87f0d6 100644 --- a/drivers/media/platform/qcom/iris/iris_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_buffer.c @@ -15,8 +15,11 @@ #define MAX_WIDTH 4096 #define MAX_HEIGHT 2304 #define Y_STRIDE_ALIGN 128 +#define Y_STRIDE_ALIGN_P010 256 #define UV_STRIDE_ALIGN 128 +#define UV_STRIDE_ALIGN_P010 256 #define Y_SCANLINE_ALIGN 32 +#define Y_SCANLINE_ALIGN_QC10C 16 #define UV_SCANLINE_ALIGN 16 #define UV_SCANLINE_ALIGN_QC08C 32 #define META_STRIDE_ALIGNED 64 @@ -80,6 +83,63 @@ static u32 iris_yuv_buffer_size_nv12(struct iris_inst *i= nst) return ALIGN(y_plane + uv_plane, PIXELS_4K); } =20 +/* + * P010: + * YUV 4:2:0 image with a plane of 10 bit Y samples followed + * by an interleaved U/V plane containing 10 bit 2x2 subsampled + * colour difference samples. + * + * <-Y/UV_Stride (aligned to 256)-> + * <----- Width*2 -------> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . ^ ^ + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . Height | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | y_scanlines (aligned to 32) + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . | | + * Y Y Y Y Y Y Y Y Y Y Y Y . . . . V | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * U V U V U V U V U V U V . . . . ^ + * U V U V U V U V U V U V . . . . | + * U V U V U V U V U V U V . . . . | + * U V U V U V U V U V U V . . . . uv_scanlines (aligned to 16) + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * . . . . . . . . . . . . . . . . --> Buffer size aligned to 4K + * + * y_stride : Width*2 aligned to 256 + * uv_stride : Width*2 aligned to 256 + * y_scanlines: Height aligned to 32 + * uv_scanlines: Height/2 aligned to 16 + * Total size =3D align((y_stride * y_scanlines + * + uv_stride * uv_scanlines , 4096) + * + * Note: All the alignments are hardware requirements. + */ +static u32 iris_yuv_buffer_size_p010(struct iris_inst *inst) +{ + u32 y_plane, uv_plane, y_stride, uv_stride, y_scanlines, uv_scanlines; + struct v4l2_format *f; + + if (inst->domain =3D=3D DECODER) + f =3D inst->fmt_dst; + else + f =3D inst->fmt_src; + + y_stride =3D ALIGN(f->fmt.pix_mp.width * 2, Y_STRIDE_ALIGN_P010); + uv_stride =3D ALIGN(f->fmt.pix_mp.width * 2, UV_STRIDE_ALIGN_P010); + y_scanlines =3D ALIGN(f->fmt.pix_mp.height, Y_SCANLINE_ALIGN); + uv_scanlines =3D ALIGN((f->fmt.pix_mp.height + 1) >> 1, UV_SCANLINE_ALIGN= ); + y_plane =3D y_stride * y_scanlines; + uv_plane =3D uv_stride * uv_scanlines; + + return ALIGN(y_plane + uv_plane, PIXELS_4K); +} + /* * QC08C: * Compressed Macro-tile format for NV12. @@ -204,6 +264,132 @@ static u32 iris_yuv_buffer_size_qc08c(struct iris_ins= t *inst) return ALIGN(y_meta_plane + y_plane + uv_meta_plane + uv_plane, PIXELS_4K= ); } =20 +/* + * QC10C: + * UBWC-compressed format for P010. + * Contains 4 planes in the following order - + * (A) Y_Meta_Plane + * (B) Y_UBWC_Plane + * (C) UV_Meta_Plane + * (D) UV_UBWC_Plane + * + * Y_Meta_Plane consists of meta information to decode compressed + * tile data in Y_UBWC_Plane. + * Y_UBWC_Plane consists of Y data in compressed macro-tile format. + * UBWC decoder block will use the Y_Meta_Plane data together with + * Y_UBWC_Plane data to produce loss-less uncompressed 10 bit Y samples. + * + * UV_Meta_Plane consists of meta information to decode compressed + * tile data in UV_UBWC_Plane. + * UV_UBWC_Plane consists of UV data in compressed macro-tile format. + * UBWC decoder block will use UV_Meta_Plane data together with + * UV_UBWC_Plane data to produce loss-less uncompressed 10 bit 2x2 + * subsampled color difference samples. + * + * Each tile in Y_UBWC_Plane/UV_UBWC_Plane is independently decodable + * and randomly accessible. There is no dependency between tiles. + * + * <----- Y Meta stride -----> (aligned to 64) + * <-------- Width ----------> (aligned to 48) + * M M M M M M M M M M M M . . ^ ^ + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . Height | + * M M M M M M M M M M M M . . | Meta_Y_Scanlines (aligned to= 16) + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . V | + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * . . . . . . . . . . . . . . V + * <--Compressed tile Y stride --> (aligned to 256) + * <------- Width * 4/3 ---------> (aligned to 48) + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . ^ ^ + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . Height | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | Macro_tile_Y_Scanlines (align= ed to 16) + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . | | + * Y* Y* Y* Y* Y* Y* Y* Y* . . . . V | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * . . . . . . . . . . . . . . . . V + * <---- UV Meta stride ----> (aligned to 64) + * <----- Width / 2 --------> (aligned to 24) + * M M M M M M M M M M M M . . ^ ^ + * M M M M M M M M M M M M . . | | + * M M M M M M M M M M M M . . Height/2 | + * M M M M M M M M M M M M . . V M_UV_Scanlines (aligned to 1= 6) + * . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . V + * . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * <--Compressed tile UV stride--> (aligned to 256) + * <------- Width * 4/3 ---------> (aligned to 48) + * U* V* U* V* U* V* U* V* . . . . ^ + * U* V* U* V* U* V* U* V* . . . . | + * U* V* U* V* U* V* U* V* . . . . | + * U* V* U* V* U* V* U* V* . . . . UV_Scanlines (aligned to 16) + * . . . . . . . . . . . . . . . . | + * . . . . . . . . . . . . . . . . V + * . . . . . . . . . . . . . . . . -------> Buffer size aligned to 4k + * + * y_stride: width aligned to 256 + * uv_stride: width aligned to 256 + * y_scanlines: height aligned to 16 + * uv_scanlines: height aligned to 16 + * y_plane: buffer size aligned to 4096 + * uv_plane: buffer size aligned to 4096 + * y_meta_stride: width aligned to 64 + * y_meta_scanlines: height aligned to 16 + * y_meta_plane: buffer size aligned to 4096 + * uv_meta_stride: width aligned to 64 + * uv_meta_scanlines: height aligned to 16 + * uv_meta_plane: buffer size aligned to 4096 + * + * Total size =3D align( y_plane + uv_plane + + * y_meta_plane + uv_meta_plane, 4096) + * + * Note: All the alignments are hardware requirements. + */ +static u32 iris_yuv_buffer_size_qc10c(struct iris_inst *inst) +{ + u32 y_plane, uv_plane, y_stride, uv_stride; + u32 uv_meta_stride, uv_meta_plane; + u32 y_meta_stride, y_meta_plane; + struct v4l2_format *f; + + if (inst->domain =3D=3D DECODER) + f =3D inst->fmt_dst; + else + f =3D inst->fmt_src; + + y_meta_stride =3D ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.width, 48), + META_STRIDE_ALIGNED); + y_meta_plane =3D y_meta_stride * ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.height,= 4), + META_SCANLINE_ALIGNED); + y_meta_plane =3D ALIGN(y_meta_plane, PIXELS_4K); + + y_stride =3D ALIGN(f->fmt.pix_mp.width * 4 / 3, Y_STRIDE_ALIGN_P010); + y_plane =3D ALIGN(y_stride * ALIGN(f->fmt.pix_mp.height, Y_SCANLINE_ALIGN= _QC10C), + PIXELS_4K); + + uv_meta_stride =3D ALIGN(DIV_ROUND_UP((f->fmt.pix_mp.width + 1) >> 1, 24), + META_STRIDE_ALIGNED); + uv_meta_plane =3D uv_meta_stride * + ALIGN(DIV_ROUND_UP((f->fmt.pix_mp.height + 1) >> 1, 4), + META_SCANLINE_ALIGNED); + uv_meta_plane =3D ALIGN(uv_meta_plane, PIXELS_4K); + + uv_stride =3D ALIGN(f->fmt.pix_mp.width * 4 / 3, UV_STRIDE_ALIGN_P010); + uv_plane =3D ALIGN(uv_stride * ALIGN((f->fmt.pix_mp.height + 1) >> 1, UV_= SCANLINE_ALIGN), + PIXELS_4K); + + return ALIGN(y_meta_plane + y_plane + uv_meta_plane + uv_plane, PIXELS_4K= ); +} + static u32 iris_dec_bitstream_buffer_size(struct iris_inst *inst) { struct platform_inst_caps *caps =3D inst->core->iris_platform_data->inst_= caps; @@ -268,10 +454,17 @@ int iris_get_buffer_size(struct iris_inst *inst, case BUF_OUTPUT: if (inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_QC08C) return iris_yuv_buffer_size_qc08c(inst); + else if (inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_QC10= C) + return iris_yuv_buffer_size_qc10c(inst); + else if (inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_P010) + return iris_yuv_buffer_size_p010(inst); else return iris_yuv_buffer_size_nv12(inst); case BUF_DPB: - return iris_yuv_buffer_size_qc08c(inst); + if (iris_fmt_is_10bit(inst->fmt_dst->fmt.pix_mp.pixelformat)) + return iris_yuv_buffer_size_qc10c(inst); + else + return iris_yuv_buffer_size_qc08c(inst); default: return 0; } --=20 2.34.1 From nobody Sun May 24 21:38:47 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 E8F41376483 for ; Thu, 21 May 2026 09:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355507; cv=none; b=OcsILsvqJayDOsPRbTygQ8kjzYb78YwMuv/I/jiTK7LXv6oxpL6kbvKoBRfjsR02ToEgNYuMJvfBfup8xGUG/G7qfRFimnLjSl/MSpRH91LSkZXH4fbJWC5CNrqkzzyRukjQN4bsDw+TcuXaqIQUPEpaCASeBGO+b0Tl+z+bif8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355507; c=relaxed/simple; bh=XwGr9tyt3hvPaymnCZfqwqr/45L2MCnptFtwTTHBXNw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mVVpiF6ZY016QiCpgJpm9se94yqTO1NwD4B0jYwwUfLBE+tGSi8v/9PPqU9U2tr8HDHxaRZLnAYnQsAHqvzIzKCSeh9QNk6U4RS1pjnSPNm1nfbSy1/WJcN8b657EGtjN8SdZxPp94bb/4ImKmytFMR4xvRdrxlZFBva9ePCnvw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=S+Rz31yK; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="S+Rz31yK" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-48fe26a177cso43773905e9.1 for ; Thu, 21 May 2026 02:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779355503; x=1779960303; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=CtfQTQItLHGkPPyqlJcA4HuqW4jsk65SOAFKJ/4eG70=; b=S+Rz31yKNhfDUvMCrQBWiVt2wlyQu2nxcI8sS16onywBw8vqHmeD2VrzQT/7kM9lUV 2UepwCn5oYkoom6w4iK17F0keKkxkyfG+sFWR8SKkfuaklSQQi+2/Hg7GpTB1mqz01iR P+kfv6vyi8IuzaGVByg9cRFBeynHK5TcprKv4szIdwy/rZpG/G0bWr/GCBmGNG64hBS7 KFYtXhrtwyg6ABS5J7Ahok8KB+qjikBAshGbEc6tnhedfGBS0qC/F7T7tkwf9P0n9fbr UbCZjFyCNDQ3B79EPV6GVIzbXLyTQ0LhlfnfY1YWWmPNPjC81lZVStV+MMbVB2r3gmy2 GsyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779355503; x=1779960303; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=CtfQTQItLHGkPPyqlJcA4HuqW4jsk65SOAFKJ/4eG70=; b=n0M3qzgqOufc0jbcOHsdRbfb5H3GPEZc8F01CrXjbnvySGd+qtoXLqVROS7XUfKbaZ mOLtxX6ojFBc/bXNhb7aVnkzVL/5jjI6lWQeESi2/GTU/fDVF8l0i9Q/o2UzDyihHe++ 4kjhpHGAaLy6Q7WW2TlQZSKN6m0PjXoPybUDB0g95bBjBnW8NsZIRTvZzmvcXoZD0pjZ 2RTGTP23TlesnmW5bLpraQlbcgkUpLd4L3PxHGfTdNpe//jO7kvIcnT/loe8sNnAIudO pvhrp+OPgS/EhPEH70YiSkY6YwxdEOFfUiospkqvvX8uX9cjC1ygEUB4k1c32tdkE1aP HjWg== X-Forwarded-Encrypted: i=1; AFNElJ8El/fjM1YE5qFwfHpgUwzcexl1Fyb2B9hfuqai3kaiKi6NyTFXv8aqE43OfigmjszCSZ2QnzAp74xNoLQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7r7UhAkRzud3/EDgDLQHM52jc8JSvCG1lcnBH9SCWC6ZzzWE6 tLEIaQaX+9UJOOXI9c6RGRdlK1eaJTV9I3RojwWPDdv2fMfNKIukNE+VizEQJDWtOgM= X-Gm-Gg: Acq92OG7yJjcM3urnEnhXuMVcrXFgpjwLt9nK4lNd3ZxKbaewIklV68D229xMzQcP6R lxPe2WhpwwBD8CozLOFRHAkYqyqnxRXQb+nXJcBQf9SgtxQLokQWYhO3kq2I5HnOOxgxhtvQtO1 zZOdZyEfyZff35Z0KuCl1o6TW2GCeB9OyVmfkLyaAQyMo2QcwTYiPpSmDb8MQAurkvnVVr2Otn9 IC09FzL+o/kT/ZATsCBQHvMwnNMhLPHC+R+TkTyVwumY9yWlfvgQaFJME5R7eR7XCppzfbQ9Hlh a/AmWL9jHR7kLZvSAaVKQHV73ZQEYs/oZsD1+NFtSUfpS+KpxPER3WMpiD5RFIcjE7FaQrBDzaC p0GaPqSOW35addYctaH4Ycytfal4UwhWiFOOcETxOI5r8v+l9FoRXyH3yoHE9FJT5wBiUhPUWIf YkRGxOVG9if/16nBrM3e/Myto/lelqWBHlEBrVguZJsJJj X-Received: by 2002:a05:600c:620f:b0:485:3abe:ab86 with SMTP id 5b1f17b1804b1-4903604cc8dmr22768965e9.4.1779355502886; Thu, 21 May 2026 02:25:02 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49033d8e25bsm54945595e9.11.2026.05.21.02.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 02:25:02 -0700 (PDT) From: Neil Armstrong Date: Thu, 21 May 2026 11:24:56 +0200 Subject: [PATCH v4 3/6] media: qcom: iris: gen2: add support for 10bit decoding Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-topic-sm8x50-iris-10bit-decoding-v4-3-8ff8fce3f904@linaro.org> References: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> In-Reply-To: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Dmitry Baryshkov X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=6402; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=XwGr9tyt3hvPaymnCZfqwqr/45L2MCnptFtwTTHBXNw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqDs9pFxMcx5vgSPt1XV6BcWTwv3OIOrX5ZxW1JxjM 3q9DptqJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCag7PaQAKCRB33NvayMhJ0RCKEA CCnt5LfU3sX6LFjTnfJfADp9X7s6E6FjMFRHU7InUDs4HTGfe1ndxsE0JLuPgrwb3C2rr5nzzpEf1z ywYDXsDNgzNesrJmny9kZd/SqAA8v5Sx61uihwLi+CS2ntOsprQt5RlqHH3TyxvhCq4Me34Ddo4rs0 HcbV+cIt/JDfRS7JuudOf5L/KTiT0K748IZ72aMwSwA2U/XDBEklhD6cN5TxIB7IpZFkQHVLyBw6va gdwK87cd4bDb6OCfvVlk/e4HY1lo9lG28ZzT/RAiuF6OkXa8Vbe46t4MRaaHCUGLNd1uZesDZfLKzM oF9AkcPhbgEPYb4II+4kfCvUekDCNYCfluXctzjC8uW0foizWAXy1scDcFtdDqZ7UtYz5QSimm6uU6 wo7IJnbgPOYv3Hst5FmeLu2eONEOgXd9sC6Zc9TjM3u+qsIlKKKUB58cyiCKpnWdMliZtejxFIJpPg Xgn3oq+9LK+vsWCSo6gShLQ1mSVawyrUS79OQz8xlqmwBJjJQTyGGWjbBrS17JY5HH0M/ZZAmHPmtY MS5c0NyqM+ZxuT+Kf0kk6RDFRS+dRj20QcVcg2nUMPAWV89nEUcCYZIeiAwhCVLLK7xECd4o/Vn+bg RSC0OlGYRRFsXEpy+OKxRwpq5gqikBqdTDYrbw8jE6Ft7aexRHOpC6UPSqQg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Add the necessary plumbing into the HFi Gen2 to signal the decoder the right 10bit pixel format and stride when in compressed mode. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong --- .../platform/qcom/iris/iris_hfi_gen2_command.c | 75 ++++++++++++++++++= +++- .../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 + drivers/media/platform/qcom/iris/iris_utils.c | 4 +- 3 files changed, 76 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_command.c index c90b22a75bc5..1d0ab30093db 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -481,8 +481,20 @@ static int iris_hfi_gen2_set_colorformat(struct iris_i= nst *inst, u32 plane) =20 if (inst->domain =3D=3D DECODER) { pixelformat =3D inst->fmt_dst->fmt.pix_mp.pixelformat; - hfi_colorformat =3D pixelformat =3D=3D V4L2_PIX_FMT_NV12 ? - HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC; + switch (pixelformat) { + case V4L2_PIX_FMT_NV12: + hfi_colorformat =3D HFI_COLOR_FMT_NV12; + break; + case V4L2_PIX_FMT_QC08C: + hfi_colorformat =3D HFI_COLOR_FMT_NV12_UBWC; + break; + case V4L2_PIX_FMT_P010: + hfi_colorformat =3D HFI_COLOR_FMT_P010; + break; + case V4L2_PIX_FMT_QC10C: + hfi_colorformat =3D HFI_COLOR_FMT_TP10_UBWC; + break; + } } else { pixelformat =3D inst->fmt_src->fmt.pix_mp.pixelformat; hfi_colorformat =3D pixelformat =3D=3D V4L2_PIX_FMT_NV12 ? @@ -517,7 +529,8 @@ static int iris_hfi_gen2_set_linear_stride_scanline(str= uct iris_inst *inst, u32 stride_uv =3D stride_y; scanline_uv =3D scanline_y / 2; =20 - if (pixelformat !=3D V4L2_PIX_FMT_NV12) + if (pixelformat !=3D V4L2_PIX_FMT_NV12 && + pixelformat !=3D V4L2_PIX_FMT_P010) return 0; =20 payload[0] =3D stride_y << 16 | scanline_y; @@ -532,6 +545,61 @@ static int iris_hfi_gen2_set_linear_stride_scanline(st= ruct iris_inst *inst, u32 sizeof(u64)); } =20 +static int iris_hfi_gen2_set_ubwc_stride_scanline(struct iris_inst *inst, = u32 plane) +{ + u32 meta_stride_y, meta_scanline_y, meta_stride_uv, meta_scanline_uv; + u32 stride_y, scanline_y, stride_uv, scanline_uv; + u32 port =3D iris_hfi_gen2_get_port(inst, plane); + u32 pixelformat, width, height; + u32 payload[4]; + + if (inst->domain !=3D DECODER || + inst->fmt_src->fmt.pix_mp.pixelformat !=3D V4L2_PIX_FMT_AV1) + return 0; + + pixelformat =3D inst->fmt_dst->fmt.pix_mp.pixelformat; + width =3D inst->fmt_dst->fmt.pix_mp.width; + height =3D inst->fmt_dst->fmt.pix_mp.height; + + switch (pixelformat) { + case V4L2_PIX_FMT_QC08C: + stride_y =3D ALIGN(width, 128); + scanline_y =3D ALIGN(height, 32); + stride_uv =3D ALIGN(width, 128); + scanline_uv =3D ALIGN((height + 1) >> 1, 32); + meta_stride_y =3D ALIGN(DIV_ROUND_UP(width, 32), 64); + meta_scanline_y =3D ALIGN(DIV_ROUND_UP(height, 8), 16); + meta_stride_uv =3D ALIGN(DIV_ROUND_UP((width + 1) >> 1, 16), 64); + meta_scanline_uv =3D ALIGN(DIV_ROUND_UP((height + 1) >> 1, 8), 16); + break; + case V4L2_PIX_FMT_QC10C: + stride_y =3D ALIGN(width * 4 / 3, 256); + scanline_y =3D ALIGN(height, 16); + stride_uv =3D ALIGN(width * 4 / 3, 256); + scanline_uv =3D ALIGN((height + 1) >> 1, 16); + meta_stride_y =3D ALIGN(DIV_ROUND_UP(width, 48), 64); + meta_scanline_y =3D ALIGN(DIV_ROUND_UP(height, 4), 16); + meta_stride_uv =3D ALIGN(DIV_ROUND_UP((width + 1) >> 1, 24), 64); + meta_scanline_uv =3D ALIGN(DIV_ROUND_UP((height + 1) >> 1, 4), 16); + break; + default: + return 0; + } + + payload[0] =3D stride_y << 16 | scanline_y; + payload[1] =3D stride_uv << 16 | scanline_uv; + payload[2] =3D meta_stride_y << 16 | meta_scanline_y; + payload[3] =3D meta_stride_uv << 16 | meta_scanline_uv; + + return iris_hfi_gen2_session_set_property(inst, + HFI_PROP_UBWC_STRIDE_SCANLINE, + HFI_HOST_FLAGS_NONE, + port, + HFI_PAYLOAD_U32_ARRAY, + &payload[0], + sizeof(u32) * 4); +} + static int iris_hfi_gen2_set_tier(struct iris_inst *inst, u32 plane) { u32 port =3D iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLA= NE); @@ -620,6 +688,7 @@ static int iris_hfi_gen2_session_set_config_params(stru= ct iris_inst *inst, u32 p {HFI_PROP_OPB_ENABLE, iris_hfi_gen2_set_opb_enable = }, {HFI_PROP_COLOR_FORMAT, iris_hfi_gen2_set_colorformat = }, {HFI_PROP_LINEAR_STRIDE_SCANLINE, iris_hfi_gen2_set_linear_stride_sc= anline }, + {HFI_PROP_UBWC_STRIDE_SCANLINE, iris_hfi_gen2_set_ubwc_stride_scan= line }, {HFI_PROP_TIER, iris_hfi_gen2_set_tier = }, {HFI_PROP_FRAME_RATE, iris_hfi_gen2_set_frame_rate = }, {HFI_PROP_AV1_FILM_GRAIN_PRESENT, iris_hfi_gen2_set_film_grain = }, diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_defines.h index cecf771c55dd..68f849232906 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -118,6 +118,7 @@ enum hfi_flip { #define HFI_PROP_OPB_ENABLE 0x03000184 #define HFI_PROP_AV1_TILE_ROWS_COLUMNS 0x03000187 #define HFI_PROP_AV1_DRAP_CONFIG 0x03000189 +#define HFI_PROP_UBWC_STRIDE_SCANLINE 0x03000190 #define HFI_PROP_COMV_BUFFER_COUNT 0x03000193 #define HFI_PROP_AV1_UNIFORM_TILE_SPACING 0x03000197 #define HFI_PROP_END 0x03FFFFFF diff --git a/drivers/media/platform/qcom/iris/iris_utils.c b/drivers/media/= platform/qcom/iris/iris_utils.c index 085665cd74ff..ba5c8dc1280c 100644 --- a/drivers/media/platform/qcom/iris/iris_utils.c +++ b/drivers/media/platform/qcom/iris/iris_utils.c @@ -35,7 +35,9 @@ int iris_get_mbpf(struct iris_inst *inst) bool iris_split_mode_enabled(struct iris_inst *inst) { return inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_NV12 || - inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_QC08C; + inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_QC08C || + inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_P010 || + inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_QC10C; } =20 bool iris_fmt_is_8bit(u32 pixelformat) --=20 2.34.1 From nobody Sun May 24 21:38:47 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 E038237701C for ; Thu, 21 May 2026 09:25:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355508; cv=none; b=bl4vdgihxohHY3J92nuARhJQ7qcfsaluT0+TCpNNW+b1Eqxd/sf5eESKtrgYGfYCmYLwNXtSgSg8kTphN06DagF/wKiU2NzE815Lz4Yud2FS/0sST2kuCTxjA1oG124Lohx8rPN1mgn1t4RbT26770XXTiwSLKz55kJ/nfnMj8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355508; c=relaxed/simple; bh=0x5xYEwoUZvKXTEvMQnBzewQiRcORbDr7ycw7TxINKE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oOqFbERKM8xwXNZu5GG0XKUNJJyujC66VL6GSffwv2PWnGr/x9iJpPJ4Vf3C6xkv4TACtyVUwSa3tJxbOHw4V4sXwvCVFG97PCfiaFe45veilfP04tynFV3UWNnqoDMg2JYRCYI92StadibnlPrtt2uj44eGtLlaQQX9g+cF7Kc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=KabRghp6; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KabRghp6" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-488af96f6b2so63638145e9.0 for ; Thu, 21 May 2026 02:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779355504; x=1779960304; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5V3jdq7D8hT9URSjELxQylxndpkD3NUZV1IJWVze3+E=; b=KabRghp6exoKj3TDIf/QFEAnImRdbVQTSBzq6qaW614aCjWnOdPvXUbzfc8nDZhMIO LdWlRK/P6aoVBV8aOx9F0wng4I1CITbWxJ+kWdjT7VvSZvrtrefGYvjmZcrE6nfOnqXQ QhZSdfpY0g2nVBCW4zKWWQr4nyJhm7R3kvxbeGTzjZ+YdAdiQZ7pu3MLiVmAUF1tAk/2 t7rl7qzAl4aa6Ra2aCdX94qg2PqcjJpfg096QIx9yJlj7bYGagnPrNxj1EQ4xQlLqYnt Mnv3kOSaBzmoSPoh52niy1XiyBMv/mE/r8liNck4Tqbp/yPi7xd8Bjv0y4f/LZKduFqT Ktog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779355504; x=1779960304; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=5V3jdq7D8hT9URSjELxQylxndpkD3NUZV1IJWVze3+E=; b=St2LZpMNbP51NTEXT4/oS+D8+zXYpAcFZxjrA/luqDLHD75RcvpLSQ+WioAfxjBg0X kul+CYAW5W5KHteQHwVDOreR8m/9cEjou/iR5GbvFI2ISxFVmx8QeuzWKJ5GTkrxOanL 8QPm/cjEwLUna0SGP7N0THFm2e6SVg9BRvvlNkxBbg0DIEkDBQR/FrxGVJsP+KgLBHW4 kxrD5aM92JF9SyViq92eHp18k8e6pSWEGC9XrHD4D9A6zeA+U/5m3yEx+Px0knErrBxe 9GmX4rPkBIBe4N+k2CyHaYb9TzIwMUf1Au+fdgdivSs2vOEnHhXXGyHBBjS/BRBk/n6u fJZA== X-Forwarded-Encrypted: i=1; AFNElJ9GYNXe8UqRMCnP3L8koYw5lkAidQpptL7HjHKXZoUWn+O/PHYmToIhJDAXY9jRZB9ZqSHVTxO/R5EyFfM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3Y8QQ0qteBEzLcwlfnuiLI0PgazUaUm9ZX20YL8/daQMlezME Y/1mc9h8pTiovvhCvc2xW86hMwiMT+oFcPUoB4vKDOVW7LEUBbElGrBkdDzVpysPJQc= X-Gm-Gg: Acq92OGpxkEmxpUN7xjhGOQXWgC7IWB5+Alx6vLrbA5uweJOtLe/vUwujGK5UoZE7Y8 koNdtoUn8EwuQSLJHLPb4RMG/3i4FqNST9I/oniKeCpj9OltjwkyaBRmPTlN993hLTORrub9ZEw rZozHDPl+boTrU99RNd+rzDDRoSvbJ9l67/Y0VgUQOlnru/2czT99WWDNcdSdfFrYNyESsE6ZVz 0M0lAsU3qEcOtWBuluUJJ9iW2+7X2lwK9kJoL7+yyapaLI5TjyczqOnzu7aKxFq12VeDNsEv+Qm RjCpqjMdtu2IwNSJN+FVSZJHxlrasZs4Ru7coNwDadTgjDmDiH7SpCbkOgeLzFurOaUI60Sk+mr mK2yfZV6aigujZ+efOnvuLnSZ8bc7OOm2W0Mv9M5COY1aJ7OQYJZWwBLVszIYB1HMK8y1PG9qrS Pb0r7ZjCbFTosjQAsbIpwCRn+3tDYXgzVXg7HLxKueHZo2 X-Received: by 2002:a05:600c:33a4:b0:48f:e230:2a1d with SMTP id 5b1f17b1804b1-490360f0f14mr15782675e9.32.1779355503640; Thu, 21 May 2026 02:25:03 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49033d8e25bsm54945595e9.11.2026.05.21.02.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 02:25:03 -0700 (PDT) From: Neil Armstrong Date: Thu, 21 May 2026 11:24:57 +0200 Subject: [PATCH v4 4/6] media: qcom: iris: vdec: update size and stride calculations for 10bit formats Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-topic-sm8x50-iris-10bit-decoding-v4-4-8ff8fce3f904@linaro.org> References: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> In-Reply-To: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Dmitry Baryshkov X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3674; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=0x5xYEwoUZvKXTEvMQnBzewQiRcORbDr7ycw7TxINKE=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqDs9qplGOiq+93Kwowy55wKDxWqlvOjTUQJw98f4t JMHBnvyJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCag7PagAKCRB33NvayMhJ0bBUD/ 0VgtbW6nrMDvBlizvd2DGdKtqwLV45UpEhkLof7xzSYTp+EaOOZR/OgU2c/IQ0rtfnaatdaLs5nfmY 95xCy8fNrzttmdn6C/KPSgfLaZDSP1TCvfDBQQaxItXMXsf1tqoTBIusy2kd43BC5KBVEiKC2fiZZQ xRUm0XfT2Lha6hU/DgvstPV5rjhGsiQr3/sqqoxDsPBmI+wPdJtbUdWX1fqPoQUi3ZlAUj1MSErxEi 44jL5DrRL7nOkrN2x5xud044Zer19K6/xn4SY6Spc8Vb8PH3RTej5FXjsTZz8dxlHh7Bo/7CaB2woo gj5BUJ+z/acjx82OUqZkYDYWxjN41wCXX7dIe4TdNMZ9Sa9uLIU2arQAWkXnNamEOF+0rxURmhWWEt GAt6AAkDfY4l0kFbzgBxdobYZ5E9U5kcGLiLSXQPLs6ajBU/ex3qOaghHYeCiIlC7af+hAtsEgbFVG 6kW3MZVTJvr1gew/736IqBquWWXNIBRy80HqODrbUQljb+YbafyAvcoDZ22zhBjSr+HXzlF3IH4/vN 4pxHRjKzwv0BfwkJL+HNJ0lb4fkD6+pYzgKLi3had6haQnCCr4p//yaa8WjAdQKE4fSwnSjKDkPz2m T3IzUiMm6YBzWhBgPazSyz5VA0q8mTLAQjVQsmTq8291iD2gD9KhBB/snZ2w== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Update the gen2 response and vdec s_fmt code to take in account the P010 and QC010 when calculating the width, height and stride. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong --- .../platform/qcom/iris/iris_hfi_gen2_response.c | 21 ++++++++++++++++--- drivers/media/platform/qcom/iris/iris_vdec.c | 24 ++++++++++++++++++= +--- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c b/dr= ivers/media/platform/qcom/iris/iris_hfi_gen2_response.c index c350d231265e..aca90aab8548 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c @@ -542,9 +542,24 @@ static void iris_hfi_gen2_read_input_subcr_params(stru= ct iris_inst *inst) pixmp_ip->width =3D width; pixmp_ip->height =3D height; =20 - pixmp_op->width =3D ALIGN(width, 128); - pixmp_op->height =3D ALIGN(height, 32); - pixmp_op->plane_fmt[0].bytesperline =3D ALIGN(width, 128); + switch (pixmp_op->pixelformat) { + case V4L2_PIX_FMT_P010: + pixmp_op->width =3D ALIGN(width, 128); + pixmp_op->height =3D ALIGN(height, 32); + pixmp_op->plane_fmt[0].bytesperline =3D ALIGN(width * 2, 256); + break; + case V4L2_PIX_FMT_QC10C: + pixmp_op->width =3D roundup(width, 192); + pixmp_op->height =3D ALIGN(height, 16); + pixmp_op->plane_fmt[0].bytesperline =3D ALIGN(pixmp_op->width * 4 / 3, 2= 56); + break; + case V4L2_PIX_FMT_NV12: + case V4L2_PIX_FMT_QC08C: + pixmp_op->width =3D ALIGN(width, 128); + pixmp_op->height =3D ALIGN(height, 32); + pixmp_op->plane_fmt[0].bytesperline =3D pixmp_op->width; + break; + } pixmp_op->plane_fmt[0].sizeimage =3D iris_get_buffer_size(inst, BUF_OUTPU= T); =20 matrix_coeff =3D subsc_params.color_info & 0xFF; diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/p= latform/qcom/iris/iris_vdec.c index ccda3b9fb845..3846d73b4d23 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -272,10 +272,28 @@ int iris_vdec_s_fmt(struct iris_inst *inst, struct v4= l2_format *f) fmt =3D inst->fmt_dst; fmt->type =3D V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; fmt->fmt.pix_mp.pixelformat =3D f->fmt.pix_mp.pixelformat; - fmt->fmt.pix_mp.width =3D ALIGN(f->fmt.pix_mp.width, 128); - fmt->fmt.pix_mp.height =3D ALIGN(f->fmt.pix_mp.height, 32); fmt->fmt.pix_mp.num_planes =3D 1; - fmt->fmt.pix_mp.plane_fmt[0].bytesperline =3D ALIGN(f->fmt.pix_mp.width,= 128); + switch (f->fmt.pix_mp.pixelformat) { + case V4L2_PIX_FMT_P010: + fmt->fmt.pix_mp.width =3D ALIGN(f->fmt.pix_mp.width, 128); + fmt->fmt.pix_mp.height =3D ALIGN(f->fmt.pix_mp.height, 32); + fmt->fmt.pix_mp.plane_fmt[0].bytesperline =3D + ALIGN(f->fmt.pix_mp.width * 2, 256); + break; + case V4L2_PIX_FMT_QC10C: + fmt->fmt.pix_mp.width =3D roundup(f->fmt.pix_mp.width, 192); + fmt->fmt.pix_mp.height =3D ALIGN(f->fmt.pix_mp.height, 16); + fmt->fmt.pix_mp.plane_fmt[0].bytesperline =3D + ALIGN(f->fmt.pix_mp.width * 4 / 3, 256); + break; + case V4L2_PIX_FMT_NV12: + case V4L2_PIX_FMT_QC08C: + fmt->fmt.pix_mp.width =3D ALIGN(f->fmt.pix_mp.width, 128); + fmt->fmt.pix_mp.height =3D ALIGN(f->fmt.pix_mp.height, 32); + fmt->fmt.pix_mp.plane_fmt[0].bytesperline =3D + ALIGN(f->fmt.pix_mp.width, 128); + break; + } fmt->fmt.pix_mp.plane_fmt[0].sizeimage =3D iris_get_buffer_size(inst, BU= F_OUTPUT); inst->buffers[BUF_OUTPUT].min_count =3D iris_vpu_buf_count(inst, BUF_OUT= PUT); inst->buffers[BUF_OUTPUT].size =3D fmt->fmt.pix_mp.plane_fmt[0].sizeimag= e; --=20 2.34.1 From nobody Sun May 24 21:38:47 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 921DB372680 for ; Thu, 21 May 2026 09:25:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355509; cv=none; b=jCz+zudaxAkMQcGDLWRXYeoKEQv65aGb+86RBLen04rs8PjnYVRf+/0vW6ShCVokavY8GzdFCQbwXzRYftHBwdE8fZZp/HR6iOsKmVmE0ucv32/7qvFMhMgeX77kc2IIYv4tZGX12J3fm7hETisQjVrpCKzYXIADAT6jhY2K3LA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355509; c=relaxed/simple; bh=5/9C7suvplgEsPbQlJQ82cUD+wRYnGK2N6Wv+CSFAPA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S63pHbuJaa5yeKlKB0r7niOuBvDLKaPnPZT9KlkBTpl4aa2VXcMWLHNML2I9AlBkd5Xfk3WXRpud+UjH4FjQj/6dk/LCRtBi2AWqFYjbYXBdKWYm7I1ZJytjWfnHw1pY+Vm4pLGHM/j4nFPQwwXUkYJfGGodvq3FFm0geVOw++E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=T7Ysfwt9; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="T7Ysfwt9" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4891c00e7aeso43671055e9.2 for ; Thu, 21 May 2026 02:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779355504; x=1779960304; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xaQcfmkaubMR1gaBpk2C5uvdfgB4RMMo7pbgwOu7Sk4=; b=T7Ysfwt9H6uwkJuCsOuBJavkOb27YP3ed4nRF3FbVZ7aTz10jTfZ0qe0X/3Hp5pAzU iWx+bGhr9L+6wPLpT1cDntXGv2lDpjVtnrpeOfgKodbqQShFbY7F8Z7EBIdFSzGImpvG YgJOywre7b8Ovp5HKhU0maw6WNO+dSc8RjCVZcnNhWdcXg6XMZdquUKPBIJ25iMTiiix x27OjHzG2dZOSZCaOcxeFqZ4ro9C7/GrY9JqbWEOv/l0AeaoMUW6CgyMFQ10brHjk8gS TL0YdXyzFyw+IBtlkDbEc0qsJxkYRL71VGPT+mozKZPU6krrXYPxbLzTIJ5ZBH7EsiIL WjmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779355504; x=1779960304; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=xaQcfmkaubMR1gaBpk2C5uvdfgB4RMMo7pbgwOu7Sk4=; b=JPfmwBxdndZDZPilig7r5Ly+CDNBejWlcBSWQmfHwn2YsyxxEphA519iqktZeeVD8r D26FmeVxYETywf3qDzosHtjCAMORekFbthJ9h06YYrZrBFtaw6/YztDrkix2NCJWXpUX Bc7U4iKacDz2wdWpyFjXYpIWfuWpurzxR/6g1Gzuj30IpWHoVFGMAriUu3iOMu1mbhL3 ZdPvKW65NNcP+5j00xa9siAzq8napsbAqbeki/4ovplftDPRRewcx7gqELDezQBZUZDE XfoW2YdW/PQg93Q7Lf9/SMmjLsnzbSwTE2/CZm+Dz08RR9Q8QxC5Kp9jOgMmJ/3J876G VOLA== X-Forwarded-Encrypted: i=1; AFNElJ9rcCM6cLLh/sUGntxuf3TWi5agiAv+E5RlVMCf4A5SjzEKeHzAiGrNWSIdGTOg7BNKRBu+vuX+61yLKGo=@vger.kernel.org X-Gm-Message-State: AOJu0YyyXpBAhSusy7YeOXdzNhfzgyfTZxLuWAdFujpUByTbxVbi8g4Y K054Wkgsn2DIMtG0/e4ZwgbYJI/GfnigFKrVrq+Wba76vS26ZtFgela4ubSg5PoqVCo= X-Gm-Gg: Acq92OFwVAIqMDD1rhQ1tEyPWl40A3csgKd8AmDCsUo/mJ6drWsKii7cVJJt+J8GBh8 fk2q470DbNBLy9eBgf8NoQ9Gtm54AfqbFa1FO8TldbmFRj5mry20uzsRCkfFCbANfB2RAHsmxWf Npn/jLe2ruN8q8q4Vgk/hxrekRhuixFhUOj5jcovZYFo0+UtG8Yl7UHciwpK+9qxo1790wRZD8Z hl05sZGLg6J1HuhiHyHJtYiAMbu4iIfRVlHYLRbSxxX2JfOaesRT5YjFFK/esUBG6DK6BkxZ9jB g9PyaUrxzKG1q8YcmYkzbaSOC5/fgqBSsoaWPHuVz6F4uzcyxoNqhtmvEl0wNlpl4SnneAx200Q fPl0ccPkVvTAhsYTmudB+xkNMJpx/y1Dt1wf6KiwaE/Teluh6btw9HyGOmC+he+AwcpDeHn3Ely uc3BnkKvos6i1YcSn6Agu/sqNm9hIpFdYzo12DVoAHE2MoEI6qwmgM0PI= X-Received: by 2002:a05:600c:a383:b0:489:1aed:1658 with SMTP id 5b1f17b1804b1-490360bd3c6mr16091865e9.23.1779355504435; Thu, 21 May 2026 02:25:04 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49033d8e25bsm54945595e9.11.2026.05.21.02.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 02:25:04 -0700 (PDT) From: Neil Armstrong Date: Thu, 21 May 2026 11:24:58 +0200 Subject: [PATCH v4 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-topic-sm8x50-iris-10bit-decoding-v4-5-8ff8fce3f904@linaro.org> References: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> In-Reply-To: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1995; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=5/9C7suvplgEsPbQlJQ82cUD+wRYnGK2N6Wv+CSFAPA=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqDs9q3hdbuw3CBEvtKL90P/F8+C2RLBsvIdzeaTzg PHFm/jKJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCag7PagAKCRB33NvayMhJ0VJ0D/ 9fo0MHvElrb3vnYjZeRGK6sOJ4wFkoN06Ld+CUJM9vi9v7Ky8DynnMIE7DXObGVS1OavtFgQDbiUgr 057KhcWcwjeZWFGYCHFsnbQ4C8FZm+c7l6/oGB/BIB4fERlSipON7gMAEb1lbRV9wBTq2LD+M5wPiD txgC3swcgifhBP2vjH8gf/d6NSvDXLE5jm/Il9+5rfoMyHmVo8aUJqf8yEq8OCqe3gaI1RCKkSMdNe LRaQyvKB75OgA2VJ0x4tb1h2GZfuSmr9QcLDJLXf4xMABWfA7m9cp0ERj2xK/U8GeCAeslopY1isly b/nvc7Ui9wPtB9Wa1N5cca180VsgAiUtm1InA8q4v7/l1H32XER00YcswLMpn94D8wVFinaZvFbViG owZcGGJ40I/JrdYcW88bM1A1qFYF1wmO2P7y0FGHXgojQyaALlgh1wtJYYQZG0L095GopMfqpntvRs jFNejHp9qJZIYur9QG40v12Jr8noEFhwOudIAndkFOaSazzk7mn70TikJM7dZrN0G2kV8qwGgwt/HQ bVFS/pW82biZY3Wqoxr/x3M2nNyy0gFTtv1JM769a8z/rMubDS5DA/H6mUgDDOsouQO3O+im+7qL4x LflgMWojqfh2nTIEdy4WM9Yg+Zd4qi+TG3tYbmPjLkPBmro6wlik5vcAbgTg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The 10bit pixel format can be only used when the decoder identifies the stream as decoding into 10bit pixel format buffers, so update the find_format helper to filter the formats and only allow the proper formats when setting or trying a capture format. Reviewed-by: Dmitry Baryshkov Reviewed-by: Bryan O'Donoghue Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_platform_common.h | 1 + drivers/media/platform/qcom/iris/iris_vdec.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 6a108173be35..7595e21277b0 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -17,6 +17,7 @@ struct iris_inst; =20 #define REGISTER_BIT_DEPTH(luma, chroma) ((luma) << 16 | (chroma)) #define BIT_DEPTH_8 REGISTER_BIT_DEPTH(8, 8) +#define BIT_DEPTH_10 REGISTER_BIT_DEPTH(10, 10) #define CODED_FRAMES_PROGRESSIVE 0x0 #define DEFAULT_MAX_HOST_BUF_COUNT 64 #define DEFAULT_MAX_HOST_BURST_BUF_COUNT 256 diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/p= latform/qcom/iris/iris_vdec.c index 3846d73b4d23..f1366a1865c1 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -105,6 +105,16 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 ty= pe) if (i =3D=3D size || fmt[i].type !=3D type) return NULL; =20 + if (type =3D=3D V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + if (iris_fmt_is_8bit(fmt[i].pixfmt) && + inst->fw_caps[BIT_DEPTH].value =3D=3D BIT_DEPTH_10) + return NULL; + + if (iris_fmt_is_10bit(fmt[i].pixfmt) && + inst->fw_caps[BIT_DEPTH].value !=3D BIT_DEPTH_10) + return NULL; + } + return &fmt[i]; } =20 --=20 2.34.1 From nobody Sun May 24 21:38:47 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 68B1234C98C for ; Thu, 21 May 2026 09:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355510; cv=none; b=eC41MnWTExcA6IUVHMs8aFb2QwfTylDfM+tX4ZQtjDpLScdITzP/DCc38usA8TmY4xa91qvA6uC46aTUL3BQrJmtQSveUV9FsLxiNTEAjzIhE+K8vTUxaM9pUDpZBWFxK2sxQfHUT9+hETw4cVnrc4gOih8aC8ykuyOdoS3gjxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779355510; c=relaxed/simple; bh=CTFTmouZYmRT/XjZjK1PSK6/Ti4OEFzaln+Rasgs8So=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kGSDFB5urxew9o2hjPq8iQfwkkggCtom32Pe9OcMs9UEtW+hl6GP7/7Of/CJ2i5JsrEh30a0gyVUuBvouZYdFq1F5P9aJP8xPHuvSN9+vVX7Hl1Gc8Nnvipa3srLNaCWdz/D/1Z5v58WzZXv+gbr2ytrOR0B/HVplkKjG5QkqD4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Bey3/fYl; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Bey3/fYl" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-48fde648a71so42264325e9.0 for ; Thu, 21 May 2026 02:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779355506; x=1779960306; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=tT5b2xPFTEeIqCWOktjj/HJHE/WMC6br0sd4CSAIaRQ=; b=Bey3/fYlFkbEoxBxheHiIll1vheqOapcWBba0peRUiEwLv111lheQiFwtOcHn7J45s kvWJLA/4tRvhauZB7TFqkRpZdrL9VKLNd6s74+5tP/Q8FjyII6WYy4rRb7yqoA0Y7Q9Y PsrQUrL7C9HHgWWws2PpzgzjZbWR2J/Om19eupsbnSzt+BWEVwkZnXlgIzABE37H8StQ 4sYhKu8iloVUmtOYZ+sK1NXKYRU2T61tkqlXW9+W+GcXj1v27JTWiDt94ElxgPdhLflh paNX9tAdjtV1JP/lX4T031IkywfbJ/a2dC0I8wl6uUrzoY+g903e0/lyH1DHPAivamz0 Q/Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779355506; x=1779960306; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=tT5b2xPFTEeIqCWOktjj/HJHE/WMC6br0sd4CSAIaRQ=; b=nyVPN1M7x2PAD5V47IaL+ymLC2jy/XHwNUCxHGjQ537GjFGjQtMTj4cNrCBUz6qLCk 5T7J07YSL+V3663wGD2+YQld6fZzA2fDsjZcxmhkLPch0En26aNv7UP+K8X6hZ2Ptfuw y7BgtitKAkAZp8cBWfU8OZpJYULSRibDnvm4KoHsq+r3O5l/UhJzSqq5N11jVBGYph3i izDXQPXaHQQrh15yVGoGl2WzS4/TsbzDPYW+Po24D5cuWx5qZHdMnB6ICIoD8z+waQFz dM6XIG5zC4oKLhPKe7cpYZKBSWuaQ6eJyjDlAfjmDOfBqdYy0jW0W0rRMbWcznNznMTB 8W5A== X-Forwarded-Encrypted: i=1; AFNElJ+ext3IDCfmxJLJYZu5HaaGs/jC5NjfW/PQhzewYlbukfTR+Ty3RZ+dUMISjlOePsBUT3VqtDZyl9iYF8k=@vger.kernel.org X-Gm-Message-State: AOJu0YyC2x1Vi7nSZTf9N9ZDDxqc/vZU8HISscPfcnbrIApAAM7vQXKQ xOws1EEKzfnqcgsPT+jVgc0+tB4JwwAMxrcF3DYiW4jRgFBuLKzWZ8qSqjvyfOXQjl8= X-Gm-Gg: Acq92OHdm2F3X3C/u2kU0q6QYZnkkXI7cagbbo02Il6pe8A2CBWsuI3pw40A997mNR5 vYzPLJryfAd4m+z0pXPfmyN5Wnw0YntLbGBAP/QE3T/YxwoP1acbPhvqOj+w4UGlRmZ9RjaUo+2 pZ3RDRzl5lBA0BWmr3Ufjc+0oVVYGTm0MAC/IE4MZJW5jq9eLKa9wAH/80pa7QZa2mnr+270bn9 4oFgK9A20GjjSvpuE8bBLSzhZ/W1dAQYHGQ5ryHh6nOOIoU9XNQWB1+3cP4ZvSO/SGpBVzI+65Z 8p3+jvf13VEdQwNCkTJW2KMoxHIb3/rn/kiut2/SNHJoLLThXFvZdzmPD2DlrlB/N3zqDIdKx// xpEe7mgGyFQUKj5DxDZlIEVUuD8ECkMp50ITBgyAnGTHzkuYDg//uPGwRO589Z7h0vfGpAjcbCI LiEaMJBw/DcY/bb0hkPTYdylX9VvfCHRTuNYHzMZKCNyBi+LpPCjkeVB4= X-Received: by 2002:a05:600d:8496:20b0:48f:e230:29f4 with SMTP id 5b1f17b1804b1-490360dc195mr14506795e9.15.1779355505388; Thu, 21 May 2026 02:25:05 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49033d8e25bsm54945595e9.11.2026.05.21.02.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 02:25:04 -0700 (PDT) From: Neil Armstrong Date: Thu, 21 May 2026 11:24:59 +0200 Subject: [PATCH v4 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-topic-sm8x50-iris-10bit-decoding-v4-6-8ff8fce3f904@linaro.org> References: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> In-Reply-To: <20260521-topic-sm8x50-iris-10bit-decoding-v4-0-8ff8fce3f904@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Dmitry Baryshkov X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4879; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=CTFTmouZYmRT/XjZjK1PSK6/Ti4OEFzaln+Rasgs8So=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqDs9rs//0uISzent47leU0Cz7PuewC6ya3ZgPCKDs 2WDWH9KJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCag7PawAKCRB33NvayMhJ0cveEA CSQZ751E4lrzZ9hdi45ncUrcovP/5omhVdN65qiuk6KAGiQXb24jY/DFK3VGWqxetdPzkOsDpPvU8I SbhA9tX2HNsSy6he2I7raNmoBPqDT7rN1c6gCtkoYLx2LAGfPEHuSUiTTx3N1tVe6XHBmxzS7gYCmJ cw/YbgHCLFFprLjAhrhwnoFCvYoKhKH0Lw1icV89TpButo1kryN2sP151vIzvB/cczPtkYG63NMDHZ +sTAEI5Ery91fOeUcTVQ0uljwph6WAjmN2tK1VVdTsZcKrxTbSo+pwxPXHF9Fxwm80kGCJ8DGfc8QF KLS/odLei3JT6lJYJjfAlFMJ0J9jJnNf11/0SZoKxVmlwriQwNuNBvG9Wpl+j/vxiBHJvn2Pk7WCGU FVeGcsY5COe4I8HZZE9fyhhqo7J5O6YQpf0aKTl9xee4Z0tzyIRy4qdNceaQxwdoPzS/MTjaM+k2mB 0OZ1shooxhBW9xaD+61RXq5qCrkHKbuipEti5mif4NpDNrfWFx4Kqy4ZSR3ADnJuNCckCmiFjN8vnH JC8axg8RiyOPTYTG/0upNfOLX12HhC+vqItI4B6v4TMZvXYxmjIoJTErXzYLfwRVNlS9gcrTx7cKqa tuZvCGNJI+NI6TSAXHl6q0NsCk1vjLc804XDIGVmmWjXWZMyW6qCs+Uj9fJg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Add the necessary bits into the gen2 platforms tables and handlers to allow decoding streams into 10bit pixel formats. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_hfi_gen2.c | 8 +++++--- .../media/platform/qcom/iris/iris_hfi_gen2_response.c | 16 ++++++++++++= +++- drivers/media/platform/qcom/iris/iris_instance.h | 2 ++ drivers/media/platform/qcom/iris/iris_vdec.c | 8 ++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2.c b/drivers/med= ia/platform/qcom/iris/iris_hfi_gen2.c index ce8490d64854..88c338e64e0d 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2.c @@ -31,9 +31,10 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8= 550_dec[] =3D { { .cap_id =3D PROFILE_HEVC, .min =3D V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN, - .max =3D V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE, + .max =3D V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10, .step_or_mask =3D BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN) | - BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE), + BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE) | + BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10), .value =3D V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN, .hfi_id =3D HFI_PROP_PROFILE, .flags =3D CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, @@ -262,7 +263,7 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm= 8550_dec[] =3D { { .cap_id =3D BIT_DEPTH, .min =3D BIT_DEPTH_8, - .max =3D BIT_DEPTH_8, + .max =3D BIT_DEPTH_10, .step_or_mask =3D 1, .value =3D BIT_DEPTH_8, .hfi_id =3D HFI_PROP_LUMA_CHROMA_BIT_DEPTH, @@ -774,6 +775,7 @@ static const u32 sm8550_vdec_output_config_params[] =3D= { HFI_PROP_OPB_ENABLE, HFI_PROP_COLOR_FORMAT, HFI_PROP_LINEAR_STRIDE_SCANLINE, + HFI_PROP_UBWC_STRIDE_SCANLINE, }; =20 static const u32 sm8550_venc_output_config_params[] =3D { diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c b/dr= ivers/media/platform/qcom/iris/iris_hfi_gen2_response.c index aca90aab8548..25162ae71357 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c @@ -542,6 +542,15 @@ static void iris_hfi_gen2_read_input_subcr_params(stru= ct iris_inst *inst) pixmp_ip->width =3D width; pixmp_ip->height =3D height; =20 + if (subsc_params.bit_depth =3D=3D BIT_DEPTH_8 && + pixmp_op->pixelformat !=3D V4L2_PIX_FMT_NV12 && + pixmp_op->pixelformat !=3D V4L2_PIX_FMT_QC08C) + pixmp_op->pixelformat =3D V4L2_PIX_FMT_NV12; + else if (subsc_params.bit_depth =3D=3D BIT_DEPTH_10 && + pixmp_op->pixelformat !=3D V4L2_PIX_FMT_P010 && + pixmp_op->pixelformat !=3D V4L2_PIX_FMT_QC10C) + pixmp_op->pixelformat =3D V4L2_PIX_FMT_P010; + switch (pixmp_op->pixelformat) { case V4L2_PIX_FMT_P010: pixmp_op->width =3D ALIGN(width, 128); @@ -625,7 +634,12 @@ static void iris_hfi_gen2_read_input_subcr_params(stru= ct iris_inst *inst) inst->fw_caps[POC].value =3D subsc_params.pic_order_cnt; inst->fw_caps[TIER].value =3D subsc_params.tier; =20 - if (subsc_params.bit_depth !=3D BIT_DEPTH_8 || + if (subsc_params.bit_depth =3D=3D BIT_DEPTH_8) + inst->fw_caps[BIT_DEPTH].value =3D BIT_DEPTH_8; + else + inst->fw_caps[BIT_DEPTH].value =3D BIT_DEPTH_10; + + if ((subsc_params.bit_depth !=3D BIT_DEPTH_8 && subsc_params.bit_depth != =3D BIT_DEPTH_10) || !(subsc_params.coded_frames & HFI_BITMASK_FRAME_MBS_ONLY_FLAG)) { dev_err(core->dev, "unsupported content, bit depth: %x, pic_struct =3D %= x\n", subsc_params.bit_depth, subsc_params.coded_frames); diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/med= ia/platform/qcom/iris/iris_instance.h index 352af99699dd..672f02b8f8f8 100644 --- a/drivers/media/platform/qcom/iris/iris_instance.h +++ b/drivers/media/platform/qcom/iris/iris_instance.h @@ -27,6 +27,8 @@ enum iris_fmt_type_out { enum iris_fmt_type_cap { IRIS_FMT_NV12, IRIS_FMT_QC08C, + IRIS_FMT_TP10, + IRIS_FMT_QC10C, }; =20 struct iris_fmt { diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/p= latform/qcom/iris/iris_vdec.c index f1366a1865c1..39a02d4e5379 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -76,6 +76,14 @@ static const struct iris_fmt iris_vdec_formats_cap[] =3D= { .pixfmt =3D V4L2_PIX_FMT_QC08C, .type =3D V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, }, + [IRIS_FMT_TP10] =3D { + .pixfmt =3D V4L2_PIX_FMT_P010, + .type =3D V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, + }, + [IRIS_FMT_QC10C] =3D { + .pixfmt =3D V4L2_PIX_FMT_QC10C, + .type =3D V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, + }, }; =20 static const struct iris_fmt * --=20 2.34.1