[PATCH] drm/amdgpu: Fix integer overflow in amdgpu_gem_add_input_fence()

2025-05-24 Thread Dan Carpenter
to sync bo map/unmap") Cc: sta...@vger.kernel.org Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 2c68118fe9fd..0ec

[PATCH] drm/amdgpu: Fix integer overflow issues in amdgpu_userq_fence.c

2025-05-24 Thread Dan Carpenter
xes: a292fdecd728 ("drm/amdgpu: Implement userqueue signal/wait IOCTL") Cc: sta...@vger.kernel.org Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amd

Re: [PATCH] drm/amdgpu/userq: remove unnecessary NULL check

2025-05-01 Thread Dan Carpenter
On Wed, Apr 30, 2025 at 09:28:59AM +, Sharma, Shashank wrote: > [AMD Official Use Only - AMD Internal Distribution Only] > > Hello Dan, > > ________ > From: Dan Carpenter > Sent: Wednesday, April 30, 2025 10:05 AM > To: Deucher, Alexander

[PATCH] drm/amdgpu/userq: remove unnecessary NULL check

2025-05-01 Thread Dan Carpenter
The "ticket" pointer points to in the middle of the &exec struct so it can't be NULL. Remove the check. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgp

[PATCH next] drm/amdgpu/userq: Call unreserve on error in amdgpu_userq_fence_read_wptr()

2025-05-01 Thread Dan Carpenter
This error path should call amdgpu_bo_unreserve() before returning. Fixes: d8675102ba32 ("drm/amdgpu: add vm root BO lock before accessing the vm") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 1 + 1 file changed, 1 insertion(+) diff --git a/d

Re: [PATCH v2] drm/amdgpu: Add NULL check for 'bo_va' in update_bo_mapping v2

2025-04-24 Thread Dan Carpenter
On Wed, Apr 23, 2025 at 02:52:22PM +0200, Christian König wrote: > On 4/22/25 16:15, Dan Carpenter wrote: > > On Tue, Apr 22, 2025 at 03:34:58PM +0200, Christian König wrote: > >> Am 22.04.25 um 15:17 schrieb Srinivasan Shanmugam: > >>> This change adds a check to e

[bug report] drm/amd/display: DCN42 RMCM and MCM 3DLUT support

2025-04-24 Thread Dan Carpenter
hubp->funcs->hubp_enable_3dlut_fl(hubp, true); 842 else { 843 if (mpc->funcs->program_lut_mode) { 844 mpc->funcs->program_lut_mode(mpc, MCM_LUT_SHAPER, MCM_LUT_DISABLE, lut_bank_a, mpcc_id); 845 mpc->funcs->program_lut_mode(mpc, MCM_LUT_3DLUT, MCM_LUT_DISABLE, lut_bank_a, mpcc_id); 846 mpc->funcs->program_lut_mode(mpc, MCM_LUT_1DLUT, MCM_LUT_DISABLE, lut_bank_a, mpcc_id); 847 } 848 } 849 break; 850 851 } 852 } regards, dan carpenter

Re: [PATCH v2] drm/amdgpu: Add NULL check for 'bo_va' in update_bo_mapping v2

2025-04-23 Thread Dan Carpenter
looking at the function itself without looking at the caller. It turns out that it's a false positve because "bo_va" is only NULL when the operation is AMDGPU_VA_OP_CLEAR. You need to look at the caller and also where fpriv->prt_va is set in amdgpu_driver_open_kms(). It's a bit too complicated for Smatch to do this level of analysis. Anyway, yes, please don't silence static checker false positives, just ignore them. regards, dan carpenter

[PATCH next] drm/amdkfd: Fix kfd_smi_event_process()

2025-04-15 Thread Dan Carpenter
The "pdd->drm_priv" NULL check is reversed so it will lead to a NULL dereference on the next line. Fixes: 4172b556fd5b ("drm/amdkfd: add smi events for process start and end") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 2 +- 1 file cha

[PATCH v2 2/2] drm/amdgpu: Clean up error handling in amdgpu_userq_fence_driver_alloc()

2025-04-12 Thread Dan Carpenter
The "fence_drv" is already NULL so no cleanup is necessary. Signed-off-by: Dan Carpenter --- v2: New patch drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/driv

[PATCH v2 1/2] drm/amdgpu: Fix double free in amdgpu_userq_fence_driver_alloc()

2025-04-12 Thread Dan Carpenter
it to -ENOMEM. Fixes: e7cf21fbb277 ("drm/amdgpu: Few optimization and fixes for userq fence driver") Signed-off-by: Dan Carpenter --- v2: No change. drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dri

Re: [PATCH next] drm/amdgpu: Fix double free in amdgpu_userq_fence_driver_alloc()

2025-04-12 Thread Dan Carpenter
makes the patch confusing to add this unrelated cleanup... I'll send it as a separate patch. regards, dan carpenter

[PATCH v2 0/2] drm/amdgpu: Fixes to amdgpu_userq_fence_driver_alloc()

2025-04-12 Thread Dan Carpenter
This fixes a double free on one error path in amdgpu_userq_fence_driver_alloc() and cleans up another error path. v2: Did some additional cleanup Dan Carpenter (2): drm/amdgpu: Fix double free in amdgpu_userq_fence_driver_alloc() drm/amdgpu: Clean up error handling in

[PATCH next] drm/amdgpu: Fix double free in amdgpu_userq_fence_driver_alloc()

2025-04-11 Thread Dan Carpenter
it to -ENOMEM. Fixes: e7cf21fbb277 ("drm/amdgpu: Few optimization and fixes for userq fence driver") Signed-off-by: Dan Carpenter --- --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/

Re: [PATCH] drm/amdgpu: Replace tmp_adev with hive in amdgpu_pci_slot_reset

2025-04-10 Thread Dan Carpenter
; > warn: iterator used outside loop: 'tmp_adev' > > > > Fixes: 8ba904f54148 ("drm/amdgpu: Multi-GPU DPC recovery support") > > Reported-by: Dan Carpenter > > Signed-off-by: Ce Sun > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++

[bug report] drm/amdgpu: Multi-GPU DPC recovery support

2025-04-10 Thread Dan Carpenter
if (hive) { 6828 mutex_unlock(&hive->hive_lock); 6829 amdgpu_put_xgmi_hive(hive); 6830 } 6831 6832 return r ? PCI_ERS_RESULT_DISCONNECT : PCI_ERS_RESULT_RECOVERED; 6833 } regards, dan carpenter

Re: [PATCH v1 1/1] drm/amdgpu: fix a smatch static checker warning in amdgpu_pci_slot_reset

2025-04-10 Thread Dan Carpenter
overy support") > Thanks. This doesn't change how the code works so probably the Fixes tag isn't required. But it doesn't hurt anything either. Static checker warnings are a gray area. regards, dan carpenter

[bug report] drm/amdgpu: update userqueue BOs and PDs

2025-04-10 Thread Dan Carpenter
} 148 149 /* Add fence to timeline */ 150 if (!point) 151 drm_syncobj_replace_fence(syncobj, last_update); 152 else 153 drm_syncobj_add_point(syncobj, chain, last_update, point); 154 } regards, dan carpenter

Re: [PATCH] drm/amd/display: Fix NULL pointer dereferences in dm_update_crtc_state()

2025-03-12 Thread Dan Carpenter
RO(drm_new_conn_state); > > Maybe it's just a false warning? Calling PTR_ERR_OR_ZERO() doesn't make sense when we know that drm_new_conn_state is an error pointer. regards, dan carpenter > > Tom > > On 3/12/2025 10:34 AM, Srinivasan Shanmugam wrote: > > Added ch

[PATCH] drm/amdkfd: delete stray tab in kfd_dbg_set_mes_debug_mode()

2025-03-11 Thread Dan Carpenter
These lines are indented one tab more than they should be. Delete the stray tabs. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm

[bug report] drm/amd/display: Expose HDR output metadata for supported connectors

2025-03-11 Thread Dan Carpenter
>abm_level; 10750 --> 10751 ret = fill_hdr_info_packet(drm_new_conn_state, ^^ Unchecked dereference 10752 &new_stream->hdr_static_metadata); 10753

[PATCH] drm/amdgpu/gfx: delete stray tabs

2025-03-10 Thread Dan Carpenter
These lines are indented one tab too far. Delete the extra tabs. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

[PATCH] drm/amdgpu: Use tabs for indenting in amdgpu_sdma_reset_engine()

2025-03-10 Thread Dan Carpenter
This line has a seven space indent instead of a tab. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c index

[bug report] drm/amdkfd: Have kfd driver use same PASID values from graphic driver

2025-02-17 Thread Dan Carpenter
1704 err_init_cwsr: 1705 kfd_process_device_destroy_ib_mem(pdd); 1706 err_reserve_ib_mem: 1707 pdd->drm_priv = NULL; 1708 amdgpu_amdkfd_gpuvm_destroy_cb(dev->adev, avm); 1709 1710 return ret; 1711 } regards, dan carpenter

Re: [PATCH] drm/amd/display: restore edid reading from a given i2c adapter

2025-02-12 Thread Dan Carpenter
), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202502121000.ebcedoo9-...@intel.com/ New smatch warnings: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7201 amdgpu_dm_connector_funcs_force() warn: variable

[bug report] drm/amdgpu: cache gpu pcie link width

2025-01-20 Thread Dan Carpenter
*speed = pcie_get_speed_cap(parent); ^^ Then we are toasted here. 6194 *width = pcie_get_width_cap(parent); 6195 } 6196 } regards, dan carpenter

[bug report] drm/amd/display: Do not elevate mem_type change to full update

2025-01-15 Thread Dan Carpenter
11491 return false; 11492 } regards, dan carpenter

[PATCH] drm/amdgpu: Fix shift type in amdgpu_debugfs_sdma_sched_mask_set()

2025-01-08 Thread Dan Carpenter
_SDMA_INSTANCES (16) bits. So this bug does not affect anything in real life. Still, for correctness sake, u64 bit masks should use BIT_ULL(). Fixes: d2e3961ae371 ("drm/amdgpu: add amdgpu_sdma_sched_mask debugfs") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu

[bug report] drm/amdgpu: parse legacy RAS bad page mixed with new data in various NPS modes

2024-12-13 Thread Dan Carpenter
} 2914 } 2915 2916 free: 2917 if (from_rom) 2918 kfree(err_data.err_addr); 2919 out: 2920 mutex_unlock(&con->recovery_lock); 2921 2922 return ret; 2923 } regards, dan carpenter

Re: [PATCH v2] drm/amd/display: Fix NULL pointer dereference in dmub_tracebuffer_show

2024-12-12 Thread Dan Carpenter
Thanks! regards, dan carpenter

[bug report] drm/amd/display: Make DMCUB tracebuffer debugfs chronological

2024-12-12 Thread Dan Carpenter
Always non-NULL 918DMUB_TRACE_BUFFER_SIZE; 919 max_entries = (tbuf_size - sizeof(struct dmub_debugfs_trace_header)) / 920 sizeof(struct dmub_debugfs_trace_entry); 921 922 num_entries = regards, dan carpenter

Re: [PATCH] drm/amd/display: Fix NULL pointer dereference in dmub_tracebuffer_show

2024-12-12 Thread Dan Carpenter
if (!tbuf_base) > return 0; > > + if (adev->dm.dmub_srv) > + fw_meta_info = &adev->dm.dmub_srv->meta_info; > + > tbuf_size = fw_meta_info ? fw_meta_info->trace_buffer_size : > DMUB_TRACE_BUFFER_SIZE; > max_entries = (tbuf_size - sizeof(struct dmub_debugfs_trace_header)) / regards, dan carpenter

Re: [PATCH][next] drm/amd/amdgpu: Fix spelling mistake "versoin" -> "version"

2024-11-13 Thread Dan Carpenter
x63 to support limit single process feature.\n"); > + dev_err(mes->adev->dev, "MES FW version must be larger > than 0x63 to support limit single process feature.\n"); What does "to support limit single process feature" mean? regards, dan carpenter

Re: [PATCH v3 1/2] drm/display/dsc: Refactor DRM MST DSC Determination Policy

2024-11-07 Thread Dan Carpenter
: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202411071102.0cmtieio-...@intel.com/ smatch warnings: drivers/gpu/drm/display/drm_dp_mst_topology.c:6043 drm_dp_mst_dsc_aux_for_port() warn: variable dereferenced before check 'port' (see line 6033)

[PATCH next] drm/amdgpu: Fix amdgpu_ip_block_hw_fini()

2024-10-25 Thread Dan Carpenter
This NULL check is reversed so the function doesn't work. Fixes: dad01f93f432 ("drm/amdgpu: validate hw_fini before function call") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

[PATCH next] drm/amdgpu: Fix a double lock bug

2024-10-18 Thread Dan Carpenter
This was supposed to be an unlock instead of a lock. The original code will lead to a deadlock. Fixes: ee52489d1210 ("drm/amdgpu: Place NPS mode request on unload") Signed-off-by: Dan Carpenter --- >From static analysis, not testing. --- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c |

[PATCH next] drm/amdgpu: Fix off by one in current_memory_partition_show()

2024-10-14 Thread Dan Carpenter
The >= ARRAY_SIZE() should be > ARRAY_SIZE() to prevent an out of bounds read. Fixes: 012be6f22c01 ("drm/amdgpu: Add sysfs interfaces for NPS mode") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

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

2024-10-07 Thread Dan Carpenter
3 *out = ring; 1234 return 0; 1235 1236 clean_up_ring: 1237 amdgpu_ring_fini(ring); 1238 clean_up_memory: 1239 kfree(ring); --> 1240 amdgpu_mes_unlock(&adev->mes); ^^ 1241 return r; 1242 } regards, dan carpenter

Re: [PATCH] drm/display/dsc: Refactor MST DSC Determination Policy

2024-09-25 Thread Dan Carpenter
/202409231002.bmp89ipm-...@intel.com/config) compiler: microblaze-linux-gcc (GCC) 14.1.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https

[PATCH] drm/amdgpu/mes11: Indent an if statment

2024-09-05 Thread Dan Carpenter
Indent the "break" statement one more tab. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c index 0f

[PATCH] drm/amd/display: fix some indenting in CalculatePrefetchSchedule()

2024-08-23 Thread Dan Carpenter
These tabs were deleted accidentally in commit d07722e1fc74 ("drm/amd/display: DML2.1 Reintegration for Various Fixes"). Add them back. Signed-off-by: Dan Carpenter --- .../dc/dml2/dml21/src/dml2_core/dml2_core_dcn4_calcs.c| 4 ++-- 1 file changed, 2 insertions(+), 2 deletion

Re: [PATCH] drm/amd/gfx11: move the gfx mutex into the caller

2024-08-21 Thread Dan Carpenter
On Tue, Aug 20, 2024 at 10:39:09AM -0400, Alex Deucher wrote: > Otherwise we can fail to drop the software mutex when > we fail to take the hardware mutex. > > Fixes: 76acba7b7f12 ("drm/amdgpu/gfx11: add a mutex for the gfx semaphore") > Reported-by: Dan Carpenter >

[bug report] drm/amdgpu/gfx11: add a mutex for the gfx semaphore

2024-08-20 Thread Dan Carpenter
mutex_unlock(&adev->gfx.reset_sem_mutex); return -EINVAL; } But I really think it would be nicer in the caller. 4777 --> 4778 return 0; 4779 } regards, dan carpenter

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

2024-07-30 Thread Dan Carpenter
gpu: Update VF2PF interface") > Signed-off-by: Su Hui > Signed-off-by: Dan Carpenter > Signed-off-by: wenlunpeng > Signed-off-by: WangYuli > --- Thanks for doing this, but these Signed-off-by tags aren't correct. Signed-off-by is like signing a legal document. It came

[bug report] drm/amd/display: DML2.1 resynchronization

2024-07-26 Thread Dan Carpenter
_kbytes = %u\n", __func__, p->rob_buffer_size_kbytes); 3846 #endif 3847 } 3848 #ifdef __DML_VBA_DEBUG__ 3849 dml2_printf("DML::%s: compbuf_reserved_space_64b = %u\n", __func__, *p->compbuf_reserved_space_64b); 3850 #endif 3851 3852 *p->hw_debug5 = false; 3853 for (unsigned int k = 0; k < p->NumberOfActiveSurfaces; ++k) { 3854 if (!(p->mrq_present) && (!p->UnboundedRequestEnabled) && (TotalActiveDPP == 1) ^^ This checks if the pointer to enabled is NULL. Probably *p was intended. 3855 && p->display_cfg->plane_descriptors[k].surface.dcc.enable 3856 && ((p->rob_buffer_size_kbytes * 1024 * (p->mrq_present ? MAXIMUMCOMPRESSION : 1) regards, dan carpenter

[bug report] drm/amdkfd: Validate queue cwsr area and eop buffer size

2024-07-26 Thread Dan Carpenter
eturn 0; 309 310 out_err_unreserve: 311 amdgpu_bo_unreserve(vm->root.bo); 312 out_err_release: 313 kfd_queue_release_buffers(pdd, properties); 314 return err; 315 } regards, dan carpenter

[bug report] drm/amd/display: Fix ineffective setting of max bpc property

2024-07-15 Thread Dan Carpenter
break; 7205 } 7206 7207 if (aconnector->base.connector_type == DRM_MODE_CONNECTOR_WRITEBACK) regards, dan carpenter

[bug report] drm/amd/display: Add DCN3 HWSEQ

2024-07-15 Thread Dan Carpenter
uncs->set_output_gamma(mpc, mpcc_id, params); Then it will crash 402 return ret; 403 } regards, dan carpenter

[PATCH] drm/amd/display: Clean up indenting in dm_dp_mst_is_port_support_mode()

2024-06-21 Thread Dan Carpenter
This code works, but it's not aligned correctly. Add a couple missing tabs. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdg

[PATCH] drm/amdgpu/kfd: Add unlock() on error path to add_queue_mes()

2024-06-21 Thread Dan Carpenter
We recently added locking to add_queue_mes() but this error path was overlooked. Add an unlock to the error path. Fixes: 1802b042a343 ("drm/amdgpu/kfd: remove is_hws_hang and is_resetting") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 1

[bug report] drm/amdgpu: add init support for GFX11 (v2)

2024-06-17 Thread Dan Carpenter
gfx_v11_0_rlc_backdoor_autoload_enable(adev); Unchecked dereference inside the function. (Probably just delete the NULL check?) 4504 if (r) 4505 return r; 4506 } else { regards, dan carpenter

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

2024-05-24 Thread Dan Carpenter
^^^ stream->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
fore 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
s out_clks; 572 unsigned 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)

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

2024-05-06 Thread Dan Carpenter
&crtc_state->stream->cursor_attributes; 8441 8442 if (!dc_stream_set_cursor_position(crtc_state->stream, 8443&position)) 8444 DRM_ERROR("DC failed to set cursor position\n"); 8445 8446 update->cursor_position = &crtc_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
2); 174 } 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
dc_allow_idle_optimizations(dc, false); regards, dan carpenter

[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 --- .../displ

[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 delet

[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
if (tf->type == TF_TYPE_HWPWL) 1123 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
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 "&pipe_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

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

2024-03-16 Thread Dan Carpenter
gards, dan carpenter

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

2024-03-15 Thread Dan Carpenter
242 drm_printf(&p, "AMDGPU register dumps:\nOffset: Value:\n"); 243 244 for (i = 0; i < coredump->adev->reset_info.num_regs; i++) 245 drm_printf(&p, "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
srv_is_hw_pwr_up(dc->ctx->dmub_srv, 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
memset(&dc_em_sink->edid_caps, 0, 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 '

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
78 dc->caps.max_planes = pool->base.pipe_count; 2579 2580 for (i = 0; i < dc->caps.max_planes; ++i) 2581 dc->caps.planes[i] = plane_cap; 2582 2583 dc->cap_funcs = cap_funcs; 2584 2585 if (dc->ctx->dc_bios-&

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

2024-01-23 Thread Dan Carpenter
= link_dpia_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
if (vm->is_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
-denominator : denominator); 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
ery)) { 543 spin_unlock(&kiq->ring_lock); 544 return 0; 545 } 546 547 if (kiq_ring->sched.ready && !adev->job_hang) 548 r = amdgpu_ring_test_helper(kiq_ring); 549 spin_unlock(&kiq->ring_lock); regards, dan carpenter

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

2023-10-31 Thread Dan Carpenter
^ 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
er amdgpu_gfx_disable_kcq() which is holding spin_lock(&kiq->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
dml2->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
; 802 } 803 804 if (!dc_dmub_srv_get_diagnostic_data(dc_dmub_srv, &diag_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(&aconnector->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
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 &clk_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
x27;t be less than zero. 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
link->replay_settings.replay_feature_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
tr->attr_update : default_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
&stream_update); 8794 mutex_unlock(&dm->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
fbdev: 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
its(ring->wptr)); 5207 } 5208 } 5209 } regards, dan carpenter

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

2023-06-21 Thread Dan Carpenter
"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+bvbt-ufxokpeqdhzf3z2hbjkgdjh8q4dvpp...@mail.gmail.com/ regards, dan carpenter

  1   2   3   4   5   >