nouveau: Rename pipe formats.
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 1 Mar 2010 18:13:32 +0000 (18:13 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 1 Mar 2010 18:53:32 +0000 (18:53 +0000)
src/gallium/drivers/nouveau/nv04_surface_2d.c
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv30/nv30_screen.c
src/gallium/drivers/nv30/nv30_state_fb.c
src/gallium/drivers/nv40/nv40_miptree.c
src/gallium/drivers/nv40/nv40_screen.c
src/gallium/drivers/nv40/nv40_state_fb.c
src/gallium/drivers/nv50/nv50_miptree.c
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nv50/nv50_surface.c

index 42c2ca932d835d6c7b7f6d451491fdeb6d90a490..b074547c4da2eb523caddb4966af30b64ef7039b 100644 (file)
@@ -18,15 +18,15 @@ nv04_surface_format(enum pipe_format format)
        case PIPE_FORMAT_I8_UNORM:
                return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8;
        case PIPE_FORMAT_R16_SNORM:
-       case PIPE_FORMAT_R5G6B5_UNORM:
+       case PIPE_FORMAT_B5G6R5_UNORM:
        case PIPE_FORMAT_Z16_UNORM:
-       case PIPE_FORMAT_A8L8_UNORM:
+       case PIPE_FORMAT_L8A8_UNORM:
                return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5;
-       case PIPE_FORMAT_X8R8G8B8_UNORM:
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
                return NV04_CONTEXT_SURFACES_2D_FORMAT_A8R8G8B8;
-       case PIPE_FORMAT_Z24S8_UNORM:
-       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_S8Z24_UNORM:
+       case PIPE_FORMAT_X8Z24_UNORM:
                return NV04_CONTEXT_SURFACES_2D_FORMAT_Y32;
        default:
                return -1;
@@ -39,14 +39,14 @@ nv04_rect_format(enum pipe_format format)
        switch (format) {
        case PIPE_FORMAT_A8_UNORM:
                return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
-       case PIPE_FORMAT_R5G6B5_UNORM:
-       case PIPE_FORMAT_A8L8_UNORM:
+       case PIPE_FORMAT_B5G6R5_UNORM:
+       case PIPE_FORMAT_L8A8_UNORM:
        case PIPE_FORMAT_Z16_UNORM:
                return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5;
-       case PIPE_FORMAT_X8R8G8B8_UNORM:
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
-       case PIPE_FORMAT_Z24S8_UNORM:
-       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
+       case PIPE_FORMAT_S8Z24_UNORM:
+       case PIPE_FORMAT_X8Z24_UNORM:
                return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
        default:
                return -1;
@@ -61,15 +61,15 @@ nv04_scaled_image_format(enum pipe_format format)
        case PIPE_FORMAT_L8_UNORM:
        case PIPE_FORMAT_I8_UNORM:
                return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_Y8;
-       case PIPE_FORMAT_A1R5G5B5_UNORM:
+       case PIPE_FORMAT_B5G5R5A1_UNORM:
                return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5;
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
                return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8;
-       case PIPE_FORMAT_X8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
                return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8;
-       case PIPE_FORMAT_R5G6B5_UNORM:
+       case PIPE_FORMAT_B5G6R5_UNORM:
        case PIPE_FORMAT_R16_SNORM:
-       case PIPE_FORMAT_A8L8_UNORM:
+       case PIPE_FORMAT_L8A8_UNORM:
                return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5;
        default:
                return -1;
index c29c36e20aabc8093c50578313abab1f7305152d..697b1b92ff6a9a8ac98634e241fc79d04845b423 100644 (file)
@@ -88,11 +88,11 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
        else {
                switch (pt->format) {
                /* TODO: Figure out which formats can be swizzled */
-               case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_X8R8G8B8_UNORM:
+               case PIPE_FORMAT_B8G8R8A8_UNORM:
+               case PIPE_FORMAT_B8G8R8X8_UNORM:
                case PIPE_FORMAT_R16_SNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM:
-               case PIPE_FORMAT_A8L8_UNORM:
+               case PIPE_FORMAT_B5G6R5_UNORM:
+               case PIPE_FORMAT_L8A8_UNORM:
                case PIPE_FORMAT_A8_UNORM:
                case PIPE_FORMAT_L8_UNORM:
                case PIPE_FORMAT_I8_UNORM:
index aef37d303d8a44c5cc0f04e76944e0d178aa7370..85433d20953abba4b28207f0d96edb32414869f3 100644 (file)
@@ -112,8 +112,8 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen,
 
        if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) {
                switch (format) {
-               case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM:
+               case PIPE_FORMAT_B8G8R8A8_UNORM:
+               case PIPE_FORMAT_B5G6R5_UNORM:
                        return TRUE;
                default:
                        break;
@@ -121,12 +121,12 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen,
        } else
        if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
                switch (format) {
-               case PIPE_FORMAT_Z24S8_UNORM:
-               case PIPE_FORMAT_Z24X8_UNORM:
+               case PIPE_FORMAT_S8Z24_UNORM:
+               case PIPE_FORMAT_X8Z24_UNORM:
                        return TRUE;
                case PIPE_FORMAT_Z16_UNORM:
                        if (front) {
-                               return (front->format == PIPE_FORMAT_R5G6B5_UNORM);
+                               return (front->format == PIPE_FORMAT_B5G6R5_UNORM);
                        }
                        return TRUE;
                default:
@@ -134,16 +134,16 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen,
                }
        } else {
                switch (format) {
-               case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_A1R5G5B5_UNORM:
-               case PIPE_FORMAT_A4R4G4B4_UNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM:
+               case PIPE_FORMAT_B8G8R8A8_UNORM:
+               case PIPE_FORMAT_B5G5R5A1_UNORM:
+               case PIPE_FORMAT_B4G4R4A4_UNORM:
+               case PIPE_FORMAT_B5G6R5_UNORM:
                case PIPE_FORMAT_L8_UNORM:
                case PIPE_FORMAT_A8_UNORM:
                case PIPE_FORMAT_I8_UNORM:
-               case PIPE_FORMAT_A8L8_UNORM:
+               case PIPE_FORMAT_L8A8_UNORM:
                case PIPE_FORMAT_Z16_UNORM:
-               case PIPE_FORMAT_Z24S8_UNORM:
+               case PIPE_FORMAT_S8Z24_UNORM:
                        return TRUE;
                default:
                        break;
index 2ed2ea55e8473875e695d53b68e44140650cbf4a..f7fe9833c7799889d6d0867a6a7774f2ede0a9e1 100644 (file)
@@ -66,14 +66,14 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
        }
 
        switch (colour_format) {
-       case PIPE_FORMAT_X8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
                rt_format |= NV34TCL_RT_FORMAT_COLOR_X8R8G8B8;
                break;
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
        case 0:
                rt_format |= NV34TCL_RT_FORMAT_COLOR_A8R8G8B8;
                break;
-       case PIPE_FORMAT_R5G6B5_UNORM:
+       case PIPE_FORMAT_B5G6R5_UNORM:
                rt_format |= NV34TCL_RT_FORMAT_COLOR_R5G6B5;
                colour_bits = 16;
                break;
@@ -86,8 +86,8 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
                rt_format |= NV34TCL_RT_FORMAT_ZETA_Z16;
                zeta_bits = 16;
                break;
-       case PIPE_FORMAT_Z24S8_UNORM:
-       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_S8Z24_UNORM:
+       case PIPE_FORMAT_X8Z24_UNORM:
        case 0:
                rt_format |= NV34TCL_RT_FORMAT_ZETA_Z24S8;
                break;
index ad1a9a519528e328a5dc120a14724b95b17d20e3..85d7e1f1972dc323205dabba8434b0fdd79e294a 100644 (file)
@@ -90,8 +90,8 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
        else {
                switch (pt->format) {
                /* TODO: Figure out which formats can be swizzled */
-               case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_X8R8G8B8_UNORM:
+               case PIPE_FORMAT_B8G8R8A8_UNORM:
+               case PIPE_FORMAT_B8G8R8X8_UNORM:
                case PIPE_FORMAT_R16_SNORM:
                {
                        if (debug_get_bool_option("NOUVEAU_NO_SWIZZLE", FALSE))
index edee4b9a3aaa1d73a677a6ec69e6ab94f17b0922..b216c5e38c95f391def494132cb70449eab4cfca 100644 (file)
@@ -98,8 +98,8 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen,
 {
        if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) {
                switch (format) {
-               case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM: 
+               case PIPE_FORMAT_B8G8R8A8_UNORM:
+               case PIPE_FORMAT_B5G6R5_UNORM: 
                        return TRUE;
                default:
                        break;
@@ -107,8 +107,8 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen,
        } else
        if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
                switch (format) {
-               case PIPE_FORMAT_Z24S8_UNORM:
-               case PIPE_FORMAT_Z24X8_UNORM:
+               case PIPE_FORMAT_S8Z24_UNORM:
+               case PIPE_FORMAT_X8Z24_UNORM:
                case PIPE_FORMAT_Z16_UNORM:
                        return TRUE;
                default:
@@ -116,17 +116,17 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen,
                }
        } else {
                switch (format) {
-               case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_A1R5G5B5_UNORM:
-               case PIPE_FORMAT_A4R4G4B4_UNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM:
+               case PIPE_FORMAT_B8G8R8A8_UNORM:
+               case PIPE_FORMAT_B5G5R5A1_UNORM:
+               case PIPE_FORMAT_B4G4R4A4_UNORM:
+               case PIPE_FORMAT_B5G6R5_UNORM:
                case PIPE_FORMAT_R16_SNORM:
                case PIPE_FORMAT_L8_UNORM:
                case PIPE_FORMAT_A8_UNORM:
                case PIPE_FORMAT_I8_UNORM:
-               case PIPE_FORMAT_A8L8_UNORM:
+               case PIPE_FORMAT_L8A8_UNORM:
                case PIPE_FORMAT_Z16_UNORM:
-               case PIPE_FORMAT_Z24S8_UNORM:
+               case PIPE_FORMAT_S8Z24_UNORM:
                case PIPE_FORMAT_DXT1_RGB:
                case PIPE_FORMAT_DXT1_RGBA:
                case PIPE_FORMAT_DXT3_RGBA:
index a58fe9ddb1954718a185e6eb8eb6436953902bed..fd3fdfddc09fe92c06bda054e0175fbb2c2c600d 100644 (file)
@@ -57,14 +57,14 @@ nv40_state_framebuffer_validate(struct nv40_context *nv40)
                rt_format = NV40TCL_RT_FORMAT_TYPE_LINEAR;
 
        switch (colour_format) {
-       case PIPE_FORMAT_X8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
                rt_format |= NV40TCL_RT_FORMAT_COLOR_X8R8G8B8;
                break;
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
        case 0:
                rt_format |= NV40TCL_RT_FORMAT_COLOR_A8R8G8B8;
                break;
-       case PIPE_FORMAT_R5G6B5_UNORM:
+       case PIPE_FORMAT_B5G6R5_UNORM:
                rt_format |= NV40TCL_RT_FORMAT_COLOR_R5G6B5;
                break;
        default:
@@ -75,8 +75,8 @@ nv40_state_framebuffer_validate(struct nv40_context *nv40)
        case PIPE_FORMAT_Z16_UNORM:
                rt_format |= NV40TCL_RT_FORMAT_ZETA_Z16;
                break;
-       case PIPE_FORMAT_Z24S8_UNORM:
-       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_S8Z24_UNORM:
+       case PIPE_FORMAT_X8Z24_UNORM:
        case 0:
                rt_format |= NV40TCL_RT_FORMAT_ZETA_Z24S8;
                break;
index 7297c74a83c6ad9a16dc4bd0a99dc65fa23e49d4..3f9d869d7a47ff657d380045dce188958132f8ef 100644 (file)
@@ -89,14 +89,14 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
        case PIPE_FORMAT_Z32_FLOAT:
                tile_flags = 0x4800;
                break;
-       case PIPE_FORMAT_Z24S8_UNORM:
+       case PIPE_FORMAT_S8Z24_UNORM:
                tile_flags = 0x1800;
                break;
        case PIPE_FORMAT_Z16_UNORM:
                tile_flags = 0x6c00;
                break;
-       case PIPE_FORMAT_X8Z24_UNORM:
-       case PIPE_FORMAT_S8Z24_UNORM:
+       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_Z24S8_UNORM:
                tile_flags = 0x2800;
                break;
        case PIPE_FORMAT_R32G32B32A32_FLOAT:
index 2232461b9b66a3daa29014f15840cc919a9bcb2d..eed6031eafab715247115bad6992eb2e4e6ca530 100644 (file)
@@ -35,9 +35,9 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
 {
        if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) {
                switch (format) {
-               case PIPE_FORMAT_X8R8G8B8_UNORM:
-               case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM:
+               case PIPE_FORMAT_B8G8R8X8_UNORM:
+               case PIPE_FORMAT_B8G8R8A8_UNORM:
+               case PIPE_FORMAT_B5G6R5_UNORM:
                case PIPE_FORMAT_R16G16B16A16_SNORM:
                case PIPE_FORMAT_R16G16B16A16_UNORM:
                case PIPE_FORMAT_R32G32B32A32_FLOAT:
@@ -51,32 +51,32 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
        if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
                switch (format) {
                case PIPE_FORMAT_Z32_FLOAT:
-               case PIPE_FORMAT_Z24S8_UNORM:
-               case PIPE_FORMAT_X8Z24_UNORM:
                case PIPE_FORMAT_S8Z24_UNORM:
+               case PIPE_FORMAT_Z24X8_UNORM:
+               case PIPE_FORMAT_Z24S8_UNORM:
                        return TRUE;
                default:
                        break;
                }
        } else {
                switch (format) {
-               case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_X8R8G8B8_UNORM:
-               case PIPE_FORMAT_A8R8G8B8_SRGB:
-               case PIPE_FORMAT_X8R8G8B8_SRGB:
-               case PIPE_FORMAT_A1R5G5B5_UNORM:
-               case PIPE_FORMAT_A4R4G4B4_UNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM:
+               case PIPE_FORMAT_B8G8R8A8_UNORM:
+               case PIPE_FORMAT_B8G8R8X8_UNORM:
+               case PIPE_FORMAT_B8G8R8A8_SRGB:
+               case PIPE_FORMAT_B8G8R8X8_SRGB:
+               case PIPE_FORMAT_B5G5R5A1_UNORM:
+               case PIPE_FORMAT_B4G4R4A4_UNORM:
+               case PIPE_FORMAT_B5G6R5_UNORM:
                case PIPE_FORMAT_L8_UNORM:
                case PIPE_FORMAT_A8_UNORM:
                case PIPE_FORMAT_I8_UNORM:
-               case PIPE_FORMAT_A8L8_UNORM:
+               case PIPE_FORMAT_L8A8_UNORM:
                case PIPE_FORMAT_DXT1_RGB:
                case PIPE_FORMAT_DXT1_RGBA:
                case PIPE_FORMAT_DXT3_RGBA:
                case PIPE_FORMAT_DXT5_RGBA:
-               case PIPE_FORMAT_Z24S8_UNORM:
                case PIPE_FORMAT_S8Z24_UNORM:
+               case PIPE_FORMAT_Z24S8_UNORM:
                case PIPE_FORMAT_Z32_FLOAT:
                case PIPE_FORMAT_R16G16B16A16_SNORM:
                case PIPE_FORMAT_R16G16B16A16_UNORM:
index 7405b67414a97905bf811ec4659a4e3679482118..cabd148bc5bfe6f6d6d6093266e9a062787c098e 100644 (file)
@@ -33,11 +33,11 @@ static INLINE int
 nv50_format(enum pipe_format format)
 {
        switch (format) {
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
                return NV50_2D_DST_FORMAT_A8R8G8B8_UNORM;
-       case PIPE_FORMAT_X8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
                return NV50_2D_DST_FORMAT_X8R8G8B8_UNORM;
-       case PIPE_FORMAT_R5G6B5_UNORM:
+       case PIPE_FORMAT_B5G6R5_UNORM:
                return NV50_2D_DST_FORMAT_R5G6B5_UNORM;
        case PIPE_FORMAT_A8_UNORM:
                return NV50_2D_DST_FORMAT_R8_UNORM;