Commit 32ecf92a authored by Jeykumar Sankaran's avatar Jeykumar Sankaran Committed by Rob Clark
Browse files

drm/msm/dpu: remove RM dependency on connector state



Connector states were passed around RM to update the custom
topology connector property with chosen topology data. Now that
we got rid of both custom properties and topology names, this
change cleans up the mechanism to pass connector states across
RM helpers and encoder functions.

changes in v5:
	- Introduced in the series
changes in v6:
	- remove parameter checking in rm reserve (Jordan)

Signed-off-by: default avatarJeykumar Sankaran <jsanka@codeaurora.org>
Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent d0a13816
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -436,15 +436,14 @@ int dpu_encoder_helper_unregister_irq(struct dpu_encoder_phys *phys_enc,
}

void dpu_encoder_get_hw_resources(struct drm_encoder *drm_enc,
		struct dpu_encoder_hw_resources *hw_res,
		struct drm_connector_state *conn_state)
				  struct dpu_encoder_hw_resources *hw_res)
{
	struct dpu_encoder_virt *dpu_enc = NULL;
	int i = 0;

	if (!hw_res || !drm_enc || !conn_state) {
		DPU_ERROR("invalid argument(s), drm_enc %d, res %d, state %d\n",
				drm_enc != 0, hw_res != 0, conn_state != 0);
	if (!hw_res || !drm_enc) {
		DPU_ERROR("invalid argument(s), drm_enc %d, res %d\n",
			  drm_enc != 0, hw_res != 0);
		return;
	}

@@ -458,7 +457,7 @@ void dpu_encoder_get_hw_resources(struct drm_encoder *drm_enc,
		struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];

		if (phys && phys->ops.get_hw_resources)
			phys->ops.get_hw_resources(phys, hw_res, conn_state);
			phys->ops.get_hw_resources(phys, hw_res);
	}
}

@@ -652,7 +651,7 @@ static int dpu_encoder_virt_atomic_check(
		if (drm_atomic_crtc_needs_modeset(crtc_state)
				&& dpu_enc->mode_set_complete) {
			ret = dpu_rm_reserve(&dpu_kms->rm, drm_enc, crtc_state,
				conn_state, topology, true);
					     topology, true);
			dpu_enc->mode_set_complete = false;
		}
	}
@@ -1044,7 +1043,7 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,

	/* Reserve dynamic resources now. Indicating non-AtomicTest phase */
	ret = dpu_rm_reserve(&dpu_kms->rm, drm_enc, drm_enc->crtc->state,
			conn->state, topology, false);
			     topology, false);
	if (ret) {
		DPU_ERROR_ENC(dpu_enc,
				"failed to reserve hw resources, %d\n", ret);
+1 −3
Original line number Diff line number Diff line
@@ -51,11 +51,9 @@ struct dpu_encoder_kickoff_params {
 * dpu_encoder_get_hw_resources - Populate table of required hardware resources
 * @encoder:	encoder pointer
 * @hw_res:	resource table to populate with encoder required resources
 * @conn_state:	report hw reqs based on this proposed connector state
 */
void dpu_encoder_get_hw_resources(struct drm_encoder *encoder,
		struct dpu_encoder_hw_resources *hw_res,
		struct drm_connector_state *conn_state);
				  struct dpu_encoder_hw_resources *hw_res);

/**
 * dpu_encoder_register_vblank_callback - provide callback to encoder that
+1 −2
Original line number Diff line number Diff line
@@ -140,8 +140,7 @@ struct dpu_encoder_phys_ops {
			    struct drm_connector_state *conn_state);
	void (*destroy)(struct dpu_encoder_phys *encoder);
	void (*get_hw_resources)(struct dpu_encoder_phys *encoder,
			struct dpu_encoder_hw_resources *hw_res,
			struct drm_connector_state *conn_state);
				 struct dpu_encoder_hw_resources *hw_res);
	int (*control_vblank_irq)(struct dpu_encoder_phys *enc, bool enable);
	int (*wait_for_commit_done)(struct dpu_encoder_phys *phys_enc);
	int (*wait_for_tx_complete)(struct dpu_encoder_phys *phys_enc);
+1 −2
Original line number Diff line number Diff line
@@ -599,8 +599,7 @@ static void dpu_encoder_phys_cmd_destroy(struct dpu_encoder_phys *phys_enc)

static void dpu_encoder_phys_cmd_get_hw_resources(
		struct dpu_encoder_phys *phys_enc,
		struct dpu_encoder_hw_resources *hw_res,
		struct drm_connector_state *conn_state)
		struct dpu_encoder_hw_resources *hw_res)
{
	struct dpu_encoder_phys_cmd *cmd_enc =
		to_dpu_encoder_phys_cmd(phys_enc);
+3 −4
Original line number Diff line number Diff line
@@ -537,12 +537,11 @@ static void dpu_encoder_phys_vid_destroy(struct dpu_encoder_phys *phys_enc)

static void dpu_encoder_phys_vid_get_hw_resources(
		struct dpu_encoder_phys *phys_enc,
		struct dpu_encoder_hw_resources *hw_res,
		struct drm_connector_state *conn_state)
		struct dpu_encoder_hw_resources *hw_res)
{
	if (!phys_enc || !hw_res) {
		DPU_ERROR("invalid arg(s), enc %d hw_res %d conn_state %d\n",
				phys_enc != 0, hw_res != 0, conn_state != 0);
		DPU_ERROR("invalid arg(s), enc %d hw_res %d\n",
			  phys_enc != 0, hw_res != 0);
		return;
	}

Loading