ecore-drm: Fix finding possible crtcs

Summary: This fixes an issue when searching for possible crtcs that an
output can work on. Previously, we would end up not returning any
possible crtcs due to not looping the crtcs of the resource.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-05-12 12:03:24 -04:00
parent e577a108cf
commit 723c24de31
1 changed files with 10 additions and 4 deletions

View File

@ -1318,7 +1318,7 @@ ecore_drm_output_possible_crtc_get(Ecore_Drm_Output *output, unsigned int crtc)
drmModeRes *res;
drmModeConnector *conn;
drmModeEncoder *enc;
int i, j;
int i, j, k;
unsigned int p;
Eina_Bool ret = EINA_FALSE;
@ -1355,9 +1355,15 @@ ecore_drm_output_possible_crtc_get(Ecore_Drm_Output *output, unsigned int crtc)
p = enc->possible_crtcs;
/* Does the CRTC match the list of possible CRTCs from the encoder? */
if (p & (1 << output->crtc_id))
ret = EINA_TRUE;
for (k = 0; k < res->count_crtcs; k++)
{
if (res->crtcs[k] != output->crtc_id) continue;
if (p & (1 << k))
{
ret = EINA_TRUE;
break;
}
}
next:
drmModeFreeEncoder(enc);