[Mesa-dev] [PATCH RFC] clover: clone pipe-resource if root-buffer already exists

Francisco Jerez currojerez at riseup.net
Fri Mar 3 22:45:17 UTC 2017


Jan Vesely <jan.vesely at rutgers.edu> writes:

> Fixes cl-api-enqueue-read_write-buffer on carrizo+topaz machine
>
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
> I'm not sure if cloning is the right thigh to do.
> Should we copy the pointer and increase ref count instead?
>
> PS: the assert did not trigger despite building mesa with --enable-debug
>
> Jan
>
>  src/gallium/state_trackers/clover/core/resource.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/core/resource.cpp b/src/gallium/state_trackers/clover/core/resource.cpp
> index 06fd3f6..71414f4 100644
> --- a/src/gallium/state_trackers/clover/core/resource.cpp
> +++ b/src/gallium/state_trackers/clover/core/resource.cpp
> @@ -172,7 +172,7 @@ root_resource::root_resource(clover::device &dev, memory_obj &obj,
>  root_resource::root_resource(clover::device &dev, memory_obj &obj,
>                               root_resource &r) :
>     resource(dev, obj) {
> -   assert(0); // XXX -- resource shared among dev and r.dev
> +   pipe = dev.pipe->resource_create(dev.pipe, r.pipe);

AFAIK this doesn't actually create a resource shared among the two
devices, which is what you need here.

>  }
>  
>  root_resource::~root_resource() {
> -- 
> 2.9.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170303/57f3385e/attachment.sig>


More information about the mesa-dev mailing list