Le 08/12/2023 à 03:44, yang.gua...@zte.com.cn a écrit :
From: Yang Guang
Convert kzalloc/memcpy operations to memdup makes for
cleaner code and avoids memcpy() failures
Hi,
usually, function's names are written with () in commit description.
(i.e. kzalloc()/memcpy()).
memdup should be kme
It is likely that the statement related to 'dml_edp' is misplaced. So move
it in the correct "case SIGNAL_TYPE_EDP".
Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_h
ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().
Note that the upper limit of ida_simple_get() is exclusive, but the one of
ida_alloc_range() is inclusive. So a -1 has been added when needed.
Signed-off-by: Christophe JAILLET
'watermarks_table' must be freed instead 'clocks_table', because
'clocks_table' is known to be NULL at this point and 'watermarks_table' is
never freed if the last kzalloc fails.
Fixes: c98ee89736b8 ("drm/amd/pm: add the fine grain tuning function for
Hi,
Le 21/08/2021 à 04:08, CGEL a écrit :
From: Luo penghao
The first assignment is not used. In order to keep the code style
consistency of the whole file, the first 'data' assignment should be
deleted.
The clang_analyzer complains as follows:
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c:2608:10:
gt;dev, e2)
@@
expression e1, e2;
@@
-pci_set_dma_mask(e1, e2)
+dma_set_mask(&e1->dev, e2)
@@
expression e1, e2;
@@
- pci_set_consistent_dma_mask(e1, e2)
+dma_set_coherent_mask(&e1->dev, e2)
Signed-off-by: Christophe JAILLET
---
If needed, see post from Christoph Hellw
'doorbell_bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code,
improve the semantic and avoid some open-coded arithmetic in allocator
arguments.
Also change the corresponding 'kfree()' into 'bitmap_free()' to keep
consistency.
Signed-off-by:
The 'doorbell_bitmap' bitmap has just been allocated. So we can use the
non-atomic '__set_bit()' function to save a few cycles as no concurrent
access can happen.
Signed-off-by: Christophe JAILLET
---
bitmap_set() could certainly also be use, but range checking would be
tric
Le 22/11/2021 à 22:44, Felix Kuehling a écrit :
Am 2021-11-21 um 12:41 p.m. schrieb Christophe JAILLET:
The 'doorbell_bitmap' bitmap has just been allocated. So we can use the
non-atomic '__set_bit()' function to save a few cycles as no concurrent
access can happen.
Signe
The 'doorbell_bitmap' bitmap has just been allocated. So we can use the
non-atomic '__set_bit()' function to save a few cycles as no concurrent
access can happen.
Reviewed-by: Felix Kuehling
Signed-off-by: Christophe JAILLET
---
bitmap_set() could certainly also be use, but
to keep
consistency.
Reviewed-by: Felix Kuehling
Signed-off-by: Christophe JAILLET
---
v1 --> v2: Compile tested :)
Add a missing ',' (kernel test robot)
Add kfd_process_queue_manager.c (Felix Kuehling)
---
drivers/gpu/drm/amd/amdkfd/kfd_process.c | 7
27; loops. These functions can work on several bits at a
time
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 16 +---
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
b/drivers/gpu/drm/amd/amdkfd/kf
'kfd->gtt_sa_bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify
code, improve the semantic and avoid some open-coded arithmetic in
allocator arguments.
Also change the corresponding 'kfree()' into 'bitmap_free()' to keep
consistency.
---
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 12 +++
kmalloc_array()/kcalloc() should be used to avoid potential overflow when
a multiplication is needed to compute the size of the requested memory.
So turn a kzalloc()+explicit size computation into an equivalent kcalloc().
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/radeon
s/than/then/
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 89ebbf363e27..1476236f5c7c 100644
--- a/drivers
mdgpu: add support for exporting VRAM using DMA-buf
v3")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr
Le 15/01/2021 à 11:10, Colin Ian King a écrit :
On 15/01/2021 10:07, Christophe JAILLET wrote:
Le 15/01/2021 à 10:37, Colin Ian King a écrit :
On 12/01/2021 10:07, Dan Carpenter wrote:
On Mon, Jan 11, 2021 at 11:46:38AM +, Colin King wrote:
From: Colin Ian King
A recent change added a
Le 15/01/2021 à 10:37, Colin Ian King a écrit :
On 12/01/2021 10:07, Dan Carpenter wrote:
On Mon, Jan 11, 2021 at 11:46:38AM +, Colin King wrote:
From: Colin Ian King
A recent change added a new BOOTUP_DEFAULT power profile mode
to the PP_SMC_POWER_PROFILE enum but omitted updating the
co
Avoid a memset after a call to 'dma_alloc_coherent()'.
This is useless since
commit 518a2f1925c3 ("dma-mapping: zero memory returned from dma_alloc_*")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/radeon/radeon_gart.c | 1 -
1 file changed, 1 deletion(-)
diff --g
ion e1, e2;
@@
-pci_dma_mapping_error(e1, e2)
+dma_mapping_error(&e1->dev, e2)
@@
expression e1, e2;
@@
-pci_set_dma_mask(e1, e2)
+dma_set_mask(&e1->dev, e2)
@@
expression e1, e2;
@@
-pci_set_consistent_dma_mask(e1, e2)
+dma_set_coherent_mask(&e1->dev, e2)
Signed-o
quot;,
ucode_prefix);
|
^
Fixes: 69939009bde7 ("drm/amd: Load VCN microcode during early_init")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
,
No problem for me if you can add it. Thanks.
But if you prefer a v2, it is also fine for me.
BTW sorry for missing the SoB tag. This definitively means that I forgot
the checkpatch.pl step for this patch, which is bad.
CJ
Thanks,
Felix
Am 2021-11-28 um 11:45 schrieb Christophe JAILLET:
Le 21/02/2023 à 17:26, Felix Kuehling a écrit :
On 2023-02-21 06:35, qu.huang-fxuvxftifdnyg1zeobx...@public.gmane.org
wrote:
From: Qu Huang
In the kfd_wait_on_events() function, the kfd_event_waiter structure is
allocated by alloc_event_waiters(), but the event field of the waiter
structure
A kzalloc()+memcpy() can be optimized in a single kmemdup().
This saves a few cycles because some memory doesn't need to be zeroed.
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --
It is likely p1_min_meta_chunk_bytes was expected here, instead of
min_meta_chunk_bytes.
Test the correct variable.
Fixes: dda4fb85e433 ("drm/amd/display: DML changes for DCN32/321")
Signed-off-by: Christophe JAILLET
---
.../gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c
It is likely Height was expected here, instead of Width.
Test the correct variable.
Fixes: 17529ea2acfa ("drm/amd/display: Optimizations for DML math")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c | 2 +-
1 file changed, 1 inser
bda0322b8a ("drm/amd/display: Add DSC support for Navi (v2)")
Signed-off-by: Christophe JAILLET
---
NOT even compile-tested.
make -j7 drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.o
on my setup, it fails with:
CC drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.o
drivers/gpu/drm/amd/displa
Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c
b/drivers/gp
Use USEC_PER_SEC instead of defining an equivalent local 'us_in_sec'.
Signed-off-by: Christophe JAILLET
---
NOT compile tested. Because of some BROKEN in KConfig files.
Some header may be missing for USEC_PER_SEC!
---
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 4 +---
1 fi
ed accordingly.
Signed-off-by: Christophe JAILLET
---
NOT compile tested. Because of some BROKEN in KConfig files.
---
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 13 -
1 file changed, 13 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c
b/driv
Le 15/12/2022 à 17:36, Arnd Bergmann a écrit :
From: Arnd Bergmann
The activity_monitor_external[] array is too big to fit on the
kernel stack, resulting in this warning with clang:
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:1438:12: error:
stack frame size (1040) exceeds
Instead of zeroing some memory and then copying data in part or all of it,
use memcpy_and_pad().
This avoids writing some memory twice and should save a few cycles.
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 11 ---
drivers/gpu/drm/amd/amdgpu
This serie simplifies amdgpu_bo_list_create() and usage of the 'struct
amdgpu_bo_list'.
It is compile tested only.
Christophe JAILLET (4):
drm/amdgpu: Explicitly add a flexible array at the end of 'struct
amdgpu_bo_list'
drm/amdgpu: Remove a redundant sanity check
'struct amdgpu_bo_list' is really used as if it was ended by a flex array.
So make it more explicit and add a 'struct amdgpu_bo_list_entry entries[]'
field at the end of the structure.
This way, struct_size() can be used when it is allocated.
It is less verbose.
Signed-off-by
Le 21/08/2023 à 08:19, Su Hui a écrit :
smatch error:
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1257
amdgpu_discovery_reg_base_init() error:
testing array offset 'adev->vcn.num_vcn_inst' after use.
change the assignment order to avoid buffer overflow.
Fixes: c40bdfb2ffa4 ("drm/amdgpu: fix
The case where 'num_entries' is too big, is already handled by
struct_size(), because kvmalloc() would fail.
It will return -ENOMEM instead of -EINVAL, but it is only related to a
unlikely to happen sanity check.
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdgpu/amdgpu
kvzalloc() can be used instead of kvmalloc() + memset() + explicit NULL
assignments.
It is less verbose and more future proof.
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/gpu
Now that there is an explicit flexible array at the end of 'struct
amdgpu_bo_list', it can be used to remove amdgpu_bo_list_array_entry() and
simplify some macro.
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +-
drivers/gpu/drm/
'dc_stream_release()' may be called twice. Once here, and once below in the
error handling path if we branch to the 'fail' label.
Set 'new_stream' to NULL, once released to avoid the duplicated release
function call.
Signed-off-by: Christophe JAILLET
---
Mayb
Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'.
While at it, split some long lines that where not that far.
Signed-off-by: Christophe JAILLET
---
Most of them have been added in commit bd607166af7f ("drm/amdgpu: Enable
reading FRU chip vi
This should be 'amdgpu_dm', not 'amdpgu_dm'
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
b/drivers/gpu/drm/a
This should be 'dce_audio_mask', not 'dce_aduio_mask'.
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 2 +-
drivers/gpu/drm/amd/display/dc/dce/dce_audio.h | 6 +++---
drivers/gpu/drm/amd/display/dc/dce100/d
'_navi10_ip_offset_HEADER' is already used in 'navi10_ip_offset.h', so use
'_navi12_ip_offset_HEADER' instead here.
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/include/navi12_ip_offset.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
di
p and g are switched in 'amdpgu_dm'
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
b/drivers/gpu/drm/amd/display
case!
failure in amdgpu_cs_process_syncobj_out_dep()
---> error code returned by amdgpu_cs_dependencies()
--> amdgpu_cs_parser_fini() is called
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/
Le 29/10/2024 à 11:18, Li Huafei a écrit :
Fix the potential NULL pointer dereference on mem_ranges in
amdgpu_discovery_get_nps_info(). Additionally, assign the output
parameters nps_type and range_cnt after the kvzalloc() call to prevent
modifying the output parameters in case of an error return
In case of error after a amdgpu_gfx_rlc_enter_safe_mode() call, it is not
balanced by a corresponding amdgpu_gfx_rlc_exit_safe_mode() call.
Add the missing call.
Fixes: c6a6e2db9945 ("drm/amdgpu: Redo XGMI reset synchronization.")
Signed-off-by: Christophe JAILLET
---
Compile tested o
In case of error after a amdgpu_gfx_rlc_enter_safe_mode() call, it is not
balanced by a corresponding amdgpu_gfx_rlc_exit_safe_mode() call.
Add the missing call.
Fixes: 9b7b8154cdb8 ("drm/amd/powerplay: added didt support for vega10")
Signed-off-by: Christophe JAILLET
---
*Not* ev
fc drivers/gpu/drm/radeon/radeon_drv.o
After:
=
textdata bss dec hex filename
4 664 44 407089f04 drivers/gpu/drm/radeon/radeon_drv.o
Signed-off-by: Christophe JAILLET
---
Compile tested-only.
---
drivers/gpu/drm/radeon/radeon_drv.c | 3 +--
1 file
Le 18/04/2025 à 02:21, li...@treblig.org a écrit :
From: "Dr. David Alan Gilbert"
radeon_doorbell_free() was added in 2013 by
commit 75efdee11b5d ("drm/radeon: implement simple doorbell page
allocator")
but never used.
Hi,
I think than instead of being removed, it should be used in the error
'struct timing_generator_funcs' are not modified in these drivers.
Constifying these structures moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.
Signed-off-by: Christophe JAILLET
---
This is NOT comp
If kasprintf() fails, some mutex still need to be released to avoid locking
issue, as already done in all other error handling path.
Fixes: c03ea34cbf88 ("drm/amdgpu: add support of debugfs for mqd information")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/amd/amdgpu/amdgpu_u
Le 10/08/2020 à 17:42, Dan Carpenter a écrit :
On Sun, Aug 09, 2020 at 10:34:06PM +0200, Christophe JAILLET wrote:
When '*sgt' is allocated, we must allocated 'sizeof(**sgt)' bytes instead
of 'sizeof(*sg)'. 'sg' (i.e. struct scatterlist) is smaller t
t and can be dropped.
Fixes: 97bda0322b8a ("drm/amd/display: Add DSC support for Navi (v2)")
Reported-by: Christophe JAILLET
Signed-off-by: Hamza Mahfooz
---
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/
Le 15/12/2022 à 20:46, Christophe JAILLET a écrit :
Le 15/12/2022 à 17:36, Arnd Bergmann a écrit :
From: Arnd Bergmann
The activity_monitor_external[] array is too big to fit on the
kernel stack, resulting in this warning with clang:
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13
55 matches
Mail list logo