3 ms·
So fully half the code of OpenBSD (3.3M loc) is in /dev/pci/drm/amd. What does that code do?
by josephg 4y ago
So fully half the code of OpenBSD (3.3M loc) is in /dev/pci/drm/amd. What does that code do?
- rpigab 4y agoPicking at random the longest file, ./include/asic_reg/nbio/nbio_7_2_0_sh_mask.h, I think it sets aliases using #define for some addresses and values in hex to easily human-readable ans easy to understand names like BIFPLR1_PCIE_ADV_ERR_CAP_CNTL__COMPLETION_TIMEOUT_LOG_CAPABLE_MASK which is an alias for 0x00001000L. This file contains 134349 defines.
- 7steps2much 4y agoFrom what I can see at a glance its mostly loads upon loads of graphics code / graphics cards stuff. Its possible they have upstreamed entire drivers into their code base. I spotted some stuff that hints at low level protocols as well (i2c f.e.), so probably its just a whole lot of work to support AMD graphics cards. Potentially they upstreamed a driver or something.
- rjsw 4y agoThe AMD driver code in Linux is dual licenced, same for Nouveau and the Intel drivers, they have been copied into all the BSD variants.
- Karliss 4y agoThose are probably AMD gpu drivers.
- brobinson 4y agoDRM = direct rendering manager (not digital rights management)
- ploxiln 4y agoThe vast bulk of it is a dump mmio register addresses, that have been cleared for public disclosure. This is driven by some kind of legal/IP requirement. The vast majority are unused, and they are expressed in a rather inefficient way, e.g. XXX_0 through XXX_31 when anywhere else it would have been parameterized XXX(N). This was all copied from the Linux kernel btw. Rather disappointing, but what are you gonna do? Make your own high-performance graphics hardware? No. AMD is the highest performance graphics hardware with open source driver on the planet by a wide margin. Compromises have to be made. Just accept that the hardware division gives you this crazy register address file and don't touch it.
- ben_bai 4y agoThat's the amdgpu kernel driver. It's ported over from Linux. all the code in /dev/pci/drm are modern graphics drivers. (DRM as in Direct Rendering Manager)