OSDN Git Service

Merge remote branch 'origin/master' into pipe-video
[android-x86/external-mesa.git] / src / gallium / drivers / r600 / r600_texture.c
index 048d0b6..7d3d022 100644 (file)
@@ -226,7 +226,7 @@ static void r600_texture_set_array_mode(struct pipe_screen *screen,
 
                w = mip_minify(ptex->width0, level);
                h = mip_minify(ptex->height0, level);
-               if (w < tile_width || h < tile_height)
+               if (w <= tile_width || h <= tile_height)
                        rtex->array_mode[level] = V_0280A0_ARRAY_1D_TILED_THIN1;
                else
                        rtex->array_mode[level] = array_mode;
@@ -422,8 +422,13 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
 
        /* Would like some magic "get_bool_option_once" routine.
         */
-       if (force_tiling == -1)
-               force_tiling = debug_get_bool_option("R600_FORCE_TILING", FALSE);
+       if (force_tiling == -1) {
+               struct r600_screen *rscreen = (struct r600_screen *)screen;
+               if (r600_get_minor_version(rscreen->radeon) >= 9)
+                       force_tiling = debug_get_bool_option("R600_TILING", TRUE);
+               else
+                       force_tiling = debug_get_bool_option("R600_TILING", FALSE);
+       }
 
        if (force_tiling && permit_hardware_blit(screen, templ)) {
                if (!(templ->flags & R600_RESOURCE_FLAG_TRANSFER) &&
@@ -813,7 +818,8 @@ static unsigned r600_get_swizzle_combined(const unsigned char *swizzle_format,
 }
 
 /* texture format translate */
-uint32_t r600_translate_texformat(enum pipe_format format,
+uint32_t r600_translate_texformat(struct pipe_screen *screen,
+                                 enum pipe_format format,
                                  const unsigned char *swizzle_view,
                                  uint32_t *word4_p, uint32_t *yuv_format_p)
 {
@@ -879,8 +885,13 @@ uint32_t r600_translate_texformat(enum pipe_format format,
                break;
        }
 
-       if (r600_enable_s3tc == -1)
-               r600_enable_s3tc = debug_get_bool_option("R600_ENABLE_S3TC", FALSE);
+       if (r600_enable_s3tc == -1) {
+               struct r600_screen *rscreen = (struct r600_screen *)screen;
+               if (r600_get_minor_version(rscreen->radeon) >= 9)
+                       r600_enable_s3tc = 1;
+               else
+                       r600_enable_s3tc = debug_get_bool_option("R600_ENABLE_S3TC", FALSE);
+       }
 
        if (desc->layout == UTIL_FORMAT_LAYOUT_RGTC) {
                if (!r600_enable_s3tc)