[PATCH 5/6] drm/omapdrm: Initialize fbdev DRM client

Thomas Zimmermann tzimmermann at suse.de
Mon Apr 3 08:15:48 UTC 2023


Hi

Am 30.03.23 um 14:13 schrieb Tomi Valkeinen:
> On 30/03/2023 11:32, Thomas Zimmermann wrote:
>> Initialize the fbdev client in the fbdev code with empty helper
>> functions. Also clean up the client. The helpers will later
>> implement various functionality of the DRM client. No functional
>> changes.
> 
> I don't see this doing any cleanups.

Yeah, that's really not well phrased in my commit message. I wanted to 
say that we now clean up by calling drm_client_release() in _fini and 
the error-handling code.

> 
> I think this could be as well merged to the next patch, as this is such 
> a short one.

Sure not problem. They both belong together, but I thought it's easier 
for reviewers to see what's happening if they are separate.

Best regards
Thomas

> 
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>
> 
>   Tomi
> 
>> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
>> ---
>>   drivers/gpu/drm/omapdrm/omap_fbdev.c | 33 +++++++++++++++++++++++++++-
>>   1 file changed, 32 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c 
>> b/drivers/gpu/drm/omapdrm/omap_fbdev.c
>> index 79e417b391bf..f0e35f4764a7 100644
>> --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
>> +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
>> @@ -221,6 +221,30 @@ static struct drm_fb_helper *get_fb(struct 
>> fb_info *fbi)
>>       return fbi->par;
>>   }
>> +/*
>> + * struct drm_client
>> + */
>> +
>> +static void omap_fbdev_client_unregister(struct drm_client_dev *client)
>> +{ }
>> +
>> +static int omap_fbdev_client_restore(struct drm_client_dev *client)
>> +{
>> +    return 0;
>> +}
>> +
>> +static int omap_fbdev_client_hotplug(struct drm_client_dev *client)
>> +{
>> +    return 0;
>> +}
>> +
>> +static const struct drm_client_funcs omap_fbdev_client_funcs = {
>> +    .owner        = THIS_MODULE,
>> +    .unregister    = omap_fbdev_client_unregister,
>> +    .restore    = omap_fbdev_client_restore,
>> +    .hotplug    = omap_fbdev_client_hotplug,
>> +};
>> +
>>   /* initialize fbdev helper */
>>   void omap_fbdev_init(struct drm_device *dev)
>>   {
>> @@ -242,10 +266,14 @@ void omap_fbdev_init(struct drm_device *dev)
>>       drm_fb_helper_prepare(dev, helper, 32, &omap_fb_helper_funcs);
>> -    ret = drm_fb_helper_init(dev, helper);
>> +    ret = drm_client_init(dev, &helper->client, "fbdev", 
>> &omap_fbdev_client_funcs);
>>       if (ret)
>>           goto fail;
>> +    ret = drm_fb_helper_init(dev, helper);
>> +    if (ret)
>> +        goto err_drm_client_release;
>> +
>>       ret = drm_fb_helper_initial_config(helper);
>>       if (ret)
>>           goto fini;
>> @@ -254,6 +282,8 @@ void omap_fbdev_init(struct drm_device *dev)
>>   fini:
>>       drm_fb_helper_fini(helper);
>> +err_drm_client_release:
>> +    drm_client_release(&helper->client);
>>   fail:
>>       drm_fb_helper_unprepare(helper);
>>       kfree(fbdev);
>> @@ -291,6 +321,7 @@ void omap_fbdev_fini(struct drm_device *dev)
>>       if (fb)
>>           drm_framebuffer_remove(fb);
>> +    drm_client_release(&helper->client);
>>       drm_fb_helper_unprepare(helper);
>>       kfree(fbdev);
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230403/25d8f240/attachment.sig>


More information about the dri-devel mailing list