[Mesa-dev] [PATCH] clover: Destory pipe_screen when device does not support compute v2

Francisco Jerez currojerez at riseup.net
Thu May 8 11:47:39 PDT 2014


Tom Stellard <thomas.stellard at amd.com> writes:

> v2:
>   - Make sure screen was successfully created before destroying it.

Thanks,
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

> ---
>  src/gallium/state_trackers/clover/core/device.cpp | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
> index 2f84677..bc3e3e6 100644
> --- a/src/gallium/state_trackers/clover/core/device.cpp
> +++ b/src/gallium/state_trackers/clover/core/device.cpp
> @@ -42,8 +42,11 @@ namespace {
>  device::device(clover::platform &platform, pipe_loader_device *ldev) :
>     platform(platform), ldev(ldev) {
>     pipe = pipe_loader_create_screen(ldev, PIPE_SEARCH_DIR);
> -   if (!pipe || !pipe->get_param(pipe, PIPE_CAP_COMPUTE))
> +   if (!pipe || !pipe->get_param(pipe, PIPE_CAP_COMPUTE)) {
> +      if (pipe)
> +         pipe->destroy(pipe);
>        throw error(CL_INVALID_DEVICE);
> +   }
>  }
>  
>  device::~device() {
> -- 
> 1.8.1.5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140508/8cccc01c/attachment.sig>


More information about the mesa-dev mailing list