Re: Fwd: cairo_paint() with GPU Buffer
Abimathi Natarajan <[email protected]> Mon, 11 Feb 2019 16:20:19 +0530
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAPxWy4is5sN50gYzMAX+dZ1qswqgbn3oj=zmaqw9FUCQKmjGGg@mail.gmail.com> |
Hi, I have tried using "av_hwframe_transfer_data()" API in FFMPEG to transfer GPU memory to CPU which takes approximately 16ms for a 4k frame and then passing that memory to cariro_image_surface_create_for_data(). However, to improve the performance of my code I need to use this GPU buffer directly. Is there a way to make cairo_paint() work faster with uncached memory? Thanks. On Mon, Feb 11, 2019, 1:37 ON Uli Schlachter <[email protected]> wrote: > Hi, > > On 11.02.19 08:11, Abimathi Natarajan wrote: > [...] > > The above command will decode the input file (input.mp4) with > > hardware accelerations(vaapi) and hwmap will directly map the hardware > > frames to system memory. > [...] > > - I will directly feed this memory to > > > > cairo_image_surface_create_for_data ((unsigned char > > *)buffer, CAIRO_FORMAT_ARGB32,width, height, stride) to create a > > cairo_surface for the given frame. > > From the information you provided, I can only make a guess. My guess is > that CPU access to the buffer in GPU memory is uncached and thus slow. > > You could try copying the image to a buffer in main memory and using > that copy for cariro_image_surface_create_for_data(). That way > cairo/pixman get to operate on cached memory. > > Cheers, > Uli > -- > "Are you preparing for another war, Plutarch?" I ask. > "Oh, not now. Now we're in that sweet period where > everyone agrees that our recent horrors should never > be repeated," he says. > -- cairo mailing list [email protected] https://lists.cairographics.org/mailman/listinfo/cairo