On Wed, Apr 11, 2018 at 04:22:16PM +0100, Alexandru Gheorghe wrote: > Use the newly added ResourceManager for creating and detecting all the > drm devices instead of assuming that there is only one device. > > Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@xxxxxxx> > --- <snip /> > index 4cca48c..4cdcd87 100644 > --- a/drmresources.h > +++ b/drmresources.h > @@ -17,22 +17,26 @@ > #ifndef ANDROID_DRM_H_ > #define ANDROID_DRM_H_ > > +#include <stdint.h> > #include "drmconnector.h" > #include "drmcrtc.h" > #include "drmencoder.h" > #include "drmeventlistener.h" > #include "drmplane.h" > - > -#include <stdint.h> > +#include "platform.h" > +#include "resourcemanager.h" > > namespace android { > > +class ResourceManager; > + > class DrmResources { One more thing I've been thinking about. Let's rename this to DrmDevice now that we can have more than one. It's immediately obvious what a collection of DrmDevices is, it's less obvious if they're DrmResources. I think ResourceManager is Ok to keep, but if you think there's a better name I'm open to that. Sean > public: > DrmResources(); > ~DrmResources(); > > - int Init(); > + int Init(ResourceManager *resource_manager, char *path, > + int start_display_index); > > int fd() const { > return fd_.get(); > @@ -58,6 +62,7 @@ class DrmResources { > DrmCrtc *GetCrtcForDisplay(int display) const; > DrmPlane *GetPlane(uint32_t id) const; > DrmEventListener *event_listener(); > + ResourceManager *resource_manager(); > > int GetPlaneProperty(const DrmPlane &plane, const char *prop_name, > DrmProperty *property); > @@ -71,6 +76,7 @@ class DrmResources { > > int CreatePropertyBlob(void *data, size_t length, uint32_t *blob_id); > int DestroyPropertyBlob(uint32_t blob_id); > + bool HandlesDisplay(int display) const; > > private: > int TryEncoderForDisplay(int display, DrmEncoder *enc); > @@ -90,6 +96,8 @@ class DrmResources { > > std::pair<uint32_t, uint32_t> min_resolution_; > std::pair<uint32_t, uint32_t> max_resolution_; > + std::map<int, int> displays_; > + ResourceManager *resource_manager_; > }; > } > > -- > 2.7.4 > -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel