Linux Media Controller development
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
	Bryan O'Donoghue <bod@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	Hans Verkuil <hverkuil@kernel.org>,
	Tomasz Figa <tfiga@chromium.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Subject: Re: [PATCH 3/3] media: venus: report the frame size of the codec being enumerated
Date: Mon, 17 Aug 2026 13:24:38 +0200	[thread overview]
Message-ID: <cedd23f9-4ae2-4215-aa12-5481783b84f8@oss.qualcomm.com> (raw)
In-Reply-To: <20260812-venus-8996-v1-3-6615f82a63b8@oss.qualcomm.com>

On 8/12/26 10:01 PM, Dmitry Baryshkov wrote:
> VIDIOC_ENUM_FRAMESIZES takes the pixel format to describe from
> userspace, but both vdec and venc answer it out of frame_width_min() and
> friends, which resolve the capabilities through inst->hfi_codec, the
> codec the instance is currently set to.  Enumerating any format other
> than that one therefore returns the limits of an unrelated codec: on a
> freshly opened decoder, which starts out as H.264, asking about MPEG-2
> on MSM8996 reports the H.264 limits where the firmware describes MPEG-2
> as 16x16 to 1920x1920.

You gave some numbers for MPEG-2, saying H.264 has some different numbers.
I think it would be slightly easier to parse if you either skipped them or
gave numbers for both codecs

> Resolve the capabilities through the format being enumerated instead,
> falling back to the codec in use for the raw formats, which have no
> codec of their own.  Both drivers now share one helper, alongside the
> pixel format to codec mapping that venus_helper_check_codec() already
> carried.
> 
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---

[...]

> -bool venus_helper_check_codec(struct venus_inst *inst, u32 v4l2_pixfmt)
> +static u32 venus_pixfmt_to_hfi_codec(u32 v4l2_pixfmt)
>  {
> -	struct venus_core *core = inst->core;
> -	u32 session_type = inst->session_type;
> -	u32 codec;
> -
>  	switch (v4l2_pixfmt) {
>  	case V4L2_PIX_FMT_H264:
> -		codec = HFI_VIDEO_CODEC_H264;
> -		break;
> +		return HFI_VIDEO_CODEC_H264;

We already have this - to_codec_type() in hfi.c

Konrad

      reply	other threads:[~2026-08-17 11:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 20:01 [PATCH 0/3] media: venus: fix several caps parsing bugs Dmitry Baryshkov
2026-08-12 20:01 ` [PATCH 1/3] media: venus: hfi_parser: account for all capabilities when skipping a property Dmitry Baryshkov
2026-08-17 11:17   ` Konrad Dybcio
2026-08-12 20:01 ` [PATCH 2/3] media: venus: hfi_parser: size a raw format property by its own entries Dmitry Baryshkov
2026-08-17 11:20   ` Konrad Dybcio
2026-08-12 20:01 ` [PATCH 3/3] media: venus: report the frame size of the codec being enumerated Dmitry Baryshkov
2026-08-17 11:24   ` Konrad Dybcio [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cedd23f9-4ae2-4215-aa12-5481783b84f8@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=bod@kernel.org \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=hverkuil@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=tfiga@chromium.org \
    --cc=vikash.garodia@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox