On Fri, Apr 5, 2024 at 5:53 PM Maaz Mombasawala
<maaz.mombasaw...@broadcom.com> wrote:
>
> On 4/2/24 16:28, Zack Rusin wrote:
> >
> > @@ -541,6 +518,8 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, 
> > unsigned unit)
> >                        dev_priv->implicit_placement_property,
> >                        1);
> >
> > +     vmw_du_init(&ldu->base);
> > +
> >       return 0;
> >
> >  err_free_unregister:
>
> > @@ -905,6 +900,9 @@ static int vmw_sou_init(struct vmw_private *dev_priv, 
> > unsigned unit)
> >                                  dev->mode_config.suggested_x_property, 0);
> >       drm_object_attach_property(&connector->base,
> >                                  dev->mode_config.suggested_y_property, 0);
> > +
> > +     vmw_du_init(&sou->base);
> > +
> >       return 0;
> >
> >  err_free_unregister:
>
> > @@ -1575,6 +1576,9 @@ static int vmw_stdu_init(struct vmw_private 
> > *dev_priv, unsigned unit)
> >                                  dev->mode_config.suggested_x_property, 0);
> >       drm_object_attach_property(&connector->base,
> >                                  dev->mode_config.suggested_y_property, 0);
> > +
> > +     vmw_du_init(&stdu->base);
> > +
> >       return 0;
> >
> >  err_free_unregister:
>
> Shouldn't calls to vmw_du_init() be behind an if(vkms_enabled) condition?

So the vmw_du_init is supposed to initialize the base, so that's
unconditional. To match the unconditional vmw_du_cleanup. There's an
argument to be made whether both of those should unconditionally  call
vmw_vkms_crtc_init and vmw_vkms_crtc_cleanup. My opinion was that
they're not doing anything costly and just initialize members and
having the members of vmw_display_unit initialized whether vkms is
enabled or not still makes sense.

z

Reply via email to