summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2008-05-23 11:24:33 +0200
committerJakob Bornecrantz <[email protected]>2008-05-23 11:24:33 +0200
commitd607a02da929cd192a3b0896c38dbb468ffa5b0d (patch)
tree39f4a32471f8ebbc55a4caefb1917960266dc5e4 /src/gallium/winsys
parent01cc1eebe92441ec33e951b95f0a5b52721741f0 (diff)
i915: Made EGL report the actual modes on the screen/output pair
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/egl_drm/intel/intel_egl.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/winsys/egl_drm/intel/intel_egl.c b/src/gallium/winsys/egl_drm/intel/intel_egl.c
index a9c02184559..ac1825210eb 100644
--- a/src/gallium/winsys/egl_drm/intel/intel_egl.c
+++ b/src/gallium/winsys/egl_drm/intel/intel_egl.c
@@ -94,6 +94,18 @@ drm_update_res(struct drm_driver *drm_drv)
drm_drv->res = drmModeGetResources(drm_drv->device->drmFD);
}
+static void
+drm_add_modes_from_output(_EGLScreen *screen, drmModeOutputPtr output)
+{
+ struct drm_mode_modeinfo *m;
+ int i;
+
+ for (i = 0; i < output->count_modes; i++) {
+ m = &output->modes[i];
+ _eglAddNewMode(screen, m->hdisplay, m->vdisplay, m->vrefresh, m->name);
+ }
+}
+
static EGLBoolean
drm_initialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor)
{
@@ -137,7 +149,7 @@ drm_initialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor)
screen->output = output;
_eglInitScreen(&screen->base);
_eglAddScreen(disp, &screen->base);
- _eglAddNewMode(&screen->base, 1024, 768, 60 * 1000, "1024x768-60");
+ drm_add_modes_from_output(&screen->base, output);
}
/* for now we only have one config */
@@ -396,7 +408,7 @@ drm_find_mode(drmModeOutputPtr output, _EGLMode *mode)
for (i = 0; i < output->count_modes; i++) {
m = &output->modes[i];
- if (m->hdisplay == mode->Width && m->vdisplay == mode->Height)
+ if (m->hdisplay == mode->Width && m->vdisplay == mode->Height && m->vrefresh == mode->RefreshRate)
break;
m = NULL;
}