From mboxrd@z Thu Jan 1 00:00:00 1970 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 11DB6396B69 for ; Fri, 17 Apr 2026 08:03:15 +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=1776413000; cv=none; b=lSyZnaa/kkRLzRzpK2AHU3Cjzifis6dNHVx94L2G6pKYf9e0d9oPHfJ0vgdq6sytbDScx9AYq+Htr41cTwit68iSp2FTQXnBHe4DlChos8kTw9heUFM169YHq+xKc8hnPOICnYrHJu+r2D5l8oS+9Mca9qPBNf7V5/iiTfmblyw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776413000; c=relaxed/simple; bh=BTJjLjWfUvgTCIjBLnvcZjPN/3AECIIcbi7bQaSLpt4=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=p0+osX2klPkkKQjD8Gs/uKT/ZGPPe5jN06/uLwPF2SnpkB91CXjye1liZyOMyCws1gr6AWSRi4g/M1LoEgr88pberCp708FLYkEWpDjpM800mS9et7Dvpxd48EpaXD1/X6a4ekA0nCn4Yhe2cFJ8cCskXujuN6ZXEiuNa5qAKXI= 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=bQ0VmohW; 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="bQ0VmohW" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-43d73422431so250553f8f.2 for ; Fri, 17 Apr 2026 01:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776412994; x=1777017794; 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=a8pmYuJdAVErRS/Y++PivAAgpE/JcE8cwNEE0jwueEE=; b=bQ0VmohWs+y7qHBluHVntOVBHOszxuHl18DlkItVfAcNOGnMuS1eBojDPbOot8I0LD /5t+RzQ+I0sFcdqQ2FShBQ1phziyrg/QakaUAF/l25qDjdv6OBbPzIQdGjTjblM1mtfn tgeCZERlJ6piTgI+CSR5jtX2DZyjDnB7TOUtnbNsC0BcxJdKAakqXE5SuSiSo1AnWofO I/Hd/XnarsDGhRy+GSXZ8+/QeeX1Hf/mpenLen53Q0fCYPzCx9xoh6qjK78JTATMxrYI 7W7zVi3A2SaGJZdi8hdwyuktVECPmEFwwnb1Q7iQkRc4x+obNNID0ZC2REHwFIRMlL82 IGYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776412994; x=1777017794; 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=a8pmYuJdAVErRS/Y++PivAAgpE/JcE8cwNEE0jwueEE=; b=eiI2QkMTbBfj0L+E/rU6y27e6YJgfYTnYf6zLbGSzJRV4DzrJZo8AJyXZcPutgNJnW 22z91kxi5XlbkGom8rIdExEreRoppEWHBhUMxDxahyPYn6wsrqFqILTevmyrepJ3ngfH gAWQB3P+iGiaA8Cm4Cle//0pDXv9gI5xUeTuDn0auHzAL55Zymdcrv11B+Xlk0H/Rdq7 FrpixhHXtVUJ2Fqe2fhZpHELpMG0sJESt2+pM3mfeDvXymVRQDK8P1qINGAdn4F9UwJr LkZh9FdHHiuuG+VhMZPfexXdG+rsA/ENEgJZgqmyS+PdLqG8eCSRKvXIYEwI/cPLOcst oebg== X-Forwarded-Encrypted: i=1; AFNElJ+MVgb4PFjT88D3l5CmILBOLGKCxuQJDJPCYIZr82Hy+RXEuz77HShQgSpWVWpnVhFaHceWpT1/fbQQGD8=@vger.kernel.org X-Gm-Message-State: AOJu0YzKCM21CB9/UWjeQD1Oy9vbd7qtgDQAqd8QbEXqRCsnMjx4fOav ygIZmuASy6kHPxFIcsBChfsvz2gQ6XSfDSu5yNRxXK4NOBR0QllJX+uYP3kK2PRliNo= X-Gm-Gg: AeBDiesSZ2q5pHkowaxcNkPzq2a/sF6tAdvIp1dtfl/v3moEJ/KWRVl1FcBmzihvScM UZdcZWEyLjan5qSuLv4lGmHhwXEv55JYEsyHUiDPs6ht2siMCeh2FIdi11e3mer6OsQNzl94yif mcptsuz0u77EyIuAJ60JbvX5nnVlAQcmmqlwXPWlx2xEqho1KxAn7SVzcjnXmpHg1cVzpXFBX4X 3WtwomvUxezQfWUoHAgyn34qNQuteTTmf2FwHuIkQSRIRbT2JW7k0Rd+h0gNbI0FNrSCq9BVPbQ tAMVD8pVO7WNhWwpxq/jg0T2ccQUV9ho8yyFnj4JoTEiKcifCywWlcp5UKJC4Qyx4NLlL0TGj2K W2BEridd/BjFXdCTrjdgks27GZDatdngpSg45OpqRNhD+M1QTRbsrZytLAz7zVZxl3FGqYg7Bu4 E9v5bVBXQjraRrI0pq6ndMYTZaHdlRBYI0O3Xyp7UJQiMbfE0IWLW4PLW96+VZqh81aavyNY95P ZMRsSSeg8bWTl0= X-Received: by 2002:a5d:5f43:0:b0:43d:73d4:b27 with SMTP id ffacd0b85a97d-43fe3e1575dmr2527363f8f.32.1776412993845; Fri, 17 Apr 2026 01:03:13 -0700 (PDT) Received: from ?IPV6:2a01:e0a:106d:1080:b416:50ee:20e:8775? ([2a01:e0a:106d:1080:b416:50ee:20e:8775]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e4d112sm2568221f8f.29.2026.04.17.01.03.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Apr 2026 01:03:13 -0700 (PDT) Message-ID: Date: Fri, 17 Apr 2026 10:03:12 +0200 Precedence: bulk X-Mailing-List: linux-kernel@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 RFC 2/7] 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: <20260408-topic-sm8x50-iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org> <20260408-topic-sm8x50-iris-10bit-decoding-v1-2-428c1ec2e3f3@linaro.org> 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+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAHNKk5laWwgQXJtc3Ryb25nIDxuZWlsLmFyb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K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/17/26 09:22, Dikshita Agarwal wrote: > > > On 4/8/2026 10:13 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..8e547e390fa3 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; > > This HFI is only applicable to AV1, you might see some corruption due to > this. Please check. This is what I saw looking at donwstream, but I had not implemented this initially but I got some corruption with some different width/height, which was solved adding this command. I guess this in-firmware calculations are not exactly the same the DRM driver expects. Honestly I think it's preferable to sync the stride/scanlines calculations between the driver and the firmware. For example I used the same "ALIGN(width, 192)" for the v2 iris patchset which was wrong because ALIGN only works on Power Of Two number but it still worked because this HFI HFI_PROP_UBWC_STRIDE_SCANLINE command was called with the wrong aligned width. Neil > > Thanks, > Dikshita