Message ID | 20211213092503.57379-3-maxime@cerno.tech (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/vc4: Use the firmware to stop the display pipeline | expand |
Hi Maxime Am 13.12.21 um 10:25 schrieb Maxime Ripard: > The bind hooks will modify their controller registers, so simplefb is > going to be unusable anyway. Let's avoid any transient state where it > could still be in the system but no longer functionnal. > > Acked-by: Nicolas Saenz Julienne <nsaenz@kernel.org> > Signed-off-by: Maxime Ripard <maxime@cerno.tech> > --- > drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c > index 16abc3a3d601..8ab89f805826 100644 > --- a/drivers/gpu/drm/vc4/vc4_drv.c > +++ b/drivers/gpu/drm/vc4/vc4_drv.c > @@ -251,6 +251,10 @@ static int vc4_drm_bind(struct device *dev) Since you work on this, I'd like to suggest to call drm_firmware_drivers_only() at the very top of this function. It's our new interface for the kernel's nomodeset argument. If it returns false, the user has disabled native drivers for this boot. The generic DRM driver will continue to run the device. > if (ret) > return ret; > > + ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); > + if (ret) > + return ret; > + There's quite a bit of work being done before calling this function. None of it is allowed to touch HW. Is that reliable? If so, the code is fine, otherwise the call should go to the top of the function. Best regards Thomas > ret = component_bind_all(dev, drm); > if (ret) > return ret; > @@ -259,10 +263,6 @@ static int vc4_drm_bind(struct device *dev) > if (ret) > goto unbind_all; > > - ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); > - if (ret) > - goto unbind_all; > - > ret = vc4_kms_load(drm); > if (ret < 0) > goto unbind_all; >
Am 13.12.21 um 10:47 schrieb Thomas Zimmermann: > Hi Maxime > > Am 13.12.21 um 10:25 schrieb Maxime Ripard: >> The bind hooks will modify their controller registers, so simplefb is >> going to be unusable anyway. Let's avoid any transient state where it >> could still be in the system but no longer functionnal. >> >> Acked-by: Nicolas Saenz Julienne <nsaenz@kernel.org> >> Signed-off-by: Maxime Ripard <maxime@cerno.tech> >> --- >> drivers/gpu/drm/vc4/vc4_drv.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/vc4/vc4_drv.c >> b/drivers/gpu/drm/vc4/vc4_drv.c >> index 16abc3a3d601..8ab89f805826 100644 >> --- a/drivers/gpu/drm/vc4/vc4_drv.c >> +++ b/drivers/gpu/drm/vc4/vc4_drv.c >> @@ -251,6 +251,10 @@ static int vc4_drm_bind(struct device *dev) > > Since you work on this, I'd like to suggest to call > drm_firmware_drivers_only() at the very top of this function. It's our > new interface for the kernel's nomodeset argument. If it returns false, s/false/true > the user has disabled native drivers for this boot. The generic DRM > driver will continue to run the device. > >> if (ret) >> return ret; >> + ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); >> + if (ret) >> + return ret; >> + > > There's quite a bit of work being done before calling this function. > None of it is allowed to touch HW. > > Is that reliable? If so, the code is fine, otherwise the call should go > to the top of the function. > > Best regards > Thomas > >> ret = component_bind_all(dev, drm); >> if (ret) >> return ret; >> @@ -259,10 +263,6 @@ static int vc4_drm_bind(struct device *dev) >> if (ret) >> goto unbind_all; >> - ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); >> - if (ret) >> - goto unbind_all; >> - >> ret = vc4_kms_load(drm); >> if (ret < 0) >> goto unbind_all; >> >
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 16abc3a3d601..8ab89f805826 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -251,6 +251,10 @@ static int vc4_drm_bind(struct device *dev) if (ret) return ret; + ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); + if (ret) + return ret; + ret = component_bind_all(dev, drm); if (ret) return ret; @@ -259,10 +263,6 @@ static int vc4_drm_bind(struct device *dev) if (ret) goto unbind_all; - ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver); - if (ret) - goto unbind_all; - ret = vc4_kms_load(drm); if (ret < 0) goto unbind_all;