From mboxrd@z Thu Jan 1 00:00:00 1970 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 CFABE266581 for ; Wed, 22 Apr 2026 13:43:08 +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=1776865392; cv=none; b=XJwcUs159YrV1sufYYqFg0yTxsUouHtQgep1Zi7O+Vc2W1bqEdbEuX2z6HctxddY6llyFIRWxcpfQh00ZY5hcdwgqQh8I+3CrBaQGpkDUKnHXhcnyoJ1gV5wC8aHCGNdZXW1uQ0bW82Ti4NMMQOlZQU/EjnBCfmGn39sJ7lU8e0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776865392; c=relaxed/simple; bh=osBE3Oxav31oKc+/m6zSrJW8cylwlZgxyG2u9ui76pU=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=C9wChve3vsRYdL0oUEfFN10hUWHsl1U9BNXYguO75mneaWXDDLG3quASh73REPaAysJaebFJ3Qkhp7P6U77ZeqWQ43WBuZG1aS+GDTW5Xo74DAkEZSDsB1F5x36kFSidYKAuh15aY1w9/m+QbxOoB6Sny6P4BElMumobLwEXiOQ= 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=Bf6RhLfE; 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="Bf6RhLfE" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-488e1a8ac40so68461235e9.2 for ; Wed, 22 Apr 2026 06:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776865387; x=1777470187; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:cc:to:subject:reply-to:from:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=Iel4FesdLoqyF+cIltg61dVP/cxi4CoyFyS3WL+YT4Y=; b=Bf6RhLfECYJOg0RB0tj2WCZ4rVubNLnRt7RI8eX+fPZ/KNTv993ak6OtwXOhWUY92a +KNlPS93HCLa+wvO9KNHyD/Tc0CmdAmwhrbk6tstCNHd2yDOV1E9IyG7bMfhXEOSngFQ L+SnlamoHOPyWhL+Zi9I80zKTFHx+OS+hpUefXee/0rIw8DIdi3j8/o4QFJRodfCC9dc ZB55I76Slcw6O8wtRuRn6u8tC9dSBxLb7hRX7A+BRXdAHzumppZEzFsZXeZQ1bZxqzx5 9Xv3+LP09oxjUOYaT9eRgB7Dphgip0tdXOz6rNauLKAu9AajOw125nXYG+dRFbPVEP1c CDzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776865387; x=1777470187; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:cc:to:subject:reply-to:from:user-agent :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Iel4FesdLoqyF+cIltg61dVP/cxi4CoyFyS3WL+YT4Y=; b=O7xAJK1KuOOBy1qdR/u5uVhr7uiSkIxHHB9wTSy6R4N1Bi3hQm9D0iChoe+XBSdEqX fgXEawzGJ1q9ITN5KcHu9ZMh6L6s/Bqe0c35g5YX8DsMaQIDxE+ftkLwMG9rb7gwtcie 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1-48a563cd16bmr92329805e9.1.1776865386732; Wed, 22 Apr 2026 06:43:06 -0700 (PDT) Received: from ?IPV6:2a01:e0a:106d:1080:7d92:9cde:4eb2:46d7? ([2a01:e0a:106d:1080:7d92:9cde:4eb2:46d7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fc1c01cfsm468597015e9.10.2026.04.22.06.43.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Apr 2026 06:43:06 -0700 (PDT) Message-ID: <391c1fb3-cf0a-4255-a8a3-94010754eaf3@linaro.org> Date: Wed, 22 Apr 2026 15:43:05 +0200 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Neil Armstrong Reply-To: Neil Armstrong Subject: Re: [PATCH v2 3/6] media: qcom: iris: gen2: add support for 10bit decoding To: Dikshita Agarwal , Vikash Garodia , 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 References: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org> <20260417-topic-sm8x50-iris-10bit-decoding-v2-3-c987b65a31d5@linaro.org> <568c51fd-a229-0cd9-815d-7461606beb60@oss.qualcomm.com> Content-Language: en-US, fr Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8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RYkxXRQmTvqa3 3eDIHu/zr1HMKErm+2SD6PO9umRef8V82o2oaCLvf4WeIssFjwB0b6a12opuRP7yo3E3gTCS KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro In-Reply-To: <568c51fd-a229-0cd9-815d-7461606beb60@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/22/26 11:13, Dikshita Agarwal wrote: > > > On 4/17/2026 3:07 PM, Neil Armstrong wrote: >> Add the necessary plumbing into the HFi Gen2 to signal the decoder >> the right 10bit pixel format and stride when in compressed mode. >> >> Signed-off-by: Neil Armstrong >> --- >> .../platform/qcom/iris/iris_hfi_gen2_command.c | 71 +++++++++++++++++++++- >> .../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 + >> drivers/media/platform/qcom/iris/iris_utils.c | 4 +- >> 3 files changed, 72 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c >> index 30bfd90d423b..d664e606e886 100644 >> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c >> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c >> @@ -481,8 +481,20 @@ static int iris_hfi_gen2_set_colorformat(struct iris_inst *inst, u32 plane) >> >> if (inst->domain == DECODER) { >> pixelformat = inst->fmt_dst->fmt.pix_mp.pixelformat; >> - hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ? >> - HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC; >> + switch (pixelformat) { >> + case V4L2_PIX_FMT_NV12: >> + hfi_colorformat = HFI_COLOR_FMT_NV12; >> + break; >> + case V4L2_PIX_FMT_QC08C: >> + hfi_colorformat = HFI_COLOR_FMT_NV12_UBWC; >> + break; >> + case V4L2_PIX_FMT_P010: >> + hfi_colorformat = HFI_COLOR_FMT_P010; >> + break; >> + case V4L2_PIX_FMT_QC10C: >> + hfi_colorformat = HFI_COLOR_FMT_TP10_UBWC; >> + break; >> + }; >> } else { >> pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat; >> hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ? >> @@ -517,7 +529,8 @@ static int iris_hfi_gen2_set_linear_stride_scanline(struct iris_inst *inst, u32 >> stride_uv = stride_y; >> scanline_uv = scanline_y / 2; >> >> - if (pixelformat != V4L2_PIX_FMT_NV12) >> + if (pixelformat != V4L2_PIX_FMT_NV12 && >> + pixelformat != V4L2_PIX_FMT_P010) >> return 0; >> >> payload[0] = stride_y << 16 | scanline_y; >> @@ -532,6 +545,57 @@ static int iris_hfi_gen2_set_linear_stride_scanline(struct iris_inst *inst, u32 >> sizeof(u64)); >> } >> >> +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 = iris_hfi_gen2_get_port(inst, plane); >> + u32 pixelformat, width, height; >> + u32 payload[4]; >> + >> + pixelformat = inst->fmt_dst->fmt.pix_mp.pixelformat; >> + width = inst->fmt_dst->fmt.pix_mp.width; >> + height = inst->fmt_dst->fmt.pix_mp.height; >> + >> + switch (pixelformat) { >> + case V4L2_PIX_FMT_QC08C: >> + stride_y = ALIGN(width, 128); >> + scanline_y = ALIGN(height, 32); >> + stride_uv = ALIGN(width, 128); >> + scanline_uv = ALIGN((height + 1) >> 1, 32); >> + meta_stride_y = ALIGN(DIV_ROUND_UP(width, 32), 64); >> + meta_scanline_y = ALIGN(DIV_ROUND_UP(height, 8), 16); >> + meta_stride_uv = ALIGN(DIV_ROUND_UP((width + 1) >> 1, 16), 64); >> + meta_scanline_uv = ALIGN(DIV_ROUND_UP((height + 1) >> 1, 8), 16); >> + break; >> + case V4L2_PIX_FMT_QC10C: >> + stride_y = ALIGN(width * 4 / 3, 256); >> + scanline_y = ALIGN(height, 16); >> + stride_uv = ALIGN(width * 4 / 3, 256); >> + scanline_uv = ALIGN((height + 1) >> 1, 16); >> + meta_stride_y = ALIGN(DIV_ROUND_UP(width, 48), 64); >> + meta_scanline_y = ALIGN(DIV_ROUND_UP(height, 4), 16); >> + meta_stride_uv = ALIGN(DIV_ROUND_UP((width + 1) >> 1, 24), 64); >> + meta_scanline_uv = ALIGN(DIV_ROUND_UP((height + 1) >> 1, 4), 16); >> + break; >> + default: >> + return 0; >> + } >> + >> + payload[0] = stride_y << 16 | scanline_y; >> + payload[1] = stride_uv << 16 | scanline_uv; >> + payload[2] = meta_stride_y << 16 | meta_scanline_y; >> + payload[3] = 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); >> +} > > I’m still not convinced this change is needed for non‑AV1 codecs. > I’m concerned this may be masking an underlying alignment issue, since this > property is not intended to be used for non‑AV1 codecs. Even FW team > doesn't recommend setting this property for other codecs as it can lead to > wasted memory due to over‑allocation and padding. I don't see the issue since here we simply pass the same strides as we expect on the drm msm and iris driver buffer calculation, as we already do for the linear formats BTW. It makes no sense to not call HFI_PROP_UBWC_STRIDE_SCANLINE for ubwc formats and let the firmware use it's default undocumented strides. Neil > > Thanks, > Dikshita