mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gjorgji Rosikopulos (Consultant)" <gjorgji.rosikopulos@oss.qualcomm.com>
To: Bryan O'Donoghue <bod@kernel.org>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
	Loic Poulain <loic.poulain@oss.qualcomm.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Daniel Scally <dan.scally@ideasonboard.com>,
	Keke Li <keke.li@amlogic.com>,
	Richard Acayan <mailingradian@gmail.com>,
	Hans Verkuil <hverkuil@kernel.org>,
	Gjorgji Rosikopulos <quic_grosikop@quicinc.com>,
	Radoslav Tsvetkov <quic_rtsvetko@quicinc.com>,
	Robert Foss <rfoss@kernel.org>,
	Milen Mitkov <quic_mmitkov@quicinc.com>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 18/74] media: qcom: camss: vfe: Add helper vfe_bus_v3_packer_fmt()
Date: Wed, 7 Oct 2026 14:25:42 +0300	[thread overview]
Message-ID: <647cdc36-d6ba-407f-9eb3-f3b34ad9df4d@oss.qualcomm.com> (raw)
In-Reply-To: <20261005-linux-mainline-7-2-sm8650-hdk-rfc-0-v1-18-ed985aefd611@kernel.org>

Hi Bryan,

On 10/5/2026 8:13 PM, Bryan O'Donoghue wrote:
> vfe_bus_v3_packer_fmt()'s job in life is to translate a given v4l2 pixel
> format and plane into the appropriate bus packing format for v3 class
> hardware.
> 
> Other versions are currently not covered.
> 
> Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
> ---
>  drivers/media/platform/qcom/camss/camss-vfe.c | 53 +++++++++++++++++++++++++++
>  drivers/media/platform/qcom/camss/camss-vfe.h | 32 ++++++++++++++++
>  2 files changed, 85 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
> index 5b5201b55a485..c95fe5b0b05fc 100644
> --- a/drivers/media/platform/qcom/camss/camss-vfe.c
> +++ b/drivers/media/platform/qcom/camss/camss-vfe.c
> @@ -370,6 +370,59 @@ const struct camss_formats vfe_formats_pix_845 = {
>  	.formats = formats_pix_845
>  };
>  
> +u32 vfe_bus_v3_packer_fmt(u32 v4l2_fmt, u8 plane, u8 align_shift)
> +{
> +	switch (v4l2_fmt) {
> +	case V4L2_PIX_FMT_NV12:
> +	case V4L2_PIX_FMT_NV12M:
> +	case V4L2_PIX_FMT_NV16:
> +		return VFE_BUS_WM_PACKER_FMT_V3_PLAIN_8_LSB_MSB_10;
> +	case V4L2_PIX_FMT_NV21:
> +	case V4L2_PIX_FMT_NV21M:
> +	case V4L2_PIX_FMT_NV61:
> +		return plane ? VFE_BUS_WM_PACKER_FMT_V3_PLAIN_8_LSB_MSB_10_ODD_EVEN
> +			     : VFE_BUS_WM_PACKER_FMT_V3_PLAIN_8_LSB_MSB_10;
> +
> +	case V4L2_PIX_FMT_SRGGB10P:
> +	case V4L2_PIX_FMT_SGRBG10P:
> +	case V4L2_PIX_FMT_SGBRG10P:
> +	case V4L2_PIX_FMT_SBGGR10P:
> +		return VFE_BUS_WM_PACKER_FMT_V3_MIPI10;
> +	case V4L2_PIX_FMT_SRGGB12P:
> +	case V4L2_PIX_FMT_SGRBG12P:
> +	case V4L2_PIX_FMT_SGBRG12P:
> +	case V4L2_PIX_FMT_SBGGR12P:
> +		return VFE_BUS_WM_PACKER_FMT_V3_MIPI12;
> +	case V4L2_PIX_FMT_SRGGB14P:
> +	case V4L2_PIX_FMT_SGRBG14P:
> +	case V4L2_PIX_FMT_SGBRG14P:
> +	case V4L2_PIX_FMT_SBGGR14P:
> +		return VFE_BUS_WM_PACKER_FMT_V3_MIPI14;
> +
> +	case V4L2_PIX_FMT_SRGGB10:
> +	case V4L2_PIX_FMT_SGRBG10:
> +	case V4L2_PIX_FMT_SGBRG10:
> +	case V4L2_PIX_FMT_SBGGR10:
> +		return VFE_BUS_WM_PACKER_FMT_V3_PLAIN_16_10BPP |
> +		       BIT(align_shift);
> +	case V4L2_PIX_FMT_SRGGB12:
> +	case V4L2_PIX_FMT_SGRBG12:
> +	case V4L2_PIX_FMT_SGBRG12:
> +	case V4L2_PIX_FMT_SBGGR12:
> +		return VFE_BUS_WM_PACKER_FMT_V3_PLAIN_16_12BPP |
> +		       BIT(align_shift);
> +
> +	case V4L2_PIX_FMT_SRGGB8:
> +	case V4L2_PIX_FMT_SGRBG8:
> +	case V4L2_PIX_FMT_SGBRG8:
> +	case V4L2_PIX_FMT_SBGGR8:
> +		return VFE_BUS_WM_PACKER_FMT_V3_PLAIN_8;
> +	}
> +
> +	WARN_ONCE(1, "no packer format for 0x%08x\n", v4l2_fmt);
> +	return VFE_BUS_WM_PACKER_FMT_V3_PLAIN_128;
> +}
> +
>  static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,
>  			    unsigned int index, u32 src_req_code)
>  {
> diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/platform/qcom/camss/camss-vfe.h
> index 089f525b98cf5..98d403a71cf95 100644
> --- a/drivers/media/platform/qcom/camss/camss-vfe.h
> +++ b/drivers/media/platform/qcom/camss/camss-vfe.h
> @@ -56,6 +56,27 @@ enum vfe_line_id {
>  	VFE_LINE_NUM_MAX = 4
>  };
>  
> +enum vfe_packer_format_v3 {
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_128 = 0,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_8,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_8_ODD_EVEN,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_8_LSB_MSB_10,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_8_LSB_MSB_10_ODD_EVEN,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_16_10BPP,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_16_12BPP,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_16_14BPP,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_16_16BPP,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_32,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN_64,
> +	VFE_BUS_WM_PACKER_FMT_V3_TP_10,
> +	VFE_BUS_WM_PACKER_FMT_V3_MIPI10,
> +	VFE_BUS_WM_PACKER_FMT_V3_MIPI12,
> +	VFE_BUS_WM_PACKER_FMT_V3_MIPI14,
> +	VFE_BUS_WM_PACKER_FMT_V3_MIPI20,
> +	VFE_BUS_WM_PACKER_FMT_V3_PLAIN32_20BPP,
> +	VFE_BUS_WM_PACKER_FMT_V3_MAX,
> +};

I think all wm configurations should be separated in separate bus or wm
abstraction and move those per version of the wm/bus.

> +
>  struct vfe_output {
>  	u8 wm_num;
>  	u8 wm_idx[3];
> @@ -315,4 +336,15 @@ int vfe_enable_output_v2(struct vfe_line *line);
>  int vfe_queue_buffer_v2(struct camss_video *vid,
>  			struct camss_buffer *buf);
>  
> +/*
> + * vfe_bus_v3_packer_fmt
> + *
> + * @v4l2_fmt: v4l2 format
> + * @plane: plane for the given format
> + * @align_shift: bit position of the PLAIN16 LSB alignment flag
> + *
> + * Return: the bus packer format for the register
> + */
> +u32 vfe_bus_v3_packer_fmt(u32 v4l2_fmt, u8 plane, u8 align_shift);
> +
>  #endif /* QC_MSM_CAMSS_VFE_H */
> 


  reply	other threads:[~2026-10-07 11:25 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2bmnjEGElR9T_ArfViwpYiEKTtnqkmH2Ly0MiZJCxhhVR_O0dZOW-Cl983_7fLBFoxMc_PBuNK6FsBbK1JLXQA==@protonmail.internalid>
2026-10-05 17:13 ` [PATCH 00/74] RFC: Switch on IFE YUV, Stats and Params support for sm8650 Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 01/74] media: qcom: camss: vfe: Rename gen3 back to vfe780 Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 02/74] media: qcom: camss: vfe: Separate VFE 690 from VFE 780/880 Bryan O'Donoghue
2026-10-07 11:07     ` Gjorgji Rosikopulos (Consultant)
2026-10-05 17:13   ` [PATCH 03/74] media: uapi: v4l2-isp: Add extensible statistics bod
2026-10-05 17:13   ` [PATCH 04/74] media: Documentation: uapi: Update V4L2 ISP for extensible stats bod
2026-10-05 17:13   ` [PATCH 05/74] media: v4l2-isp: Rename v4l2_isp_params_buffer_size bod
2026-10-05 17:13   ` [PATCH 06/74] media: v4l2-isp: Add per-block validation callback bod
2026-10-05 17:13   ` [PATCH 07/74] media: amlogic-c3: Implement per-block validation bod
2026-10-05 17:13   ` [PATCH 08/74] media: v4l2-isp: Add helpers for stats buffer bod
2026-10-05 17:13   ` [PATCH 09/74] media: uapi: Add CAMSS ISP configuration definition bod
2026-10-05 17:13   ` [PATCH 10/74] media: Documentation: uapi: Add qcom-camss ISP params documentation bod
2026-10-05 17:13   ` [PATCH 11/74] media: qcom: camss: Fix invalid declaration of PIX for SDM670 bod
2026-10-05 17:13   ` [PATCH 12/74] media: qcom: camss: Fix invalid declaration of PIX for SDM845 bod
2026-10-05 17:13   ` [PATCH 13/74] media: qcom: camss: Fix invalid declaration of PIX for sc8280xp bod
2026-10-05 17:13   ` [PATCH 14/74] media: qcom: camss: Fix invalid declaration of PIX for x1e80100 bod
2026-10-05 17:13   ` [PATCH 15/74] media: qcom: camss: csid: Configure the stream on every s_stream bod
2026-10-07  8:46     ` Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 16/74] media: qcom: camss: Switch existing vfe_formats_pix_845 to vfe_formats_rdi_845 Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 17/74] media: qcom: camss: Define PIX formats for x1e PIX interface Bryan O'Donoghue
2026-10-07  8:22     ` Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 18/74] media: qcom: camss: vfe: Add helper vfe_bus_v3_packer_fmt() Bryan O'Donoghue
2026-10-07 11:25     ` Gjorgji Rosikopulos (Consultant) [this message]
2026-10-05 17:13   ` [PATCH 19/74] media: qcom: camss: vfe: Represent output as an array instead of a singleton Bryan O'Donoghue
2026-10-09  5:20     ` kernel test robot
2026-10-09  6:52     ` kernel test robot
2026-10-05 17:13   ` [PATCH 20/74] media: qcom: camss: vfe: Move video_out from vfe_line to vfe_output Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 21/74] media: qcom: camss: vfe: Represent vfe wm inside of a struct Bryan O'Donoghue
2026-10-09  7:14     ` kernel test robot
2026-10-05 17:13   ` [PATCH 22/74] media: qcom: camss: vfe: Add is_pix to struct line Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 23/74] media: qcom: camss: vfe: Add comp_group to struct vfe_wm Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 24/74] media: qcom: camss: vfe: Define vfe v3 completion group enum Bryan O'Donoghue
2026-10-08  5:52     ` Gjorgji Rosikopulos (Consultant)
2026-10-05 17:13   ` [PATCH 25/74] media: qcom: camss: vfe: Define output based VFE controls Bryan O'Donoghue
2026-10-08  5:55     ` Gjorgji Rosikopulos (Consultant)
2026-10-08 11:17       ` Bryan O'Donoghue
2026-10-08 11:35         ` Gjorgji Rosikopulos (Consultant)
2026-10-08 15:16           ` Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 26/74] media: qcom: camss: vfe: Call vfe_subdev_init after not before significant enumeration Bryan O'Donoghue
2026-10-08  5:55     ` Gjorgji Rosikopulos (Consultant)
2026-10-05 17:13   ` [PATCH 27/74] media: qcom: camss: vfe: Move legacy VFE bus client assignment to msm_vfe_subdev_init Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 28/74] media: qcom: camss: vfe: Add planes identifier to struct wm Bryan O'Donoghue
2026-10-08  5:56     ` Gjorgji Rosikopulos (Consultant)
2026-10-08 13:08       ` Bryan O'Donoghue
2026-10-05 17:13   ` [PATCH 29/74] media: qcom: camss: vfe: Specify number of pads via line->num_pads Bryan O'Donoghue
2026-10-08  6:03     ` Gjorgji Rosikopulos (Consultant)
2026-10-05 17:14   ` [PATCH 30/74] media: qcom: camss: vfe: Add support for starting multiple write-masters in one output's group Bryan O'Donoghue
2026-10-08  6:09     ` Gjorgji Rosikopulos (Consultant)
2026-10-05 17:14   ` [PATCH 31/74] media: qcom: camss: vfe: Add support for updating multiple write-masters within an output group Bryan O'Donoghue
2026-10-08  6:10     ` Gjorgji Rosikopulos (Consultant)
2026-10-05 17:14   ` [PATCH 32/74] media: qcom: camss: vfe: Update an output group's write masters on buffer done bod
2026-10-05 17:14   ` [PATCH 33/74] media: qcom: camss: vfe: Add support for stopping outputs which contain multiple write masters Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 34/74] media: qcom: camss: vfe: Stop an output group once bod
2026-10-05 17:14   ` [PATCH 35/74] media: qcom: camss: vfe: Add helper __vfe_pix_format_is_raw Bryan O'Donoghue
2026-10-08  6:12     ` Gjorgji Rosikopulos (Consultant)
2026-10-05 17:14   ` [PATCH 36/74] media: qcom: camss: csid: Add helper function csid_ipp_bayer_pattern bod
2026-10-05 17:14   ` [PATCH 37/74] media: qcom: camss: vfe: Decompose repeated code down to __vfe_src_pad_default() Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 38/74] media: qcom: camss: vfe: Eliminate ever expanding src_pad_code switch logic Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 39/74] media: qcom: camss: vfe: Add Bayer to YUV conversion switch cases for PIX Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 40/74] media: qcom: camss: vfe-gen3: Define full array of write-masters Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 41/74] media: qcom: camss: vfe-gen3: Enable PIX formats on PIX interfaces Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 42/74] media: qcom: camss: vfe: Pass struct line to wm_stop Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 43/74] media: qcom: camss: vfe-780: Use bus-client to derive write master index Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 44/74] media: qcom: camss: vfe-780: Switch on YUV pix path Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 45/74] media: qcom: camss: vfe: Add support for pix pad data-types Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 46/74] media: qcom: camss: vfe: Add helper methods to enumerate output descriptors Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 47/74] media: qcom: camss: Pass new struct camss_buf_done_info to camss_buf_done bod
2026-10-05 17:14   ` [PATCH 48/74] media: qcom: camss: Add a status field to camss_buf_done_info bod
2026-10-05 17:14   ` [PATCH 49/74] media: qcom: camss: csid-gen3: Enable the IPP path bod
2026-10-05 17:14   ` [PATCH 50/74] media: qcom: camss: vfe: Pass the completion info to vfe_buf_done() bod
2026-10-05 17:14   ` [PATCH 51/74] media: qcom: camss: vfe: Pass the buffer to vfe_wm_update() bod
2026-10-05 17:14   ` [PATCH 52/74] media: qcom: camss: Add the SM8650 IFE pixel pipe configuration bod
2026-10-05 17:14   ` [PATCH 53/74] media: qcom: camss: csid-gen3: Define the IPP reg update port in the header bod
2026-10-05 17:14   ` [PATCH 54/74] media: qcom: camss: vfe-880: Program the pixel pipe outside output_lock Bryan O'Donoghue
2026-10-05 17:14   ` [PATCH 55/74] media: qcom: camss: vfe: Make is_pix the only test for the pixel path bod
2026-10-05 17:14   ` [PATCH 56/74] media: qcom: camss: csid-gen3: Route IPP completions to the port the IPP feeds bod
2026-10-05 17:14   ` [PATCH 57/74] media: qcom: camss: vfe-780: Add full-resolution YUV on the PIX line bod
2026-10-05 17:14   ` [PATCH 58/74] media: uapi: Add CAMSS ISP statistics definition bod
2026-10-08 11:23     ` Gjorgji Rosikopulos (Consultant)
2026-10-08 13:40       ` Bryan O'Donoghue
2026-10-08 15:18         ` Gjorgji Rosikopulos (Consultant)
2026-10-05 17:14   ` [PATCH 59/74] media: Documentation: uapi: Add qcom-camss ISP statistics bod
2026-10-05 17:14   ` [PATCH 60/74] media: qcom: camss: vfe: Select line-based mode for the pixel path's video node bod
2026-10-05 17:14   ` [PATCH 61/74] media: qcom: camss: vfe: Size the pixel path clock by its pixels per clock bod
2026-10-05 17:14   ` [PATCH 62/74] media: qcom: camss: vfe: Size the outputs for the PIX line and set up each one bod
2026-10-05 17:14   ` [PATCH 63/74] media: qcom: camss: video: Support metadata capture nodes bod
2026-10-05 17:14   ` [PATCH 64/74] media: qcom: camss: vfe: Register a statistics node for the pixel line bod
2026-10-05 17:14   ` [PATCH 65/74] media: qcom: camss: vfe: Complete pixel line outputs on their own completion group bod
2026-10-05 17:14   ` [PATCH 66/74] media: qcom: camss: vfe-780: Produce the AEC Bayer histogram statistics bod
2026-10-07  8:49     ` Bryan O'Donoghue
2026-10-08 11:17     ` Gjorgji Rosikopulos (Consultant)
2026-10-05 17:14   ` [PATCH 67/74] media: uapi: Add the CAMSS AEC Bayer histogram configuration bod
2026-10-05 17:14   ` [PATCH 68/74] media: v4l2: Add the Qualcomm CAMSS ISP parameters format bod
2026-10-05 17:14   ` [PATCH 69/74] media: Documentation: uapi: Add the CAMSS IFE parameters bod
2026-10-05 17:14   ` [PATCH 70/74] media: qcom: camss: video: Support metadata output nodes bod
2026-10-05 17:14   ` [PATCH 71/74] media: qcom: camss: vfe: Register and apply a parameters node for the pixel line bod
2026-10-05 17:14   ` [PATCH 72/74] media: qcom: camss: vfe-780: Apply the AEC Bayer histogram parameters bod
2026-10-05 17:14   ` [PATCH 73/74] media: qcom: camss: vfe-780: Drive the write masters through the output ops bod
2026-10-05 17:14   ` [PATCH 74/74] media: qcom: camss: vfe: Pass the write master its address again bod
2026-10-07  8:47     ` Bryan O'Donoghue
2026-10-06  7:06   ` [PATCH 00/74] RFC: Switch on IFE YUV, Stats and Params support for sm8650 Jacopo Mondi
2026-10-07  8:41     ` Bryan O'Donoghue
2026-10-08 12:55   ` Bryan O'Donoghue

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=647cdc36-d6ba-407f-9eb3-f3b34ad9df4d@oss.qualcomm.com \
    --to=gjorgji.rosikopulos@oss.qualcomm.com \
    --cc=bod@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=dan.scally@ideasonboard.com \
    --cc=hverkuil@kernel.org \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=keke.li@amlogic.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=mailingradian@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=quic_grosikop@quicinc.com \
    --cc=quic_mmitkov@quicinc.com \
    --cc=quic_rtsvetko@quicinc.com \
    --cc=rfoss@kernel.org \
    --cc=vladimir.zapolskiy@linaro.org \
    /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

all inboxes | Powered by JetHome®