Blame include/drm/README

Packit 631bab
What are these headers ?
Packit 631bab
------------------------
Packit 631bab
This is the canonical source of drm headers that user space should use for
Packit 631bab
communicating with the kernel DRM subsystem.
Packit 631bab
Packit 631bab
They flow from the kernel, thus any changes must be merged there first.
Packit 631bab
Do _not_ attempt to "fix" these by deviating from the kernel ones !
Packit 631bab
Packit 631bab
Packit 631bab
Non-linux platforms - changes/patches
Packit 631bab
-------------------------------------
Packit 631bab
If your platform has local changes, please send them upstream for inclusion.
Packit 631bab
Even if your patches don't get accepted in their current form, devs will
Packit 631bab
give you feedback on how to address things properly.
Packit 631bab
Packit 631bab
git send-email --subject-prefix="PATCH libdrm" your patches to dri-devel
Packit 631bab
mailing list.
Packit 631bab
Packit 631bab
Before doing so, please consider the following:
Packit 631bab
 - Have the [libdrm vs kernel] headers on your platform deviated ?
Packit 631bab
Consider unifying them first.
Packit 631bab
Packit 631bab
 - Have you introduced additional ABI that's not available in Linux ?
Packit 631bab
Propose it for [Linux kernel] upstream inclusion.
Packit 631bab
If that doesn't work out (hopefully it never does), move it to another header
Packit 631bab
and/or keep the change(s) local ?
Packit 631bab
Packit 631bab
 - Are your changes DRI1/UMS specific ?
Packit 631bab
There is virtually no interest/power in keeping those legacy interfaces. They
Packit 631bab
are around due to the kernel "thou shalt not break existing user space" rule.
Packit 631bab
Packit 631bab
Consider porting the driver to DRI2/KMS - all (almost?) sensible hardware is
Packit 631bab
capable of supporting those.
Packit 631bab
Packit 631bab
Packit 631bab
Which headers go where ?
Packit 631bab
------------------------
Packit 631bab
A snipped from the, now removed, Makefile.am used to state:
Packit 631bab
Packit 631bab
  XXX airlied says, nothing besides *_drm.h and drm*.h should be necessary.
Packit 631bab
  however, r300 and via need their reg headers installed in order to build.
Packit 631bab
  better solutions are welcome.
Packit 631bab
Packit 631bab
Obviously the r300 and via headers are no longer around ;-)
Packit 631bab
Packit 631bab
Reason behind is that the drm headers can be used as a basic communications
Packit 631bab
channel with the respective kernel modules. If more advanced functionality is
Packit 631bab
required one can pull the specific libdrm_$driver which is free to pull
Packit 631bab
additional files from the kernel.
Packit 631bab
Packit 631bab
For example: nouveau has nouveau/nvif/*.h while vc4 has vc4/*.h
Packit 631bab
Packit 631bab
If your driver is still in prototyping/staging state, consider moving the
Packit 631bab
$driver_drm.h into $driver and _not_ installing it. An header providing opaque
Packit 631bab
definitions and access [via $driver_drmif.h or similar] would be better fit.
Packit 631bab
Packit 631bab
Packit 631bab
When and which headers to update
Packit 631bab
--------------------------------
Packit 631bab
Ideally all files will be synced (updated) with the latest released kernel on
Packit 631bab
each libdrm release. Sadly that's not yet possible since quite a few headers
Packit 631bab
differ significantly - see Outdated or Broken Headers section below.
Packit 631bab
Packit 631bab
That said, it's up-to the individual developers to sync with newer version
Packit 631bab
(from drm-next) as they see fit.
Packit 631bab
Packit 631bab
Packit 631bab
When and how to update these files
Packit 631bab
----------------------------------
Packit 631bab
Note: One should not do _any_ changes to the files apart from the steps below.
Packit 631bab
Packit 631bab
In order to update the files do the following:
Packit 631bab
 - Switch to a Linux kernel tree/branch which is not rebased.
Packit 631bab
   For example: drm-next (https://cgit.freedesktop.org/drm/drm)
Packit 631bab
 - Install the headers via `make headers_install' to a separate location.
Packit 631bab
 - Copy the drm header[s] + git add + git commit.
Packit 631bab
 - Note: Your commit message must include:
Packit 631bab
   a) Brief summary on the delta. If there's any change that looks like an
Packit 631bab
API/ABI break one _must_ explicitly state why it's safe to do so.
Packit 631bab
   b) "Generated using make headers_install."
Packit 631bab
   c) "Generated from $tree/branch commit $sha"
Packit 631bab
Packit 631bab
Packit 631bab
Outdated or Broken Headers
Packit 631bab
--------------------------
Packit 631bab
This section contains a list of headers and the respective "issues" they might
Packit 631bab
have relative to their kernel equivalent.
Packit 631bab
Packit 631bab
Most UMS headers:
Packit 631bab
 - Not using fixed size integers - compat ioctls are broken.
Packit 631bab
Status: ?
Packit 631bab
Promote to fixed size ints, which match the current (32bit) ones.
Packit 631bab
Packit 631bab
nouveau_drm.h
Packit 631bab
 - Missing macros NOUVEAU_GETPARAM*, NOUVEAU_DRM_HEADER_PATCHLEVEL, structs,
Packit 631bab
enums
Packit 631bab
Status: Deliberate UABI choice; nouveau hides the exact kernel ABI behind libdrm
Packit 631bab
Packit 631bab
r128_drm.h
Packit 631bab
 - Broken compat ioctls.
Packit 631bab
Packit 631bab
radeon_drm.h
Packit 631bab
 - Missing RADEON_TILING_R600_NO_SCANOUT, CIK_TILE_MODE_*, broken UMS ioctls
Packit 631bab
 - Both kernel and libdrm: missing padding -
Packit 631bab
drm_radeon_gem_{create,{g,s}et_tiling,set_domain} others ?
Packit 631bab
Status: ?
Packit 631bab
Packit 631bab
savage_drm.h
Packit 631bab
 - Renamed ioctls - DRM_IOCTL_SAVAGE_{,BCI}_EVENT_EMIT, compat ioctls are broken.
Packit 631bab
Status: ?
Packit 631bab
Packit 631bab
sis_drm.h
Packit 631bab
 - Borken ioctls + libdrm uses int vs kernel long
Packit 631bab
Status: ?
Packit 631bab
Packit 631bab
via_drm.h
Packit 631bab
 - Borken ioctls - libdrm int vs kernel long
Packit 631bab
Status: ?
Packit 631bab
Packit 631bab
Packit 631bab
omap_drm.h (living in $TOP/omap)
Packit 631bab
 - License mismatch, missing DRM_IOCTL_OMAP_GEM_NEW and related struct
Packit 631bab
Status: ?
Packit 631bab
Packit 631bab
exynos_drm.h (living in $TOP/exynos)
Packit 631bab
 - License mismatch, now using fixed size ints (but not everywhere). Lots of
Packit 631bab
new stuff.
Packit 631bab
Status: ?