[PATCH v2] drm/i915: fix build issue when using clang

2022-02-14 Thread Tong Zhang
t enable -Wformat-security with -Wall. Disable -Wformat-security within the i915 Makefile so that these warnings do not show up with clang. Signed-off-by: Tong Zhang --- v2: revise commit message drivers/gpu/drm/i915/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/

Re: [PATCH] drm/i915: fix build issue when using clang

2022-02-14 Thread Tong Zhang
On Sun, Feb 13, 2022 at 10:39 AM Nathan Chancellor wrote: > > On Sat, Feb 12, 2022 at 10:51:06PM -0800, Tong Zhang wrote: > > drm/i915 target adds some extra cflags, especially it does re-apply -Wall. > > In clang this will override -Wno-format-security and cause the buil

[PATCH] drm/i915: fix build issue when using clang

2022-02-12 Thread Tong Zhang
anded from macro 'do_trace_printk' __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \ ^~~~ drivers/gpu/drm/i915/gt/intel_gt.c:983:2: note: treat the string as an argument to avoid this Signed-off-by: Tong Zhang --- drive

[PATCH v2] drm/privacy-screen: honor acpi=off in detect_thinkpad_privacy_screen

2022-01-23 Thread Tong Zhang
in detect_thinkpad_privacy_screen(). Signed-off-by: Tong Zhang --- v2: fix typo in previous commit -- my keyboard is eating letters drivers/gpu/drm/drm_privacy_screen_x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm

[PATCH v1] drm/privacy-screen: honor acpi=off in detect_thinkpad_privacy_screen

2022-01-23 Thread Tong Zhang
in detect_thinkpad_privacy_screen(). Signed-off-by: Tong Zhang --- drivers/gpu/drm/drm_privacy_screen_x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm/drm_privacy_screen_x86.c index a2cafb294ca6..e7aa74ad0b24 100644

[PATCH v1] fix vmwgfx compilation error due to a missing include

2021-07-09 Thread Tong Zhang
cit-function-declaration] 690 | ttm_range_man_fini(_priv->bdev, TTM_PL_VRAM); | ^~ cc1: some warnings being treated as errors Signed-off-by: Tong Zhang --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx

Re: [PATCH] drm/radeon: don't evict if not initialized

2021-03-21 Thread Tong Zhang
Thanks, Fixed as suggested and sent as v2. - Tong On Sun, Mar 21, 2021 at 9:26 AM Christian König wrote: > > > > Am 20.03.21 um 21:10 schrieb Tong Zhang: > > TTM_PL_VRAM may not initialized at all when calling > > radeon_bo_evict_vram(). We need to che

[PATCH v2] drm/radeon: don't evict if not initialized

2021-03-21 Thread Tong Zhang
/0xa0 [radeon] [2.169534] radeon_driver_load_kms+0x174/0x210 [radeon] [2.169843] drm_dev_register+0xd9/0x1c0 [drm] [2.170104] radeon_pci_probe+0x117/0x1a0 [radeon] Suggested-by: Christian König Signed-off-by: Tong Zhang --- v2: coding style fix drivers/gpu/drm/radeon/radeon_object.c

[PATCH] drm/radeon: don't evict if not initialized

2021-03-20 Thread Tong Zhang
/0xa0 [radeon] [2.169534] radeon_driver_load_kms+0x174/0x210 [radeon] [2.169843] drm_dev_register+0xd9/0x1c0 [drm] [2.170104] radeon_pci_probe+0x117/0x1a0 [radeon] Signed-off-by: Tong Zhang --- drivers/gpu/drm/radeon/radeon_object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

Re: [PATCH] drm/fb-helper: only unmap if buffer not null

2021-03-01 Thread Tong Zhang
mains NULL -- Since there could be the case that the fb_probe is never called, a subsequent modprobe -r will cause the following drm_client_buffer_vunmap(NULL) in drm_fbdev_cleanup() Best, - Tong On Mon, Mar 1, 2021 at 3:26 AM Thomas Zimmermann wrote: > > Hi > > Am 28.02.21 um 05:46 schrieb To

[PATCH] video: fbdev: sis: catch out of bounds in SiS_DoCalcDelay

2021-02-27 Thread Tong Zhang
f9 [4.772384] c0048c00: f9 f9 f9 f9 00 00 00 f9 f9 f9 f9 f9 00 f9 f9 f9 [4.772385] == Signed-off-by: Tong Zhang --- drivers/video/fbdev/sis/init.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/video/fb

[PATCH] drm/fb-helper: only unmap if buffer not null

2021-02-27 Thread Tong Zhang
+0x3e4/0x580 [ 199.137481] ? fpregs_assert_state_consistent+0x4d/0x60 [ 199.137767] ? exit_to_user_mode_prepare+0x2f/0x130 [ 199.138037] do_syscall_64+0x33/0x40 [ 199.138237] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 199.138517] RIP: 0033:0x7f36fdc3dcf7 Signed-off-by: Tong Zhang --- dri

Re: [PATCH] video: fbdev: pm2fb: avoid stall on fb_sync

2021-02-24 Thread Tong Zhang
, 2021 at 6:35 AM Geert Uytterhoeven wrote: > > Hi Tong, > > On Sun, Feb 21, 2021 at 1:05 AM Tong Zhang wrote: > > On Sat, Feb 20, 2021 at 6:33 PM Randy Dunlap wrote: > > > On 2/20/21 3:02 PM, Tong Zhang wrote: > > > > pm2fb_sync is called when doing /dev

[PATCH] drm/ast: fix memory leak when unload the driver

2021-02-21 Thread Tong Zhang
] [drm:drm_mode_config_cleanup] *ERROR* connector VGA-1 leaked! Signed-off-by: Tong Zhang --- drivers/gpu/drm/ast/ast_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c index 667b450606ef..b047c0ea43e8 100644 --- a/drivers/gpu/drm/ast/ast_drv.c +++ b

Re: [PATCH v2] video: fbdev: pm2fb: avoid stall on fb_sync

2021-02-20 Thread Tong Zhang
On Sat, Feb 20, 2021 at 7:36 PM Randy Dunlap wrote: > I suppose the rest of the patch is OK since it works for you. > > I don't know any of this code. It would be nice to know what some > of those pm2_RD(par, SOME_REG) mean so that I could sort of > understand what it is doing, but don't go

[PATCH v3] video: fbdev: pm2fb: avoid stall on fb_sync

2021-02-20 Thread Tong Zhang
: 0871 R11: 0246 R12: 0800 [ 39.538008] R13: 56491a6ad000 R14: 0200 R15: Signed-off-by: Tong Zhang --- v3: initialize timeout_fifo to 0, and added comment for WAIT_FIFO_TIMEOUT v2: fix typo and add console log according

Re: [PATCH] video: fbdev: pm2fb: avoid stall on fb_sync

2021-02-20 Thread Tong Zhang
Hi Randy, Thanks for the comment. I currently have this problem on my machine. I have submitted a revised patch -- which includes the console log. Thanks! - Tong On Sat, Feb 20, 2021 at 6:33 PM Randy Dunlap wrote: > > Hi-- > > On 2/20/21 3:02 PM, Tong Zhang wrote: > > pm2fb_s

[PATCH v2] video: fbdev: pm2fb: avoid stall on fb_sync

2021-02-20 Thread Tong Zhang
: 0871 R11: 0246 R12: 0800 [ 39.538008] R13: 56491a6ad000 R14: 0200 R15: Signed-off-by: Tong Zhang --- v2: fix typo and add console log according to Randy's comment drivers/video/fbdev/pm2fb.c | 29

[PATCH] video: fbdev: pm2fb: avoid stall on fb_sync

2021-02-20 Thread Tong Zhang
pm2fb_sync is called when doing /dev/fb read or write. The original pm2fb_sync wait indefinitely on hardware flags which can possibly stall kernel and make everything unresponsive. Instead of waiting indefinitely, we can timeout to give user a chance to get back control. Signed-off-by: Tong Zhang

Re: [PATCH] drm/qxl: properly handle device init failures

2021-02-09 Thread Tong Zhang
Hi Gerd, I tested the patch on drm-misc-next and it fixed the issue. Thanks, - Tong > On Feb 9, 2021, at 7:16 AM, Gerd Hoffmann wrote: > > On Mon, Feb 08, 2021 at 12:07:01PM -0500, Tong Zhang wrote: >> Does this patch fix an issue raised previously? Or should they be used >&g

Re: [PATCH] drm/qxl: properly handle device init failures

2021-02-08 Thread Tong Zhang
ically do not try release resources which where > not allocated in the first place. > > Cc: Tong Zhang > Signed-off-by: Gerd Hoffmann > --- > drivers/gpu/drm/qxl/qxl_display.c | 3 +++ > drivers/gpu/drm/qxl/qxl_kms.c | 4 > 2 files changed, 7 insertions(+) >

Re: [PATCH] drm/qxl: properly handle device init failures

2021-02-08 Thread Tong Zhang
- Tong > On Feb 8, 2021, at 5:41 AM, Gerd Hoffmann wrote: > > Specifically do not try release resources which where > not allocated in the first place. > > Cc: Tong Zhang > Signed-off-by: Gerd Hoffmann > --- > drivers/gpu/drm/qxl/qxl_display.c | 3 +++ > drivers/gp

Re: [PATCH v2] drm/qxl: do not run release if qxl failed to init

2021-02-05 Thread Tong Zhang
On Feb 5, 2021, at 2:43 AM, Gerd Hoffmann wrote: > > On Thu, Feb 04, 2021 at 11:30:50AM -0500, Tong Zhang wrote: >> if qxl_device_init() fail, drm device will not be registered, >> in this case, do not run qxl_drm_release() > > How do you trigger this? > This c

Re: [PATCH v6 02/10] Revert "drm/qxl: do not run release if qxl failed to init"

2021-02-04 Thread Tong Zhang
> On Feb 4, 2021, at 2:06 PM, Thomas Zimmermann wrote: > > Hi Tong > >> I have posted an updated patch. >> The new patch use the following logic >> +if (!qdev->ddev.mode_config.funcs) >> + return; > > This is again just papering over the issue. Better don't call > qxl_drm_release()

Re: [PATCH v6 02/10] Revert "drm/qxl: do not run release if qxl failed to init"

2021-02-04 Thread Tong Zhang
ch is broken, it effectively makes qxl_drm_release() a nop >> because on normal driver shutdown qxl_drm_release() is called >> *after* drm_dev_unregister(). >> Cc: Tong Zhang >> Signed-off-by: Gerd Hoffmann >> --- >> drivers/gpu/drm/qxl/qxl_drv.c | 2 -- >>

[PATCH v2] drm/qxl: do not run release if qxl failed to init

2021-02-04 Thread Tong Zhang
: 7fa3f68bf300 R11: 0246 R12: 01e939e0 [5.273550] R13: R14: 01e93bd0 R15: 0001 [5.273928] == Signed-off-by: Tong Zhang --- v2: use qdev->ddev.mode_config.fu

[PATCH v1] drm/qxl: do not run release if qxl failed to init

2021-02-03 Thread Tong Zhang
: 7fa3f68bf300 R11: 0246 R12: 01e939e0 [5.273550] R13: R14: 01e93bd0 R15: 0001 [5.273928] == Signed-off-by: Tong Zhang --- drivers/gpu/drm/qxl/qxl_drv.c | 2 ++ 1

[PATCH] drm/amd/display: should check error using DC_OK

2020-08-17 Thread Tong Zhang
core_link_read_dpcd returns only DC_OK(1) and DC_ERROR_UNEXPECTED(-1), the caller should check error using DC_OK instead of checking against 0 Signed-off-by: Tong Zhang --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git