1d722e3fbSopenharmony_ciWhat are these headers ? 2d722e3fbSopenharmony_ci------------------------ 3d722e3fbSopenharmony_ciThis is the canonical source of drm headers that user space should use for 4d722e3fbSopenharmony_cicommunicating with the kernel DRM subsystem. 5d722e3fbSopenharmony_ci 6d722e3fbSopenharmony_ciThey flow from the kernel, thus any changes must be merged there first. 7d722e3fbSopenharmony_ciDo _not_ attempt to "fix" these by deviating from the kernel ones ! 8d722e3fbSopenharmony_ci 9d722e3fbSopenharmony_ci 10d722e3fbSopenharmony_ciNon-linux platforms - changes/patches 11d722e3fbSopenharmony_ci------------------------------------- 12d722e3fbSopenharmony_ciIf your platform has local changes, please send them upstream for inclusion. 13d722e3fbSopenharmony_ciEven if your patches don't get accepted in their current form, devs will 14d722e3fbSopenharmony_cigive you feedback on how to address things properly. 15d722e3fbSopenharmony_ci 16d722e3fbSopenharmony_cigit send-email --subject-prefix="PATCH libdrm" your patches to dri-devel 17d722e3fbSopenharmony_cimailing list. 18d722e3fbSopenharmony_ci 19d722e3fbSopenharmony_ciBefore doing so, please consider the following: 20d722e3fbSopenharmony_ci - Have the [libdrm vs kernel] headers on your platform deviated ? 21d722e3fbSopenharmony_ciConsider unifying them first. 22d722e3fbSopenharmony_ci 23d722e3fbSopenharmony_ci - Have you introduced additional ABI that's not available in Linux ? 24d722e3fbSopenharmony_ciPropose it for [Linux kernel] upstream inclusion. 25d722e3fbSopenharmony_ciIf that doesn't work out (hopefully it never does), move it to another header 26d722e3fbSopenharmony_ciand/or keep the change(s) local ? 27d722e3fbSopenharmony_ci 28d722e3fbSopenharmony_ci - Are your changes DRI1/UMS specific ? 29d722e3fbSopenharmony_ciThere is virtually no interest/power in keeping those legacy interfaces. They 30d722e3fbSopenharmony_ciare around due to the kernel "thou shalt not break existing user space" rule. 31d722e3fbSopenharmony_ci 32d722e3fbSopenharmony_ciConsider porting the driver to DRI2/KMS - all (almost?) sensible hardware is 33d722e3fbSopenharmony_cicapable of supporting those. 34d722e3fbSopenharmony_ci 35d722e3fbSopenharmony_ci 36d722e3fbSopenharmony_ciWhich headers go where ? 37d722e3fbSopenharmony_ci------------------------ 38d722e3fbSopenharmony_ciA snipped from the, now removed, Makefile.am used to state: 39d722e3fbSopenharmony_ci 40d722e3fbSopenharmony_ci XXX airlied says, nothing besides *_drm.h and drm*.h should be necessary. 41d722e3fbSopenharmony_ci however, r300 and via need their reg headers installed in order to build. 42d722e3fbSopenharmony_ci better solutions are welcome. 43d722e3fbSopenharmony_ci 44d722e3fbSopenharmony_ciObviously the r300 and via headers are no longer around ;-) 45d722e3fbSopenharmony_ci 46d722e3fbSopenharmony_ciReason behind is that the drm headers can be used as a basic communications 47d722e3fbSopenharmony_cichannel with the respective kernel modules. If more advanced functionality is 48d722e3fbSopenharmony_cirequired one can pull the specific libdrm_$driver which is free to pull 49d722e3fbSopenharmony_ciadditional files from the kernel. 50d722e3fbSopenharmony_ci 51d722e3fbSopenharmony_ciFor example: nouveau has nouveau/nvif/*.h while vc4 has vc4/*.h 52d722e3fbSopenharmony_ci 53d722e3fbSopenharmony_ciIf your driver is still in prototyping/staging state, consider moving the 54d722e3fbSopenharmony_ci$driver_drm.h into $driver and _not_ installing it. An header providing opaque 55d722e3fbSopenharmony_cidefinitions and access [via $driver_drmif.h or similar] would be better fit. 56d722e3fbSopenharmony_ci 57d722e3fbSopenharmony_ci 58d722e3fbSopenharmony_ciWhen and which headers to update 59d722e3fbSopenharmony_ci-------------------------------- 60d722e3fbSopenharmony_ciIdeally all files will be synced (updated) with the latest released kernel on 61d722e3fbSopenharmony_cieach libdrm release. Sadly that's not yet possible since quite a few headers 62d722e3fbSopenharmony_cidiffer significantly - see Outdated or Broken Headers section below. 63d722e3fbSopenharmony_ci 64d722e3fbSopenharmony_ciThat said, it's up-to the individual developers to sync with newer version 65d722e3fbSopenharmony_ci(from drm-next) as they see fit. 66d722e3fbSopenharmony_ci 67d722e3fbSopenharmony_ci 68d722e3fbSopenharmony_ciWhen and how to update these files 69d722e3fbSopenharmony_ci---------------------------------- 70d722e3fbSopenharmony_ciNote: One should not do _any_ changes to the files apart from the steps below. 71d722e3fbSopenharmony_ci 72d722e3fbSopenharmony_ciIn order to update the files do the following: 73d722e3fbSopenharmony_ci - Switch to a Linux kernel tree/branch which is not rebased. 74d722e3fbSopenharmony_ci For example: drm-next (https://cgit.freedesktop.org/drm/drm) 75d722e3fbSopenharmony_ci - Install the headers via `make headers_install' to a separate location. 76d722e3fbSopenharmony_ci - Copy the drm header[s] + git add + git commit. 77d722e3fbSopenharmony_ci - Note: Your commit message must include: 78d722e3fbSopenharmony_ci a) Brief summary on the delta. If there's any change that looks like an 79d722e3fbSopenharmony_ciAPI/ABI break one _must_ explicitly state why it's safe to do so. 80d722e3fbSopenharmony_ci b) "Generated using make headers_install." 81d722e3fbSopenharmony_ci c) "Generated from $tree/branch commit $sha" 82d722e3fbSopenharmony_ci 83d722e3fbSopenharmony_ci 84d722e3fbSopenharmony_ciOutdated or Broken Headers 85d722e3fbSopenharmony_ci-------------------------- 86d722e3fbSopenharmony_ciThis section contains a list of headers and the respective "issues" they might 87d722e3fbSopenharmony_cihave relative to their kernel equivalent. 88d722e3fbSopenharmony_ci 89d722e3fbSopenharmony_ciMost UMS headers: 90d722e3fbSopenharmony_ci - Not using fixed size integers - compat ioctls are broken. 91d722e3fbSopenharmony_ciStatus: ? 92d722e3fbSopenharmony_ciPromote to fixed size ints, which match the current (32bit) ones. 93d722e3fbSopenharmony_ci 94d722e3fbSopenharmony_cinouveau_drm.h 95d722e3fbSopenharmony_ci - Missing macros NOUVEAU_GETPARAM*, NOUVEAU_DRM_HEADER_PATCHLEVEL, structs, 96d722e3fbSopenharmony_cienums 97d722e3fbSopenharmony_ciStatus: Deliberate UABI choice; nouveau hides the exact kernel ABI behind libdrm 98d722e3fbSopenharmony_ci 99d722e3fbSopenharmony_cir128_drm.h 100d722e3fbSopenharmony_ci - Broken compat ioctls. 101d722e3fbSopenharmony_ci 102d722e3fbSopenharmony_ciradeon_drm.h 103d722e3fbSopenharmony_ci - Missing RADEON_TILING_R600_NO_SCANOUT, CIK_TILE_MODE_*, broken UMS ioctls 104d722e3fbSopenharmony_ci - Both kernel and libdrm: missing padding - 105d722e3fbSopenharmony_cidrm_radeon_gem_{create,{g,s}et_tiling,set_domain} others ? 106d722e3fbSopenharmony_ciStatus: ? 107d722e3fbSopenharmony_ci 108d722e3fbSopenharmony_cisavage_drm.h 109d722e3fbSopenharmony_ci - Renamed ioctls - DRM_IOCTL_SAVAGE_{,BCI}_EVENT_EMIT, compat ioctls are broken. 110d722e3fbSopenharmony_ciStatus: ? 111d722e3fbSopenharmony_ci 112d722e3fbSopenharmony_cisis_drm.h 113d722e3fbSopenharmony_ci - Borken ioctls + libdrm uses int vs kernel long 114d722e3fbSopenharmony_ciStatus: ? 115d722e3fbSopenharmony_ci 116d722e3fbSopenharmony_civia_drm.h 117d722e3fbSopenharmony_ci - Borken ioctls - libdrm int vs kernel long 118d722e3fbSopenharmony_ciStatus: ? 119d722e3fbSopenharmony_ci 120d722e3fbSopenharmony_ci 121d722e3fbSopenharmony_ciomap_drm.h (living in $TOP/omap) 122d722e3fbSopenharmony_ci - License mismatch, missing DRM_IOCTL_OMAP_GEM_NEW and related struct 123d722e3fbSopenharmony_ciStatus: ? 124d722e3fbSopenharmony_ci 125d722e3fbSopenharmony_ciexynos_drm.h (living in $TOP/exynos) 126d722e3fbSopenharmony_ci - License mismatch, now using fixed size ints (but not everywhere). Lots of 127d722e3fbSopenharmony_cinew stuff. 128d722e3fbSopenharmony_ciStatus: ? 129