Re: [PATCH] drm/simple-kms: Fix documentation for drm_simple_encoder_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Am 03.03.20 um 09:33 schrieb Daniel Vetter:
> On Tue, Mar 03, 2020 at 08:18:07AM +0100, Thomas Zimmermann wrote:
>> Brings the documentation of drm_simple_encoder_init() in sync with the
>> function's signature.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
>> Fixes: 63170ac6f2e8 ("drm/simple-kms: Add drm_simple_encoder_{init,create}()")
>> Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
>> Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
>> Cc: Maxime Ripard <mripard@xxxxxxxxxx>
>> Cc: David Airlie <airlied@xxxxxxxx>
>> Cc: Daniel Vetter <daniel@xxxxxxxx>
>> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
>> ---
>>  drivers/gpu/drm/drm_simple_kms_helper.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c
>> index 5a2abe2dea3e..2fab80aaf52e 100644
>> --- a/drivers/gpu/drm/drm_simple_kms_helper.c
>> +++ b/drivers/gpu/drm/drm_simple_kms_helper.c
>> @@ -40,7 +40,7 @@ static const struct drm_encoder_funcs drm_simple_encoder_funcs_cleanup = {
>>  /**
>>   * drm_simple_encoder_init - Initialize a preallocated encoder
>>   * @dev: drm device
>> - * @funcs: callbacks for this encoder
>> + * @encoder: the encoder to initialize
>>   * @encoder_type: user visible type of the encoder
>>   *
>>   * Initialises a preallocated encoder that has no further functionality.
> 
> btw reading this I just realized ... who does the kfree on the memory
> containing the encoder? The ->destroy hook doesn't do that, and without
> that the only other option thus far is devm_kzalloc, which is wrong.
> drmm_kzalloc would fix this, but we don't have that yet.
> 
> How does this work? Maybe add a FIXME note that right now this can only
> really be used if the encoder is embedded into something else that's
> getting freed ...

Good point. The function expects the driver to kfree the memory as part
of the final release. The drivers I saw did this, but adding an
additional note here is probably a good idea.

Best regards
Thomas

> -Daniel
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux