Re: [Mesa-dev] [PATCH v4 1/2] gallium/winsys/kms: Fix possible leak in map/unmap.

2018-03-16 Thread Tomasz Figa
Hi Lepton, Please avoid top-posting in mailing lists in the future. It's against the netiquette. On Wed, Mar 14, 2018 at 10:20 AM, Lepton Wu wrote: [Message moved to bottom] > On Tue, Mar 13, 2018 at 8:41 AM, Emil Velikov > wrote: >> On 13 March

Re: [Mesa-dev] [PATCH v4 1/2] gallium/winsys/kms: Fix possible leak in map/unmap.

2018-03-13 Thread Lepton Wu
I am fine to add ref count for map pointer but then the code looks a little complex: We already have ref count for display target, and it seems most other drivers don't have a ref count for map pointer. (I checked dri_sw_displaytarget_map / gdi_sw_displaytarget_map/hgl_winsys_displaytarget_map

Re: [Mesa-dev] [PATCH v4 1/2] gallium/winsys/kms: Fix possible leak in map/unmap.

2018-03-13 Thread Emil Velikov
On 13 March 2018 at 11:46, Tomasz Figa wrote: > On Thu, Mar 8, 2018 at 7:39 AM, Lepton Wu wrote: >> If user calls map twice for kms_sw_displaytarget, the first mapped >> buffer could get leaked. Instead of calling mmap every time, just >> reuse previous

Re: [Mesa-dev] [PATCH v4 1/2] gallium/winsys/kms: Fix possible leak in map/unmap.

2018-03-13 Thread Tomasz Figa
On Thu, Mar 8, 2018 at 7:39 AM, Lepton Wu wrote: > If user calls map twice for kms_sw_displaytarget, the first mapped > buffer could get leaked. Instead of calling mmap every time, just > reuse previous mapping. Since user could map same displaytarget with > different flags,

Re: [Mesa-dev] [PATCH v4 1/2] gallium/winsys/kms: Fix possible leak in map/unmap.

2018-03-13 Thread Tomasz Figa
On Tue, Mar 13, 2018 at 3:10 AM, Emil Velikov wrote: > On 12 March 2018 at 17:45, Lepton Wu wrote: >> Ping. Any more comments or missing stuff to get this commited into master? >> > As things have changed a bit (the original map/unmap behaviour is

Re: [Mesa-dev] [PATCH v4 1/2] gallium/winsys/kms: Fix possible leak in map/unmap.

2018-03-12 Thread Emil Velikov
On 12 March 2018 at 17:45, Lepton Wu wrote: > Ping. Any more comments or missing stuff to get this commited into master? > As things have changed a bit (the original map/unmap behaviour is preserved) I was hoping that Tomasz will give it another look. If he prefers, I could

Re: [Mesa-dev] [PATCH v4 1/2] gallium/winsys/kms: Fix possible leak in map/unmap.

2018-03-12 Thread Lepton Wu
Ping. Any more comments or missing stuff to get this commited into master? Thanks. On Wed, Mar 7, 2018 at 2:39 PM, Lepton Wu wrote: > If user calls map twice for kms_sw_displaytarget, the first mapped > buffer could get leaked. Instead of calling mmap every time, just >

[Mesa-dev] [PATCH v4 1/2] gallium/winsys/kms: Fix possible leak in map/unmap.

2018-03-07 Thread Lepton Wu
If user calls map twice for kms_sw_displaytarget, the first mapped buffer could get leaked. Instead of calling mmap every time, just reuse previous mapping. Since user could map same displaytarget with different flags, we have to keep two different pointers, one for rw mapping and one for ro