diff mbox series

[v4,01/15] drm/msm/dpu: add formats check for writeback encoder

Message ID 20231212205254.12422-2-quic_abhinavk@quicinc.com
State Accepted
Commit 043e5b302625634f5590f3da09652cdfa1037851
Headers show
Series [v4,01/15] drm/msm/dpu: add formats check for writeback encoder | expand

Commit Message

Abhinav Kumar Dec. 12, 2023, 8:52 p.m. UTC
In preparation for adding more formats to dpu writeback add
format validation to it to fail any unsupported formats.

changes in v4:
	- change the failure message of the API
	  drm_atomic_helper_check_wb_connector_state() to a generic
	  one in case it checks more errors later and moreoever it
	  already has debug message to indicate its failure
	- change the corresponding DPU_ERROR to DPU_DEBUG in-line with
	  other atomic_check failure messages

changes in v3:
	- rebase on top of msm-next
	- replace drm_atomic_helper_check_wb_encoder_state() with
	  drm_atomic_helper_check_wb_connector_state() due to the
	  rebase

changes in v2:
	- correct some grammar in the commit text

Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback")
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
index bb94909caa25..4953d87affa1 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c
@@ -272,6 +272,7 @@  static int dpu_encoder_phys_wb_atomic_check(
 {
 	struct drm_framebuffer *fb;
 	const struct drm_display_mode *mode = &crtc_state->mode;
+	int ret;
 
 	DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n",
 			phys_enc->hw_wb->idx, mode->name, mode->hdisplay, mode->vdisplay);
@@ -308,6 +309,12 @@  static int dpu_encoder_phys_wb_atomic_check(
 		return -EINVAL;
 	}
 
+	ret = drm_atomic_helper_check_wb_connector_state(conn_state->connector, conn_state->state);
+	if (ret < 0) {
+		DPU_DEBUG("wb check connector state failed ret = %d\n", ret);
+		return ret;
+	}
+
 	return 0;
 }