Re: [Mesa-dev] [PATCH] pb_bufmgr_cache: flush cache when create_buffer fails and try again
- Original Message - On Sat, Oct 8, 2011 at 1:44 AM, Jose Fonseca jfons...@vmware.com wrote: - Original Message - NOTE: This is a candidate for the stable branches. --- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 58721c0..0e6896a 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -324,6 +324,13 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, return NULL; buf-buffer = mgr-provider-create_buffer(mgr-provider, size, desc); This looks OK, but shouldn't we try flushing the cache first (i.e., invoke pb_cache_manager_flush) before flushing the inner buffer manager? That's what the patch does. mgr-base.flush is equal to pb_cache_manager_flush, but the function is declared later in the code, so I called it this way. I was mixing up mgr-base with mgr-provider. Looks good Marek. Jose ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] pb_bufmgr_cache: flush cache when create_buffer fails and try again
NOTE: This is a candidate for the stable branches. --- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 58721c0..0e6896a 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -324,6 +324,13 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, return NULL; buf-buffer = mgr-provider-create_buffer(mgr-provider, size, desc); + + /* Empty the cache and try again. */ + if (!buf-buffer) { + mgr-base.flush(mgr-base); + buf-buffer = mgr-provider-create_buffer(mgr-provider, size, desc); + } + if(!buf-buffer) { FREE(buf); return NULL; -- 1.7.4.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] pb_bufmgr_cache: flush cache when create_buffer fails and try again
- Original Message - NOTE: This is a candidate for the stable branches. --- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 58721c0..0e6896a 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -324,6 +324,13 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, return NULL; buf-buffer = mgr-provider-create_buffer(mgr-provider, size, desc); This looks OK, but shouldn't we try flushing the cache first (i.e., invoke pb_cache_manager_flush) before flushing the inner buffer manager? Jose + + /* Empty the cache and try again. */ + if (!buf-buffer) { + mgr-base.flush(mgr-base); + buf-buffer = mgr-provider-create_buffer(mgr-provider, size, desc); + } + if(!buf-buffer) { FREE(buf); return NULL; -- 1.7.4.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] pb_bufmgr_cache: flush cache when create_buffer fails and try again
On Sat, Oct 8, 2011 at 1:44 AM, Jose Fonseca jfons...@vmware.com wrote: - Original Message - NOTE: This is a candidate for the stable branches. --- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 58721c0..0e6896a 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -324,6 +324,13 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, return NULL; buf-buffer = mgr-provider-create_buffer(mgr-provider, size, desc); This looks OK, but shouldn't we try flushing the cache first (i.e., invoke pb_cache_manager_flush) before flushing the inner buffer manager? That's what the patch does. mgr-base.flush is equal to pb_cache_manager_flush, but the function is declared later in the code, so I called it this way. Marek ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev