#define __DRI_IMAGE_FORMAT_R16 0x100d
#define __DRI_IMAGE_FORMAT_GR1616 0x100e
#define __DRI_IMAGE_FORMAT_YUYV 0x100f
+#define __DRI_IMAGE_FORMAT_XBGR2101010 0x1010
+#define __DRI_IMAGE_FORMAT_ABGR2101010 0x1011
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
static const int fourcc_formats[] = {
__DRI_IMAGE_FOURCC_ARGB2101010,
__DRI_IMAGE_FOURCC_XRGB2101010,
+ __DRI_IMAGE_FOURCC_ABGR2101010,
+ __DRI_IMAGE_FOURCC_XBGR2101010,
__DRI_IMAGE_FOURCC_ARGB8888,
__DRI_IMAGE_FOURCC_ABGR8888,
__DRI_IMAGE_FOURCC_SARGB8888,
format = __DRI_IMAGE_FORMAT_XRGB2101010;
dri_components = __DRI_IMAGE_COMPONENTS_RGB;
break;
+ case __DRI_IMAGE_FOURCC_ABGR2101010:
+ format = __DRI_IMAGE_FORMAT_ABGR2101010;
+ dri_components = __DRI_IMAGE_COMPONENTS_RGBA;
+ break;
+ case __DRI_IMAGE_FOURCC_XBGR2101010:
+ format = __DRI_IMAGE_FORMAT_XBGR2101010;
+ dri_components = __DRI_IMAGE_COMPONENTS_RGB;
+ break;
case __DRI_IMAGE_FOURCC_R8:
format = __DRI_IMAGE_FORMAT_R8;
dri_components = __DRI_IMAGE_COMPONENTS_R;
case __DRI_IMAGE_FORMAT_XRGB2101010:
format = __DRI_IMAGE_FOURCC_XRGB2101010;
break;
+ case __DRI_IMAGE_FORMAT_ABGR2101010:
+ format = __DRI_IMAGE_FOURCC_ABGR2101010;
+ break;
+ case __DRI_IMAGE_FORMAT_XBGR2101010:
+ format = __DRI_IMAGE_FOURCC_XBGR2101010;
+ break;
case __DRI_IMAGE_FORMAT_R8:
format = __DRI_IMAGE_FOURCC_R8;
break;
case __DRI_IMAGE_FORMAT_ARGB2101010:
pf = PIPE_FORMAT_B10G10R10A2_UNORM;
break;
+ case __DRI_IMAGE_FORMAT_XBGR2101010:
+ pf = PIPE_FORMAT_R10G10B10X2_UNORM;
+ break;
+ case __DRI_IMAGE_FORMAT_ABGR2101010:
+ pf = PIPE_FORMAT_R10G10B10A2_UNORM;
+ break;
case __DRI_IMAGE_FORMAT_R8:
pf = PIPE_FORMAT_R8_UNORM;
break;
case __DRI_IMAGE_FOURCC_XRGB2101010:
pf = PIPE_FORMAT_B10G10R10X2_UNORM;
break;
+ case __DRI_IMAGE_FOURCC_ABGR2101010:
+ pf = PIPE_FORMAT_R10G10B10A2_UNORM;
+ break;
+ case __DRI_IMAGE_FOURCC_XBGR2101010:
+ pf = PIPE_FORMAT_R10G10B10X2_UNORM;
+ break;
case __DRI_IMAGE_FOURCC_NV12:
pf = PIPE_FORMAT_NV12;
*/
switch(format) {
case PIPE_FORMAT_B10G10R10A2_UNORM:
+ case PIPE_FORMAT_R10G10B10A2_UNORM:
case PIPE_FORMAT_BGRA8888_UNORM:
case PIPE_FORMAT_RGBA8888_UNORM:
depth = 32;
break;
+ case PIPE_FORMAT_R10G10B10X2_UNORM:
case PIPE_FORMAT_B10G10R10X2_UNORM:
depth = 30;
break;
case PIPE_FORMAT_B10G10R10A2_UNORM:
image_format = __DRI_IMAGE_FORMAT_ARGB2101010;
break;
+ case PIPE_FORMAT_R10G10B10X2_UNORM:
+ image_format = __DRI_IMAGE_FORMAT_XBGR2101010;
+ break;
+ case PIPE_FORMAT_R10G10B10A2_UNORM:
+ image_format = __DRI_IMAGE_FORMAT_ABGR2101010;
+ break;
default:
image_format = __DRI_IMAGE_FORMAT_NONE;
break;
case PIPE_FORMAT_B10G10R10A2_UNORM:
internal_format = PIPE_FORMAT_B10G10R10X2_UNORM;
break;
+ case PIPE_FORMAT_R10G10B10A2_UNORM:
+ internal_format = PIPE_FORMAT_R10G10B10X2_UNORM;
+ break;
case PIPE_FORMAT_BGRA8888_UNORM:
internal_format = PIPE_FORMAT_BGRX8888_UNORM;
break;
static const mesa_format mesa_formats[] = {
MESA_FORMAT_B10G10R10A2_UNORM,
MESA_FORMAT_B10G10R10X2_UNORM,
+ MESA_FORMAT_R10G10B10A2_UNORM,
+ MESA_FORMAT_R10G10B10X2_UNORM,
MESA_FORMAT_B8G8R8A8_UNORM,
MESA_FORMAT_B8G8R8X8_UNORM,
MESA_FORMAT_B8G8R8A8_SRGB,
static const enum pipe_format pipe_formats[] = {
PIPE_FORMAT_B10G10R10A2_UNORM,
PIPE_FORMAT_B10G10R10X2_UNORM,
+ PIPE_FORMAT_R10G10B10A2_UNORM,
+ PIPE_FORMAT_R10G10B10X2_UNORM,
PIPE_FORMAT_BGRA8888_UNORM,
PIPE_FORMAT_BGRX8888_UNORM,
PIPE_FORMAT_BGRA8888_SRGB,
if (!allow_rgb10 &&
(mesa_formats[format] == MESA_FORMAT_B10G10R10A2_UNORM ||
- mesa_formats[format] == MESA_FORMAT_B10G10R10X2_UNORM))
+ mesa_formats[format] == MESA_FORMAT_B10G10R10X2_UNORM ||
+ mesa_formats[format] == MESA_FORMAT_R10G10B10A2_UNORM ||
+ mesa_formats[format] == MESA_FORMAT_R10G10B10X2_UNORM))
continue;
if (!p_screen->is_format_supported(p_screen, pipe_formats[format],
}
break;
+ case 0x000003FF:
+ if (mode->alphaMask) {
+ assert(mode->alphaMask == 0xC0000000);
+ stvis->color_format = PIPE_FORMAT_R10G10B10A2_UNORM;
+ } else {
+ stvis->color_format = PIPE_FORMAT_R10G10B10X2_UNORM;
+ }
+ break;
+
case 0x00FF0000:
if (mode->alphaMask) {
assert(mode->alphaMask == 0xFF000000);
case __DRI_IMAGE_FORMAT_XBGR8888:
case __DRI_IMAGE_FORMAT_XRGB2101010:
case __DRI_IMAGE_FORMAT_ARGB2101010:
+ case __DRI_IMAGE_FORMAT_XBGR2101010:
+ case __DRI_IMAGE_FORMAT_ABGR2101010:
case __DRI_IMAGE_FORMAT_SARGB8:
return 4;
case __DRI_IMAGE_FORMAT_NONE:
case __DRI_IMAGE_FORMAT_XBGR8888: return __DRI_IMAGE_FOURCC_XBGR8888;
case __DRI_IMAGE_FORMAT_XRGB2101010: return __DRI_IMAGE_FOURCC_XRGB2101010;
case __DRI_IMAGE_FORMAT_ARGB2101010: return __DRI_IMAGE_FOURCC_ARGB2101010;
+ case __DRI_IMAGE_FORMAT_XBGR2101010: return __DRI_IMAGE_FOURCC_XBGR2101010;
+ case __DRI_IMAGE_FORMAT_ABGR2101010: return __DRI_IMAGE_FOURCC_ABGR2101010;
}
return 0;
}
{ 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 },
/* MESA_FORMAT_R8G8B8X8_UNORM */
{ 0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000 },
+ /* MESA_FORMAT_R10G10B10X2_UNORM */
+ { 0x000003FF, 0x000FFC00, 0x3FF00000, 0x00000000 },
+ /* MESA_FORMAT_R10G10B10A2_UNORM */
+ { 0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000 },
};
const uint32_t * masks;
case MESA_FORMAT_B10G10R10A2_UNORM:
masks = masks_table[4];
break;
+ case MESA_FORMAT_R10G10B10X2_UNORM:
+ masks = masks_table[7];
+ break;
+ case MESA_FORMAT_R10G10B10A2_UNORM:
+ masks = masks_table[8];
+ break;
default:
fprintf(stderr, "[%s:%u] Unknown framebuffer type %s (%d).\n",
__func__, __LINE__,
return GL_UNSIGNED_SHORT_5_6_5;
if (format == MESA_FORMAT_B10G10R10A2_UNORM ||
- format == MESA_FORMAT_B10G10R10X2_UNORM)
+ format == MESA_FORMAT_B10G10R10X2_UNORM ||
+ format == MESA_FORMAT_R10G10B10A2_UNORM ||
+ format == MESA_FORMAT_R10G10B10X2_UNORM)
return GL_UNSIGNED_INT_2_10_10_10_REV;
switch (data_type) {
switch (format) {
case PIPE_FORMAT_B10G10R10A2_UNORM:
+ case PIPE_FORMAT_R10G10B10A2_UNORM:
strb->Base.InternalFormat = GL_RGB10_A2;
break;
+ case PIPE_FORMAT_R10G10B10X2_UNORM:
case PIPE_FORMAT_B10G10R10X2_UNORM:
strb->Base.InternalFormat = GL_RGB10;
break;