From nobody Sat Jun 13 03:30:24 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 412DA3BB9F8 for ; Mon, 11 May 2026 09:20:33 +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=1778491235; cv=none; b=b2/ZDkfg90uWFkhoPZMsqWTZwrdOvE4ZuLXk8Ez1L1AkTS6ZuifgFJrN+VXv8MriZ2Zxx+ubeQOzbNOFOiP85/0WDnfoM8qVHssRJf7rUC3FWFb/7IZu/Kf+DjV6We0HvJh28JVnHOPOVJU857AjSQgC0v85p11lfWxCLvoJmWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491235; c=relaxed/simple; bh=f4Nq3WnEslse/Ujj95T0YlMIcxOUx5FiJpFStU/aLcc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VUouwuuFpxnUKqBN9Qn7Yv6L3XmPc9y2/irAgGPYyuMgZy+hbU9dh7Ufsfq0m1S6RKpGQeWDrag9PQBZZ6EA9meoQnD6c7Sr7sUd5D2/f3LG3vo7AMb80rrILicL6Qvuuh11fSGURfbXjw0qM8QqHK4GFauGGEbt4eD410DUNRQ= 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=i6vOI74c; 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="i6vOI74c" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4891e86fabeso48073825e9.1 for ; Mon, 11 May 2026 02:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778491232; x=1779096032; 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=CubxZ76p15MsLWO+D7OUNcZmLk+LktFGsM5YIDoX56Y=; b=i6vOI74cXPQu1R1/uQXcve0dKu+ZAUfcMRldiIj7qZPW0tUJ1mnWucoh2H0MGpjr5u fMtgX62pSqkiAY0G72s4tDprSyCTSSWqPCD9dFMbLoT9L7FBmR4mI2y2YzbPqeDr3t+P vj9t+G+1iboHC8WsKrjYFE21lcEx+Alo1/2mMGns/Epx8eCnNLv9ZkWbLTj0EouercHs GctjD7OTMPHVDYTV7N2QEBAsDZJhoM9ZTjjAH9NaVe7QONt7WEkedqnBq1gLOEUVYehn mPJWlWWhPINawX8bFg3xYEy9D9vfv8YopuaEOIgYZX4vwjSfuPDUWIzwsYQFCL/EkXwP Fwbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778491232; x=1779096032; 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=CubxZ76p15MsLWO+D7OUNcZmLk+LktFGsM5YIDoX56Y=; b=n4MRUA9gnPCo4Fo0QkMn0vT9SyDcEW7uIw7ZgSZtLNl0HmfeRMY/vAAKiXuKQE4mu0 tEqb2O0lSdrHNDei7EugeT3FjCNk4MF2WhJdJAFULfHlAz1AkYuiiggLCBzWHSyNQe5n Sv954NRdG1LGfOWrP4ecjkhWm+KsSJPrww7EwS0B9okONG7ZeTLpcdZbFs9+QuEUViDv asuOlrw0cf6EvxMOACcP2pST1amMp0X+9GyJfjplfQVS7lvx9jyT533iQNwmYGJzCMud GAnupQok0IeIKug/II5nM6ZGa6OEGNXchdrRztL9nX8/U1jcgj2DjMdlqY3hti+7YRLz hrew== X-Forwarded-Encrypted: i=1; AFNElJ/M3uRW8NyefRXngLcrz4qMtNio3XIDeaJlRQXxVi+j8j8b4QNllMJECWjptfTMG3spF9XVoRxADm5Birg=@vger.kernel.org X-Gm-Message-State: AOJu0Yyplt6pk6PFlDsKuhDWJoSSh4FT34vZWPAqc9mj5UhVxdJ5PJnX a9yrmST0t4Sujp+U27ENkJ/eobTz/2P3wp/d62valUvqsN+esBRO2uK0Yor7chN4Tq4xYrnWyHZ N23yFMO4= X-Gm-Gg: Acq92OEp7ydDSx6zJEeGkEaYCwd6Ha39qzc9BIoH7aYMQCYM/FSqF58duTVRwtreTSQ VvlG0eDxSQVaWwb8jfDX2HoYvlUJoZVX4L7pek4mHmxXQy//d7CZ2a7TFfBjA4vG1XEjZHuxI/8 9LpLYk36rlb48ip7QbqQ0V49VndvnUinu9t0SCGF7t+eBUk8OYDodJpDjoidhRYISN4iPxw0AKL 9+si9zsnntVG97sN8G455GX+12gsjYgY1gh6s7SI96WXYSIagZgZxIGMaOAMmxxyYvwWpc3XnCf 1WjbYo8d0UovB+5vCfcW4JyzPk3nEVIyiVrmA0UwYnS7ejtLUXJmwzplQuKqe81/0+l/LI2JC3g GGAknS2Sfviz/Ewz5exhIPa87ZhyOShnQdOV0EFABrLfQrLgp8XA8pw8hFcQh0puaITOjxmK6Gd un9AhWbl73AMfWGgzkOFJb4U4HUhjol7uauQtmFXmwTss7 X-Received: by 2002:a05:600c:a411:b0:488:af48:af11 with SMTP id 5b1f17b1804b1-48e51e08ce3mr303186555e9.1.1778491231446; Mon, 11 May 2026 02:20:31 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120ec0asm23743240f8f.17.2026.05.11.02.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 02:20:31 -0700 (PDT) From: Neil Armstrong Date: Mon, 11 May 2026 11:20:26 +0200 Subject: [PATCH v3 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: <20260511-topic-sm8x50-iris-10bit-decoding-v3-1-7fc049b93042@linaro.org> References: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org> In-Reply-To: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@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=1951; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=f4Nq3WnEslse/Ujj95T0YlMIcxOUx5FiJpFStU/aLcc=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqAZ9bKiDYDwGUeoJ437lHi3nXZmikHepINN2wPupQ wR0a1SyJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCagGfWwAKCRB33NvayMhJ0XwTD/ 41f+P7LYfdY0U2EoL7Wn4adthTPh9LBgwmgHdrCIFbU9QrflWthsAgqSnIzT78CeDjpDOgXDxcSkxo 7b2+P6f1NrqhhCBFpnahMxErqZD482PuH6kcYGHBQCTbgBAGQIo0e6qA/wUhmooXvvPKXZ0cu6arMs jAJy01RAkRhxDLXizViFDHU5EnJ8qNbMGw3hewrFoLiwduS9gcxbXHWdRt9Rb9Be5WDnYFXLuMAMjP IVMppWVoCBgEj1r96nz8irKK57OJFJAiHIscU4blVQsDfDz/QZTYudftZKc8B9qxeYK4Xr+7DQ79vt pB5RNvF5xkLZsZ7AxRVWU4P/BMviDZBqBehkjXiC3eP3ap0Oq0NzkOUyJXTixdcOHN7ubY4cvHdmso QX5M+gDu7FNKOqxy47SDTP4G4YWN+ALv4hqvZFgV0ozt6mz+ZA5IccPmoC2k9LMt0ev5cXJA+HgMsl o6p0AO2t+cnOQzJStZDQcZgKc1BicnFCkXuccfq5MHw2iyU9+CBl6hGiQ6MIRK9WHlkH3IiYKuzjuT PWpSWzqDxhHnPDtOGWykpgR/BcFxy+6pLkc4bD1we8rxCoWOFHiMH0z0mIjfABAtgxZayk7TI3uyGk m5YaeJCsENf26kedSsE0lWUgBBxeGOoa/AvI58MezS+n4CCsVdlUp70QUJCA== 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 Signed-off-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov --- 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 Sat Jun 13 03:30:24 2026 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.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 0F8DA3BBA04 for ; Mon, 11 May 2026 09:20:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491236; cv=none; b=PFsoWiJs/4hIrx0e/G6SqYlCLy/PhDmNKX9+OLC1+juqTslpR89gs4ss7+kYscsNs7dZyayBUHkDrXu7pI4RjDDZJ26wIN3iQw3jh3eNeq5VWALKBDp+UuU71hwuV4BqJCiY4T54mK2YUfZ5rHuJK5pR5yoxyqLyD5/7W3nKabE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491236; c=relaxed/simple; bh=TAhQZw0wpyy7M1R35sWEGKNJTx38Wi1ZyfZZ3XckPRY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X1WStZlA3nkn198XObcMSmrM9Zz7aTZjCUzccCnA3vuP9zg3shf4Sav4mpgxxS3Z76ZMguvMCWf+t4w7QTSHV0OrT0GL0MPR8dAGwh9BIr1wscXGobG/z61Q0bKdZTQJk7XJSoHPq0geZ8OmIcakFFGW/knIUJdREQuTRkdXt3g= 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=dXdRx0dU; arc=none smtp.client-ip=209.85.221.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="dXdRx0dU" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-43fe62837baso2035836f8f.3 for ; Mon, 11 May 2026 02:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778491232; x=1779096032; 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=70RRHIcPtjWb3dpDxzH5BIzTRCGXwzXLne5sT6oMZeE=; b=dXdRx0dU0YOGYHlT58R04EqpXKbAjtWGQPfet0IzMExksAs3aruJkMgs36m5kWYSn5 ekFV3Eh4ryK3iF8vwFszlq5CrYfbk7dSDLKehs9TE5k8JVeshiRVqnxJegNP5jsyL/jr bwO1ECz2iMHCkeehnTfOs4FJZNVPE88tcuJ3XxQKjeCw4Kj/kaDH+QHXi4bt/bg6Usq6 01uBYB7QiX4hJQOJijLqdqOBieLPRiSM5Ircl0e1pMSqB8qy/AKUHYL/Uq7NQMlcG9nt 9CaK8m68l2fGkTKY/83OCxJsL1W0isR1WIso5pXs2jCaG8w5GtFe1UuVhEOGux3BYO4W n9HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778491232; x=1779096032; 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=70RRHIcPtjWb3dpDxzH5BIzTRCGXwzXLne5sT6oMZeE=; b=JRLrocof01AcLikgNffI+v4QK6Rzoj8ohhBW5elpv4J9+ew8DBm+NNijztVs8t57Qs D9F0eiiHmHrmnf6mLZq50wbsuHe9XpaEns6q8Rdvgql0vFOTZAZ1Ma9U/RLJVawgtbbI p5UuzjZmN3KfytjYcihauII1gldFqmeOobizUqVIMreRmny+BwQL82MuPZ4yzUrUW2hf tbJN6sUNOJMvLdADRh5QZvsqUFn3zkknkKzZGY7GQx+4lDRisqTdhiADC0rSgQmL0OuH iyKHk6hmQaauYyfjyvbdZWDH8LYCafg2WcL/G2VIBhSikHHSmALws6i3kXI27htEVjNo X0+A== X-Forwarded-Encrypted: i=1; AFNElJ/1KYQdQx1ifdZqaahrXsBHxTxcJf5rdJoreZBivPOIccPpEc0E57cLvdE6/laV2RqUxj0RKqwBAf0A8eI=@vger.kernel.org X-Gm-Message-State: AOJu0Yxg2DkXmx8cYOlqYwUbMBRLub25IIayABnclJj3TeBwBmq2HcUs HkEmQllj6mLtkLtnEAxlwCImCuKVMLs+D0L9m0hrVWQNBBSZQv5SDVeOotg736xZe58= X-Gm-Gg: Acq92OHo+XqW3ZtBbXZpcMOupWl2NelsPjueJUGlv+fsSLBFPGfmsAXiigzF2lOLVqU y5kLlerqVYgt9kQeB/Qzt9ZjzVFcV7XtZuajEIQtHIFzNyT5fp3Ep5fQNm1xPcIBc6krYDwAGnL jrDdyimEzDM6bQKPBMHcphlhPGnLvrSDCUlTzpmWjlkdbobf3tuj0fz3uEHwzV0Jq8XRt1N39o4 IRzzO/2wWQa/Aa2w+gQEmZtNzlDBbnTEyDzfaZPRVl9aJgtX+XaY9MeLw8Y3szMV4ajDY3n8sgi ZilG5OqrIHUBQfBdEkeg8+38oNi5rzQqmixBQPchudb5Ha/uTtJCpf0T14zSqzpGZ4dX/OuguRE 1ZmNvXm54ztwySSzM+TgI0/5G5wvlmc4kz4yNaIG41XZE/z7kH0mIp8ZWlq0oc3gtuGQTW2gLeI a0HNFPoSHJPOap/4LkiijUrzycZ9ur0MqVsJDqDoOofwGL X-Received: by 2002:a05:6000:3107:b0:43d:2be:e54 with SMTP id ffacd0b85a97d-4515dc8095fmr32953188f8f.39.1778491232261; Mon, 11 May 2026 02:20:32 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120ec0asm23743240f8f.17.2026.05.11.02.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 02:20:31 -0700 (PDT) From: Neil Armstrong Date: Mon, 11 May 2026 11:20:27 +0200 Subject: [PATCH v3 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: <20260511-topic-sm8x50-iris-10bit-decoding-v3-2-7fc049b93042@linaro.org> References: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org> In-Reply-To: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@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=TAhQZw0wpyy7M1R35sWEGKNJTx38Wi1ZyfZZ3XckPRY=; b=owEBbAKT/ZANAwAKAXfc29rIyEnRAcsmYgBqAZ9bhS22tB5+HUPMYAcJ2SC4HNr9lw2nFUcUgYKe YqtTvFuJAjIEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCagGfWwAKCRB33NvayMhJ0SDzD/ iQPV5TBPeDhherAbdia567cDu91JKP8PKtYAHmXDEd/XqCRELlvEEJ/NnWPwlgau6K+fBlthiY9p9w 94FD0S+CZvAT/S+Iq8MLBD6XV1tBOL5r7vw/lC2lfVtVAZbe6YYddQ+B+w3ljnOXamYEPhWE4SIhm1 +dBNBE82W5GrtiDewtwIX3/IGnrm/G3/tL/YvTEgJlJCVyNq4m3y3TSLJ3A0FMqG+6cPJvb4T1oq3s LzV6JmodLIW9PQI3slilO1eLRb7CviKxXXc5R5PptcCLyJ1k2MV4l2sJf2Fu65FBOJXennC0/P0wYX C2GbzpQKTBjuqQHBbQLY5khA5FtHOGblSMgaxJJxTeqIWyeVO7xkgjmu2zwxg2nj2D5kCaCfjRPOgC prYxKgNfGpdAur/iTHZsXWPIbgEsqmTkj1TViSpmdiAJlNb+ri1WnSLrAjXaqi1aXxJSVPVx2sEG3d 8A0cQaAU79PSHU4Oj3osWECtVoHcKb7NHLGy8n59XE9P8ewSeofsiaG4j9ACr1/KKAVoSowIb5rHw9 0p7zvgiDse3ffqgeWUFmF3qf5IVykdPos/ZcYunEOTCY62O8TbdcDI9z/ddQkZIK734kO8mjwIxiRH lw5teMsKGhWV/b7kS3wCWpXvZa+GQwC3wuz5N96LV+bW5In59xhAPUuzUY 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 1d53c7414b75..713a63d0ca0c 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 Sat Jun 13 03:30:24 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 B1DC13BD653 for ; Mon, 11 May 2026 09:20:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491236; cv=none; b=OT7QkCIO5zbgou9aPyiQgrDSAJ47MO17pY0rE3so5uR8aclstm+cJQ2u4Bhq5gbqIdc/4J3CATOjkca+UamYH49mBGaORH7GgKN7VPB+5ujeKyAGatT2Nf5crXzGU9hEf2Yib7s7CScDNgl9+NoesmUGiv/YAGUB/rj5MGn7Qh8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491236; c=relaxed/simple; bh=1rSEiYXVcRcV2xZexhpwg0dlj0Dy1rXlTjlNxZeesUM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UCmwBPXtCxXJzmlpRaf20rb5wyu/PON/OLrfnh5IqBubKLB0i6MU1wU/4C98VfBCjS4Pr83NCwwRYnHZpA7Ow690jGdpcgC+0akfX5zwVJ/S/ONQVWkTh70EVS0jHOvUC9G+Ij4a7Ms79oiLnA5ZucKkadFDR/bpFcLPhikSFkE= 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=xuEgCN80; arc=none smtp.client-ip=209.85.221.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="xuEgCN80" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-44985f4ab0fso2274007f8f.0 for ; Mon, 11 May 2026 02:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778491233; x=1779096033; 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=YyBxidac3NtDJGTYfXnUsepNfGEUBvJmRFwXoFqDASU=; b=xuEgCN80tBHUyHyarb0IRp4Hv2wu2tDUMwTSAuZsZCkldblYxGnfPoLru9gatcM2HK mGr0L3DJ+/h4NYvvd1KIVVstkSd8jNOQfPrgPlPvBpF7HpO/cyYeGRBZ89v0S96sBuME KY1MsrKmuDvKJskNk0kFY9QKXeGRcZ2Soe/qUxzzdSUZgiE77Iyb4qUKtehVhF/a47Ov Dzh41Wbe2DzpPcmAjaxekbXYyjNbwBWHx9BVXPwQLMCi8kvt/WYfhbyZlfXiK1pE0xZp BCbwMZbSqbYfiR2xVgGqtoAjBouoC+iLC4ZHQEx3Gkfhyf6J5TuRcFmk8CLDeHUB9fpY 6BYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778491233; x=1779096033; 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=YyBxidac3NtDJGTYfXnUsepNfGEUBvJmRFwXoFqDASU=; b=AqNRUp2N5hDiOsVA+0hOV2LgujNDRbTTZIzSqm+2RKQFlKk2OjbAFj5g6Sg4ftUMK2 Ych2jPZA1++f8mJ3xiSWemj9j6PJViAqtoDv9Pr2kjWNhkFJtnQaPlWUekccVXcCGhKy FR8nQwUnVEPC5vjj+5CfIpPxtLJnyRyY2TPsqJEv/wF8sCEy7Y081R2klLlv1nV+/1Vr GFL3tagefuhMEZUybIqB3yOrahrsuGyqd4TyrAkXz226xQc1vJJRtRPpYIQQaPn/eI9e MlBlm16KIl0Q4Kx3lxT7oPDz7XDP9aiPV0e7C3rjFUx/U/87r3cT0qE0Ulq50V0vvkne hODw== X-Forwarded-Encrypted: i=1; AFNElJ+DtNdFrznuDkjoZ0LzbCQJRlLQXs52O1yzMe+dBUdJcNm03r00VaBUnlnSeXcprvf/Fn+0my5O6HC+LTk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz4n1GPVFkA/ohlPJnBgJbWGHnjqtTZfyWVwZrpjith2yO0r+0V NmcRZxsGVmALRURZZzuJdYdUnhc8GPGznVnHrNNJUz98R9r0ZjWEA4J9Rku30HsZmPTkTG+M5L9 GBn5jkiM= X-Gm-Gg: Acq92OHzJ1p2oYqBFvJzJJ0vppr3Ai4TDinS+cZAIBr9azk2zFeN4Wz+XwRpXXSKkJw TBs5l+dGF/QsMP3DiiTcUX5CvOmXTXtZd/l5O+xkNM51F+LfV9XPytQxExYR1wYnCUTJm8++qU5 1PPb/n9pJC86/Rw3MJ8DNcPD3GYp2LeWfles162cv0Bj2y/qKGsmigHTbjOxnwYuhprTxzGMrrf HQ1Ou7s2M/EJv8EcInthtYkHvUUeJjMxfDQd9R4xeYr/+tQqKdlqwB1sMDIMnUkMGd6Zkr29vNP SAgkvCQNdJSG713MpT+cSxULgwDyCFH+ZClI45kPdxCwa2l8s4ki2rp4jOdCIVW7CAx6PMJt7sM vewt2/ZnUoSdrl7XykFUA3ljrmrNtj3deZqSd8LcNE4IdgeJX9IfZMx/5YbTbJcZ7U825wj6fjl Ui1u19WKBcCxnhSNbQ7gMhnqmH7bmmfOgy0p+ywOnaHnw8IG6wAecYK74= X-Received: by 2002:a05:6000:1acb:b0:44a:8c10:40d9 with SMTP id ffacd0b85a97d-4515cf126camr36818311f8f.23.1778491232973; Mon, 11 May 2026 02:20:32 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120ec0asm23743240f8f.17.2026.05.11.02.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 02:20:32 -0700 (PDT) From: Neil Armstrong Date: Mon, 11 May 2026 11:20:28 +0200 Subject: [PATCH v3 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: <20260511-topic-sm8x50-iris-10bit-decoding-v3-3-7fc049b93042@linaro.org> References: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org> In-Reply-To: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@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=6336; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=1rSEiYXVcRcV2xZexhpwg0dlj0Dy1rXlTjlNxZeesUM=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqAZ9cTMpGz9hHL3CBmXtJTHK88dJ0Grgk0mZxXc5l WsCctDiJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCagGfXAAKCRB33NvayMhJ0e2IEA DMCbqHjs29ducCTXdmU6qwuUQ+NxaJrWR9dnYcrQa7v/jJVBoP3yeOvnNFdV5JIyXBVOwWCJS0CogI PP4oySZL+a//8nrDW4YTw9ppdv20e67m0XWxYlEun4tk4rabT29tuUmBphOtePQv/25XRY1U0mmKIt lNZbvD4S+Pr+cRJ3nnFeyBS6V/Q0qVtvh5n5n+gENjtMJ29FfRiddXYqoEmHT4euJ+DQ7cCq9h/ADj au+7EsoC79FLMX1PsXaSjcsBSpcLOTD0v5mwGIUpnDtQWfZE+a9f8mN3cf8EU5FzZ8CRn+Ikltmwku a1NFzLYffEwUjG2M6Je5Shve1h8gBfxatJxymmTiyUX0KS1s6W2RDE+f71uSzR3/+A46GIRB3OlYhN Xe/UJp7tdlJQUn8U5vycMsRQWISUhP7O/jYXUXdLvYw0tK+vyl2O0cSa8NZ3wXSLMHqZ+HvzQi3r0K G4XmV0jXyW114MhiqcKxJkRPtrEr+QMuQ3BNKhPtS56Wj0dO5qdxjDO+kLsHR6nUBHLcPyt0WrVwuR Lysua+VsYwPJ9VXSIvMkz31sLRGHIqP4mTlHefqHbOk+AuFE98HQAp8RC6l5g4f1y6HQThdK6i7nad oeGivgJxRghJ2QuXURzqsXw3SguMvDta96uVY23x3VRxynmzMOCvE6rg5iBQ== 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 Reviewed-by: Dmitry Baryshkov --- .../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 30bfd90d423b..89de8c366836 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -481,8 +481,20 @@ static int iris_hfi_gen2_set_colorformat(struct iris_i= nst *inst, u32 plane) =20 if (inst->domain =3D=3D DECODER) { pixelformat =3D inst->fmt_dst->fmt.pix_mp.pixelformat; - hfi_colorformat =3D pixelformat =3D=3D V4L2_PIX_FMT_NV12 ? - HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC; + switch (pixelformat) { + case V4L2_PIX_FMT_NV12: + hfi_colorformat =3D HFI_COLOR_FMT_NV12; + break; + case V4L2_PIX_FMT_QC08C: + hfi_colorformat =3D HFI_COLOR_FMT_NV12_UBWC; + break; + case V4L2_PIX_FMT_P010: + hfi_colorformat =3D HFI_COLOR_FMT_P010; + break; + case V4L2_PIX_FMT_QC10C: + hfi_colorformat =3D HFI_COLOR_FMT_TP10_UBWC; + break; + }; } else { pixelformat =3D inst->fmt_src->fmt.pix_mp.pixelformat; hfi_colorformat =3D pixelformat =3D=3D V4L2_PIX_FMT_NV12 ? @@ -517,7 +529,8 @@ static int iris_hfi_gen2_set_linear_stride_scanline(str= uct iris_inst *inst, u32 stride_uv =3D stride_y; scanline_uv =3D scanline_y / 2; =20 - if (pixelformat !=3D V4L2_PIX_FMT_NV12) + if (pixelformat !=3D V4L2_PIX_FMT_NV12 && + pixelformat !=3D V4L2_PIX_FMT_P010) return 0; =20 payload[0] =3D stride_y << 16 | scanline_y; @@ -532,6 +545,61 @@ static int iris_hfi_gen2_set_linear_stride_scanline(st= ruct iris_inst *inst, u32 sizeof(u64)); } =20 +static int iris_hfi_gen2_set_ubwc_stride_scanline(struct iris_inst *inst, = u32 plane) +{ + u32 meta_stride_y, meta_scanline_y, meta_stride_uv, meta_scanline_uv; + u32 stride_y, scanline_y, stride_uv, scanline_uv; + u32 port =3D iris_hfi_gen2_get_port(inst, plane); + u32 pixelformat, width, height; + u32 payload[4]; + + if (inst->domain !=3D DECODER || + inst->fmt_src->fmt.pix_mp.pixelformat !=3D V4L2_PIX_FMT_AV1) + return 0; + + pixelformat =3D inst->fmt_dst->fmt.pix_mp.pixelformat; + width =3D inst->fmt_dst->fmt.pix_mp.width; + height =3D inst->fmt_dst->fmt.pix_mp.height; + + switch (pixelformat) { + case V4L2_PIX_FMT_QC08C: + stride_y =3D ALIGN(width, 128); + scanline_y =3D ALIGN(height, 32); + stride_uv =3D ALIGN(width, 128); + scanline_uv =3D ALIGN((height + 1) >> 1, 32); + meta_stride_y =3D ALIGN(DIV_ROUND_UP(width, 32), 64); + meta_scanline_y =3D ALIGN(DIV_ROUND_UP(height, 8), 16); + meta_stride_uv =3D ALIGN(DIV_ROUND_UP((width + 1) >> 1, 16), 64); + meta_scanline_uv =3D ALIGN(DIV_ROUND_UP((height + 1) >> 1, 8), 16); + break; + case V4L2_PIX_FMT_QC10C: + stride_y =3D ALIGN(width * 4 / 3, 256); + scanline_y =3D ALIGN(height, 16); + stride_uv =3D ALIGN(width * 4 / 3, 256); + scanline_uv =3D ALIGN((height + 1) >> 1, 16); + meta_stride_y =3D ALIGN(DIV_ROUND_UP(width, 48), 64); + meta_scanline_y =3D ALIGN(DIV_ROUND_UP(height, 4), 16); + meta_stride_uv =3D ALIGN(DIV_ROUND_UP((width + 1) >> 1, 24), 64); + meta_scanline_uv =3D ALIGN(DIV_ROUND_UP((height + 1) >> 1, 4), 16); + break; + default: + return 0; + } + + payload[0] =3D stride_y << 16 | scanline_y; + payload[1] =3D stride_uv << 16 | scanline_uv; + payload[2] =3D meta_stride_y << 16 | meta_scanline_y; + payload[3] =3D meta_stride_uv << 16 | meta_scanline_uv; + + return iris_hfi_gen2_session_set_property(inst, + HFI_PROP_UBWC_STRIDE_SCANLINE, + HFI_HOST_FLAGS_NONE, + port, + HFI_PAYLOAD_U32_ARRAY, + &payload[0], + sizeof(u32) * 4); +} + static int iris_hfi_gen2_set_tier(struct iris_inst *inst, u32 plane) { u32 port =3D iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLA= NE); @@ -620,6 +688,7 @@ static int iris_hfi_gen2_session_set_config_params(stru= ct iris_inst *inst, u32 p {HFI_PROP_OPB_ENABLE, iris_hfi_gen2_set_opb_enable = }, {HFI_PROP_COLOR_FORMAT, iris_hfi_gen2_set_colorformat = }, {HFI_PROP_LINEAR_STRIDE_SCANLINE, iris_hfi_gen2_set_linear_stride_sc= anline }, + {HFI_PROP_UBWC_STRIDE_SCANLINE, iris_hfi_gen2_set_ubwc_stride_scan= line }, {HFI_PROP_TIER, iris_hfi_gen2_set_tier = }, {HFI_PROP_FRAME_RATE, iris_hfi_gen2_set_frame_rate = }, {HFI_PROP_AV1_FILM_GRAIN_PRESENT, iris_hfi_gen2_set_film_grain = }, diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_defines.h index cecf771c55dd..68f849232906 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -118,6 +118,7 @@ enum hfi_flip { #define HFI_PROP_OPB_ENABLE 0x03000184 #define HFI_PROP_AV1_TILE_ROWS_COLUMNS 0x03000187 #define HFI_PROP_AV1_DRAP_CONFIG 0x03000189 +#define HFI_PROP_UBWC_STRIDE_SCANLINE 0x03000190 #define HFI_PROP_COMV_BUFFER_COUNT 0x03000193 #define HFI_PROP_AV1_UNIFORM_TILE_SPACING 0x03000197 #define HFI_PROP_END 0x03FFFFFF diff --git a/drivers/media/platform/qcom/iris/iris_utils.c b/drivers/media/= platform/qcom/iris/iris_utils.c index 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 Sat Jun 13 03:30:24 2026 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 904333A8740 for ; Mon, 11 May 2026 09:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491238; cv=none; b=Q3JWj10pd4b5tHKkYSZvLTpRamFGNkg8wuo5Sv8XHaKapeFZ6VmrhisRQRYbS4TlXoaG/dFX/uRCJ3Pf/oxDEyypmFk5s9/13kbHu62MDg+p8BdMDNtKtfIksWchoSGjFG+r7NWfgY9NmGqLFGTdYRptmkn8YOGv2X9UBjpBMmI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491238; c=relaxed/simple; bh=aII67ihvk6yUlrAWkvBSxcTsViGo+wxhGgK9MlHyzZ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eUjN83P2K4KjuKm/dqPK3HKzbqR0MOp+yEYDzwxkctYRu4luN9Xktoe1RpJn6f8Bxo43zexvK8kFAzu7yalbOfqntf/JJMG3YI+HY74n678wMqzWD2HFCC8ghPnjuR36xwT6baMPHzly4t2PGmn+W/Xw7P1rhj8N+YILHgSWAi8= 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=dQntA0MB; arc=none smtp.client-ip=209.85.221.52 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="dQntA0MB" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-44509921fbcso2000504f8f.3 for ; Mon, 11 May 2026 02:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778491234; x=1779096034; 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=v88vZiME58PShFsdqu58388c3o6S1JEPT0wDwwHJzQo=; b=dQntA0MBTKiuKz2WtImtD5t60IMOM0HFsB+ad4WTop9JLbOTEieCWUzm+BXTSZE3xE Dksr83/oSTXZXKMwGnN5EEsdnezHq24pJn1AMEci/Yo1YRiCHZrfpjHQrT9rBt9eIzGK XZaXvn6EMf0UARBE4h+gubQwSbOE5zWgIGMdpHu+oAVi3t2KlrgezWBO8dBDPH8Vhf1G k2Dsdu2CAuQvTtgDuZrvhj8M4EHzaDjYZAzkxCE0p6yf26JQ31fM0Mxr67l62AEs8Mqp cqvJCMwnJlZPsno+hD5SmEMAnPxuP1D2CJk6cpUmEui8RE3eexrsUC4ecweibB1K9Na8 HQww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778491234; x=1779096034; 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=v88vZiME58PShFsdqu58388c3o6S1JEPT0wDwwHJzQo=; b=fZJ7Q5MxBuYar2nlkuVibaHf5/1GVTid24P4ercdUzoeitfry+1GdHO2uztYum8isy 9eZ2fzvBBaNUdBLLc+DvFTNGUA0JkgelXsD9VnZXHOYpyRkDwyq3qxBa8DTZnyyDBJlb mi3LlaVuj7YV/KOj/G8prcg7vbefyDAeffysdiYQSn2uU3kZP4Z4+Hhu6VKrS+6spvf0 FydwrjwKbJJNSL5c9SUHimshofE/1T+AohFhl5EXL7cI+e+cV+TwTJHz4cnnY4MzLXrM wyuQ3XOc41elwo2BVJsrMk71eW5JoT4qaecm+qdz9JPwqzIStkSX4GyLzDs3qGjMuhA0 qVlw== X-Forwarded-Encrypted: i=1; AFNElJ8jguRCWqYH+WATXnTns0dlA5wWLg00co6M9d1IW3+kOAWGPSqoYLotQT+67OaNbFIvxXPC6FEYMruvgSs=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+LGz10jfYbr47BORfYivtYyyDIXWHmErOOgggTqPybtW6OgiD iM16w2pxcjFg1vI09NB4Zm8lxkqSNhcD7JIpr6bYFWuc8heg/gl+1efNvjlnUbezCog= X-Gm-Gg: Acq92OEiJcgYK0tr1F5a80qes5wZDSrgCzjBraCX2l76fprck8Ha83lS/fab0KlYUXo DSagXAiNRjfMHb3C3VaUqJ1D8YP6kJLFn4j5c0tuewY4i69iaQsw+fQ4yYYLuRfHSwkSPdbt2/v 0v88shKn5MSNqkkKiw3n5stMX/RRRAs3UaPfTLV68bIZlBs+EaBLXWPm4h9GpV/s+rG5csd8tvu bN21W5ES1SCaBPXAfnPNIcRKbO8XRKiO7sRFgndgo/8j74G9Z3/PrH3NrsFhVr9OC8lO2sjd1Cq DcnDAewXgDl0AMuj3ZB7qgDLSA5wmHnmc1kVg2uV/a6ScQn7M/A9udGJ0Ky1JcvVqALIWPyvOJ1 waG5DWFt7/52oWRf8IINnLFtNxKn/DDl1AzIpX80huXeD3Vybf9yn1xEUwad6sBi5Ll5G7iuDAD i64YHqqwSccrfg0qluQl9slmYO6HEfA0agEXW3OtgD0bih X-Received: by 2002:a05:6000:2910:b0:44d:821:1a0b with SMTP id ffacd0b85a97d-4515d3dc326mr36238691f8f.29.1778491233792; Mon, 11 May 2026 02:20:33 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120ec0asm23743240f8f.17.2026.05.11.02.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 02:20:33 -0700 (PDT) From: Neil Armstrong Date: Mon, 11 May 2026 11:20:29 +0200 Subject: [PATCH v3 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: <20260511-topic-sm8x50-iris-10bit-decoding-v3-4-7fc049b93042@linaro.org> References: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org> In-Reply-To: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@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=aII67ihvk6yUlrAWkvBSxcTsViGo+wxhGgK9MlHyzZ4=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqAZ9clzKk7rE0y/SqTAcN/l4Kfj0bsYZzPqYYJxhE JzEUUUeJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCagGfXAAKCRB33NvayMhJ0TNXEA DGea+pvS41Wjtw8W9lVq/xhhnkwqXLyA4XKTPVknG/xOEydBo8suxd1pskqmfG560BKgxcNtObaGTQ azkt1DdgFo+ZasPRfcn7Zmsr0wrKntAmDddobpiyuhelZP2+kvvqeUIilFSXqR2195XIRY+xHVzLzQ pEHkC7FpS1ijPyZ+8jR3jBpo1fdtdSom41qxIgqiOiGiJamdAvL9sKPAd7fqXkcaoVgFlZ062QCN3F m/wVmJpL1wJ6b1nReR2TzL41HmvjIzpvO6MIebCunxpUWKPlyBGoeKJg+1yUcjEhMNGYHbevuBWT4a iJqiySma4XCu6cevlMxM25pw7jqvh4oaiSmcxQT1aCQrmf+4tx/Wch9f4jWo3ynBKkAk5+WJ09O8ZD Cj1Tv28Mfb5D80C7tEHgkpOygeT04UjLWDPkV9aLXMpbH533oL27JH++BOqAxyth36OPqcKE2Jv0NF EAKNvu/u8E03g8dqWGnjl7mRGH9+cygO9guTfA+0l4pbeAhAelDRPxEZdCQ11GtHD2Ah+ZGwBdJpGE +fQhX+n7brKc/ZK2JoyauMjzOUya9XoO7u4nBFQHV3pwyTg6Or9m91lE3emZQDw7FmZn3o9qVKuH2g tHEjR9FJr0900SUGb6MS7nRR6GC7zDF1AfiuJReCSldQncByt+mKKQxRiVBg== 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 Reviewed-by: Dmitry Baryshkov --- .../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 99d544e2af4f..eea69f937147 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -266,10 +266,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 Sat Jun 13 03:30:24 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 940383BED2D for ; Mon, 11 May 2026 09:20:36 +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=1778491238; cv=none; b=EXGp/C2YuJOusUcOYp7QQ60IF0lYMdVCE44ca6tcR2UYKUcjBWs4zzWijsdcycPE3HEiIG/pnGYuxuMuL9dNEOFz8dZAYj2VKXaRfYZ+pDQUEoljZra2ZHaVpdeC+GoD8pDm3wHNFW6LdBvVywyJFQqSU1vacOeD6S/e8HMNYTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491238; c=relaxed/simple; bh=QZuxmCrKzUY9/4DJZBvW/RsakTj7/Vxp1bMSYyTjHRU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=P10XUfIWFZthlbwg6uWUzcg0Ga6aB1eGzpe1QV44/aiPYgjC93erqTlqKNKWp0M/qTfG6Ri7vhN6od9OFzvAjoT25F1Q59FItir3mz0g60ADLrIFfYNafIIyud2ThknruIWEqSMB3vszF/rm3rjNxOfxX6aDzwa9b/IUB9N+jj0= 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=jB0kE2os; 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="jB0kE2os" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4891e86fabeso48074475e9.1 for ; Mon, 11 May 2026 02:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778491235; x=1779096035; 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=8uKDFDq6E8/eD48OfK+PZznOc+DyNeOaGLJOIQrrNXY=; b=jB0kE2osLOr+Dk83W82dX+mQpF19Ns8nUH6q2iYx+DPIJXkvUSMLy1vy00bv7mKJ2L keazgK5wdch9ujVGp6z8zduPweE/HM5mlT5pm0NnNULzokM+3AGTqMtmh1miKgze43su nN9bWLpYN5FG04AoUMwrNU7rCFcB+ZfeqX+96FRh0b4/D+3q8SYzENq0C150tF6xdBEr 8xGVsSVhjdy8PhQpnGOz1EFs1da2bHgcb9FYLrz4E7FoL5UJrhK6ZDqbNiWOgtZEzeF0 4i2U0Hh8DSEsXeYOCwLuno/wvwYhGMhrFY6bdcUVTtrZwXRpPSI1AkWJUZfZKzuuEq4z ixzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778491235; x=1779096035; 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=8uKDFDq6E8/eD48OfK+PZznOc+DyNeOaGLJOIQrrNXY=; b=YQMw/TDpkxRECdZBFdrm6Rpdfzavu2+i/VC+Nk+nanSFjykHojziGaw8PFPcEhMukH aLhzD5otUYRyXNkmJY/qwWYj6g1T0IeIrf75D2IASc9GUqioj8rTKhMYus83Pl6UToV0 zjm5qA6BnhX2Ufou47dWyLejzRCW/QO4EUHncXf2bXuBE5QgCd+ayYGtxRlgy4jnfHh7 6EIbl3zQ7LZwRaKqQoYyDtJMbq9LS1Z+cW2ktnfdqOhFnlKMh5OTGVWmAdpdTm8uBnbP YbiCUK0roOJZRmzgCueH0sDa4t3f916A4LrpBwwTFabXldvCgmKh9YmFz5s9+Dsbyxjf dHPw== X-Forwarded-Encrypted: i=1; AFNElJ9F1IjonRko+qN8fcKoGZ4xBtoxXAdHymI6QZi4LrSCiM9BDvYDXz3dck3sl+05dA5RNgPXfen3TqtqhU0=@vger.kernel.org X-Gm-Message-State: AOJu0YwIfCcmS8rChhRpKVxuDxQXlAHPHqbo+u7pKXNi4zUz0PNL+Xl3 LZ9ecMrwRqhgXM6zDBRrlVl9rB/Km0uHXLmrONC1hZKIturdZ2D9RybzKJMXOBXP39c= X-Gm-Gg: Acq92OGCxqGjMxhL68JBQdCKm0LDWt/fsnGmc9vDkzjybah77nyD+APJAueob9lWPvh zmQP8ZZqQuC5uP3KdeU9qJNe61U0uf+Vv+qb1I5juJ6LvYE6BPvi5XTW6D1bkYs1+FjD3cnEnFi PSyb4KG9NXDBMpnsenB3xM1fz2FffUQDbT6HaxOJblF02afCg/yAlEXnmRz/SqL2KzP5FHgaExD w9oO3gCQhpqDgIICzXOynTAH55l5YD6rvbxiVsJrYLyirMBbniNt5iq/MqejQ6DN9Y6kCi49F3n MfOdNyVwDPuludZQ/NUHRs1Vo3fcMDdSmckhjBgya58HtXcyOSB/LKsoHvziKm18pccLkgogi+G ZNOlKpQt7ypCKpk5+P+7scsgsKNV6CEb1RKYcvUbfnd7meQPUKBbQbyrPQYbPj67LeYmk19y7Dk JMZs/lis4AKrJPlKh4gUfejWtYZCFifUN+j1ixyzXvqiCLGCgiHd3eQUM470iCj+XWFA== X-Received: by 2002:a05:6000:290f:b0:43d:7af0:3a7c with SMTP id ffacd0b85a97d-4515d3dc24cmr36669919f8f.29.1778491234498; Mon, 11 May 2026 02:20:34 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120ec0asm23743240f8f.17.2026.05.11.02.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 02:20:34 -0700 (PDT) From: Neil Armstrong Date: Mon, 11 May 2026 11:20:30 +0200 Subject: [PATCH v3 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: <20260511-topic-sm8x50-iris-10bit-decoding-v3-5-7fc049b93042@linaro.org> References: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org> In-Reply-To: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@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=1866; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=QZuxmCrKzUY9/4DJZBvW/RsakTj7/Vxp1bMSYyTjHRU=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqAZ9d9BsAPVj1mBVZ+AYXUx2sn524eS3AODUszxx4 KW545AqJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCagGfXQAKCRB33NvayMhJ0dSxD/ 9EW3HTL0vDojNVspto/DqfUz+dZnPXlgKd4cCHR72RhQclrmBNfexxUoZqU9mxmGY0/lPkIftsz1zT 4O8tSVaZpThR5Ds5CS+TMWxuUj8HtcrQisMaBTmqOKiBVUB4Tf/50CNjTk3hvpx5x5OJLYFEANlD4S JLlRg65qHzPBB40XAqbJH2W3RQAjc4gC6hgm7fFoyI5cxmzliAwDb2rWEbxXFYkdkIMbrk9H7eZj4z aO6NYRjnVjshJQL0DdloVNScd/lY+8LQKESplWQVOJ+EzdpVknUy/yVo9GwDlS3kX8PnKkw7fbBgtt cOSelzRccijlH50wEYJPm4hOatLN1n65f6JJ33L5OGrxehfLWpatyjRVWmPNEYkM4U+CrS8HAZClub LN6iLCICGNcqHtDqzHBFv3OxADMD3bCrb4jhH/b5qx+6FKWKolzNE5eFh1QxtZyM0UiYzrdjYHSAlg bANWxUkzearxKBGLMIM2Q0QsuQD/BhXTinvMtQ/0x+9bXoyNoP80TyL6E+eWenHIaM4lkRQr5196PV PbSKAyu0ayhq6sSyA7IwKtj+1qkPI5bS0TyXa0wAiZPm5+nPlY4dQ+bU3X7aazvGqWOhspDI9pwmd5 fiu0YzJeibPnSPmYglYtha8JLTibFiqVcuaIQYDnDnPsBp1UWqsN2CRCG4qg== 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 Reviewed-by: Bryan O'Donoghue Reviewed-by: Bryan O'Donoghue > -- Reviewed-by: Dmitry Baryshkov --- 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 eea69f937147..f4d9951ed04c 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -99,6 +99,16 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type) 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 Sat Jun 13 03:30:24 2026 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.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 5F7623BD22F for ; Mon, 11 May 2026 09:20:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491239; cv=none; b=PeEQZKK5fGZgwJnjv9GrrSTO7CJ/C2UFfLHz5pXdVsYPU3PXmDnVJZp+zqJ9YSPljQhz08towZaeUpYIxAUmKn2Nj55Zlivb5aE6Mu6MSvDUuCSSZEnfVHETUAopt9vMALk8bckopjuPYpL0xFn+sclZm4CPtUS2QjJ6xNQU+HI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778491239; c=relaxed/simple; bh=0XXM8SATZX5xddyNGVmVrzd/1VHNcnt9h/bLvxKqu7w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=J5APFkI44tGDfvemdxj7kZVcLYmgx7gIWcJPm6KKQKcpumC4r/3TfcBj93O/ikzNOPMAsY+2T/K39mEAtH51kj+mQslfvY23w3PHIBpXOW4kWVMSXYysf4BfHAI1t7LFRTbT4/5L4Dg/NtrX6wnbnQ2CoSjMPkHMS1rwBe3gu9U= 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=adzzzydg; arc=none smtp.client-ip=209.85.221.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="adzzzydg" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-43d73422431so3140843f8f.2 for ; Mon, 11 May 2026 02:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778491235; x=1779096035; 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=P3AzCwGuPnUfKtYTICegT0okxDHwk/H/9i6HDV/B1Ww=; b=adzzzydgm+FBvGd37deGXznKfTbxPVIk1U8u2hvdwT7qcDcsd/P3Rur4xl5CeyBDzj jeQUeNKwTbke+S7k/3DhXotn8gnQGJZVfnHciWSEwarm9ABRJz5VEFE1hgzwW8HBS0g4 /HULEctAxqrkksy6O7d5QGhYPutxaQC4AnWxYpjDmKxmVuknlFNgmf19HqD1nE7+k0L8 oakR/rEjNaTjZfKEUsPC6digGYR9ijEOsxFtuabMLbkgQ/D/wfPgFVokVxtKtePc4GmZ 30lE3d3sgCXRYeOdZp2lamkjWfhzJ2xElLFQ9fmNVK7AIV1XHh8bYACj6FZhAPIEy6YB c5pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778491235; x=1779096035; 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=P3AzCwGuPnUfKtYTICegT0okxDHwk/H/9i6HDV/B1Ww=; b=qqjdfE7ec1xf85DwQTgAgZbmX6iVn5boHkIGrsYF2bZJY+R33UNvJUMpAMLUXB3+QJ EYxEcV+6LDKQqh3BbewK4kA2N44YdsylED9fjjzzDg7lXsZ3lwBegjQzo+qmqNpH4fnL /Y7Fl4HLuREjLd62kCZ53fHpD7gJQw3tcMdhK4QBCGRzwEbpZw+miBjwlFQnj70tpXGj u1L/1axdd9REpLVBTwci5Cqx87/zjAa2TR59aJFOCqUk5m9nW+vkZrX6HJ2E70ND478L 02ihxBgIuursk2cB9dbrrfE4t6WMTM/+VszFh0S9DW806Gzet+OhkVVbde9Jf3r34QSz qUHQ== X-Forwarded-Encrypted: i=1; AFNElJ9aDDhHrU/vKjouvldDQqqpwJC2Uw5HBzW+w2TBF0wYzVpHVWyP8SWPgzaQd643lY7eASGyLugXabPMohM=@vger.kernel.org X-Gm-Message-State: AOJu0YxG5JL8X2VI3PmSjsu8reut/2joogsIJPcRf79r8d9tW4j3d9s0 PAWn7XCIRBY9qqBma2QJjBXYQvRpnEmISbPDSXEDGdoL8Pjmdl4nZ3TyyDwmYwYxn2cEatuMnlO SfYs6FBQ= X-Gm-Gg: Acq92OEgBIt/vZnvA8M0gPsgGzdu0rK2UjDBMIkGWFsh069fWhSNZq4D2q2aQ2RArXO q4dt0FlDZM5VH5ljQZS7Vf70q2BCw1F6meNtq5o6crLENrf4+pyJubOrXQgmBEtNgHPMmO/++Eg xo8yTE4p5+Lz0GgCqgFfE/18QNZpwS8Wp7iqSY2zjNszFvFMG9lIGow1gOAsK56q7wF+6hcssFK ttHKdtSRNx8LZkd6xopUnhEU9WO8J7lxy6LqzVEE7omeFn3vp3px+gNB2O6IQrt3kKUjq0tNtdN TbAkv8TMK1kWCpzZc1C1pySaFtLJiQk3ZSLLwacQlGXQhkVmy0/4vZLJunkOAf4Ck+pvWOKbBdu nIOcuWCnUpmGpy0GcoXvBc9knQ4KaIYp48NGwAkJyV/nKhGvgdAnsyp4SNNqp18L11gncjgAbxm BL6jb1F09e1ba15JMm486Uf6fOnCyBg9JcqKSvE8b1mf2m X-Received: by 2002:a5d:5f42:0:b0:455:460a:33a5 with SMTP id ffacd0b85a97d-455460a3511mr16709478f8f.34.1778491235232; Mon, 11 May 2026 02:20:35 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4549120ec0asm23743240f8f.17.2026.05.11.02.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 02:20:34 -0700 (PDT) From: Neil Armstrong Date: Mon, 11 May 2026 11:20:31 +0200 Subject: [PATCH v3 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: <20260511-topic-sm8x50-iris-10bit-decoding-v3-6-7fc049b93042@linaro.org> References: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org> In-Reply-To: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@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=0XXM8SATZX5xddyNGVmVrzd/1VHNcnt9h/bLvxKqu7w=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBqAZ9dmMvT6hxbqJ8xf2FZ3uINwpHDW5NYpaS6MkGv sFkDMASJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCagGfXQAKCRB33NvayMhJ0YfND/ 0eZA0rBVDpF0xsJITUqLEN4s4R1NjLiUYG703AB9PtoNS/8zULIbatBdTuQ4q5kwB7jDeZsYOfgOTE xqJO2B6z3mvAnrWrE/juPT72gx4TnUYDxfg/JFMlo25n9Q0RPaErIFBW7aIdyytsqvMRHAdDX4hJ0S WRS0c7xPMSC/hAoCZf0RrPBV5DCuZFei7wqzGnFpqHy7FousNfmSXCvk0OZQnQZf53SZfXj6pzXV7N UIwH7y3jFNfspWFjsUYkpheX2iasvybuaobxsadqJTWXTjph643M1xOLhCv8znQDlVtBU1XH6zptjp QXOTTDinNK9mkrkh5iDYPOSNQBqnKNZB5YxmerCHKQfYudeG1YRop66Z8v0pgyXjihXxEufEDrOk/1 JBTRRZPi0WlzEIvZbrsDIVxtG4lg9YxVH6RU/mgHoXx5iGZEUpcVNxNrw9UJkFsHUsNB1Cr2Pzoqyx +mHgwqiyBuKkDK63Png/ZqKjiYJEZEPbF9hU02CZ+BgA9Nhd0o1Bx1Av9VYLCkAZxsAKiRsnSU5bhs dAKu3/6mYi3gWwvcDW8Jkdjg5MrIZz9jRK8nhTqIeZVk/DJTa2MGVgKwkC1Egk+YAYPpdhKTJ8JXnZ X7rOqW68j0p5mcv1Th4uM11VFNFDAoTCxtcqIVSFFhyV/2+RikDilsmTh06A== 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 Reviewed-by: Dmitry Baryshkov --- .../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 f4d9951ed04c..65cf509e4aef 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -70,6 +70,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