summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aec0652)
raw | patch | inline | side by side (parent: aec0652)
author | Pooja Prajod <a0132412@ti.com> | |
Wed, 14 Dec 2016 09:15:42 +0000 (14:45 +0530) | ||
committer | Pooja Prajod <a0132412@ti.com> | |
Fri, 16 Dec 2016 11:12:40 +0000 (16:42 +0530) |
In some usecases HDMI is connected but is disabled by default.
In such scenarios drmGetEncoder fails. This patch iterates over
all possible encoders and stores the crtc accordingly.
Signed-off-by: Pooja Prajod <a0132412@ti.com>
In such scenarios drmGetEncoder fails. This patch iterates over
all possible encoders and stores the crtc accordingly.
Signed-off-by: Pooja Prajod <a0132412@ti.com>
sys/kms/gstdrmutils.c | patch | blob | history |
diff --git a/sys/kms/gstdrmutils.c b/sys/kms/gstdrmutils.c
index d496b5e34dfbf0b6a5dc398135af024c51a2a870..0e67a488d44261637acd5903eb130add9a7a21ef 100644 (file)
--- a/sys/kms/gstdrmutils.c
+++ b/sys/kms/gstdrmutils.c
{
int i, best_area = 0, ret;
struct drm_set_client_cap req;
+ unsigned int j;
+ int32_t crtc;
gst_drm_connector_cleanup (fd, c);
enc = c->encoder;
stored_enc = c->connector->encoder_id;
}
+
+ if (!c->encoder) {
+ for (i = 0; i < c->connector->count_encoders; ++i) {
+ c->encoder = drmModeGetEncoder(fd, c->connector->encoders[i]);
+ if (!c->encoder) {
+ GST_DEBUG ("Cannot retrieve encoder %u:%u (%d): %m\n",
+ i, c->connector->encoders[i], errno);
+ continue;
+ }
+ /* iterate all global CRTCs */
+ for (j = 0; j < resources->count_crtcs; ++j) {
+ /* check whether this CRTC works with the encoder */
+ if (!(c->encoder->possible_crtcs & (1 << j)))
+ continue;
+ crtc = resources->crtcs[j];
+ break;
+ }
+ if (crtc >= 0) {
+ enc = c->encoder;
+ stored_enc = c->connector->encoder_id;
+ c->crtc = crtc;
+ goto found_encoder;
+ }
+ }
+ }
+
+found_encoder:
+
if (!c->encoder)
goto error_no_encoder;