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

media: atomisp: Remove accelerator pipe creation code



The ATOMISP_ACC_* custom ioctls and the ACC device node have been removed
in commit a5c17adbadcb ("media: atomisp: Remove the ACC device node").

This means that pipe_configs[pipe_id].acc_extension now never gets set
which causes atomisp_compat_css20.c: __create_pipe() to always skip
creation of pipes with a pipe_id of IA_CSS_PIPE_ID_ACC / a mode of
IA_CSS_PIPE_MODE_ACC.

This allows removing of the acc_pipe creation / handling code
from mainly sh_css.c and a bunch of other places.

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 8824864b
Loading
Loading
Loading
Loading
+2 −25
Original line number Diff line number Diff line
@@ -236,18 +236,6 @@ static void __dump_pipe_config(struct atomisp_sub_device *asd,
		dev_dbg(isp->dev,
			"pipe_config.isp_pipe_version:%d.\n",
			p_config->isp_pipe_version);
		dev_dbg(isp->dev,
			"pipe_config.acc_extension=%p.\n",
			p_config->acc_extension);
		dev_dbg(isp->dev,
			"pipe_config.acc_stages=%p.\n",
			p_config->acc_stages);
		dev_dbg(isp->dev,
			"pipe_config.num_acc_stages=%d.\n",
			p_config->num_acc_stages);
		dev_dbg(isp->dev,
			"pipe_config.acc_num_execs=%d.\n",
			p_config->acc_num_execs);
		dev_dbg(isp->dev,
			"pipe_config.default_capture_config.capture_mode=%d.\n",
			p_config->default_capture_config.mode);
@@ -629,10 +617,6 @@ static void __apply_additional_pipe_config(
		else
			stream_env->pipe_configs[pipe_id].enable_dz = false;
		break;
	case IA_CSS_PIPE_ID_ACC:
		stream_env->pipe_configs[pipe_id].mode = IA_CSS_PIPE_MODE_ACC;
		stream_env->pipe_configs[pipe_id].enable_dz = false;
		break;
	default:
		break;
	}
@@ -644,7 +628,7 @@ static bool is_pipe_valid_to_current_run_mode(struct atomisp_sub_device *asd,
	if (!asd)
		return false;

	if (pipe_id == IA_CSS_PIPE_ID_ACC || pipe_id == IA_CSS_PIPE_ID_YUVPP)
	if (pipe_id == IA_CSS_PIPE_ID_YUVPP)
		return true;

	if (asd->vfpp) {
@@ -718,12 +702,7 @@ static int __create_pipe(struct atomisp_sub_device *asd,
	if (pipe_id >= IA_CSS_PIPE_ID_NUM)
		return -EINVAL;

	if (pipe_id != IA_CSS_PIPE_ID_ACC &&
	    !stream_env->pipe_configs[pipe_id].output_info[0].res.width)
		return 0;

	if (pipe_id == IA_CSS_PIPE_ID_ACC &&
	    !stream_env->pipe_configs[pipe_id].acc_extension)
	if (!stream_env->pipe_configs[pipe_id].output_info[0].res.width)
		return 0;

	if (!is_pipe_valid_to_current_run_mode(asd, pipe_id))
@@ -2141,8 +2120,6 @@ static enum ia_css_pipe_mode __pipe_id_to_pipe_mode(
		return IA_CSS_PIPE_MODE_CAPTURE;
	case IA_CSS_PIPE_ID_VIDEO:
		return IA_CSS_PIPE_MODE_VIDEO;
	case IA_CSS_PIPE_ID_ACC:
		return IA_CSS_PIPE_MODE_ACC;
	case IA_CSS_PIPE_ID_YUVPP:
		return IA_CSS_PIPE_MODE_YUVPP;
	default:
+1 −2
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ struct ia_css_preview_settings {

	struct ia_css_pipe *copy_pipe;
	struct ia_css_pipe *capture_pipe;
	struct ia_css_pipe *acc_pipe;
};

#define IA_CSS_DEFAULT_PREVIEW_SETTINGS { \
@@ -156,7 +155,7 @@ struct ia_css_pipe {
#define IA_CSS_DEFAULT_PIPE { \
	.config			= DEFAULT_PIPE_CONFIG, \
	.info			= DEFAULT_PIPE_INFO, \
	.mode			= IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \
	.mode			= IA_CSS_PIPE_ID_VIDEO, /* (pipe_id) */ \
	.pipeline		= DEFAULT_PIPELINE, \
	.output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
	.bds_output_info	= IA_CSS_BINARY_DEFAULT_FRAME_INFO, \
+0 −69
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ enum ia_css_pipe_mode {
	IA_CSS_PIPE_MODE_PREVIEW,	/** Preview pipe */
	IA_CSS_PIPE_MODE_VIDEO,		/** Video pipe */
	IA_CSS_PIPE_MODE_CAPTURE,	/** Still capture pipe */
	IA_CSS_PIPE_MODE_ACC,		/** Accelerated pipe */
	IA_CSS_PIPE_MODE_COPY,		/** Copy pipe, only used for embedded/image data copying */
	IA_CSS_PIPE_MODE_YUVPP,		/** YUV post processing pipe, used for all use cases with YUV input,
									for SoC sensor and external ISP */
@@ -95,21 +94,11 @@ struct ia_css_pipe_config {
	/** output of YUV scaling */
	struct ia_css_frame_info vf_output_info[IA_CSS_PIPE_MAX_OUTPUT_STAGE];
	/** output of VF YUV scaling */
	struct ia_css_fw_info *acc_extension;
	/** Pipeline extension accelerator */
	struct ia_css_fw_info **acc_stages;
	/** Standalone accelerator stages */
	u32 num_acc_stages;
	/** Number of standalone accelerator stages */
	struct ia_css_capture_config default_capture_config;
	/** Default capture config for initial capture pipe configuration. */
	struct ia_css_resolution dvs_envelope; /** temporary */
	enum ia_css_frame_delay dvs_frame_delay;
	/** indicates the DVS loop delay in frame periods */
	int acc_num_execs;
	/** For acceleration pipes only: determine how many times the pipe
	     should be run. Setting this to -1 means it will run until
	     stopped. */
	bool enable_dz;
	/** Disabling digital zoom for a pipeline, if this is set to false,
	     then setting a zoom factor will have no effect.
@@ -153,7 +142,6 @@ struct ia_css_pipe_config {
	.vf_output_info		= {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \
	.default_capture_config	= DEFAULT_CAPTURE_CONFIG, \
	.dvs_frame_delay	= IA_CSS_FRAME_DELAY_1, \
	.acc_num_execs		= -1, \
}

/* Pipe info, this struct describes properties of a pipe after it's stream has
@@ -224,9 +212,6 @@ struct ia_css_pipe_info {
		{{0, 0}, 0, 0, 0, 0}, // second_output_info
		{{0, 0}, 0, 0, 0, 0}, // vf_output_info
		{{0, 0}, 0, 0, 0, 0}, // second_vf_output_info
		NULL,   // acc_extension
		NULL,   // acc_stages
		0,      // num_acc_stages
		{
			IA_CSS_CAPTURE_MODE_RAW, // mode
			false, // enable_xnr
@@ -234,7 +219,6 @@ struct ia_css_pipe_info {
		},      // default_capture_config
		{0, 0}, // dvs_envelope
		1,      // dvs_frame_delay
		-1,     // acc_num_execs
		true,   // enable_dz
		NULL,   // p_isp_config
	};
@@ -426,59 +410,6 @@ int
ia_css_pipe_dequeue_buffer(struct ia_css_pipe *pipe,
			   struct ia_css_buffer *buffer);

/* @brief  Set the state (Enable or Disable) of the Extension stage in the
 *          given pipe.
 * @param[in] pipe         Pipe handle.
 * @param[in] fw_handle    Extension firmware Handle (ia_css_fw_info.handle)
 * @param[in] enable       Enable Flag (1 to enable ; 0 to disable)
 *
 * @return
 * 0			: Success
 * -EINVAL		: Invalid Parameters
 * -EBUSY	: Inactive QOS Pipe
 *					(No active stream with this pipe)
 *
 * This function will request state change (enable or disable) for the Extension
 * stage (firmware handle) in the given pipe.
 *
 * Note:
 *	1. Extension can be enabled/disabled only on QOS Extensions
 *	2. Extension can be enabled/disabled only with an active QOS Pipe
 *	3. Initial(Default) state of QOS Extensions is Disabled
 *	4. State change cannot be guaranteed immediately OR on frame boundary
 *
 */
int
ia_css_pipe_set_qos_ext_state(struct ia_css_pipe *pipe,
			      u32 fw_handle,
			      bool  enable);

/* @brief  Get the state (Enable or Disable) of the Extension stage in the
 *          given pipe.
 * @param[in]  pipe        Pipe handle.
 * @param[in]  fw_handle   Extension firmware Handle (ia_css_fw_info.handle)
 * @param[out] *enable     Enable Flag
 *
 * @return
 * 0			: Success
 * -EINVAL		: Invalid Parameters
 * -EBUSY	: Inactive QOS Pipe
 *					(No active stream with this pipe)
 *
 * This function will query the state of the Extension stage (firmware handle)
 * in the given Pipe.
 *
 * Note:
 *	1. Extension state can be queried only on QOS Extensions
 *	2. Extension can be enabled/disabled only with an active QOS Pipe
 *	3. Initial(Default) state of QOS Extensions is Disabled.
 *
 */
int
ia_css_pipe_get_qos_ext_state(struct ia_css_pipe *pipe,
			      u32 fw_handle,
			      bool *enable);

/* @brief Get selected configuration settings
 * @param[in]	pipe	The pipe.
 * @param[out]	config	Configuration settings.
+0 −7
Original line number Diff line number Diff line
@@ -133,7 +133,6 @@ static const char *const pipe_id_to_str[] = {
	/* [IA_CSS_PIPE_ID_VIDEO]     =*/ "video",
	/* [IA_CSS_PIPE_ID_CAPTURE]   =*/ "capture",
	/* [IA_CSS_PIPE_ID_YUVPP]     =*/ "yuvpp",
	/* [IA_CSS_PIPE_ID_ACC]       =*/ "accelerator"
};

static char dot_id_input_bin[SH_CSS_MAX_BINARY_NAME + 10];
@@ -2989,16 +2988,10 @@ ia_css_debug_dump_pipe_config(
		ia_css_debug_dump_frame_info(&config->vf_output_info[i],
					     "vf_output_info");
	}
	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "acc_extension: %p\n",
			    config->acc_extension);
	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "num_acc_stages: %d\n",
			    config->num_acc_stages);
	ia_css_debug_dump_capture_config(&config->default_capture_config);
	ia_css_debug_dump_resolution(&config->dvs_envelope, "dvs_envelope");
	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "dvs_frame_delay: %d\n",
			    config->dvs_frame_delay);
	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "acc_num_execs: %d\n",
			    config->acc_num_execs);
	ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "enable_dz: %d\n",
			    config->enable_dz);
	IA_CSS_LEAVE_PRIVATE("");
+0 −8
Original line number Diff line number Diff line
@@ -774,14 +774,6 @@ ia_css_pipeline_configure_inout_port(struct ia_css_pipeline *me,
					    (uint8_t)SH_CSS_PORT_OUTPUT,
					    (uint8_t)SH_CSS_HOST_TYPE, 1);
		break;
	case IA_CSS_PIPE_ID_ACC:
		SH_CSS_PIPE_PORT_CONFIG_SET(me->inout_port_config,
					    (uint8_t)SH_CSS_PORT_INPUT,
					    (uint8_t)SH_CSS_HOST_TYPE, 1);
		SH_CSS_PIPE_PORT_CONFIG_SET(me->inout_port_config,
					    (uint8_t)SH_CSS_PORT_OUTPUT,
					    (uint8_t)SH_CSS_HOST_TYPE, 1);
		break;
	default:
		break;
	}
Loading