summaryrefslogtreecommitdiff
path: root/glamor/glamor_egl.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2015-06-10 14:46:22 +1000
committerDave Airlie <airlied@redhat.com>2015-06-30 12:17:55 +1000
commitea0e4d752b778c1f2132f8d29542f7dabc296415 (patch)
tree9ccde95e54e4bc367f30fd1733d1eafb1ec93168 /glamor/glamor_egl.c
parent5c555605386c76be2f02193d434a4617218b67be (diff)
glamor: add support for allocating linear buffers (v2)
We need this for doing USB offload scenarios using glamor and modesetting driver. unfortunately only gbm in mesa 10.6 has support for the linear API. v1.1: fix bad define v2: update the configure.ac test as per amdgpu. (Michel) set linear bos to external to avoid cache. (Eric) Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'glamor/glamor_egl.c')
-rw-r--r--glamor/glamor_egl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index dc5456118..4c0db6a47 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -187,7 +187,7 @@ glamor_egl_get_gbm_device(ScreenPtr screen)
}
unsigned int
-glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h)
+glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h, Bool linear)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
struct glamor_egl_screen_private *glamor_egl;
@@ -200,6 +200,9 @@ glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h)
glamor_egl = glamor_egl_get_screen_private(scrn);
bo = gbm_bo_create(glamor_egl->gbm, w, h, GBM_FORMAT_ARGB8888,
+#ifdef GLAMOR_HAS_GBM_LINEAR
+ (linear ? GBM_BO_USE_LINEAR : 0) |
+#endif
GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT);
if (!bo)
return 0;