LKML Archive on
help / color / mirror / Atom feed
* [PATCH] drm/komeda: Accept null writeback configurations for writeback
@ 2019-05-24  3:16 james qian wang (Arm Technology China)
  0 siblings, 0 replies; only message in thread
From: james qian wang (Arm Technology China) @ 2019-05-24  3:16 UTC (permalink / raw)
  To: Liviu Dudau, airlied, Brian Starkey, maarten.lankhorst, sean
  Cc: Jonathan Chai (Arm Technology China),
	Julien Yin (Arm Technology China),
	thomas Sun (Arm Technology China),
	Lowry Li (Arm Technology China),
	Ayan Halder, Tiannan Zhu (Arm Technology China),
	Yiqi Kang (Arm Technology China),
	nd, linux-kernel, dri-devel, Ben Davis,
	Oscar Zhang (Arm Technology China),
	Channing Chen (Arm Technology China),
	james qian wang (Arm Technology China)

User may send null writeback configurations for writeback connector like:
- Only bind the writeback connector to crtc.
- set a fb_id(0) to writeback_fb_id_property
All above configurations are meaningless for writeback, but since they are
still valid configurations, accept them.

Depends on:

Signed-off-by: James Qian Wang (Arm Technology China) <>
 .../gpu/drm/arm/display/komeda/komeda_wb_connector.c  | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
index 20295291572f..0d734244f662 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
@@ -13,11 +13,7 @@ komeda_wb_init_data_flow(struct komeda_layer *wb_layer,
 			 struct komeda_crtc_state *kcrtc_st,
 			 struct komeda_data_flow_cfg *dflow)
-	struct drm_framebuffer *fb = conn_st->writeback_job ?
-				     conn_st->writeback_job->fb : NULL;
-	if (!fb)
-		return -EINVAL;
+	struct drm_framebuffer *fb = conn_st->writeback_job->fb;
 	memset(dflow, 0, sizeof(*dflow));
@@ -42,10 +38,15 @@ komeda_wb_encoder_atomic_check(struct drm_encoder *encoder,
 			       struct drm_connector_state *conn_st)
 	struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(crtc_st);
+	struct drm_writeback_job *writeback_job = conn_st->writeback_job;
 	struct komeda_layer *wb_layer;
 	struct komeda_data_flow_cfg dflow;
 	int err;
+	if (!writeback_job || !writeback_job->fb) {
+		return 0;
+	}
 	if (!crtc_st->active) {
 		DRM_DEBUG_ATOMIC("Cannot write the composition result out on a inactive CRTC.\n");
 		return -EINVAL;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-24  3:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24  3:16 [PATCH] drm/komeda: Accept null writeback configurations for writeback james qian wang (Arm Technology China)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).