On Fri, Aug 01, 2025 at 04:08:37PM +0200, Louis Chauvet wrote: > > > Le 01/08/2025 à 15:51, Dmitry Baryshkov a écrit : > > Use drmm_plain_encoder_alloc() to allocate simple encoder and > > drmm_writeback_connector_init() in order to initialize writeback > > connector instance. > > > > Signed-off-by: Dmitry Baryshkov <dmitry.barysh...@oss.qualcomm.com> > > --- > > .../gpu/drm/renesas/rcar-du/rcar_du_writeback.c | 23 > > +++++++++++++++------- > > 1 file changed, 16 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c > > b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c > > index > > 8cd37d7b8ae281cbc1fd8cbb243c621174517e23..9986a10e8114680e9da48986f4ca3ce6ec66b8cb > > 100644 > > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c > > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c > > @@ -134,7 +134,6 @@ static void rcar_du_wb_conn_reset(struct drm_connector > > *connector) > > static const struct drm_connector_funcs rcar_du_wb_conn_funcs = { > > .reset = rcar_du_wb_conn_reset, > > .fill_modes = drm_helper_probe_single_connector_modes, > > - .destroy = drm_connector_cleanup, > > .atomic_duplicate_state = rcar_du_wb_conn_duplicate_state, > > .atomic_destroy_state = rcar_du_wb_conn_destroy_state, > > }; > > @@ -202,15 +201,25 @@ int rcar_du_writeback_init(struct rcar_du_device > > *rcdu, > > { > > struct drm_writeback_connector *wb_conn = &rcrtc->writeback; > > + struct drm_encoder *encoder; > > + > > + encoder = drmm_plain_encoder_alloc(&rcdu->ddev, NULL, > > + DRM_MODE_ENCODER_VIRTUAL, NULL); > > + if (IS_ERR(encoder)) > > + return PTR_ERR(encoder); > > + > > + drm_encoder_helper_add(encoder, &rcar_du_wb_enc_helper_funcs); > > + > > + encoder->possible_crtcs = 1 << drm_crtc_index(&rcrtc->crtc); > > drm_crtc_mask?
I was just moving the code, but I think this kind of change is fine > > With this: > > Reviewed-by: Louis Chauvet <louis.chauvet> > > > + > > drm_connector_helper_add(&wb_conn->base, > > &rcar_du_wb_conn_helper_funcs); > > - return drm_writeback_connector_init(&rcdu->ddev, wb_conn, > > - &rcar_du_wb_conn_funcs, > > - &rcar_du_wb_enc_helper_funcs, > > - writeback_formats, > > - ARRAY_SIZE(writeback_formats), > > - 1 << drm_crtc_index(&rcrtc->crtc)); > > + return drmm_writeback_connector_init(&rcdu->ddev, wb_conn, > > + &rcar_du_wb_conn_funcs, > > + encoder, > > + writeback_formats, > > + ARRAY_SIZE(writeback_formats)); > > } > > void rcar_du_writeback_setup(struct rcar_du_crtc *rcrtc, > > > > -- > Louis Chauvet, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com > -- With best wishes Dmitry