[Mesa-dev,1/2] st/dri: don't use _ctx in client_wait_sync

Submitted by Albert Freeman on Sept. 27, 2015, 6:02 a.m.

Details

Message ID CAHD8uZM_3eyTh6fUSH3aE=t3hSEQ+bh5XV4FWH_9dfTTahz=iw@mail.gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Albert Freeman Sept. 27, 2015, 6:02 a.m.
On 25 September 2015 at 23:49, Marek Olšák <maraeo@gmail.com> wrote:
> From: Marek Olšák <marek.olsak@amd.com>
>
> Not needed and it can be NULL.
>
> Cc: 10.6 11.0 <mesa-stable@lists.freedesktop.org>
> ---
>  src/gallium/state_trackers/dri/dri2.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
> index 91b4431..ab940e4 100644
> --- a/src/gallium/state_trackers/dri/dri2.c
> +++ b/src/gallium/state_trackers/dri/dri2.c
> @@ -1293,6 +1293,7 @@ dri2_load_opencl_interop(struct dri_screen *screen)
>  }
>
>  struct dri2_fence {
> +   struct dri_screen *driscreen;
>     struct pipe_fence_handle *pipe_fence;
>     void *cl_event;
>  };
> @@ -1313,6 +1314,7 @@ dri2_create_fence(__DRIcontext *_ctx)
>        return NULL;
>     }
>
> +   fence->driscreen = dri_screen(_ctx->driScreenPriv);
>     return fence;
>  }
>
> @@ -1360,9 +1362,9 @@ static GLboolean
>  dri2_client_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags,
>                        uint64_t timeout)
>  {
> -   struct dri_screen *driscreen = dri_screen(_ctx->driScreenPriv);
> -   struct pipe_screen *screen = driscreen->base.screen;
>     struct dri2_fence *fence = (struct dri2_fence*)_fence;
> +   struct dri_screen *driscreen = fence->driscreen;
> +   struct pipe_screen *screen = driscreen->base.screen;
>
>     /* No need to flush. The context was flushed when the fence was created. */
>
> --
> 2.1.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
I think this is required (it is applied on top of your patch against mesa git):





otherwise
Reviewed-by: Albert Freeman <albertwdfreeman@gmail.com>

Patch hide | download patch | download mbox

diff --git a/src/gallium/state_trackers/dri/dri2.c
b/src/gallium/state_trackers/dri/dri2.c
index ab940e4..712203b 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1338,6 +1338,7 @@  dri2_get_fence_from_cl_event(__DRIscreen
*_screen, intptr_t cl_event)
       return NULL;
    }

+   fence->driscreen = driscreen;
    return fence;
 }

Comments

On Sun, Sep 27, 2015 at 8:02 AM, Albert Freeman
<albertwdfreeman@gmail.com> wrote:
> On 25 September 2015 at 23:49, Marek Olšák <maraeo@gmail.com> wrote:
>> From: Marek Olšák <marek.olsak@amd.com>
>>
>> Not needed and it can be NULL.
>>
>> Cc: 10.6 11.0 <mesa-stable@lists.freedesktop.org>
>> ---
>>  src/gallium/state_trackers/dri/dri2.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
>> index 91b4431..ab940e4 100644
>> --- a/src/gallium/state_trackers/dri/dri2.c
>> +++ b/src/gallium/state_trackers/dri/dri2.c
>> @@ -1293,6 +1293,7 @@ dri2_load_opencl_interop(struct dri_screen *screen)
>>  }
>>
>>  struct dri2_fence {
>> +   struct dri_screen *driscreen;
>>     struct pipe_fence_handle *pipe_fence;
>>     void *cl_event;
>>  };
>> @@ -1313,6 +1314,7 @@ dri2_create_fence(__DRIcontext *_ctx)
>>        return NULL;
>>     }
>>
>> +   fence->driscreen = dri_screen(_ctx->driScreenPriv);
>>     return fence;
>>  }
>>
>> @@ -1360,9 +1362,9 @@ static GLboolean
>>  dri2_client_wait_sync(__DRIcontext *_ctx, void *_fence, unsigned flags,
>>                        uint64_t timeout)
>>  {
>> -   struct dri_screen *driscreen = dri_screen(_ctx->driScreenPriv);
>> -   struct pipe_screen *screen = driscreen->base.screen;
>>     struct dri2_fence *fence = (struct dri2_fence*)_fence;
>> +   struct dri_screen *driscreen = fence->driscreen;
>> +   struct pipe_screen *screen = driscreen->base.screen;
>>
>>     /* No need to flush. The context was flushed when the fence was created. */
>>
>> --
>> 2.1.4
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> I think this is required (it is applied on top of your patch against mesa git):
>
> diff --git a/src/gallium/state_trackers/dri/dri2.c
> b/src/gallium/state_trackers/dri/dri2.c
> index ab940e4..712203b 100644
> --- a/src/gallium/state_trackers/dri/dri2.c
> +++ b/src/gallium/state_trackers/dri/dri2.c
> @@ -1338,6 +1338,7 @@ dri2_get_fence_from_cl_event(__DRIscreen
> *_screen, intptr_t cl_event)
>        return NULL;
>     }
>
> +   fence->driscreen = driscreen;
>     return fence;
>  }

Thanks, I've added your change into my commit.

Marek