Commit 93125cb7 authored by Srinivasan Shanmugam's avatar Srinivasan Shanmugam Committed by Alex Deucher

drm/amd/amdgpu: Fix warnings in amdgpu/amdgpu_display.c

Fixes the below checkpatch.pl warnings:

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line
WARNING: suspect code indent for conditional statements (8, 12)
WARNING: braces {} are not necessary for single statement blocks

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 803d411b
...@@ -124,7 +124,7 @@ static void amdgpu_display_flip_work_func(struct work_struct *__work) ...@@ -124,7 +124,7 @@ static void amdgpu_display_flip_work_func(struct work_struct *__work)
struct drm_crtc *crtc = &amdgpu_crtc->base; struct drm_crtc *crtc = &amdgpu_crtc->base;
unsigned long flags; unsigned long flags;
unsigned i; unsigned int i;
int vpos, hpos; int vpos, hpos;
for (i = 0; i < work->shared_count; ++i) for (i = 0; i < work->shared_count; ++i)
...@@ -201,7 +201,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, ...@@ -201,7 +201,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
u64 tiling_flags; u64 tiling_flags;
int i, r; int i, r;
work = kzalloc(sizeof *work, GFP_KERNEL); work = kzalloc(sizeof(*work), GFP_KERNEL);
if (work == NULL) if (work == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -332,13 +332,15 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set, ...@@ -332,13 +332,15 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
adev = drm_to_adev(dev); adev = drm_to_adev(dev);
/* if we have active crtcs and we don't have a power ref, /* if we have active crtcs and we don't have a power ref,
take the current one */ * take the current one
*/
if (active && !adev->have_disp_power_ref) { if (active && !adev->have_disp_power_ref) {
adev->have_disp_power_ref = true; adev->have_disp_power_ref = true;
return ret; return ret;
} }
/* if we have no active crtcs, then drop the power ref /* if we have no active crtcs, then drop the power ref
we got before */ * we got before
*/
if (!active && adev->have_disp_power_ref) { if (!active && adev->have_disp_power_ref) {
pm_runtime_put_autosuspend(dev->dev); pm_runtime_put_autosuspend(dev->dev);
adev->have_disp_power_ref = false; adev->have_disp_power_ref = false;
...@@ -507,11 +509,10 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector, ...@@ -507,11 +509,10 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
if (amdgpu_connector->router.ddc_valid) if (amdgpu_connector->router.ddc_valid)
amdgpu_i2c_router_select_ddc_port(amdgpu_connector); amdgpu_i2c_router_select_ddc_port(amdgpu_connector);
if (use_aux) { if (use_aux)
ret = i2c_transfer(&amdgpu_connector->ddc_bus->aux.ddc, msgs, 2); ret = i2c_transfer(&amdgpu_connector->ddc_bus->aux.ddc, msgs, 2);
} else { else
ret = i2c_transfer(&amdgpu_connector->ddc_bus->adapter, msgs, 2); ret = i2c_transfer(&amdgpu_connector->ddc_bus->adapter, msgs, 2);
}
if (ret != 2) if (ret != 2)
/* Couldn't find an accessible DDC on this connector */ /* Couldn't find an accessible DDC on this connector */
...@@ -520,10 +521,12 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector, ...@@ -520,10 +521,12 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
* EDID header starts with: * EDID header starts with:
* 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00. * 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00.
* Only the first 6 bytes must be valid as * Only the first 6 bytes must be valid as
* drm_edid_block_valid() can fix the last 2 bytes */ * drm_edid_block_valid() can fix the last 2 bytes
*/
if (drm_edid_header_is_valid(buf) < 6) { if (drm_edid_header_is_valid(buf) < 6) {
/* Couldn't find an accessible EDID on this /* Couldn't find an accessible EDID on this
* connector */ * connector
*/
return false; return false;
} }
return true; return true;
...@@ -1216,8 +1219,10 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, ...@@ -1216,8 +1219,10 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev,
obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
if (obj == NULL) { if (obj == NULL) {
drm_dbg_kms(dev, "No GEM object associated to handle 0x%08X, " drm_dbg_kms(dev,
"can't create framebuffer\n", mode_cmd->handles[0]); "No GEM object associated to handle 0x%08X, can't create framebuffer\n",
mode_cmd->handles[0]);
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
} }
...@@ -1410,6 +1415,7 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc, ...@@ -1410,6 +1415,7 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
} }
if (amdgpu_crtc->rmx_type != RMX_OFF) { if (amdgpu_crtc->rmx_type != RMX_OFF) {
fixed20_12 a, b; fixed20_12 a, b;
a.full = dfixed_const(src_v); a.full = dfixed_const(src_v);
b.full = dfixed_const(dst_v); b.full = dfixed_const(dst_v);
amdgpu_crtc->vsc.full = dfixed_div(a, b); amdgpu_crtc->vsc.full = dfixed_div(a, b);
...@@ -1429,7 +1435,7 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc, ...@@ -1429,7 +1435,7 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
* *
* \param dev Device to query. * \param dev Device to query.
* \param pipe Crtc to query. * \param pipe Crtc to query.
* \param flags Flags from caller (DRM_CALLED_FROM_VBLIRQ or 0). * \param flags from caller (DRM_CALLED_FROM_VBLIRQ or 0).
* For driver internal use only also supports these flags: * For driver internal use only also supports these flags:
* *
* USE_REAL_VBLANKSTART to use the real start of vblank instead * USE_REAL_VBLANKSTART to use the real start of vblank instead
...@@ -1504,8 +1510,8 @@ int amdgpu_display_get_crtc_scanoutpos(struct drm_device *dev, ...@@ -1504,8 +1510,8 @@ int amdgpu_display_get_crtc_scanoutpos(struct drm_device *dev,
/* Called from driver internal vblank counter query code? */ /* Called from driver internal vblank counter query code? */
if (flags & GET_DISTANCE_TO_VBLANKSTART) { if (flags & GET_DISTANCE_TO_VBLANKSTART) {
/* Caller wants distance from real vbl_start in *hpos */ /* Caller wants distance from real vbl_start in *hpos */
*hpos = *vpos - vbl_start; *hpos = *vpos - vbl_start;
} }
/* Fudge vblank to start a few scanlines earlier to handle the /* Fudge vblank to start a few scanlines earlier to handle the
...@@ -1527,7 +1533,7 @@ int amdgpu_display_get_crtc_scanoutpos(struct drm_device *dev, ...@@ -1527,7 +1533,7 @@ int amdgpu_display_get_crtc_scanoutpos(struct drm_device *dev,
/* In vblank? */ /* In vblank? */
if (in_vbl) if (in_vbl)
ret |= DRM_SCANOUTPOS_IN_VBLANK; ret |= DRM_SCANOUTPOS_IN_VBLANK;
/* Called from driver internal vblank counter query code? */ /* Called from driver internal vblank counter query code? */
if (flags & GET_DISTANCE_TO_VBLANKSTART) { if (flags & GET_DISTANCE_TO_VBLANKSTART) {
...@@ -1635,6 +1641,7 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev) ...@@ -1635,6 +1641,7 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {
struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
r = amdgpu_bo_reserve(aobj, true); r = amdgpu_bo_reserve(aobj, true);
if (r == 0) { if (r == 0) {
amdgpu_bo_unpin(aobj); amdgpu_bo_unpin(aobj);
...@@ -1642,9 +1649,9 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev) ...@@ -1642,9 +1649,9 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
} }
} }
if (fb == NULL || fb->obj[0] == NULL) { if (!fb || !fb->obj[0])
continue; continue;
}
robj = gem_to_amdgpu_bo(fb->obj[0]); robj = gem_to_amdgpu_bo(fb->obj[0]);
if (!amdgpu_display_robj_is_fb(adev, robj)) { if (!amdgpu_display_robj_is_fb(adev, robj)) {
r = amdgpu_bo_reserve(robj, true); r = amdgpu_bo_reserve(robj, true);
...@@ -1671,6 +1678,7 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev) ...@@ -1671,6 +1678,7 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev)
if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {
struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo);
r = amdgpu_bo_reserve(aobj, true); r = amdgpu_bo_reserve(aobj, true);
if (r == 0) { if (r == 0) {
r = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM); r = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment