etnaviv: compiled_framebuffer_state: get rid of SE_SCISSOR_*
[mesa.git] / src / gallium / drivers / etnaviv / etnaviv_resource.c
index cca8b64d7c6048f66d078007bd659db350a5fc57..4a992b5f668d14f37199e0b729e6a6dbc3c2cf4f 100644 (file)
@@ -145,7 +145,7 @@ etna_screen_can_create_resource(struct pipe_screen *pscreen,
                                 const struct pipe_resource *templat)
 {
    struct etna_screen *screen = etna_screen(pscreen);
-   if (!translate_samples_to_xyscale(templat->nr_samples, NULL, NULL, NULL))
+   if (!translate_samples_to_xyscale(templat->nr_samples, NULL, NULL))
       return false;
 
    /* templat->bind is not set here, so we must use the minimum sizes */
@@ -229,7 +229,7 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout,
    }
 
    int msaa_xscale = 1, msaa_yscale = 1;
-   if (!translate_samples_to_xyscale(nr_samples, &msaa_xscale, &msaa_yscale, NULL)) {
+   if (!translate_samples_to_xyscale(nr_samples, &msaa_xscale, &msaa_yscale)) {
       /* Number of samples not supported */
       return NULL;
    }
@@ -351,17 +351,13 @@ etna_resource_create(struct pipe_screen *pscreen,
     * and a texture-compatible base buffer in other cases
     *
     */
-
    if (templat->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_DEPTH_STENCIL)) {
       if (screen->specs.pixel_pipes > 1 && !screen->specs.single_buffer)
          layout |= ETNA_LAYOUT_BIT_MULTI;
       if (screen->specs.can_supertile)
          layout |= ETNA_LAYOUT_BIT_SUPER;
    } else if (VIV_FEATURE(screen, chipMinorFeatures2, SUPERTILED_TEXTURE) &&
-              /* RS can't tile 1 byte per pixel formats, will have to CPU tile,
-               * which doesn't support super-tiling
-               */
-              util_format_get_blocksize(templat->format) > 1) {
+              etna_resource_hw_tileable(screen->specs.use_blt, templat)) {
       layout |= ETNA_LAYOUT_BIT_SUPER;
    }
 
@@ -468,6 +464,7 @@ etna_resource_destroy(struct pipe_screen *pscreen, struct pipe_resource *prsc)
    struct etna_resource *rsc = etna_resource(prsc);
 
    assert(!_mesa_set_next_entry(rsc->pending_ctx, NULL));
+   _mesa_set_destroy(rsc->pending_ctx, NULL);
 
    if (rsc->bo)
       etna_bo_del(rsc->bo);
@@ -498,7 +495,6 @@ etna_resource_from_handle(struct pipe_screen *pscreen,
    struct etna_resource *rsc;
    struct etna_resource_level *level;
    struct pipe_resource *prsc;
-   struct pipe_resource *ptiled = NULL;
 
    DBG("target=%d, format=%s, %ux%ux%u, array_size=%u, last_level=%u, "
        "nr_samples=%u, usage=%u, bind=%x, flags=%x",
@@ -572,8 +568,6 @@ etna_resource_from_handle(struct pipe_screen *pscreen,
 
 fail:
    etna_resource_destroy(pscreen, prsc);
-   if (ptiled)
-      etna_resource_destroy(pscreen, ptiled);
 
    return NULL;
 }