RetroArch/gfx/common/drm_common.c

37 lines
1.1 KiB
C

/* RetroArch - A frontend for libretro.
* copyright (c) 2011-2015 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "drm_common.h"
uint32_t g_connector_id;
drmModeCrtc *g_orig_crtc;
int g_drm_fd;
/* Restore the original CRTC. */
void drm_restore_crtc(void)
{
if (!g_orig_crtc)
return;
drmModeSetCrtc(g_drm_fd, g_orig_crtc->crtc_id,
g_orig_crtc->buffer_id,
g_orig_crtc->x,
g_orig_crtc->y,
&g_connector_id, 1, &g_orig_crtc->mode);
drmModeFreeCrtc(g_orig_crtc);
g_orig_crtc = NULL;
}