Skip to contentSkip to conversation

drm/simple-kms: Fix documentation for drm_simple_encoder_init()

PATCH Superseded Thomas Zimmermann 2 participants 4 messages Mar 3, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH 1/1 drm/simple-kms: Fix documentation for drm_simple_encoder_init()

Brings the documentation of drm_simple_encoder_init() in sync with the function's signature.

Fixes 63170ac6f2e8 ("drm/simple-kms: Add drm_simple_encoder_{init,create}()")
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_simple_kms_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_simple_kms_helper.c +1 -1
index 5a2abe2dea3e..2fab80aaf52e 100644
@@ -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.

--
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Thomas Zimmermann

Brings the documentation of drm_simple_encoder_init() in sync with the function's signature.

Fixes 63170ac6f2e8 ("drm/simple-kms: Add drm_simple_encoder_{init,create}()")
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Quoted 20 lines
---
 drivers/gpu/drm/drm_simple_kms_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_simple_kms_helper.c +1 -2
index 5a2abe2dea3e..2fab80aaf52e 100644
@@ -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.
--

2.25.1

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
In reply to Thomas Zimmermann
Quoted 20 lines · Thomas Zimmermann

Brings the documentation of drm_simple_encoder_init() in sync with the function's signature.

Fixes 63170ac6f2e8 ("drm/simple-kms: Add drm_simple_encoder_{init,create}()")
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_simple_kms_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_simple_kms_helper.c +0 -0
index 5a2abe2dea3e..2fab80aaf52e 100644

drivers/gpu/drm/drm_simple_kms_helper.c static const struct drm_encoder_funcs drm_simple_encoder_funcs_cleanup = { · line 46

Quoted 8 lines
drivers/gpu/drm/drm_simple_kms_helper.c +1 -1
@@ -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 ...
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#3 lore raw

Hi

Am 03.03.20 um 09:33 schrieb Daniel Vetter:

Quoted 35 lines · Thomas Zimmermann
Quoted 20 lines

Brings the documentation of drm_simple_encoder_init() in sync with the function's signature.

Fixes 63170ac6f2e8 ("drm/simple-kms: Add drm_simple_encoder_{init,create}()")
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_simple_kms_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_simple_kms_helper.c +0 -0
index 5a2abe2dea3e..2fab80aaf52e 100644

drivers/gpu/drm/drm_simple_kms_helper.c static const struct drm_encoder_funcs drm_simple_encoder_funcs_cleanup = { · line 46

Quoted 8 lines
drivers/gpu/drm/drm_simple_kms_helper.c +1 -1
@@ -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.

Quoted 3 lines

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

Quoted 2 lines

-Daniel

Signature · 6 lines
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

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel