Created
February 26, 2015 12:27
-
-
Save carlocaione/de489eb63ac5d5ca1c8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/armsoc_driver.c b/src/armsoc_driver.c | |
index 322a9c5..9c60559 100644 | |
--- a/src/armsoc_driver.c | |
+++ b/src/armsoc_driver.c | |
@@ -348,7 +348,7 @@ static Bool ARMSOCCopyDRMFB(ScrnInfoPtr pScrn) | |
drmModeCrtcPtr crtc; | |
drmModeFBPtr fb; | |
struct drm_mode_map_dumb mreq; | |
- uint32_t crct_id; | |
+ uint32_t crtc_id, connector_id; | |
uint32_t src_pitch; | |
int src_cpp; | |
int dst_width, dst_height, dst_bpp, dst_pitch; | |
@@ -358,10 +358,13 @@ static Bool ARMSOCCopyDRMFB(ScrnInfoPtr pScrn) | |
unsigned char *src = NULL, *dst = NULL; | |
unsigned int src_size = 0; | |
pixman_bool_t pixman_ret; | |
+ drmModeModeInfo mode; | |
+ FILE *file = fopen("/dev/kmsg","w"); | |
- crct_id = drmmode_get_crtc_id(pScrn); | |
+ crtc_id = drmmode_get_crtc_id(pScrn); | |
+ connector_id = drmmode_get_connector_id(pScrn, &mode); | |
- crtc = drmModeGetCrtc(pARMSOC->drmFD, crct_id); | |
+ crtc = drmModeGetCrtc(pARMSOC->drmFD, crtc_id); | |
if (!crtc) { | |
ERROR_MSG("Couldn't get crtc"); | |
goto exit; | |
@@ -440,6 +443,11 @@ static Bool ARMSOCCopyDRMFB(ScrnInfoPtr pScrn) | |
} | |
} | |
+ drmModeSetCrtc(pARMSOC->drmFD, crtc_id, fb->fb_id, 0, 0, &connector_id, 1, &mode); | |
+ | |
+ fprintf(file, "<1>[armsoc] ================ fd: %d, crtc_id: %d, fb_id: %d, connector_id: %d\n", pARMSOC->drmFD, crtc_id, fb->fb_id, connector_id); | |
+ fclose(file); | |
+ | |
ret = TRUE; | |
free_fb: | |
diff --git a/src/armsoc_driver.h b/src/armsoc_driver.h | |
index 59c5e0e..af71dca 100644 | |
--- a/src/armsoc_driver.h | |
+++ b/src/armsoc_driver.h | |
@@ -38,6 +38,7 @@ | |
#include "xf86drm.h" | |
#include <errno.h> | |
#include "armsoc_exa.h" | |
+#include "xf86drmMode.h" | |
/* Apparently not used by X server */ | |
#define ARMSOC_VERSION 1000 | |
@@ -204,6 +205,7 @@ void drmmode_wait_for_event(ScrnInfoPtr pScrn); | |
Bool drmmode_cursor_init(ScreenPtr pScreen); | |
void drmmode_cursor_fini(ScreenPtr pScreen); | |
uint32_t drmmode_get_crtc_id(ScrnInfoPtr pScrn); | |
+uint32_t drmmode_get_connector_id(ScrnInfoPtr pScrn, drmModeModeInfo *mode); | |
/** | |
* DRI2 functions.. | |
diff --git a/src/drmmode_display.c b/src/drmmode_display.c | |
index 852861b..873dc3e 100644 | |
--- a/src/drmmode_display.c | |
+++ b/src/drmmode_display.c | |
@@ -871,6 +871,18 @@ uint32_t drmmode_get_crtc_id(ScrnInfoPtr pScrn) | |
return drmmode_crtc->crtc_id; | |
} | |
+uint32_t drmmode_get_connector_id(ScrnInfoPtr pScrn, drmModeModeInfo *mode) | |
+{ | |
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); | |
+ xf86OutputPtr output = config->output[config->compat_output]; | |
+ struct drmmode_output_priv *drmmode_output = output->driver_private; | |
+ | |
+ memcpy(mode, &drmmode_output->connector->modes[0], sizeof(*mode)); | |
+ | |
+ return drmmode_output->connector->connector_id; | |
+} | |
+ | |
+ | |
#if 1 == ARMSOC_SUPPORT_GAMMA | |
static void | |
drmmode_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment