summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorMario Kleiner <mario.kleiner.de@gmail.com>2018-02-27 03:05:27 +0100
committerAdam Jackson <ajax@redhat.com>2018-02-27 10:18:06 -0500
commitc326c717c8dbf4a3f0c64a031fbe6030e73ff355 (patch)
treeed5dbe3288776afcca87369dc9b350f8b4db5b71 /glamor
parent9ab5d91c6c228e8f5b34e4b30c5104aed6c41958 (diff)
glamor: Fix loose ends in color depth 30 support.
This makes it work properly with OpenGL based desktop compositing, as tested with EGL and GLX based compositing under OpenGL-2/3, and also artifact free with XRender based 2D compositing. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Antoine Martin <antoine@nagafix.co.uk>
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor.c6
-rw-r--r--glamor/glamor_copy.c9
-rw-r--r--glamor/glamor_egl.c3
3 files changed, 15 insertions, 3 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 4a41fe783..d61e27563 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -805,7 +805,8 @@ glamor_fd_from_pixmap(ScreenPtr screen,
switch (pixmap_priv->type) {
case GLAMOR_TEXTURE_DRM:
case GLAMOR_TEXTURE_ONLY:
- if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0))
+ if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ?
+ GL_RGB10_A2 : GL_RGBA, 0))
return -1;
return glamor_egl_dri3_fd_name_from_tex(screen,
pixmap,
@@ -845,7 +846,8 @@ glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
switch (pixmap_priv->type) {
case GLAMOR_TEXTURE_DRM:
case GLAMOR_TEXTURE_ONLY:
- if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0))
+ if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ?
+ GL_RGB10_A2 : GL_RGBA, 0))
return -1;
return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen,
pixmap,
diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
index bd4a0e20f..e050c0220 100644
--- a/glamor/glamor_copy.c
+++ b/glamor/glamor_copy.c
@@ -78,6 +78,15 @@ use_copyplane(PixmapPtr dst, GCPtr gc, glamor_program *prog, void *arg)
/* XXX handle 2 10 10 10 and 1555 formats; presumably the pixmap private knows this? */
switch (args->src_pixmap->drawable.depth) {
+ case 30:
+ glUniform4ui(prog->bitplane_uniform,
+ (args->bitplane >> 20) & 0x3ff,
+ (args->bitplane >> 10) & 0x3ff,
+ (args->bitplane ) & 0x3ff,
+ 0);
+
+ glUniform4f(prog->bitmul_uniform, 0x3ff, 0x3ff, 0x3ff, 0);
+ break;
case 24:
glUniform4ui(prog->bitplane_uniform,
(args->bitplane >> 16) & 0xff,
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 202b83efd..eb5e68b8e 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -270,7 +270,8 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap)
}
bo = gbm_bo_create(glamor_egl->gbm, width, height,
- GBM_FORMAT_ARGB8888,
+ (pixmap->drawable.depth == 30) ?
+ GBM_FORMAT_ARGB2101010 : GBM_FORMAT_ARGB8888,
#ifdef GLAMOR_HAS_GBM_LINEAR
(pixmap->usage_hint == CREATE_PIXMAP_USAGE_SHARED ?
GBM_BO_USE_LINEAR : 0) |