diff options
author | Martin Peres <[email protected]> | 2016-10-06 17:07:22 +0300 |
---|---|---|
committer | Martin Peres <[email protected]> | 2016-10-07 11:11:44 +0300 |
commit | 0247e5ee3edd546b8598082d5b45d110f61853d0 (patch) | |
tree | 428c1747d1b7fb8a49569c9bde6a0e2ffec63e96 /src/egl/drivers/dri2 | |
parent | 82b4f1c47b1d6ca326dbd863253d89337f565309 (diff) |
loader/dri3: add get_dri_screen() to the vtable
This allows querying the current active screen from the
loader's common code.
Cc: [email protected]
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Martin Peres <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r-- | src/egl/drivers/dri2/platform_x11_dri3.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c index 31649fe849e..d93f5bc73c9 100644 --- a/src/egl/drivers/dri2/platform_x11_dri3.c +++ b/src/egl/drivers/dri2/platform_x11_dri3.c @@ -103,6 +103,17 @@ egl_dri3_get_dri_context(struct loader_dri3_drawable *draw) return dri2_ctx->dri_context; } +static __DRIscreen * +egl_dri3_get_dri_screen(struct loader_dri3_drawable *draw) +{ + _EGLContext *ctx = _eglGetCurrentContext(); + struct dri2_egl_context *dri2_ctx; + if (!ctx) + return NULL; + dri2_ctx = dri2_egl_context(ctx); + return dri2_egl_display(dri2_ctx->base.Resource.Display)->dri_screen; +} + static void egl_dri3_flush_drawable(struct loader_dri3_drawable *draw, unsigned flags) { @@ -119,6 +130,7 @@ static struct loader_dri3_vtable egl_dri3_vtable = { .set_drawable_size = egl_dri3_set_drawable_size, .in_current_context = egl_dri3_in_current_context, .get_dri_context = egl_dri3_get_dri_context, + .get_dri_screen = egl_dri3_get_dri_screen, .flush_drawable = egl_dri3_flush_drawable, .show_fps = NULL, }; |