Re: [PATCH] drm/ttm/tests: Fix memory leaks for ttm_tt_init()

2024-11-06 Thread Jinjie Ruan
Gentle ping. On 2024/10/18 18:11, Jinjie Ruan wrote: > modprobe ttm_tt_test and then rmmod it, the following > memory leaks occurs because the ttm->pages allocated > in ttm_tt_init() is not freed: > > unreferenced object 0xff80c8469ed0 (size 8): > comm &

Re: [PATCH v4] drm/ttm/tests: Fix memory leak in ttm_tt_simple_create()

2024-11-06 Thread Jinjie Ruan
On 2024/10/30 10:01, Jinjie Ruan wrote: > Gentle ping. > > On 2024/10/26 10:07, Jinjie Ruan wrote: >> modprobe ttm_device_test and then rmmod ttm_device_test, the following >> memory leaks occurs: >> >> The ttm->pages allocated in ttm_

[PATCH v4 3/3] drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()

2024-10-29 Thread Jinjie Ruan
t;] ret_from_fork+0x10/0x20 .. Free `mode` by using drm_kunit_display_mode_from_cea_vic() to fix it. Cc: sta...@vger.kernel.org Fixes: 4af70f19e559 ("drm/tests: Add RGB Quantization tests") Acked-by: Maxime Ripard Signed-off-by: Jinjie Ruan --- v3: - Update the commit message. - Add Ack

[PATCH v4 1/3] drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic()

2024-10-29 Thread Jinjie Ruan
As Maxime suggested, add a new helper drm_kunit_display_mode_from_cea_vic(), it can replace the direct call of drm_display_mode_from_cea_vic(), and it will help solving the `mode` memory leaks. Acked-by: Maxime Ripard Suggested-by: Maxime Ripard Signed-off-by: Jinjie Ruan --- v4: - Return NULL

[PATCH v4 2/3] drm/connector: hdmi: Fix memory leak in drm_display_mode_from_cea_vic()

2024-10-29 Thread Jinjie Ruan
f>] ret_from_fork+0x10/0x20 .. Free `mode` by using drm_kunit_display_mode_from_cea_vic() to fix it. Cc: sta...@vger.kernel.org Fixes: abb6f74973e2 ("drm/tests: Add HDMI TDMS character rate tests") Acked-by: Maxime Ripard Signed-off-by: Jinjie Ruan --- v3: - Update the commi

[PATCH v4 0/3] drm/tests: Fix some memory leaks

2024-10-29 Thread Jinjie Ruan
drm_kunit_helpers.c. - Drop the "helper" in the helper name. - s/fllowing/following/ - Add Acked-by. Changes in v2: - Fix it with new introduced helper instead of drm_mode_destroy(). - Update the commit message. - Add Reviewed-by. Jinjie Ruan (3): drm/tests: helpers: Add helper for drm_display_mode_fr

Re: [PATCH v4] drm/ttm/tests: Fix memory leak in ttm_tt_simple_create()

2024-10-29 Thread Jinjie Ruan
Gentle ping. On 2024/10/26 10:07, Jinjie Ruan wrote: > modprobe ttm_device_test and then rmmod ttm_device_test, the following > memory leaks occurs: > > The ttm->pages allocated in ttm_tt_init() is not freed after calling > ttm_tt_simple_create(), which cau

Re: [PATCH v3 1/4] drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic()

2024-10-29 Thread Jinjie Ruan
On 2024/10/29 16:16, Maxime Ripard wrote: > On Thu, Oct 17, 2024 at 02:31:22PM +0800, Jinjie Ruan wrote: >> As Maxime suggested, add a new helper >> drm_kunit_display_mode_from_cea_vic(), it can replace the direct call >> of drm_display_mode_from_cea_vic(), and it will help

[PATCH] drm/msm/gpu: Fix missing error check for dev_pm_qos_add_request()

2024-10-26 Thread Jinjie Ruan
going on, also call dev_pm_qos_remove_request() in the next error path is also meaningless Fixes: 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints") Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/msm/msm_gpu_devfreq.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-

[PATCH v4] drm/ttm/tests: Fix memory leak in ttm_tt_simple_create()

2024-10-25 Thread Jinjie Ruan
function. Cc: sta...@vger.kernel.org Fixes: e6f7c641fae3 ("drm/ttm/tests: Add tests for ttm_tt") Reviewed-by: Nirmoy Das Signed-off-by: Jinjie Ruan --- v4: - Split out to be alone. v3: - s/fllowing/following/ v2: - Add Reviewed-by. --- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c

Re: [PATCH v3 0/4] drm/tests: Fix some memory leaks

2024-10-25 Thread Jinjie Ruan
On 2024/10/25 22:33, Maxime Ripard wrote: > On Wed, Oct 23, 2024 at 09:35:59AM +0800, Jinjie Ruan wrote: >> >> >> On 2024/10/18 16:12, Jinjie Ruan wrote: >>> >>> >>> On 2024/10/18 15:55, Maxime Ripard wrote: >>>> Hi, >>>> &

Re: [PATCH v3 0/4] drm/tests: Fix some memory leaks

2024-10-22 Thread Jinjie Ruan
On 2024/10/18 16:12, Jinjie Ruan wrote: > > > On 2024/10/18 15:55, Maxime Ripard wrote: >> Hi, >> >> On Thu, Oct 17, 2024 at 02:31:21PM GMT, Jinjie Ruan wrote: >>> Fix some memory leaks in drm tests. >>> >>> Changes in v3: >>> -

[PATCH] drm/ttm/tests: Fix memory leaks for ttm_tt_init()

2024-10-18 Thread Jinjie Ruan
x80/0xec [<dac19ab7>] kthread+0x2e8/0x374 [<57031423>] ret_from_fork+0x10/0x20 .. Add a helper named ttm_tt_init_kunit() to call ttm_tt_finish() to free it automatically. Cc: sta...@vger.kernel.org Fixes: e6f7c641fae3 ("drm/ttm/te

[PATCH] drm/ttm/tests: Fix memory leak in ttm_bo_kunit_init()

2024-10-18 Thread Jinjie Ruan
afc1e0aa485 ("drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man") Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c b/drivers/gpu/drm/ttm

Re: [PATCH v3 0/4] drm/tests: Fix some memory leaks

2024-10-18 Thread Jinjie Ruan
On 2024/10/18 15:55, Maxime Ripard wrote: > Hi, > > On Thu, Oct 17, 2024 at 02:31:21PM GMT, Jinjie Ruan wrote: >> Fix some memory leaks in drm tests. >> >> Changes in v3: >> - Adjust drm/drm_edid.h header to drm_kunit_helpers.c. >> - Drop the "

Re: [PATCH v3 0/4] drm/tests: Fix some memory leaks

2024-10-18 Thread Jinjie Ruan
On 2024/10/18 15:55, Maxime Ripard wrote: > Hi, > > On Thu, Oct 17, 2024 at 02:31:21PM GMT, Jinjie Ruan wrote: >> Fix some memory leaks in drm tests. >> >> Changes in v3: >> - Adjust drm/drm_edid.h header to drm_kunit_helpers.c. >> - Drop the "

Re: [PATCH v2 1/4] drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic()

2024-10-17 Thread Jinjie Ruan
On 2024/10/17 20:13, Maxime Ripard wrote: > On Thu, Oct 17, 2024 at 09:33:07AM GMT, Jinjie Ruan wrote: >>>> diff --git a/include/drm/drm_kunit_helpers.h >>>> b/include/drm/drm_kunit_helpers.h >>>> index e7cc17ee4934..1e7fd4be550c 100644 >>>&g

[PATCH v3 4/4] drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()

2024-10-16 Thread Jinjie Ruan
t;] ret_from_fork+0x10/0x20 .. Free `mode` by using drm_kunit_display_mode_from_cea_vic() to fix it. Cc: sta...@vger.kernel.org Fixes: 4af70f19e559 ("drm/tests: Add RGB Quantization tests") Acked-by: Maxime Ripard Signed-off-by: Jinjie Ruan --- v3: - Update the commit message. - Add Ack

[PATCH v3 3/4] drm/ttm/tests: Fix memory leak in ttm_tt_simple_create()

2024-10-16 Thread Jinjie Ruan
function. Cc: sta...@vger.kernel.org Fixes: e6f7c641fae3 ("drm/ttm/tests: Add tests for ttm_tt") Reviewed-by: Nirmoy Das Signed-off-by: Jinjie Ruan --- v3: - s/fllowing/following/ v2: - Add Reviewed-by. --- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 1 + 1 file changed, 1 insertion(

[PATCH v3 2/4] drm/connector: hdmi: Fix memory leak in drm_display_mode_from_cea_vic()

2024-10-16 Thread Jinjie Ruan
f>] ret_from_fork+0x10/0x20 .. Free `mode` by using drm_kunit_display_mode_from_cea_vic() to fix it. Cc: sta...@vger.kernel.org Fixes: abb6f74973e2 ("drm/tests: Add HDMI TDMS character rate tests") Acked-by: Maxime Ripard Signed-off-by: Jinjie Ruan --- v3: - Update the commi

[PATCH v3 1/4] drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic()

2024-10-16 Thread Jinjie Ruan
As Maxime suggested, add a new helper drm_kunit_display_mode_from_cea_vic(), it can replace the direct call of drm_display_mode_from_cea_vic(), and it will help solving the `mode` memory leaks. Acked-by: Maxime Ripard Suggested-by: Maxime Ripard Signed-off-by: Jinjie Ruan --- v3: - Adjust drm

[PATCH v3 0/4] drm/tests: Fix some memory leaks

2024-10-16 Thread Jinjie Ruan
it message. - Add Reviewed-by. Jinjie Ruan (4): drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic() drm/connector: hdmi: Fix memory leak in drm_display_mode_from_cea_vic() drm/ttm/tests: Fix memory leak in ttm_tt_simple_create() drm/tests: hdmi: Fix memor

Re: [PATCH v2 1/4] drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic()

2024-10-16 Thread Jinjie Ruan
On 2024/10/16 17:35, Maxime Ripard wrote: > On Mon, Oct 14, 2024 at 08:52:01PM GMT, Jinjie Ruan wrote: >> As Maxime suggested, add a new helper >> drm_kunit_helper_display_mode_from_cea_vic(), it can replace >> the direct call of drm_display_mode_from_cea_vic(), and it wil

Re: [PATCH] drm/panel: s6e3ha8: select CONFIG_DRM_DISPLAY_DSC_HELPER

2024-10-15 Thread Jinjie Ruan
On 2024/10/15 15:30, Arnd Bergmann wrote: > From: Arnd Bergmann > > The new driver needs the dsc helper code to be available: > > x86_64-linux-ld: vmlinux.o: in function `s6e3ha8_amb577px01_wqhd_prepare': > panel-samsung-s6e3ha8.c:(.text+0x16b1e65): undefined reference to > `drm_dsc_pps_payl

[PATCH v2 4/4] drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()

2024-10-14 Thread Jinjie Ruan
t;] ret_from_fork+0x10/0x20 .. Free `mode` by using drm_kunit_helper_display_mode_from_cea_vic() to fix it. Cc: sta...@vger.kernel.org Fixes: 4af70f19e559 ("drm/tests: Add RGB Quantization tests") Signed-off-by: Jinjie Ruan --- v2: - Fix it with new introduced helper instead of d

[PATCH v2 2/4] drm/connector: hdmi: Fix memory leak in drm_display_mode_from_cea_vic()

2024-10-14 Thread Jinjie Ruan
f>] ret_from_fork+0x10/0x20 .. Free `mode` by using drm_kunit_helper_display_mode_from_cea_vic() to fix it. Cc: sta...@vger.kernel.org Fixes: abb6f74973e2 ("drm/tests: Add HDMI TDMS character rate tests") Signed-off-by: Jinjie Ruan --- v2: - Fix it with new introduced helper instead o

[PATCH v2 3/4] drm/ttm/tests: Fix memory leak in ttm_tt_simple_create()

2024-10-14 Thread Jinjie Ruan
function. Cc: sta...@vger.kernel.org Fixes: e6f7c641fae3 ("drm/ttm/tests: Add tests for ttm_tt") Reviewed-by: Nirmoy Das Signed-off-by: Jinjie Ruan --- v2: - Add Reviewed-by. --- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v2 1/4] drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic()

2024-10-14 Thread Jinjie Ruan
As Maxime suggested, add a new helper drm_kunit_helper_display_mode_from_cea_vic(), it can replace the direct call of drm_display_mode_from_cea_vic(), and it will help solving the `mode` memory leaks. Suggested-by: Maxime Ripard Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/tests

[PATCH v2 0/4] drm: Fix some memory leaks

2024-10-14 Thread Jinjie Ruan
Fix some memory leaks in drm. Changes in v2: - Fix it with new introduced helper instead of drm_mode_destroy(). - Update the commit message. - Add Reviewed-by. Jinjie Ruan (4): drm/tests: helpers: Add helper for drm_display_mode_from_cea_vic() drm/connector: hdmi: Fix memory leak in

Re: [PATCH 1/3] drm/connector: hdmi: Fix memory leak in drm_display_mode_from_cea_vic()

2024-10-14 Thread Jinjie Ruan
On 2024/10/14 17:11, Maxime Ripard wrote: > On Mon, Oct 14, 2024 at 03:16:30PM GMT, Jinjie Ruan wrote: >> modprobe drm_connector_test and then rmmod drm_connector_test, >> the following memory leak occurs. >> >> The `mode` allocated in drm

[PATCH 3/3] drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()

2024-10-14 Thread Jinjie Ruan
x20 .. Free `mode` by calling drm_mode_destroy() to fix it. Cc: sta...@vger.kernel.org Fixes: 4af70f19e559 ("drm/tests: Add RGB Quantization tests") Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 8 1 file changed, 8 inserti

[PATCH 2/3] drm/ttm/tests: Fix memory leak in ttm_tt_simple_create()

2024-10-14 Thread Jinjie Ruan
function. Cc: sta...@vger.kernel.org Fixes: e6f7c641fae3 ("drm/ttm/tests: Add tests for ttm_tt") Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c b/drivers/gpu/dr

[PATCH 0/3] drm: Fix some memory leaks

2024-10-14 Thread Jinjie Ruan
Fix some memory leaks in drm. Jinjie Ruan (3): drm/connector: hdmi: Fix memory leak in drm_display_mode_from_cea_vic() drm/ttm/tests: Fix memory leak in ttm_tt_simple_create() drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic() drivers/gpu/drm/tests

[PATCH 1/3] drm/connector: hdmi: Fix memory leak in drm_display_mode_from_cea_vic()

2024-10-14 Thread Jinjie Ruan
gt;] ret_from_fork+0x10/0x20 .. Free `mode` by calling drm_mode_destroy() to fix it. Cc: sta...@vger.kernel.org Fixes: abb6f74973e2 ("drm/tests: Add HDMI TDMS character rate tests") Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/tests/drm_connector_test.c | 24 +++

[PATCH v2 3/5] drm/imx/ipuv3: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-12 Thread Jinjie Ruan
ned-off-by: Jinjie Ruan --- v2: - Add Reviewed-by. --- drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c index ef29c9a61a46..99db53e167bd 100644 --- a/d

[PATCH v2 0/5] drm: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-12 Thread Jinjie Ruan
events the automatic enabling of the requested interrupt in the same safe way. With that the usage can be simplified and corrected. Compile-tested only. Changes in v2: - Correct the commit subject. - Add reviewed-by. Jinjie Ruan (5): drm/imx: Use IRQF_NO_AUTOEN flag in request_irq() drm/imx

[PATCH v2 5/5] drm/msm/adreno: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-12 Thread Jinjie Ruan
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 4b565ca5a2cb ("drm/msm: Add A6XX device support") Reviewed-by: Dmitry Baryshkov Signed-off-by: Jinjie Ru

[PATCH v2 1/5] drm/imx: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-12 Thread Jinjie Ruan
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ") Signed-off-by: Jinjie Ruan --- v2: -

[PATCH v2 4/5] drm/tegra: dpaux: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-12 Thread Jinjie Ruan
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 9e532b3ad9a7 ("drm/tegra: dpaux: Disable interrupt when detached") Signed-off-by: Jinjie Ruan --- drive

[PATCH v2 2/5] drm/imx/dcss: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-12 Thread Jinjie Ruan
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ") Reviewed-by: Dmitry Baryshkov Signed-off-

[PATCH 4/5] drm/tegra: dpaux: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-06 Thread Jinjie Ruan
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 9e532b3ad9a7 ("drm/tegra: dpaux: Disable interrupt when detached") Signed-off-by: Jinjie Ruan --- drive

[PATCH 5/5] drm/msm/adreno: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-06 Thread Jinjie Ruan
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 4b565ca5a2cb ("drm/msm: Add A6XX device support") Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/

[PATCH 3/5] drm/imx/ipuv3: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-06 Thread Jinjie Ruan
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 47b1be5c0f4e ("staging: imx/drm: request irq only after adding the crtc") Signed-off-by: Jinjie Ruan --- d

[PATCH 2/5] drm/imx/dcss: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-06 Thread Jinjie Ruan
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ") Signed-off-by: Jinjie Ruan --- drivers/g

[PATCH 1/5] drm/atomic: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-06 Thread Jinjie Ruan
disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ") Signed-off-by: Jinjie Ruan --- drivers/g

[PATCH 0/5] drm: Use IRQF_NO_AUTOEN flag in request_irq()

2024-09-06 Thread Jinjie Ruan
events the automatic enabling of the requested interrupt in the same safe way. With that the usage can be simplified and corrected. Jinjie Ruan (5): drm/atomic: Use IRQF_NO_AUTOEN flag in request_irq() drm/imx/dcss: Use IRQF_NO_AUTOEN flag in request_irq() drm/imx/ipuv3: Use IRQF_NO_AUTO

[PATCH] drm/amdgpu: Fix incorrect resource realease in amdgpu_init()

2024-09-05 Thread Jinjie Ruan
If pci_register_driver() fails, amdgpu_sync_slab and amdgpu_fence_slab should be freed in the error path, fix it. Signed-off-by: Jinjie Ruan Suggested-by: Thomas Gleixner --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a

[PATCH v2] drm/panthor: Use the BITS_PER_LONG macro

2024-09-02 Thread Jinjie Ruan
/panthor_mmu.c:2696: + if (BITS_PER_LONG < va_bits) { Signed-off-by: Jinjie Ruan --- v2: - Also fix for below mmu_features. - Remoove -next. --- drivers/gpu/drm/panthor/panthor_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c

[PATCH -next v2] drm/imagination: Use memdup_user() helper

2024-09-01 Thread Jinjie Ruan
Switching to memdup_user(), which combines kmalloc() and copy_from_user(), and it can simplfy code. Signed-off-by: Jinjie Ruan Suggested-by: Christophe JAILLET --- v2: - Add suggested-by. - Simplify the code. --- drivers/gpu/drm/imagination/pvr_context.c | 18 +++--- 1 file changed

Re: [PATCH -next] drm/imagination: Use memdup_user() helper

2024-09-01 Thread Jinjie Ruan
On 2024/8/31 18:48, Christophe JAILLET wrote: > Le 31/08/2024 à 12:30, Jinjie Ruan a écrit : >> Switching to memdup_user(), which combines kmalloc() and >> copy_from_user(), >> and it can simplfy code. >> >> Signed-off-by: Jinjie Ruan >> --- >>   d

[PATCH -next] drm/imagination: Use memdup_user() helper

2024-08-31 Thread Jinjie Ruan
Switching to memdup_user(), which combines kmalloc() and copy_from_user(), and it can simplfy code. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/imagination/pvr_context.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/imagination

[PATCH -next] drm/imagination: Use memdup_user() helper to simplify code

2024-08-31 Thread Jinjie Ruan
Switching to memdup_user(), which combines kmalloc() and copy_from_user(), and it can simplfy code. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/imagination/pvr_job.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/imagination/pvr_job.c b

[PATCH -next] drm/i915: Use memdup_user() helper

2024-08-31 Thread Jinjie Ruan
Switching to memdup_user(), which combines kmalloc() and copy_from_user(), and it can simplfy code. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/gem

[PATCH -next] drm/panthor: Use the BITS_PER_LONG macro

2024-08-30 Thread Jinjie Ruan
/panthor_mmu.c:2696: + if (BITS_PER_LONG < va_bits) { Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/panthor/panthor_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c index d47972806

[PATCH -next v2] drm: of: Use for_each_child_of_node_scoped()

2024-08-30 Thread Jinjie Ruan
Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- v2: - Split out from the PATCH set. --- drivers/gpu/drm/drm_of.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu

[PATCH -next v2] gpu: host1x: Use for_each_available_child_of_node_scoped()

2024-08-30 Thread Jinjie Ruan
Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- v2: - Split out from the patch set. --- drivers/gpu/host1x/bus.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu

[PATCH -next v2] drm/nouveau: Use for_each_child_of_node_scoped()

2024-08-30 Thread Jinjie Ruan
Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- v2: - Split out from the patch set. --- drivers/gpu/drm/nouveau/nouveau_connector.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau

[PATCH -next v2] drm/rockchip: Use for_each_child_of_node_scoped()

2024-08-30 Thread Jinjie Ruan
Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan Reviewed-by: Heiko Stuebner --- v2: - Add Reviewed-by. - Split out from the PATCH set. --- drivers/gpu/drm/rockchip/rockchip_lvds.c | 8 +++- 1 file changed, 3 insertions(+), 5

[PATCH v2] drm/mediatek: Fix missing of_node_put() for mtk_drm_get_all_drm_priv()

2024-08-30 Thread Jinjie Ruan
In mtk_drm_get_all_drm_priv(), break in for_each_child_of_node() should call of_node_put() to avoid child node resource leak, fix it. Fixes: d761b9450e31 ("drm/mediatek: Add cnt checking for coverity issue") Signed-off-by: Jinjie Ruan --- v2: - Use of_node_put() to fix it. - Update

[PATCH -next] drm: zynqmp_dp: Use devm_platform_ioremap_resource_byname()

2024-08-28 Thread Jinjie Ruan
platform_get_resource_byname() and devm_ioremap_resource() can be replaced by devm_platform_ioremap_resource_byname(), which can simplify the code logic a bit, No functional change here. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 +--- 1 file changed, 1 insertion(+), 3

[PATCH -next] drm/msm: Use devm_platform_ioremap_resource_byname()

2024-08-28 Thread Jinjie Ruan
platform_get_resource_byname() and devm_ioremap_resource() can be replaced by devm_platform_ioremap_resource_byname(), which can simplify the code logic a bit, No functional change here. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/msm/msm_io_utils.c | 8 +--- 1 file changed, 1 insertion

[PATCH -next v2 1/3] drm/rockchip: Use for_each_child_of_node_scoped()

2024-08-26 Thread Jinjie Ruan
Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/rockchip/rockchip_lvds.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip

[PATCH -next v2 3/3] drm/rockchip: Simplified with dev_err_probe()

2024-08-26 Thread Jinjie Ruan
Use dev_err_probe to replace deprecated() DRM_DEV_ERROR(), which can simplfy code. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/rockchip/rockchip_lvds.c | 30 +--- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b

[PATCH -next v2 2/3] drm/rockchip: Simplified with dev_err() and __free()

2024-08-26 Thread Jinjie Ruan
Avoid need to manually handle of_node_put() by using __free(), and use dev_err() to replace deprecated() DRM_DEV_ERROR(), which can simplfy code. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/rockchip/rockchip_lvds.c | 38 1 file changed, 13 insertions(+), 25 deletions

[PATCH -next v2 0/3] drm/rockchip: Simplified with for_each_child_of_node_scoped()

2024-08-26 Thread Jinjie Ruan
Use for_each_child_of_node_scoped(), __free and dev_err_probe() to simplify code. Changes in v2: - Split from the patch set. - Also use __free() and dev_err_probe() to simplify code. Jinjie Ruan (3): drm/rockchip: Use for_each_child_of_node_scoped() drm/rockchip: Simplified with dev_err

Re: [PATCH -next 2/5] drm/mediatek: Fix missing of_node_put() for mtk_drm_get_all_drm_priv()

2024-08-26 Thread Jinjie Ruan
On 2024/8/25 13:16, Marion & Christophe JAILLET wrote: > > > Le 23/08/2024 à 12:46, Christophe JAILLET a écrit : >>> @@ -933,10 +931,8 @@ static int mtk_drm_probe(struct platform_device >>> *pdev) >>>   } >>>   ret = mtk_ddp_comp_init(node, &private->ddp_comp[comp_id], >>> comp

Re: [PATCH -next 1/5] drm/rockchip: Use for_each_child_of_node_scoped()

2024-08-26 Thread Jinjie Ruan
On 2024/8/23 19:32, Jonathan Cameron wrote: > On Fri, 23 Aug 2024 17:20:49 +0800 > Jinjie Ruan wrote: > >> Avoids the need for manual cleanup of_node_put() in early exits >> from the loop. >> >> Signed-off-by: Jinjie Ruan > > There is more to do here

Re: [PATCH -next 1/5] drm/rockchip: Use for_each_child_of_node_scoped()

2024-08-26 Thread Jinjie Ruan
On 2024/8/23 19:32, Jonathan Cameron wrote: > On Fri, 23 Aug 2024 17:20:49 +0800 > Jinjie Ruan wrote: > >> Avoids the need for manual cleanup of_node_put() in early exits >> from the loop. >> >> Signed-off-by: Jinjie Ruan > > There is more to do here

[PATCH -next 2/5] drm/mediatek: Fix missing of_node_put() for mtk_drm_get_all_drm_priv()

2024-08-23 Thread Jinjie Ruan
t;drm/mediatek: Add cnt checking for coverity issue") Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 77

[PATCH -next 5/5] gpu: host1x: Use for_each_available_child_of_node_scoped()

2024-08-23 Thread Jinjie Ruan
Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/gpu/host1x/bus.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index 8e09d6d328d2

[PATCH -next 4/5] drm/nouveau: Use for_each_child_of_node_scoped()

2024-08-23 Thread Jinjie Ruan
Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/nouveau/nouveau_connector.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm

[PATCH -next 3/5] drm: of: Use for_each_child_of_node_scoped()

2024-08-23 Thread Jinjie Ruan
Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/drm_of.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 177b600895d3

[PATCH -next 1/5] drm/rockchip: Use for_each_child_of_node_scoped()

2024-08-23 Thread Jinjie Ruan
Avoids the need for manual cleanup of_node_put() in early exits from the loop. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/rockchip/rockchip_lvds.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip

[PATCH -next 0/5] drm: Use for_each_child_of_node_scoped()

2024-08-23 Thread Jinjie Ruan
Use for_each_child_of_node_scoped() to simplfy code and fix a bug by the way. Jinjie Ruan (5): drm/rockchip: Use for_each_child_of_node_scoped() drm/mediatek: Fix missing of_node_put() for mtk_drm_get_all_drm_priv() drm: of: Use for_each_child_of_node_scoped() drm/nouveau: Use

[PATCH -next v3] drm/amd/display: Remove unused dcn35_fpga_funcs and related functions

2024-08-22 Thread Jinjie Ruan
dcn35_fpga_funcs is not used anywhere, remove it. And also remove related not used dcn35_init_clocks_fpga() and dcn35_update_clocks_fpga(). Signed-off-by: Jinjie Ruan --- v3: - Also remove related unused functions. - Update the commit message. v2: - Remove it instead of making it static

Re: [PATCH -next v2 RESEND] drm/amd/display: Remove unused dcn35_fpga_funcs

2024-08-22 Thread Jinjie Ruan
On 2024/8/23 2:01, Alex Deucher wrote: > On Thu, Aug 22, 2024 at 5:20 AM Jinjie Ruan wrote: >> >> dcn35_fpga_funcs is not used anywhere, remove it. > > This will lead to warnings about unused functions. The fpga specific > functions should be removed as well. I&#

[PATCH -next] backlight: 88pm860x_bl: Simplify with scoped for each OF child loop

2024-08-21 Thread Jinjie Ruan
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Jinjie Ruan --- drivers/video/backlight/88pm860x_bl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers

[PATCH -next v2 RESEND] drm/amd/display: Remove unused dcn35_fpga_funcs

2024-08-21 Thread Jinjie Ruan
dcn35_fpga_funcs is not used anywhere, remove it. Signed-off-by: Jinjie Ruan --- v2: - Remove it instead of making it static. --- .../gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35

[PATCH -next v2] drm/amd/display: Remove unused dcn35_fpga_funcs

2024-08-21 Thread Jinjie Ruan
dcn35_fpga_funcsc is not used anywhere, remove it. Signed-off-by: Jinjie Ruan --- v2: - Remove it instead of making it static. --- .../gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35

[PATCH -next 5/5] drm/amd/display: Make dcn35_fpga_funcs static

2024-08-20 Thread Jinjie Ruan
The sparse tool complains as follows: drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c:1071:22: warning: symbol 'dcn35_fpga_funcs' was not declared. Should it be static? This symbol is not used outside of dcn35_clk_mgr.c, so marks it static. Signed-off-

[PATCH -next 4/5] drm/amd/display: Make dcn401_dsc_funcs static

2024-08-20 Thread Jinjie Ruan
The sparse tool complains as follows: drivers/gpu/drm/amd/amdgpu/../display/dc/dsc/dcn401/dcn401_dsc.c:30:24: warning: symbol 'dcn401_dsc_funcs' was not declared. Should it be static? This symbol is not used outside of dcn401_dsc.c, so marks it static. Signed-off-by: J

[PATCH -next 0/5] drm/amd/display: Make some symobols static

2024-08-20 Thread Jinjie Ruan
Make some symobols static. Jinjie Ruan (5): drm/amd/display: Make core_dcn4_g6_temp_read_blackout_table static drm/amd/display: Make core_dcn4_ip_caps_base static drm/amd/display: Make dcn35_hubp_funcs static drm/amd/display: Make dcn401_dsc_funcs static drm/amd/display: Make

[PATCH -next 3/5] drm/amd/display: Make dcn35_hubp_funcs static

2024-08-20 Thread Jinjie Ruan
The sparse tool complains as follows: drivers/gpu/drm/amd/amdgpu/../display/dc/hubp/dcn35/dcn35_hubp.c:191:19: warning: symbol 'dcn35_hubp_funcs' was not declared. Should it be static? This symbol is not used outside of dcn35_hubp.c, so marks it static. Signed-off-by: J

[PATCH -next 1/5] drm/amd/display: Make core_dcn4_g6_temp_read_blackout_table static

2024-08-20 Thread Jinjie Ruan
outside of dml2_core_dcn4_calcs.c, so marks it static. And not want to change it, so mark it const. Signed-off-by: Jinjie Ruan --- .../display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src

[PATCH -next 2/5] drm/amd/display: Make core_dcn4_ip_caps_base static

2024-08-20 Thread Jinjie Ruan
c. And do not want to change it, so mark it const. Signed-off-by: Jinjie Ruan --- .../amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.c| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.c b/drive

[PATCH -next 6/8] drm/panel: khadas-ts050: Make ts050_panel_data and ts050v2_panel_data static

2024-08-19 Thread Jinjie Ruan
declared. Should it be static? These symbols are not used outside panel-khadas-ts050.c, so marks them static. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/panel/panel-khadas-ts050.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-khadas-ts050.

[PATCH v2] drm: gm12u320: Fix the timeout usage for usb_bulk_msg()

2023-09-03 Thread Jinjie Ruan
it consistent here and so change IDLE_TIMEOUT to msecs_to_jiffies(IDLE_TIMEOUT) where it is used. Fixes: e4f86e437164 ("drm: Add Grain Media GM12U320 driver v2") Signed-off-by: Jinjie Ruan Suggested-by: Hans de Goede --- v2: - Remove the msecs_to_jiffies() also for IDLE_TIMEOUT. - Upda

[PATCH] drm: gm12u320: Fix the timeout usage for usb_bulk_msg()

2023-09-03 Thread Jinjie Ruan
The timeout arg of usb_bulk_msg() is ms already and it has convert it to jiffies by msecs_to_jiffies() in usb_start_wait_urb(). So fix the usage by remove the redundant msecs_to_jiffies() in the macros. Fixes: 77b8cabf3d52 ("drm/gm12u320: Move driver to drm/tiny") Signed-off-by: J

[PATCH] drm/mediatek: dp: Remove redundant dev_err_probe() for platform_get_irq()

2023-08-31 Thread Jinjie Ruan
custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Fixes: 828c91231fbe ("drm/mediatek: dp: Don't register HPD interrupt handler for eDP case") Signed-off-by: Jinjie Ruan --- drivers/gpu/dr

[PATCH -next] drm/i915/gvt: Use list_for_each_entry() helper

2023-08-28 Thread Jinjie Ruan
Convert list_for_each() to list_for_each_entry() so that the pos list_head pointer and list_entry() call are no longer needed, which can reduce a few lines of code. No functional changed. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/i915/gvt/dmabuf.c | 8 ++-- 1 file changed, 2 insertions

[PATCH -next] drm: xlnx: zynqmp_dpsub: Use devm_clk_get_enabled() helper function

2023-08-25 Thread Jinjie Ruan
The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/xlnx

[PATCH -next] fbdev/core: Use list_for_each_entry() helper

2023-08-23 Thread Jinjie Ruan
Convert list_for_each() to list_for_each_entry() so that the pos list_head pointer and list_entry() call are no longer needed, which can reduce a few lines of code. No functional changed. Signed-off-by: Jinjie Ruan --- drivers/video/fbdev/core/fbsysfs.c | 8 ++-- drivers/video/fbdev/core

[PATCH -next 2/2] drm/tegra: Use PTR_ERR_OR_ZERO() to simplify code

2023-08-22 Thread Jinjie Ruan
Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to simplify code. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/tegra/drm.c | 5 + drivers/gpu/drm/tegra/gem.c | 5 + 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm

[PATCH -next 0/2] drm: Use PTR_ERR_OR_ZERO() to simplify code

2023-08-22 Thread Jinjie Ruan
PTR_ERR_OR_ZERO() return the error code within @ptr if it is an error pointer, otherwise return 0. So use it to simplify code. Jinjie Ruan (2): drm/bridge: Use PTR_ERR_OR_ZERO() to simplify code drm/tegra: Use PTR_ERR_OR_ZERO() to simplify code drivers/gpu/drm/bridge/tc358762.c | 10

[PATCH -next 1/2] drm/bridge: Use PTR_ERR_OR_ZERO() to simplify code

2023-08-22 Thread Jinjie Ruan
Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to simplify code. Signed-off-by: Jinjie Ruan --- drivers/gpu/drm/bridge/tc358762.c | 10 ++ drivers/gpu/drm/bridge/tc358764.c | 5 + 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge