README revision 7cdc0497
1037b3c26SmrgWhat are these headers ? 2037b3c26Smrg------------------------ 3037b3c26SmrgThis is the canonical source of drm headers that user space should use for 4037b3c26Smrgcommunicating with the kernel DRM subsystem. 5037b3c26Smrg 6037b3c26SmrgThey flow from the kernel, thus any changes must be merged there first. 7037b3c26SmrgDo _not_ attempt to "fix" these by deviating from the kernel ones ! 8037b3c26Smrg 9037b3c26Smrg 10037b3c26SmrgNon-linux platforms - changes/patches 11037b3c26Smrg------------------------------------- 12037b3c26SmrgIf your platform has local changes, please send them upstream for inclusion. 13037b3c26SmrgEven if your patches don't get accepted in their current form, devs will 14037b3c26Smrggive you feedback on how to address things properly. 15037b3c26Smrg 16037b3c26Smrggit send-email --subject-prefix="PATCH libdrm" your patches to dri-devel 17037b3c26Smrgmailing list. 18037b3c26Smrg 19037b3c26SmrgBefore doing so, please consider the following: 20037b3c26Smrg - Have the [libdrm vs kernel] headers on your platform deviated ? 21037b3c26SmrgConsider unifying them first. 22037b3c26Smrg 23037b3c26Smrg - Have you introduced additional ABI that's not available in Linux ? 24037b3c26SmrgPropose it for [Linux kernel] upstream inclusion. 25037b3c26SmrgIf that doesn't work out (hopefully it never does), move it to another header 26037b3c26Smrgand/or keep the change(s) local ? 27037b3c26Smrg 28037b3c26Smrg - Are your changes DRI1/UMS specific ? 29037b3c26SmrgThere is virtually no interest/power in keeping those legacy interfaces. They 30037b3c26Smrgare around due to the kernel "thou shalt not break existing user space" rule. 31037b3c26Smrg 32037b3c26SmrgConsider porting the driver to DRI2/KMS - all (almost?) sensible hardware is 33037b3c26Smrgcapable of supporting those. 34037b3c26Smrg 35037b3c26Smrg 36037b3c26SmrgWhich headers go where ? 37037b3c26Smrg------------------------ 38037b3c26SmrgA snipped from the, now removed, Makefile.am used to state: 39037b3c26Smrg 40037b3c26Smrg XXX airlied says, nothing besides *_drm.h and drm*.h should be necessary. 41037b3c26Smrg however, r300 and via need their reg headers installed in order to build. 42037b3c26Smrg better solutions are welcome. 43037b3c26Smrg 44037b3c26SmrgObviously the r300 and via headers are no longer around ;-) 45037b3c26Smrg 46037b3c26SmrgReason behind is that the drm headers can be used as a basic communications 47037b3c26Smrgchannel with the respective kernel modules. If more advanced functionality is 48037b3c26Smrgrequired one can pull the specific libdrm_$driver which is free to pull 49037b3c26Smrgadditional files from the kernel. 50037b3c26Smrg 51037b3c26SmrgFor example: nouveau has nouveau/nvif/*.h while vc4 has vc4/*.h 52037b3c26Smrg 53037b3c26SmrgIf your driver is still in prototyping/staging state, consider moving the 54037b3c26Smrg$driver_drm.h into $driver and _not_ installing it. An header providing opaque 55037b3c26Smrgdefinitions and access [via $driver_drmif.h or similar] would be better fit. 56037b3c26Smrg 57037b3c26Smrg 58037b3c26SmrgWhen and which headers to update 59037b3c26Smrg-------------------------------- 60037b3c26SmrgIdeally all files will be synced (updated) with the latest released kernel on 61037b3c26Smrgeach libdrm release. Sadly that's not yet possible since quite a few headers 62037b3c26Smrgdiffer significantly - see Outdated or Broken Headers section below. 63037b3c26Smrg 64037b3c26SmrgThat said, it's up-to the individual developers to sync with newer version 65037b3c26Smrg(from drm-next) as they see fit. 66037b3c26Smrg 67037b3c26Smrg 68037b3c26SmrgWhen and how to update these files 69037b3c26Smrg---------------------------------- 70d8807b2fSmrgNote: One should not do _any_ changes to the files apart from the steps below. 71d8807b2fSmrg 72037b3c26SmrgIn order to update the files do the following: 73037b3c26Smrg - Switch to a Linux kernel tree/branch which is not rebased. 747cdc0497Smrg For example: drm-next (https://cgit.freedesktop.org/drm/drm) 75037b3c26Smrg - Install the headers via `make headers_install' to a separate location. 76037b3c26Smrg - Copy the drm header[s] + git add + git commit. 77037b3c26Smrg - Note: Your commit message must include: 78037b3c26Smrg a) Brief summary on the delta. If there's any change that looks like an 79037b3c26SmrgAPI/ABI break one _must_ explicitly state why it's safe to do so. 80037b3c26Smrg b) "Generated using make headers_install." 81037b3c26Smrg c) "Generated from $tree/branch commit $sha" 82037b3c26Smrg 83037b3c26Smrg 84037b3c26SmrgOutdated or Broken Headers 85037b3c26Smrg-------------------------- 86037b3c26SmrgThis section contains a list of headers and the respective "issues" they might 87037b3c26Smrghave relative to their kernel equivalent. 88037b3c26Smrg 89037b3c26SmrgMost UMS headers: 90037b3c26Smrg - Not using fixed size integers - compat ioctls are broken. 91037b3c26SmrgStatus: ? 92037b3c26SmrgPromote to fixed size ints, which match the current (32bit) ones. 93037b3c26Smrg 94037b3c26Smrgnouveau_drm.h 95037b3c26Smrg - Missing macros NOUVEAU_GETPARAM*, NOUVEAU_DRM_HEADER_PATCHLEVEL, structs, 9600a23bdaSmrgenums 977cdc0497SmrgStatus: Deliberate UABI choice; nouveau hides the exact kernel ABI behind libdrm 98037b3c26Smrg 99037b3c26Smrgr128_drm.h 100037b3c26Smrg - Broken compat ioctls. 101037b3c26Smrg 102037b3c26Smrgradeon_drm.h 10300a23bdaSmrg - Missing RADEON_TILING_R600_NO_SCANOUT, CIK_TILE_MODE_*, broken UMS ioctls 104037b3c26Smrg - Both kernel and libdrm: missing padding - 105037b3c26Smrgdrm_radeon_gem_{create,{g,s}et_tiling,set_domain} others ? 106037b3c26SmrgStatus: ? 107037b3c26Smrg 108037b3c26Smrgsavage_drm.h 109037b3c26Smrg - Renamed ioctls - DRM_IOCTL_SAVAGE_{,BCI}_EVENT_EMIT, compat ioctls are broken. 110037b3c26SmrgStatus: ? 111037b3c26Smrg 112037b3c26Smrgsis_drm.h 113037b3c26Smrg - Borken ioctls + libdrm uses int vs kernel long 114037b3c26SmrgStatus: ? 115037b3c26Smrg 116037b3c26Smrgvia_drm.h 117037b3c26Smrg - Borken ioctls - libdrm int vs kernel long 118037b3c26SmrgStatus: ? 119037b3c26Smrg 120037b3c26Smrg 121037b3c26Smrgomap_drm.h (living in $TOP/omap) 122037b3c26Smrg - License mismatch, missing DRM_IOCTL_OMAP_GEM_NEW and related struct 123037b3c26SmrgStatus: ? 124037b3c26Smrg 125037b3c26Smrgexynos_drm.h (living in $TOP/exynos) 126037b3c26Smrg - License mismatch, now using fixed size ints (but not everywhere). Lots of 127037b3c26Smrgnew stuff. 128037b3c26SmrgStatus: ? 129