[PATCH 3/4] drm: Only lastclose on unload for legacy drivers

Alex Deucher alexdeucher at gmail.com
Wed Aug 2 20:50:30 UTC 2017


On Wed, Aug 2, 2017 at 7:56 AM, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> The only thing modern drivers are supposed to do in lastclose is
> restore the fb emulation state. Which is entirely optional, and
> there's really no reason to do that. So restrict it to legacy drivers
> (where the driver cleanup essentially happens in lastclose).

vga_switcheroo_process_delayed_switch() gets called in lastclose.
Won't that need to get moved elsewhere for this to work?

Alex

>
> This will also allow us to share the unregister function with
> drm_dev_unplug().
>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  drivers/gpu/drm/drm_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 39191e5c240e..694040a240af 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -860,7 +860,8 @@ void drm_dev_unregister(struct drm_device *dev)
>  {
>         struct drm_map_list *r_list, *list_temp;
>
> -       drm_lastclose(dev);
> +       if (drm_core_check_feature(dev, DRIVER_LEGACY))
> +               drm_lastclose(dev);
>
>         dev->registered = false;
>
> --
> 2.13.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list