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

2022-08-19 Thread Jeffy Chen
/20211105083308.392156-1-jay...@rock-chips.com/ Another problem is that the imported dmabuf might not always have gem_obj->dma_buf set, which would cause leaks in drm_gem_remove_prime_handles(). Let's fix these for now by using handle to find the exact map to remove. Signed-off-by: Jeffy Chen

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

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 ha

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 星期一

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

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

2022-08-08 Thread Chen Jeffy
Hi Christian, Sorry, i've sent a v2 before, please check that. On 8/9 星期二 2:05, Christian König wrote: Am 02.08.22 um 13:33 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

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, sin

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

2022-08-03 Thread Jeffy Chen
x24 Let's fix these by using handle to find the exact map to remove. Signed-off-by: Jeffy Chen --- Changes in v2: Fix a typo of rbtree. drivers/gpu/drm/drm_gem.c | 17 + drivers/gpu/drm/drm_internal.h | 4 ++-- drivers/gpu/drm/drm_prime.c| 20

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

2022-08-02 Thread Jeffy Chen
x24 Let's fix these by using handle to find the exact map to remove. Signed-off-by: Jeffy Chen --- drivers/gpu/drm/drm_gem.c | 17 + drivers/gpu/drm/drm_internal.h | 4 ++-- drivers/gpu/drm/drm_prime.c| 16 ++-- 3 files changed, 13 insertions(+), 24 d

[PATCH] drm/bridge/synopsys: dw-hdmi: Fix memleak in __dw_hdmi_remove

2018-03-04 Thread Jeffy Chen
5c [<0e17cd06>] platform_device_register_full+0x64/0x108 [<418a0882>] __dw_hdmi_probe+0xb9c/0xcc0 [<e0b720fd>] dw_hdmi_bind+0x30/0x88 [<9af347f6>] dw_hdmi_rockchip_bind+0x260/0x2e8 Signed-off-by: Jeffy Chen --- drivers/gpu/drm/brid

[PATCH] drm/rockchip: vop: Init vskiplines in scl_vop_cal_scale()

2018-02-22 Thread Jeffy Chen
Currently we are calling scl_vop_cal_scale() to get vskiplines for yrgb and cbcr. So the cbcr's vskiplines might be an unexpected value if the second scl_vop_cal_scale() didn't update it. Init vskiplines in scl_vop_cal_scale() to avoid that. Signed-off-by: Jeffy Chen --- drive

Re: [PATCH v6 03/10] drm/bridge: analogix: Do not use device's drvdata

2017-10-20 Thread jeffy
Hi Sean, On 10/21/2017 12:52 AM, Sean Paul wrote: On Thu, Oct 19, 2017 at 11:48:05AM +0800, Jeffy Chen wrote: This patch has somehow lost it's original author. I assume this is not intentional. oops, sorry, guess i used some wrongly command during the rebasing... will fix

Re: [PATCH] drm/rockchip: Fix build warning in analogix_dp-rockchip.c

2017-10-20 Thread jeffy
iable ‘ret’ [-Wunused-variable] int ret; ^~~ sorry, i thought i fixed that, but it looks like i amended it to the wrong commit by mistake... Fixes: 102712a32ff5 ("drm/rockchip: analogix_dp: Remove unnecessary init code") Cc: Jeffy Chen Cc: Mark Yao Cc: Sean Paul Cc: Hei

[PATCH v6 09/10] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata

2017-10-18 Thread Jeffy Chen
Let plat drivers own the drvdata, so that they could cleanup resources in their unbind(). Signed-off-by: Jeffy Chen Reviewed-by: Neil Armstrong --- Changes in v6: None Changes in v5: None drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 43 ++--- drivers/gpu/drm/imx

[PATCH v6 10/10] drm/rockchip: dw_hdmi: Fix error handling path

2017-10-18 Thread Jeffy Chen
Add missing clk_disable_unprepare() in bind()'s error handling path and unbind(). Also inline clk_prepare_enable() with bind(). Fixes: 12b9f204e804 ("drm: bridge/dw_hdmi: add rockchip rk3288 support") Signed-off-by: Jeffy Chen --- Changes in v6: None Changes in v5: Add disable t

[PATCH v6 05/10] drm/rockchip: analogix_dp: Add a sanity check for rockchip_drm_psr_register()

2017-10-18 Thread Jeffy Chen
The rockchip_drm_psr_register() can fail, so add a sanity check for that. Also reorder the calls in unbind() to match bind(). Signed-off-by: Jeffy Chen --- Changes in v6: None Changes in v5: None drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 15 +++ 1 file changed, 11

[PATCH v6 06/10] drm/rockchip: dw-mipi-dsi: Fix error handling path

2017-10-18 Thread Jeffy Chen
Add missing pm_runtime_disable() in bind()'s error handling path. Also cleanup encoder & connector in unbind(). Fixes: 80a9a059d4e4 ("drm/rockchip/dsi: add dw-mipi power domain support") Signed-off-by: Jeffy Chen --- Changes in v6: None Changes in v5: Call the destro

[PATCH v6 07/10] drm/rockchip: inno_hdmi: Fix error handling path

2017-10-18 Thread Jeffy Chen
Add missing error handling in bind(). Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support") Signed-off-by: Jeffy Chen --- Changes in v6: None Changes in v5: Call the destroy hook in the error handling path like in unbind(). Update cleanup order in unbind(). drive

[PATCH v6 03/10] drm/bridge: analogix: Do not use device's drvdata

2017-10-18 Thread Jeffy Chen
practice and in fact has led to many bugs in this driver. Let's clean up this mess and change Analogix entry points to simply accept some opaque struct pointer, adjusting their users at the same time to avoid breaking the compilation. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen Review

[PATCH v6 02/10] drm/rockchip: analogix_dp: Remove unnecessary init code

2017-10-18 Thread Jeffy Chen
Remove unnecessary init code, since we would do it in the power_on() callback. Also move of parse code to probe(). Fixes: 9e32e16e9e98 ("drm: rockchip: dp: add rockchip platform dp driver") Signed-off-by: Jeffy Chen --- Changes in v6: None Changes in v5: None drivers/gpu/dr

[PATCH v6 08/10] drm/bridge/synopsys: dw-hdmi: Add missing bridge detach

2017-10-18 Thread Jeffy Chen
We inited connector in attach(), so need a detach() to cleanup. Also fix wrong use of dw_hdmi_remove() in bind(). Signed-off-by: Jeffy Chen --- Changes in v6: None Changes in v5: None drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion

[PATCH v6 04/10] drm/bridge: analogix_dp: Fix connector and encoder cleanup

2017-10-18 Thread Jeffy Chen
Since we are initing connector in the core driver and encoder in the plat driver, let's clean them up in the right places. Signed-off-by: Jeffy Chen Reviewed-by: Andrzej Hajda --- Changes in v6: Don't change order of rockchip_drm_psr_register(). Changes in v5: None drivers/gpu/

[PATCH v6 00/10] rockchip: kevin: Enable edp display

2017-10-18 Thread Jeffy Chen
hook in the error handling path like in unbind(). Update cleanup order in unbind(). Add disable to unbind(), and inline clk_prepare_enable() with bind(). Jeffy Chen (10): arm64: dts: rockchip: Enable edp disaplay on kevin drm/rockchip: analogix_dp: Remove unnecessary init code drm/bridge: ana

Re: [RFC PATCH v4 4/8] drm/rockchip: dw_hdmi: Fix error handling path

2017-10-18 Thread jeffy
Hi Sean, Thanks for your review. On 10/18/2017 02:10 AM, Sean Paul wrote: On Tue, Oct 17, 2017 at 06:16:20PM +0800, Jeffy Chen wrote: >Add missing clk_disable_unprepare() in bind()'s error handling path. This also isn't disabled in unbind(), is that intentional? i wasn'

[PATCH v5 8/9] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata

2017-10-18 Thread Jeffy Chen
Let plat drivers own the drvdata, so that they could cleanup resources in their unbind(). Signed-off-by: Jeffy Chen --- Changes in v5: None drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 43 ++--- drivers/gpu/drm/imx/dw_hdmi-imx.c | 22 +-- drivers

[PATCH v5 9/9] drm/rockchip: dw_hdmi: Fix error handling path

2017-10-18 Thread Jeffy Chen
Add missing clk_disable_unprepare() in bind()'s error handling path and unbind(). Also inline clk_prepare_enable() with bind(). Fixes: 12b9f204e804 ("drm: bridge/dw_hdmi: add rockchip rk3288 support") Signed-off-by: Jeffy Chen --- Changes in v5: Add disable to unbin

[PATCH v5 6/9] drm/rockchip: inno_hdmi: Fix error handling path

2017-10-18 Thread Jeffy Chen
Add missing error handling in bind(). Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support") Signed-off-by: Jeffy Chen --- Changes in v5: Call the destroy hook in the error handling path like in unbind(). Update cleanup order in unbind(). drivers/gpu/drm/rockchip/i

[PATCH v5 7/9] drm/bridge/synopsys: dw-hdmi: Add missing bridge detach

2017-10-18 Thread Jeffy Chen
We inited connector in attach(), so need a detach() to cleanup. Also fix wrong use of dw_hdmi_remove() in bind(). Signed-off-by: Jeffy Chen --- Changes in v5: None drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH v5 2/9] drm/rockchip: analogix_dp: Remove unnecessary init code

2017-10-18 Thread Jeffy Chen
Remove unnecessary init code, since we would do it in the power_on() callback. Also move of parse code to probe(). Fixes: 9e32e16e9e98 ("drm: rockchip: dp: add rockchip platform dp driver") Signed-off-by: Jeffy Chen --- Changes in v5: None drivers/gpu/drm/rockchip/analogix_dp-rockc

[PATCH v5 0/9] rockchip: kevin: Enable edp display

2017-10-18 Thread Jeffy Chen
unbind(). Add disable to unbind(), and inline clk_prepare_enable() with bind(). Jeffy Chen (9): arm64: dts: rockchip: Enable edp disaplay on kevin drm/rockchip: analogix_dp: Remove unnecessary init code drm/bridge: analogix: Do not use device's drvdata drm/bridge: analogix_dp

[PATCH v5 5/9] drm/rockchip: dw-mipi-dsi: Fix error handling path

2017-10-18 Thread Jeffy Chen
Add missing pm_runtime_disable() in bind()'s error handling path. Also cleanup encoder & connector in unbind(). Fixes: 80a9a059d4e4 ("drm/rockchip/dsi: add dw-mipi power domain support") Signed-off-by: Jeffy Chen --- Changes in v5: Call the destroy hook in the error ha

[PATCH v5 4/9] drm/bridge: analogix_dp: Fix connector & encoder cleanup

2017-10-18 Thread Jeffy Chen
Since we are initing connector in the core driver and encoder in the plat driver, let's clean them up in the right places. Signed-off-by: Jeffy Chen --- Changes in v5: None drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 -- drivers/gpu/drm/exynos/exynos_dp.c

[PATCH v5 3/9] drm/bridge: analogix: Do not use device's drvdata

2017-10-18 Thread Jeffy Chen
practice and in fact has led to many bugs in this driver. Let's clean up this mess and change Analogix entry points to simply accept some opaque struct pointer, adjusting their users at the same time to avoid breaking the compilation. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen Review

[RFC PATCH v4 8/8] drm/rockchip: Add device links for master and components

2017-10-17 Thread Jeffy Chen
Since we are trying to access components' resources in the master's suspend/resume PM callbacks(e.g. panel), add device links to correct the suspend/resume and shutdown ordering. Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: None Changes in v2: Use device link to c

[RFC PATCH v4 4/8] drm/rockchip: dw_hdmi: Fix error handling path

2017-10-17 Thread Jeffy Chen
Add missing clk_disable_unprepare() in bind()'s error handling path. Fixes: 12b9f204e804 ("drm: bridge/dw_hdmi: add rockchip rk3288 support") Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: None Changes in v2: None drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c |

[RFC PATCH v4 6/8] drm/bridge/analogix: Do not use device's drvdata

2017-10-17 Thread Jeffy Chen
barely a good practice and in fact has led to many bugs in this driver. Let's clean up this mess and change Analogix entry points to simply accept some opaque struct pointer, adjusting their users at the same time to avoid breaking the compilation. Signed-off-by: Tomasz Figa Signed-off-by:

[RFC PATCH v4 5/8] drm/rockchip: inno_hdmi: Fix error handling path

2017-10-17 Thread Jeffy Chen
Add missing error handling in bind(). Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support") Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: None Changes in v2: None drivers/gpu/drm/rockchip/inno_hdmi.c | 20 1 file c

[RFC PATCH v4 0/8] rockchip: kevin: Enable edp display

2017-10-17 Thread Jeffy Chen
link to correct the suspend/resume and shutdown ordering, instead of converting rockchip spi's suspend/resume PM callbacks to late suspend/resume PM callbacks. Jeffy Chen (7): arm64: dts: rockchip: Enable edp disaplay on kevin drm/rockchip: analogix_dp: Fix error handling path drm/rockchi

[RFC PATCH v4 2/8] drm/rockchip: analogix_dp: Fix error handling path

2017-10-17 Thread Jeffy Chen
Add missing error handling in rockchip_dp_bind(). Fixes: 9e32e16e9e98 ("drm: rockchip: dp: add rockchip platform dp driver") Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: None Changes in v2: None drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 14

[RFC PATCH v4 3/8] drm/rockchip: dw-mipi-dsi: Fix error handling path

2017-10-17 Thread Jeffy Chen
Add missing pm_runtime_disable() in bind()'s error handling path. Also cleanup encoder & connector in unbind(). Fixes: 80a9a059d4e4 ("drm/rockchip/dsi: add dw-mipi power domain support") Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: None Changes in v2: Non

Re: [RESEND PATCH v2 2/5] backlight: pwm_bl: Add device link for pwm_bl and pwm

2017-10-17 Thread jeffy
Hi Brian, On 10/17/2017 07:57 AM, Brian Norris wrote: This is going to be a*lot* of churn throughout the tree, if we expect all resource consumers to do this. I think we'd want some kind of agreement from the PM maintainers and (larger) subsystem owners before going down this route... And in t

[RFC PATCH v3 2/5] drm/rockchip: Fix error handling path in rockchip_dp_bind()

2017-10-17 Thread Jeffy Chen
Add missing error handling in rockchip_dp_bind(). Fixes: 9e32e16e9e98 ("drm: rockchip: dp: add rockchip platform dp driver") Signed-off-by: Jeffy Chen --- Changes in v3: None Changes in v2: None drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 14 -- 1 file changed, 12

[RFC PATCH v3 5/5] drm/rockchip: Add device links for master and components

2017-10-17 Thread Jeffy Chen
Since we are trying to access components' resources in the master's suspend/resume PM callbacks(e.g. panel), add device links to correct the suspend/resume and shutdown ordering. Signed-off-by: Jeffy Chen --- Changes in v3: None Changes in v2: Use device link to correct the suspend/

[RFC PATCH v3 3/5] drm/bridge/analogix: Do not use device's drvdata

2017-10-17 Thread Jeffy Chen
barely a good practice and in fact has led to many bugs in this driver. Let's clean up this mess and change Analogix entry points to simply accept some opaque struct pointer, adjusting their users at the same time to avoid breaking the compilation. Signed-off-by: Tomasz Figa Signed-off-by:

[RFC PATCH v3 0/5] rockchip: kevin: Enable edp display

2017-10-17 Thread Jeffy Chen
shutdown ordering, instead of converting rockchip spi's suspend/resume PM callbacks to late suspend/resume PM callbacks. Jeffy Chen (4): arm64: dts: rockchip: Enable edp disaplay on kevin drm/rockchip: Fix error handling path in rockchip_dp_bind() pwm: Add dummy pwmchip for orphan pwms

[RESEND PATCH v2 5/5] drm/rockchip: Add device links for master and components

2017-10-16 Thread Jeffy Chen
Since we are trying to access components' resources in the master's suspend/resume PM callbacks(e.g. panel), add device links to correct the suspend/resume and shutdown ordering. Signed-off-by: Jeffy Chen --- Changes in v2: Use device link to correct the suspend/resume and shutdow

[RESEND PATCH v2 3/5] drm/rockchip: Fix error handling path in rockchip_dp_bind()

2017-10-16 Thread Jeffy Chen
Add missing error handling in rockchip_dp_bind(). Fixes: 9e32e16e9e98 ("drm: rockchip: dp: add rockchip platform dp driver") Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 14 -- 1 file changed, 12 insertions(+), 2

[RESEND PATCH v2 2/5] backlight: pwm_bl: Add device link for pwm_bl and pwm

2017-10-16 Thread Jeffy Chen
When the pwm driver is unbound, the pwm_bl driver would still hold a reference to that pwm, and crash the kernel later(if someone trying to access that invalid pwm). Add a device link to avoid this. Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/video/backlight/pwm_bl.c | 2 ++ 1

[RESEND PATCH v2 4/5] drm/bridge/analogix: Do not use device's drvdata

2017-10-16 Thread Jeffy Chen
barely a good practice and in fact has led to many bugs in this driver. Let's clean up this mess and change Analogix entry points to simply accept some opaque struct pointer, adjusting their users at the same time to avoid breaking the compilation. Signed-off-by: Tomasz Figa Signed-off-by:

[RESEND PATCH v2 0/5] rockchip: kevin: Enable edp display

2017-10-16 Thread Jeffy Chen
esume PM callbacks. Jeffy Chen (4): arm64: dts: rockchip: Enable edp disaplay on kevin backlight: pwm_bl: Add device link for pwm_bl and pwm drm/rockchip: Fix error handling path in rockchip_dp_bind() drm/rockchip: Add device links for master and components Tomasz Figa (1): drm/bridge/ana

[PATCH 0/5] rockchip: kevin: Enable edp display

2017-10-16 Thread Jeffy Chen
Make edp display works on chromebook kevin(at least for boot animation). Also solve some issues i meet during the bringup. Jeffy Chen (4): arm64: dts: rockchip: Enable edp disaplay on kevin backlight: pwm_bl: Add device link for pwm_bl and pwm drm/rockchip: Fix error handling path in

Re: [PATCH] drm/rockchip: Fix memory leak in rockchip_drm_sys_resume()

2017-10-08 Thread jeffy
Hi Sean, On 09/28/2017 11:16 AM, jeffy wrote: Hi Sean, On 09/28/2017 04:27 AM, Sean Paul wrote: >@@ -299,6 +300,7 @@ static int rockchip_drm_sys_resume(struct device *dev) > > priv = drm->dev_private; > drm_atomic_helper_resume(drm, priv->state); >+drm_

[PATCH v2] drm/atomic: Unref duplicated drm_atomic_state in drm_atomic_helper_resume()

2017-10-08 Thread Jeffy Chen
0x28/0x158 [] drm_atomic_helper_suspend+0x5c/0xf0 Problem here is that we are duplicating the drm_atomic_state in drm_atomic_helper_suspend(), but not unreference it in the resume path. Fixes: 1494276000db ("drm/atomic-helper: Implement subsystem-level suspend/resume") Signed-off-by: Jeffy Chen

Re: [PATCH] drm/rockchip: Fix memory leak in rockchip_drm_sys_resume()

2017-09-27 Thread jeffy
Hi Sean, On 09/28/2017 04:27 AM, Sean Paul wrote: >@@ -299,6 +300,7 @@ static int rockchip_drm_sys_resume(struct device *dev) > >priv = drm->dev_private; >drm_atomic_helper_resume(drm, priv->state); >+ drm_atomic_state_put(priv->state); Won't this be freed for you eventually in commit

[PATCH] drm/rockchip: Fix memory leak in rockchip_drm_sys_resume()

2017-09-27 Thread Jeffy Chen
Free the drm_atomic_state allocated by drm_atomic_helper_suspend(). Fixes: 5a5873830972 ("drm/rockchip: Use atomic PM helpers") Signed-off-by: Jeffy Chen --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/dr

Re: [v2] timers: Fix excessive granularity of new timers after a nohz idle

2017-08-23 Thread jeffy
Hi Thierry, i hit a compile error with this patch: CC drivers/gpu/drm/tegra/trace.o In file included from drivers/gpu/drm/tegra/trace.h:68:0, from drivers/gpu/drm/tegra/trace.c:2: ./include/trace/define_trace.h:88:43: fatal error: ./trace.h: No such file or directory co

Re: [v6,5/7] drm/rockchip: vop: add a series of vop support

2017-07-27 Thread jeffy
same structure, newer design vop will bigger then old one. Signed-off-by: Mark Yao Reviewed-by: Jeffy Chen ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [v6,4/7] drm/rockchip: vop: group vop registers

2017-07-27 Thread jeffy
Hi mark, On 07/26/2017 02:19 PM, Mark yao wrote: Grouping the vop registers facilitates make register definition clearer, and also is useful for different vop reuse the same group register. Signed-off-by: Mark Yao Reviewed-by: Jeffy Chen ___ dri

Re: [v6, 2/7] drm/rockchip: vop: move write_relaxed flags to vop register

2017-07-27 Thread jeffy
method that is inefficient, hardcode the write_relaxed flags to vop registers, then can only do synchronize write for those actual needed register. Signed-off-by: Mark Yao Tested-by: Heiko Stuebner Reviewed-by: Jeffy Chen ___ dri-devel mailing list dri

Re: [v6,7/7] drm/rockchip: vop: rk3328: fix overlay abnormal

2017-07-27 Thread jeffy
ing is the details for this register VOP_WIN0_CTRL2 bit[7:4] win_rid_win0_cbr axi read id of win0 cbr channel bit[3:0] win_rid_win0_yrgb axi read id of win0 yrgb channel Signed-off-by: Mark Yao Reviewed-by: Jeffy Chen ___ dri-dev

Re: [v6,1/7] drm/rockchip: vop: initialize registers directly

2017-07-27 Thread jeffy
e for difference chips. To make it clean, initialize registers directly, and drops init_table mechanism out. Signed-off-by: Mark Yao Tested-by: Heiko Stuebner Reviewed-by: Jeffy Chen ___ dri-devel mailing list dri-devel@lists.freedesktop.org

Re: drm: Add missing field copy in compat_drm_version

2017-07-12 Thread jeffy
c_len + 1); ... if (version->name_len) version->name[version->name_len] = '\0'; <-- crashed here, since the name_len would always be zero, so version->name would be nullptr. On 07/12/2017 02:18 PM, Jeffy Chen wrote: DRM_IOCTL_VERSION is supposed to updat

[PATCH] drm: Add missing field copy in compat_drm_version

2017-07-11 Thread Jeffy Chen
DRM_IOCTL_VERSION is supposed to update the name_len/date_len/desc_len fields to user. Fixes: 012c6741c6aa("switch compat_drm_version() to drm_ioctl_kernel()") Signed-off-by: Jeffy Chen --- drivers/gpu/drm/drm_ioc32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drive

Re: [PATCH v11] drm: Unplug drm device when unregistering it (v8)

2017-05-30 Thread jeffy
Hi Hans, thanx for investigating :) On 05/30/2017 03:06 PM, Hans de Goede wrote: Hi, On 29-05-17 22:25, Chris Wilson wrote: On Fri, Apr 14, 2017 at 11:15:04AM -0400, Sean Paul wrote: On Thu, Apr 13, 2017 at 03:32:44PM +0800, Jeffy Chen wrote: After unbinding drm, the user space may still

Re: drm/rockchip: Correct vop out_mode configure

2017-05-30 Thread jeffy
Hi Mark, Reviewed-by: Jeffy Chen On 05/27/2017 07:43 PM, yao mark wrote: Force vop output mode on encoder driver seem not a good idea, EDP, HDMI, DisplayPort all have 10bit input on rk3399, On non-10bit vop, vop 8bit output bit[0-7] connect to the encoder high 8bit [2-9]. So force RGB10 to

Re: [PATCH] drm/rockchip: Don't allow zero sized gem buffer

2017-05-25 Thread jeffy
Hi sean, On 05/25/2017 11:30 PM, Sean Paul wrote: On Tue, May 23, 2017 at 02:39:43PM +0800, Jeffy Chen wrote: The system would crash when trying to alloc zero sized gem buffer: [6.712435] Unable to handle kernel NULL pointer dereference at virtual address 0010 <--ZERO_SIZE_

[PATCH] drm/rockchip: Don't allow zero sized gem buffer

2017-05-22 Thread Jeffy Chen
The system would crash when trying to alloc zero sized gem buffer: [6.712435] Unable to handle kernel NULL pointer dereference at virtual address 0010 <--ZERO_SIZE_PTR ... [6.757502] PC is at sg_alloc_table_from_pages+0x170/0x1ec Signed-off-by: Jeffy Chen --- drivers/gpu/

Re: [PATCH v2] drm/rockchip: Set line flag config register in vop_crtc_enable

2017-04-29 Thread jeffy
Hi Sean, On 04/28/2017 11:03 PM, Sean Paul wrote: On Fri, Apr 28, 2017 at 03:37:47PM +0800, Jeffy Chen wrote: We need to set vop config done after update line flag config, it's a new requirement for chips newer than rk3368. Since we would only use line flag irq for vact_end, let's

[PATCH] drm/rockchip: analogix_dp: Remove unused check and variables

2017-04-29 Thread Jeffy Chen
Remove unused check and variables after: drm/rockchip: Set line flag config register in vop_crtc_enable Signed-off-by: Jeffy Chen --- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/rockchip

[PATCH v2] drm/rockchip: Set line flag config register in vop_crtc_enable

2017-04-28 Thread Jeffy Chen
We need to set vop config done after update line flag config, it's a new requirement for chips newer than rk3368. Since we would only use line flag irq for vact_end, let's move it to vop_crtc_enable. v2: Remove unused check and variables. Signed-off-by: Jeffy Chen --- Changes in

[PATCH] drm/rockchip: Set line flag config register in vop_crtc_enable

2017-04-26 Thread Jeffy Chen
We need to set vop config done after update line flag config, it's a new requirement for chips newer than rk3368. Since we would only use line flag irq for vact_end, let's move it to vop_crtc_enable. Signed-off-by: Jeffy Chen --- drivers/gpu/drm/rockchip/analogix_dp-rockc

Re: [PATCH v9] drm: Unplug drm device when unregistering it

2017-04-13 Thread jeffy
Hi Sean, On 04/12/2017 11:03 PM, Sean Paul wrote: On Wed, Apr 12, 2017 at 04:56:21PM +0800, Jeffy Chen wrote: After unbinding drm, the user space may still owns the drm dev fd, and may still be able to call drm ioctl. We're using an unplugged state to prevent something like that, so

[PATCH v11] drm: Unplug drm device when unregistering it (v8)

2017-04-13 Thread Jeffy Chen
state into drm_drv. v7: Add missing drm_dev_unref in udl_drv. v8: Fix compiler errors after enable udl. Signed-off-by: Jeffy Chen --- drivers/gpu/drm/drm_drv.c | 26 ++ drivers/gpu/drm/udl/udl_drv.c | 3 ++- include/drm/drmP.h| 6 -- include/drm

[PATCH v9] drm: Unplug drm device when unregistering it

2017-04-12 Thread Jeffy Chen
After unbinding drm, the user space may still owns the drm dev fd, and may still be able to call drm ioctl. We're using an unplugged state to prevent something like that, so let's reuse it here. Also drop drm_unplug_dev, because it would be unused after other changes. Signed-off-by:

[PATCH v8 1/2] drm: Unplug drm device when unregistering it

2017-04-12 Thread Jeffy Chen
After unbinding drm, the user space may still owns the drm dev fd, and may still be able to call drm ioctl. We're using an unplugged state to prevent something like that, so let's reuse it here. Also drop drm_unplug_dev, because it would be unused after other changes. Signed-off-by:

Re: [PATCH v7 2/2] drm: Prevent release fb after cleanup drm_mode_config

2017-04-12 Thread jeffy
Hi Daniel, On 04/12/2017 02:36 PM, Daniel Vetter wrote: On Tue, Apr 11, 2017 at 11:31:42AM +0800, Jeffy Chen wrote: We are freeing all framebuffers in drm_mode_config_cleanup without sync the drm_file's fbs list. So if someone try to unbind drm before release drm dev fd, the fbs list

[PATCH v8 0/2] drm: rockchip: Fix rockchip drm unbind crash error

2017-04-12 Thread Jeffy Chen
dress Daniel Vetter 's comments. Changes in v5: Fix wrong git account. Changes in v2: Fix some commit messages. Jeffy Chen (2): drm: Unplug drm device when unregistering it drm: Prevent release fb after cleanup drm_mode_config drivers/gpu/drm/drm_drv.c | 19 +++ drive

[PATCH v9 0/1] drm: rockchip: Fix rockchip drm unbind crash error

2017-04-12 Thread Jeffy Chen
drm_device_set_plug_state helper. Changes in v6: Reuse unplug status. Changes in v5: Fix wrong git account. Changes in v2: Fix some commit messages. Jeffy Chen (1): drm: Unplug drm device when unregistering it drivers/gpu/drm/drm_drv.c | 26 ++ drivers/gpu/drm/udl/udl_drv.c

Re: [PATCH v7 1/2] drm: Unplug drm device when unregistering it

2017-04-12 Thread jeffy
Hi Daniel, On 04/12/2017 02:33 PM, Daniel Vetter wrote: On Tue, Apr 11, 2017 at 11:31:41AM +0800, Jeffy Chen wrote: After unbinding drm, the user space may still owns the drm dev fd, and may still be able to call drm ioctl. We're using an unplugged state to prevent something like tha

[PATCH v8 2/2] drm: Prevent release fb after cleanup drm_mode_config

2017-04-12 Thread Jeffy Chen
that. Signed-off-by: Jeffy Chen --- Changes in v8: None Changes in v7: Update commit message. Changes in v6: None Changes in v5: None Changes in v2: None drivers/gpu/drm/drm_framebuffer.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gp

Re: [PATCH v7 1/2] drm: Unplug drm device when unregistering it

2017-04-12 Thread jeffy
Hi Daniel, missed some questions... On 04/12/2017 04:17 PM, jeffy wrote: Hi Daniel, On 04/12/2017 02:33 PM, Daniel Vetter wrote: On Tue, Apr 11, 2017 at 11:31:41AM +0800, Jeffy Chen wrote: After unbinding drm, the user space may still owns the drm dev fd, and may still be able to call drm

[PATCH v7 1/2] drm: Unplug drm device when unregistering it

2017-04-11 Thread Jeffy Chen
After unbinding drm, the user space may still owns the drm dev fd, and may still be able to call drm ioctl. We're using an unplugged state to prevent something like that, so let's reuse it here. Signed-off-by: Jeffy Chen Reviewed-by: Sean Paul --- Changes in v7: Address Sean Paul &

[PATCH] drm: Fixup hang when unregistering drm dev with open_count 0

2017-04-11 Thread Jeffy Chen
directly. Signed-off-by: Jeffy Chen --- drivers/gpu/drm/drm_drv.c | 15 +-- include/drm/drm_drv.h | 1 - 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index ad13e20..cc2d018 100644 --- a/drivers/gpu/drm/drm_drv.c

Re: [PATCH v6 0/2] drm: rockchip: Fix rockchip drm unbind crash error

2017-04-11 Thread jeffy
Hi Sean, On 04/11/2017 03:26 AM, Sean Paul wrote: On Mon, Apr 10, 2017 at 06:00:43PM +0800, Jeffy Chen wrote: Hi Jeffy, Thanks for sending this up again. Verified on rk3399 chromebook kevin, no more crashes during unbind/bind drm. I'm assuming this is on the chromeos-4.4 kernel?

[PATCH v7 0/2] drm: rockchip: Fix rockchip drm unbind crash error

2017-04-11 Thread Jeffy Chen
ome commit messages. Jeffy Chen (2): drm: Unplug drm device when unregistering it drm: Prevent release fb after cleanup drm_mode_config drivers/gpu/drm/drm_drv.c | 8 drivers/gpu/drm/drm_framebuffer.c | 5 + drivers/gpu/drm/udl/udl_drv.c | 2 +- include/drm/drmP.h

[PATCH v7 2/2] drm: Prevent release fb after cleanup drm_mode_config

2017-04-11 Thread Jeffy Chen
that. Signed-off-by: Jeffy Chen --- Changes in v7: Update commit message. Changes in v6: None Changes in v5: None Changes in v2: None drivers/gpu/drm/drm_framebuffer.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuf

Re: [PATCH v6 2/2] drm: Prevent release fb after cleanup mode config

2017-04-11 Thread jeffy
Hi Sean, On 04/11/2017 04:31 AM, Sean Paul wrote: On Mon, Apr 10, 2017 at 06:00:45PM +0800, Jeffy Chen wrote: After unbinding drm, the user space may still owns the drm dev fd, and may trigger fb release after cleanup mode config. Add a sanity check to prevent that. Signed-off-by: Jeffy Chen

[PATCH v6 2/2] drm: Prevent release fb after cleanup mode config

2017-04-10 Thread Jeffy Chen
After unbinding drm, the user space may still owns the drm dev fd, and may trigger fb release after cleanup mode config. Add a sanity check to prevent that. Signed-off-by: Jeffy Chen --- Changes in v6: None Changes in v5: None Changes in v2: None drivers/gpu/drm/drm_framebuffer.c | 5

[PATCH v6 0/2] drm: rockchip: Fix rockchip drm unbind crash error

2017-04-10 Thread Jeffy Chen
Verified on rk3399 chromebook kevin, no more crashes during unbind/bind drm. Changes in v6: Address Daniel Vetter 's comments. Changes in v5: Fix wrong git account. Changes in v2: Fix some commit messages. Jeffy Chen (2): drm: Unplug drm device when unregistering it drm: Prevent re

[PATCH v6 1/2] drm: Unplug drm device when unregistering it

2017-04-10 Thread Jeffy Chen
After unbinding drm, the user space may still owns the drm dev fd, and may still be able to call drm ioctl. We're using an unplugged state to prevent something like that, so let's reuse it here. Signed-off-by: Jeffy Chen --- Changes in v6: Address Daniel Vetter 's comments. Cha

Re: [PATCH v5 12/12] drm/drm_ioctl.c: Break ioctl when drm device not registered

2017-04-07 Thread jeffy
Hi Daniel, On 04/07/2017 03:16 PM, Daniel Vetter wrote: On Thu, Apr 06, 2017 at 08:31:25PM +0800, Jeffy Chen wrote: After unbinding drm, the user space may still owns the drm dev fd, and may still be able to call drm ioctl. Add a sanity check here to prevent that from happening. Signed-off

Re: [PATCH v3 8/9] drm/rockchip: gem: Don't alloc/free gem buf when dev_private is invalid

2017-04-07 Thread jeffy
Hi Daniel, On 04/07/2017 02:30 PM, Daniel Vetter wrote: On Thu, Apr 6, 2017 at 1:09 PM, jeffy wrote: On 04/06/2017 04:26 PM, Daniel Vetter wrote: On Wed, Apr 05, 2017 at 12:28:40PM -0400, Sean Paul wrote: On Wed, Apr 05, 2017 at 04:29:26PM +0800, Jeffy Chen wrote: After unbinding drm

[PATCH v5 10/12] drm/rockchip: Reoder drm bind/unbind sequence

2017-04-06 Thread Jeffy Chen
Current drm bind/unbind sequence would cause some memory issues. For example we should not cleanup iommu before cleanup mode config. Reorder bind/unbind sequence, follow exynos drm. Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes in v3: Address Sean Paul &#

Re: [PATCH v3 8/9] drm/rockchip: gem: Don't alloc/free gem buf when dev_private is invalid

2017-04-06 Thread jeffy
Hi Sean, On 04/06/2017 08:26 PM, Sean Paul wrote: On Thu, Apr 06, 2017 at 10:47:59AM +0800, jeffy wrote: Hi Sean, On 04/06/2017 12:28 AM, Sean Paul wrote: On Wed, Apr 05, 2017 at 04:29:26PM +0800, Jeffy Chen wrote: After unbinding drm, the userspace may still has a chance to access gem buf

[PATCH v5 01/12] drm: bridge: analogix: Detach panel when unbinding analogix dp

2017-04-06 Thread Jeffy Chen
The panel is attached when binding analogix dp. Signed-off-by: Jeffy Chen Reviewed-by: Andrzej Hajda --- Changes in v5: Fix wrong git account. Changes in v4: None Changes in v3: None Changes in v2: Fix some commit messages. drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 ++ 1 file

[PATCH v5 03/12] drm: bridge: analogix: Disable clock when unbinding

2017-04-06 Thread Jeffy Chen
The clock is enabled when binding analogix dp. Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/analogix

[PATCH v5 08/12] drm/rockchip: vop: Unprepare clocks when unbinding

2017-04-06 Thread Jeffy Chen
The clocks are prepared when binding vop. Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/rockchip

[PATCH v5 07/12] drm/rockchip: vop: Enable pm domain before vop_initial

2017-04-06 Thread Jeffy Chen
ial to the end of vop_bind for eaiser error handling. 2/ correct the err_put_pm_runtime of vop_enable. Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes in v3: Address Sean Paul 's comments. Update commit message. Changes in v2: None drivers/g

[PATCH v5 06/12] drm/rockchip: cdn-dp: Don't unregister audio dev when unbinding

2017-04-06 Thread Jeffy Chen
After snd_soc_unregister_codec, the dai link would remain bound to the invalid codec. That would cause crashes after unbind dp driver. Let's unregister audio codec when removing dp driver to prevent that. Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes

[PATCH v5 11/12] drm/rockchip: Shutdown all crtcs when unbinding drm

2017-04-06 Thread Jeffy Chen
Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes in v3: Address Daniel Vetter 's comments. Update commit message. Changes in v2: None drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/roc

  1   2   >