[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

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

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

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

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

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

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/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

[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

[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

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

[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

[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

[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

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-

[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

[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

[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

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 ("

[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

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

[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

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"

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: 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

[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...@

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

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

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

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

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,

[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

[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

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

[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

[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

[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

<    1   2   3   4