[Mesa-dev] [PATCH 2/3] st/dri: cleanup image_from_fd/dma_buf paths

Stanimir Varbanov stanimir.varbanov at linaro.org
Tue May 17 07:39:57 UTC 2016


Hi Emil,

Thanks for the comments.

On 05/16/2016 11:04 PM, Emil Velikov wrote:
> On 16 May 2016 at 19:43, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> Hi Stanimir,
>>
>> On 15 May 2016 at 12:34, Stanimir Varbanov <stanimir.varbanov at linaro.org> wrote:
>>> Signed-off-by: Stanimir Varbanov <stanimir.varbanov at linaro.org>
>>> ---
>>>  src/gallium/state_trackers/dri/dri2.c | 75 ++++++++++++++++++-----------------
>>>  1 file changed, 39 insertions(+), 36 deletions(-)
>>>
>>> diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
>>> index 8ace842b74b8..78b1b86515e0 100644
>>> --- a/src/gallium/state_trackers/dri/dri2.c
>>> +++ b/src/gallium/state_trackers/dri/dri2.c
>>> @@ -832,21 +832,43 @@ dri2_create_image_from_name(__DRIscreen *_screen,
>>>
>>>  static __DRIimage *
>>>  dri2_create_image_from_fd(__DRIscreen *_screen,
>>> -                          int width, int height, int format,
>>> -                          int fd, int stride, void *loaderPrivate)
>>> +                          int width, int height, int fourcc,
>>> +                          int *fds, int num_fds, int *strides,
>>> +                          int *offsets, unsigned *error,
>>
>> This patch folds the duplicated checks prior to calling
>> dri2_create_image_from_fd() within the function although it adds a
>> set-but-unused variable error.  I'd either add a comment in the
>> summary about it, or just introduce it where it's needed.
>>
> Actually I misread things and "error" is unused only in one of the two
> cases. Still adding a trivial note would be nice imho.

You are right, the *error is unused in dri2_from_fds case. I can add a
check for NULL pointer in dri2_create_image_from_fd and call it from
dri2_from_fds case with NULL pointer for *error argument?

-- 
regards,
Stan


More information about the mesa-dev mailing list