[Bug 773473] kmssink: support display mode setting

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Nov 9 13:35:44 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=773473

--- Comment #33 from Michael Tretter <m.tretter at pengutronix.de> ---
(In reply to Víctor Manuel Jáquez Leal from comment #32)
> (In reply to Michael Tretter from comment #30)
> > (In reply to Víctor Manuel Jáquez Leal from comment #29)
> > > ::: sys/kms/gstkmsallocator.c
> > > @@ +335,3 @@
> > >    kmsmem = (GstKMSMemory *) mem;
> > >    if (kmsmem->bo)
> > > +    kmsmem->bo->refs--;
> > > 
> > > did you forget to unmap the bo when refs == 0?
> > 
> > The buffer object is unmapped and destroyed in
> > gst_kms_allocator_memory_reset.
> 
> I'm not sure about this approach. I would unmap when the map_counter reach
> zero, otherwise a bad code could unmap forever.
> gst_kms_allocator_memory_reset() should force the unmap, if is still mapped
> with a g_warning message, and then destroy the dumb buffer.

I used the same approach as implemented in libkms. I remember some problems
with unmapping when the map_counter is zero, but right not, it seems to work
fine. I will do some more testing and update the patch.

> Also, I'm wondering if we should add mutexes when mapping-unmapping if there
> are threads using the buffers. But that could go in other patch.

I had the same question. As libkms didn't use mutexes for the reference
counter, I didn't use mutexes, but it sounds like a good idea.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list