vc_mipi_nvidia icon indicating copy to clipboard operation
vc_mipi_nvidia copied to clipboard

vc_mipi_camera.c: error: 'struct sensor_image_properties' has no member named 'left'

Open fre-wolf opened this issue 2 years ago • 1 comments

Hello, I'm trying to include the drivers into my system, but the compilation fails at one point: error: 'struct sensor_image_properties' has no member named 'left'

void vc_update_image_size_from_mode(struct tegracam_device *tc_dev,  __u32 *left, __u32 *top, __u32 *width, __u32 *height)
{
	struct vc_cam *cam = tegracam_to_cam(tc_dev);
	struct device *dev = vc_core_get_sen_device(cam);
	struct sensor_mode_properties *mode = NULL;
	struct sensor_image_properties *image = NULL;
	int mode_idx = 0;

	if (tc_dev->s_data->use_sensor_mode_id) 
		mode_idx = tc_dev->s_data->sensor_mode_id;

	mode = tegracam_to_mode(tc_dev, mode_idx);
	if (mode == NULL)
		return;

	image = &mode->image_properties;
	if (image->width != 0 && image->height != 0) {
		*left = image->left;
		*top = image->top;
		*width = image->width;
		*height = image->height;

		vc_notice(dev, "%s(): Update image size from mode%u (l: %u, t: %u, w: %u, h: %u)\n",
			__FUNCTION__, mode_idx, *left, *top, *width, *height);
	}
}

in image = &mode->image_properties; and the following lines, somehow the parameter left is being accessed, but there is no left defined in the struct sensor_image_properties : (from tegra-v4l2-camera.h):

struct sensor_image_properties {
	__u32 width;
	__u32 height;
	__u32 line_length;
	__u32 pixel_format;
	__u32 embedded_metadata_height;
	__u32 reserved[11];
};

How can this be resolved?

fre-wolf avatar May 15 '23 11:05 fre-wolf

Hi fre-wolf, this patch adds the missing variable. Please check this: https://github.com/VC-MIPI-modules/vc_mipi_nvidia/blob/master/patch/kernel_common_32.3.1%2B/0001-Added-cropping-position-left-top-to-sensor-image-pro.patch

pmliquify avatar May 15 '23 13:05 pmliquify