Set the formats of sensor as bayer bggr8, but get the data from /dev/video0 is 16bit

Hi:

HW: AGX orin 64GB

JP: 6.2

I debugged a TOF camera recently, I set the formats of camera like below

mclk_khz = "24000";
				num_lanes = "4";
				tegra_sinterface = "serial_e";
				vc_id = "0";
				phy_mode = "DPHY";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "8";
				csi_pixel_bit_depth = "8";
				mode_type = "bayer";
				pixel_phase = "bggr";

				active_w = "2025";
				active_h = "240";
				readout_orientation = "0";
				line_length = "2155";
				inherent_gain = "1";
				mclk_multiplier = "1";
				pix_clk_hz = "24000000";
				serdes_pix_clk_hz = "400000000";

				gain_factor = "10";
				min_gain_val = "0"; /* 0dB */
				max_gain_val = "480"; /* 48dB */
				step_gain_val = "3"; /* 0.3 */
				default_gain = "0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				framerate_factor = "1000000";
				min_framerate = "1500000"; /* 1.5 */
				max_framerate = "20000000"; /* 30 */
				step_framerate = "1";
				default_framerate= "10000000";
				exposure_factor = "1000000";
				min_exp_time = "30"; /* us */
				max_exp_time = "660000"; /* us */
				step_exp_time = "1";
				default_exp_time = "33334";/* us */
				embedded_metadata_height = "1";

But the data I got from the /dev/video0 node was 16bit unexpectly,

the all the HSB bytes ware 0, how was that?

please help me to debug, thank you

You need modify the T_R16 to T_R8 in VI driver like below.

./vi/vi5_formats.h:     TEGRA_VIDEO_FORMAT(RAW10, 10, SRGGB10_1X10, 2, 1, T_R16,

yes, I added a item like below

TEGRA_VIDEO_FORMAT(RAW8, 8, SBGGR8_1X8, 1, 1, T_R8,

            RAW8, SBGGR8, "BGBG.. GRGR.."),

What’t the Bytes per Line by v4l2-ctl --all?

Bytes per Line : 2025

The config looks without problem thought.

Could it output test pattern to check with other platform like RP berry?

Thanks

The camera did not have test pattern and There is no available platform to check this camera unfortunately

Are there any ways to debug this problem?

Using 7yuv to check if able to show the frame correctly.

7yuv?, how do I config this type?

This tool support bayer format just config it by the GUI.

THanks

Now we have fixed the data wrong problem, but we find another issue that the one of line pixel of frame append several 0 bytes and the number of 0 bytes is not fixed.

For example, first line of frame is 2025 pixel and then there are 23 0 bytes but next line is 4 0bytes