Re: [Linaro-mm-sig] Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-10 Thread Christian König
Hi Jeffy, Am 10.08.22 um 06:16 schrieb Chen Jeffy: Hi Christian, On 8/9 星期二 18:18, Christian König wrote: Hi Jeffy, [SNIP] Maybe cache the latest returned handle in the obj(after drm_gem_prime_fd_to_handle), and clear it when that handle been deleted in drm_gem_handle_delete()? That won't

Re: [Linaro-mm-sig] Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-09 Thread Chen Jeffy
Hi Christian, On 8/9 星期二 18:18, Christian König wrote: Hi Jeffy, Am 09.08.22 um 12:02 schrieb Chen Jeffy: Hi Christian, On 8/9 星期二 17:08, Christian König wrote: Hi Jeffy, Am 09.08.22 um 09:55 schrieb Christian König: [SNIP] So we are allowing GEM object to have multiple handles, and G

Re: [Linaro-mm-sig] Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-09 Thread Christian König
Hi Jeffy, Am 09.08.22 um 12:02 schrieb Chen Jeffy: Hi Christian, On 8/9 星期二 17:08, Christian König wrote: Hi Jeffy, Am 09.08.22 um 09:55 schrieb Christian König: [SNIP] So we are allowing GEM object to have multiple handles, and GEM object could have at most one dma-buf, doesn't that m

Re: [Linaro-mm-sig] Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-09 Thread Chen Jeffy
Hi Christian, On 8/9 星期二 17:08, Christian König wrote: Hi Jeffy, Am 09.08.22 um 09:55 schrieb Christian König: [SNIP] So we are allowing GEM object to have multiple handles, and GEM object could have at most one dma-buf, doesn't that means that dma-buf could map to multiple handles? N

Re: [Linaro-mm-sig] Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-09 Thread Christian König
Hi Jeffy, Am 09.08.22 um 09:55 schrieb Christian König: [SNIP] So we are allowing GEM object to have multiple handles, and GEM object could have at most one dma-buf, doesn't that means that dma-buf could map to multiple handles? No, at least not for the same GEM file private. That's the

Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-09 Thread Chen Jeffy
Hi Christian, On 8/9 星期二 15:55, Christian König wrote: Am 09.08.22 um 03:28 schrieb Chen Jeffy: Hi Christian, On 8/9 星期二 2:03, Christian König wrote: Hi Jeffy, Am 08.08.22 um 05:51 schrieb Chen Jeffy: Hi Christian, Thanks for your reply, and sorry i didn't make it clear. On 8/8 星期一 0:52,

Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-09 Thread Christian König
Am 09.08.22 um 03:28 schrieb Chen Jeffy: Hi Christian, On 8/9 星期二 2:03, Christian König wrote: Hi Jeffy, Am 08.08.22 um 05:51 schrieb Chen Jeffy: Hi Christian, Thanks for your reply, and sorry i didn't make it clear. On 8/8 星期一 0:52, Christian König wrote: Am 03.08.22 um 10:32 schrieb Jeff

Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-08 Thread Chen Jeffy
Hi Christian, On 8/9 星期二 2:03, Christian König wrote: Hi Jeffy, Am 08.08.22 um 05:51 schrieb Chen Jeffy: Hi Christian, Thanks for your reply, and sorry i didn't make it clear. On 8/8 星期一 0:52, Christian König wrote: Am 03.08.22 um 10:32 schrieb Jeffy Chen: Currently we are assuming a one to

Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-08 Thread Christian König
Hi Jeffy, Am 08.08.22 um 05:51 schrieb Chen Jeffy: Hi Christian, Thanks for your reply, and sorry i didn't make it clear. On 8/8 星期一 0:52, Christian König wrote: Am 03.08.22 um 10:32 schrieb Jeffy Chen: Currently we are assuming a one to one mapping between dmabuf and handle when releasing

Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-07 Thread Chen Jeffy
Hi Christian, Thanks for your reply, and sorry i didn't make it clear. On 8/8 星期一 0:52, Christian König wrote: Am 03.08.22 um 10:32 schrieb Jeffy Chen: Currently we are assuming a one to one mapping between dmabuf and handle when releasing GEM handles. But that is not always true, since we wo

Re: [PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-07 Thread Christian König
Am 03.08.22 um 10:32 schrieb Jeffy Chen: Currently we are assuming a one to one mapping between dmabuf and handle when releasing GEM handles. But that is not always true, since we would create extra handles for the GEM obj in cases like gem_open() and getfb{,2}(). A similar issue was reported a

[PATCH v2] drm/gem: Fix GEM handle release errors

2022-08-03 Thread Jeffy Chen
Currently we are assuming a one to one mapping between dmabuf and handle when releasing GEM handles. But that is not always true, since we would create extra handles for the GEM obj in cases like gem_open() and getfb{,2}(). A similar issue was reported at: https://lore.kernel.org/all/202111050833