[PATCH 07/11] drm/gma500: Use fbdev client helpers

Patrik Jakobsson patrik.r.jakobsson at gmail.com
Wed May 8 12:53:11 UTC 2024


On Tue, May 7, 2024 at 2:04 PM Thomas Zimmermann <tzimmermann at suse.de> wrote:
>
> Implement struct drm_client_funcs with the respective helpers and
> remove the custom code from the emulation. The generic helpers are
> equivalent in functionality.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>

Acked-by: Patrik Jakobsson <patrik.r.jakobsson at gmail.com>

> ---
>  drivers/gpu/drm/gma500/fbdev.c | 58 ++--------------------------------
>  1 file changed, 3 insertions(+), 55 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/fbdev.c b/drivers/gpu/drm/gma500/fbdev.c
> index 98b44974d42dd..8a6cb47e83f8f 100644
> --- a/drivers/gpu/drm/gma500/fbdev.c
> +++ b/drivers/gpu/drm/gma500/fbdev.c
> @@ -8,7 +8,6 @@
>  #include <linux/fb.h>
>  #include <linux/pfn_t.h>
>
> -#include <drm/drm_crtc_helper.h>
>  #include <drm/drm_drv.h>
>  #include <drm/drm_fb_helper.h>
>  #include <drm/drm_framebuffer.h>
> @@ -252,63 +251,12 @@ static const struct drm_fb_helper_funcs psb_fbdev_fb_helper_funcs = {
>  };
>
>  /*
> - * struct drm_client_funcs and setup code
> + * struct drm_client_funcs
>   */
>
> -static void psb_fbdev_client_unregister(struct drm_client_dev *client)
> -{
> -       struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client);
> -
> -       if (fb_helper->info) {
> -               drm_fb_helper_unregister_info(fb_helper);
> -       } else {
> -               drm_fb_helper_unprepare(fb_helper);
> -               drm_client_release(&fb_helper->client);
> -               kfree(fb_helper);
> -       }
> -}
> -
> -static int psb_fbdev_client_restore(struct drm_client_dev *client)
> -{
> -       drm_fb_helper_lastclose(client->dev);
> -
> -       return 0;
> -}
> -
> -static int psb_fbdev_client_hotplug(struct drm_client_dev *client)
> -{
> -       struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client);
> -       struct drm_device *dev = client->dev;
> -       int ret;
> -
> -       if (dev->fb_helper)
> -               return drm_fb_helper_hotplug_event(dev->fb_helper);
> -
> -       ret = drm_fb_helper_init(dev, fb_helper);
> -       if (ret)
> -               goto err_drm_err;
> -
> -       if (!drm_drv_uses_atomic_modeset(dev))
> -               drm_helper_disable_unused_functions(dev);
> -
> -       ret = drm_fb_helper_initial_config(fb_helper);
> -       if (ret)
> -               goto err_drm_fb_helper_fini;
> -
> -       return 0;
> -
> -err_drm_fb_helper_fini:
> -       drm_fb_helper_fini(fb_helper);
> -err_drm_err:
> -       drm_err(dev, "Failed to setup gma500 fbdev emulation (ret=%d)\n", ret);
> -       return ret;
> -}
> -
>  static const struct drm_client_funcs psb_fbdev_client_funcs = {
> -       .owner          = THIS_MODULE,
> -       .unregister     = psb_fbdev_client_unregister,
> -       .restore        = psb_fbdev_client_restore,
> -       .hotplug        = psb_fbdev_client_hotplug,
> +       .owner = THIS_MODULE,
> +       DRM_FBDEV_HELPER_CLIENT_FUNCS,
>  };
>
>  void psb_fbdev_setup(struct drm_psb_private *dev_priv)
> --
> 2.44.0
>


More information about the amd-gfx mailing list