From nobody Mon Jun 8 04:25:17 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 A2B3C2874E3 for ; Tue, 2 Jun 2026 08:39:23 +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=1780389567; cv=none; b=RbkH4iD54S9THQ9aw9IprXocU//xpK1Hx9pFplCgz4uWKYyG7z5gPnYqltfVSpkHfvuliVCl9WSGTwnq0L88IbMTzZnGNw+YLRyRDQc3Dbl8idetR2UNK+WiMIehWW7/mJo2PjVvIGfQc6BxhXmO+2wFUzqR5Rq8psfr+IqAXl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389567; c=relaxed/simple; bh=8QQGtfLgtdUXMNRLEDAdD0G9n8EM0L6VfE19GU/xjBk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=W9euu0yFsYwWIdf2FwUVRbBLpdscwh4gXr8KY2QtQxfmUbx5SeM3vY9HFEqFMW3MjLO67mEAcq+yBfgMWSjZ6K8hZ2bTpepDI20zZb2cN+Hb+2f/7lSUmXdoQNfFxtplKHYbcj4ACeTYDMqMDhu59nS8T0c7HKoTMQhMTqhf8zU= 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=No1riZtV; 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="No1riZtV" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-490388fd0dbso111483485e9.0 for ; Tue, 02 Jun 2026 01:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780389562; x=1780994362; 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=OWyzGB/0xUFPPIwYqt4ljUuRWgwAyuAeLbCuIJBQLG8=; b=No1riZtVXJ7D596fdUI0A0EgLIupFBbe0OykNgis+/0Qrz+j5i84VW7lhFZQ3m9pK1 +5/2CCKxOMtbT7xa5GKb1CgGD0Xxu4jQuolR9nTHFpneE1pNuTzSjnSALJa5r3j+hcjX 7m+M+ChodY7t30D9jBhO6Figwx7/uepfmOxcBhP28rXDFFQt/pHal/NBM77pNAmvjpCQ 0iC8mjS7CgH4t/SSxSwZJS13e0NFvq7aEOQYynbQoANSaeULKU1a9ltXlA9/EQpQRwFw 7IGkNae/tX1LbZgpy/yG4iinAWOm6F4hy5FRt7RGM/vd21sIJnzRHbq6arTUiuzJ6fX0 +Ipg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389562; x=1780994362; 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=OWyzGB/0xUFPPIwYqt4ljUuRWgwAyuAeLbCuIJBQLG8=; b=lr43qv84hr6/mIvUGilg5BTJgxX2vd5WsZFAfhgwr+k8TzMZYpZgD30E4jH1nxAdXU HqBzn4Kmc9NaYzeon4KHVpDIGDK1f53iT1YHwkVABTxtdmMRXlveQGo0DzPc75kQPwdO ABIiYCne0n9Zq95JgzU7QbizBF982CQ5BKIWDR92B/4mf7fmEHl0WOeI7OBfdIwvpcPW AHxL0EZcQnP/Q/D4/fzScK0O0Qxq4lZFYh32rZRjk+R0yichGu7LkXSVghi1be7ZNXUu 4m5HF/bWfAuwEja6reX1D77rQy5rcPnqKoI+BeYi5SOl+Xr2Uf/3eViXLa5bWuYTPOPR 2o5A== X-Forwarded-Encrypted: i=1; AFNElJ/xnkuQ00aC+LrogwA3O+lDRoDFx3CSDsf9AQUzmkd/q5pXCeC5S9ngkubRj5Zd+rf1CKZcGxQrAhssJg8=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5oGyPKrsNRcQGF3cfpnAZdTKe0f9bOF1eNB79pa5/uay8ao7E mrCwP4GIuNvsOOPXyI+Y+NrvUS2NjYD+A1VwxhT8+6QSEInpa1tjgVYy5LoF6Kg2s8M= X-Gm-Gg: Acq92OFr+ar9cvy9hLUO9mPRX1zu3Vwo5v/7mx78Jo3UD2MLxL/5YpnTVBuJ+yxnDmR CK0K7solLMH5tySOEiKGGAfTbFV9xAHURfSyPtgti3LNcV1LCr1OfqTWG5H0EU8Gf5ZccOoZaqF CsQOxXrR9h4r4bobIQIDwEQvQ/HKT6ny54K2WtH6YFzr6RebaDHYA+B546RgECdE9MmQuqT/Fk/ wY3v02jLas80QVDOqxOp7YoHZdXE6OJRVT9YzdBwzw+qTrKvfLjk+jZKWLCoN54EDDD7CuF8Yxa New2lEQazRWViualNGNmP0kJscr076cxgfwxTWVvz/v6eYFgM0rHLl9h4q5PEKP1nPnSFRwataX 6liqKBFZIuS81wD1F2EyT25DSOKR66bEw9yNWs920lbWDwxtL6WqqqCMJxK7qh5wYgfwXxCwNSi BY+i0kdIMgKIikKmah41EGY5LJS0rJyoq/hlHI6wIjsAAVYBJT14rSE2M= X-Received: by 2002:a05:600c:5697:b0:48f:e6de:1cba with SMTP id 5b1f17b1804b1-490a2958f75mr197204615e9.17.1780389561744; Tue, 02 Jun 2026 01:39:21 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e26050sm43879425e9.9.2026.06.02.01.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:39:21 -0700 (PDT) From: Neil Armstrong Date: Tue, 02 Jun 2026 10:39:16 +0200 Subject: [PATCH v5 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: <20260602-topic-sm8x50-iris-10bit-decoding-v5-1-c2b32474ed67@linaro.org> References: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@linaro.org> In-Reply-To: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@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 , Wangao Wang X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2065; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=8QQGtfLgtdUXMNRLEDAdD0G9n8EM0L6VfE19GU/xjBk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqHpa1RsRBPFP1x0RR1QphpYuDsiSPKUnplCmWpDtt ArA3S5eJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCah6WtQAKCRB33NvayMhJ0cDEEA CHZOBd59MEu8ENeyENBKx6SVc3sSHwu1WOXPVnDIPPn9ozR7jfkswfyGjyZevczGLhS6QqMuxh7j5W GoJbcC4a3np8lRkFoDkzABpcNDR0NLxoO2VyFU+1lp/vMkWtY+TfpwHG9nwUx99myJRsT0ZKfpxmZn Jq9hCDnlce/5u3Op8lW+V2+7Q6EY5MJNG4gljfJkRfE0Elw641lI/BL5cZfYszR9X81Ru4PbhKPCry EUsHXKpsD7w/pL4dctIqXNl7HkeP9dsJRPBkl//b07I+ufI/YwY3fqzKLXsAYQGVB1hAOXeNeJrN5j 8S7Ky7Vw2NCEoAOn1gyFAjtO7+LBlK4tm6m9tsf/HpR6sLXaqkwAHzZ1WhmW87bNWuNcQSelt5aiuI Z21h4j5Su1M6pWzhXAsLmK+Uc8f+g2dKrGTShiSzu54rYWSDzTytIkKR8GTp4tm2488joWe09SmqLb TmlseN4QQeIbE281fWtsAyJb2OpktOCXhdyHA25FfZxKORIAmRVnJKCVqGEQ9DHVTnlsdBFi2DgYfZ i7fUGm/41LlyfB8IJBaKhjys5Qzdp7RgTZ9DbT/WfGBXKOrSBukkU6T68C9KPxiBwbgX2TIu2E8aMq uUW6ecJ01JbER+19JiodWR8MgIM/8embCt5hZxHqpF7iWodjfev+XFbzzJXg== 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 Tested-by: Wangao Wang 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 Mon Jun 8 04:25:17 2026 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 6A0C73C81BF for ; Tue, 2 Jun 2026 08:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389569; cv=none; b=IHT+a8UDoQ183hTFVdYEHhEEwdzwMGVYR5Qd8+a5KCRuSlv672hynL+8lp1Jtc7Ghy8f4W24uKau4dwF3U/n0suKp0YLFPbpO/fwnSox8iSPV5OO3kCvbjIg9TbZUSvxFRcF1OL3RHtnahF42n3wcRskfcD0q5pZHdtK55VWW6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389569; c=relaxed/simple; bh=S0Db5q5hr6FHFvR+xCmOQpGFoF3p1CIuLIlhmqNs5vA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mtEKAJqz+qf1XkkLgIFHfYl1KjaAlfHz53y76or51kL+utccFZ4Ff79lk8Pm2LKBgtizQpfFjsApm6SimvaXszTjuPdquq+WrevBD055bKNb1Ot52duQ6U5qMYisWIjFPwRHmdjrjLA7bM6IHI/Qhl33zAKTaF5usKE4SN8h8CU= 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=medjD/Ht; arc=none smtp.client-ip=209.85.128.45 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="medjD/Ht" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-49050bfe053so79753595e9.3 for ; Tue, 02 Jun 2026 01:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780389563; x=1780994363; 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=nHVYWOR+HRE1TX1JuspNow2YGDrcXnqJ6OCBB/dIJOs=; b=medjD/HtVOtfRQXJkUumD3w0wEsvNjI4tqxJs3E/Jz1+k/d4HVNV9cpH7rVzEeYoHG +2kbUb6p5Tc8ibV2ObQJm570HVQOJInJrO/caW/VeDiMzTN7TGb/dVMVbv3cfCpoczw0 /AeCpWlA6L6zfzpc4SfHQ3H6EEoubyXuY3gGkSBzOuJz4IJPiEKUeq+WjoYA0h9vxxhL 3vNPyC5j+GS3G82+UC5qIlONY+v7ZdjDPmD+gkqIYcwzw0uhfLYGT0LOCItsO6S9p6fE HAzZN0/DSFhOBSwsG72BlxkzOMvXChtvQUbJGZssKD6vZ8fBf0I6dyOvd9J+XI1UY0U5 H5lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389563; x=1780994363; 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=nHVYWOR+HRE1TX1JuspNow2YGDrcXnqJ6OCBB/dIJOs=; b=NPImEw6xVg0oTcm310uaIN/rhV9minS1cMfPiBAyK8ifpMoFXUuXoKi1i0LDsx6Q16 kiTeeWfuNIVOXEGCafIm1ciFIjhOLYH4Asoy/WDfGv4onAms8XKFJdY27CVRh+oaN6Jt YE1djm/8kMI13lr27z6J+Os+xTSp1bdP92UTsBnFmZL/8lwXRRaJv/rqfNVtW2azMSsb S6QAYp948pkL17uxpM8SisW7M0ONmm84Wx4Mh5yBStm/p8cnw49AWehgf6qsw7J3Ffqs zxqVV4OzPk4enWxwwW4aXU4WeBXdc+ZPDuPtcXsuwFDiOuJxjpbHL/gNsC2SYubwN9Lo MhnA== X-Forwarded-Encrypted: i=1; AFNElJ95qfkInap1WufYdoZdNekXKDNseXV7vhCOBDkGBUR1qwjrk66z92pRV+xTRBc8NcBtkur/m7+FTIHWKZ8=@vger.kernel.org X-Gm-Message-State: AOJu0YzZ8KCCg5XBUttlOgqprLIPaNmFqDgD3PxzFry8hhcsIgOGCKX3 ukK/eE6kRKDlil2SIer45WmDpDLrZjwLiTudja3hz0w2anykHy2oHDyWb8zyu2BM6hs= X-Gm-Gg: Acq92OEFRl1966WwBXL6vOuBYF3WREXObBibJNo0FKGIZN1bSwopnfGxz2Zb0iHiuuO PIsqfZ5pGxDUOoyIJvzrIxYmyCE99J/7FFb8nRNIFIprOwO3z0GZoQCPpuuVBXkaekcX2zsJ+S7 ggQQw+WvaWUDxbIDPyMluyjyEhnF49gFk6r9We0uN0tP03LP73tJXYR9UWm2TSEYyPFJBB7SzVj LrJosI5bEn11SJH9kiOld5zW2jwwosqeWWS6aCDAO/QM/XiMUtGFo3x7+oSMceJoJU72z5VmKjv JXxNAPr0056jUGzgf4vThy1lhOV4hQ+0Ws5gOeZkbtu4pfasUu0SISTMPQgGdCDrTtRcey1XHwJ LN8nbQveWjFVXvb7k64Jw96l9q6jL9oD5QK0Q74uGYg0x0H7zVFwqq7WSx38EBTDahndb2Lt6k2 ZF0XmGJ1yeWAr/r0+LkVokaBtJZpA1+eCpisNUX0s6uxhNS9V23SBnRfMPswN7nLSb6g== X-Received: by 2002:a05:600c:654b:b0:48f:e1ac:c94f with SMTP id 5b1f17b1804b1-490b071b95fmr37621185e9.10.1780389562507; Tue, 02 Jun 2026 01:39:22 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e26050sm43879425e9.9.2026.06.02.01.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:39:22 -0700 (PDT) From: Neil Armstrong Date: Tue, 02 Jun 2026 10:39:17 +0200 Subject: [PATCH v5 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: <20260602-topic-sm8x50-iris-10bit-decoding-v5-2-c2b32474ed67@linaro.org> References: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@linaro.org> In-Reply-To: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@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 , Bryan O'Donoghue , Wangao Wang X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=10325; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=S0Db5q5hr6FHFvR+xCmOQpGFoF3p1CIuLIlhmqNs5vA=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqHpa2aBax2W8lHXTcA0lvliooN4DlfQttxYdSXtg+ pY/ywCuJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCah6WtgAKCRB33NvayMhJ0fUGEA CHB4DuC2zl4b7KvrU+JHOqbHxUH02ajjcQO7+Zxt0yvsLxiC9EnqAlgO2UxzF8NRCQSfgQBUMQFbW+ GDG8+Nq88eiUrmhEX9aHAIhB38n16523yL22G334WLzjzo6bcLaM81awpJst3xk4QH7Td/ke5LFxQN Vj+yiGm9KgLh4kLpgYRVs+wkG/wZHNNj2GsyDY6oMTqN1K2JJu3g98qMarq13op0gf6e3ygJ/CHhYd TavULCCp4WYYdNZWou6eBZDTZjEg59nMgqBxz36umatRTed7dKWU9Y3J5NNOY2P/ue+frjzTGcYaiT nxm0pEcodcnKnjZSMc+XdjuNVcnCQvA6dYnn66wtb8coufqUGo+kT7AhXgXCJZ2ZTepR/MLb6aJyEM tWJzSbUKYLervx+/TOz25ZueW0BM0yR9IHZouXKwsnVC9pZXDP/2iIXdrYrlMaPmvphG+qeUmTRSZL KZBZ4H8nhX/mO6QxYG75sDhqNinxvwcPv1u0O12YM6YckZOvuTHZNyXyKAQNqs7jS2SF8KmFIWZuuv aIUkQ4GZNxzalrDoAYg+YzGmAQhjh6EJD+JIEoJ8NQV3+ATy0Md9XCZCmf/0tbDfsU5sdozASTI6Ks OCkqLvR1M3BN7dXVX1HfokT9Atkix/oWJcEnLfvUdM/q5mQLnXcanZA5obRA== 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. Reviewed-by: Bryan O'Donoghue Tested-by: Wangao Wang 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 Mon Jun 8 04:25:17 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 1B07E3C871E for ; Tue, 2 Jun 2026 08:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389569; cv=none; b=g/DUQOGH++IH5kbFWoomWXecq2yKeBMyxbN/mbB6VyJuNRhhv9yCvDnhT+o9gRKlAArkdi49yweU/xLKQS1ABbUdGVbJ3xT1syUrsULzynkiMrBk16PCnJa/VKev5LB058JGbAbXISvRxgTGVL3XIyWzigi05pX+fgx9Q+qH31o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389569; c=relaxed/simple; bh=Aivtp95wV2tJK8BU4UcdJBDDqczU83zO4d2Fedom0S8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B7ISMkQyb7vW5YxfsXnmnl0Cxungb64/9wNzi9XuTS72WcqA9YfHfYFLmShlgd7H+FvjatJoKcRqNUfCwy9TOzEVN3Hys/SAv5GWMB5K5VrhrWhEw9XjzlWuAfGC681eLmIdjk6VdleyrOXaMbtZ69fnPQwWsIQl9JXvPJil4uQ= 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=fsrJfMZ0; arc=none smtp.client-ip=209.85.128.47 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="fsrJfMZ0" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-490a765d410so25217955e9.1 for ; Tue, 02 Jun 2026 01:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780389563; x=1780994363; 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=WW8A+O5CaCJo51Sk2hlF19QmFYNNtctthgExs50X4Uo=; b=fsrJfMZ0OvLzSMv2IpxvBaGjQWeDsuUX50XjC9kJCzHaDJuz3l2SuKGSHhfJkoYIW4 UJO0qwLKi/WvLRAG5tMmUsMGP73h/hidcEewvtLjuI40Aw8+T6y1KHs7kYmbAxZussbA j2e925PL5oDm2uy38TMpbhtmKlI4G8A8iSnvaApUxSxpVf2e8YIIvfi8fzQvjunH6JN1 nTeV/mp7JZJ5BElkjvasS5dsfXUKtW8fevLW7gXP4AHtr5+dlX6a4AIhT6EFkbR51oo/ XugTwPY1dIi9RQ8idde0rICRpnmowqKhKKDj3nkp/Zs5LpdFW1iF06XAm/Xp3jC9K4zl UP5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389563; x=1780994363; 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=WW8A+O5CaCJo51Sk2hlF19QmFYNNtctthgExs50X4Uo=; b=chupXeBMuKbNpamitTLn20V+mZPcvmb3wkAvcVSK9m77sOTVaZDVJJkuTxyuFVYqSK oYHuN0yc7sfzXN+lkRtXzKseG27igDJxb5AcFR3Q2UkxAaNIvkKsiNunl7U6RWCQvv9J 55HiJSjEF5uXsoBvim4ChdUV4xGFCHOCBWfP7cQaaUGAoNeFKhEkwqMLiStwpgKqeA3U IjVQzjN+SzczqbHZX1526n8N+4I4LFz0UMSOXRVrGesendUyePJXhpy6L1X4RPSZhCan +/inuanTB5narGIn+bAEYWgE1AgbI/C7sMGfltucW1vOD9d8hCcJadrkolGpXMtRS+Oc 5/gg== X-Forwarded-Encrypted: i=1; AFNElJ9DH+mZQ5h1YrM/w/xKnk89T1JXFMXsbAKxH+eXHSpVe1lDLgtmSfwJd4oxmXtfYBmtrB22QmAyRYN7maM=@vger.kernel.org X-Gm-Message-State: AOJu0YyQH0xstHWXihUpIoKCXbInTVO+BywnShirwb9QAZ7WA4FmXanJ EeaG8T/U/Mndm4NrQxG2dIha6Jikr1y9W4eGsZ2a5B3eIY6UTer0Kp089pXS1akYA7c= X-Gm-Gg: Acq92OGEI50HaPDHP41MM5PyallA+HztbMinEYbXvfGx/vcWO/X+OUYVkDN1FYQHr6R oWNwVO3eIS1bpEhJ2raNcgumpdCdOeNJu9mDVwscd2M0ilfZcM6bL+daqyvoeSON30O2RuB+nKF 4DuEfKPYkpJ6J4i9FqHK/tf6Zt94d6kapzc3pSmM3ZbFQ0TfQySXYrytYkX36seBY1xsIwBV/0q kQVF4xGnAMiNHCIym/h4Q1DgTg0vxHwCOeFYnMKvjLOXQsnkS36w9N3FpIKOQpjj9qqgcMLc1hT Q2bGiuwXjiNiqsMxMPrJrLZ0t7djLcWLpOKUfW0J/Cn3McpQKuOntY0cVrgH/LkJhOvNEf1hmm5 ULxslgeiomTyhJ5D5KobKkVE3MIYvfjjmwJprBlp9/zQZ0FzIiYPblb4PGp+8jw3Q9KDqOyM7WY 2ySVpzLVgKMNb1zoYts/LPdAkIF3M0LlojKnnQrh+pUOO7jWiOa5ChS0w= X-Received: by 2002:a05:600d:8498:20b0:490:484b:bf41 with SMTP id 5b1f17b1804b1-490a2923b7fmr198737535e9.6.1780389563215; Tue, 02 Jun 2026 01:39:23 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e26050sm43879425e9.9.2026.06.02.01.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:39:22 -0700 (PDT) From: Neil Armstrong Date: Tue, 02 Jun 2026 10:39:18 +0200 Subject: [PATCH v5 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: <20260602-topic-sm8x50-iris-10bit-decoding-v5-3-c2b32474ed67@linaro.org> References: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@linaro.org> In-Reply-To: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@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 , Wangao Wang X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=6457; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=Aivtp95wV2tJK8BU4UcdJBDDqczU83zO4d2Fedom0S8=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqHpa2ujjiaqf+MlEKH9YPwoQly9De4MGFYFfBtyZ8 Vi1P6MiJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCah6WtgAKCRB33NvayMhJ0bV/EA CBOGGvmoU1cjndlXKZv249sw41DMCjRSFbhfYEeAn6HuQXwuqacPP+dwiGLVhowv01wBOSrQMz4+rY 5KnWsTGf0noZdBrevlteXDJWlJ4mR5h9yqT8amaDZKmAXJaF4itmB0vWRfyNbBb8WVdpc2IH2HNe++ 207ThWbD9prVhA8/vRHv8JK/JVNiDTGbuRi/Xl2bKH26i2fUH+6MWKyGXUifgN1b42Rn3bmkAAJyru SyI6k3ulHBh6JIKXsihanzlK2vVKJWa8itA6M4IF6haYBcn+37HogXmkWBhQl1PTyndCnomWuqOwwM kmBYIxqEw+bqBcjh1hI2PhKbW7Hol0PQ1Ez0nYVTot0WXPC9SOGrV9XCi8zH5ANZp4bxIi6AHHeG9b 0j5cTjPxp2Sx0c2fdDQ1v1/n7TyUaF0B0qqLbw57QWPpRMDXQ54uAKpUI6E2eGlk8nX3/craR7FQG5 +CwCS5axS8dSSF4qMQopnpDX0qszZMBQaHUU7ynBbT+DVpprWRHS05kn0pM0nML4kEJyg/3fhDenvP owdL55cpiCuz56zrAtKI+CYjSc3HIJd//3MqNR716RlDhLuY9VCUqC8vAimByXFnqwbp84eQtGCmfG po3dvPT+TAWjE8QDM33Y13s4cKuOSNgePO5/Aci5zXNn2MJqR30CvmjxBoNQ== 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 Tested-by: Wangao Wang 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 7ac69af63ead..ca2954f8bd3a 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -480,8 +480,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 ? @@ -516,7 +528,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; @@ -531,6 +544,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); @@ -619,6 +687,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 d09096a9d5f9..776b21cd11b2 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -136,6 +136,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 Mon Jun 8 04:25:17 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 9ED743932C4 for ; Tue, 2 Jun 2026 08:39:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389570; cv=none; b=Rc9v/XYhLrmm1D8gnDF9KXq5x3h1GwIpQKTSw61dFjajwZl91MseFd6hUKE8EIz+pH1BgMSHlt1eZIiHWjd5yXrK09YC+XFHLHZvsBn/s21ZD7zpe3zLAuY1Itq5niYQuQvZUH+FMIfHhyEe8c7T92U9YnEQnNSL8wmkydjDsYc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389570; c=relaxed/simple; bh=fIMj9J3bf66tJ0SCujCc667QSjtjF1FCVosD2tmUDVA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FpGfyX4umAvguF9lDK7ldNh5dlXk5iuOcvfQ6IFdMs+kXU6S8AfmnwqIlBUY7esRgwbpm4yvHVCsBdzUVlAxBB/vdhB9wBSaPnftfRmLm0Dlme9sF2Z/SdMp9aT1CGIsGt1T6C6H5c9X3UPLbWPXJ7jmchU20xkmiasyI4DjWeE= 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=HEOjrJuF; arc=none smtp.client-ip=209.85.128.53 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="HEOjrJuF" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-490a765d410so25218215e9.1 for ; Tue, 02 Jun 2026 01:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780389564; x=1780994364; 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=x+d/vjagw3btqR9jRfyvVTPfDk4CiJBd17ayADhnvx4=; b=HEOjrJuF5uLjEA6+D1rurpIWw43TfzPfoX/RV9SG1I1keGE0/3V3JbnuA+6SCUy+VB Jh8QRbWXRAk9ZnJv2Y7gWB2PfB8dawuJBHlmMV2kBpuNZ27wItDr4LgKeTG3LifXijjJ V+Xr8/KNjI0FINByiZiwIasxGtsRyycKJJvCDqF0RxJiieAikjb6qC+y9GCfaejB/+n5 5Vj+wf8V2P/jU4jw1X8Bz8XE4Z3EvoTfLFKiKkeGVnZUIjsSgjKNIxsEzfMIQCRWiT9c 7zKLxo8NTHmejNcW18Dj2hdVEOt6vMmJsUtzEF7vIT5YV/WpCwC3w5sgN1ZeJyhI2Iaz uygw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389564; x=1780994364; 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=x+d/vjagw3btqR9jRfyvVTPfDk4CiJBd17ayADhnvx4=; b=Mc2f8lpR+wB3t//AtHxxxGu/fLb0+daMCP5c/34aymeW+3ZNLEeOg1aWt+yteun+2h PwuZ9AaZImzSXvWPoU5QH9M/Ev5W78k3gAZ5Oxf/SRIkeiOttiO+qKGiB8el2lHxUxSG t1TOGXyPD1NRU0k162eEX/UTbR/U19BQu/y+ZGPUfKgE1qPinir3sCIWOh4Nav/2lbtB IacLaQruWx/iSFD9JCNGFft8qWqufvIR8ugXKUrQa6wodKGL+o3MR+4yr9csSn6Y7IJy PqpGk+G+K5YJG+5NOFNa0ly9fpaAtpDVKjbOzFbPWhbqoPVTRQOe3ANCsvkGt7qT19YY 2HQA== X-Forwarded-Encrypted: i=1; AFNElJ+ImNioW5hZs7LJUK5hLbbhAmJYHE/B+dOXt58OT4tAQs0K2y8NI5JGbvjV+Pe9dnLs7t3qngQyVBJJi6E=@vger.kernel.org X-Gm-Message-State: AOJu0Yxfa853ULLIRBz2qTyAwmQgq3IqLvpjZUzYcIb/auKKLJaSML9j yslRHYcwAzRZpbxHej6FBvR7lRTKMGV7CvWuEvguL0EIJuKnSozn3IquqV60em8Z5/s= X-Gm-Gg: Acq92OFTHFbkADEhll+ChIC5zE1H98m3A9XfRGo+G9pvN7zeIr7uzjgKbF+qgRwEKX1 u2YEawuTClOpPzoG0PCeCtFQTrxYNcanPC7LmJnxdM0C2M/MX7uh8vlTRs3kxjW6eJ8nAGf7CEM oLL0kOBrBRxHytiJBxYpb5tl1f4VIDPnbDfgVoWDV4CQPUszn4PWlJ0/jzooiH0eoEAgnv2PEtL J9dKV+UqPtT1e9owYJMLiP+dj7qOZha12svER7CAITOGNyH/kkCOJneDlwnmiDIE5MhTXR5LVTY fvfCIC9EWA0JGY8ibfJBgOFYPSIQK02t4zX9c1SxZcWZsZTNESJ73fKe9JYIDGbbYhw6v6u4vVi zyIYOy6inL/WCYmyE5i5g7uPx26RPUItT+Ft5xLaYYpf0McsF9uUjuxHCZ+jPlPj6D7chIBafe8 sryQsM8DrmrR5IrOrEFlnGv8Z3yK28G6S7YYJ+B+YmrLvWTuP6tH9vmOfJVNR/9yHMGA== X-Received: by 2002:a05:600c:2a8a:b0:490:6869:7d8b with SMTP id 5b1f17b1804b1-490a293cf20mr198069715e9.15.1780389563957; Tue, 02 Jun 2026 01:39:23 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e26050sm43879425e9.9.2026.06.02.01.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:39:23 -0700 (PDT) From: Neil Armstrong Date: Tue, 02 Jun 2026 10:39:19 +0200 Subject: [PATCH v5 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: <20260602-topic-sm8x50-iris-10bit-decoding-v5-4-c2b32474ed67@linaro.org> References: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@linaro.org> In-Reply-To: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@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 , Wangao Wang X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3729; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=fIMj9J3bf66tJ0SCujCc667QSjtjF1FCVosD2tmUDVA=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqHpa3IUPhLMJS595Po4f2N7hGKHKchnIkrmXC55UO 1+FmtNWJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCah6WtwAKCRB33NvayMhJ0fCND/ 9kh4aCyBLUxSs/+3ucFkXWirorf1+bV7FNNBmzNeRH5c6YDWV31KsLP0WSCPxIPVW+x4BY1MJNy5ye T9htDNR8SQy646PS/nC0y5BaMFTHCA1vgafDHX+PuA6Z/CGFk2BrrR51tt3UMm26h02XIyWmf0viSV C7aIytsrEnezFJRwaJO37pqRbbjulVKWzGngJOAv4y97aQbhIcSOsqnOkbkfAGmAAz1P1CrKIVjuwl sWEIW9/vP4kmlgpv8Ia90+hjF0UEx+XZU8j0XnnhuP1HvXgg+oDqcDaEVNcM8Z/P5VGSJxy11KMqtZ JLouLB2wKjaAAV8L0NI72YRizVQnKEUmGH0n8QqiR1trO/HpxYkjgZFy7MI1fUP5R52+NHt607gj4g /btiSuNW9o0R6o1cZDslcAotN0T3dP+MFs4baIGp8nzrDEBqCj5jqKfwabSEcaMohBkn2VGHBOITBw fvhw915XOXGvi2QW2M/PEjrQiozETAvRW7zMrVW99vXWEQqqA3dRdHX9SScghPU0vMyykePC7GWyQh 9YYfPaAgMaTBj+yllna4h/FG2sySmtPA023VIB8Aya5pu0hUb7IwkIhRK6RQ+3+sqNCZWVcD6PsuiH dQplDFi3NZDguVO7c+gv5cEqIR/+oLcbJuNE6iL3dRObFppKe4kPBXOqfeZQ== 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 Tested-by: Wangao Wang 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 b65832042dc8..92e9201cd3a4 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -263,10 +263,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 Mon Jun 8 04:25:17 2026 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 A05BE3C8C46 for ; Tue, 2 Jun 2026 08:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389570; cv=none; b=N1MbWRMTqVHf9OLJ8vlTIEHFX9XHRvHizmzm6+8kvlU10i/gOn6YBoAyLZmKwyCSuiqkCHS/R0xoW3t9MhOzi17Itl6Fcd64mZd4zZAUZMz6aZiwan/4Y6oUB2vtsOEbulq2XT/zim717VeRtBCBkho/XK1THChkK2aKaaegfoc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389570; c=relaxed/simple; bh=AGNlMq/rmW+DgIPAyuJDu0dlqI4I/vZ6MLbj2JdQR9k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ObgNnZUwEi4XUUgelkH6smPHxmAqPNnSIR8BUAg6D9Ho3KifK/U8styC0G0n+WFxcUy5FcBs/b2nVB+T1cnog+K2l97by/8T9+RwCklZS+EUur4WDPMSxVM6n4vDM6moRw6+HkWqLswDU9G4NugD9g7oK2yUUXS5c8GtpoZT+b4= 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=AYCfQ+Df; arc=none smtp.client-ip=209.85.128.45 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="AYCfQ+Df" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-490b09e4cccso5789925e9.0 for ; Tue, 02 Jun 2026 01:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780389565; x=1780994365; 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=JbnfuFDSGtjOdRPNnS9h8MPvEx7+PQJBmmZ8fMbaRcE=; b=AYCfQ+DfQJ35nmJ1eXd4umqT+RlHwNX/rFTtd5XjJkmtn8jPKLHvvcmWFuIPvtLSt0 HmLSoL6AkVwCjw7EuUuWJnBeCLdPMR36pc8aDVCSPVaez17Ecj8ndvZvZSs0/uz/Jf7q r/hPnbq1u2BKIGB6quFtJoM7DCOr1DmHOXqbZbE6LHDEJpaCU70PIJjlbdg58vHxaIAg ed+P7V2LSHzYfZRRj/HWBtVZLfsG51tzyd5jvqqJqjdqbe6tabEUlFx7uWtkRQL1j4Ow dBxrpwsNJRz/1kKsH3V8cV6iYuzhkIRU0j7Q9shFRT4Ko2c6atJ1EkmmvnhRBcvMjvkc gDeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389565; x=1780994365; 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=JbnfuFDSGtjOdRPNnS9h8MPvEx7+PQJBmmZ8fMbaRcE=; b=UltcIvxtRyxDXTXF5HVfKw1XU7wHCvRBl4k5uqgOYhr2AAU4aNBVFvk4Lx2kzRGYx1 aVngg2yrSOZDCsZ+EY5aPv3qoouP1KfimXOnS0MVI3cId+YU9H5E6rkNFsSQFfj95PFV FuiC1AJQVjUwng3NNZBNpCnUprSWh9B2f61dCadLwubyJeBYlzgUxlZmEsAJOSYvnwJY 48iSLemWkZOIwEUPAKP40lGt+MyRT9V0fUWoFFkDE0nWnGAEnSvHBNZN8vP3e8nG+mOb TKtU9eYr3VkM9ojHBj2slfvNPvjMFetXVzjmYG3ssd+dv2du87QYzO+X+sA44k0xKioD /7ag== X-Forwarded-Encrypted: i=1; AFNElJ9XVeeAyK5dxmIeEobnJqxHJrSE9ulKsKrWYbStoNlZGaInbpPIPQb+7nKPGBM9SmaBQxoLyn4dXOQ9R0g=@vger.kernel.org X-Gm-Message-State: AOJu0Ywn0ywgsdauP/MGMErbD6c1ulNaqcBXFyqewIFpvtHac9uwb1R5 0Tn1c0axNwoBfzpuLBjNC8HVdFoU03I9IFQbjzjNzZwKzCcFEtYKLRbpLfdQLvbn/oQ= X-Gm-Gg: Acq92OGK4I4ViV1MR1qw6hHNrUZIbHfdgVc3Ob1jC6M/dc515tvyuDLtylaj+1QNcrW 4QYPlUM1Z85Is96eJODyg9867J4dXkXR7DXouw0Tbaa86gw1mThaSnX26BMyYY3i/H/2IsZ70+Y GXDYxPCAS5U+Nq70bktliVUb1+14SPoMUKWy0eqbKuMhOU3gJJs1y2OPw3J9dTCwGq5N8asCdeg ceuTzzZlU1p2Ue4L14s/I8A+kCHi8bjkODYUkd+DO7mciisQmShl8NwA0Of/pyV0xbMwMwweNAp yTXXlFXxokty4rQyaAHHzE0Inin59CT3N06RvGKaBQwMUGecyoPdBlOnY6O1gPTsPyiB2kb85uH VvKDBMjJFrmMyHfmUrEOTIxdCgx1zVTyBDk7xGNjWrvwuJBaC0mMyocUMZ165CIEjcQElxsKPym OYPXGo67wL3sw2raSfH5MPIBx0qzjj90URJleb5EkmDDB0sH9FYehiZ3c= X-Received: by 2002:a05:600c:3acb:b0:490:aef9:aa3b with SMTP id 5b1f17b1804b1-490aef9ab5cmr85735165e9.32.1780389564713; Tue, 02 Jun 2026 01:39:24 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e26050sm43879425e9.9.2026.06.02.01.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:39:24 -0700 (PDT) From: Neil Armstrong Date: Tue, 02 Jun 2026 10:39:20 +0200 Subject: [PATCH v5 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: <20260602-topic-sm8x50-iris-10bit-decoding-v5-5-c2b32474ed67@linaro.org> References: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@linaro.org> In-Reply-To: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@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 , Wangao Wang X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2243; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=AGNlMq/rmW+DgIPAyuJDu0dlqI4I/vZ6MLbj2JdQR9k=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqHpa3YghYS42q+WEludXjGeKj4fmuAg53dU5d53wp MaJZN6GJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCah6WtwAKCRB33NvayMhJ0WwaD/ 90phSUtZprGcg/QO2ak2gfR9cpgLPZI4RqhTRd4QxlnTCOpfPGCV5Zt4JNiLGAhA9Sb+Ghl2+BGj58 O91bjyUg+9N6yAwdQi98yRpmqF9Fc0EKxarPo3F5D6BPYL/IiZG+DhdCUvqT1dnqV6NkHddV2fuKnr +0FTDq/xh5YEtXp4jlUsbBcs/JtvMu5XOysq6xR89rJhp82XNxlfu5OsTl/eyHSFyvG9XImUMBD2N0 vhjXk8GsnnRI8vVFUrEPyneMRMStiGzAQvP22/SUD9D/Po3w/D4Ksi5p0IiDtTf3FJHgRUZjxlbo4/ Zv0xNlUJ0vGxxPRCKRFkM6xLSUEfiZUMielOQZW5JzijFwJ7O+isO3wAaic4AGTcfYgLiF/KGI/47t HyaTc5cUhbYeYMqoxcOeUWSovS30T89QVJE7ePA613oHTUy8oLKRuFuGj2jICJhQ3Vu/1rwUaXf4o3 W2/BNP65kaAfRKrojplV9eJGKzBWeO9hhkNoaWDj1Av2yMPHdXuXUVAWQ88Tpt48hY93wHNShIH5AC kgb1O+aixwzpIAMTfgTqdi3o0Ooyd+M0PMFVKznZWjgLe4yPXAr1ifhGvhTY6jEgLeZYPVG9bqz37J pRMf/ct2L29QmV0UZaGYWezHvr8Ay3L4KL8LKIU6/iHtO/uT91IM2YFEZsrA== 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 Tested-by: Wangao Wang Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_platform_common.h | 1 + drivers/media/platform/qcom/iris/iris_vdec.c | 17 +++++++++++++= ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 6d69a1e3dcd3..c9256f2323dc 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 92e9201cd3a4..d55671340600 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -93,10 +93,23 @@ static bool check_format(struct iris_inst *inst, u32 pi= xfmt, u32 type) =20 for (i =3D 0; i < size; i++) { if (fmt[i] =3D=3D pixfmt) - return true; + break; + } + + if (i =3D=3D size) + return false; + + if (type =3D=3D V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + if (iris_fmt_is_8bit(pixfmt) && + inst->fw_caps[BIT_DEPTH].value =3D=3D BIT_DEPTH_10) + return false; + + if (iris_fmt_is_10bit(pixfmt) && + inst->fw_caps[BIT_DEPTH].value !=3D BIT_DEPTH_10) + return false; } =20 - return false; + return true; } =20 static u32 find_format_by_index(struct iris_inst *inst, u32 index, u32 typ= e) --=20 2.34.1 From nobody Mon Jun 8 04:25:17 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 356823C8C70 for ; Tue, 2 Jun 2026 08:39:27 +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=1780389572; cv=none; b=rBFn1HvYgIsZ5ZVurvZJooCjvVBPCXXaaDlhw9qbjLiodxOIDLR09uRklLngIesT7D7/HxF+vljIEaQVPYD6hNfPLsbs4zhBv6S7kNNpu2kPhRWwlbck4UAv0n8ajdW201hrn/itgQ4p7IqMPGVVYmoT9/4qf+oH9sbZtXhb43M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389572; c=relaxed/simple; bh=FSRjjiwubMsbmGQlFv02cRDb8aSDoT7TLY94ZGqccOE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Hh9vzXyRI1z3JYH/t0xWI4czVYzT5MS/3Y+ssEYI4+WV1PJ58SEX5H+esY13OJ5ZU7X50GtPYN4Hn5dDMjojdNDP7lYGfQPJXVWGmxesMWmCPGa47+e8A+JraBotQQUZjpxjjyUniBKvZiZcJjlttVToCly1oJNmWcjjOAI+d6A= 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=jSqPVgGz; 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="jSqPVgGz" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4909e3fa4b2so39274395e9.0 for ; Tue, 02 Jun 2026 01:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780389565; x=1780994365; 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=yU+v1GlIbb9kozfDeAVXVrzHJKOrtEBHh4oL/P0WE9U=; b=jSqPVgGzQZb5HEz5M2AyF/iI3UvUO+1q+gIo8+SzelCnveGOeFimrDO9Fp8HEmOfSd MSAKhD4OQMsOaiH4T5aWLo/XstN+90QOidvgG56mqWxxWCPjA8iDh2wyNfwUSQeuLIhB wxbV2PAcjHDMYaxrCQYjXBU/H2efSpG0+u50fRwUUmnfPMgQ5WH5s6xemxlew1NlGIx6 jN1aQKB6wbK11blTV/BKrpPr984Bt3l9TE/hrTnz9UAPrC5HUXjODSrPiJmSatiOAC8S dz5izXSNfNu3BoJNmc/27M54ZFRFQsZOlwI1q3iUfGJkX7O4mVTkf7tIGlpFLH3COT0h CzKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389565; x=1780994365; 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=yU+v1GlIbb9kozfDeAVXVrzHJKOrtEBHh4oL/P0WE9U=; b=Iitt8bx6rvjsgi6XfVBILdbJxibEOAqQ7bphFAXRq+O+ltVnTnNSOuCiGfezVuYYBc fTjFt1aYV4aUBKWIeR5hzAKv8PmEw68b042NehlKQpLNPmWJk73yxlsDn34GiENLTknj vxYS66Qzbo/Tko8ILvnmksEOUIo9u4s18o1IX8axYZxBv8xR/peEh/yuQc/DnYI2BaEB 6oDLpV1N8rHpTVIuSURqLG3HCubTJiN7J+ycYvdT05OHdZUptBeB0uf80GjPbvSTpxPq vMfHcfSbJaTomS0BfMaipYH/ciGT4dMmqP2qB8Phf6+eNnU1IV9h2XbHqPKJdsV1Nq3P oEyA== X-Forwarded-Encrypted: i=1; AFNElJ8vNB9UZWJpKnYSG6ReMnP546e3AQujEOvSo46t/eGBWvhL/MjiA7vScDyHwnq+LY69P+0yfr1I0lPxxG4=@vger.kernel.org X-Gm-Message-State: AOJu0Yzqm3eaA2JyEMO8rDSADsEOBKsObzDQZGv/9eiGfL0dB3GUuO11 uPMooTZ6rY7eV2CTgtaOYaP9NdHlCzuaH73A5en9jpHNuZJ+WzNxjEvFsszo4udkEXA= X-Gm-Gg: Acq92OGjd5lu2ctyFlviBF32uI9A6iZevat+1o7BwZMot6NeDJw62Ejl5xOPDbQwVxR yYJ+mxBQQI6C5ZLMjscrh+zy5SJJsep3y7nHPqlEm+5RdBAyMr73uEN9bPAxW4av59V3l1eEYAu eqqLoLrkGNfEnr4TnXl8MKzRCiZXc3aUxeKZg9BYjJe+vPnkpj1PT+WrRIh6ouCGj1JqaFdRM/q q+g1pOq1hpswgOfCiQ4pb2v/zD0ZoGdHn/J5MkwwC0Y1r0CZ4vRi9ASe4LMCFPU/FHoLsIpUeFx QOyxZhPVxOn2Y14ommUYUs0oujT3XWl1e8WV2vBwrUSsgdzZwF4XkXtNdbudB2Add55R08xqmvv k5ImkHkXTWH7gv0b4UZfAFVAJak5b9seLZveZxqXY6pAMsq/Yes1/Oa97jMoGhdT74VKvcccgo6 AujXWCqj/ruGTayjv2LkfXiKCMLUUmmJvVi9BlDsSlb1BLWACG4KsbFT8= X-Received: by 2002:a05:600c:8b01:b0:48a:563c:c8c5 with SMTP id 5b1f17b1804b1-490a29127c0mr55625555e9.8.1780389565427; Tue, 02 Jun 2026 01:39:25 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e26050sm43879425e9.9.2026.06.02.01.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:39:25 -0700 (PDT) From: Neil Armstrong Date: Tue, 02 Jun 2026 10:39:21 +0200 Subject: [PATCH v5 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: <20260602-topic-sm8x50-iris-10bit-decoding-v5-6-c2b32474ed67@linaro.org> References: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@linaro.org> In-Reply-To: <20260602-topic-sm8x50-iris-10bit-decoding-v5-0-c2b32474ed67@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 , Wangao Wang X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4850; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=FSRjjiwubMsbmGQlFv02cRDb8aSDoT7TLY94ZGqccOE=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqHpa3tphMfFq2aRbEGfi12mhSrXo+E1GzA7nnkPUP k+QIH7SJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCah6WtwAKCRB33NvayMhJ0UP/D/ 4rKpp40CWrMs+OayqZM3J1qkp6ktiWk8FQvq6bdiWqZlo6X522U5dNui+tgvUxN2Bn8KOIt93GDdU0 Nz9+4AQAukp0MMbg9JVVBx5vdArlTS3VZ3HimVO4DZXPzYUXM9FUJdqNgA+0EflfW+svmq2Le8SdyP zMdbFGz7CtlmT1iurqRWaXLcxv5rrHiho89ZsAsiZBU2tZdDCq4KHxzrr0v86+yS1Iv7Rwur4lm2CL U0w1caAvK/wMwVc3oJ1XbN5eDit+K/2D6MekvFW9qLeP0GUwVMcwr3xiFNETS8eyB9IRms8Tr4nj6D 5AboIgx2GitTl3HoV7/HkXuwUCOcVvd8r/IKhtFgi+8HM2N/ACA34ZQ/XiJwu2VDlqKST2oJvez0Si oG4im2hSU5PP1ddlqBx8asU94iG23xCW5nOxytwKCUIW4X8SbJhUhWm+pW/NDj6MfnKvHODwCPbpr1 i8tTK2DmGdwbfBlwSQ2pOdI4AGlz8shAilC+y4OfLke9Ei2ZV8AgNZ5SXod9PU7S7W3SAa9bIIaVWz JQ/PjK53TWxxuTa4iyPEEpa3RVS9kwfci0UL05nMGea7IvEUpYiegQ8B1+w9sjiGblEF9JS03CGTsx hs835IHfqmgk6UfUINjJ99L4vcB27yC3i1FHhwDvjUwATbnUcf/ZbuxblTiA== 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 Tested-by: Wangao Wang 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 | 2 ++ 4 files changed, 24 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 7a85c1d4e5e6..acc0ed8adda1 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, @@ -996,6 +997,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 c54d8ec8562a..a770331d1675 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 /** diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/p= latform/qcom/iris/iris_vdec.c index d55671340600..a8d6354bee28 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -71,6 +71,8 @@ void iris_vdec_inst_deinit(struct iris_inst *inst) static const u32 iris_vdec_formats_cap[] =3D { [IRIS_FMT_NV12] =3D V4L2_PIX_FMT_NV12, [IRIS_FMT_QC08C] =3D V4L2_PIX_FMT_QC08C, + [IRIS_FMT_TP10] =3D V4L2_PIX_FMT_P010, + [IRIS_FMT_QC10C] =3D V4L2_PIX_FMT_QC10C, }; =20 static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type) --=20 2.34.1