[igt-dev] [PATCH i-g-t 1/8] lib/igt_fb: Add igt_put_cairo_ctx as counter to igt_get_cairo_ctx

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Mon Jan 29 17:01:37 UTC 2018


Op 25-01-18 om 12:43 schreef Mika Kahola:
> On Wed, 2018-01-24 at 13:26 +0100, Maarten Lankhorst wrote:
>> Hey,
>>
>> Op 23-01-18 om 16:50 schreef Ville Syrjälä:
>>> On Tue, Jan 23, 2018 at 01:56:35PM +0100, Maarten Lankhorst wrote:
>>>> This will allow support for NV12 in the future, where
>>>> igt_get_cairo_ctx
>>>> will return a RGB image to draw with, which will be converted in
>>>> igt_put_cairo_ctx so tests don't have to add special support for
>>>> NV12.
>>> Why do we need a special funciton? As in, can't you just do it the
>>> same as we handle the gtt vs. blit stuff?
>>>
>> The cairo_destroy() call will do the actual conversion back, but with
>> this helper we can
>> actually check that every call to get() is followed by a put() and
>> errors are consistently
>> checked. Not all callers have both, so I felt it better to put it in
>> the core..
> From the naming convention point of view, I would use set() instead of
> put() as we have a get() as counterpart.
Lot of places using get() to acquire a ref, put() to release it. So I think it makes sense..

~Maarten


More information about the igt-dev mailing list