From nobody Tue Jun 16 07:37:12 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 338202E1F06 for ; Fri, 17 Apr 2026 09:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418672; cv=none; b=LfVUjTdo4eVhS7wegxBCBYQ4gAoGq3BqCSuTP30ub6RzTtq72voDnFunMR82uWwp84hO7SYIyY3xSY3qFz1kuoi3C2U4QbUVGN0krw6dozKblMTMqUq2GK9FdFU9EmaWqQVfYR2B0Vv445OIR9wkXZsAmWRgg3P1TfOPPuIj3z8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418672; c=relaxed/simple; bh=5sMpVnJbX4Wo0wpTQlrFG0+qE1K2lYr004iW/zPD4sM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UIZ9wSQdjrswvlKI+CX8uKR0WgTi3xdrxlUXqnaElafaF/Nov2arW6ZAD6jbRJ0Zw9WSK3PDizYM+uh7v5VGG/a0wuCC8GfYilmal5AzweKJvbz04C3XsjqpnUblFqO6IPZK9+Gu6RU00GjsLjqGhXA4SC2pq5zWHmmCmOPrrDg= 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=rPFm15lj; arc=none smtp.client-ip=209.85.128.49 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="rPFm15lj" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-488ad135063so4679815e9.0 for ; Fri, 17 Apr 2026 02:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776418670; x=1777023470; 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=SdDC0tucHeP1WgDsxGwA3dfuw3FF32FYs5RhFEaWcZg=; b=rPFm15lj/5QjqFkqxchTW+73EAFfDw9u/qZJ6DZkiFnaD5B6Pp00i+GtmYGtWQXNAV uWzMaEHM/fjTvF6eB6uLPM5ZPvlCnT55ivvM5o9R1+poEbmOzUOFWtUJahodGXNpLd68 Fu+xtDcPW3wTlru7l6vp/8GL+KjG0f/9opsWOwMkv2wC+TiODam0xwomE9h6v6AA8AK7 dL/9iAsk0pa6dc6YSHN87PmOQuPn2n+bXC8ZJiD9CXvUsAx50jXrSwe63oT09khQ2hMX l8llom4u0e40vtABPlYXzW6tGdZqvwItGBymbzkOMEmHii7S2XedoII1yjQebIfOfYqY +IeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776418670; x=1777023470; 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=SdDC0tucHeP1WgDsxGwA3dfuw3FF32FYs5RhFEaWcZg=; b=tHp/KoARTxdNtilhGtK/T9yWhU+54yO3PV0ibvoMyF+LtPPGIB0tSApwsfmYy1U19c fN712A+QN8q+tgxw8dzpbNFyfQ2P22usKlnmHyPEdJz0O8fl4LIHJI3BvXpwn4g1PHCl q7jvpDWyLcD4maTV00KmMnZ4CNplZ4PH9F0CtVK/zpn8bXNXql/vdokjpjCghOGAyPMk CHMEepQ3XTa3rUrkgFhNAR3II60RbQ+0nUjdNEhxbTtoy6peuKYbiMPNYUW0+svfVULw eeE4e7Eg+mkHdIMYVqd2y99/pqHfwCsJdKnv7dnUd5oD0F25e7dvsLOMHXVUJTSGtnz9 Bkfw== X-Forwarded-Encrypted: i=1; AFNElJ+HZNRxSrF6K/P0TLDyxamdCEpd2xu+6/pegQq9VaNLojgJJw1uFiFRSRTIxYSoaFiCF86hl2124wocepo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/WxuTbRvmrDiiJGfMqMylqd13YaC/wopIEWfUYeQFp9rqfJfI 0D8PnyyXoB6BYb9n4J9rnxqP/TPW0LkVmJtmtSj7mIdGA3EDrdM509uwmP7Tm26wLTI= X-Gm-Gg: AeBDieuKMVTFObpLgk26W0+z1ZvQM33UEp91j7QAhgqJUpq+a063VjjioQojjrDzyrN yXREmfIHI5AuSLE+EDEHFORiw49i7ZxzScepdaNVW2kdmHoqcNebPG0sZrbV4pSuqkhOm0nFyR4 lpPvvDSRwxci/eUsrbXDg36x1/6Ga4VvkOokjmqdGkLs2z/vcTGDZzb9QO1lH6e3bIKFi7ah6Ss v+HNmUmW7+3NkaC9Ai3YxCztwZYQ28B4cOm4DYxF5NSOtDD00nPK2ERpEevR3rMerp7HuIg5eTA lJdTXXy21qY9c+f9DXrNZ/dX9/0++aR49ZUnmFv/XyQqLU5kPCb9UtdXbS+FoBhOXTnA2MDgig1 nZRiwSbhah68TimjqEZzUdRw/AGQBY6WV2f5Lyr9BceYFCPlWiM7tW0ts3P15x0Bm+YKdGpC6YE yI2IX1beqtLH45du8GzSY7+z7W5Hk+t2FCseHXlapgMlArz2r9QUi92Z8D+Mo5ZF7Nkg== X-Received: by 2002:a05:600c:3411:b0:487:1c2:6a56 with SMTP id 5b1f17b1804b1-488fb74529fmr18448995e9.3.1776418669542; Fri, 17 Apr 2026 02:37:49 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7b2634sm12915435e9.28.2026.04.17.02.37.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 02:37:49 -0700 (PDT) From: Neil Armstrong Date: Fri, 17 Apr 2026 11:37:41 +0200 Subject: [PATCH v2 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: <20260417-topic-sm8x50-iris-10bit-decoding-v2-1-c987b65a31d5@linaro.org> References: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org> In-Reply-To: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@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=1884; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=5sMpVnJbX4Wo0wpTQlrFG0+qE1K2lYr004iW/zPD4sM=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBp4f9pq7EsOKRwmM19h8c7brWZsEhPwCymO40/gR5Z kmUPyM2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCaeH/aQAKCRB33NvayMhJ0R7nEA C9ywtf6EX6voCeoW4IT7BiqXR5GZcWeQoLS7nf1gK1bQYL7XLtOBCc56G9gzfg6OQ+yB9Z0aywsBNx ftPNbF1LLskJQDk5nAiUtb7VIfDKv2luXqPlUCO0RptzSlDwJGjopZKVZkAK2ZtcoFO43MH+FaujTT H1pCeJjLJtELgjI11++3qmqOFuczS8Ws+Zy7iU0hRIhMYpWalEvl5K9wFKvOZTkoMHga1RemzB4emT b7WJN6vNZ4JjdQa2XfS5/C0Z2hl3KXWKYx0v2QolV9Wfk5X9jBJde4n3yJiY5VJUXuVQ/BDB/ngp+w x0WbyJgfIAv3QMAHcbmHkSs8yrPEgZqZl4CB5qnsfdDMGNLPSsguzn71D/PZq8ojbTV0FdYazGv8Xa hEkC78Gv5eFX4M+fSLlkpXvXvUkbe+NvDPdGHQt9u9QmapVt8QqBNi/QtZx+dmhff9Gpd7AalpcDrQ t0Ae7qsx4ouhCOLH/psZhAxirtivv28ewYuaxtJyh5BGxhrwHineDDJdytH8oWVCxF5KmUFtWXAjOC SqeI22qPvsrlCYJvuqJnQ8JkxBpRd+4SAyncNBRTrTyLODthi4dmC2NXc1VFUjj7Ee3adZPNdXLQZv YQwAVZfoCXYFpywp5I0PVbtnC50+g9ns2nSY9qJmQDGsb6Ff8VG0OlZMpz3g== 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. Signed-off-by: Neil Armstrong Reviewed-by: Dikshita Agarwal --- 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 cfc5b576ec56..bdedd6bfa87a 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..35337c5da005 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 Tue Jun 16 07:37:12 2026 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 205C33976A8 for ; Fri, 17 Apr 2026 09:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418674; cv=none; b=QlW2BsNUF44i1E57WvdZulovGNUcW84CfcME4EBZeCiGdjXVxxIn6J8SmG26tG7kCTePMaAs59HmnwfBYJUFzLmftua5Wt/bcKSi/Uy0YPVWIww9bPCwUY6NSlvvdf2giNkOVboR2b+FOH8Xsr48PlATPy8wIKaxmpj2urU+MOs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418674; c=relaxed/simple; bh=d9uRXaLdyFWWRpJT+htD5WetYhp0U6x8tsZUnkHSdQs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=De1SG8MkSo9+9Gh5MMMDVzlrge5Hw4uFP3gs/n06/Ppj4VKuBgzfgHRKytH3cE9M8793reRqDIM/1y0xluSkw//er8selYoEfo1G2RDjHaB9QMl7nyG92B+2cuazpjJuefBX4zsZ+cFrI5g3UMzvyHM6QvPgRnnBeh5mlG5kguA= 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=ysZL/ic8; arc=none smtp.client-ip=209.85.128.41 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="ysZL/ic8" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-488c2690057so4554775e9.0 for ; Fri, 17 Apr 2026 02:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776418670; x=1777023470; 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=qmLWdZEsMa5osbUvm5RbW/e0ymGFNTcUQWqcDHN80mM=; b=ysZL/ic8TxeYq7mgNKyF4SafnjViDxhVtxuxYfY1cl9EBPtFdOpJK49N7yG6/Ix4fk /BwRaM1kcbaaDYMys6rbl2WdC6TLerPrGkMcRaRyWjJ65rioIQNa1Sv7KdAAAUJFvC6n HUDYvBVQnlqKYxHcLQXNOqWRYDcoOKiqYy/JzsoEwjq44RXIpDwjrQhHRXq1hL0Z749j BHx8LP6wy4JqIY+n93K5OxJ1D5JtsseNWCO9M/mphXde7+T/Ma1OpXbxUWk+LKnY7fpc AgqhWqe1+1VPiUutnFdaTrs+8wfRw+EfMJ9ss+0PRu++/+UAkITWCs+sDzpNepBh5i5/ 8jDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776418670; x=1777023470; 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=qmLWdZEsMa5osbUvm5RbW/e0ymGFNTcUQWqcDHN80mM=; b=JZ1KGQ/H+kGurivP1LjH0NahN/blz/9CE5UnWhUWhqMYxOb6P46HqViKiK7yIXSyxG hQJ2/MUMrovvXTzGBXl6ka50m40TsokE8A7pJ+MaqjnMic+1j8aKmrLkYm0XBePmikXs W5nT8sSWJMe8lRimM0pvLXVTzFrWVju4QBCP+heGy19DHi0l0BdFoDvqHC06I0yM7YjP t9ahk6hRy8GT2DQdlrMyLRGl/Y0NFRxN5NYfQyy9C+N6v8WBH6dNBbhGX14nllFb5pBJ iVVQ6F1pmZu/oPvzr2TIjG36tjvEQP7lF0rYoifJPMBNx30Dv8QNwo/R+JewEvYVSk6g B64A== X-Forwarded-Encrypted: i=1; AFNElJ9yeyTbstEYzGc89dR7x2HACL8U09ORCvzRhbXv53v9zCFjOg1+nCU6sCCIrYN57jPkboQhFaVbfir89oI=@vger.kernel.org X-Gm-Message-State: AOJu0YyUKH2xeaX4XKW+moil7RXJ9D10O7UU6BTEO10FRJHRw/M+OB+N sJIUgTrZeL4YMfDrIDfCgLiddTgkCLfrQ3WODq6AGOp0wEDXBWFwSdXAGszQK67P2gv+CTGM7+M /RAZKamU= X-Gm-Gg: AeBDietmzzJyxL4s8pUM82TCvOwYR85lydFnru+yg5tax4NY9U3ejKgSPmsSSOGtWbH lXPPJK1L7tUHBjQasKs65ThvpqXR0pIV3IH3T2A3/Ln0ePHHLI11goXyVLWkaQOLGHeSBerQM+J bmFAbJIiF63E6fyfNvrWrs+w6n1am5yQRZEh5aIkPxJWK70GbBkxgMGDRStdfBgRYWdy74CejPa d4zxPkhLHa/w3RL3n1h6qjReQk6UnSQPY17OhmEkgRFy0bCEM5YOh9mPHC4ovW8DzmIprNaz99g nfYk4pEGpwMJGIvmHUXDGOpZZO6SrBNfVEF/7uGvVG9NIICpyliaXzfvHe+nT9NLjl4EGzo8Uvg a+hH/isEd5Y6GekDEka7NK7l7zQw1+NZbAQ3cz4T5YtCBm5v+dVjNhPZEvdaOKlaQElC2qqHgwe qSc/RDUDzI3uAwonaMnK+1xh59Jx5Mh6oWLTIxMwQnVFbWuw15nrtVMp8= X-Received: by 2002:a05:600c:4e16:b0:488:d6eb:e63a with SMTP id 5b1f17b1804b1-488fb76fe73mr29078455e9.14.1776418670342; Fri, 17 Apr 2026 02:37:50 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7b2634sm12915435e9.28.2026.04.17.02.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 02:37:50 -0700 (PDT) From: Neil Armstrong Date: Fri, 17 Apr 2026 11:37:42 +0200 Subject: [PATCH v2 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: <20260417-topic-sm8x50-iris-10bit-decoding-v2-2-c987b65a31d5@linaro.org> References: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org> In-Reply-To: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@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=10187; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=d9uRXaLdyFWWRpJT+htD5WetYhp0U6x8tsZUnkHSdQs=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBp4f9pHBx8Vw9i0s7t+/VLzm4eYh+19POBDWexlvOt Kx1zfCOJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCaeH/aQAKCRB33NvayMhJ0cVYEA CbJvjDCxf7JY4BYG8MFnbuHwDIzAecFeHZK3iqNgYDis1JNLzVEhDTSrqwxREAK9lk4IVhJ2NGvHZY caLZSbINxiap/PBD25gz1BE28oNWDjd5cQJzFXZ039AqCLqNWiyMWwBNFSobfyFyTLEullAvmhRrQe zqQYPGWioUWlPWtkNWLiTfcgSmUMTYhVshVO2+aJp/S3/ZfpSG5pnOZMZoxY9xOjvw/B6Bmtan7Zau AvipzaaH7BUrkL+8Htqr7xOS7DwYHoXOQADyBZqUR28WeQsu0dwD1DJVwNAt8RTN1esTuRDyWILC0A N2QcqTJZp5bMxi4l2Vbb14tX7dUWpx+5prEOBmirCtJeLV0WLr4ta0UaA+ERhz/kZNyQrD48BbTa3e zKdTK/uBJVtHlh+MKRaOsKXDOT32sxS6dpGSrQ/2Ax0Nnf9jgdum25X4ZJCbFhQ72LEqxZ5ZrvREU7 F22SePp3OjD7SYDN1/gSqyf43HYHHbLPhznus9bp5T5QTuLNX0n9E2E+Q9rKHf31h+BhzIwxhboJl4 4VxG4UjX09SI/mk5isEHBoJaOBtLckDHnf89jAFbcoXscIPAaALeun6x5V6wIBrJsVX6GYLrU/+of6 gag5/jMQ57ZnTv2l2mUTdrspNx7tHst0QspBOIbhMRDv4FuLlpKcVH9qVVQA== 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 DPB 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 9151f43bc6b9..23a3e9a9c383 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 =3D NULL; + + 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) / 2, 24), + META_STRIDE_ALIGNED); + uv_meta_plane =3D uv_meta_stride * + ALIGN(DIV_ROUND_UP((f->fmt.pix_mp.height + 1) / 2, 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) / 2, UV_S= CANLINE_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 Tue Jun 16 07:37:12 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 B38F23AE6EB for ; Fri, 17 Apr 2026 09:37:52 +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=1776418674; cv=none; b=M906GhbW2Liv/zX6vwrIoE6T6UzRYAAuWHb2HVarBXcvEBZ8SasR15EGjGWiIJJCnt1HJdnYwcDmFpLJv197luVvNqfX5Y0MeayYHjVHVbX/RzUddAThYjphPqiyNetc6VGD8zFGHsIm1gjZy9FhTEmCSEvQe/z6ozVdivJpN2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418674; c=relaxed/simple; bh=vUdFYSgnBSzZgk95HkEcJ1yBIuWlbgrBUX6/E7cKxlo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DeupSTjy1l11cJ7RED3bLr9OjlgmikUd87FLiOPgrMz970o+9j9+QzZHaoUswuhXfUQjISZcJjef4DvdhV/Or7ocpONVKMuNEfH485j2XDFiSERYBAVQYAfnVch2K7koslwGmTevrv2vE/jZEIcKc3mqXE23A9DpOHPERrVx9k0= 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=g9KlAUsS; 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="g9KlAUsS" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-488a4bc360bso2747195e9.0 for ; Fri, 17 Apr 2026 02:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776418671; x=1777023471; 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=WDbXOBlWoAeeu3uACVssb9h5dacPl/RzVtWw9N7wjaM=; b=g9KlAUsSLDGNi3Ws0i7tAPRAkWWylpXlfaN9mjKI3+q4RwhibovsCok8j0klOVBl/W EbPOW/U2GoKAa7Ieu9GF5MGiC89Vr2lycQ2OASbTsHD3WamygaORWLe2HdiWUtB7jHuh WSp3t6O1Oq2J3UlNeULGcKxUYNjCfl1owDo4yhiQT57/ZCj63QG4exXCXLu1DJM/ZuPK xNHLY1qmPXxvkbOUv74GJzJCjxSdE4oe0tMYII0FgK28lVuC6IbVlbuGCRtRpYTQLTNo q0i11F9cbcAVO74Ze7XNLJEae6vrd/J7BlU+9jjgMvOBurKh+k3dwvfXw97MuKVY99VS rYtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776418671; x=1777023471; 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=WDbXOBlWoAeeu3uACVssb9h5dacPl/RzVtWw9N7wjaM=; b=Xh0Kp9v2eQkjsM/LMJDNWb6T/A5KHmYShs2FYz70KbuaEnRe9XaedvC7+oFw5VFLQg b+jidInSwz8kJNBjSxJtT9jNz0KNuBXnIKWPKH9aAUwNuUe58RAXgLvnWTuDqTYTezpA UXPL77zTzGFEPBYDvYEQYFYplKx041EnhEx11gKB5KacnIf7O2J86kw+ZqjQ+pgudaeq g0nGScdt9ppoeQiodwEEk+o/z7E1SsOWEStGuicI7/kILi41da1DLTUvml+4srWik3Mm G8ZECQfl1kxLpka6jgcGy2b/vswB/YkgSp1XYxFBjAczZ4FBFRjXvUZZXU2AsVrAiwcl XaDg== X-Forwarded-Encrypted: i=1; AFNElJ/qlJ8c5ABLgrlwqB+qa/xAdCbp4KfdFn/xjGKjC7FI0CWVuNoLP1UDvjmdNmGdG6qEUrhfGiFaJNkmY1I=@vger.kernel.org X-Gm-Message-State: AOJu0YwsU3bRn/Ng0OhakJIebfjC7am+8M4UYaGn4jJ9rD98Z+L8Lda/ hvizp2s240aiVhA+poIUTW3LzWxYwz4sghOsI4leBEQGLyJw+MhKzA2GeEzfGiEP0Kc= X-Gm-Gg: AeBDiety3HY4QltMbozfYy3bKhU5RcMni9tbXV1+9NkYqkDs9YvocBUj0gvdQyEN3BI NGDvpWSL5VVTwwwz933PGzZtAyniNWXAapR4V5xvE4CXX7H19YwH23Bdd5Qx0HSLatF0SzAllGk 13eBe+S5TCpC7jNMAEyLtKRFSacKzCCtqzgxN9ZAqHkcNv8NNb3HxrYTbPaWUo6SmsgVIRTwOfN 21On2fj2tNyWyRZWAppN5GiNRp4k/rH1LZV7tnxFP6Kx5iZUaxUwYw1Ntezky6ZZs2tyx4uiwhK 8IxzvJfV/t5WQiGPkINQzhXAop0tgfjWtEHVzNxKcnyKKJ/dwxKQDpPROMdsy3Or3rPTGYbUTjj tsBFYnp/hwXfyVrcBl7uKC5rI5B1dY9V+WtIiPBXAPonHO1LEF9jNNTxiRkcZZqUPI3eHn8Pl89 Np2CeACPdo9V0vEbyDzRTM4fEoYijnGGAQDeL+5l4oaH/wxytS7nm0420= X-Received: by 2002:a05:600c:3513:b0:488:a977:8de with SMTP id 5b1f17b1804b1-488fb77a3a7mr27141775e9.16.1776418671041; Fri, 17 Apr 2026 02:37:51 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7b2634sm12915435e9.28.2026.04.17.02.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 02:37:50 -0700 (PDT) From: Neil Armstrong Date: Fri, 17 Apr 2026 11:37:43 +0200 Subject: [PATCH v2 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: <20260417-topic-sm8x50-iris-10bit-decoding-v2-3-c987b65a31d5@linaro.org> References: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org> In-Reply-To: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@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=6219; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=vUdFYSgnBSzZgk95HkEcJ1yBIuWlbgrBUX6/E7cKxlo=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBp4f9qPEZNzp8pS+zT5//LmokfgsXW8PhYSXhAu2zO otwm8MyJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCaeH/agAKCRB33NvayMhJ0YccD/ 0bGHzr6Z1ikdT6xxRrQfdd2gf0IJRC7MD2Urjf1LLXDKdPpTZNF3n2WW5sW5Gp2/cYqznChEB8y6al UHiMh0RT7uXBxoM6zzlglkcJ7scc9zsU8QL+HRWeb0hwdPrTgjVdICTJACv3cSznSHZqADTutJTTzK qTFECx8j+86RXphU9TCI+e9MkOm6gYNXqhuCzZrxSiy0wbsJI7qHPhat1hWW3roH0lqKvPjuyI3zjr SjU72rcjj08lc14hvMXznDluuxVYrPqJG2m1tIWvXvweLSPqIHyVz/AR5b63myNvzKpiv0LlgdNWTC 3wqUxMQrQAyeXOAH3AbAOQLCqmXmNi7xZ4loQLtfuw5u0t8wPLXZxGFaiWNVg4DNDgQPUj75GDXU26 NEof05ZzJ5UH2jecsAe9es+opmSYHJ8m98uJMB7mzDMw2Ag8b/oG3HPdxQCPj8kdiJP7SUYpbxuUG2 IC47dHZ8raJWeUNFJDDqAtdrei6aSsLSOTTznfTUo2qaWP+MEt/0TZUhRDt4qeAaw3wub4crzSR3xt C5Jy9q10XMvbysIdLR2Qy4jnjhGdhQGNDL8DoBI9tb5bXg/rA5budsaptELtWYqz0EAn9OGyAg8xuu 1M7u46GPAf+/1hYF0F+01d6ufIu+PxrGBXS7DBhQUfM5Arc6Iz+JD1zPPTEQ== 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. Signed-off-by: Neil Armstrong --- .../platform/qcom/iris/iris_hfi_gen2_command.c | 71 ++++++++++++++++++= +++- .../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 + drivers/media/platform/qcom/iris/iris_utils.c | 4 +- 3 files changed, 72 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 30bfd90d423b..d664e606e886 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,57 @@ 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]; + + 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 +684,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 bdedd6bfa87a..c75dcb8e671e 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 Tue Jun 16 07:37:12 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 BDEAB34A786 for ; Fri, 17 Apr 2026 09:37:53 +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=1776418676; cv=none; b=Cgjd+NgS8Sflg5KydLqhfMsWexWJm3TDnJJi/U3+2Rnor4iqroh/rg0Fkxza1GgcWzjmtO6IFEU+wAoI22zr7PVTih4SeJDVM/Ww7hAmfJQxSYfIvu1OGPg7JMh4O+1ai9b0kf4r6ce1AtQICQxCcNpKe9Apz/z70O+/LVhrcGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418676; c=relaxed/simple; bh=vYjJMDeVg4k6fo70v4ABD1udotMHtah4iQLNpwwmOk4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=grPFsPEmZY7f3XtUWnNddS4p5sbKcLQNKIYU9urPc+Y9GCVwCotiKfwJGCedzPn7QE6Iqc2lbETpdSuMbpo6tEiEfxQjbWtZmVQVhPORoaWrMT47j65YUDEvfnEtV3f/qH12b9D633KflmXDc2fE4lKzO/VyTmm8QGK+TUWSQS4= 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=GXRBSbYY; 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="GXRBSbYY" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-488ad135063so4680195e9.0 for ; Fri, 17 Apr 2026 02:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776418672; x=1777023472; 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=+/dGPO0kAxWU1/3ix/1Osc2H8ffG2NBMmISaalGLB2w=; b=GXRBSbYYEYSrTiuJwqjTpruZz11QAi5nLafjLSYpwMlBkjVMGFQWEBz3bL1I8fyYI0 FmsbUaxHB/C9Bx93bO/n1eRzuPdL4z2MtUfseGOTMSn0IFbwxRwTGdUKt0sLarmR5DRF aVu1/gBiXQYlrjeoN7fMvGgibG6hdEuPGLcN9KPwOk7tcv7paAHyEiLRL3L/JrL9ZtnI vBWyt7t3PvhtH4MgElIz88qbbYHq1cH6mXerQkpHSA8+Yi4iLD/wuPlODxQ12iFo+MBP ezhvGJhJQj0paYAlI+7EkJl8des/Hhhfg9+7eQEuF8cHbvSC4oVhNa53LrGdlJlLuNln O5vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776418672; x=1777023472; 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=+/dGPO0kAxWU1/3ix/1Osc2H8ffG2NBMmISaalGLB2w=; b=DQSOQH/tF8Zp392sW5Kf/BQD8VZsdXYVPcOLA0+BYrZwuAhXiTr+UHuFdxkDjZh8uy o19M+JISLFnIWzUi+r8Mb39t36bXU06RTZhRB5MrbSLLVonFegNW7fFnTx7YEnWZyQeS 6Hme8jZMcpCPcckS5/zSfBBQAo5mpOBBbWBAZgbHuqQ43AvQqUR+0U46yc4sZw/6UiEC apzaXtdlax233la6tfHkiwZg7czyvjNUxEyu4gsL7NUaYKS/pB1hl/CIfJ632Ra9vlQP SGR7IVQ9XiYwngCGpYSCTU0u02An2yRIjoiutAtqSQggRjCezyueAlc8tWPE6+YYLjaS Lfpw== X-Forwarded-Encrypted: i=1; AFNElJ9jBwR9M++zhuWRuVby2/Dynw5FXT08j2cYtVJnw2oscG0scWg2JpLhVa240ssq6+EZG/7W0RPDcIC4RDw=@vger.kernel.org X-Gm-Message-State: AOJu0YzcJLhVDYUI/u7Y0IWJoT1Yzgqfcr3Y4F8HO+YQehb8CYkLhvAv MBD13vT7FW6VNr8iNRT7WyonZRDR2H1tP0WqQJHQokgMAmUTrACM3qQI/H1AIn8hA4E= X-Gm-Gg: AeBDiet8HYun4rDNkwLR4ZnL0cT7S9KJhBo4L+fW/QIdICR8xGWHNYcVYRThEo9EpiB MwZsbiJTxVE/iL/lzVgjuJK5cTL3yJtxRmJL/CilgNjroWGIP1dR5OTm+hKOhY35SE91OmTPQgf 3ogwAExMujbt66BtnkZrbQ961Ojon0yH1NJ1cJvJ7xlhUGFMJYn3uAiCd4eTMOZt6SwHZljk8ab /Fl0U9yaTRS9vrxdddgMkW5Cb3PueF6Ft1eDeOnUsCkOd36uauAv1PPSzKcAMjhnyyr1XURyEBI FfUrYBwnK2Z/JIE3ArPVNJouZcrla4NcaAob0gnuoXw7t7HyH2kb2Rk3SLtiHGD4/T/D300Uza4 4XwqOCHlKeSg0p/4oRz1hgo6yEM2Il5A3WEfg/x8rLeqds5c60GhiplllHgVC42R+ihy2tUv0Jr mGIpiOW7rvfUeS8SqN7I9aafVRomJUR5BW1QMR2N2/Hc8oEN2Qa0PtQlw= X-Received: by 2002:a05:600c:8183:b0:486:fe39:28b7 with SMTP id 5b1f17b1804b1-488fb752e3cmr26432275e9.9.1776418672054; Fri, 17 Apr 2026 02:37:52 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7b2634sm12915435e9.28.2026.04.17.02.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 02:37:51 -0700 (PDT) From: Neil Armstrong Date: Fri, 17 Apr 2026 11:37:44 +0200 Subject: [PATCH v2 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: <20260417-topic-sm8x50-iris-10bit-decoding-v2-4-c987b65a31d5@linaro.org> References: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org> In-Reply-To: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@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=3607; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=vYjJMDeVg4k6fo70v4ABD1udotMHtah4iQLNpwwmOk4=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBp4f9qHQh9uuMQ+tI0lky+eapxI+LIuRRk+JQavqgB tmu7XMuJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCaeH/agAKCRB33NvayMhJ0fMeEA C9bAkvPeznT9/pbzj5ETL3cuHdqOaSSVUVTBmg8NF0WEQqbrnT/O6J9jGp3HqIulQdzPY762hyjO+S 7+wlgzB/kq8pVpbLWThGmjzF7/I+py3SmYfNPFN65wxnCpYU2Q0wofLdopwyRpaw20NQxJeVwPgbAb AB/YqKjIY0oznudse94P0HCxNWpBaKtGqAykGV8yqUY0t6C/OEUYevIbU2qMV0oOQuOYh9EXgAySZC jQQqavIyNimjeGzJxfg1ih2RuMn60vBlDuKjdUVDqxr2iYyIw2o964Gqd60z2ccqJA8Dp9cPTGJaeO LoDm2PseveNw9zn18fVVqYj87Xjn43q+6a4eQXNm4xyw7AYWT4eFiA272oYc96KrPcKoq+0CappLCR pgY+Bl0oM6P3bZ+1AggKX4BDcA5o/OY4jDu+xLHM/cIHu3ZqukJANhJNxsQ8sWBbPQL6v/GS9GD2Mq lXpZC+c2BM8n58iSNPM+bssXfELsOOjtd6rGtul70sjdT6ux6ZzjyQX/O+OZeUkxb2sWREcqCZBg0O GJJf4zohPnELVSer5ZAsNzbVaQiVFmWqtiEHKDZwxQAml/DAUT4C8FXGy2jJcnKQ1sS9zp9OhMRk5c 9TrsAg0v9lxTSjPLSjugEPq2qS/0ah0R44uJ1njZXW5TRSl2O0L8dpLSQBTw== 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. 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 8e19f61bbbf9..0541e02d7507 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 719217399a30..32cb75757f2e 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 Tue Jun 16 07:37:12 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 A01E83B47EC for ; Fri, 17 Apr 2026 09:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418676; cv=none; b=YVgARixgxSFtgVLv3Pru7MHfUItEgZrzRBlWDirvlzey0WrfNJZpAblMkMvZHQBB+bPkjpBWLmL2KScxE1zb66GhGIeHGfnHbqTqNVL9JT4KehZBXlpM4AfENRUGghEy5AK/TDyuXE6MRjhyRoTQ+1wPo2kCtsh9jUh2XVJPSFk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418676; c=relaxed/simple; bh=tK9kidjyUePjkt2XPWz0LurMs4Gb/ujh22R0YE1LBJw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aR2y1fXpB+P5bY+GGRIDCuBCZoth4Y+wDtAgzoushrR1gWLra54zHFts+bfb3OusrUGMxxCFCmuBx7ACIjLhbs+BeI+GjNL8CglpkCq2Tamf6i92OPfrOqnSkG+jHdj0z0jRtCLnL/y850Y5vPZ1ozYFc7Th5OlVb35jQSNCnao= 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=hKn47pmP; arc=none smtp.client-ip=209.85.128.49 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="hKn47pmP" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-48374014a77so5785185e9.3 for ; Fri, 17 Apr 2026 02:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776418673; x=1777023473; 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=9TOp9gQOdq82VI4oe3G6KbPjn6R3y1zFltcXTzoUHVU=; b=hKn47pmP5ApVUHbDxlaqiKPFWjlLxnpQbvhh/bA94tFfjVYFH8TB3Eid7CXmLj4kBi Ehk/DwFt9t8vHJAN2wJKZt2xv7ypAD2gkpN/5MUojarioDhOEJVH3cjuo5uoaC566+ek z01AXksYQLPpKEotvQUNAWADaWhXp8a0GTi0EhMmpPNfdvRcZOE2mcU25jPGxjkyXmW3 VM2RQrsAhEJrLhJZIXPw+0xHukvnGDj1RYxXneOvONDnDqNea/SlXfVmbG/VJUxz/JBk qYxLAaCoQC+ZJTeqyBNGnII+jo0P8Et/s08fawVs94IAqoIbSDH6eRqGUezbSGQBCFoC +6Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776418673; x=1777023473; 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=9TOp9gQOdq82VI4oe3G6KbPjn6R3y1zFltcXTzoUHVU=; b=menlLEz2bPKy0zi/4wu2+e1CRXzRflaGtznV/d6d4jFcPbw7uSGgnAv4gA+hIepdHI h4bhvJaC6aSO29nGeNNmvKvtH+9xpK2gPmkK/5FBJzqa3unMURivPmNKipuECvl5X5lF 40aHdR05UkKFMViHXobIjvVTQ7Y6h1hPDEk3cgvSY4sWv7omwASo1+DLhwefFU6hz1rR WQhZU/HNiKtYyKHBeE6IRjwD0flVs6q4yggDQwbgg3pJVYgaJgb1XjbcRN27AZAx3qUO un109DE65oEerHzkCD9VFWbrAwxSOg9govBpo6G7JFFWdLgmcQ5GnsYajUPmkgnC/kFU Zexg== X-Forwarded-Encrypted: i=1; AFNElJ/W0jTO/R6pRSMvzx5vFe+IeCg7U2uuG3oWCdj0WmOpGP7tJOJjcYPac8Q267LOKCdK9NTz2JYZBTIdHx8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1AMnFembFebvAjlolAAjf6fgXulNLxx0D6xDP0+poMvC+/vnn oZ4XJlySNvEWIdezACj5assk3TUS4mTdm0Eznd1gCtok6L9HVLjM1trN9RPu7Y3Mg1c= X-Gm-Gg: AeBDievwE+mybAZeKrL0VL3kjh+sj/J/hUCnOrlR/SYtAEAHZ3SgKARv4ypq+y4p2OU vfkMyWnqwV5L2JBufM5ythdpxT54UxNy2KvT4gXz8PQxCEAUFnRqmKekhupQ8JzD6bAB34bJWKr Exm/UZnYRtDunuelr/UXFhI3jVD4phiQyqCOBgwtx19Optkd4h6wkj8fDQJJ3CVdjkmxpGr/0Eh RN0+QhwBo6LI9ExtKx0ZN0Rf0888JV0pUFikEpsPZBiQyCSfFZ8NC+zPq3Po1oHlQ/5GNbI8B30 tyk+5x0v/nTYN6u6tGnvlA8QQWlpwn+GiOvZj0B3VKnbNT37knPCdc4G3YbNtpe8sC2/PGxL4zW BXoNFlc/6HHR8hFHFWmwtHwwPDRYsFfLY2BNC1FWuRDKW75vllXqahYe8ThmYgA4fvnYC7s80Jp DVxNPyTBTqfvE4xrAcEnXSrR/IVZGQzcWsbBYVZsJ6jacPYbzZQMphUjE= X-Received: by 2002:a05:600c:a309:b0:487:cd8:4c9 with SMTP id 5b1f17b1804b1-488fb78a4d1mr17953235e9.27.1776418672878; Fri, 17 Apr 2026 02:37:52 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7b2634sm12915435e9.28.2026.04.17.02.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 02:37:52 -0700 (PDT) From: Neil Armstrong Date: Fri, 17 Apr 2026 11:37:45 +0200 Subject: [PATCH v2 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: <20260417-topic-sm8x50-iris-10bit-decoding-v2-5-c987b65a31d5@linaro.org> References: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org> In-Reply-To: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@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=1868; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=tK9kidjyUePjkt2XPWz0LurMs4Gb/ujh22R0YE1LBJw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBp4f9qQRvg2bjcxW/lnpfPet7WxhN+voL237r+ut4u yYJs5MCJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCaeH/agAKCRB33NvayMhJ0aQHD/ 9Mt0ZeI+lS809cX7PEoebxSr/Nw8Y6cqlQG0+SQsi/63oVAqyCZxYus8UbwrDfrGsZqCb72+pVaJrb 0jWsffvub6DgiOKKzYODhphHH5ArXVP2L10bYdC3EkQLtmvO1rbRMIQS3SNKCt8pYIaRshbWrW96uZ WYburfEw5vugM5KYQjWny95dfBjDhM4EHrnpG+EIGApLmr+E6LBvy3aOqF1auHv8NylXIqXmmmSmIl msoI6yTQ7vMzG3NUerl4TTm6F4QKJUULGkRteSmqISfdtEwZamPtg36wcC2ua/TtWWtRXfdTN2bEQT 9eAE9zZuPBfbCD/QKPs7HjOC9WoSPV6HGDGR4Rl925G8FMkChFGNKzaabS7/ELtUn6WUeRINhHIRbb UPlr4MfRP5KEdCuCEzXfKNc3BNJXYOeU99svHvqZlIkzhqM3FV1Wbia4VzNmSC2KgfVhaLNTTPRaXn 2HMDIX+MOTCUUpRw/qS5yweQS4JpArlS4kcQ4X/qEI1Q38SHLaKDlxSXecRyz54ghj9Dqgrhs7ICy1 vAZQiBIYhLcWbXVWqVne9aDlUYXX9sQuCKekBRH7nliZkmfZI8WE5Jfgv4jeN/FzDb0e1DrC8T+oBY qhHVouK3h0TsQywrUY5XUl1j4j8OHs3HQJ91RMcClw0lhJjdZFtVnFK2+fyA== 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. 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 5a489917580e..cd3509da4b75 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -18,6 +18,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 32cb75757f2e..55c4acf1aba3 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 Tue Jun 16 07:37:12 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 6EA8D3B52EA for ; Fri, 17 Apr 2026 09:37:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418678; cv=none; b=OSskMb3ueGZwDQ/+AvhIPNO4Q11r+sjKMivSWZMcy0QcxVN7/4ZvYa2eg5+pjDLa/QtpnehO3rSRpLisl/HnRPVf1kJuV3L3mZ8hxXYEg2mBUXk4TSyfGfN+bDH+t2mAolnAMOPrBn76fJnHWeVJn2An1bQKqnnfb4sP8L4iw2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776418678; c=relaxed/simple; bh=bs5ckZUuvVRSX4pNz+txZhVzs8ilhLU/N0vuJgwX+RA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MAss5LDYqlORY245esBBilZIyTQz+dEw7K4eTYgYuhhWwZ0Qltw1zlo+EvwR0Ey+D47Ms0h5gQ7xH/YkC/nnrBCvnHXS04TVSYkn0ODpnOE1x4oUhHhnY0f6r+ZvRQ0Cba7BqiTW+YEkrfNl/9ZID0aK8A+eri08MIbOpd7uW1M= 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=rDCfGnls; arc=none smtp.client-ip=209.85.128.50 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="rDCfGnls" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-482f454be5bso15244395e9.0 for ; Fri, 17 Apr 2026 02:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776418674; x=1777023474; 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=7Ldf1uFdSDfjOItd4Grh+k9eom0LIMtCneVMq6WQ2gY=; b=rDCfGnlsM6tXIXE1Y7MXHs46NG9zyrn2KJ0+h9CSJWTSOvUwmoTqEd2exP3iJkg40r t5f+9Ow7IFnUsF7PUBlGZR8dQckFdykBnYrv19Y6G/wRXolyzbS+Z0frh/3hJmAla1xY DPRqt+umrPFDuFgj1Nj7nxo24GZdKUWwNLF+ZM2t5qAvJ8euaTYpR6I5B0y2L6TLuF9v wkHXnOl3c4PJEYpkZcStVyHRZt1p9YbydvI+yjQJGY3lbZqxfkhRClENOWvixX3o7IEc 5nULIYI/iHHtfaWoKmElLdnAb0ZasJW08YJ4q0hKS7RGVIKM5G+kH3wiuzVHY7+Yklqq Vymg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776418674; x=1777023474; 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=7Ldf1uFdSDfjOItd4Grh+k9eom0LIMtCneVMq6WQ2gY=; b=jeQV8B6yn5LOJiXqTI5ntPP/kniI2ds+yKu9mgWjJrPg5WLUfUp0Fa3bdQiKZZlZOK N/LyvVPeXem5RvoofqyMSBPtHCnzcS3MekOSbhn83bB6wR99UG3CY6hO3YuLFfZBRJbI go2elMK0umuJyLkLUrd5k+HOoXiJlIEAunlUJ4kBm2pPGo5b1R5VGFS5fS19RMx7QGRs WOd/NVIQrlXYv1d4/ylMB7f/0mQ1NaV2pn+jIn2TvvCYxrpZkGmvHs7PIaBAsXyxHg2b 6oNvCLEaa2EvvI8PMcXfcZsbrU5nRg9uo2NmXR4DiIpmuAvhR9D6qsUXCb1W6kW+Gopk YJUg== X-Forwarded-Encrypted: i=1; AFNElJ+Jvz/rIshtWVl0cU1NPBJ8RwiVlKemPUfuHkzQuE6cFgo6OCdIZ2/ADSclWRJQIU1C5bDWYK/Xk1YBmk8=@vger.kernel.org X-Gm-Message-State: AOJu0YzaNrxHKSA9fNqBbsAa7VUqpWOI8cVxz2n3v0yqZPrKtxslibvY xV8Zx0/sZ/9CnGDegiBVVcNKF29rPNtJFwygRDBxRn4JBzLoCHIJqA4eieXYAt3jOW4= X-Gm-Gg: AeBDievQY3Eb5e/y3bvWgabbemjj3AsdmL7iASAmOoqpxY90hV83zKRapBJIPQNqE/H HoCtxVDXLzSzE2Ps3M3HJca1wjUCE0VGgMvzfcdqAwXLsX3riezoYmkCLokMnfbO1SibBpyP6LK H640Zz1KDO6IL/MbKe+OlFm3zytixZgYQYLHx7479EruBV6hy3FTOV/mo4mrCYoNYB5on0Q33Uq s/3ukfIiuLDN4mPKrB+F7gvpazjOw+Or7hGzrOCNyQVFgqPqFUiixJ7nF1VAnix7Ql6u2b+j+rf +vSHvQu2eTa/er9oEldUHbMlNKLREXR7chKaGNtzoYb/Ri8o49KXqz4CKppDRzUcWBgsxVWzKq4 zM33rDIhuPM46CvzVnvKeaYSMjlaoCSwO3C2iWjCL9eLamMAenWRAXgTSbS4yWRE0ftOctinTO3 uEA8e6mVg2PubhIOyH3XUVO2Qju2za/Bqw07fd+nqtCkrEIJywB2xeYlI= X-Received: by 2002:a05:600d:9:b0:488:9c3b:ff40 with SMTP id 5b1f17b1804b1-488fb8bdfa8mr19282995e9.15.1776418673597; Fri, 17 Apr 2026 02:37:53 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb7b2634sm12915435e9.28.2026.04.17.02.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 02:37:53 -0700 (PDT) From: Neil Armstrong Date: Fri, 17 Apr 2026 11:37:46 +0200 Subject: [PATCH v2 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: <20260417-topic-sm8x50-iris-10bit-decoding-v2-6-c987b65a31d5@linaro.org> References: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org> In-Reply-To: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@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=4832; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=bs5ckZUuvVRSX4pNz+txZhVzs8ilhLU/N0vuJgwX+RA=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBp4f9rlYbfmqCkAGC+AVMVk4EjRNhTcvjja1fbYFTl r0xV5IKJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCaeH/awAKCRB33NvayMhJ0e1JD/ 9wiGObAass/w6jSe/1X5i4slOC21Hsftse82GdPjH0VbgRl7q+izjBKt3sWV+1hCsP173bROHyx9/u +V6/pmIbznVdsQTBiNAH6He7A7L2TJsLp4Qvbxb/oqih/rA6ofnbY6u6V6WJdz+r6rVNkO0p+f4YUL AD6FgHSYZrJMayzsaFJjU8ZHMLbIrQ/BXdKYt/qack7CwfpYCloCn7dnGxQttQwpG+I3bwur1o3gwk TfWmbeuuEWYqrxt6r9q9MPVFbVS7uH/0of3R6GHQ57H15yNozHsgpZpFcmw80dEgarl5CSANkHDnkl rJbzmP0cZqbaBrNe+rMe/h6AFsmGnXM/TjpxUd1b7eDkEWeFyLbtgWNMkMuUSPiHtz9E77ifl5e4/o vjnNmrbWKc/v9vZ3dU/OUZkynDJSqqV5wBq6VTgB+wpV97Xn+mGZRsanTYpdrCwFovTULn643wbGku mKZ2N0XTn5DKet88MB3hP7jxnR/wp8deSMl8WBThiZm+AAzO09yvO0akdw+cqClT7Orpt+KFCZZA/Q U5Lbb9hKDmQg/QhWUb/J6Tkp8SdORVvxCXfoK8IPnX4EzpNeAb/1uFemd/2bVeWKzaTgsQeFefHVrS L99Pp3zbZFTpx+bmDuBmdhp9CL6VfjxYa8YWGSs9VdPQNJ6ERjCBINxmiHcQ== 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. Signed-off-by: Neil Armstrong --- .../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_platform_gen2.c | 8 +++++--- 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_response.c b/dr= ivers/media/platform/qcom/iris/iris_hfi_gen2_response.c index 0541e02d7507..b6d815c01f1d 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 16965150f427..16424d1e94a6 100644 --- a/drivers/media/platform/qcom/iris/iris_instance.h +++ b/drivers/media/platform/qcom/iris/iris_instance.h @@ -25,6 +25,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_platform_gen2.c b/driver= s/media/platform/qcom/iris/iris_platform_gen2.c index 5da90d47f9c6..ceed4b5d96ca 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c @@ -56,9 +56,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, @@ -287,7 +288,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, @@ -866,6 +867,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_vdec.c b/drivers/media/p= latform/qcom/iris/iris_vdec.c index 55c4acf1aba3..3b18bb9bb71f 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