Move `#ifdef HAVE_DRM_ATOMIC` code into new file
There is a big chunk of code under #ifdef HAVE_DRM_ATOMIC
in drm.c
. It is easy to add new code inside that chunk without realizing it, leading to problems like !48 (comment 172224) .
All that code should be moved into a new source file drm-atomic.c
, built conditional on what triggers HAVE_DRM_ATOMIC
. When drm-atomic.c
is not built, a private header needs to provide stub functions returning failures, so that we can drop almost all #ifdef HAVE_DRM_ATOMIC
from drm.c
.
Few special cases that still need #ifdef HAVE_DRM_ATOMIC
in drm.c
may remain.