Skip to contentSkip to conversation

drm/doc: Improve docs for conn_state->best_encoder

PATCH In review Daniel Vetter 3 participants 4 messages May 6, 2019 – May 7, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/doc: Improve docs for conn_state->best_encoder

It's mandatory and considered core state since ioctls rely on this working.

Thanks to Laurent for pointing out this gap.

v2: Clarify to "atomic drivers" only.

Cc Laurent Pinchart <[email protected]>
Cc Sean Paul <[email protected]>
---
 include/drm/drm_connector.h | 4 ++++
 1 file changed, 4 insertions(+)
include/drm/drm_connector.h +4 -0
index 02a131202add..f43f40d5888a 100644
@@ -517,6 +517,10 @@ struct drm_connector_state {
 	 * Used by the atomic helpers to select the encoder, through the
 	 * &drm_connector_helper_funcs.atomic_best_encoder or
 	 * &drm_connector_helper_funcs.best_encoder callbacks.
+	 *
+	 * NOTE: Atomic drivers must fill this out (either themselves or through
+	 * helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will
+	 * not return correct data to userspace.
 	 */
 	struct drm_encoder *best_encoder;
 
Signature · 6 lines
2.20.1

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

Hi Daniel,

Thank you for the patch.

Quoted 19 lines · Daniel Vetter

It's mandatory and considered core state since ioctls rely on this working.

Thanks to Laurent for pointing out this gap.

v2: Clarify to "atomic drivers" only.

Cc Laurent Pinchart <[email protected]>
Cc Sean Paul <[email protected]>
---
 include/drm/drm_connector.h | 4 ++++
 1 file changed, 4 insertions(+)
include/drm/drm_connector.h +0 -0
index 02a131202add..f43f40d5888a 100644

include/drm/drm_connector.h struct drm_connector_state { · line 519

Quoted 3 lines
include/drm/drm_connector.h +0 -0
@@ -517,6 +517,10 @@ struct drm_connector_state {
 	 * Used by the atomic helpers to select the encoder, through the
 	 * &drm_connector_helper_funcs.atomic_best_encoder or
 	 * &drm_connector_helper_funcs.best_encoder callbacks.

How about updating this part as well ?

"Used by both the DRM core and the atomic helpers to select the encoder (through the &drm_connector_helper_funcs.atomic_best_encoder), access it and report it to userspace (through the GETCONNECTOR and GETENCODER ioctls). This field shall be set by all atomic drivers, either directly or through atomic helpers."

Quoted 7 lines
include/drm/drm_connector.h +4 -0
+	 *
+	 * NOTE: Atomic drivers must fill this out (either themselves or through
+	 * helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will
+	 * not return correct data to userspace.
 	 */
 	struct drm_encoder *best_encoder;
 
Signature · 7 lines
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 30 lines · Laurent Pinchart

Hi Daniel,

Thank you for the patch.

Quoted 19 lines · Daniel Vetter

It's mandatory and considered core state since ioctls rely on this working.

Thanks to Laurent for pointing out this gap.

v2: Clarify to "atomic drivers" only.

Cc Laurent Pinchart <[email protected]>
Cc Sean Paul <[email protected]>
---
 include/drm/drm_connector.h | 4 ++++
 1 file changed, 4 insertions(+)
include/drm/drm_connector.h +0 -0
index 02a131202add..f43f40d5888a 100644

include/drm/drm_connector.h struct drm_connector_state { · line 519

Quoted 3 lines
include/drm/drm_connector.h +0 -0
@@ -517,6 +517,10 @@ struct drm_connector_state {
 	 * Used by the atomic helpers to select the encoder, through the
 	 * &drm_connector_helper_funcs.atomic_best_encoder or
 	 * &drm_connector_helper_funcs.best_encoder callbacks.

How about updating this part as well ?

Quoted 5 lines

"Used by both the DRM core and the atomic helpers to select the encoder (through the &drm_connector_helper_funcs.atomic_best_encoder), access it and report it to userspace (through the GETCONNECTOR and GETENCODER ioctls). This field shall be set by all atomic drivers, either directly or through atomic helpers."

It's kinda two things, I think best to describe in two paragraphs. But I can move the core usage up, since arguable more important. Otoh most drivers won't care since helpers handle this, and they care more about how @best_encoder is used.

E.g. core never calls the helper callbacks @atomic_best_endoer/best_encoder, which isn't clear anymore with your wording. And I have a sticker for core/helper splits :-) -Daniel

Quoted 13 lines
Quoted 8 lines
include/drm/drm_connector.h +4 -0
+	 *
+	 * NOTE: Atomic drivers must fill this out (either themselves or through
+	 * helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will
+	 * not return correct data to userspace.
 	 */
 	struct drm_encoder *best_encoder;
 
Signature · 3 lines
Regards,

Laurent Pinchart
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
#3 lore raw
Quoted 37 lines · Daniel Vetter
Quoted 30 lines · Laurent Pinchart

Hi Daniel,

Thank you for the patch.

Quoted 19 lines · Daniel Vetter

It's mandatory and considered core state since ioctls rely on this working.

Thanks to Laurent for pointing out this gap.

v2: Clarify to "atomic drivers" only.

Cc Laurent Pinchart <[email protected]>
Cc Sean Paul <[email protected]>
---
 include/drm/drm_connector.h | 4 ++++
 1 file changed, 4 insertions(+)
include/drm/drm_connector.h +0 -0
index 02a131202add..f43f40d5888a 100644

include/drm/drm_connector.h struct drm_connector_state { · line 519

Quoted 3 lines
include/drm/drm_connector.h +0 -0
@@ -517,6 +517,10 @@ struct drm_connector_state {
 	 * Used by the atomic helpers to select the encoder, through the
 	 * &drm_connector_helper_funcs.atomic_best_encoder or
 	 * &drm_connector_helper_funcs.best_encoder callbacks.

How about updating this part as well ?

Quoted 5 lines

"Used by both the DRM core and the atomic helpers to select the encoder (through the &drm_connector_helper_funcs.atomic_best_encoder), access it and report it to userspace (through the GETCONNECTOR and GETENCODER ioctls). This field shall be set by all atomic drivers, either directly or through atomic helpers."

Quoted 8 lines

It's kinda two things, I think best to describe in two paragraphs. But I can move the core usage up, since arguable more important. Otoh most drivers won't care since helpers handle this, and they care more about how @best_encoder is used.

E.g. core never calls the helper callbacks @atomic_best_endoer/best_encoder, which isn't clear anymore with your wording. And I have a sticker for core/helper splits :-)

Went ahead with Sean's irc ack and merged this. We can bikeshed more later on I guess with more patches. I think sprinkling a pile of cross references once Sean's and yours patches all land would be good. -Daniel

Quoted 19 lines

-Daniel

Quoted 13 lines
Quoted 8 lines
include/drm/drm_connector.h +4 -0
+	 *
+	 * NOTE: Atomic drivers must fill this out (either themselves or through
+	 * helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will
+	 * not return correct data to userspace.
 	 */
 	struct drm_encoder *best_encoder;
 
Signature · 3 lines
Regards,

Laurent Pinchart
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
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