diff options
author | Chia-I Wu <[email protected]> | 2010-02-21 10:58:22 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-03-05 10:19:05 +0800 |
commit | e38f28ddedd6d4902ae18b1bf243e67d4b16decb (patch) | |
tree | 30237b21b483746ecf2263c16ed380062e1fae53 /src/gallium/state_trackers/egl/kms | |
parent | 45df4bad9fc0379f05197bee10c03fd351f24094 (diff) |
st/egl: Add event support to the native display interface.
There is only invalid_surface event right now. When EGL receives the
event, it sets the force_validate flag of the context binding to the
surface. This helps skip an unnecessary check.
Diffstat (limited to 'src/gallium/state_trackers/egl/kms')
-rw-r--r-- | src/gallium/state_trackers/egl/kms/native_kms.c | 13 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/kms/native_kms.h | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c index aedf3d430ca..90c82eaf6ce 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.c +++ b/src/gallium/state_trackers/egl/kms/native_kms.c @@ -201,6 +201,8 @@ kms_surface_swap_buffers(struct native_surface *nsurf) /* the front/back textures are swapped */ ksurf->sequence_number++; + kdpy->event_handler->invalid_surface(&kdpy->base, + &ksurf->base, ksurf->sequence_number); return TRUE; } @@ -762,7 +764,9 @@ static struct native_display_modeset kms_display_modeset = { }; static struct native_display * -kms_create_display(EGLNativeDisplayType dpy, struct drm_api *api) +kms_create_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler, + struct drm_api *api) { struct kms_display *kdpy; @@ -770,6 +774,8 @@ kms_create_display(EGLNativeDisplayType dpy, struct drm_api *api) if (!kdpy) return NULL; + kdpy->event_handler = event_handler; + kdpy->api = api; if (!kdpy->api) { _eglLog(_EGL_WARNING, "failed to create DRM API"); @@ -845,7 +851,8 @@ native_get_name(void) } struct native_display * -native_create_display(EGLNativeDisplayType dpy) +native_create_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler) { struct native_display *ndpy = NULL; @@ -853,7 +860,7 @@ native_create_display(EGLNativeDisplayType dpy) drm_api = drm_api_create(); if (drm_api) - ndpy = kms_create_display(dpy, drm_api); + ndpy = kms_create_display(dpy, event_handler, drm_api); return ndpy; } diff --git a/src/gallium/state_trackers/egl/kms/native_kms.h b/src/gallium/state_trackers/egl/kms/native_kms.h index 095186e3cf3..f9cbcb158b5 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.h +++ b/src/gallium/state_trackers/egl/kms/native_kms.h @@ -53,6 +53,8 @@ struct kms_crtc { struct kms_display { struct native_display base; + struct native_event_handler *event_handler; + int fd; struct drm_api *api; drmModeResPtr resources; |