From mboxrd@z Thu Jan 1 00:00:00 1970 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 5DEDD347FE1 for ; Wed, 8 Apr 2026 16:44:02 +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=1775666644; cv=none; b=ghcaHc+wRYgYdUl1O/XhONl0rYgcw9E96Ph8a3F4e96OEo1u0HDHhDBcVTgxX8u5YQt0nv74QLuE2dsCCaQwMlDIroo2WSclG9W07aWr43mE5BolFhUWRXC1V5dBpXtBzzqzt3B7no9kNDhE/Coiim2p+F59+icqrdqf97MiLnA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775666644; c=relaxed/simple; bh=pHKyPIFUSfQb0bp0ZKG3yIfhrCTjykMJRoh2sBNViH0=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=V2DYuVxtN4Y7ql88obd5Dfevl8OytOVXCJynzi/RcfqnTT8CsT6JzbCTIOEinXMOYlA8+tZnbsIgsMq61IOdVEXnzKF8JOFG7Cnt2UA2olP27dmTdV+wH0VQrc+VYuGkAygwqCM6kCGOTe47n4pacY+y9lE6oxc+/ff+KP3+VGs= 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=YnRheqO+; 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="YnRheqO+" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso190095e9.2 for ; Wed, 08 Apr 2026 09:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1775666641; x=1776271441; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=jEUkOqpmhVMv8LaBp7+L9Aw2hBHRX5x6gSJKztcEJsk=; b=YnRheqO+50QyxD/PjAfBjvq8p2SBmqWv2UIS2mp7zMoLWsOyoJgyimWr5WLtV2unPQ /3JkPouqcWVIsNXrVLOq9cXuFLJbbyuoaNcPGGJ36Z1wuxrr9uJ7dr7T6FxPhNdshBiQ 0s8C2taOAlZmExIbZSwxYfNXOwU3ri4ZTYWGgBon8hEee7e+6ZzXEqE8peiEsB6YtIK2 bmzT1jK1r4lrf0ejvVBRFqQqgJrOnOTsmkTyyRJ3Sbc9wVngavX1r7i9Ywu/94k+LZfl d6fWDy6OAassdzua4z7spKBt6EtE+6/D7oAVs6cjMQ+LCcD+z3GPfDR6Yda9ug9HP/O/ SmBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775666641; x=1776271441; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jEUkOqpmhVMv8LaBp7+L9Aw2hBHRX5x6gSJKztcEJsk=; b=AsYhUPUXXeeyhkRLxHq1ckLAM5HmToiABvfcufmjnEt82JQnIxWJzAMbUiifw459Gg UJoxFwjVLbjWDYJP0xHzDUeN0LJQQgbM3LqFNx/jfoqJ2E1pJZbZsQ0R1ahGVhSGhFi1 695sOkHI6pj0f7Utgk2aUi0k4Hv2r5IHKYY4L1enqeIYMHM9ufCgfEmY4xrmUU94C8WO VsUh6qU3EtwdhI9tripLAamB4HIrmU9on9HgNPIduFz/ziiglLx44IT3FuapMi55tntH ujwdRU+mOeXczOJurZX/ZQtomU8xxHy+mHQTMBBGz6L71qeFjexdAjYbpAa70q4oDpfK 9khQ== X-Forwarded-Encrypted: i=1; AJvYcCVMs7qRgYal2KN3FkiNkSyjoYK6qjhMLAdvap/Ytw/waJJ4rndZASxupqM4COZcEbvnghSbq8fuXBi4DYk=@vger.kernel.org X-Gm-Message-State: AOJu0Yxr2uHmDo08/icLIeAR6MlDnaV99/J+4lspd4oEdAzjemeW4vrk OzJJRJUsd54bfHYzc8i5ddhhU5TkJIUOZih9Oe6Elo9BmEvshTS3ruWjWmYiS/dWnB4= X-Gm-Gg: AeBDiet3QgFb6aAezPkDI/VxCHPfvSj0z0Ep7dTUnMHagWO3nnkWWIXHylnMCxI0cy1 mOMZ6WLD8JjF+X//0srdH+iESaGAH95vY5UniMb5K3rB/eqDqKJtuRROcg1pt0xVPmQcywie1gU cXXVFvP0XOHFbc3fB3O9/ciQ9lGP8nUYOQCcLHUiGuEKgeDKlU5qvA2ndjWR5E+CQL48Om2BQv0 mUdYpjd73WAkJXSIFskz6v0HBd6kiJ/fKZYsMJ73Bi/D3nh7PK9IeVGcMkY6OPaF4FMCTdSt/i7 M49w1zyt5jzcCnuVgmnEUTbjC2X9RPNqzqxXvA90YOg3KyvjvRAgT2NcwGcSsmwkXhSXhBkc+sN Q7BK9FJul4VuXdfmmuHIvqf+QPVN+wzioUiM3SUim9yHNQBhd9prc0LPFn+D8eZLj6ochG9swqr 0kwTi5WeVC207eubQT44Pu3TdLgWOk4hCgPk+iYNxqxkUP X-Received: by 2002:a05:600c:6cf:b0:488:a824:fdff with SMTP id 5b1f17b1804b1-488a825003fmr116775895e9.22.1775666640603; Wed, 08 Apr 2026 09:44:00 -0700 (PDT) Received: from arrakeen.starnux.net ([2a01:e0a:106d:1080:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488cd17be0csm1388065e9.18.2026.04.08.09.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 09:44:00 -0700 (PDT) From: Neil Armstrong Subject: [PATCH RFC 0/7] media: qcom: iris: add support for decoding 10bit formats Date: Wed, 08 Apr 2026 18:43:53 +0200 Message-Id: <20260408-topic-sm8x50-iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org> 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: 7bit X-B4-Tracking: v=1; b=H4sIAMmF1mkC/yWNQQ6CQAwAv0J6tklBcNGriQ/wajxAt2JN3CVbN CSEv7vqceYws4BJUjE4FAskeatpDBnKTQF878IgqD4zVFTtqKYWpzgqoz3buSHUpIYl9TqhF45 ew4Dkat527PauYciZMclN59/iAufTEa5/aa/+ITx947CuH9FzgMOJAAAA X-Change-ID: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c 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=3361; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=pHKyPIFUSfQb0bp0ZKG3yIfhrCTjykMJRoh2sBNViH0=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBp1oXLXzDI9w+7Jivak5yqOH8Ic9C/KNci2XOomH7R t0sBuEeJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCadaFywAKCRB33NvayMhJ0XzYD/ 9hfLV1YuqUF/wjR2gH/3U7JBLRHyQvOkdVqJ3iH08VRezniCKAPNOAfVj1ZZfa+hOltsFcoqsssDRj MV3x6z+YpviDJXhdVoUlAoJX5Y5xAf1lJgUcyqoDxvxAIp7O54pHp+VXBcOHeHtlYK2LvxrvGBQs+W E9JUekwEJfjN3NND1QfOAuCROoX5y+//x5uNvnx/eoVM7rs4mfkE/FFXOHOcRN+61sRFwomvWnyICi gFbTTa02+/OOZo/RExpWUEFI8Z9XTEbjT1dIZx84+7gSaoBFETQ0ev+iTuFKk7jxo2AvpGceJgmI8l a1vzGjj7myCwV0QcZPKne9B0HIUR73usw2J0z6eAcypRH1oAcfclPDy7han4kCjhizniYIZ4FY0dtk oyIEloA0wM4Y+rbvcDYqlr/HWUfNnKmiDyqLwLb9ZZys4FfiiuR/XqeIh3/SPPCnSVI+eSLrYil25L ANArZrRqfbDBwDiMlcr5vCS+z3oWw55akGTM0w4SlT4lckF/ci56TAnrs6i94TJ2CS6eVaDFa3AK42 qylxWJ8Z45aH2puGSiwtf8TVRgIe1F/epKyAkxgO1vhOh6i3O28n1apIS3Q7H9cidzWtSeLu+MBk6J wtHEY3wGqkclWEsA88yTVyt+rDsMxOWc9myb5FijBslui9MkloOh/Nv1vYaA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE This adds the plumbing to support decoding HEVC and AV1 streams into 10bit pixel formats, linear and compressed. This has only been tested on SM8650 with HEVC, and was inspired by Venus and the downstream vidc driver for the buffer calculations and HFI messages. I was unable to get 10bit decoding working with Gstreamer and ffmpeg, but v4l2-ctl works with: v4l2-ctl --verbose --set-fmt-video-out=pixelformat=HEVC --set-fmt-video=pixelformat=P010 --stream-mmap --stream-out-mmap --stream-from-hdr Big_Buck_Bunny_1080_10s_30MB_main10.h265.hdr --stream-to out.P010 v4l2-ctl --verbose --set-fmt-video-out=pixelformat=HEVC --set-fmt-video=pixelformat=Q10C --stream-mmap --stream-out-mmap --stream-from-hdr Big_Buck_Bunny_1080_10s_30MB_main10.h265.hdr --stream-to out.QC10 The non-10bit decoding still works as before. With Big_Buck_Bunny_1080_10s_30MB reencoded in 10-bit profile and tranformed in v4l2 header format with [1]: ffmpeg -i Big_Buck_Bunny_1080_10s_30MB.h264 -pix_fmt yuv420p10le -c:v libx265 -crf 28 -x265-params profile=main10 Big_Buck_Bunny_1080_10s_30MB_main10.h265 /path/to/mkhdr.sh Big_Buck_Bunny_1080_10s_30MB_main10.h265 raw Big_Buck_Bunny_1080_10s_30MB_main10.h265.hdr The frames correctness has been verified buy displaying them via Vulkan DMA_BUF import, including QC10C and QC08C. The support is probably incomplete for other platforms and I'm unsure what's required to conform to the V4L2 M2M stateless spec, especially since AFAIK the decoder doesn't support decoding 10bit streams in 8bit pixel format, thus the RFC state. Review is welcome ! [1] https://github.com/superna9999/pyv4l2compliance Signed-off-by: Neil Armstrong --- Neil Armstrong (7): media: qcom: iris: add QC10C & P010 buffer size calculations media: qcom: iris: gen2: add support for 10bit decoding media: qcom: iris: add helpers for 8bit and 10bit formats media: qcom: iris: vdec: update size and stride calculations for 10bit formats media: qcom: iris: vdec: forbid g_fmt while waiting for first source change media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats media: qcom: iris: vdec: allow decoding into 10bit format drivers/media/platform/qcom/iris/iris_buffer.c | 81 +++++++++++++++++++++- .../platform/qcom/iris/iris_hfi_gen2_command.c | 71 ++++++++++++++++++- .../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 + .../platform/qcom/iris/iris_hfi_gen2_response.c | 35 ++++++++-- drivers/media/platform/qcom/iris/iris_instance.h | 2 + .../platform/qcom/iris/iris_platform_common.h | 1 + .../media/platform/qcom/iris/iris_platform_gen2.c | 3 +- drivers/media/platform/qcom/iris/iris_state.c | 6 ++ drivers/media/platform/qcom/iris/iris_state.h | 1 + drivers/media/platform/qcom/iris/iris_utils.c | 16 ++++- drivers/media/platform/qcom/iris/iris_utils.h | 2 + drivers/media/platform/qcom/iris/iris_vdec.c | 70 +++++++++++++++++-- drivers/media/platform/qcom/iris/iris_vidc.c | 14 +++- 13 files changed, 285 insertions(+), 18 deletions(-) --- base-commit: f3e6330d7fe42b204af05a2dbc68b379e0ad179e change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c Best regards, -- Neil Armstrong