[bug report] drm/amd/display: Find max flickerless instant vtotal delta

2024-05-24 Thread Dan Carpenter
gt;timing.v_total is u32 so it makes the subtract u32 thus it's always >= 0. 1007 1008 return ((safe_refresh_v_total - stream->timing.v_total) >= 0) ? (safe_refresh_v_total - stream->timing.v_total) : 0; ^^^ Same. 1009 } regards, dan carpenter

Re: [PATCH v3] drm/amdkfd: Remove bo NULL check in gmc_v12_0_get_vm_pte() function

2024-05-15 Thread Dan Carpenter
check 'bo' (see line 500)' > > Signed-off-by: Sreekant Somasekharan > Suggested-by: Dan Carpenter > --- This is fine, but you're overthinking these... The v1 patch was also fine. regards, dan carpenter

[bug report] drm/amd/display: Introduce DML2

2024-05-09 Thread Dan Carpenter
igned int result = 0; 573 bool need_recalculation = false; 574 uint32_t cstate_enter_plus_exit_z8_ns; 575 576 if (!context || context->stream_count == 0) Checked too late 577 return true; 578 regards, dan carpenter

[PATCH] drm/amdgpu: delete unnecessary check

2024-05-06 Thread Dan Carpenter
The "ret" variable is zero. No need to check. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index a0

[bug report] drm/amdkfd: mark GFX12 system and peer GPU memory mappings as MTYPE_NC

2024-05-06 Thread Dan Carpenter
*flags &= ~AMDGPU_PTE_VALID; 516 } 517 518 if (bo && bo->flags & (AMDGPU_GEM_CREATE_COHERENT | ^^ But previously we assumed bo could be NULL. 519 AMDGPU_GEM_CREATE_UNCACHED)) 520

[bug report] drm/amd/display: Do cursor programming with rest of pipe

2024-05-06 Thread Dan Carpenter
if (!dc_stream_set_cursor_position(crtc_state->stream, 8443)) 8444 DRM_ERROR("DC failed to set cursor position\n"); 8445 8446 update->cursor_position = _state->stream->cursor_position; 8447 } 8448 } regards, dan carpenter

[bug report] drm/amdgpu: Add sdma v7_0 ip block support (v7)

2024-05-06 Thread Dan Carpenter
} 175 } else { 176 if (ring->use_doorbell) { 177 DRM_DEBUG("Using doorbell -- " 178 "wptr_offs == 0x%08x " regards, dan carpenter

[PATCH] drm/amd/pm: Fix error code in vega10_hwmgr_backend_init()

2024-05-06 Thread Dan Carpenter
Return -EINVAL on error instead of success. Also on the success path, return a literal zero instead of "return result;" Fixes: e098bc9612c2 ("drm/amd/pm: optimize the power related source code layout") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/pm/powerplay/hwmg

[bug report] drm/amd/display: Separate setting and programming of cursor

2024-05-06 Thread Dan Carpenter
ons if enabling cursor */ 404 if (dc->idle_optimizations_allowed && 405 (!old_position->enable || dc->debug.exit_idle_opt_for_cursor_updates) && 406 position->enable) { 407 dc_

[PATCH] drm/amd/display: re-indent dpp401_dscl_program_isharp()

2024-04-28 Thread Dan Carpenter
at I could replace "scl_data->dscl_prog_data." with just "data->" and shorten the lines a bit. It's more readable without the line breaks. I also tried to align it so you can see what is changing on each line. Signed-off-by: Dan Carpenter --- .../display/dc

[PATCH] drm/amdgpu: Fix signedness bug in sdma_v4_0_process_trap_irq()

2024-04-28 Thread Dan Carpenter
The "instance" variable needs to be signed for the error handling to work. Fixes: b34ddc71267a ("drm/amdgpu: add error handle to avoid out-of-bounds") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH v2] drm/amd/display: re-indent dc_power_down_on_boot()

2024-04-25 Thread Dan Carpenter
These lines are indented too far. Clean the whitespace. Signed-off-by: Dan Carpenter --- v2: Delete another blank line (checkpatch.pl --strict). drivers/gpu/drm/amd/display/dc/core/dc.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc

Re: [PATCH] drm/amd/display: re-indent dc_power_down_on_boot()

2024-04-25 Thread Dan Carpenter
On Wed, Apr 24, 2024 at 03:11:08PM +0200, Christian König wrote: > Am 24.04.24 um 13:41 schrieb Dan Carpenter: > > These lines are indented too far. Clean the whitespace. > > > > Signed-off-by: Dan Carpenter > > --- > > drivers/gpu/drm/amd/display/dc/core/dc.c

Re: [PATCH] drm/amd/display: re-indent dc_power_down_on_boot()

2024-04-25 Thread Dan Carpenter
On Wed, Apr 24, 2024 at 03:33:11PM +0200, Christian König wrote: > Am 24.04.24 um 15:20 schrieb Dan Carpenter: > > On Wed, Apr 24, 2024 at 03:11:08PM +0200, Christian König wrote: > > > Am 24.04.24 um 13:41 schrieb Dan Carpenter: > > > > These lines are indented

[PATCH] drm/amd/display: re-indent dc_power_down_on_boot()

2024-04-25 Thread Dan Carpenter
These lines are indented too far. Clean the whitespace. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/dc/core/dc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c

[bug report] drm/amd/display: Remove plane and stream pointers from dc scratch

2024-04-08 Thread Dan Carpenter
dpp_base->funcs->dpp_program_degamma_pwl(dpp_base, regards, dan carpenter

[bug report] drm/amd/display: Allow Z8 when stutter threshold is not met

2024-04-08 Thread Dan Carpenter
;& link->replay_settings.replay_feature_enabled; but the patch assumes link can be NULL. Somebody is wrong. regards, dan carpenter

[PATCH] drm/amd/display: delete unnecessary check in dcn35_set_long_vblank()

2024-03-16 Thread Dan Carpenter
"timing" is "_ctx[i]->stream->timing" where ->timing is not the first struct member of ->stream. So it's the address which points into the middle of a struct. It can't be NULL so delete the NULL check. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/dis

Re: [bug report] drm/amdgpu: add ring buffer information in devcoredump

2024-03-16 Thread Dan Carpenter
, dan carpenter

[bug report] drm/amdgpu: add ring buffer information in devcoredump

2024-03-15 Thread Dan Carpenter
p->adev->reset_info.num_regs; i++) 245 drm_printf(, "0x%08x: 0x%08x\n", 246 coredump->adev->reset_info.reset_dump_reg_list[i], 247 coredump->adev->reset_info.reset_dump_reg_value[i]); 248 } 249 250 return count - iter.remain; 251 } regards, dan carpenter

[bug report] drm/amd/display: Add debug counters to IPS exit prints

2024-03-15 Thread Dan Carpenter
rv, true)) 1396 ASSERT(0); 1397 --> 1398 DC_LOG_IPS("%s exit (count rcg=%d ips1=%d ips2=%d)", 1399 __func__, 1400 rcg_exit_count, 1401 ips1_exit_count, 1402 ips2_exit_count); used here 1403 } regards, dan carpenter

[bug report] drm/amd/display: fix null-pointer dereference on edid reading

2024-02-27 Thread Dan Carpenter
, sizeof(struct dc_edid_caps)); 6685 memmove(dc_em_sink->dc_edid.raw_edid, edid, (edid->extensions + 1) * EDID_LENGTH); regards, dan carpenter

[PATCH] drm/amd/display: Fix && vs || typos

2024-02-09 Thread Dan Carpenter
These ANDs should be ORs or it will lead to a NULL dereference. Fixes: fb5a3d037082 ("drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()'") Fixes: 886571d217d7 ("drm/amd/display: Fix 'panel_cntl' could be null in 'dcn21_set_backlight_level()'"

Re: [bug report] drm/amd/display: Simplify the per-CPU usage.

2024-02-01 Thread Dan Carpenter
On Thu, Feb 01, 2024 at 02:53:42PM +0100, Sebastian Andrzej Siewior wrote: > On 2024-02-01 15:18:04 [+0300], Dan Carpenter wrote: > > Hello Sebastian Andrzej Siewior, > Hi Dan, > > > The patch de5e73dc6baf: "drm/amd/display: Simplify the per-CPU > > usage."

[bug report] drm/amd/display: Simplify the per-CPU usage.

2024-02-01 Thread Dan Carpenter
ap_funcs = cap_funcs; 2584 2585 if (dc->ctx->dc_bios->fw_info.oem_i2c_present) { 2586 ddc_init_data.ctx = dc->ctx; 2587 ddc_init_data.link = NULL; 2588 ddc_init_data.id.id = dc->ctx->dc_bios->fw_info.oem_i2c_obj_id; 2589 ddc_init_data.id.enum_id = 0; 2590 ddc_init_data.id.type = OBJECT_TYPE_GENERIC; 2591 pool->base.oem_device = dc->link_srv->create_ddc_service(_init_data); 2592 } else { 2593 pool->base.oem_device = NULL; 2594 } 2595 2596 DC_FP_END(); 2597 2598 return true; 2599 2600 create_fail: 2601 2602 DC_FP_END(); 2603 dcn30_resource_destruct(pool); 2604 2605 return false; 2606 } regards, dan carpenter

[bug report] drm/amd/display: Add dpia display mode validation logic

2024-01-23 Thread Dan Carpenter
ia_secondary->dpia_bw_alloc_config.estimated_bw; 227 } 228 break; 229 } 230 } 231 232 return total_bw; 233 } regards, dan carpenter

[bug report] drm/amdgpu: Auto-validate DMABuf imports in compute VMs

2024-01-12 Thread Dan Carpenter
_compute_context && bo_va->base.bo && ^^ The patch adds this NULL check but hopefully it's not required. 1481 bo_va->base.bo->tbo.base.import_attach && 1482 (!bo_va->base.bo->tbo.resource || regards, dan carpenter

[PATCH] drm/amdgpu: fix return value in aca_bank_hwip_is_matched()

2024-01-12 Thread Dan Carpenter
The aca_bank_hwip_is_matched() function is type bool. This error path return -EINVAL which is cast to true, but it should return false instead. Fixes: 22a4fa4709e3 ("drm/amdgpu: implement RAS ACA driver framework") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu

[bug report] drm/amdgpu/vpe: enable vpe dpm

2024-01-05 Thread Dan Carpenter
or); 67 68 uint16_t remainder; 69 regards, dan carpenter

[bug report] drm/amdgpu: Workaround to skip kiq ring test during ras gpu recovery

2023-12-04 Thread Dan Carpenter
eturn 0; 545 } 546 547 if (kiq_ring->sched.ready && !adev->job_hang) 548 r = amdgpu_ring_test_helper(kiq_ring); 549 spin_unlock(>ring_lock); regards, dan carpenter

[bug report] drm/amd/display: Add interface to enable DPIA trace

2023-10-31 Thread Dan Carpenter
alid parameters.", __func__); ^ This macro dereferences dc_dmub_srv. 1042 return; 1043 } 1044 1045 dmub = dc_dmub_srv->dmub; regards, dan carpenter

[bug report] drm/amdgpu: Workaround to skip kiq ring test during ras gpu recovery

2023-10-24 Thread Dan Carpenter
sable_kcq() which is holding spin_lock(>ring_lock). And we can't take a mutex if we're already holding a spin_lock. Turn on CONFIG_DEBUG_ATOMIC_SLEEP to see the warning. regards, dan carpenter

[bug report] drm/amd/display: Introduce DML2

2023-10-20 Thread Dan Carpenter
l2->v20.scratch.dml_to_dc_pipe_mapping.dml_pipe_idx_to_plane_id[num_pipes] = dml2->v20.scratch.dml_to_dc_pipe_mapping.disp_cfg_to_plane_id[i]; 80 dml2->v20.scratch.dml_to_dc_pipe_mapping.dml_pipe_idx_to_plane_id_valid[num_pipes] = true; 81 num_pipes++; 82 } 83 } 84 } regards, dan carpenter

[bug report] drm/amd/display: Introduce DML2

2023-10-20 Thread Dan Carpenter
132.0 * 383.0 / 384.0 * 65536.0 / 65540.0; There are a bunch of other warnings as well. Too many to review. regards, dan carpenter drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2903 dm_resume() warn: inconsistent indenting drivers/gpu/drm/amd/amdgpu/../display/dc/basics/dc

[bug report] drm/amd/display: add DMUB registers to crash dump diagnostic data.

2023-09-28 Thread Dan Carpenter
} 803 804 if (!dc_dmub_srv_get_diagnostic_data(dc_dmub_srv, _data)) { regards, dan carpenter

[bug report] drm/amd/display: switch DC over to the new DRM logging macros

2023-09-28 Thread Dan Carpenter
546 547 return drm_dp_dpcd_read(>dm_dp_aux.aux, address, data, 548 size) == size; 549 } regards, dan carpenter

[PATCH] drm/amd/pm: delete dead code

2023-09-27 Thread Dan Carpenter
"ret" was checked earlier inside the loop, so we know it is zero here. No need to check a second time. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13

[bug report] drm/amd/display: Add DCN35 CLK_MGR

2023-09-06 Thread Dan Carpenter
i, smu_dpm_clks.dpm_clks->DfPstateTable[i].MemClk, 977 i, smu_dpm_clks.dpm_clks->DfPstateTable[i].Voltage); 978 } 979 980 if (ctx->dc_bios && ctx->dc_bios->integrated_info && ctx->dc->config.use_default_clock_table == false) { This NULL check is too late. It will already have crashed. 981 dcn35_clk_mgr_helper_populate_bw_params( 982 _mgr->base, regards, dan carpenter

[bug report] Mass report of new Smatch warnings

2023-09-06 Thread Dan Carpenter
Here is the list of new warning which were introduced while I was out of office. The line numbers are from linux-next next-20230905. regards, dan carpenter drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c:292 dcn35_update_clocks() warn: inconsistent indenting drivers/gpu

[PATCH] drm/amdgpu: fix retry loop test

2023-09-06 Thread Dan Carpenter
This loop will exit with "retry" set to -1 if it fails but the code checks for if "retry" is zero. Fix this by changing post-op to a pre-op. --retry vs retry--. Fixes: e01eeffc3f86 ("drm/amd/pm: avoid driver getting empty metrics table for the first time"

Re: [bug report] drm/amdgpu: add selftest framework for UMSCH

2023-09-06 Thread Dan Carpenter
On Wed, Sep 06, 2023 at 07:07:32PM +0800, Lang Yu wrote: > On 09/06/ , Dan Carpenter wrote: > > Thanks for reporting this bug. Can you give a link to this bug report? Commit > message requests it. > ("Reported-by: should be immediately followed by Link: with a URL to the >

[bug report] drm/amdgpu: add selftest framework for UMSCH

2023-09-06 Thread Dan Carpenter
339 r = test->pasid; 340 goto error_fini_vm; 341 } 342 343 r = amdgpu_bo_create_kernel(adev, sizeof(struct umsch_mm_test_ctx_data), regards, dan carpenter

[bug report] drm/amd/display: Add Functions to enable Freesync Panel Replay

2023-08-09 Thread Dan Carpenter
enabled) 860 replay->funcs->replay_enable(replay, *allow_active, wait, panel_inst); 861 link->replay_settings.replay_allow_active = *allow_active; 862 } 863 864 return true; 865 } regards, dan carpenter

[bug report] drm/amdgpu: optimize amdgpu device attribute code

2023-08-01 Thread Dan Carpenter
_attr_update; regards, dan carpenter

[PATCH] drm/amd/display: Unlock on error path in dm_handle_mst_sideband_msg_ready_event()

2023-07-21 Thread Dan Carpenter
This error path needs to unlock the "aconnector->handle_mst_msg_ready" mutex before returning. Fixes: bb4fa525f327 ("drm/amd/display: Add polling method to handle MST reply packet") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst

[bug report] drm/amd/display: Reduce stack size

2023-07-20 Thread Dan Carpenter
_update); 8794 mutex_unlock(>dc_lock); 8795 kfree(dummy_updates); regards, dan carpenter

Re: [PATCH v3 00/18] fbdev: Remove FBINFO_DEFAULT and FBINFO_FLAG_DEFAULT flags

2023-07-14 Thread Dan Carpenter
: Remove FBINFO_DEFAULT from static structs fbdev: Remove FBINFO_DEFAULT from kzalloc() structs fbdev: Remove FBINFO_DEFAULT from devm_kzalloc() structs regards, dan carpenter

[bug report] drm/amdgpu/gfx11: add aggregated doorbell support

2023-07-11 Thread Dan Carpenter
tr)); 5207 } 5208 } 5209 } regards, dan carpenter

Re: [PATCH] drm/amd/amdgpu: Properly tune the size of struct

2023-06-21 Thread Dan Carpenter
pes properly packed individually, rather than use the disgusting "pragma pack()" that should never be used." https://lore.kernel.org/linux-sparse/CAHk-=wi7jgz+bvbt-ufxokpeqdhzf3z2hbjkgdjh8q4dvpp...@mail.gmail.com/ regards, dan carpenter

Re: [PATCH] drm/amd/amdgpu: Use “__packed“ instead of "pragma pack()"

2023-06-21 Thread Dan Carpenter
r; Smatch complains that we don't necessarily enter the loop. I think I'm going to disable this type of "enter the loop" warning when you don't have the cross function database available. That will silence these for the kbuild bot. regards, dan carpenter Hi Su, kernel test robot noticed

Re: [PATCH] drm/amd/amdgpu: Properly tune the size of struct

2023-06-21 Thread Dan Carpenter
On Tue, Jun 20, 2023 at 10:37:59AM +0300, Dan Carpenter wrote: > "Mark the associated types properly packed individually, rather than > use the disgusting "pragma pack()" that should never be used." > > https://lore.kernel.org/linux-sparse/CAHk-=wi7jgz+bvb

[PATCH] drm/amdkfd: potential error pointer dereference in ioctl

2023-06-06 Thread Dan Carpenter
The "target" either comes from kfd_create_process() which returns error pointers on error or kfd_lookup_process_by_pid() which returns NULL on error. So we need to check for both types of errors. Fixes: a42e42c4e3b1 ("drm/amdkfd: prepare per-process debug enable and disable"

[PATCH] drm/amd/pm: Fix memory some memory corruption

2023-06-06 Thread Dan Carpenter
m: fulfill the OD support for SMU13.0.7") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 4 ++-- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu1

[bug report] drm: Track drm_mm allocators and show leaks on shutdown

2023-05-30 Thread Dan Carpenter
ers for drm_mm_takedown() are holding spinlocks so it's a sleeping in atomic bug. The problematic callers are ttm_range_man_fini_nocheck() and amdgpu_gtt_mgr_fini(). 1002 } regards, dan carpenter

[bug report] drm/amd/display: Check clock table return

2023-05-30 Thread Dan Carpenter
t;integrated_info) { Check for NULL is too late. 776 rn_clk_mgr_helper_populate_bw_params (clk_mgr->base.bw_params, _table, ctx->dc_bios->integrated_info); 777 /* treat memory config as single channel if memory is asymmetrics. */ regards, dan carpenter

[PATCH] drm/amd/amdgpu: Fix up locking etc in amdgpu_debugfs_gprwave_ioctl()

2023-05-25 Thread Dan Carpenter
/amdgpu: Update debugfs for XCC support (v3)") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c ind

[bug report] drm/amd/display: Clean FPGA code in dc

2023-05-24 Thread Dan Carpenter
y) 779 clk_mgr->base.bw_params->num_channels = 1; 780 } 781 } 782 783 /* enable powerfeatures when displaycount goes to 0 */ 784 if (clk_mgr->smu_ver >= 0x00371500) 785 rn_vbios_smu_enable_48mhz_tmdp_refclk_pwrdwn(clk_mgr, !debug->disable_48mhz_pwrdwn); 786 } regards, dan carpenter

[bug report] drm/amd/display: Add connector HPD trigger debugfs entry

2023-05-19 Thread Dan Carpenter
aconnector->dc_link) ^^^ Too late. Dead already. 1221 return -EINVAL; 1222 1223 if (size == 0) regards, dan carpenter

Re: [PATCH] drm/amdgpu: remove unnecessary (void*) conversions

2023-05-15 Thread Dan Carpenter
On Mon, May 15, 2023 at 10:11:39AM -0400, Alex Deucher wrote: > On Mon, May 15, 2023 at 3:17 AM Dan Carpenter > wrote: > > > > On Mon, May 15, 2023 at 09:34:28AM +0800, Su Hui wrote: > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c > &g

Re: [PATCH] drm/amdgpu: remove unnecessary (void*) conversions

2023-05-15 Thread Dan Carpenter
e; So you probably want to change the order now that the lengths have changed. Same in the other places as well. regards, dan carpenter

[PATCH] drm/amdgpu: release correct lock in amdgpu_gfx_enable_kgq()

2023-05-09 Thread Dan Carpenter
This function was releasing the incorrect lock on the error path. Reported-by: kernel test robot Fixes: 9bfa241d1289 ("drm/amdgpu: add [en/dis]able_kgq() functions") Signed-off-by: Dan Carpenter --- The LKP robot sent me an email about this after I had already written the patch. (I

[PATCH] drm/amdgpu: unlock on error in gfx_v9_4_3_kiq_resume()

2023-05-03 Thread Dan Carpenter
uot;) Signed-off-by: Dan Carpenter --- The Fixes tag is weird, but I think it's correct? drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c index 56a415e151

[PATCH] drm/amdgpu: unlock the correct lock in amdgpu_gfx_enable_kcq()

2023-05-03 Thread Dan Carpenter
We changed which lock we are supposed to take but this error path was accidentally over looked so it still drops the old lock. Fixes: def799c6596d ("drm/amdgpu: add multi-xcc support to amdgpu_gfx interfaces (v4)") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu

[bug report] drm/amd/display: Use per pipe P-State force for FPO

2023-04-04 Thread Dan Carpenter
re done programming. 2008 */ 2009 if (hwseq->funcs.program_mall_pipe_config) 2010 hwseq->funcs.program_mall_pipe_config(dc, context); 2011 regards, dan carpenter

[PATCH] drm/amdgpu: fix AMDGPU_RAS_BLOCK__DF check

2023-03-29 Thread Dan Carpenter
There is a mixup where AMDGPU_RAS_BLOCK__DF is used as a mask instead of a shifter. It means that this condition will be true for AMDGPU_RAS_BLOCK__MMHUB instead of for AMDGPU_RAS_BLOCK__DF. Fixes: b6f512168478 ("drm/amdgpu: Add fatal error handling in nbio v4_3") Signed-off-by: Dan

[bug report] drm/amd/display: move eDP panel control logic to link_edp_panel_control

2023-03-22 Thread Dan Carpenter
357 --> 358 return result; ^^ result is a non-zero enum so this always returns true. Which is fine because the caller doesn't check. 359 } regards, dan carpenter

[bug report] drm/amd/display: Various logs added

2023-02-27 Thread Dan Carpenter
^ Too late. 1863 return BP_RESULT_BADBIOSTABLE; 1864 regards, dan carpenter

[bug report] drm/amd/display: break down dc_link.c

2023-02-16 Thread Dan Carpenter
^^ 364 365 if (!link->link_enc) { ^^ Checked too late 366 DC_ERROR("Failed to create link encoder!\n"); 367 goto link_enc_create_fail; 368 } 369 regards, dan carpenter

[bug report] drm/amd/display: Disable MALL SS and messages for PSR supported configs

2023-02-06 Thread Dan Carpenter
Checked too late. 258 259 /* 1. Check no memory request case for CAB. regards, dan carpenter

[bug report] drm/amd/display: move eDP panel control logic to link_edp_panel_control

2023-01-26 Thread Dan Carpenter
--> 353 return result; 354 } regards, dan carpenter

[PATCH] drm/amdgpu: Add a missing tab

2023-01-13 Thread Dan Carpenter
This tab was deleted accidentally and triggers a Smatch warning: drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:1006 gfx_v8_0_init_microcode() warn: inconsistent indenting Add it back. Fixes: 0aaafb7359d2 ("drm/amd: Use `amdgpu_ucode_*` helpers for GFX8") Signed-off-by: Dan

Re: [PATCH v6] drm: Optimise for continuous memory allocation

2022-12-23 Thread Dan Carpenter
test robot | Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/drm_buddy.c:501 find_continuous_blocks() error: uninitialized symbol 'block'. vim +/block +501 drivers/gpu/drm/drm_buddy.c 8a257b57bc11a2 xinhui pan 2022-12-18 472 static struct drm_buddy_block * 8a257b57bc11a2 xinhui pan

[PATCH] drm/amdkfd: Remove unnecessary condition in kfd_topology_add_device()

2022-11-25 Thread Dan Carpenter
We re-arranged this code recently so "ret" is always zero at this point. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/

Re: [PATCH] drm/amdkfd: Release the topology_lock in error case

2022-11-16 Thread Dan Carpenter
On Wed, Nov 16, 2022 at 03:49:18PM -0500, Felix Kuehling wrote: > Am 2022-11-16 um 03:04 schrieb Ma Jun: > > Release the topology_lock in error case > > > > Signed-off-by: Ma Jun > > Reported-by: Dan Carpenter > Dan, did you change your email address, is this on

[bug report] drm/amdkfd: Fix the warning of array-index-out-of-bounds

2022-11-15 Thread Dan Carpenter
res); 1880 } 1881 up_write(_lock); ^ Drops the lock. The patch has some other locking changes which are not explained in the commit message and seem unrelated to the out of bounds issue. 1882 1883 dev->gpu_id = gpu_id; 1884 gpu->id = gpu_id; regards, dan carpenter

[PATCH] amdgpu/pm: prevent array underflow in vega20_odn_edit_dpm_table()

2022-11-15 Thread Dan Carpenter
In the PP_OD_EDIT_VDDC_CURVE case the "input_index" variable is capped at 2 but not checked for negative values so it results in an out of bounds read. This value comes from the user via sysfs. Fixes: d5bf26539494 ("drm/amd/powerplay: added vega20 overdrive support V3"

[bug report] drm/amdgpu/mes: use ring for kernel queue submission

2022-10-26 Thread Dan Carpenter
2 queue_id); 1063 else 1064 BUG(); 1065 1066 *out = ring; 1067 return 0; 1068 1069 clean_up_ring: 1070 amdgpu_ring_fini(ring); 1071 clean_up_memory: 1072 kfree(ring); 1073 amdgpu_mes_unlock(>mes); 1074 return r; 1075 } regards, dan carpenter

[bug report] drm/amd/display: Update MALL SS NumWays calculation

2022-10-05 Thread Dan Carpenter
case CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA: 297 case CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA: 298 cursor_size *= 4; 299 cursor_bpp = 4; 300 break; 301 regards, dan carpenter

[bug report] drm/amd/display: Reverted DSC programming sequence change

2022-09-15 Thread Dan Carpenter
eam enable *unless* the failure was due to 4324 * DP link training - some DP monitors will recover and 4325 * show the stream anyway. But MST displays can't proceed regards, dan carpenter

Re: [PATCH] drm/amdkfd: potential crash in kfd_create_indirect_link_prop()

2022-08-15 Thread Dan Carpenter
On Fri, Aug 12, 2022 at 05:10:51PM -0400, Felix Kuehling wrote: > On 2022-08-12 02:20, Dan Carpenter wrote: > > This code has two bugs. If kfd_topology_device_by_proximity_domain() > > failed on the first iteration through the loop then "cpu_link" is >

[PATCH] drm/amdkfd: potential crash in kfd_create_indirect_link_prop()

2022-08-12 Thread Dan Carpenter
r to test for valid vs invalid. Fixes: 0f28cca87e9a ("drm/amdkfd: Extend KFD device topology to surface peer-to-peer links") Signed-off-by: Dan Carpenter --- I reported these in June but never heard back. drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 11 +++ 1 file changed, 7 i

[bug report] drm/amd/display: Add SubVP required code

2022-08-01 Thread Dan Carpenter
ULL); 106 smu_print("Numways for SubVP : %d\n", num_ways); 107 } regards, dan carpenter

amdgpu: misc ugliness and inconsistency

2022-07-26 Thread Dan Carpenter
. regards, dan carpenter Inconsistent NULL checks: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:1271 handle_cursor_update() error: we previously assumed 'afb' could be null (see line 1230) drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_resource.c:1017

Re: [bug report] drm/amd/display: use FB pitch to fill dc_cursor_attributes

2022-07-26 Thread Dan Carpenter
;fb && !old_plane_state->fb) return; Should the && be ||? regards, dan carpenter

[bug report] drm/amd/display: DML changes for DCN32/321

2022-07-26 Thread Dan Carpenter
iredBPP; 1649 } 1650 1651 *RequiredSlots = dml_ceil(DesiredBPP / MaxLinkBPP * 64, 1); 1652 1653 return BPP_INVALID; 1654 } // TruncToValidBPP regards, dan carpenter

[PATCH] drm/amd/display: Fix apply_synaptics_fifo_reset_wa()

2022-07-26 Thread Dan Carpenter
There is a stray return which accidentally turns the last part of the function into dead code. Fixes: 2ca97adccdc9 ("drm/amd/display: Add Synaptics Fifo Reset Workaround") Signed-off-by: Dan Carpenter --- >From static analysis. Untested. drivers/gpu/drm/amd/disp

[bug report] drm/amd/display: Synchronize displays with different timings

2022-07-26 Thread Dan Carpenter
opp->funcs->opp_program_dpg_dimensions(opp, width, height); 2219 } 2220 } regards, dan carpenter

[bug report] drm/amd/display: use FB pitch to fill dc_cursor_attributes

2022-07-26 Thread Dan Carpenter
DRM_ERROR("DC failed to set cursor attributes\n"); 1278 1279 if (!dc_stream_set_cursor_position(crtc_state->stream, 1280)) 1281 DRM_ERROR("DC failed to set cursor position\n"); 1282 mutex_unlock(>dm.dc_lock); 1283 } 1284 } regards, dan carpenter

[bug report] drm/amd/display: Add dcn3.01 support to DC (v2)

2022-07-26 Thread Dan Carpenter
rn clock_table->DcfClocks[i]; ^ The ->SocVoltage[] array has 8 elements but the ->DcfClocks[] array only has 7 and the mismatch leads to an out of bounds. 540 } 541 542 ASSERT(0); 543

[bug report] drm/amd/display: Initial DC support for Beige Goby

2022-07-26 Thread Dan Carpenter
rn >base; 396 } regards, dan carpenter

[bug report] drm/amdgpu: create I2S platform devices for Jadeite platform

2022-07-26 Thread Dan Carpenter
dev_err(>pdev->dev, "Failed to reset ACP\n"); 492 r = -ETIMEDOUT; 493 goto failure; 494 } 495 udelay(100); 496 } 497 /* Deassert the SOFT RESET flags */ 498 val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET); 499 val &= ~ACP_SOFT_RESET__SoftResetAud_MASK; 500 cgs_write_register(adev->acp.cgs_device, mmACP_SOFT_RESET, val); 501 return 0; 502 503 failure: 504 kfree(i2s_pdata); 505 kfree(adev->acp.acp_res); 506 kfree(adev->acp.acp_cell); 507 kfree(adev->acp.acp_genpd); 508 return r; 509 } regards, dan carpenter

[PATCH] drm/amd/display: fix signedness bug in execute_synaptics_rc_command()

2022-07-26 Thread Dan Carpenter
The "ret" variable needs to be signed for the error handling to work. Fixes: 2ca97adccdc9 ("drm/amd/display: Add Synaptics Fifo Reset Workaround") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- 1 file changed, 1 inse

[bug report] drm/amd/display: Add basic infrastructure for enabling FAMS

2022-07-15 Thread Dan Carpenter
rm_enabled = dc->debug.visual_confirm == VISUAL_CONFIRM_FAMS; Dereference 310 311 if (dc == NULL) ^^ NULL check is too late 312 return false; 313

[bug report] drm/amdgpu/mes: ring aggregatged doorbell when mes queue is unmapped

2022-07-14 Thread Dan Carpenter
} else { 8562 WREG32_SOC15(GC, 0, mmCP_RB0_WPTR, 8563 lower_32_bits(ring->wptr)); 8564 WREG32_SOC15(GC, 0, mmCP_RB0_WPTR_HI, 8565 upper_32_bits(ring->wptr));

[PATCH] drm/amd/display: Remove unnecessary NULL check in commit_planes_for_stream()

2022-07-13 Thread Dan Carpenter
Smatch complains that: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3369 commit_planes_for_stream() warn: variable dereferenced before check 'stream' (see line 3114) The 'stream' pointer cannot be NULL and the check can be removed. Signed-off-by: Dan Carpenter --- drivers/gpu

Re: [linux-next:master] BUILD REGRESSION 088b9c375534d905a4d337c78db3b3bfbb52c4a0

2022-07-08 Thread Dan Carpenter
: from is NULL but dereferenced. drivers/android/binder.c:2920:29-33: ERROR: target_thread is NULL but dereferenced. drivers/android/binder.c:353:25-35: ERROR: node -> proc is NULL but dereferenced. drivers/android/binder.c:4888:16-20: ERROR: t is NULL but dereferenced. regards, dan carpenter

Re: [PATCH] drm/amdkfd: Fix warnings from static analyzer Smatch

2022-06-29 Thread Dan Carpenter
esh Errabolu > Reported-by: Dan Carpenter This needs a Fixes tag as well. regards, dan carpenter

Re: [PATCH] drm/amdkfd: Fix warnings from static analyzer Smatch

2022-06-29 Thread Dan Carpenter
On Tue, Jun 28, 2022 at 07:41:09PM -0400, Felix Kuehling wrote: > > Am 2022-06-28 um 19:25 schrieb Ramesh Errabolu: > > The patch fixes couple of warnings, as reported by Smatch > > a static analyzer > > > > Signed-off-by: Ramesh Errabolu > > Reported-by:

[bug report] drm/amdkfd: Extend KFD device topology to surface peer-to-peer links

2022-06-24 Thread Dan Carpenter
ks_count++; If you fix the exit condition above then probably this warning will go away too? 1463 list_add_tail(>list, _dev->p2p_link_props); 1464 ret = kfd_build_p2p_node_entry(cpu_dev, props2); 1465 if (ret < 0) 1466 return ret; 1467 } 1468 } 1469 return ret; 1470 } regards, dan carpenter

Re: [PATCH] drm/amdgpu/discovery: add comments about VCN instance handling

2022-06-02 Thread Dan Carpenter
On Thu, Jun 02, 2022 at 12:45:47PM -0400, Alex Deucher wrote: > Add comments to clarify code that is safe, but triggers and > smatch warning. > > Link: https://lists.freedesktop.org/archives/amd-gfx/2022-June/079905.html > Signed-off-by: Alex Deucher > Cc: Dan Carpenter >

  1   2   3   4   >