Move HwcDisplay, HwcLayer and HwcCallback out of DrmHwcTwo class
As for now HwcDisplay, HwcLayer and HwcCallback are inner classes of DrmHwcTwo class. Moreover, they are private. This creates some issues with further code changes and for simpler support of the code in future those classes should be extracted as a separate entities.
-
Those classes are logically separate from DrmHwcTwo just as DrmDevice or DrmConnector. All those entities could be described without DrmHwcTwo which serves only as a entry point and interface for whole composer infrastructure. I can't come up with any reason to have it inside private part of other class, honestly.
-
Other composer implementations have similar types but none of them are private or hidden in some other class. As for example, one of Qualcomm implementations here, HWCDisplay is separate class which is instantiated from HWCSession which serves similar purpose to DrmHwcTwo.
-
There's no easy way to pass display if there is any need of doing that. HwcDisplay is private internal class, so no way it could be used anywhere outside DrmHwcTwo, even tho it is desirable in some cases for simpler implementation of other features, for example it could be used for backend-specific validation requested in issue #34 (closed), to simplify passing of all data to separate validator.
Based on that I believe that this refactoring could simplify further development and improve code quality.