[patch] drm/amdgpu/virt: double free in amdgpu_map_static_csa()

2017-02-07 Thread Dan Carpenter
The amdgpu_vm_bo_rmv() function frees "bo_va" so we shouldn't free it a second time. Fixes: 4e4bbe7343a6 ("drm/amdgpu:add new file for SRIOV") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/dr

[bug report] drm/amdgpu/virt: implement VI virt operation interfaces

2017-02-06 Thread Dan Carpenter
e.\n"); BUG_ON() takes a condition argument, not a format string. 311 break; 312 } 313 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amdgpu: refine uvd4.2 init/stop code.

2017-02-13 Thread Dan Carpenter
reak; 425 mdelay(1); 426 } 427 break; ^^ 428 } 429 regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amdgpu: switch ih handling to two levels (v3)

2017-04-04 Thread Dan Carpenter
return -ENOMEM; 324 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/powerplay: add Vega10 powerplay support (v5)

2017-04-03 Thread Dan Carpenter
k_dep_table->entries[i].usCKSVOffsetandDisable & 0x7F); 439 clk_table->entries[i].sclk_offset = 440 clk_dep_table->entries[i].usAVFSOffset; 441 } 442 regards, dan carpenter __

Re: [bug report] drm/amdgpu/gfx6: clean up cu configuration

2017-04-03 Thread Dan Carpenter
tch is trying to do or why it exists... > adev->gfx.config.max_shader_engines is set in gfx_v6_0_gpu_init() and > it must be < 4 so we'll never be beyond the end of the array. Could you remove the condition then? We should either check it always or not at all. We shouldn't check it half

[PATCH 1/2] drm/amd/powerplay: fix pp_dpm_get_current_power_state()

2017-04-03 Thread Dan Carpenter
This switch statement is missing breaks. Fixes: 2a5071056e6a ("drm/amd/powerplay: add global PowerPlay mutex.") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c in

[PATCH] drm/amdgpu: Fix a NULL deref in amdgpu_vm_add_prt_cb()

2017-04-03 Thread Dan Carpenter
We accidentally dereference "cb" if the kmalloc() fails. Fixes: 451bc8eb8fe6 ("drm/amdgpu: fix PRT teardown on VM fini v3") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdg

[bug report] drm/amdgpu: soc15 enable (v3)

2017-04-03 Thread Dan Carpenter
tate_adjust_rules() error: uninitialized symbol 'stable_pstate_sclk_dpm_percentage'. regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH 2/2] drm/amd/powerplay: fix a couple locking issues

2017-04-03 Thread Dan Carpenter
We should return unlock on the error path in pp_dpm_dispatch_tasks() and there is a double lock bug in pp_dpm_set_sclk_od(). Fixes: 2a5071056e6a ("drm/amd/powerplay: add global PowerPlay mutex.") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/d

Re: [bug report] drm/amdgpu: soc15 enable (v3)

2017-04-03 Thread Dan Carpenter
On Mon, Apr 03, 2017 at 03:12:31PM -0400, Alex Deucher wrote: > On Mon, Apr 3, 2017 at 2:53 PM, Dan Carpenter <dan.carpen...@oracle.com> > wrote: > > Hello Ken Wang, > > > > The patch 220ab9bd1ccf: "drm/amdgpu: soc15 enable (v3)" from Mar 6, > > 2017,

Re: [bug report] drm/amdgpu: soc15 enable (v3)

2017-04-03 Thread Dan Carpenter
If we added an: else BUG(); that would silence the warning. regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amdgpu/gfx6: clean up cu configuration

2017-03-31 Thread Dan Carpenter
(i * 16 + j * 8)); 3749 } 3750 } 3751 3752 gfx_v6_0_select_se_sh(adev, 0x, 0x, 0x); 3753 mutex_unlock(>grbm_idx_mutex); 3754 3755 cu_info->number = active_cu_number; 3756

Re: [PATCH] drm/amdgpu: potential shift wrapping bug

2017-08-10 Thread Dan Carpenter
On Thu, Aug 10, 2017 at 03:02:53PM +0200, Christian König wrote: > Am 10.08.2017 um 14:53 schrieb Dan Carpenter: > > On Thu, Aug 10, 2017 at 02:30:15PM +0200, Christian König wrote: > > > Am 10.08.2017 um 14:16 schrieb Dan Carpenter: > > > > "frag_align"

[PATCH] drm/amdgpu: potential shift wrapping bug

2017-08-10 Thread Dan Carpenter
"frag_align" is a u64, so presumably we want to use the high bits as well instead of shift wrapping. Fixes: 6be7adb37d9b ("drm/amdgpu: increase fragmentation size for Vega10 v2") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm

Re: [PATCH] drm/amdgpu: potential shift wrapping bug

2017-08-10 Thread Dan Carpenter
On Thu, Aug 10, 2017 at 02:30:15PM +0200, Christian König wrote: > Am 10.08.2017 um 14:16 schrieb Dan Carpenter: > > "frag_align" is a u64, so presumably we want to use the high bits as > > well instead of shift wrapping. > > > > Fixes: 6be7adb37d9b (&qu

Re: [PATCH] drm/amdgpu: potential shift wrapping bug

2017-08-10 Thread Dan Carpenter
On Thu, Aug 10, 2017 at 02:30:15PM +0200, Christian König wrote: > Am 10.08.2017 um 14:16 schrieb Dan Carpenter: > > "frag_align" is a u64, so presumably we want to use the high bits as > > well instead of shift wrapping. > > > > Fixes: 6be7adb37d9b (&qu

[PATCH] drm/amdgpu: Off by one sanity checks

2017-07-11 Thread Dan Carpenter
This is just future proofing code, not something that can be triggered in real life. We're testing to make sure we don't shift wrap when we do "1ull << i" so "i" has to be in the 0-63 range. If it's 64 then we have gone too far. Signed-off-by: Dan Carpenter <da

[bug report] drm/amdkfd: Add SDMA user-mode queues support to QCM

2017-07-11 Thread Dan Carpenter
qpd, q); 194 *allocated_vmid = 0; 195 } 196 mutex_unlock(>lock); 197 return retval; 198 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()

2017-08-09 Thread Dan Carpenter
My static checker complains that it's possible for "r" to be uninitialized. It used to be set to zero so this returns it to the old behavior. Fixes: 98a7f88ce9a9 ("drm/amdgpu: bind BOs with GTT space allocated directly v2") Signed-off-by: Dan Carpenter <dan.carpen...@

[PATCH 1/2] drm/radeon/ci: tidy up some limit checks

2017-08-22 Thread Dan Carpenter
ISCRETE_MC_REGISTER_ARRAY_SIZE". The "table->last" value can't possibly be greater than the array size and it is allowed to be equal to it. So let's just remove that test entirely. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Not tested. Please review this one c

[PATCH 2/2] drm/amdgpu/ci: tidy up some limit checks

2017-08-22 Thread Dan Carpenter
ISCRETE_MC_REGISTER_ARRAY_SIZE". The "table->last" value can't possibly be greater than the array size and it is allowed to be equal to it. So let's just remove that test entirely. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Not tested. Please review this one care

Re: [PATCH] drm/amd/powerplay: ensure loop does not wraparound on decrement

2017-05-17 Thread Dan Carpenter
I sent a patch for this bug earlier. There is a second bug later in the function which my patch fixes as well. regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amd/powerplay: fix a signedness bugs

2017-05-16 Thread Dan Carpenter
Smatch complains about a signedness bug here: vega10_hwmgr.c:4202 vega10_force_clock_level() warn: always true condition '(i >= 0) => (0-u32max >= 0)' Fixes: 7b52db39a4c2 ("drm/amd/powerplay: fix bug sclk/mclk level can't be set on vega10.") Signed-of

[PATCH] drm/amdkfd: NULL dereference involving create_process()

2017-06-14 Thread Dan Carpenter
We accidentally return ERR_PTR(0) which is NULL. The caller is not expecting that and it leads to an Oops. Fixes: dd59239a9862 ("amdkfd: init aperture once per process") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.

[PATCH 1/2] drm/amdgpu: potential uninitialized variable in amdgpu_vce_ring_parse_cs()

2017-09-30 Thread Dan Carpenter
also possible I may have missed something. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c index b46280c1279f..2918de2f39ec 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +++ b/

[PATCH] drm/amd/powerplay: fix amd_powerplay_reset()

2017-10-24 Thread Dan Carpenter
We accidentally inverted an if statement and turned amd_powerplay_reset() into a no-op. Fixes: ae97988fc89e ("drm/amd/powerplay: tidy up ret checks in amd_powerplay.c (v3)") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- IMHO, tidying unreadable double negatives is

Re: [PATCH] drm/amd/powerplay: fix amd_powerplay_reset()

2017-10-24 Thread Dan Carpenter
On Tue, Oct 24, 2017 at 01:11:07PM +0300, Jani Nikula wrote: > On Tue, 24 Oct 2017, Dan Carpenter <dan.carpen...@oracle.com> wrote: > > We accidentally inverted an if statement and turned amd_powerplay_reset() > > into a no-op. > > > > Fixes: ae97988fc89e ("

[bug report] drm/amd/amdgpu: Add debugfs support for reading GPRs (v2)

2017-11-28 Thread Dan Carpenter
F, 0x); 3769 mutex_unlock(>grbm_idx_mutex); 3770 3771 while (size) { 3772 uint32_t value; 3773 3774 value = data[offset++]; ^^ We're possibly reading beyond the end of the ar

[bug report] drm/amd/dc: Add dc display driver (v2)

2017-11-06 Thread Dan Carpenter
hole function is a no-op? My Brian is melting??? 1369 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display : add high part address calculation for underlay

2017-11-06 Thread Dan Carpenter
plane_state->plane_size.video.luma_pitch = awidth; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH] drm/amd/display: indent an if statement

2017-11-05 Thread Dan Carpenter
On Sat, Nov 04, 2017 at 10:16:23AM +0100, walter harms wrote: > > > Am 04.11.2017 07:12, schrieb Dan Carpenter: > > The if statement wasn't indented so it makes static analysis tools and > > probably very recent GCC versions complain. > > > > Signed-

[PATCH] drm/amd/display: small cleanup in destruct()

2017-11-05 Thread Dan Carpenter
not really appropriate here so it should be removed as well. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- v2: in v1 I just added a tab diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c index d91159

AMD, please run Smatch on your driver

2017-11-06 Thread Dan Carpenter
selves because it scales better than relying on me to do it. regards, dan carpenter drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:2224 amdgpu_device_init() warn: 'adev->rio_mem' was not released on error drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:2395 amdgpu_device_init() warn: 'adev->rio_mem' was

[PATCH] drm/amd/display: checking for NULL instead of IS_ERR()

2017-11-06 Thread Dan Carpenter
backlight_device_register() never returns NULL, it returns error pointers on error so the check here is wrong. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

[PATCH] drm/amd/display: remove some unneeded code

2017-11-06 Thread Dan Carpenter
We assign "v_init = asic_blank_start;" a few lines earlier so there is no need to do it again inside the if statements. Also "v_init" is unsigned so it can't be less than zero. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gp

[bug report] drm/amdgpu/display: Add core dc support for DCN

2017-11-04 Thread Dan Carpenter
EGIONS_NUMBER then we're reading beyond the end of the array 1697 regamma_params->arr_curve_points[k].segments_num = 1698 seg_distr[k]; 1699 regards, dan carpenter ___ amd-gfx mailin

[bug report] drm/amd/display: Merge amdgpu_dm_types and amdgpu_dm

2017-11-04 Thread Dan Carpenter
spin_unlock_irqrestore(>dev->event_lock, flags); ^^ Double unlock. 3896 3897 if (!pflip_needed) { regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amd/display: indent an if statement

2017-11-04 Thread Dan Carpenter
The if statement wasn't indented so it makes static analysis tools and probably very recent GCC versions complain. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- I went over 80 characters because other lines do already and it seemed like the cleanest thing here. diff --git a/d

[bug report] drm/amd/pp: Change voltage/clk range for OD feature on VI

2018-05-17 Thread Dan Carpenter
x_vddc'. drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c:1588 vegam_populate_clock_stretcher_data_table() error: uninitialized symbol 'efuse'. drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c:1725 vegam_populate_avfs_parameters() erro

[bug report] drm/amd/powerplay: add control gfxoff enabling in late init

2018-05-17 Thread Dan Carpenter
hecked dereference. 195 (hwmgr->feature_mask & PP_GFXOFF_MASK)) { 196 ret = hwmgr->hwmgr_func->gfx_off_control(hwmgr, true); 197 if (ret) 198 pr_err("gfx off enabling failed!\n"); 199

[bug report] drm/amd/display: Adding stutter entry wm to dce bw struct

2018-05-17 Thread Dan Carpenter
3248 bw_fixed_to_int(bw_mul(data-> 3249 stutter_entry_watermark[0], bw_int_to_fixed(1000))); See also: drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:3356 bw_calcs() warn: inconsistent indenting regards, dan carpenter _

[bug report] drm/amd/pp: Use gfx rlc funcs directly in powerplay

2018-05-17 Thread Dan Carpenter
(uint16_t)(PPSMC_MSG_EnableDpmDidt)); 970 PP_ASSERT_WITH_CODE((0 == result), 971 "Failed to enable DPM DIDT.", return result); 972 } 973 mutex_unlock(>grb

[PATCH] drm/amd/pp: missing curly braces in smu7_enable_sclk_mclk_dpm()

2018-05-17 Thread Dan Carpenter
We added some more lines of code to this if statement but forgot to add curly braces. Fixes: 0c24e7ef233b ("drm/amd/powerplay: add specific changes for VEGAM in smu7_hwmgr.c") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/powerplay/hw

[PATCH] drm/amd/amdgpu: Fix debugfs error handling

2018-06-14 Thread Dan Carpenter
you don't have to look at the surrounding code to see whether debugfs is enabled or not. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index f5fb93795a69..dd9a4fb9ce39 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debu

[bug report] drm/amd/display: Fix indentation in dcn10 resource constructor

2018-06-27 Thread Dan Carpenter
fill in from actual raven resource when we create 1014 * more than virtual encoder 1015 */ regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH 3/3] drm/amdgpu: Move to gtt before cpu accesses dma buf.

2018-01-11 Thread Dan Carpenter
Hi Samuel, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm/drm-next] [also build test WARNING on v4.15-rc7 next-20180110] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

[bug report] drm/amdgpu: move debugfs functions to their own file

2018-01-08 Thread Dan Carpenter
(ent->d_inode, adev->rmmio_size); debugfs_create_file() returns ERR_PTR(-ENODEV) if it's not enabled in the .config or it returns a NULL pointer. 697 adev->debugfs_regs[i] = ent; 698 } 699 700 ret

[bug report] drm/amdgpu: rework IP block registration (v2)

2018-01-16 Thread Dan Carpenter
because pp_late_fini() frees the parameter. The amdgpu_pp_late_fini() function doesn't so that's a bit weird. 1504 adev->ip_blocks[i].status.late_initialized = false; ^^^ Dereference. 1505 } 1506 regards, dan carpenter _

[bug report] drm/amd/display: Read AUX channel even if only status byte is returned

2018-07-31 Thread Dan Carpenter
76 ); 677 678 break; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amd/display: indent an if statement

2018-08-14 Thread Dan Carpenter
The if statement isn't indented and it makes static checkers complain. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 4ca41d6e3bcf..d82ba58c720f 100644 --- a/drivers/gpu/drm/amd/display/dc

[PATCH] drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create()

2018-08-10 Thread Dan Carpenter
ist array after the list") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index d472a2c8399f..b80243d3972e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_l

[bug report] drm/radeon: use pcie functions for link width

2018-09-04 Thread Dan Carpenter
speed_cntl |= LC_INITIATE_LINK_SPEED_CHANGE; 9651 WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, speed_cntl); 9652 9653 for (i = 0; i < rdev->usec_timeout; i++) { 9654 speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL); 9655 if ((speed

[PATCH] drm/amd/display: off by one in find_irq_source_info()

2018-07-04 Thread Dan Carpenter
The ->info[] array has DAL_IRQ_SOURCES_NUMBER elements so this condition should be >= instead of > or we could read one element beyond the end of the array. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu

[bug report] drm/amd/display: Handle HDR use cases.

2018-03-14 Thread Dan Carpenter
i++; 541 } 542 543 if (seg_distr[k] != -1) ^^ then this would be a problem. 544 lut_params->arr_curve_points[k].segments_num = seg_distr[k]; 545 regards, dan carpenter ___ amd-g

[bug report] drm/amd/display: disable CRTCs with NULL FB on their primary plane (V2)

2018-03-15 Thread Dan Carpenter
return -EINVAL; 4830 } 4831 } 4832 return 0; 4833 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH] drm/amd/display: fix spelling mistake: "Usupported" -> "Unsupported"

2018-04-03 Thread Dan Carpenter
his. > > It's complex to have to remember the preferences for every subsystem. > Preferences should be expressed in the MAINTAINERS file in some way. > Also, since no one reads lkml, does it hurt to have even trivial patches? I always tell people not to CC lkml when there

[bug report] amd\powerplay Implement get dal power level

2018-04-04 Thread Dan Carpenter
e should be using table->entries[0] here? 1487 return 0; 1488 } 1489 } 1490 return -EINVAL; 1491 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH] drm/amdkfd: Integer overflows in ioctl

2018-04-25 Thread Dan Carpenter
for this to be bigger than the number of GPUs in the system. The > maximum number of GPUs supported due to device minor limit in DRM is 128. > 128 is sort of a magic number. Is there a MAX_GPU define or something? regards, dan carpenter ___ a

[PATCH] drm/amdkfd: Integer overflows in ioctl

2018-04-24 Thread Dan Carpenter
args->n_devices is a u32 that comes from the user. The multiplication could overflow on 32 bit systems possibly leading to privilege escalation. Fixes: 5ec7e02854b3 ("drm/amdkfd: Add ioctls for GPUVM memory management") Signed-off-by: Dan Carpenter dan.carpen...@oracle.com> diff

[PATCH] drm/amd/pp: silence a static checker warning

2018-03-23 Thread Dan Carpenter
This has a static checker warning because "frev" and "crev" can be uninitialized if "info" is NULL. I just changed the order of the checks so that we check "info" first. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drive

[bug report] drm/amd/display: Implement interface for CRC on CRTC

2018-03-02 Thread Dan Carpenter
c->crtc_id; 321 322 drm_handle_vblank(adev->ddev, crtc_index); 323 amdgpu_dm_crtc_handle_crc_irq(>base); ^^^ The new code dereferences without checking (inside the function call). 324 } 325 reg

[PATCH] drm/amd/display: Fix a loop timeout in wait_for_fbc_state_changed()

2018-06-20 Thread Dan Carpenter
t;) Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c index e2994d337044..8e83ec66fd22 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +++ b/drivers/gpu/drm/amd/

[bug report] drm/amd/dc: Add dc display driver (v2)

2018-11-01 Thread Dan Carpenter
ms->asic_id); 676 if (!dc->res_pool) 677 goto fail; 678 679 dc_resource_state_construct(dc, dc->current_state); 680 681 if (!create_links(dc, init_params->num_virtual_links)) 682 goto fail; 683

[bug report] drm/amd/display: Build stream update and plane updates in dm

2018-09-28 Thread Dan Carpenter
num_plane].surface->dst_rect = 5196 new_dm_plane_state->dc_state->dst_rect; 5197 updates[num_plane].surface->rotation = regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.free

[PATCH] drm/amdgpu: fix a NULL check in debugfs init

2018-09-26 Thread Dan Carpenter
The debugfs_create_file() returns error pointers if DEBUGFS isn't enabled. But here, we know that it is enabled so it returns NULL on error which could lead to a NULL dereference a few lines later. Signed-off-by: Dan Carpenter --- If someone wanted to delete the error handling as well

[bug report] drm/amd/display: Program vline interrupt on FAST update

2018-09-25 Thread Dan Carpenter
^ The old code didn't check. 1464 // if otg funcs defined check if blanked before programming 1465 if (!pipe_ctx->stream_res.tg->funcs->is_blanke

Re: [PATCH 1/6] drm/dp_mst: Introduce drm_dp_mst_connector_atomic_check()

2018-09-20 Thread Dan Carpenter
Hi Lyude, Thank you for the patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Lyude-Paul/Fix-legacy-DPMS-changes-with-MST/20180919-203434 base: git://anongit.freedesktop.org/drm-intel for-linux-next smatch warnings:

[bug report] drm/amdkfd: Add DMABuf import functionality

2018-12-14 Thread Dan Carpenter
truct kgd_mem **), , 1646NULL); 1647 if (r) 1648 goto err_unlock; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: Add support for Freesync 2 HDR and Content to Display Mapping

2018-11-23 Thread Dan Carpenter
_params->max_content == 0 || ^ Too late. 827 fs_params->max_display == 0) 828 return false; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.or

[bug report] drm/amdgpu: Refine CSA related functions

2018-11-23 Thread Dan Carpenter
fails. 50 return 0; 51 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amdgpu : Generate XGMI topology info from driver level

2019-01-04 Thread Dan Carpenter
137 } 138 139 list_for_each_entry(tmp_adev, >device_list, gmc.xgmi.head) { 140 ret = amdgpu_xgmi_update_topology(hive, tmp_adev); 141 if (ret) 142 break; 143 } 144

[bug report] drm/amd/dc: Add dc display driver (v2)

2019-01-09 Thread Dan Carpenter
rrent_state" gets dereferenced inside the function. This style of one function cleans up everything error handling is always buggy... :/ https://plus.google.com/u/0/106378716002406849458/posts/1Ud9JbaYnPr 755 return false; 756 } regards, dan carpenter _

Re: [PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table()

2019-03-21 Thread Dan Carpenter
On Thu, Mar 21, 2019 at 09:20:38AM +0100, Julia Lawall wrote: > > > On Thu, 21 Mar 2019, Huang, Ray wrote: > > > > -Original Message- > > > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > > > Sent: Thursday, March 21, 2019 2:28 PM > >

[PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table()

2019-03-21 Thread Dan Carpenter
We already unlocked a few lines earlier so this code unlocks twice on the success path. Fixes: 5809d7420f97 ("drm/amd/powerplay: implement sysfs of pp_table for smu11 (v2)") Signed-off-by: Dan Carpenter --- I'm not sure what this bug looks like at runtime, but it's slightly weird t

[PATCH] drm/amd/powerplay: delete some dead code

2019-03-21 Thread Dan Carpenter
The "size" variable is unsigned. We never pass invalid sizes to this function and we already used it as an array offset earlier so it's too late to check here. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 3 --- 1 file changed, 3 deletions(-)

[PATCH] drm/amd/powerplay: Off by one in vega20_get_smu_msg_index()

2019-03-21 Thread Dan Carpenter
The > should be >= so that we don't read one element beyond the end of the vega20_message_map[] array. Fixes: 3ec3c931489f ("drm/amd/powerplay: implement smu vega20_message_map for vega20") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 3 ++- 1

[bug report] drm/amd/display: Link train only when link is DP and backend is enabled

2019-03-25 Thread Dan Carpenter
New check 551 return; 552 553 if (link_stream) ^^^ The old code used to check for NULL 554 decide_link_settings(link_stream, _settings); 555 regards, dan carpenter _

[bug report] drm/amd/display: On DCN1, Wait for vupdate on cursor updates

2019-03-25 Thread Dan Carpenter
us_to_vupdate = lines_to_vupdate * us_per_line; 222 223 /* 70 us is a conservative estimate of cursor update time*/ 224 if (us_to_vupdate < 70) 225 udelay(us_to_vupdate); 226 }

[bug report] drm/amd/display: Call into DC once per multiplane flip

2019-02-19 Thread Dan Carpenter
4851 mutex_unlock(>dc_lock); 4852 } 4853 4854 if (planes_count) { regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amdgpu: tighten gpu_recover in mailbox_flr to avoid duplicate recover in sriov

2019-03-05 Thread Dan Carpenter
^^ amdgpu_lockup_timeout is an int and I'm not sure if that's what you want to test. MAX_SCHEDULE_TIMEOUT is LONG_MAX. 271 amdgpu_device_gpu_recover(adev, NULL); 272 } regards, dan carpenter ___ amd-gfx mailing list

[bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2)

2019-03-20 Thread Dan Carpenter
|| pages <= 0) Check 1216 return 0; 1217 regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: Call into DC once per multiplane flip

2019-02-05 Thread Dan Carpenter
dm, regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: Move link functions from dc to dc_link

2019-05-30 Thread Dan Carpenter
^ Can link_stream be NULL? 2927 return; 2928 2929 if (link_stream) ^^^ We check here so maybe? 2930 decide_link_settings(link_stream, _settings); 2931 regards, dan carpenter __

[PATCH] drm/amdgpu: Fix bounds checking in amdgpu_ras_is_supported()

2019-06-08 Thread Dan Carpenter
ife, because debugfs is generally root only. Fixes: 36ea1bd2d084 ("drm/amdgpu: add debugfs ctrl node") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h b/drivers/gpu/drm

Re: [PATCH][next] drm/amd/display: remove redundant assignment to status

2019-06-06 Thread Dan Carpenter
ders, because people naturally assume it is not dead. GCC has a feature to warn about uninitialized variables and we're randomly initializing status to a bogus value to disable static analysis... regards, dan carpenter

Re: [PATCH -next] drm/amdgpu: remove set but not used variables 'ret'

2019-06-22 Thread Dan Carpenter
_6_MAX_COUNTERS); You're resending this for other reasons, but don't forget to update the indenting on the arguments so they still line up with the '('. regards, dan carpenter

Re: [bug report] drm/amdkfd: Add procfs-style information for KFD processes

2019-06-24 Thread Dan Carpenter
that with comments. I'll try to address this in > a coming patch. > Part of the reason for error handling is just to silence static checker warnings because otherwise everyone has to review it to see if the resource leaks are important. It's easier in the long run to just fix everything

Re: [PATCH -next] drm/amdgpu: remove set but not used variables 'ret'

2019-06-23 Thread Dan Carpenter
On Sat, Jun 22, 2019 at 01:43:19PM +0300, Dan Carpenter wrote: > On Sat, Jun 22, 2019 at 11:03:14AM +0800, Mao Wenan wrote: > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c > > index 0e6dba9..0bf4dd9 100644 > > --- a

Re: [PATCH -next v3] drm/amdgpu: return 'ret' immediately if failed in amdgpu_pmu_init

2019-06-24 Thread Dan Carpenter
ve to pull the arguments back as well. I think this fix that Julia suggested is really the right so leave the indenting alone. It looks like you've right aligned the arguments. That's not the right way, the original was correct. regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH -next v3] drm/amdgpu: return 'ret' immediately if failed in amdgpu_pmu_init

2019-06-24 Thread Dan Carpenter
On Mon, Jun 24, 2019 at 05:29:33PM +0800, maowenan wrote: > > > On 2019/6/24 16:39, Dan Carpenter wrote: > > On Mon, Jun 24, 2019 at 11:45:32AM +0800, Mao Wenan wrote: > >> There is one warning: > >> drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c: In function ‘amdgpu_pm

[bug report] drm/amdkfd: Add procfs-style information for KFD processes

2019-06-24 Thread Dan Carpenter
quot;, 316 (int)process->lead_thread->pid); Error handling and error code missing. 317 } 318 out: 319 mutex_unlock(_processes_mutex); 320 321 return process; 322 } regards, dan carpenter ___

Re: [PATCH][next] drm/amdgpu: fix return of an uninitialized value in variable ret

2019-05-10 Thread Dan Carpenter
gt; - if (ret) > - return ret; > + return -EINVAL; From a naive reading of the code without knowing the hardware spec then you would probably think that lo_base_addr can also be uninitialized. regards, dan carpenter _

[PATCH] drm/amd/powerplay: fix locking in smu_feature_set_supported()

2019-05-15 Thread Dan Carpenter
There is a typo so the code unlocks twice instead of taking the lock and then releasing it. Fixes: f14a323db5b0 ("drm/amd/powerplay: implement update enabled feature state to smc for smu11") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +- 1 file

[bug report] drm/amd/display: wait for fence without holding reservation lock

2019-05-02 Thread Dan Carpenter
buffer before flip\n"); 5350 5351 amdgpu_bo_get_tiling_flags(abo, _flags); 5352 5353 amdgpu_bo_unreserve(abo); regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: If one stream full updates, full update all planes

2019-04-23 Thread Dan Carpenter
if (u->plane_info) 1491 format = u->plane_info->format; 1492 else if (u->surface) ^^ But the old code assumed it could be NULL 1493 format

Re: [bug report] drm/amd/display: If one stream full updates, full update all planes

2019-04-23 Thread Dan Carpenter
On Tue, Apr 23, 2019 at 02:16:53PM +, Kazlauskas, Nicholas wrote: > On 4/23/19 10:10 AM, Dan Carpenter wrote: > > Hello David Francis, > > > > This is a semi-automatic email about new static checker warnings. > > > > The patch c238bfe0be9e: "drm/a

Re: [PATCH][drm-next] drm/amd/display: fix a potential null pointer dereference

2019-08-17 Thread Dan Carpenter
stly pointing this out because that NULL check is written so higgledy-piggledy. At first I thought this was staging code so I was planning to ignore the patch. :P regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: add set and get clock for testing purposes

2019-08-19 Thread Dan Carpenter
0 if (!dc->clk_mgr->funcs->get_clock) ^ This will oops if ->clk_mgr is NULL 3231 return DC_FAIL_UNSUPPORTED_1; 3232 regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/powerplay: implement smc firmware v2.1 for smu11

2019-08-19 Thread Dan Carpenter
lay_table_size = size; 400 401 return 0; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  1   2   3   4   >