exynos_gfx: handle drmModeSetCrtc failing

This shouldn't happen anymore after the connector ID fix, but
the checks don't hurt and protect us from future mishaps.
This commit is contained in:
Tobias Jakobi 2015-02-20 10:54:23 +01:00
parent 551123d4d6
commit cf3eea13df

View File

@ -874,13 +874,17 @@ static int exynos_alloc(struct exynos_data *pdata)
}
}
/* Setup CRTC: display the last allocated page. */
if (drmModeSetCrtc(pdata->fd, pdata->drm->crtc_id, pages[pdata->num_pages - 1].buf_id,
0, 0, &pdata->drm->connector_id, 1, pdata->drm->mode))
{
RARCH_ERR("video_exynos: initial crtc setup failed\n");
goto fail;
}
pdata->pages = pages;
pdata->device = device;
/* Setup CRTC: display the last allocated page. */
drmModeSetCrtc(pdata->fd, pdata->drm->crtc_id, pages[pdata->num_pages - 1].buf_id,
0, 0, &pdata->drm->connector_id, 1, pdata->drm->mode);
return 0;
fail:
@ -898,8 +902,9 @@ static void exynos_free(struct exynos_data *pdata)
unsigned i;
/* Disable the CRTC. */
drmModeSetCrtc(pdata->fd, pdata->drm->crtc_id, 0,
0, 0, &pdata->drm->connector_id, 1, NULL);
if (drmModeSetCrtc(pdata->fd, pdata->drm->crtc_id, 0,
0, 0, &pdata->drm->connector_id, 1, NULL))
RARCH_WARN("video_exynos: failed to disable the crtc\n");
clean_up_pages(pdata->pages, pdata->num_pages);