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>
This commit is contained in:
parent
9ab5d91c6c
commit
c326c717c8
|
@ -805,7 +805,8 @@ glamor_fd_from_pixmap(ScreenPtr screen,
|
||||||
switch (pixmap_priv->type) {
|
switch (pixmap_priv->type) {
|
||||||
case GLAMOR_TEXTURE_DRM:
|
case GLAMOR_TEXTURE_DRM:
|
||||||
case GLAMOR_TEXTURE_ONLY:
|
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 -1;
|
||||||
return glamor_egl_dri3_fd_name_from_tex(screen,
|
return glamor_egl_dri3_fd_name_from_tex(screen,
|
||||||
pixmap,
|
pixmap,
|
||||||
|
@ -845,7 +846,8 @@ glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
|
||||||
switch (pixmap_priv->type) {
|
switch (pixmap_priv->type) {
|
||||||
case GLAMOR_TEXTURE_DRM:
|
case GLAMOR_TEXTURE_DRM:
|
||||||
case GLAMOR_TEXTURE_ONLY:
|
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 -1;
|
||||||
return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen,
|
return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen,
|
||||||
pixmap,
|
pixmap,
|
||||||
|
|
|
@ -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? */
|
/* XXX handle 2 10 10 10 and 1555 formats; presumably the pixmap private knows this? */
|
||||||
switch (args->src_pixmap->drawable.depth) {
|
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:
|
case 24:
|
||||||
glUniform4ui(prog->bitplane_uniform,
|
glUniform4ui(prog->bitplane_uniform,
|
||||||
(args->bitplane >> 16) & 0xff,
|
(args->bitplane >> 16) & 0xff,
|
||||||
|
|
|
@ -270,7 +270,8 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap)
|
||||||
}
|
}
|
||||||
|
|
||||||
bo = gbm_bo_create(glamor_egl->gbm, width, height,
|
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
|
#ifdef GLAMOR_HAS_GBM_LINEAR
|
||||||
(pixmap->usage_hint == CREATE_PIXMAP_USAGE_SHARED ?
|
(pixmap->usage_hint == CREATE_PIXMAP_USAGE_SHARED ?
|
||||||
GBM_BO_USE_LINEAR : 0) |
|
GBM_BO_USE_LINEAR : 0) |
|
||||||
|
|
Loading…
Reference in New Issue