DRM (Direct Rendering Manager) is a subsystem of the Linux kernel responsible for interfacing with GPUs of modern video cards.
DRM uses a set of generic system ioctls to allocate memory for the graphical objects and stuffs the commands and texture it needs.
So, when we a graphical application is run, it loads the OpenGL driver, such as Mesa; which in turn, loads libdrm, which enables talking directly to the kernel through ioctl.
The window system, such as X Server or Wayland, needs to know what is happening, so it can synchronize and update itself.