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

Mika Kahola mika.kahola at intel.com
Thu Jan 25 11:43:01 UTC 2018


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.

> 
> ~Maarten
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
-- 
Mika Kahola - Intel OTC



More information about the igt-dev mailing list