diff --git a/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt b/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt index 6d4fb1a24c6..05303e0a374 100644 --- a/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt +++ b/src/gallium/drivers/crocus/ci/crocus-hsw-fails.txt @@ -39,9 +39,6 @@ spec@!opengl 1.1@linestipple@Factor 3x,Fail spec@!opengl 1.1@linestipple@Line loop,Fail spec@!opengl 1.1@linestipple@Line strip,Fail -# max-texture-size: ../src/gallium/drivers/crocus/crocus_resource.c:693: crocus_resource_create_with_modifiers: Assertion `isl_surf_created_successfully' failed. -spec@!opengl 1.1@max-texture-size,Crash - spec@!opengl 3.0@clearbuffer-bug,Fail # "../src/mesa/state_tracker/st_cb_texture.c:1164:st_get_blit_mask: Assertion `0' failed." diff --git a/src/gallium/drivers/crocus/crocus_resource.c b/src/gallium/drivers/crocus/crocus_resource.c index 9d4336d3317..3ee44e7713a 100644 --- a/src/gallium/drivers/crocus/crocus_resource.c +++ b/src/gallium/drivers/crocus/crocus_resource.c @@ -254,6 +254,15 @@ crocus_resource_configure_main(const struct crocus_screen *screen, if (!isl_surf_init_s(&screen->isl_dev, &res->surf, &init_info)) return false; + /* + * Don't create staging surfaces that will use > half the aperture + * since staging implies you are sending to another resource, + * which there is no way to fit both into aperture. + */ + if (templ->usage == PIPE_USAGE_STAGING) + if (res->surf.size_B > screen->aperture_threshold / 2) + return false; + res->internal_format = templ->format; return true; diff --git a/src/gallium/drivers/crocus/crocus_screen.c b/src/gallium/drivers/crocus/crocus_screen.c index 9e2a7004d42..2c23beeddd8 100644 --- a/src/gallium/drivers/crocus/crocus_screen.c +++ b/src/gallium/drivers/crocus/crocus_screen.c @@ -351,7 +351,7 @@ crocus_get_param(struct pipe_screen *pscreen, enum pipe_cap param) * flushing, etc. That's the big cliff apps will care about. */ const unsigned gpu_mappable_megabytes = - (screen->aperture_bytes * 3 / 4) / (1024 * 1024); + (screen->aperture_threshold) / (1024 * 1024); const long system_memory_pages = sysconf(_SC_PHYS_PAGES); const long system_page_size = sysconf(_SC_PAGE_SIZE); @@ -743,6 +743,7 @@ crocus_screen_create(int fd, const struct pipe_screen_config *config) p_atomic_set(&screen->refcount, 1); screen->aperture_bytes = get_aperture_size(fd); + screen->aperture_threshold = screen->aperture_bytes * 3 / 4; driParseConfigFiles(config->options, config->options_info, 0, "crocus", NULL, NULL, NULL, 0, NULL, 0); diff --git a/src/gallium/drivers/crocus/crocus_screen.h b/src/gallium/drivers/crocus/crocus_screen.h index 38e392e75cb..c5b5a2c8df2 100644 --- a/src/gallium/drivers/crocus/crocus_screen.h +++ b/src/gallium/drivers/crocus/crocus_screen.h @@ -202,6 +202,7 @@ struct crocus_screen { } driconf; uint64_t aperture_bytes; + uint64_t aperture_threshold; struct intel_device_info devinfo; struct isl_device isl_dev;