Commit a0821ca1 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab
Browse files

media: atomisp: Remove test pattern generator (TPG) support



The TPG support registers a v4l2-subdev for this, but this is not part of
the media-controller graph in any way. After manually selecting the TPG
as input using the s_input ioctl it does not work.

Several supported sensors have their own working TPG and using the sensor's
TPG means that the same data-flow is used as with actual sensors rather
then the quite different data-flow from the ISP's builtin TPG.

Remove the broken TPG support, when a test-pattern is needed for testing
a sensor's TPG can be used. Using a sensor's TPG is actually better for
testing since then the actual normal data-flow is being tested.

Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 36a14185
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ atomisp-objs += \
	pci/atomisp_fops.o \
	pci/atomisp_ioctl.o \
	pci/atomisp_subdev.o \
	pci/atomisp_tpg.o \
	pci/atomisp_v4l2.o \
	pci/sh_css_firmware.o \
	pci/sh_css_host_data.o \
+0 −1
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ enum atomisp_input_format {
enum intel_v4l2_subdev_type {
	RAW_CAMERA = 1,
	LED_FLASH = 2,
	TEST_PATTERN = 3,
};

struct intel_v4l2_subdev_id {
+18 −19
Original line number Diff line number Diff line
@@ -4133,6 +4133,7 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev,
				  unsigned int width, unsigned int height) =
				      configure_pp_input_nop;
	const struct atomisp_in_fmt_conv *fc = NULL;
	struct v4l2_mbus_framefmt *ffmt;
	int ret, i;

	isp_sink_crop = atomisp_subdev_get_rect(
@@ -4143,7 +4144,6 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev,
	if (!format)
		return -EINVAL;

	if (input->type != TEST_PATTERN) {
	mipi_info = atomisp_to_sensor_mipi_info(input->camera);

	if (atomisp_set_sensor_mipi_to_isp(asd, ATOMISP_INPUT_STREAM_GENERAL,
@@ -4152,19 +4152,18 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev,

	if (mipi_info)
		fc = atomisp_find_in_fmt_conv_by_atomisp_in_fmt(mipi_info->input_format);

		if (!fc)
			fc = atomisp_find_in_fmt_conv(
				 atomisp_subdev_get_ffmt(&asd->subdev,
							 NULL, V4L2_SUBDEV_FORMAT_ACTIVE,
							 ATOMISP_SUBDEV_PAD_SINK)->code);
	if (!fc) {
		ffmt = atomisp_subdev_get_ffmt(&asd->subdev, NULL,
					       V4L2_SUBDEV_FORMAT_ACTIVE,
					       ATOMISP_SUBDEV_PAD_SINK);
		fc = atomisp_find_in_fmt_conv(ffmt->code);
	}
	if (!fc)
		return -EINVAL;

	if (format->sh_fmt == IA_CSS_FRAME_FORMAT_RAW &&
		    raw_output_format_match_input(fc->atomisp_in_fmt,
						  pix->pixelformat))
	    raw_output_format_match_input(fc->atomisp_in_fmt, pix->pixelformat))
		return -EINVAL;
	}

	/*
	 * Configure viewfinder also when vfpp is disabled: the
+1 −30
Original line number Diff line number Diff line
@@ -302,21 +302,6 @@ static void __dump_stream_config(struct atomisp_sub_device *asd,
			"stream_config.source.port.compression.uncompressed_bits_per_pixel=%d.\n",
			s_config->source.port.compression.
			uncompressed_bits_per_pixel);
	} else if (s_config->mode == IA_CSS_INPUT_MODE_TPG) {
		dev_dbg(isp->dev, "stream_config.source.tpg.id=%d.\n",
			s_config->source.tpg.id);
		dev_dbg(isp->dev, "stream_config.source.tpg.mode=%d.\n",
			s_config->source.tpg.mode);
		dev_dbg(isp->dev, "stream_config.source.tpg.x_mask=%d.\n",
			s_config->source.tpg.x_mask);
		dev_dbg(isp->dev, "stream_config.source.tpg.x_delta=%d.\n",
			s_config->source.tpg.x_delta);
		dev_dbg(isp->dev, "stream_config.source.tpg.y_mask=%d.\n",
			s_config->source.tpg.y_mask);
		dev_dbg(isp->dev, "stream_config.source.tpg.y_delta=%d.\n",
			s_config->source.tpg.y_delta);
		dev_dbg(isp->dev, "stream_config.source.tpg.xy_mask=%d.\n",
			s_config->source.tpg.xy_mask);
	} else if (s_config->mode == IA_CSS_INPUT_MODE_PRBS) {
		dev_dbg(isp->dev, "stream_config.source.prbs.id=%d.\n",
			s_config->source.prbs.id);
@@ -1672,26 +1657,12 @@ void atomisp_css_capture_set_mode(struct atomisp_sub_device *asd,
void atomisp_css_input_set_mode(struct atomisp_sub_device *asd,
				enum ia_css_input_mode mode)
{
	int i;
	struct atomisp_device *isp = asd->isp;
	unsigned int size_mem_words;
	int i;

	for (i = 0; i < ATOMISP_INPUT_STREAM_NUM; i++)
		asd->stream_env[i].stream_config.mode = mode;

	if (isp->inputs[asd->input_curr].type == TEST_PATTERN) {
		struct ia_css_stream_config *s_config =
			    &asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].stream_config;
		s_config->mode = IA_CSS_INPUT_MODE_TPG;
		s_config->source.tpg.mode = IA_CSS_TPG_MODE_CHECKERBOARD;
		s_config->source.tpg.x_mask = (1 << 4) - 1;
		s_config->source.tpg.x_delta = -2;
		s_config->source.tpg.y_mask = (1 << 4) - 1;
		s_config->source.tpg.y_delta = 3;
		s_config->source.tpg.xy_mask = (1 << 8) - 1;
		return;
	}

	if (mode != IA_CSS_INPUT_MODE_BUFFERED_SENSOR)
		return;

+0 −2
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@

#include "atomisp_csi2.h"
#include "atomisp_subdev.h"
#include "atomisp_tpg.h"
#include "atomisp_compat.h"

#include "gp_device.h"
@@ -188,7 +187,6 @@ struct atomisp_device {
	bool pm_only;

	struct atomisp_mipi_csi2_device csi2_port[ATOMISP_CAMERA_NR_PORTS];
	struct atomisp_tpg_device tpg;

	/* Purpose of mutex is to protect and serialize use of isp data
	 * structures and css API calls. */
Loading