README revision 037b3c26
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---------------------------------- 70037b3c26SmrgIn order to update the files do the following: 71037b3c26Smrg - Switch to a Linux kernel tree/branch which is not rebased. 72037b3c26SmrgFor example: airlied/drm-next 73037b3c26Smrg - Install the headers via `make headers_install' to a separate location. 74037b3c26Smrg - Copy the drm header[s] + git add + git commit. 75037b3c26Smrg - Note: Your commit message must include: 76037b3c26Smrg a) Brief summary on the delta. If there's any change that looks like an 77037b3c26SmrgAPI/ABI break one _must_ explicitly state why it's safe to do so. 78037b3c26Smrg b) "Generated using make headers_install." 79037b3c26Smrg c) "Generated from $tree/branch commit $sha" 80037b3c26Smrg 81037b3c26Smrg 82037b3c26SmrgOutdated or Broken Headers 83037b3c26Smrg-------------------------- 84037b3c26SmrgThis section contains a list of headers and the respective "issues" they might 85037b3c26Smrghave relative to their kernel equivalent. 86037b3c26Smrg 87037b3c26SmrgNearly all headers: 88037b3c26Smrg - Missing extern C notation. 89037b3c26SmrgStatus: Trivial. 90037b3c26Smrg 91037b3c26SmrgMost UMS headers: 92037b3c26Smrg - Not using fixed size integers - compat ioctls are broken. 93037b3c26SmrgStatus: ? 94037b3c26SmrgPromote to fixed size ints, which match the current (32bit) ones. 95037b3c26Smrg 96037b3c26Smrg 97037b3c26Smrgamdgpu_drm.h 98037b3c26Smrg - Using the stdint.h uint*_t over the respective __u* ones 99037b3c26SmrgStatus: Trivial. 100037b3c26Smrg 101037b3c26Smrgdrm_mode.h 102037b3c26Smrg - Missing DPI encode/connector pair. 103037b3c26SmrgStatus: Trivial. 104037b3c26Smrg 105037b3c26Smrgi915_drm.h 106037b3c26Smrg - Missing PARAMS - HAS_POOLED_EU, MIN_EU_IN_POOL CONTEXT_PARAM_NO_ERROR_CAPTURE 107037b3c26SmrgStatus: Trivial. 108037b3c26Smrg 109037b3c26Smrgmga_drm.h 110037b3c26Smrg - Typo fix, use struct over typedef. 111037b3c26SmrgStatus: Trivial. 112037b3c26Smrg 113037b3c26Smrgnouveau_drm.h 114037b3c26Smrg - Missing macros NOUVEAU_GETPARAM*, NOUVEAU_DRM_HEADER_PATCHLEVEL, structs, 115037b3c26Smrgenums, using stdint.h over the __u* types. 116037b3c26SmrgStatus: ? 117037b3c26Smrg 118037b3c26Smrgqxl_drm.h 119037b3c26Smrg - Using the stdint.h uint*_t over the respective __u* ones 120037b3c26SmrgStatus: Trivial. 121037b3c26Smrg 122037b3c26Smrgr128_drm.h 123037b3c26Smrg - Broken compat ioctls. 124037b3c26Smrg 125037b3c26Smrgradeon_drm.h 126037b3c26Smrg - Missing RADEON_TILING_R600_NO_SCANOUT, CIK_TILE_MODE_*, broken UMS ioctls, 127037b3c26Smrgusing stdint types. 128037b3c26Smrg - Both kernel and libdrm: missing padding - 129037b3c26Smrgdrm_radeon_gem_{create,{g,s}et_tiling,set_domain} others ? 130037b3c26SmrgStatus: ? 131037b3c26Smrg 132037b3c26Smrgsavage_drm.h 133037b3c26Smrg - Renamed ioctls - DRM_IOCTL_SAVAGE_{,BCI}_EVENT_EMIT, compat ioctls are broken. 134037b3c26SmrgStatus: ? 135037b3c26Smrg 136037b3c26Smrgsis_drm.h 137037b3c26Smrg - Borken ioctls + libdrm uses int vs kernel long 138037b3c26SmrgStatus: ? 139037b3c26Smrg 140037b3c26Smrgvia_drm.h 141037b3c26Smrg - Borken ioctls - libdrm int vs kernel long 142037b3c26SmrgStatus: ? 143037b3c26Smrg 144037b3c26Smrg 145037b3c26Smrgomap_drm.h (living in $TOP/omap) 146037b3c26Smrg - License mismatch, missing DRM_IOCTL_OMAP_GEM_NEW and related struct 147037b3c26SmrgStatus: ? 148037b3c26Smrg 149037b3c26Smrgmsm_drm.h (located in $TOP/freedreno/msm/) 150037b3c26Smrg - License mismatch, missing MSM_PIPE_*, MSM_SUBMIT_*. Renamed 151037b3c26Smrgdrm_msm_gem_submit::flags, missing drm_msm_gem_submit::fence_fd. 152037b3c26SmrgStatus: ? 153037b3c26Smrg 154037b3c26Smrgexynos_drm.h (living in $TOP/exynos) 155037b3c26Smrg - License mismatch, now using fixed size ints (but not everywhere). Lots of 156037b3c26Smrgnew stuff. 157037b3c26SmrgStatus: ? 158