drm_hwcomposer: Add display field to Drmencoder
In the current implementation TryEncoderForDisplay just looks
at the crtc linked to the display, if that's not assigned to
a display it means the encoder could be used, otherwise iterate
to the list of possible_crtcs and find one which is not used.
This logic works fine when you have just one encoder connected to a
crtc but with two or more, like is the case when we attach a writeback
connector, we need to know if we already assigned the encoder to a
display.
Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
diff --git a/drmdevice.cpp b/drmdevice.cpp
index 138bb3d..7a54c9d 100644
--- a/drmdevice.cpp
+++ b/drmdevice.cpp
@@ -277,6 +277,7 @@
DrmCrtc *crtc = enc->crtc();
if (crtc && crtc->can_bind(display)) {
crtc->set_display(display);
+ enc->set_crtc(crtc);
return 0;
}
@@ -287,8 +288,8 @@
continue;
if (crtc->can_bind(display)) {
- enc->set_crtc(crtc);
crtc->set_display(display);
+ enc->set_crtc(crtc);
return 0;
}
}