drm/doc: Document uapi requirements in DRM
Subsystems (3)
PATCH 1/1 drm/doc: Document uapi requirements in DRM
Everyone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Last time this was a big discussion was about 6 years ago, when qcom tried to land a kernel driver without userspace. Dave Airlie made the rules really clear:
http://airlied.livejournal.com/73115.html
This write-up here is essentially what I've put into a presentation a while ago, which was also reviewed by Dave:
http://blog.ffwll.ch/2015/05/gfx-kernel-upstreaming-requirements.html
--- Documentation/gpu/drm-uapi.rst | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)
Documentation/gpu/drm-uapi.rst +67 -0
@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements on what the userspace side for new +uAPI needs to look like. This section here explains what exactly those +requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed and ready for +merging into a suitable and canonical upstream project. + +GFX devices (both display and render/GPU side) are really complex bits of hardware, +with userspace and kernel by necessity having to work together really closely. +The interfaces, for rendering and modesetting must be extremely wide and +flexible, and therefore it is almost always impossible to precisely define them +for every possible corner case. This in turns makes it really practically +infeasible to differentiate between behaviour that's required by userspace, and +which must not be changed to avoid regressions, and behaviour which is only an +accidental artifact of the current implementation. + +Without access to the full source code of all userspace users that means it +becomes impossible to change the implementation details, since userspace could +depend upon the accidental behaviour of the current implementation in minute +details. And debugging such regressions without access to source code is pretty +much impossible. As a consequence this means: + +- The Linux kernel's "no regression" policy holds in practice only for + open-source userspace of the DRM subsystem. DRM developers are perfectly fine + if closed-source blob drivers in userspace use the same uAPI as the open + drivers, but they must do so in the exact same way as the open drivers. + Creative (ab)use of the interfaces will, and in the past routinely has, lead + to breakage. + +- Any new userspace interface must have an open-source implementation as + demonstration vehicle. + +The other reason for requiring open-source userspace is uAPI review. Since the +kernel and userspace parts of a GFX stack must work together so closely, code +review can only assess whether a new interface achieves its goals by looking at +both sides. Making sure that the interface indeed covers the use-case fully +leads to a few additional requirements: + +- The open-source userspace must not be a toy/test application, but the real + thing. Specifically it needs to handle all the usual error and corner cases. + These are often the places where new uAPI falls apart and hence essential to + assess the fitness of a proposed interface. + +- The userspace side must be fully reviewed and tested to the standards of that + userspace project. For e.g. mesa this means piglit testcases and review on the + mailing list. This is again to ensure that the new interface actually gets the + job done. + +- The userspace patches must be against the canonical upstream, not some vendor + fork. This is to make sure that no one cheats on the review and testing + requirements by doing a quick fork. + +- The kernel patch can only be merged after all the above requirements are met, + but it **must** be merged **before** the userspace patches land. uAPI always flows + from the kernel, doing things the other way round risks divergence of the uAPI + definitions and header files. + +These are fairly steep requirements, but have grown out from years of shared +pain and experience with uAPI added hastily, and almost always regretted about +as fast. GFX devices change really fast, requiring a paradigm shift and entire +new set of uAPI interfaces every few years at least. Together with the Linux +kernel's guarantee to keep existing userspace running for 10+ years this is +already rather painful for the DRM subsystem, with multiple different uAPIs for +the same thing co-existing. If we'd add a few more complete mistakes into the +mix every year it would be entirely unmanagable. + Render nodes ============
Signature · 6 lines
2.8.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 19 lines · Daniel Vetter
Everyone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
--- Documentation/gpu/drm-uapi.rst | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)Documentation/gpu/drm-uapi.rst +1
-0@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements on what the userspace side for new
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 49
Quoted 10 lines
Documentation/gpu/drm-uapi.rst +10
-0+uAPI needs to look like. This section here explains what exactly those +requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed and ready for +merging into a suitable and canonical upstream project. + +GFX devices (both display and render/GPU side) are really complex bits of hardware, +with userspace and kernel by necessity having to work together really closely. +The interfaces, for rendering and modesetting must be extremely wide and
I think there should be another comma after "modesetting".
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 51
Quoted 2 lines
Documentation/gpu/drm-uapi.rst +2
-0+flexible, and therefore it is almost always impossible to precisely define them +for every possible corner case. This in turns makes it really practically
"in turn"
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 103
Quoted 7 lines
Documentation/gpu/drm-uapi.rst +7
-0+These are fairly steep requirements, but have grown out from years of shared +pain and experience with uAPI added hastily, and almost always regretted about +as fast. GFX devices change really fast, requiring a paradigm shift and entire +new set of uAPI interfaces every few years at least. Together with the Linux +kernel's guarantee to keep existing userspace running for 10+ years this is +already rather painful for the DRM subsystem, with multiple different uAPIs for +the same thing co-existing. If we'd add a few more complete mistakes into the
"If we"
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 104
Quoted 1 line
Documentation/gpu/drm-uapi.rst +1
-0+mix every year it would be entirely unmanagable.
With the little nitpicks (probably) fixed,
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 19.08.2016 um 23:43 schrieb Eric Anholt:
Quoted 6 lines
Quoted 4 lines · Daniel Vetter
Everyone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Oh, yes please.
Quoted 38 lines
Quoted 13 lines
--- Documentation/gpu/drm-uapi.rst | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)Documentation/gpu/drm-uapi.rst +1
-0@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements on what the userspace side for newDocumentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 49
Quoted 10 lines
Documentation/gpu/drm-uapi.rst +10
-0+uAPI needs to look like. This section here explains what exactly those +requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed and ready for +merging into a suitable and canonical upstream project. + +GFX devices (both display and render/GPU side) are really complex bits of hardware, +with userspace and kernel by necessity having to work together really closely. +The interfaces, for rendering and modesetting must be extremely wide andI think there should be another comma after "modesetting".
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 51
Quoted 2 lines
Documentation/gpu/drm-uapi.rst +2
-0+flexible, and therefore it is almost always impossible to precisely define them +for every possible corner case. This in turns makes it really practically"in turn"
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 103
Quoted 7 lines
Documentation/gpu/drm-uapi.rst +7
-0+These are fairly steep requirements, but have grown out from years of shared +pain and experience with uAPI added hastily, and almost always regretted about +as fast. GFX devices change really fast, requiring a paradigm shift and entire +new set of uAPI interfaces every few years at least. Together with the Linux +kernel's guarantee to keep existing userspace running for 10+ years this is +already rather painful for the DRM subsystem, with multiple different uAPIs for +the same thing co-existing. If we'd add a few more complete mistakes into the"If we"
Quoted 4 lines
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 104
Quoted 1 line
Documentation/gpu/drm-uapi.rst +1
-0+mix every year it would be entirely unmanagable.With the little nitpicks (probably) fixed,
Reviewed-by Eric Anholt <[email protected]>
I read through it and can't find anything more to add. So with Eric's comments fixed the patch is Reviewed-by: Christian König <[email protected]>.
Additional to that I think with our hybrid stack this is rather important for AMD. So I'm going to forward it to a few people internally as well.
Regards,
Christian.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 110 lines · Daniel Vetter
Everyone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Last time this was a big discussion was about 6 years ago, when qcom tried to land a kernel driver without userspace. Dave Airlie made the rules really clear:
http://airlied.livejournal.com/73115.html
This write-up here is essentially what I've put into a presentation a while ago, which was also reviewed by Dave:
http://blog.ffwll.ch/2015/05/gfx-kernel-upstreaming-requirements.html
Cc Dave Airlie <[email protected]>Cc Oded Gabbay <[email protected]>Cc Russell King <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Eric Anholt <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Lucas Stach <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Mark Yao <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Ben Skeggs <[email protected]>Cc Rob Clark <[email protected]>Cc CK Hu <[email protected]>Cc Xinliang Liu <[email protected]>Cc Philipp Zabel <[email protected]>Cc Stefan Agner <[email protected]>Cc Inki Dae <[email protected]>Cc Maxime Ripard <[email protected]>Cc Boris Brezillon <[email protected]>Cc Jani Nikula <[email protected]>Cc Daniel Vetter <[email protected]>Cc Thierry Reding <[email protected]>Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Brian Starkey <[email protected]>Cc Liviu Dudau <[email protected]>Cc Alexey Brodkin <[email protected]>Acked-by Dave Airlie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- Documentation/gpu/drm-uapi.rst | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)Documentation/gpu/drm-uapi.rst +51
-0@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements on what the userspace side for new +uAPI needs to look like. This section here explains what exactly those +requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed and ready for +merging into a suitable and canonical upstream project. + +GFX devices (both display and render/GPU side) are really complex bits of hardware, +with userspace and kernel by necessity having to work together really closely. +The interfaces, for rendering and modesetting must be extremely wide and +flexible, and therefore it is almost always impossible to precisely define them +for every possible corner case. This in turns makes it really practically +infeasible to differentiate between behaviour that's required by userspace, and +which must not be changed to avoid regressions, and behaviour which is only an +accidental artifact of the current implementation. + +Without access to the full source code of all userspace users that means it +becomes impossible to change the implementation details, since userspace could +depend upon the accidental behaviour of the current implementation in minute +details. And debugging such regressions without access to source code is pretty +much impossible. As a consequence this means: + +- The Linux kernel's "no regression" policy holds in practice only for + open-source userspace of the DRM subsystem. DRM developers are perfectly fine + if closed-source blob drivers in userspace use the same uAPI as the open + drivers, but they must do so in the exact same way as the open drivers. + Creative (ab)use of the interfaces will, and in the past routinely has, lead + to breakage. + +- Any new userspace interface must have an open-source implementation as + demonstration vehicle. + +The other reason for requiring open-source userspace is uAPI review. Since the +kernel and userspace parts of a GFX stack must work together so closely, code +review can only assess whether a new interface achieves its goals by looking at +both sides. Making sure that the interface indeed covers the use-case fully +leads to a few additional requirements: + +- The open-source userspace must not be a toy/test application, but the real + thing. Specifically it needs to handle all the usual error and corner cases. + These are often the places where new uAPI falls apart and hence essential to + assess the fitness of a proposed interface. + +- The userspace side must be fully reviewed and tested to the standards of that + userspace project. For e.g. mesa this means piglit testcases and review on the + mailing list. This is again to ensure that the new interface actually gets the + job done. + +- The userspace patches must be against the canonical upstream, not some vendor + fork. This is to make sure that no one cheats on the review and testing
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 99
Quoted 10 lines
Documentation/gpu/drm-uapi.rst +10
-0+ requirements by doing a quick fork. + +- The kernel patch can only be merged after all the above requirements are met, + but it **must** be merged **before** the userspace patches land. uAPI always flows + from the kernel, doing things the other way round risks divergence of the uAPI + definitions and header files. + +These are fairly steep requirements, but have grown out from years of shared +pain and experience with uAPI added hastily, and almost always regretted about +as fast.
last sentence is a bit awkward, maybe "regretted about just as fast"? There is probably a better way to word that, I'm not totally happy with my wording either.
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 104
Quoted 6 lines
GFX devices change really fast, requiring a paradigm shift and entire
Documentation/gpu/drm-uapi.rst +5
-0+new set of uAPI interfaces every few years at least. Together with the Linux +kernel's guarantee to keep existing userspace running for 10+ years this is +already rather painful for the DRM subsystem, with multiple different uAPIs for +the same thing co-existing. If we'd add a few more complete mistakes into the +mix every year it would be entirely unmanagable.
s/unmanagable/unmanageable/
anyway, other than minor nitpicks, the message is totally correct and to the point, so:
Quoted 7 lines
+
Render nodes
============--
2.8.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/1 drm/doc: Document uapi requirements in DRM
In reply to Daniel VetterEveryone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Last time this was a big discussion was about 6 years ago, when qcom tried to land a kernel driver without userspace. Dave Airlie made the rules really clear:
http://airlied.livejournal.com/73115.html
This write-up here is essentially what I've put into a presentation a while ago, which was also reviewed by Dave:
http://blog.ffwll.ch/2015/05/gfx-kernel-upstreaming-requirements.html
v2: Fix typos Eric&Rob spotted.
--- Documentation/gpu/drm-uapi.rst | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)
Documentation/gpu/drm-uapi.rst +67 -0
@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements on what the userspace side for new +uAPI needs to look like. This section here explains what exactly those +requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed and ready for +merging into a suitable and canonical upstream project. + +GFX devices (both display and render/GPU side) are really complex bits of +hardware, with userspace and kernel by necessity having to work together really +closely. The interfaces, for rendering and modesetting, must be extremely wide +and flexible, and therefore it is almost always impossible to precisely define +them for every possible corner case. This in turn makes it really practically +infeasible to differentiate between behaviour that's required by userspace, and +which must not be changed to avoid regressions, and behaviour which is only an +accidental artifact of the current implementation. + +Without access to the full source code of all userspace users that means it +becomes impossible to change the implementation details, since userspace could +depend upon the accidental behaviour of the current implementation in minute +details. And debugging such regressions without access to source code is pretty +much impossible. As a consequence this means: + +- The Linux kernel's "no regression" policy holds in practice only for + open-source userspace of the DRM subsystem. DRM developers are perfectly fine + if closed-source blob drivers in userspace use the same uAPI as the open + drivers, but they must do so in the exact same way as the open drivers. + Creative (ab)use of the interfaces will, and in the past routinely has, lead + to breakage. + +- Any new userspace interface must have an open-source implementation as + demonstration vehicle. + +The other reason for requiring open-source userspace is uAPI review. Since the +kernel and userspace parts of a GFX stack must work together so closely, code +review can only assess whether a new interface achieves its goals by looking at +both sides. Making sure that the interface indeed covers the use-case fully +leads to a few additional requirements: + +- The open-source userspace must not be a toy/test application, but the real + thing. Specifically it needs to handle all the usual error and corner cases. + These are often the places where new uAPI falls apart and hence essential to + assess the fitness of a proposed interface. + +- The userspace side must be fully reviewed and tested to the standards of that + userspace project. For e.g. mesa this means piglit testcases and review on the + mailing list. This is again to ensure that the new interface actually gets the + job done. + +- The userspace patches must be against the canonical upstream, not some vendor + fork. This is to make sure that no one cheats on the review and testing + requirements by doing a quick fork. + +- The kernel patch can only be merged after all the above requirements are met, + but it **must** be merged **before** the userspace patches land. uAPI always flows + from the kernel, doing things the other way round risks divergence of the uAPI + definitions and header files. + +These are fairly steep requirements, but have grown out from years of shared +pain and experience with uAPI added hastily, and almost always regretted about +just as fast. GFX devices change really fast, requiring a paradigm shift and +entire new set of uAPI interfaces every few years at least. Together with the +Linux kernel's guarantee to keep existing userspace running for 10+ years this +is already rather painful for the DRM subsystem, with multiple different uAPIs +for the same thing co-existing. If we add a few more complete mistakes into the +mix every year it would be entirely unmanageable. + Render nodes ============
Signature · 6 lines
2.8.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 61 lines · Daniel Vetter
Everyone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Last time this was a big discussion was about 6 years ago, when qcom tried to land a kernel driver without userspace. Dave Airlie made the rules really clear:
http://airlied.livejournal.com/73115.html
This write-up here is essentially what I've put into a presentation a while ago, which was also reviewed by Dave:
http://blog.ffwll.ch/2015/05/gfx-kernel-upstreaming-requirements.html
v2: Fix typos Eric&Rob spotted.
Cc Dave Airlie <[email protected]>Cc Oded Gabbay <[email protected]>Cc Russell King <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Eric Anholt <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Lucas Stach <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Mark Yao <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Ben Skeggs <[email protected]>Cc Rob Clark <[email protected]>Cc CK Hu <[email protected]>Cc Xinliang Liu <[email protected]>Cc Philipp Zabel <[email protected]>Cc Stefan Agner <[email protected]>Cc Inki Dae <[email protected]>Cc Maxime Ripard <[email protected]>Cc Boris Brezillon <[email protected]>Cc Jani Nikula <[email protected]>Cc Daniel Vetter <[email protected]>Cc Thierry Reding <[email protected]>Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Brian Starkey <[email protected]>Cc Liviu Dudau <[email protected]>Cc Alexey Brodkin <[email protected]>Acked-by Dave Airlie <[email protected]>Reviewed-by Rob Clark <[email protected]>Reviewed-by Christian König <[email protected]>Reviewed-by Eric Anholt <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- Documentation/gpu/drm-uapi.rst | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)Documentation/gpu/drm-uapi.rst +0
-0
Documentation/gpu/drm-uapi.rst Primary Nodes, DRM Master and Authentication · line 41
Quoted 6 lines
Documentation/gpu/drm-uapi.rst +3
-0@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements on what the userspace side for new +uAPI needs to look like. This section here explains what exactly those +requirements are, and why they exist.
Nitpick, stricter requirements than what? I know what you mean, but the comparative begs for the thing to compare against.
Otherwise,
Quoted 66 lines
Documentation/gpu/drm-uapi.rst +64
-0+ +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed and ready for +merging into a suitable and canonical upstream project. + +GFX devices (both display and render/GPU side) are really complex bits of +hardware, with userspace and kernel by necessity having to work together really +closely. The interfaces, for rendering and modesetting, must be extremely wide +and flexible, and therefore it is almost always impossible to precisely define +them for every possible corner case. This in turn makes it really practically +infeasible to differentiate between behaviour that's required by userspace, and +which must not be changed to avoid regressions, and behaviour which is only an +accidental artifact of the current implementation. + +Without access to the full source code of all userspace users that means it +becomes impossible to change the implementation details, since userspace could +depend upon the accidental behaviour of the current implementation in minute +details. And debugging such regressions without access to source code is pretty +much impossible. As a consequence this means: + +- The Linux kernel's "no regression" policy holds in practice only for + open-source userspace of the DRM subsystem. DRM developers are perfectly fine + if closed-source blob drivers in userspace use the same uAPI as the open + drivers, but they must do so in the exact same way as the open drivers. + Creative (ab)use of the interfaces will, and in the past routinely has, lead + to breakage. + +- Any new userspace interface must have an open-source implementation as + demonstration vehicle. + +The other reason for requiring open-source userspace is uAPI review. Since the +kernel and userspace parts of a GFX stack must work together so closely, code +review can only assess whether a new interface achieves its goals by looking at +both sides. Making sure that the interface indeed covers the use-case fully +leads to a few additional requirements: + +- The open-source userspace must not be a toy/test application, but the real + thing. Specifically it needs to handle all the usual error and corner cases. + These are often the places where new uAPI falls apart and hence essential to + assess the fitness of a proposed interface. + +- The userspace side must be fully reviewed and tested to the standards of that + userspace project. For e.g. mesa this means piglit testcases and review on the + mailing list. This is again to ensure that the new interface actually gets the + job done. + +- The userspace patches must be against the canonical upstream, not some vendor + fork. This is to make sure that no one cheats on the review and testing + requirements by doing a quick fork. + +- The kernel patch can only be merged after all the above requirements are met, + but it **must** be merged **before** the userspace patches land. uAPI always flows + from the kernel, doing things the other way round risks divergence of the uAPI + definitions and header files. + +These are fairly steep requirements, but have grown out from years of shared +pain and experience with uAPI added hastily, and almost always regretted about +just as fast. GFX devices change really fast, requiring a paradigm shift and +entire new set of uAPI interfaces every few years at least. Together with the +Linux kernel's guarantee to keep existing userspace running for 10+ years this +is already rather painful for the DRM subsystem, with multiple different uAPIs +for the same thing co-existing. If we add a few more complete mistakes into the +mix every year it would be entirely unmanageable. + Render nodes ============
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/1 drm/doc: Document uapi requirements in DRM
In reply to Daniel VetterEveryone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Last time this was a big discussion was about 6 years ago, when qcom tried to land a kernel driver without userspace. Dave Airlie made the rules really clear:
http://airlied.livejournal.com/73115.html
This write-up here is essentially what I've put into a presentation a while ago, which was also reviewed by Dave:
http://blog.ffwll.ch/2015/05/gfx-kernel-upstreaming-requirements.html
v2: Fix typos Eric&Rob spotted.
v3: Nitpick from Jani.
--- Documentation/gpu/drm-uapi.rst | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)
Documentation/gpu/drm-uapi.rst +67 -0
@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements than most other kernel subsystems on +what the userspace side for new uAPI needs to look like. This section here +explains what exactly those requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed and ready for +merging into a suitable and canonical upstream project. + +GFX devices (both display and render/GPU side) are really complex bits of +hardware, with userspace and kernel by necessity having to work together really +closely. The interfaces, for rendering and modesetting, must be extremely wide +and flexible, and therefore it is almost always impossible to precisely define +them for every possible corner case. This in turn makes it really practically +infeasible to differentiate between behaviour that's required by userspace, and +which must not be changed to avoid regressions, and behaviour which is only an +accidental artifact of the current implementation. + +Without access to the full source code of all userspace users that means it +becomes impossible to change the implementation details, since userspace could +depend upon the accidental behaviour of the current implementation in minute +details. And debugging such regressions without access to source code is pretty +much impossible. As a consequence this means: + +- The Linux kernel's "no regression" policy holds in practice only for + open-source userspace of the DRM subsystem. DRM developers are perfectly fine + if closed-source blob drivers in userspace use the same uAPI as the open + drivers, but they must do so in the exact same way as the open drivers. + Creative (ab)use of the interfaces will, and in the past routinely has, lead + to breakage. + +- Any new userspace interface must have an open-source implementation as + demonstration vehicle. + +The other reason for requiring open-source userspace is uAPI review. Since the +kernel and userspace parts of a GFX stack must work together so closely, code +review can only assess whether a new interface achieves its goals by looking at +both sides. Making sure that the interface indeed covers the use-case fully +leads to a few additional requirements: + +- The open-source userspace must not be a toy/test application, but the real + thing. Specifically it needs to handle all the usual error and corner cases. + These are often the places where new uAPI falls apart and hence essential to + assess the fitness of a proposed interface. + +- The userspace side must be fully reviewed and tested to the standards of that + userspace project. For e.g. mesa this means piglit testcases and review on the + mailing list. This is again to ensure that the new interface actually gets the + job done. + +- The userspace patches must be against the canonical upstream, not some vendor + fork. This is to make sure that no one cheats on the review and testing + requirements by doing a quick fork. + +- The kernel patch can only be merged after all the above requirements are met, + but it **must** be merged **before** the userspace patches land. uAPI always flows + from the kernel, doing things the other way round risks divergence of the uAPI + definitions and header files. + +These are fairly steep requirements, but have grown out from years of shared +pain and experience with uAPI added hastily, and almost always regretted about +just as fast. GFX devices change really fast, requiring a paradigm shift and +entire new set of uAPI interfaces every few years at least. Together with the +Linux kernel's guarantee to keep existing userspace running for 10+ years this +is already rather painful for the DRM subsystem, with multiple different uAPIs +for the same thing co-existing. If we add a few more complete mistakes into the +mix every year it would be entirely unmanageable. + Render nodes ============
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Daniel Vetter
Everyone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Thanks for re-iterating this. Although some of us from ARM are new to the KMS world, there have been previous engagements with the community from others in the company.
Quoted 4 lines
Last time this was a big discussion was about 6 years ago, when qcom tried to land a kernel driver without userspace. Dave Airlie made the rules really clear:
I'm guessing the topic was mainly about GPUs at that time. ARM's current upstreaming efforts are limited to display engines and supporting the open-source userspace with the mainline driver.
Quoted 32 lines
http://airlied.livejournal.com/73115.html
This write-up here is essentially what I've put into a presentation a while ago, which was also reviewed by Dave:
http://blog.ffwll.ch/2015/05/gfx-kernel-upstreaming-requirements.html
v2: Fix typos Eric&Rob spotted.
v3: Nitpick from Jani.
Cc Dave Airlie <[email protected]>Cc Oded Gabbay <[email protected]>Cc Russell King <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Eric Anholt <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Lucas Stach <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Mark Yao <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Ben Skeggs <[email protected]>Cc Rob Clark <[email protected]>Cc CK Hu <[email protected]>Cc Xinliang Liu <[email protected]>Cc Philipp Zabel <[email protected]>Cc Stefan Agner <[email protected]>Cc Inki Dae <[email protected]>Cc Maxime Ripard <[email protected]>Cc Boris Brezillon <[email protected]>
Quoted 8 lines
Cc Jani Nikula <[email protected]>Cc Daniel Vetter <[email protected]>Cc Thierry Reding <[email protected]>Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Brian Starkey <[email protected]>Cc Liviu Dudau <[email protected]>
Best regards,
Liviu
Quoted 92 lines
Cc Alexey Brodkin <[email protected]>Acked-by Dave Airlie <[email protected]>Reviewed-by Rob Clark <[email protected]>Reviewed-by Christian König <[email protected]>Reviewed-by Eric Anholt <[email protected]>Reviewed-by Jani Nikula <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- Documentation/gpu/drm-uapi.rst | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)Documentation/gpu/drm-uapi.rst +67
-0@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements than most other kernel subsystems on +what the userspace side for new uAPI needs to look like. This section here +explains what exactly those requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed and ready for +merging into a suitable and canonical upstream project. + +GFX devices (both display and render/GPU side) are really complex bits of +hardware, with userspace and kernel by necessity having to work together really +closely. The interfaces, for rendering and modesetting, must be extremely wide +and flexible, and therefore it is almost always impossible to precisely define +them for every possible corner case. This in turn makes it really practically +infeasible to differentiate between behaviour that's required by userspace, and +which must not be changed to avoid regressions, and behaviour which is only an +accidental artifact of the current implementation. + +Without access to the full source code of all userspace users that means it +becomes impossible to change the implementation details, since userspace could +depend upon the accidental behaviour of the current implementation in minute +details. And debugging such regressions without access to source code is pretty +much impossible. As a consequence this means: + +- The Linux kernel's "no regression" policy holds in practice only for + open-source userspace of the DRM subsystem. DRM developers are perfectly fine + if closed-source blob drivers in userspace use the same uAPI as the open + drivers, but they must do so in the exact same way as the open drivers. + Creative (ab)use of the interfaces will, and in the past routinely has, lead + to breakage. + +- Any new userspace interface must have an open-source implementation as + demonstration vehicle. + +The other reason for requiring open-source userspace is uAPI review. Since the +kernel and userspace parts of a GFX stack must work together so closely, code +review can only assess whether a new interface achieves its goals by looking at +both sides. Making sure that the interface indeed covers the use-case fully +leads to a few additional requirements: + +- The open-source userspace must not be a toy/test application, but the real + thing. Specifically it needs to handle all the usual error and corner cases. + These are often the places where new uAPI falls apart and hence essential to + assess the fitness of a proposed interface. + +- The userspace side must be fully reviewed and tested to the standards of that + userspace project. For e.g. mesa this means piglit testcases and review on the + mailing list. This is again to ensure that the new interface actually gets the + job done. + +- The userspace patches must be against the canonical upstream, not some vendor + fork. This is to make sure that no one cheats on the review and testing + requirements by doing a quick fork. + +- The kernel patch can only be merged after all the above requirements are met, + but it **must** be merged **before** the userspace patches land. uAPI always flows + from the kernel, doing things the other way round risks divergence of the uAPI + definitions and header files. + +These are fairly steep requirements, but have grown out from years of shared +pain and experience with uAPI added hastily, and almost always regretted about +just as fast. GFX devices change really fast, requiring a paradigm shift and +entire new set of uAPI interfaces every few years at least. Together with the +Linux kernel's guarantee to keep existing userspace running for 10+ years this +is already rather painful for the DRM subsystem, with multiple different uAPIs +for the same thing co-existing. If we add a few more complete mistakes into the +mix every year it would be entirely unmanageable. + Render nodes ============Signature · 1 line
2.9.3
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develQuoted 132 lines · Daniel Vetter
Everyone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Last time this was a big discussion was about 6 years ago, when qcom tried to land a kernel driver without userspace. Dave Airlie made the rules really clear:
This write-up here is essentially what I've put into a presentation a while ago, which was also reviewed by Dave:
Cc Dave Airlie <[email protected]>Cc Oded Gabbay <[email protected]>Cc Russell King <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Eric Anholt <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Lucas Stach <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Mark Yao <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Ben Skeggs <[email protected]>Cc Rob Clark <[email protected]>Cc CK Hu <[email protected]>Cc Xinliang Liu <[email protected]>Cc Philipp Zabel <[email protected]>Cc Stefan Agner <[email protected]>Cc Inki Dae <[email protected]>Cc Maxime Ripard <[email protected]>Cc Boris Brezillon <[email protected]>Cc Jani Nikula <[email protected]>Cc Daniel Vetter <[email protected]>Cc Thierry Reding <[email protected]>Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Brian Starkey <[email protected]>Cc Liviu Dudau <[email protected]>Cc Alexey Brodkin <[email protected]>Acked-by Dave Airlie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- Documentation/gpu/drm-uapi.rst | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)Documentation/gpu/drm-uapi.rst +67
-0@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements on what the userspace side for new +uAPI needs to look like. This section here explains what exactly those +requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed and ready for +merging into a suitable and canonical upstream project. + +GFX devices (both display and render/GPU side) are really complex bits of hardware, +with userspace and kernel by necessity having to work together really closely. +The interfaces, for rendering and modesetting must be extremely wide and +flexible, and therefore it is almost always impossible to precisely define them +for every possible corner case. This in turns makes it really practically +infeasible to differentiate between behaviour that's required by userspace, and +which must not be changed to avoid regressions, and behaviour which is only an +accidental artifact of the current implementation. + +Without access to the full source code of all userspace users that means it +becomes impossible to change the implementation details, since userspace could +depend upon the accidental behaviour of the current implementation in minute +details. And debugging such regressions without access to source code is pretty +much impossible. As a consequence this means: + +- The Linux kernel's "no regression" policy holds in practice only for + open-source userspace of the DRM subsystem. DRM developers are perfectly fine + if closed-source blob drivers in userspace use the same uAPI as the open + drivers, but they must do so in the exact same way as the open drivers. + Creative (ab)use of the interfaces will, and in the past routinely has, lead + to breakage. + +- Any new userspace interface must have an open-source implementation as + demonstration vehicle. + +The other reason for requiring open-source userspace is uAPI review. Since the +kernel and userspace parts of a GFX stack must work together so closely, code +review can only assess whether a new interface achieves its goals by looking at +both sides. Making sure that the interface indeed covers the use-case fully +leads to a few additional requirements: + +- The open-source userspace must not be a toy/test application, but the real + thing. Specifically it needs to handle all the usual error and corner cases. + These are often the places where new uAPI falls apart and hence essential to + assess the fitness of a proposed interface. + +- The userspace side must be fully reviewed and tested to the standards of that + userspace project. For e.g. mesa this means piglit testcases and review on the + mailing list. This is again to ensure that the new interface actually gets the + job done. + +- The userspace patches must be against the canonical upstream, not some vendor + fork. This is to make sure that no one cheats on the review and testing + requirements by doing a quick fork. + +- The kernel patch can only be merged after all the above requirements are met, + but it **must** be merged **before** the userspace patches land. uAPI always flows + from the kernel, doing things the other way round risks divergence of the uAPI + definitions and header files. + +These are fairly steep requirements, but have grown out from years of shared +pain and experience with uAPI added hastily, and almost always regretted about +as fast. GFX devices change really fast, requiring a paradigm shift and entire +new set of uAPI interfaces every few years at least. Together with the Linux +kernel's guarantee to keep existing userspace running for 10+ years this is +already rather painful for the DRM subsystem, with multiple different uAPIs for +the same thing co-existing. If we'd add a few more complete mistakes into the +mix every year it would be entirely unmanagable. + Render nodes ============Signature · 1 line
2.8.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Daniel,
Thank you for the patch.
Quoted 68 lines · On Friday 19 Aug 2016 22:50:38 Daniel Vetter wrote:
Everyone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Last time this was a big discussion was about 6 years ago, when qcom tried to land a kernel driver without userspace. Dave Airlie made the rules really clear:
http://airlied.livejournal.com/73115.html
This write-up here is essentially what I've put into a presentation a while ago, which was also reviewed by Dave:
http://blog.ffwll.ch/2015/05/gfx-kernel-upstreaming-requirements.html
Cc Dave Airlie <[email protected]>Cc Oded Gabbay <[email protected]>Cc Russell King <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Eric Anholt <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Lucas Stach <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Mark Yao <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Ben Skeggs <[email protected]>Cc Rob Clark <[email protected]>Cc CK Hu <[email protected]>Cc Xinliang Liu <[email protected]>Cc Philipp Zabel <[email protected]>Cc Stefan Agner <[email protected]>Cc Inki Dae <[email protected]>Cc Maxime Ripard <[email protected]>Cc Boris Brezillon <[email protected]>Cc Jani Nikula <[email protected]>Cc Daniel Vetter <[email protected]>Cc Thierry Reding <[email protected]>Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Brian Starkey <[email protected]>Cc Liviu Dudau <[email protected]>Cc Alexey Brodkin <[email protected]>Acked-by Dave Airlie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- Documentation/gpu/drm-uapi.rst | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)Documentation/gpu/drm-uapi.rst +1
-0@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements on what the userspace side fornew +uAPI needs to look like. This section here explains what exactly those
Documentation/gpu/drm-uapi.rst +4
-0+requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed andready for +merging into a suitable and canonical upstream project.
Documentation/gpu/drm-uapi.rst +2
-0+ +GFX devices (both display and render/GPU side) are really complex bits of
Quoted 8 lines
hardware, +with userspace and kernel by necessity having to work together really closely. +The interfaces, for rendering and modesetting must be extremely wide and +flexible, and therefore it is almost always impossible to precisely define them +for every possible corner case. This in turns makes it really practically +infeasible to differentiate between behaviour that's required by userspace, and +which must not be changed to avoid regressions, and behaviour which is only an +accidental artifact of the current implementation.
While I agree that this is a proper description of the current state of the DRM/KMS subsystem, I don't like how it implies that shipping code is an acceptable replacement for documentation. We need to aim at documenting the DRM/KMS userspace API to a level of detail that will cover the vast majority of cases (be they corner or round), if not all of them.
Quoted 10 lines
Documentation/gpu/drm-uapi.rst +2
-0+Without access to the full source code of all userspace users that means it +becomes impossible to change the implementation details, since userspacecould +depend upon the accidental behaviour of the current implementation in minute +details. And debugging such regressions without access to source code is pretty +much impossible. As a consequence this means:
Documentation/gpu/drm-uapi.rst +3
-0+ +- The Linux kernel's "no regression" policy holds in practice only for + open-source userspace of the DRM subsystem. DRM developers are perfectlyfine + if closed-source blob drivers in userspace use the same uAPI as the open + drivers,
In which category do you put the open-source userspace code that is not part of the mainline version of a major userspace framework (X11, Weston, Android hwcomposer, ...) ? I'm thinking about open-source vendor forks of those projects, or home-brew implementation of a tailor-made display stack for a product (I'm intentionally using the word display instead of GFX here, if a full tailor-made GFX stack including 3D rendering is quite unlikely, a display stack or even just an application driving the display through the DRM/KMS API is much easier to write from scratch).
Quoted 3 lines
but they must do so in the exact same way as the open drivers.
+ Creative (ab)use of the interfaces will, and in the past routinely has, lead + to breakage.
This in my opinion calls for documentation, otherwise how can userspace developers tell what is an abuse without copying open-source code verbatim ?
Quoted 40 lines
+- Any new userspace interface must have an open-source implementation as
Documentation/gpu/drm-uapi.rst +3
-0+ demonstration vehicle. + +The other reason for requiring open-source userspace is uAPI review. Sincethe +kernel and userspace parts of a GFX stack must work together so closely, code +review can only assess whether a new interface achieves its goals by looking at +both sides. Making sure that the interface indeed covers the use-case fully +leads to a few additional requirements:
++- The open-source userspace must not be a toy/test application, but the real + thing. Specifically it needs to handle all the usual error and corner cases. + These are often the places where new uAPI falls apart and hence essential to + assess the fitness of a proposed interface. + +- The userspace side must be fully reviewed and tested to the standards of that + userspace project. For e.g. mesa this means piglit testcases and review on the + mailing list. This is again to ensure that the new interface actually gets the + job done. + +- The userspace patches must be against the canonical upstream, not some vendor + fork. This is to make sure that no one cheats on the review and testing + requirements by doing a quick fork. + +- The kernel patch can only be merged after all the above requirements are met, + but it **must** be merged **before** the userspace patches land. uAPI always flows + from the kernel, doing things the other way round risks divergence of the uAPI + definitions and header files.Documentation/gpu/drm-uapi.rst +2
-0+ +These are fairly steep requirements, but have grown out from years ofshared +pain and experience with uAPI added hastily, and almost always regretted about +as fast. GFX devices change really fast, requiring a paradigm shift and entire +new set of uAPI interfaces every few years at least. Together with the Linux +kernel's guarantee to keep existing userspace running for 10+ years this is +already rather painful for the DRM subsystem, with multiple different uAPIs for +the same thing co-existing. If we'd add a few more complete mistakes into the +mix every year it would be entirely unmanagable.
+
Render nodes
============
Signature · 7 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 79 lines · Laurent Pinchart
Hi Daniel,
Thank you for the patch.
Quoted 74 lines · On Friday 19 Aug 2016 22:50:38 Daniel Vetter wrote:
Everyone knows them, except all the new folks joining from the ARM side haven't lived through all the pain of the past years and are entirely surprised when I raise this. Definitely time to document this.
Last time this was a big discussion was about 6 years ago, when qcom tried to land a kernel driver without userspace. Dave Airlie made the rules really clear:
http://airlied.livejournal.com/73115.html
This write-up here is essentially what I've put into a presentation a while ago, which was also reviewed by Dave:
http://blog.ffwll.ch/2015/05/gfx-kernel-upstreaming-requirements.html
Cc Dave Airlie <[email protected]>Cc Oded Gabbay <[email protected]>Cc Russell King <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc Eric Anholt <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Lucas Stach <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Mark Yao <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Ben Skeggs <[email protected]>Cc Rob Clark <[email protected]>Cc CK Hu <[email protected]>Cc Xinliang Liu <[email protected]>Cc Philipp Zabel <[email protected]>Cc Stefan Agner <[email protected]>Cc Inki Dae <[email protected]>Cc Maxime Ripard <[email protected]>Cc Boris Brezillon <[email protected]>Cc Jani Nikula <[email protected]>Cc Daniel Vetter <[email protected]>Cc Thierry Reding <[email protected]>Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Brian Starkey <[email protected]>Cc Liviu Dudau <[email protected]>Cc Alexey Brodkin <[email protected]>Acked-by Dave Airlie <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- Documentation/gpu/drm-uapi.rst | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)Documentation/gpu/drm-uapi.rst +1
-0@@ -36,6 +36,73 @@ Primary Nodes, DRM Master and Authentication Open-Source Userspace Requirements ================================== +The DRM subsystem has stricter requirements on what the userspace side fornew +uAPI needs to look like. This section here explains what exactly those
Documentation/gpu/drm-uapi.rst +4
-0+requirements are, and why they exist. + +The short summary is that any addition of DRM uAPI requires corresponding +open-sourced userspace patches, and those patches must be reviewed andready for +merging into a suitable and canonical upstream project.
Documentation/gpu/drm-uapi.rst +2
-0+ +GFX devices (both display and render/GPU side) are really complex bits ofhardware, +with userspace and kernel by necessity having to work together really closely. +The interfaces, for rendering and modesetting must be extremely wide and +flexible, and therefore it is almost always impossible to precisely define them +for every possible corner case. This in turns makes it really practically +infeasible to differentiate between behaviour that's required by userspace, and +which must not be changed to avoid
Quoted 8 lines
Quoted 2 lines
regressions, and behaviour which is only an +accidental artifact of the current implementation.
While I agree that this is a proper description of the current state of the DRM/KMS subsystem, I don't like how it implies that shipping code is an acceptable replacement for documentation. We need to aim at documenting the DRM/KMS userspace API to a level of detail that will cover the vast majority of cases (be they corner or round), if not all of them.
I agree that this is a good idea, the trouble is in convincing everyone else, and more important, that this is important enough that they should spent time typing these docs. I think the only way to do that is to 1) type those docs for existing ioctls yourself, and then start and RFC to make it a standard. For properties I'm already starting with at least some not-too-formal docs within the existing kernel-doc stuff. Not there yet either. I somewhat plan to get around to ioctl in the next few years, but would be real awesome if someone beats me to it ;-)
Quoted 11 lines
Quoted 10 lines
Documentation/gpu/drm-uapi.rst +2
-0+Without access to the full source code of all userspace users that means it +becomes impossible to change the implementation details, since userspacecould +depend upon the accidental behaviour of the current implementation in minute +details. And debugging such regressions without access to source code is pretty +much impossible. As a consequence this means:
Documentation/gpu/drm-uapi.rst +3
-0+ +- The Linux kernel's "no regression" policy holds in practice only for + open-source userspace of the DRM subsystem. DRM developers are perfectlyfine + if closed-source blob drivers in userspace use the same uAPI as the open + drivers,
Quoted 8 lines
In which category do you put the open-source userspace code that is not part of the mainline version of a major userspace framework (X11, Weston, Android hwcomposer, ...) ? I'm thinking about open-source vendor forks of those projects, or home-brew implementation of a tailor-made display stack for a product (I'm intentionally using the word display instead of GFX here, if a full tailor-made GFX stack including 3D rendering is quite unlikely, a display stack or even just an application driving the display through the DRM/KMS API is much easier to write from scratch).
I think if it's just a vendor fork of an existing open-source project, then that existing open-source project should be the target. The idea behind requiring review&ready for acceptance by the userspace side is to make sure it'll be useful for more than just 1 vendor, just applying it to a vendor fork somewhat defeats that idea. Best option would be to either reintegrate the vendor for, or if that's not possible, have some shared library or other means of sharing code. Afaiui that's the entire point of libweston, so assuming your vendor fork is tracking upstream libweston (it really should) this shouldn't be a problem. If there's no direct code sharing, but at least common history, porting the patches to upstream as demonstration vehicle also shouldn't be that bad a burden.
An entirely different case is 2 independent codebases that solve the exact same problem. We have no precedence for that, but I expect we'll have that real soon with the community radv vulkan driver vs. the one from amd (that should be released as open source any minute now). Personally I'm leaning towards "why don't you just collaborate" and trying to look cute&cuddly, but no sure where that one will fall tbh. We will see soon.
Quoted 6 lines
Quoted 3 lines
but they must do so in the exact same way as the open drivers.
+ Creative (ab)use of the interfaces will, and in the past routinely has, lead + to breakage.This in my opinion calls for documentation, otherwise how can userspace developers tell what is an abuse without copying open-source code verbatim ?
If there's a regression, and code disagrees with the documentation, the code wins. I agree that good docs would help, but the reality is that very often you get to review 10+ years of git history in a bunch of projects. I & others have done this plenty of times, and we generally get things mostly right. But again not having tons of forks and different implementations helps a lot with this, so "pls collaborate" is a good idea (for the community overall, and that's the point here) too. We have a bunch of forks and independent reimplemenations (e.g. the gallium intel driver), but most often those forks tend to lack in features so much that they're not hitting any of the uapi corner cases that might break. I'll be interesting when this happens for the first time for real, but personally I really hope this doesn't happen, and that everyone understands the long-term benefits of collaborating.
Cheers, Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel