Commit 8eb94c9b authored by Srinivasan Shanmugam's avatar Srinivasan Shanmugam Committed by Alex Deucher

drm/radeon: Fix style issues in radeon _encoders.c & _gart.c

Conform to Linux kernel coding style.

Fixes the following & other checks in radeon_encoders.c & radeon_gart.c:

WARNING: Missing a blank line after declarations
WARNING: Block comments use * on subsequent lines
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
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 avatarGuchun Chen <guchun.chen@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 93125cb7
...@@ -58,6 +58,7 @@ static uint32_t radeon_encoder_clones(struct drm_encoder *encoder) ...@@ -58,6 +58,7 @@ static uint32_t radeon_encoder_clones(struct drm_encoder *encoder)
count = -1; count = -1;
list_for_each_entry(clone_encoder, &dev->mode_config.encoder_list, head) { list_for_each_entry(clone_encoder, &dev->mode_config.encoder_list, head) {
struct radeon_encoder *radeon_clone = to_radeon_encoder(clone_encoder); struct radeon_encoder *radeon_clone = to_radeon_encoder(clone_encoder);
count++; count++;
if (clone_encoder == encoder) if (clone_encoder == encoder)
...@@ -108,9 +109,10 @@ radeon_get_encoder_enum(struct drm_device *dev, uint32_t supported_device, uint8 ...@@ -108,9 +109,10 @@ radeon_get_encoder_enum(struct drm_device *dev, uint32_t supported_device, uint8
if (ASIC_IS_AVIVO(rdev)) if (ASIC_IS_AVIVO(rdev))
ret = ENCODER_INTERNAL_KLDSCP_DAC2_ENUM_ID1; ret = ENCODER_INTERNAL_KLDSCP_DAC2_ENUM_ID1;
else { else {
/*if (rdev->family == CHIP_R200) /* if (rdev->family == CHIP_R200)
ret = ENCODER_INTERNAL_DVO1_ENUM_ID1; * ret = ENCODER_INTERNAL_DVO1_ENUM_ID1;
else*/ * else
*/
ret = ENCODER_INTERNAL_DAC2_ENUM_ID1; ret = ENCODER_INTERNAL_DAC2_ENUM_ID1;
} }
break; break;
...@@ -234,6 +236,7 @@ void radeon_encoder_set_active_device(struct drm_encoder *encoder) ...@@ -234,6 +236,7 @@ void radeon_encoder_set_active_device(struct drm_encoder *encoder)
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
if (connector->encoder == encoder) { if (connector->encoder == encoder) {
struct radeon_connector *radeon_connector = to_radeon_connector(connector); struct radeon_connector *radeon_connector = to_radeon_connector(connector);
radeon_encoder->active_device = radeon_encoder->devices & radeon_connector->devices; radeon_encoder->active_device = radeon_encoder->devices & radeon_connector->devices;
DRM_DEBUG_KMS("setting active device to %08x from %08x %08x for encoder %d\n", DRM_DEBUG_KMS("setting active device to %08x from %08x %08x for encoder %d\n",
radeon_encoder->active_device, radeon_encoder->devices, radeon_encoder->active_device, radeon_encoder->devices,
...@@ -320,12 +323,12 @@ void radeon_panel_mode_fixup(struct drm_encoder *encoder, ...@@ -320,12 +323,12 @@ void radeon_panel_mode_fixup(struct drm_encoder *encoder,
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct radeon_device *rdev = dev->dev_private; struct radeon_device *rdev = dev->dev_private;
struct drm_display_mode *native_mode = &radeon_encoder->native_mode; struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
unsigned hblank = native_mode->htotal - native_mode->hdisplay; unsigned int hblank = native_mode->htotal - native_mode->hdisplay;
unsigned vblank = native_mode->vtotal - native_mode->vdisplay; unsigned int vblank = native_mode->vtotal - native_mode->vdisplay;
unsigned hover = native_mode->hsync_start - native_mode->hdisplay; unsigned int hover = native_mode->hsync_start - native_mode->hdisplay;
unsigned vover = native_mode->vsync_start - native_mode->vdisplay; unsigned int vover = native_mode->vsync_start - native_mode->vdisplay;
unsigned hsync_width = native_mode->hsync_end - native_mode->hsync_start; unsigned int hsync_width = native_mode->hsync_end - native_mode->hsync_start;
unsigned vsync_width = native_mode->vsync_end - native_mode->vsync_start; unsigned int vsync_width = native_mode->vsync_end - native_mode->vsync_start;
adjusted_mode->clock = native_mode->clock; adjusted_mode->clock = native_mode->clock;
adjusted_mode->flags = native_mode->flags; adjusted_mode->flags = native_mode->flags;
...@@ -424,6 +427,7 @@ bool radeon_dig_monitor_is_duallink(struct drm_encoder *encoder, ...@@ -424,6 +427,7 @@ bool radeon_dig_monitor_is_duallink(struct drm_encoder *encoder,
bool radeon_encoder_is_digital(struct drm_encoder *encoder) bool radeon_encoder_is_digital(struct drm_encoder *encoder)
{ {
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
switch (radeon_encoder->encoder_id) { switch (radeon_encoder->encoder_id) {
case ENCODER_OBJECT_ID_INTERNAL_LVDS: case ENCODER_OBJECT_ID_INTERNAL_LVDS:
case ENCODER_OBJECT_ID_INTERNAL_TMDS1: case ENCODER_OBJECT_ID_INTERNAL_TMDS1:
......
...@@ -74,9 +74,9 @@ int radeon_gart_table_ram_alloc(struct radeon_device *rdev) ...@@ -74,9 +74,9 @@ int radeon_gart_table_ram_alloc(struct radeon_device *rdev)
ptr = dma_alloc_coherent(&rdev->pdev->dev, rdev->gart.table_size, ptr = dma_alloc_coherent(&rdev->pdev->dev, rdev->gart.table_size,
&rdev->gart.table_addr, GFP_KERNEL); &rdev->gart.table_addr, GFP_KERNEL);
if (ptr == NULL) { if (!ptr)
return -ENOMEM; return -ENOMEM;
}
#ifdef CONFIG_X86 #ifdef CONFIG_X86
if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480 || if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480 ||
rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) { rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
...@@ -99,9 +99,9 @@ int radeon_gart_table_ram_alloc(struct radeon_device *rdev) ...@@ -99,9 +99,9 @@ int radeon_gart_table_ram_alloc(struct radeon_device *rdev)
*/ */
void radeon_gart_table_ram_free(struct radeon_device *rdev) void radeon_gart_table_ram_free(struct radeon_device *rdev)
{ {
if (rdev->gart.ptr == NULL) { if (!rdev->gart.ptr)
return; return;
}
#ifdef CONFIG_X86 #ifdef CONFIG_X86
if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480 || if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480 ||
rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) { rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
...@@ -133,9 +133,8 @@ int radeon_gart_table_vram_alloc(struct radeon_device *rdev) ...@@ -133,9 +133,8 @@ int radeon_gart_table_vram_alloc(struct radeon_device *rdev)
r = radeon_bo_create(rdev, rdev->gart.table_size, r = radeon_bo_create(rdev, rdev->gart.table_size,
PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM, PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM,
0, NULL, NULL, &rdev->gart.robj); 0, NULL, NULL, &rdev->gart.robj);
if (r) { if (r)
return r; return r;
}
} }
return 0; return 0;
} }
...@@ -197,9 +196,9 @@ void radeon_gart_table_vram_unpin(struct radeon_device *rdev) ...@@ -197,9 +196,9 @@ void radeon_gart_table_vram_unpin(struct radeon_device *rdev)
{ {
int r; int r;
if (rdev->gart.robj == NULL) { if (!rdev->gart.robj)
return; return;
}
r = radeon_bo_reserve(rdev->gart.robj, false); r = radeon_bo_reserve(rdev->gart.robj, false);
if (likely(r == 0)) { if (likely(r == 0)) {
radeon_bo_kunmap(rdev->gart.robj); radeon_bo_kunmap(rdev->gart.robj);
...@@ -220,9 +219,9 @@ void radeon_gart_table_vram_unpin(struct radeon_device *rdev) ...@@ -220,9 +219,9 @@ void radeon_gart_table_vram_unpin(struct radeon_device *rdev)
*/ */
void radeon_gart_table_vram_free(struct radeon_device *rdev) void radeon_gart_table_vram_free(struct radeon_device *rdev)
{ {
if (rdev->gart.robj == NULL) { if (!rdev->gart.robj)
return; return;
}
radeon_bo_unref(&rdev->gart.robj); radeon_bo_unref(&rdev->gart.robj);
} }
...@@ -239,11 +238,10 @@ void radeon_gart_table_vram_free(struct radeon_device *rdev) ...@@ -239,11 +238,10 @@ void radeon_gart_table_vram_free(struct radeon_device *rdev)
* Unbinds the requested pages from the gart page table and * Unbinds the requested pages from the gart page table and
* replaces them with the dummy page (all asics). * replaces them with the dummy page (all asics).
*/ */
void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, void radeon_gart_unbind(struct radeon_device *rdev, unsigned int offset,
int pages) int pages)
{ {
unsigned t; unsigned int t, p;
unsigned p;
int i, j; int i, j;
if (!rdev->gart.ready) { if (!rdev->gart.ready) {
...@@ -284,12 +282,11 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, ...@@ -284,12 +282,11 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset,
* (all asics). * (all asics).
* Returns 0 for success, -EINVAL for failure. * Returns 0 for success, -EINVAL for failure.
*/ */
int radeon_gart_bind(struct radeon_device *rdev, unsigned offset, int radeon_gart_bind(struct radeon_device *rdev, unsigned int offset,
int pages, struct page **pagelist, dma_addr_t *dma_addr, int pages, struct page **pagelist, dma_addr_t *dma_addr,
uint32_t flags) uint32_t flags)
{ {
unsigned t; unsigned int t, p;
unsigned p;
uint64_t page_base, page_entry; uint64_t page_base, page_entry;
int i, j; int i, j;
...@@ -307,9 +304,9 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset, ...@@ -307,9 +304,9 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
for (j = 0; j < (PAGE_SIZE / RADEON_GPU_PAGE_SIZE); j++, t++) { for (j = 0; j < (PAGE_SIZE / RADEON_GPU_PAGE_SIZE); j++, t++) {
page_entry = radeon_gart_get_page_entry(page_base, flags); page_entry = radeon_gart_get_page_entry(page_base, flags);
rdev->gart.pages_entry[t] = page_entry; rdev->gart.pages_entry[t] = page_entry;
if (rdev->gart.ptr) { if (rdev->gart.ptr)
radeon_gart_set_page(rdev, t, page_entry); radeon_gart_set_page(rdev, t, page_entry);
}
page_base += RADEON_GPU_PAGE_SIZE; page_base += RADEON_GPU_PAGE_SIZE;
} }
} }
...@@ -332,9 +329,9 @@ int radeon_gart_init(struct radeon_device *rdev) ...@@ -332,9 +329,9 @@ int radeon_gart_init(struct radeon_device *rdev)
{ {
int r, i; int r, i;
if (rdev->gart.pages) { if (rdev->gart.pages)
return 0; return 0;
}
/* We need PAGE_SIZE >= RADEON_GPU_PAGE_SIZE */ /* We need PAGE_SIZE >= RADEON_GPU_PAGE_SIZE */
if (PAGE_SIZE < RADEON_GPU_PAGE_SIZE) { if (PAGE_SIZE < RADEON_GPU_PAGE_SIZE) {
DRM_ERROR("Page size is smaller than GPU page size!\n"); DRM_ERROR("Page size is smaller than GPU page size!\n");
......
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