[Mesa-dev] [PATCH v3 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

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

2018-03-07 Thread Lepton Wu
OK, I will send out a new version which omit unmap in dt_destory. Any way, even we need this code, it could be a separate patch. On Wed, Mar 7, 2018 at 7:14 AM, Emil Velikov wrote: > On 6 March 2018 at 22:43, Lepton Wu wrote: >> If user calls map

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

2018-03-07 Thread Lepton Wu
I misunderstanding your point, now I got it and will do more test to see if removing this hunk will cause some issue in some cases of multi plane code path. Thanks. On Wed, Mar 7, 2018 at 10:14 AM, Lepton Wu wrote: > Actually the reason why I need this CL: > > In multi plane

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

2018-03-07 Thread Lepton Wu
Actually the reason why I need this CL: In multi plane patch I'd like to only mmap once for different planes of same buffer. So actually I need some way to reuse same mmap for different planes. Then it's natural to have this CL. The fix to leak is a side effect of this CL. dt_unmap still works

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

2018-03-07 Thread Emil Velikov
On 6 March 2018 at 22:43, 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, we