Re: [PATCH v4 0/3] drm/amd/display: Stop control flow if the divisior is zero

2025-02-24 Thread Huacai Chen
ion is based on 6.13-rc7, tested on x86 and LoongArch. Reviewed-by: Huacai Chen > > Tiezhu Yang (3): > drm/amd/display: Add ASSERT_BUG() macro definition > drm/amd/display: Add SPL_ASSERT_BUG() macro definition > drm/amd/display: Harden callers of division functions > &g

Re: [PATCH v6 0/9] Add jump table support for objtool on LoongArch

2025-02-19 Thread Huacai Chen
On Wed, Feb 19, 2025 at 1:46 AM Josh Poimboeuf wrote: > > On Mon, Feb 17, 2025 at 11:13:43AM +0800, Huacai Chen wrote: > > On Thu, Feb 13, 2025 at 10:51 AM Josh Poimboeuf wrote: > > > > > > On Wed, Feb 12, 2025 at 03:22:45PM +0800, Huacai Chen wrote: > > &g

Re: [PATCH v6 0/9] Add jump table support for objtool on LoongArch

2025-02-16 Thread Huacai Chen
On Thu, Feb 13, 2025 at 10:51 AM Josh Poimboeuf wrote: > > On Wed, Feb 12, 2025 at 03:22:45PM +0800, Huacai Chen wrote: > > > The new series now has 7 patches: > > > > > > Tiezhu Yang (7): > > > objtool: Handle various symbol types of rodata >

Re: [PATCH v6 0/9] Add jump table support for objtool on LoongArch

2025-02-11 Thread Huacai Chen
On Wed, Feb 12, 2025 at 7:30 AM Josh Poimboeuf wrote: > > On Tue, Feb 11, 2025 at 07:59:57PM +0800, Huacai Chen wrote: > > Hi, Josh, > > > > On Tue, Feb 11, 2025 at 5:26 AM Josh Poimboeuf wrote: > > > > > > On Mon, Feb 10, 2025 at 02:07:43PM +0800, Tiez

Re: [PATCH v6 0/9] Add jump table support for objtool on LoongArch

2025-02-11 Thread Huacai Chen
Hi, Josh, On Tue, Feb 11, 2025 at 5:26 AM Josh Poimboeuf wrote: > > On Mon, Feb 10, 2025 at 02:07:43PM +0800, Tiezhu Yang wrote: > > On 01/15/2025 09:34 AM, Josh Poimboeuf wrote: > > > On Sat, Jan 11, 2025 at 02:57:42PM +0800, Tiezhu Yang wrote: > > > > Hi Josh and Peter, > > > > > > > > On 12/17

Re: [PATCH v3 1/3] drm/amd/display: Add ASSERT_BUG() macro definition

2025-01-14 Thread Huacai Chen
Hi, Tiezhu, On Tue, Jan 14, 2025 at 2:16 PM Tiezhu Yang wrote: > > In order to keep the current ability for the aim of debugging and avoid > printing the warning message twice, add ASSERT_BUG() macro definition to > harden the callers of division functions. > > Signed-off-by: Tiezhu Yang > --- >

Re: [PATCH v6 0/9] Add jump table support for objtool on LoongArch

2025-01-04 Thread Huacai Chen
Hi, Josh and Peter, I think this series (except the last patch, but that one can be a separate one) is good enough now, right? If so, I think there is some ways to get it upstream: 1) I merge objtool/core from tip.git to the loongarch tree, then apply this whole series with your acked-by; 2) You

Re: [PATCH] drm/amd/display: Harden callers of division functions

2024-12-31 Thread Huacai Chen
Hi, Tiezhu, On Tue, Dec 31, 2024 at 3:28 PM Tiezhu Yang wrote: > > There are objtool warnings compiled with the latest mainline LLVM: > > dc_fixpt_recip() falls through to next function dc_fixpt_sinc() > spl_fixpt_recip() falls through to next function spl_fixpt_sinc() > > Here are the call p

Re: [PATCH v6 9/9] drm/amd/display: Mark dc_fixpt_from_fraction() noinline

2024-12-18 Thread Huacai Chen
Hi, Tiezhu, On Tue, Dec 17, 2024 at 9:50 AM Tiezhu Yang wrote: > > When compiling with Clang on LoongArch, there exists the following objtool > warning in drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.o: > > dc_fixpt_recip() falls through to next function dc_fixpt_sinc() > > This is because

[PATCH] drm/amd/display: Allow building DC with clang on LoongArch

2024-11-16 Thread Huacai Chen
disable DC_FP by default. The help message is also updated. Tested-by: Rui Wang Signed-off-by: Huacai Chen --- drivers/gpu/drm/amd/display/Kconfig | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd

[PATCH] drm/radeon: Use ttm_bo_move_null() in radeon_bo_move()

2024-11-13 Thread Huacai Chen
Since ttm_bo_move_null() is exactly the same as ttm_resource_free() + ttm_bo_assign_mem(), we use ttm_bo_move_null() for the GTT --> SYSTEM move case too. Then the code is more consistent as the SYSTEM --> GTT move case. Signed-off-by: Huacai Chen --- drivers/gpu/drm/radeon/radeon_ttm

[PATCH] Revert "drm/radeon: use GEM references instead of TTMs"

2024-09-30 Thread Huacai Chen
This reverts commit fd69ef05029f9beb7b031ef96e7a36970806a670. The original patch causes NULL pointer references: [ 21.620856] CPU 3 Unable to handle kernel paging request at virtual address , era == 94bf61d8, ra == 94bf61d4 [ 21.717958] Oops[#1]: [ 21.803205

[PATCH] drm/radeon: Call mmiowb() at the end of radeon_ring_commit()

2024-02-20 Thread Huacai Chen
27;t update BO_VA (-35) radeon :04:00.0: scheduling IB failed (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35) radeon :04:00.0: scheduling IB failed (-35). [drm:radeon_gem_va_ioctl [radeon]] *ERROR* Couldn't update BO_VA (-35) Cc: sta...@vger.ker

Re: [PATCH v2 07/14] LoongArch: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-01-06 Thread Huacai Chen
On Thu, Jan 4, 2024 at 11:58 PM Samuel Holland wrote: > > Hi Huacai, > > On 2024-01-04 3:55 AM, Huacai Chen wrote: > > Hi, Samuel, > > > > On Thu, Dec 28, 2023 at 9:42 AM Samuel Holland > > wrote: > >> > >> LoongArch already provides kernel_

Re: [PATCH v2 07/14] LoongArch: Implement ARCH_HAS_KERNEL_FPU_SUPPORT

2024-01-04 Thread Huacai Chen
Hi, Samuel, On Thu, Dec 28, 2023 at 9:42 AM Samuel Holland wrote: > > LoongArch already provides kernel_fpu_begin() and kernel_fpu_end() in > asm/fpu.h, so it only needs to add kernel_fpu_available() and export > the CFLAGS adjustments. > > Acked-by: WANG Xuerui > Reviewed-by: Christoph Hellwig

[PATCH V3] drm/amdgpu/display: Enable DC_FP for LoongArch

2023-05-08 Thread Huacai Chen
LoongArch now provides kernel_fpu_begin() and kernel_fpu_end() that are used like the x86 counterparts in commit 2b3bd32ea3a22ea2d ("LoongArch: Provide kernel fpu functions"), so we can enable DC_FP on LoongArch for supporting more DCN devices. Signed-off-by: WANG Xuerui Signed-off-

Re: [PATCH V2] drm/amdgpu/display: Enable DC_FP for LoongArch

2023-05-06 Thread Huacai Chen
Hi, Hamza, On Fri, May 5, 2023 at 9:37 PM Hamza Mahfooz wrote: > > > Hey Huacai, > > On 5/5/23 07:32, Huacai Chen wrote: > > Now LoongArch provides kernel_fpu_begin() and kernel_fpu_end() in commit > > 2b3bd32ea3a22ea2d ("LoongArch: Provide kernel fpu functions&q

[PATCH V2] drm/amdgpu/display: Enable DC_FP for LoongArch

2023-05-05 Thread Huacai Chen
Now LoongArch provides kernel_fpu_begin() and kernel_fpu_end() in commit 2b3bd32ea3a22ea2d ("LoongArch: Provide kernel fpu functions"), so we can enable DC_FP for DCN devices. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen --- V2: Update commit message to add the commit whic

[PATCH] drm/amdgpu/display: Enable DC_FP for LoongArch

2023-05-05 Thread Huacai Chen
Now LoongArch provides kernel_fpu_begin() and kernel_fpu_end() so we can enable DC_FP for DCN devices. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen --- drivers/gpu/drm/amd/display/Kconfig| 2 +- drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 6 -- drivers/gpu/drm/amd

[PATCH] drm/amdgpu: Use uncached ioremap() for LoongArch

2023-03-06 Thread Huacai Chen
-off-by: Huacai Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index c5ef7f7bdc15..c6888a58819a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b

Re: [PATCH] drm/amdgpu: Use uncached ioremap() for LoongArch

2023-03-05 Thread Huacai Chen
Hi, Christian, On Mon, Mar 6, 2023 at 12:40 AM Christian König wrote: > > Am 05.03.23 um 06:21 schrieb Huacai Chen: > > LoongArch maintains cache coherency in hardware, but its WUC attribute > > (Weak-ordered UnCached, which is similar to WC) is out of the scope of > > c

[PATCH] drm/amdgpu: Fix GPU TLB update error when PAGE_SIZE > AMDGPU_PAGE_SIZE

2021-05-14 Thread Huacai Chen
From: Yi Li When PAGE_SIZE is larger than AMDGPU_PAGE_SIZE, the number of GPU TLB entries which need to update in amdgpu_map_buffer() should be multiplied by AMDGPU_GPU_PAGES_IN_CPU_PAGE (PAGE_SIZE / AMDGPU_PAGE_SIZE). Signed-off-by: Yi Li Signed-off-by: Huacai Chen --- drivers/gpu/drm/amd

[PATCH 1/2] drm/radeon: Don't use WC for VRAM if !RADEON_GEM_GTT_WC

2020-09-09 Thread Huacai Chen
Though RADEON_GEM_GTT_WC is initially used for GTT, but this flag is bound to drm_arch_can_wc_memory(), and if arch doesn't support WC, then VRAM should not use WC. Signed-off-by: Huacai Chen --- drivers/gpu/drm/radeon/radeon_object.c | 14 ++ 1 file changed, 10 insertions(

[PATCH 2/2] drm/amdgpu: Don't use WC for VRAM if !AMDGPU_GEM_CREATE_CPU_GTT_USWC

2020-09-09 Thread Huacai Chen
Though AMDGPU_GEM_CREATE_CPU_GTT_USWC is initially used for GTT, but this flag is bound to drm_arch_can_wc_memory(), and if arch doesn't support WC, then VRAM should not use WC. Signed-off-by: Huacai Chen --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 -- 1 file changed, 4 inser