Skip to content

Commit

Permalink
drm: Remove usage of deprecated DRM_DEBUG
Browse files Browse the repository at this point in the history
drm_print.h says DRM_DEBUG is deprecated in favor of drm_dbg_core().

Signed-off-by: Siddh Raman Pant <code@siddh.me>
  • Loading branch information
siddhpant authored and intel-lab-lkp committed Dec 21, 2022
1 parent 24eb203 commit 3990929
Show file tree
Hide file tree
Showing 21 changed files with 178 additions and 169 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/drm_agpsupport.c
Expand Up @@ -315,8 +315,8 @@ int drm_legacy_agp_bind(struct drm_device *dev, struct drm_agp_binding *request)
if (retcode)
return retcode;
entry->bound = dev->agp->base + (page << PAGE_SHIFT);
DRM_DEBUG("base = 0x%lx entry->bound = 0x%lx\n",
dev->agp->base, entry->bound);
drm_dbg_core(dev, "base = 0x%lx entry->bound = 0x%lx\n",
dev->agp->base, entry->bound);
return 0;
}
EXPORT_SYMBOL(drm_legacy_agp_bind);
Expand Down
114 changes: 58 additions & 56 deletions drivers/gpu/drm/drm_bufs.c
Expand Up @@ -171,8 +171,8 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset,
kfree(map);
return -EINVAL;
}
DRM_DEBUG("offset = 0x%08llx, size = 0x%08lx, type = %d\n",
(unsigned long long)map->offset, map->size, map->type);
drm_dbg_core(dev, "offset = 0x%08llx, size = 0x%08lx, type = %d\n",
(unsigned long long)map->offset, map->size, map->type);

/* page-align _DRM_SHM maps. They are allocated here so there is no security
* hole created by that and it works around various broken drivers that use
Expand Down Expand Up @@ -205,10 +205,10 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset,
list = drm_find_matching_map(dev, map);
if (list != NULL) {
if (list->map->size != map->size) {
DRM_DEBUG("Matching maps of type %d with "
"mismatched sizes, (%ld vs %ld)\n",
map->type, map->size,
list->map->size);
drm_dbg_core(dev, "Matching maps of type %d with "
"mismatched sizes, (%ld vs %ld)\n",
map->type, map->size,
list->map->size);
list->map->size = map->size;
}

Expand Down Expand Up @@ -239,9 +239,9 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset,
list = drm_find_matching_map(dev, map);
if (list != NULL) {
if (list->map->size != map->size) {
DRM_DEBUG("Matching maps of type %d with "
"mismatched sizes, (%ld vs %ld)\n",
map->type, map->size, list->map->size);
drm_dbg_core(dev, "Matching maps of type %d with "
"mismatched sizes, (%ld vs %ld)\n",
map->type, map->size, list->map->size);
list->map->size = map->size;
}

Expand All @@ -250,8 +250,8 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset,
return 0;
}
map->handle = vmalloc_user(map->size);
DRM_DEBUG("%lu %d %p\n",
map->size, order_base_2(map->size), map->handle);
drm_dbg_core(dev, "%lu %d %p\n",
map->size, order_base_2(map->size), map->handle);
if (!map->handle) {
kfree(map);
return -ENOMEM;
Expand Down Expand Up @@ -308,8 +308,8 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset,
kfree(map);
return -EPERM;
}
DRM_DEBUG("AGP offset = 0x%08llx, size = 0x%08lx\n",
(unsigned long long)map->offset, map->size);
drm_dbg_core(dev, "AGP offset = 0x%08llx, size = 0x%08lx\n",
(unsigned long long)map->offset, map->size);

break;
}
Expand Down Expand Up @@ -749,13 +749,13 @@ int drm_legacy_addbufs_agp(struct drm_device *dev,
byte_count = 0;
agp_offset = dev->agp->base + request->agp_start;

DRM_DEBUG("count: %d\n", count);
DRM_DEBUG("order: %d\n", order);
DRM_DEBUG("size: %d\n", size);
DRM_DEBUG("agp_offset: %lx\n", agp_offset);
DRM_DEBUG("alignment: %d\n", alignment);
DRM_DEBUG("page_order: %d\n", page_order);
DRM_DEBUG("total: %d\n", total);
drm_dbg_core(dev, "count: %d\n", count);
drm_dbg_core(dev, "order: %d\n", order);
drm_dbg_core(dev, "size: %d\n", size);
drm_dbg_core(dev, "agp_offset: %lx\n", agp_offset);
drm_dbg_core(dev, "alignment: %d\n", alignment);
drm_dbg_core(dev, "page_order: %d\n", page_order);
drm_dbg_core(dev, "total: %d\n", total);

if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER)
return -EINVAL;
Expand All @@ -770,7 +770,7 @@ int drm_legacy_addbufs_agp(struct drm_device *dev,
}
}
if (!list_empty(&dev->agp->memory) && !valid) {
DRM_DEBUG("zone invalid\n");
drm_dbg_core(dev, "zone invalid\n");
return -EINVAL;
}
spin_lock(&dev->buf_lock);
Expand Down Expand Up @@ -833,14 +833,15 @@ int drm_legacy_addbufs_agp(struct drm_device *dev,
return -ENOMEM;
}

DRM_DEBUG("buffer %d @ %p\n", entry->buf_count, buf->address);
drm_dbg_core(dev, "buffer %d @ %p\n", entry->buf_count,
buf->address);

offset += alignment;
entry->buf_count++;
byte_count += PAGE_SIZE << page_order;
}

DRM_DEBUG("byte_count: %d\n", byte_count);
drm_dbg_core(dev, "byte_count: %d\n", byte_count);

temp_buflist = krealloc(dma->buflist,
(dma->buf_count + entry->buf_count) *
Expand All @@ -863,8 +864,8 @@ int drm_legacy_addbufs_agp(struct drm_device *dev,
dma->page_count += byte_count >> PAGE_SHIFT;
dma->byte_count += byte_count;

DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count);
DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count);
drm_dbg_core(dev, "dma->buf_count : %d\n", dma->buf_count);
drm_dbg_core(dev, "entry->buf_count : %d\n", entry->buf_count);

mutex_unlock(&dev->struct_mutex);

Expand Down Expand Up @@ -912,8 +913,8 @@ int drm_legacy_addbufs_pci(struct drm_device *dev,
order = order_base_2(request->size);
size = 1 << order;

DRM_DEBUG("count=%d, size=%d (%d), order=%d\n",
request->count, request->size, size, order);
drm_dbg_core(dev, "count=%d, size=%d (%d), order=%d\n",
request->count, request->size, size, order);

if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER)
return -EINVAL;
Expand Down Expand Up @@ -975,8 +976,8 @@ int drm_legacy_addbufs_pci(struct drm_device *dev,
}
memcpy(temp_pagelist,
dma->pagelist, dma->page_count * sizeof(*dma->pagelist));
DRM_DEBUG("pagelist: %d entries\n",
dma->page_count + (count << page_order));
drm_dbg_core(dev, "pagelist: %d entries\n",
dma->page_count + (count << page_order));

entry->buf_size = size;
entry->page_order = page_order;
Expand Down Expand Up @@ -1015,9 +1016,9 @@ int drm_legacy_addbufs_pci(struct drm_device *dev,
}
entry->seglist[entry->seg_count++] = dmah;
for (i = 0; i < (1 << page_order); i++) {
DRM_DEBUG("page %d @ 0x%08lx\n",
dma->page_count + page_count,
(unsigned long)dmah->vaddr + PAGE_SIZE * i);
drm_dbg_core(dev, "page %d @ 0x%08lx\n",
dma->page_count + page_count,
(unsigned long)dmah->vaddr + PAGE_SIZE * i);
temp_pagelist[dma->page_count + page_count++]
= (unsigned long)dmah->vaddr + PAGE_SIZE * i;
}
Expand Down Expand Up @@ -1051,8 +1052,8 @@ int drm_legacy_addbufs_pci(struct drm_device *dev,
return -ENOMEM;
}

DRM_DEBUG("buffer %d @ %p\n",
entry->buf_count, buf->address);
drm_dbg_core(dev, "buffer %d @ %p\n",
entry->buf_count, buf->address);
}
byte_count += PAGE_SIZE << page_order;
}
Expand Down Expand Up @@ -1140,13 +1141,13 @@ static int drm_legacy_addbufs_sg(struct drm_device *dev,
byte_count = 0;
agp_offset = request->agp_start;

DRM_DEBUG("count: %d\n", count);
DRM_DEBUG("order: %d\n", order);
DRM_DEBUG("size: %d\n", size);
DRM_DEBUG("agp_offset: %lu\n", agp_offset);
DRM_DEBUG("alignment: %d\n", alignment);
DRM_DEBUG("page_order: %d\n", page_order);
DRM_DEBUG("total: %d\n", total);
drm_dbg_core(dev, "count: %d\n", count);
drm_dbg_core(dev, "order: %d\n", order);
drm_dbg_core(dev, "size: %d\n", size);
drm_dbg_core(dev, "agp_offset: %lu\n", agp_offset);
drm_dbg_core(dev, "alignment: %d\n", alignment);
drm_dbg_core(dev, "page_order: %d\n", page_order);
drm_dbg_core(dev, "total: %d\n", total);

if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER)
return -EINVAL;
Expand Down Expand Up @@ -1212,14 +1213,15 @@ static int drm_legacy_addbufs_sg(struct drm_device *dev,
return -ENOMEM;
}

DRM_DEBUG("buffer %d @ %p\n", entry->buf_count, buf->address);
drm_dbg_core(dev, "buffer %d @ %p\n", entry->buf_count,
buf->address);

offset += alignment;
entry->buf_count++;
byte_count += PAGE_SIZE << page_order;
}

DRM_DEBUG("byte_count: %d\n", byte_count);
drm_dbg_core(dev, "byte_count: %d\n", byte_count);

temp_buflist = krealloc(dma->buflist,
(dma->buf_count + entry->buf_count) *
Expand All @@ -1242,8 +1244,8 @@ static int drm_legacy_addbufs_sg(struct drm_device *dev,
dma->page_count += byte_count >> PAGE_SHIFT;
dma->byte_count += byte_count;

DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count);
DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count);
drm_dbg_core(dev, "dma->buf_count : %d\n", dma->buf_count);
drm_dbg_core(dev, "entry->buf_count : %d\n", entry->buf_count);

mutex_unlock(&dev->struct_mutex);

Expand Down Expand Up @@ -1344,7 +1346,7 @@ int __drm_legacy_infobufs(struct drm_device *dev,
++count;
}

DRM_DEBUG("count = %d\n", count);
drm_dbg_core(dev, "count = %d\n", count);

if (*p >= count) {
for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) {
Expand All @@ -1353,12 +1355,12 @@ int __drm_legacy_infobufs(struct drm_device *dev,
if (from->buf_count) {
if (f(data, count, from) < 0)
return -EFAULT;
DRM_DEBUG("%d %d %d %d %d\n",
i,
dma->bufs[i].buf_count,
dma->bufs[i].buf_size,
dma->bufs[i].low_mark,
dma->bufs[i].high_mark);
drm_dbg_core(dev, "%d %d %d %d %d\n",
i,
dma->bufs[i].buf_count,
dma->bufs[i].buf_size,
dma->bufs[i].low_mark,
dma->bufs[i].high_mark);
++count;
}
}
Expand Down Expand Up @@ -1421,8 +1423,8 @@ int drm_legacy_markbufs(struct drm_device *dev, void *data,
if (!dma)
return -EINVAL;

DRM_DEBUG("%d, %d, %d\n",
request->size, request->low_mark, request->high_mark);
drm_dbg_core(dev, "%d, %d, %d\n",
request->size, request->low_mark, request->high_mark);
order = order_base_2(request->size);
if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER)
return -EINVAL;
Expand Down Expand Up @@ -1469,7 +1471,7 @@ int drm_legacy_freebufs(struct drm_device *dev, void *data,
if (!dma)
return -EINVAL;

DRM_DEBUG("%d\n", request->count);
drm_dbg_core(dev, "%d\n", request->count);
for (i = 0; i < request->count; i++) {
if (copy_from_user(&idx, &request->list[i], sizeof(idx)))
return -EFAULT;
Expand Down Expand Up @@ -1569,7 +1571,7 @@ int __drm_legacy_mapbufs(struct drm_device *dev, void *data, int *p,
}
done:
*p = dma->buf_count;
DRM_DEBUG("%d buffers, retcode = %d\n", *p, retcode);
drm_dbg_core(dev, "%d buffers, retcode = %d\n", *p, retcode);

return retcode;
}
Expand Down
14 changes: 7 additions & 7 deletions drivers/gpu/drm/drm_context.c
Expand Up @@ -280,7 +280,7 @@ static int drm_context_switch(struct drm_device * dev, int old, int new)
return -EBUSY;
}

DRM_DEBUG("Context switch from %d to %d\n", old, new);
drm_dbg_core(dev, "Context switch from %d to %d\n", old, new);

if (new == dev->last_context) {
clear_bit(0, &dev->context_flag);
Expand Down Expand Up @@ -379,9 +379,9 @@ int drm_legacy_addctx(struct drm_device *dev, void *data,
/* Skip kernel's context and get a new one. */
tmp_handle = drm_legacy_ctxbitmap_next(dev);
}
DRM_DEBUG("%d\n", tmp_handle);
drm_dbg_core(dev, "%d\n", tmp_handle);
if (tmp_handle < 0) {
DRM_DEBUG("Not enough free contexts.\n");
drm_dbg_core(dev, "Not enough free contexts.\n");
/* Should this return -EBUSY instead? */
return tmp_handle;
}
Expand All @@ -390,7 +390,7 @@ int drm_legacy_addctx(struct drm_device *dev, void *data,

ctx_entry = kmalloc(sizeof(*ctx_entry), GFP_KERNEL);
if (!ctx_entry) {
DRM_DEBUG("out of memory\n");
drm_dbg_core(dev, "out of memory\n");
return -ENOMEM;
}

Expand Down Expand Up @@ -449,7 +449,7 @@ int drm_legacy_switchctx(struct drm_device *dev, void *data,
!drm_core_check_feature(dev, DRIVER_LEGACY))
return -EOPNOTSUPP;

DRM_DEBUG("%d\n", ctx->handle);
drm_dbg_core(dev, "%d\n", ctx->handle);
return drm_context_switch(dev, dev->last_context, ctx->handle);
}

Expand All @@ -473,7 +473,7 @@ int drm_legacy_newctx(struct drm_device *dev, void *data,
!drm_core_check_feature(dev, DRIVER_LEGACY))
return -EOPNOTSUPP;

DRM_DEBUG("%d\n", ctx->handle);
drm_dbg_core(dev, "%d\n", ctx->handle);
drm_context_switch_complete(dev, file_priv, ctx->handle);

return 0;
Expand All @@ -499,7 +499,7 @@ int drm_legacy_rmctx(struct drm_device *dev, void *data,
!drm_core_check_feature(dev, DRIVER_LEGACY))
return -EOPNOTSUPP;

DRM_DEBUG("%d\n", ctx->handle);
drm_dbg_core(dev, "%d\n", ctx->handle);
if (ctx->handle != DRM_KERNEL_CONTEXT) {
if (dev->driver->context_dtor)
dev->driver->context_dtor(dev, ctx->handle);
Expand Down
10 changes: 5 additions & 5 deletions drivers/gpu/drm/drm_dma.c
Expand Up @@ -94,11 +94,11 @@ void drm_legacy_dma_takedown(struct drm_device *dev)
/* Clear dma buffers */
for (i = 0; i <= DRM_MAX_ORDER; i++) {
if (dma->bufs[i].seg_count) {
DRM_DEBUG("order %d: buf_count = %d,"
" seg_count = %d\n",
i,
dma->bufs[i].buf_count,
dma->bufs[i].seg_count);
drm_dbg_core(dev, "order %d: buf_count = %d,"
" seg_count = %d\n",
i,
dma->bufs[i].buf_count,
dma->bufs[i].seg_count);
for (j = 0; j < dma->bufs[i].seg_count; j++) {
if (dma->bufs[i].seglist[j]) {
dmah = dma->bufs[i].seglist[j];
Expand Down

0 comments on commit 3990929

Please sign in to comment.