r600g: fix RSQ of negative value on Cayman
[mesa.git] / src / gallium / drivers / r600 / r600_pipe.c
index 658e9a94a262537d3a851f31ad903d56b7983e67..0a7b0ac2012e57107544e071dc2ec87bf03afeb2 100644 (file)
@@ -174,7 +174,7 @@ static void r600_destroy_context(struct pipe_context *context)
        if (rctx->custom_blend_decompress) {
                rctx->context.delete_blend_state(&rctx->context, rctx->custom_blend_decompress);
        }
-       util_unreference_framebuffer_state(&rctx->framebuffer);
+       util_unreference_framebuffer_state(&rctx->framebuffer.state);
 
        r600_context_fini(rctx);
 
@@ -223,6 +223,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
        rctx->ws = rscreen->ws;
        rctx->family = rscreen->family;
        rctx->chip_class = rscreen->chip_class;
+       rctx->keep_tiling_flags = rscreen->info.drm_minor >= 12;
 
        LIST_INITHEAD(&rctx->active_timer_queries);
        LIST_INITHEAD(&rctx->active_nontimer_queries);
@@ -666,6 +667,22 @@ static int r600_get_compute_param(struct pipe_screen *screen,
                }
                return sizeof(uint64_t);
 
+       case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE:
+               if (ret) {
+                       uint64_t max_global_size;
+                       uint64_t * max_mem_alloc_size = ret;
+                       r600_get_compute_param(screen,
+                                       PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE,
+                                       &max_global_size);
+                       /* OpenCL requres this value be at least
+                        * max(MAX_GLOBAL_SIZE / 4, 128 * 1024 *1024)
+                        * I'm really not sure what value to report here, but
+                        * MAX_GLOBAL_SIZE / 4 seems resonable.
+                        */
+                       *max_mem_alloc_size = max_global_size / 4;
+               }
+               return sizeof(uint64_t);
+
        default:
                fprintf(stderr, "unknown PIPE_COMPUTE_CAP %d\n", param);
                return 0;