[Intel-gfx] [RFC] drm: add DRM_DEBUG_CORE() and friends and use them
Jani Nikula
jani.nikula at intel.com
Thu Dec 27 16:23:10 UTC 2018
DRM_DEBUG() was intended to be used by the drm core code only, but we
weren't careful. Today, the driver usage of DRM_DEBUG() trumps drm core
usage about 10:1. It's easier to swith the core over to a new
DRM_DEBUG_CORE() macro than the drivers over to DRM_DEBUG_DRIVER().
Do the same for DRM_DEV_DEBUG() and the ratelimited ones as well.
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
drivers/gpu/drm/ati_pcigart.c | 4 +-
drivers/gpu/drm/drm_agpsupport.c | 6 +-
drivers/gpu/drm/drm_auth.c | 4 +-
drivers/gpu/drm/drm_bufs.c | 112 +++++++++++++++++++-------------------
drivers/gpu/drm/drm_context.c | 14 ++---
drivers/gpu/drm/drm_dma.c | 10 ++--
drivers/gpu/drm/drm_dp_aux_dev.c | 6 +-
drivers/gpu/drm/drm_drv.c | 10 ++--
drivers/gpu/drm/drm_edid.c | 48 ++++++++--------
drivers/gpu/drm/drm_fb_helper.c | 16 +++---
drivers/gpu/drm/drm_file.c | 20 +++----
drivers/gpu/drm/drm_framebuffer.c | 2 +-
drivers/gpu/drm/drm_hashtab.c | 4 +-
drivers/gpu/drm/drm_ioc32.c | 12 ++--
drivers/gpu/drm/drm_ioctl.c | 16 +++---
drivers/gpu/drm/drm_irq.c | 4 +-
drivers/gpu/drm/drm_lease.c | 2 +-
drivers/gpu/drm/drm_lock.c | 20 +++----
drivers/gpu/drm/drm_mode_object.c | 4 +-
drivers/gpu/drm/drm_pci.c | 10 ++--
drivers/gpu/drm/drm_plane.c | 10 ++--
drivers/gpu/drm/drm_scatter.c | 10 ++--
drivers/gpu/drm/drm_sysfs.c | 8 +--
drivers/gpu/drm/drm_vblank.c | 62 ++++++++++-----------
drivers/gpu/drm/drm_vm.c | 32 +++++------
include/drm/drm_print.h | 32 ++++++-----
26 files changed, 242 insertions(+), 236 deletions(-)
diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c
index 2362f07fe1fc..80af5b62154b 100644
--- a/drivers/gpu/drm/ati_pcigart.c
+++ b/drivers/gpu/drm/ati_pcigart.c
@@ -112,7 +112,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
}
if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
- DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n");
+ DRM_DEBUG_CORE("PCI: no table in VRAM: using normal RAM\n");
if (pci_set_dma_mask(dev->pdev, gart_info->table_mask)) {
DRM_ERROR("fail to set dma mask to 0x%Lx\n",
@@ -133,7 +133,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
} else {
address = gart_info->addr;
bus_address = gart_info->bus_addr;
- DRM_DEBUG("PCI: Gart Table: VRAM %08LX mapped at %08lX\n",
+ DRM_DEBUG_CORE("PCI: Gart Table: VRAM %08LX mapped at %08lX\n",
(unsigned long long)bus_address,
(unsigned long)address);
}
diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index 737f02885c28..ab567d4e4e81 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -323,8 +323,8 @@ int drm_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_DEBUG_CORE("base = 0x%lx entry->bound = 0x%lx\n",
+ dev->agp->base, entry->bound);
return 0;
}
EXPORT_SYMBOL(drm_agp_bind);
@@ -476,7 +476,7 @@ drm_agp_bind_pages(struct drm_device *dev,
struct agp_memory *mem;
int ret, i;
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
mem = agp_allocate_memory(dev->agp->bridge, num_pages,
type);
diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
index 1669c42c40ed..ef46299784d8 100644
--- a/drivers/gpu/drm/drm_auth.c
+++ b/drivers/gpu/drm/drm_auth.c
@@ -70,7 +70,7 @@ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv)
auth->magic = file_priv->magic;
mutex_unlock(&dev->master_mutex);
- DRM_DEBUG("%u\n", auth->magic);
+ DRM_DEBUG_CORE("%u\n", auth->magic);
return ret < 0 ? ret : 0;
}
@@ -81,7 +81,7 @@ int drm_authmagic(struct drm_device *dev, void *data,
struct drm_auth *auth = data;
struct drm_file *file;
- DRM_DEBUG("%u\n", auth->magic);
+ DRM_DEBUG_CORE("%u\n", auth->magic);
mutex_lock(&dev->master_mutex);
file = idr_find(&file_priv->master->magic_map, auth->magic);
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index d7d10cabb9bb..f7d5af8604c2 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -159,8 +159,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_DEBUG_CORE("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
@@ -193,10 +193,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_DEBUG_CORE("Matching maps of type %d with "
+ "mismatched sizes, (%ld vs %ld)\n",
+ map->type, map->size,
+ list->map->size);
list->map->size = map->size;
}
@@ -227,9 +227,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_DEBUG_CORE("Matching maps of type %d with "
+ "mismatched sizes, (%ld vs %ld)\n",
+ map->type, map->size, list->map->size);
list->map->size = map->size;
}
@@ -238,8 +238,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_DEBUG_CORE("%lu %d %p\n",
+ map->size, order_base_2(map->size), map->handle);
if (!map->handle) {
kfree(map);
return -ENOMEM;
@@ -296,8 +296,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_DEBUG_CORE("AGP offset = 0x%08llx, size = 0x%08lx\n",
+ (unsigned long long)map->offset, map->size);
break;
}
@@ -711,13 +711,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_DEBUG_CORE("count: %d\n", count);
+ DRM_DEBUG_CORE("order: %d\n", order);
+ DRM_DEBUG_CORE("size: %d\n", size);
+ DRM_DEBUG_CORE("agp_offset: %lx\n", agp_offset);
+ DRM_DEBUG_CORE("alignment: %d\n", alignment);
+ DRM_DEBUG_CORE("page_order: %d\n", page_order);
+ DRM_DEBUG_CORE("total: %d\n", total);
if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER)
return -EINVAL;
@@ -732,7 +732,7 @@ int drm_legacy_addbufs_agp(struct drm_device *dev,
}
}
if (!list_empty(&dev->agp->memory) && !valid) {
- DRM_DEBUG("zone invalid\n");
+ DRM_DEBUG_CORE("zone invalid\n");
return -EINVAL;
}
spin_lock(&dev->buf_lock);
@@ -795,14 +795,14 @@ int drm_legacy_addbufs_agp(struct drm_device *dev,
return -ENOMEM;
}
- DRM_DEBUG("buffer %d @ %p\n", entry->buf_count, buf->address);
+ DRM_DEBUG_CORE("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_DEBUG_CORE("byte_count: %d\n", byte_count);
temp_buflist = krealloc(dma->buflist,
(dma->buf_count + entry->buf_count) *
@@ -825,8 +825,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_DEBUG_CORE("dma->buf_count : %d\n", dma->buf_count);
+ DRM_DEBUG_CORE("entry->buf_count : %d\n", entry->buf_count);
mutex_unlock(&dev->struct_mutex);
@@ -874,8 +874,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_DEBUG_CORE("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;
@@ -937,8 +937,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_DEBUG_CORE("pagelist: %d entries\n",
+ dma->page_count + (count << page_order));
entry->buf_size = size;
entry->page_order = page_order;
@@ -961,9 +961,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_DEBUG_CORE("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;
}
@@ -997,8 +997,8 @@ int drm_legacy_addbufs_pci(struct drm_device *dev,
return -ENOMEM;
}
- DRM_DEBUG("buffer %d @ %p\n",
- entry->buf_count, buf->address);
+ DRM_DEBUG_CORE("buffer %d @ %p\n",
+ entry->buf_count, buf->address);
}
byte_count += PAGE_SIZE << page_order;
}
@@ -1086,13 +1086,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_DEBUG_CORE("count: %d\n", count);
+ DRM_DEBUG_CORE("order: %d\n", order);
+ DRM_DEBUG_CORE("size: %d\n", size);
+ DRM_DEBUG_CORE("agp_offset: %lu\n", agp_offset);
+ DRM_DEBUG_CORE("alignment: %d\n", alignment);
+ DRM_DEBUG_CORE("page_order: %d\n", page_order);
+ DRM_DEBUG_CORE("total: %d\n", total);
if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER)
return -EINVAL;
@@ -1158,14 +1158,14 @@ static int drm_legacy_addbufs_sg(struct drm_device *dev,
return -ENOMEM;
}
- DRM_DEBUG("buffer %d @ %p\n", entry->buf_count, buf->address);
+ DRM_DEBUG_CORE("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_DEBUG_CORE("byte_count: %d\n", byte_count);
temp_buflist = krealloc(dma->buflist,
(dma->buf_count + entry->buf_count) *
@@ -1188,8 +1188,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_DEBUG_CORE("dma->buf_count : %d\n", dma->buf_count);
+ DRM_DEBUG_CORE("entry->buf_count : %d\n", entry->buf_count);
mutex_unlock(&dev->struct_mutex);
@@ -1290,7 +1290,7 @@ int __drm_legacy_infobufs(struct drm_device *dev,
++count;
}
- DRM_DEBUG("count = %d\n", count);
+ DRM_DEBUG_CORE("count = %d\n", count);
if (*p >= count) {
for (i = 0, count = 0; i < DRM_MAX_ORDER + 1; i++) {
@@ -1298,12 +1298,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_DEBUG_CORE("%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;
}
}
@@ -1362,8 +1362,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_DEBUG_CORE("%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;
@@ -1410,7 +1410,7 @@ int drm_legacy_freebufs(struct drm_device *dev, void *data,
if (!dma)
return -EINVAL;
- DRM_DEBUG("%d\n", request->count);
+ DRM_DEBUG_CORE("%d\n", request->count);
for (i = 0; i < request->count; i++) {
if (copy_from_user(&idx, &request->list[i], sizeof(idx)))
return -EFAULT;
@@ -1510,7 +1510,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_DEBUG_CORE("%d buffers, retcode = %d\n", *p, retcode);
return retcode;
}
diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c
index 506663c69b0a..6f0bedbe66a9 100644
--- a/drivers/gpu/drm/drm_context.c
+++ b/drivers/gpu/drm/drm_context.c
@@ -274,7 +274,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_DEBUG_CORE("Context switch from %d to %d\n", old, new);
if (new == dev->last_context) {
clear_bit(0, &dev->context_flag);
@@ -371,16 +371,16 @@ int drm_legacy_addctx(struct drm_device *dev, void *data,
/* Skip kernel's context and get a new one. */
ctx->handle = drm_legacy_ctxbitmap_next(dev);
}
- DRM_DEBUG("%d\n", ctx->handle);
+ DRM_DEBUG_CORE("%d\n", ctx->handle);
if (ctx->handle < 0) {
- DRM_DEBUG("Not enough free contexts.\n");
+ DRM_DEBUG_CORE("Not enough free contexts.\n");
/* Should this return -EBUSY instead? */
return -ENOMEM;
}
ctx_entry = kmalloc(sizeof(*ctx_entry), GFP_KERNEL);
if (!ctx_entry) {
- DRM_DEBUG("out of memory\n");
+ DRM_DEBUG_CORE("out of memory\n");
return -ENOMEM;
}
@@ -439,7 +439,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_DEBUG_CORE("%d\n", ctx->handle);
return drm_context_switch(dev, dev->last_context, ctx->handle);
}
@@ -463,7 +463,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_DEBUG_CORE("%d\n", ctx->handle);
drm_context_switch_complete(dev, file_priv, ctx->handle);
return 0;
@@ -489,7 +489,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_DEBUG_CORE("%d\n", ctx->handle);
if (ctx->handle != DRM_KERNEL_CONTEXT) {
if (dev->driver->context_dtor)
dev->driver->context_dtor(dev, ctx->handle);
diff --git a/drivers/gpu/drm/drm_dma.c b/drivers/gpu/drm/drm_dma.c
index 3f83e2ca80ad..360f87d2b503 100644
--- a/drivers/gpu/drm/drm_dma.c
+++ b/drivers/gpu/drm/drm_dma.c
@@ -89,11 +89,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_DEBUG_CORE("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]) {
drm_pci_free(dev, dma->bufs[i].seglist[j]);
diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c
index 0e4f25d63fd2..6600b495b585 100644
--- a/drivers/gpu/drm/drm_dp_aux_dev.c
+++ b/drivers/gpu/drm/drm_dp_aux_dev.c
@@ -286,7 +286,7 @@ void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux)
device_destroy(drm_dp_aux_dev_class,
MKDEV(drm_dev_major, minor));
- DRM_DEBUG("drm_dp_aux_dev: aux [%s] unregistering\n", aux->name);
+ DRM_DEBUG_CORE("drm_dp_aux_dev: aux [%s] unregistering\n", aux->name);
kref_put(&aux_dev->refcount, release_drm_dp_aux_dev);
}
@@ -308,8 +308,8 @@ int drm_dp_aux_register_devnode(struct drm_dp_aux *aux)
goto error;
}
- DRM_DEBUG("drm_dp_aux_dev: aux [%s] registered as minor %d\n",
- aux->name, aux_dev->index);
+ DRM_DEBUG_CORE("drm_dp_aux_dev: aux [%s] registered as minor %d\n",
+ aux->name, aux_dev->index);
return 0;
error:
drm_dp_aux_unregister_devnode(aux);
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index a5fe91b8c3c9..ec6b6b22a7b7 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -177,7 +177,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
unsigned long flags;
int ret;
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
minor = *drm_minor_get_slot(dev, type);
if (!minor)
@@ -198,7 +198,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
idr_replace(&drm_minors_idr, minor, minor->index);
spin_unlock_irqrestore(&drm_minor_lock, flags);
- DRM_DEBUG("new minor registered %d\n", minor->index);
+ DRM_DEBUG_CORE("new minor registered %d\n", minor->index);
return 0;
err_debugfs:
@@ -308,7 +308,7 @@ void drm_minor_release(struct drm_minor *minor)
*/
void drm_put_dev(struct drm_device *dev)
{
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
if (!dev) {
DRM_ERROR("cleanup called no dev\n");
@@ -918,7 +918,7 @@ static int drm_stub_open(struct inode *inode, struct file *filp)
struct drm_minor *minor;
int err;
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
mutex_lock(&drm_global_mutex);
minor = drm_minor_acquire(iminor(inode));
@@ -987,7 +987,7 @@ static int __init drm_core_init(void)
drm_core_init_complete = true;
- DRM_DEBUG("Initialized\n");
+ DRM_DEBUG_CORE("Initialized\n");
return 0;
error:
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b506e3622b08..fc30d6fad251 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1380,7 +1380,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
*/
if (edid_corrupt)
*edid_corrupt = true;
- DRM_DEBUG("Fixing EDID header, your hardware may be failing\n");
+ DRM_DEBUG_CORE("Fixing EDID header, your hardware may be failing\n");
memcpy(raw_edid, edid_header, sizeof(edid_header));
} else {
if (edid_corrupt)
@@ -1396,8 +1396,8 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
/* allow CEA to slide through, switches mangle this */
if (raw_edid[0] == CEA_EXT) {
- DRM_DEBUG("EDID checksum is invalid, remainder is %d\n", csum);
- DRM_DEBUG("Assuming a KVM switch modified the CEA block but left the original checksum\n");
+ DRM_DEBUG_CORE("EDID checksum is invalid, remainder is %d\n", csum);
+ DRM_DEBUG_CORE("Assuming a KVM switch modified the CEA block but left the original checksum\n");
} else {
if (print_bad_edid)
DRM_NOTE("EDID checksum is invalid, remainder is %d\n", csum);
@@ -1415,7 +1415,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
}
if (edid->revision > 4)
- DRM_DEBUG("EDID minor > 4, assuming backward compatibility\n");
+ DRM_DEBUG_CORE("EDID minor > 4, assuming backward compatibility\n");
break;
default:
@@ -3797,8 +3797,8 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
if (mode->clock == clock)
return;
- DRM_DEBUG("detailed mode matches %s VIC %d, adjusting clock %d -> %d\n",
- type, vic, mode->clock, clock);
+ DRM_DEBUG_CORE("detailed mode matches %s VIC %d, adjusting clock %d -> %d\n",
+ type, vic, mode->clock, clock);
mode->clock = clock;
}
@@ -4349,32 +4349,32 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
dc_bpc = 10;
info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_30;
- DRM_DEBUG("%s: HDMI sink does deep color 30.\n",
- connector->name);
+ DRM_DEBUG_CORE("%s: HDMI sink does deep color 30.\n",
+ connector->name);
}
if (hdmi[6] & DRM_EDID_HDMI_DC_36) {
dc_bpc = 12;
info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_36;
- DRM_DEBUG("%s: HDMI sink does deep color 36.\n",
- connector->name);
+ DRM_DEBUG_CORE("%s: HDMI sink does deep color 36.\n",
+ connector->name);
}
if (hdmi[6] & DRM_EDID_HDMI_DC_48) {
dc_bpc = 16;
info->edid_hdmi_dc_modes |= DRM_EDID_HDMI_DC_48;
- DRM_DEBUG("%s: HDMI sink does deep color 48.\n",
- connector->name);
+ DRM_DEBUG_CORE("%s: HDMI sink does deep color 48.\n",
+ connector->name);
}
if (dc_bpc == 0) {
- DRM_DEBUG("%s: No deep color support on this HDMI sink.\n",
- connector->name);
+ DRM_DEBUG_CORE("%s: No deep color support on this HDMI sink.\n",
+ connector->name);
return;
}
- DRM_DEBUG("%s: Assigning HDMI sink color depth as %d bpc.\n",
- connector->name, dc_bpc);
+ DRM_DEBUG_CORE("%s: Assigning HDMI sink color depth as %d bpc.\n",
+ connector->name, dc_bpc);
info->bpc = dc_bpc;
/*
@@ -4387,8 +4387,8 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
/* YCRCB444 is optional according to spec. */
if (hdmi[6] & DRM_EDID_HDMI_DC_Y444) {
info->color_formats |= DRM_COLOR_FORMAT_YCRCB444;
- DRM_DEBUG("%s: HDMI sink does YCRCB444 in deep color.\n",
- connector->name);
+ DRM_DEBUG_CORE("%s: HDMI sink does YCRCB444 in deep color.\n",
+ connector->name);
}
/*
@@ -4396,8 +4396,8 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
* then deep color 36 bit must be supported.
*/
if (!(hdmi[6] & DRM_EDID_HDMI_DC_36)) {
- DRM_DEBUG("%s: HDMI sink should do DC_36, but does not!\n",
- connector->name);
+ DRM_DEBUG_CORE("%s: HDMI sink should do DC_36, but does not!\n",
+ connector->name);
}
}
@@ -4510,8 +4510,8 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
if ((info->bpc == 0) && (edid->revision < 4) &&
(edid->input & DRM_EDID_DIGITAL_TYPE_DVI)) {
info->bpc = 8;
- DRM_DEBUG("%s: Assigning DFP sink color depth as %d bpc.\n",
- connector->name, info->bpc);
+ DRM_DEBUG_CORE("%s: Assigning DFP sink color depth as %d bpc.\n",
+ connector->name, info->bpc);
}
/* Only defined for 1.4 with digital displays */
@@ -4543,8 +4543,8 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
break;
}
- DRM_DEBUG("%s: Assigning EDID-1.4 digital sink color depth as %d bpc.\n",
- connector->name, info->bpc);
+ DRM_DEBUG_CORE("%s: Assigning EDID-1.4 digital sink color depth as %d bpc.\n",
+ connector->name, info->bpc);
info->color_formats |= DRM_COLOR_FORMAT_RGB444;
if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index d3af098b0922..454e20fd32d6 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1646,11 +1646,11 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
if (var->bits_per_pixel != fb->format->cpp[0] * 8 ||
var->xres > fb->width || var->yres > fb->height ||
var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
- DRM_DEBUG("fb requested width/height/bpp can't fit in current fb "
- "request %dx%d-%d (virtual %dx%d) > %dx%d-%d\n",
- var->xres, var->yres, var->bits_per_pixel,
- var->xres_virtual, var->yres_virtual,
- fb->width, fb->height, fb->format->cpp[0] * 8);
+ DRM_DEBUG_CORE("fb requested width/height/bpp can't fit in current fb "
+ "request %dx%d-%d (virtual %dx%d) > %dx%d-%d\n",
+ var->xres, var->yres, var->bits_per_pixel,
+ var->xres_virtual, var->yres_virtual,
+ fb->width, fb->height, fb->format->cpp[0] * 8);
return -EINVAL;
}
@@ -1659,7 +1659,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
* so reject all pixel format changing requests.
*/
if (!drm_fb_pixel_format_equal(var, &info->var)) {
- DRM_DEBUG("fbdev emulation doesn't support changing the pixel format\n");
+ DRM_DEBUG_CORE("fbdev emulation doesn't support changing the pixel format\n");
return -EINVAL;
}
@@ -3166,7 +3166,7 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client)
return drm_fb_helper_hotplug_event(dev->fb_helper);
if (!dev->mode_config.num_connector) {
- DRM_DEV_DEBUG(dev->dev, "No connectors found, will not create framebuffer!\n");
+ DRM_DEV_DEBUG_CORE(dev->dev, "No connectors found, will not create framebuffer!\n");
return 0;
}
@@ -3241,7 +3241,7 @@ int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)
ret = drm_fbdev_client_hotplug(&fb_helper->client);
if (ret)
- DRM_DEV_DEBUG(dev->dev, "client hotplug ret=%d\n", ret);
+ DRM_DEV_DEBUG_CORE(dev->dev, "client hotplug ret=%d\n", ret);
return 0;
}
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index ffa8dc35515f..2aefdaa12c1d 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -217,10 +217,10 @@ void drm_file_free(struct drm_file *file)
dev = file->minor->dev;
- DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n",
- task_pid_nr(current),
- (long)old_encode_dev(file->minor->kdev->devt),
- dev->open_count);
+ DRM_DEBUG_CORE("pid = %d, device = 0x%lx, open_count = %d\n",
+ task_pid_nr(current),
+ (long)old_encode_dev(file->minor->kdev->devt),
+ dev->open_count);
if (drm_core_check_feature(dev, DRIVER_LEGACY) &&
dev->driver->preclose)
@@ -278,7 +278,7 @@ static int drm_setup(struct drm_device * dev)
return ret;
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
return 0;
}
@@ -366,7 +366,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
if (dev->switch_power_state != DRM_SWITCH_POWER_ON && dev->switch_power_state != DRM_SWITCH_POWER_DYNAMIC_OFF)
return -EINVAL;
- DRM_DEBUG("pid = %d, minor = %d\n", task_pid_nr(current), minor->index);
+ DRM_DEBUG_CORE("pid = %d, minor = %d\n", task_pid_nr(current), minor->index);
priv = drm_file_alloc(minor);
if (IS_ERR(priv))
@@ -432,16 +432,16 @@ static void drm_legacy_dev_reinit(struct drm_device *dev)
dev->last_context = 0;
dev->if_version = 0;
- DRM_DEBUG("lastclose completed\n");
+ DRM_DEBUG_CORE("lastclose completed\n");
}
void drm_lastclose(struct drm_device * dev)
{
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
if (dev->driver->lastclose)
dev->driver->lastclose(dev);
- DRM_DEBUG("driver lastclose completed\n");
+ DRM_DEBUG_CORE("driver lastclose completed\n");
if (drm_core_check_feature(dev, DRIVER_LEGACY))
drm_legacy_dev_reinit(dev);
@@ -471,7 +471,7 @@ int drm_release(struct inode *inode, struct file *filp)
mutex_lock(&drm_global_mutex);
- DRM_DEBUG("open_count = %d\n", dev->open_count);
+ DRM_DEBUG_CORE("open_count = %d\n", dev->open_count);
mutex_lock(&dev->filelist_mutex);
list_del(&file_priv->lhead);
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index fcaea8f50513..b9b2a601fef3 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -118,7 +118,7 @@ int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
r.pixel_format = drm_driver_legacy_fb_format(dev, or->bpp, or->depth);
if (r.pixel_format == DRM_FORMAT_INVALID) {
- DRM_DEBUG("bad {bpp:%d, depth:%d}\n", or->bpp, or->depth);
+ DRM_DEBUG_CORE("bad {bpp:%d, depth:%d}\n", or->bpp, or->depth);
return -EINVAL;
}
diff --git a/drivers/gpu/drm/drm_hashtab.c b/drivers/gpu/drm/drm_hashtab.c
index c92b00d42ece..b434f61e5b4d 100644
--- a/drivers/gpu/drm/drm_hashtab.c
+++ b/drivers/gpu/drm/drm_hashtab.c
@@ -64,10 +64,10 @@ void drm_ht_verbose_list(struct drm_open_hash *ht, unsigned long key)
int count = 0;
hashed_key = hash_long(key, ht->order);
- DRM_DEBUG("Key is 0x%08lx, Hashed key is 0x%08x\n", key, hashed_key);
+ DRM_DEBUG_CORE("Key is 0x%08lx, Hashed key is 0x%08x\n", key, hashed_key);
h_list = &ht->table[hashed_key];
hlist_for_each_entry(entry, h_list, head)
- DRM_DEBUG("count %d, key: 0x%08lx\n", count++, entry->key);
+ DRM_DEBUG_CORE("count %d, key: 0x%08lx\n", count++, entry->key);
}
static struct hlist_node *drm_ht_find_key(struct drm_open_hash *ht,
diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
index 67b1fca39aa6..ca6420e4fcf8 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
@@ -969,14 +969,14 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (!fn)
return drm_ioctl(filp, cmd, arg);
- DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n",
- task_pid_nr(current),
- (long)old_encode_dev(file_priv->minor->kdev->devt),
- file_priv->authenticated,
- drm_compat_ioctls[nr].name);
+ DRM_DEBUG_CORE("pid=%d, dev=0x%lx, auth=%d, %s\n",
+ task_pid_nr(current),
+ (long)old_encode_dev(file_priv->minor->kdev->devt),
+ file_priv->authenticated,
+ drm_compat_ioctls[nr].name);
ret = (*fn)(filp, cmd, arg);
if (ret)
- DRM_DEBUG("ret = %d\n", ret);
+ DRM_DEBUG_CORE("ret = %d\n", ret);
return ret;
}
EXPORT_SYMBOL(drm_compat_ioctl);
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 7e6746b2d704..cdf377d9e2f5 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -426,7 +426,7 @@ static int drm_setversion(struct drm_device *dev, void *data, struct drm_file *f
int drm_noop(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
return 0;
}
EXPORT_SYMBOL(drm_noop);
@@ -823,7 +823,7 @@ long drm_ioctl(struct file *filp,
out_size = 0;
ksize = max(max(in_size, out_size), drv_size);
- DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n",
+ DRM_DEBUG_CORE("pid=%d, dev=0x%lx, auth=%d, %s\n",
task_pid_nr(current),
(long)old_encode_dev(file_priv->minor->kdev->devt),
file_priv->authenticated, ioctl->name);
@@ -832,7 +832,7 @@ long drm_ioctl(struct file *filp,
func = ioctl->func;
if (unlikely(!func)) {
- DRM_DEBUG("no function\n");
+ DRM_DEBUG_CORE("no function\n");
retcode = -EINVAL;
goto err_i1;
}
@@ -861,15 +861,15 @@ long drm_ioctl(struct file *filp,
err_i1:
if (!ioctl)
- DRM_DEBUG("invalid ioctl: pid=%d, dev=0x%lx, auth=%d, cmd=0x%02x, nr=0x%02x\n",
- task_pid_nr(current),
- (long)old_encode_dev(file_priv->minor->kdev->devt),
- file_priv->authenticated, cmd, nr);
+ DRM_DEBUG_CORE("invalid ioctl: pid=%d, dev=0x%lx, auth=%d, cmd=0x%02x, nr=0x%02x\n",
+ task_pid_nr(current),
+ (long)old_encode_dev(file_priv->minor->kdev->devt),
+ file_priv->authenticated, cmd, nr);
if (kdata != stack_kdata)
kfree(kdata);
if (retcode)
- DRM_DEBUG("pid=%d, ret = %d\n", task_pid_nr(current), retcode);
+ DRM_DEBUG_CORE("pid=%d, ret = %d\n", task_pid_nr(current), retcode);
return retcode;
}
EXPORT_SYMBOL(drm_ioctl);
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 45a07652fa00..6d3fef78d425 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -117,7 +117,7 @@ int drm_irq_install(struct drm_device *dev, int irq)
return -EBUSY;
dev->irq_enabled = true;
- DRM_DEBUG("irq=%d\n", irq);
+ DRM_DEBUG_CORE("irq=%d\n", irq);
/* Before installing handler */
if (dev->driver->irq_preinstall)
@@ -205,7 +205,7 @@ int drm_irq_uninstall(struct drm_device *dev)
if (!irq_enabled)
return -EINVAL;
- DRM_DEBUG("irq=%d\n", dev->irq);
+ DRM_DEBUG_CORE("irq=%d\n", dev->irq);
if (drm_core_check_feature(dev, DRIVER_LEGACY))
vga_client_register(dev->pdev, NULL, NULL, NULL);
diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
index b735704653cb..bfdbaa4c6fdf 100644
--- a/drivers/gpu/drm/drm_lease.c
+++ b/drivers/gpu/drm/drm_lease.c
@@ -703,7 +703,7 @@ int drm_mode_get_lease_ioctl(struct drm_device *dev,
count++;
}
- DRM_DEBUG("lease holds %d objects\n", count);
+ DRM_DEBUG_CORE("lease holds %d objects\n", count);
if (ret == 0)
arg->count_objects = count;
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c
index 67a1a2ca7174..c32f8f09c9d8 100644
--- a/drivers/gpu/drm/drm_lock.c
+++ b/drivers/gpu/drm/drm_lock.c
@@ -176,10 +176,10 @@ int drm_legacy_lock(struct drm_device *dev, void *data,
return -EINVAL;
}
- DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n",
- lock->context, task_pid_nr(current),
- master->lock.hw_lock ? master->lock.hw_lock->lock : -1,
- lock->flags);
+ DRM_DEBUG_CORE("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n",
+ lock->context, task_pid_nr(current),
+ master->lock.hw_lock ? master->lock.hw_lock->lock : -1,
+ lock->flags);
add_wait_queue(&master->lock.lock_queue, &entry);
spin_lock_bh(&master->lock.spinlock);
@@ -215,8 +215,8 @@ int drm_legacy_lock(struct drm_device *dev, void *data,
__set_current_state(TASK_RUNNING);
remove_wait_queue(&master->lock.lock_queue, &entry);
- DRM_DEBUG("%d %s\n", lock->context,
- ret ? "interrupted" : "has lock");
+ DRM_DEBUG_CORE("%d %s\n", lock->context,
+ ret ? "interrupted" : "has lock");
if (ret) return ret;
/* don't set the block all signals on the master process for now
@@ -230,8 +230,8 @@ int drm_legacy_lock(struct drm_device *dev, void *data,
if (dev->driver->dma_quiescent && (lock->flags & _DRM_LOCK_QUIESCENT))
{
if (dev->driver->dma_quiescent(dev)) {
- DRM_DEBUG("%d waiting for DMA quiescent\n",
- lock->context);
+ DRM_DEBUG_CORE("%d waiting for DMA quiescent\n",
+ lock->context);
return -EBUSY;
}
}
@@ -341,8 +341,8 @@ void drm_legacy_lock_release(struct drm_device *dev, struct file *filp)
return;
if (drm_legacy_i_have_hw_lock(dev, file_priv)) {
- DRM_DEBUG("File %p released, freeing lock for context %d\n",
- filp, _DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock));
+ DRM_DEBUG_CORE("File %p released, freeing lock for context %d\n",
+ filp, _DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock));
drm_legacy_lock_free(&file_priv->master->lock,
_DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock));
}
diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
index bb1dd46496cd..8f31bf6cf2d0 100644
--- a/drivers/gpu/drm/drm_mode_object.c
+++ b/drivers/gpu/drm/drm_mode_object.c
@@ -183,7 +183,7 @@ EXPORT_SYMBOL(drm_mode_object_find);
void drm_mode_object_put(struct drm_mode_object *obj)
{
if (obj->free_cb) {
- DRM_DEBUG("OBJ ID: %d (%d)\n", obj->id, kref_read(&obj->refcount));
+ DRM_DEBUG_CORE("OBJ ID: %d (%d)\n", obj->id, kref_read(&obj->refcount));
kref_put(&obj->refcount, obj->free_cb);
}
}
@@ -200,7 +200,7 @@ EXPORT_SYMBOL(drm_mode_object_put);
void drm_mode_object_get(struct drm_mode_object *obj)
{
if (obj->free_cb) {
- DRM_DEBUG("OBJ ID: %d (%d)\n", obj->id, kref_read(&obj->refcount));
+ DRM_DEBUG_CORE("OBJ ID: %d (%d)\n", obj->id, kref_read(&obj->refcount));
kref_get(&obj->refcount);
}
}
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index a9d9df6c85ad..8a522a398208 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -158,8 +158,8 @@ static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p)
p->irq = dev->pdev->irq;
- DRM_DEBUG("%d:%d:%d => IRQ %d\n", p->busnum, p->devnum, p->funcnum,
- p->irq);
+ DRM_DEBUG_CORE("%d:%d:%d => IRQ %d\n", p->busnum, p->devnum, p->funcnum,
+ p->irq);
return 0;
}
@@ -238,7 +238,7 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
struct drm_device *dev;
int ret;
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
dev = drm_dev_alloc(driver, &pdev->dev);
if (IS_ERR(dev))
@@ -293,7 +293,7 @@ int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
const struct pci_device_id *pid;
int i;
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY)))
return -EINVAL;
@@ -347,7 +347,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data,
void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
{
struct drm_device *dev, *tmp;
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
if (!(driver->driver_features & DRIVER_LEGACY)) {
WARN_ON(1);
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 5f650d8fc66b..43ead742525d 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -1072,17 +1072,17 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
switch (page_flip->flags & DRM_MODE_PAGE_FLIP_TARGET) {
case DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE:
if ((int)(target_vblank - current_vblank) > 1) {
- DRM_DEBUG("Invalid absolute flip target %u, "
- "must be <= %u\n", target_vblank,
- current_vblank + 1);
+ DRM_DEBUG_CORE("Invalid absolute flip target %u, "
+ "must be <= %u\n", target_vblank,
+ current_vblank + 1);
drm_crtc_vblank_put(crtc);
return -EINVAL;
}
break;
case DRM_MODE_PAGE_FLIP_TARGET_RELATIVE:
if (target_vblank != 0 && target_vblank != 1) {
- DRM_DEBUG("Invalid relative flip target %u, "
- "must be 0 or 1\n", target_vblank);
+ DRM_DEBUG_CORE("Invalid relative flip target %u, "
+ "must be 0 or 1\n", target_vblank);
drm_crtc_vblank_put(crtc);
return -EINVAL;
}
diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c
index bb829a115fc6..e44c281ccd7f 100644
--- a/drivers/gpu/drm/drm_scatter.c
+++ b/drivers/gpu/drm/drm_scatter.c
@@ -86,7 +86,7 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
struct drm_sg_mem *entry;
unsigned long pages, i, j;
- DRM_DEBUG("\n");
+ DRM_DEBUG_CORE("\n");
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
return -EOPNOTSUPP;
@@ -102,7 +102,7 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
return -ENOMEM;
pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
- DRM_DEBUG("size=%ld pages=%ld\n", request->size, pages);
+ DRM_DEBUG_CORE("size=%ld pages=%ld\n", request->size, pages);
entry->pages = pages;
entry->pagelist = kcalloc(pages, sizeof(*entry->pagelist), GFP_KERNEL);
@@ -133,8 +133,8 @@ int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
entry->handle = ScatterHandle((unsigned long)entry->virtual);
- DRM_DEBUG("handle = %08lx\n", entry->handle);
- DRM_DEBUG("virtual = %p\n", entry->virtual);
+ DRM_DEBUG_CORE("handle = %08lx\n", entry->handle);
+ DRM_DEBUG_CORE("virtual = %p\n", entry->virtual);
for (i = (unsigned long)entry->virtual, j = 0; j < pages;
i += PAGE_SIZE, j++) {
@@ -213,7 +213,7 @@ int drm_legacy_sg_free(struct drm_device *dev, void *data,
if (!entry || entry->handle != request->handle)
return -EINVAL;
- DRM_DEBUG("virtual = %p\n", entry->virtual);
+ DRM_DEBUG_CORE("virtual = %p\n", entry->virtual);
drm_sg_cleanup(entry);
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index ecb7b33002bb..08079b0615ad 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -276,7 +276,7 @@ int drm_sysfs_connector_add(struct drm_connector *connector)
connector, connector_dev_groups,
"card%d-%s", dev->primary->index,
connector->name);
- DRM_DEBUG("adding \"%s\" to sysfs\n",
+ DRM_DEBUG_CORE("adding \"%s\" to sysfs\n",
connector->name);
if (IS_ERR(connector->kdev)) {
@@ -294,7 +294,7 @@ void drm_sysfs_connector_remove(struct drm_connector *connector)
{
if (!connector->kdev)
return;
- DRM_DEBUG("removing \"%s\" from sysfs\n",
+ DRM_DEBUG_CORE("removing \"%s\" from sysfs\n",
connector->name);
device_unregister(connector->kdev);
@@ -306,7 +306,7 @@ void drm_sysfs_lease_event(struct drm_device *dev)
char *event_string = "LEASE=1";
char *envp[] = { event_string, NULL };
- DRM_DEBUG("generating lease event\n");
+ DRM_DEBUG_CORE("generating lease event\n");
kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp);
}
@@ -324,7 +324,7 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)
char *event_string = "HOTPLUG=1";
char *envp[] = { event_string, NULL };
- DRM_DEBUG("generating hotplug event\n");
+ DRM_DEBUG_CORE("generating hotplug event\n");
kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp);
}
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 98e091175921..79189f5a3268 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -384,7 +384,7 @@ static void vblank_disable_fn(struct timer_list *t)
spin_lock_irqsave(&dev->vbl_lock, irqflags);
if (atomic_read(&vblank->refcount) == 0 && vblank->enabled) {
- DRM_DEBUG("disabling vblank on crtc %u\n", pipe);
+ DRM_DEBUG_CORE("disabling vblank on crtc %u\n", pipe);
drm_vblank_disable_and_save(dev, pipe);
}
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
@@ -537,11 +537,11 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc,
vblank->framedur_ns = framedur_ns;
vblank->hwmode = *mode;
- DRM_DEBUG("crtc %u: hwmode: htotal %d, vtotal %d, vdisplay %d\n",
- crtc->base.id, mode->crtc_htotal,
- mode->crtc_vtotal, mode->crtc_vdisplay);
- DRM_DEBUG("crtc %u: clock %d kHz framedur %d linedur %d\n",
- crtc->base.id, dotclock, framedur_ns, linedur_ns);
+ DRM_DEBUG_CORE("crtc %u: hwmode: htotal %d, vtotal %d, vdisplay %d\n",
+ crtc->base.id, mode->crtc_htotal,
+ mode->crtc_vtotal, mode->crtc_vdisplay);
+ DRM_DEBUG_CORE("crtc %u: clock %d kHz framedur %d linedur %d\n",
+ crtc->base.id, dotclock, framedur_ns, linedur_ns);
}
EXPORT_SYMBOL(drm_calc_timestamping_constants);
@@ -616,7 +616,7 @@ bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
* Happens during initial modesetting of a crtc.
*/
if (mode->crtc_clock == 0) {
- DRM_DEBUG("crtc %u: Noop due to uninitialized mode.\n", pipe);
+ DRM_DEBUG_CORE("crtc %u: Noop due to uninitialized mode.\n", pipe);
WARN_ON_ONCE(drm_drv_uses_atomic_modeset(dev));
return false;
@@ -642,8 +642,8 @@ bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
/* Return as no-op if scanout query unsupported or failed. */
if (!vbl_status) {
- DRM_DEBUG("crtc %u : scanoutpos query failed.\n",
- pipe);
+ DRM_DEBUG_CORE("crtc %u : scanoutpos query failed.\n",
+ pipe);
return false;
}
@@ -657,8 +657,8 @@ bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
/* Noisy system timing? */
if (i == DRM_TIMESTAMP_MAXRETRIES) {
- DRM_DEBUG("crtc %u: Noisy timestamp %d us > %d us [%d reps].\n",
- pipe, duration_ns/1000, *max_error/1000, i);
+ DRM_DEBUG_CORE("crtc %u: Noisy timestamp %d us > %d us [%d reps].\n",
+ pipe, duration_ns/1000, *max_error/1000, i);
}
/* Return upper bound of timestamp precision error. */
@@ -954,7 +954,7 @@ static int drm_vblank_enable(struct drm_device *dev, unsigned int pipe)
* prevent double-accounting of same vblank interval.
*/
ret = __enable_vblank(dev, pipe);
- DRM_DEBUG("enabling vblank on crtc %u, ret: %d\n", pipe, ret);
+ DRM_DEBUG_CORE("enabling vblank on crtc %u, ret: %d\n", pipe, ret);
if (ret) {
atomic_dec(&vblank->refcount);
} else {
@@ -1155,9 +1155,9 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) {
if (e->pipe != pipe)
continue;
- DRM_DEBUG("Sending premature vblank event on disable: "
- "wanted %llu, current %llu\n",
- e->sequence, seq);
+ DRM_DEBUG_CORE("Sending premature vblank event on disable: "
+ "wanted %llu, current %llu\n",
+ e->sequence, seq);
list_del(&e->base.link);
drm_vblank_put(dev, pipe);
send_vblank_event(dev, e, seq, now);
@@ -1449,8 +1449,8 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
seq = drm_vblank_count_and_time(dev, pipe, &now);
- DRM_DEBUG("event on vblank count %llu, current %llu, crtc %u\n",
- req_seq, seq, pipe);
+ DRM_DEBUG_CORE("event on vblank count %llu, current %llu, crtc %u\n",
+ req_seq, seq, pipe);
trace_drm_vblank_event_queued(file_priv, pipe, req_seq);
@@ -1541,10 +1541,10 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
if (vblwait->request.type &
~(_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK |
_DRM_VBLANK_HIGH_CRTC_MASK)) {
- DRM_DEBUG("Unsupported type value 0x%x, supported mask 0x%x\n",
- vblwait->request.type,
- (_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK |
- _DRM_VBLANK_HIGH_CRTC_MASK));
+ DRM_DEBUG_CORE("Unsupported type value 0x%x, supported mask 0x%x\n",
+ vblwait->request.type,
+ (_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK |
+ _DRM_VBLANK_HIGH_CRTC_MASK));
return -EINVAL;
}
@@ -1587,7 +1587,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
ret = drm_vblank_get(dev, pipe);
if (ret) {
- DRM_DEBUG("crtc %d failed to acquire vblank counter, %d\n", pipe, ret);
+ DRM_DEBUG_CORE("crtc %d failed to acquire vblank counter, %d\n", pipe, ret);
return ret;
}
seq = drm_vblank_count(dev, pipe);
@@ -1621,8 +1621,8 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
}
if (req_seq != seq) {
- DRM_DEBUG("waiting on vblank count %llu, crtc %u\n",
- req_seq, pipe);
+ DRM_DEBUG_CORE("waiting on vblank count %llu, crtc %u\n",
+ req_seq, pipe);
DRM_WAIT_ON(ret, vblank->queue, 3 * HZ,
vblank_passed(drm_vblank_count(dev, pipe),
req_seq) ||
@@ -1632,10 +1632,10 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
if (ret != -EINTR) {
drm_wait_vblank_reply(dev, pipe, &vblwait->reply);
- DRM_DEBUG("crtc %d returning %u to client\n",
- pipe, vblwait->reply.sequence);
+ DRM_DEBUG_CORE("crtc %d returning %u to client\n",
+ pipe, vblwait->reply.sequence);
} else {
- DRM_DEBUG("crtc %d vblank wait interrupted by signal\n", pipe);
+ DRM_DEBUG_CORE("crtc %d vblank wait interrupted by signal\n", pipe);
}
done:
@@ -1659,8 +1659,8 @@ static void drm_handle_vblank_events(struct drm_device *dev, unsigned int pipe)
if (!vblank_passed(seq, e->sequence))
continue;
- DRM_DEBUG("vblank event on %llu, current %llu\n",
- e->sequence, seq);
+ DRM_DEBUG_CORE("vblank event on %llu, current %llu\n",
+ e->sequence, seq);
list_del(&e->base.link);
drm_vblank_put(dev, pipe);
@@ -1788,7 +1788,7 @@ int drm_crtc_get_sequence_ioctl(struct drm_device *dev, void *data,
if (!vblank_enabled) {
ret = drm_crtc_vblank_get(crtc);
if (ret) {
- DRM_DEBUG("crtc %d failed to acquire vblank counter, %d\n", pipe, ret);
+ DRM_DEBUG_CORE("crtc %d failed to acquire vblank counter, %d\n", pipe, ret);
return ret;
}
}
@@ -1854,7 +1854,7 @@ int drm_crtc_queue_sequence_ioctl(struct drm_device *dev, void *data,
ret = drm_crtc_vblank_get(crtc);
if (ret) {
- DRM_DEBUG("crtc %d failed to acquire vblank counter, %d\n", pipe, ret);
+ DRM_DEBUG_CORE("crtc %d failed to acquire vblank counter, %d\n", pipe, ret);
goto err_free;
}
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index c3301046dfaa..7b764f342054 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -208,7 +208,7 @@ static vm_fault_t drm_vm_shm_fault(struct vm_fault *vmf)
get_page(page);
vmf->page = page;
- DRM_DEBUG("shm_fault 0x%lx\n", offset);
+ DRM_DEBUG_CORE("shm_fault 0x%lx\n", offset);
return 0;
}
@@ -229,8 +229,8 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
struct drm_map_list *r_list;
int found_maps = 0;
- DRM_DEBUG("0x%08lx,0x%08lx\n",
- vma->vm_start, vma->vm_end - vma->vm_start);
+ DRM_DEBUG_CORE("0x%08lx,0x%08lx\n",
+ vma->vm_start, vma->vm_end - vma->vm_start);
map = vma->vm_private_data;
@@ -314,7 +314,7 @@ static vm_fault_t drm_vm_dma_fault(struct vm_fault *vmf)
get_page(page);
vmf->page = page;
- DRM_DEBUG("dma_fault 0x%lx (page %lu)\n", offset, page_nr);
+ DRM_DEBUG_CORE("dma_fault 0x%lx (page %lu)\n", offset, page_nr);
return 0;
}
@@ -386,8 +386,8 @@ static void drm_vm_open_locked(struct drm_device *dev,
{
struct drm_vma_entry *vma_entry;
- DRM_DEBUG("0x%08lx,0x%08lx\n",
- vma->vm_start, vma->vm_end - vma->vm_start);
+ DRM_DEBUG_CORE("0x%08lx,0x%08lx\n",
+ vma->vm_start, vma->vm_end - vma->vm_start);
vma_entry = kmalloc(sizeof(*vma_entry), GFP_KERNEL);
if (vma_entry) {
@@ -412,8 +412,8 @@ static void drm_vm_close_locked(struct drm_device *dev,
{
struct drm_vma_entry *pt, *temp;
- DRM_DEBUG("0x%08lx,0x%08lx\n",
- vma->vm_start, vma->vm_end - vma->vm_start);
+ DRM_DEBUG_CORE("0x%08lx,0x%08lx\n",
+ vma->vm_start, vma->vm_end - vma->vm_start);
list_for_each_entry_safe(pt, temp, &dev->vmalist, head) {
if (pt->vma == vma) {
@@ -461,8 +461,8 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
dev = priv->minor->dev;
dma = dev->dma;
- DRM_DEBUG("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n",
- vma->vm_start, vma->vm_end, vma->vm_pgoff);
+ DRM_DEBUG_CORE("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n",
+ vma->vm_start, vma->vm_end, vma->vm_pgoff);
/* Length must match exact page count */
if (!dma || (length >> PAGE_SHIFT) != dma->page_count) {
@@ -523,8 +523,8 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
resource_size_t offset = 0;
struct drm_hash_item *hash;
- DRM_DEBUG("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n",
- vma->vm_start, vma->vm_end, vma->vm_pgoff);
+ DRM_DEBUG_CORE("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n",
+ vma->vm_start, vma->vm_end, vma->vm_pgoff);
if (!priv->authenticated)
return -EACCES;
@@ -595,10 +595,10 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
return -EAGAIN;
- DRM_DEBUG(" Type = %d; start = 0x%lx, end = 0x%lx,"
- " offset = 0x%llx\n",
- map->type,
- vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset));
+ DRM_DEBUG_CORE(" Type = %d; start = 0x%lx, end = 0x%lx,"
+ " offset = 0x%llx\n",
+ map->type,
+ vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset));
vma->vm_ops = &drm_vm_ops;
break;
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index afbc3beef089..29ba1a3a4a81 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -227,10 +227,11 @@ static inline struct drm_printer drm_debug_printer(const char *prefix)
* The following categories are defined:
*
* CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, drm_memory.c, ...
- * This is the category used by the DRM_DEBUG() macro.
+ * This is the category used by the DRM_DEBUG_CORE() macro.
*
* DRIVER: Used in the vendor specific part of the driver: i915, radeon, ...
- * This is the category used by the DRM_DEBUG_DRIVER() macro.
+ * This is the category used by the DRM_DEBUG() and DRM_DEBUG_DRIVER()
+ * macros.
*
* KMS: used in the modesetting code.
* This is the category used by the DRM_DEBUG_KMS() macro.
@@ -346,15 +347,20 @@ void drm_err(const char *format, ...);
* @dev: device pointer
* @fmt: printf() like format string.
*/
-#define DRM_DEV_DEBUG(dev, fmt, ...) \
+#define DRM_DEV_DEBUG_CORE(dev, fmt, ...) \
drm_dev_dbg(dev, DRM_UT_CORE, fmt, ##__VA_ARGS__)
-#define DRM_DEBUG(fmt, ...) \
+#define DRM_DEBUG_CORE(fmt, ...) \
drm_dbg(DRM_UT_CORE, fmt, ##__VA_ARGS__)
+#define DRM_DEV_DEBUG(dev, fmt, ...) \
+ drm_dev_dbg(dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__)
+#define DRM_DEBUG(fmt, ...) \
+ drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__)
+
#define DRM_DEV_DEBUG_DRIVER(dev, fmt, ...) \
- drm_dev_dbg(dev, DRM_UT_DRIVER, fmt, ##__VA_ARGS__)
+ DRM_DEV_DEBUG(dev, fmt, ##__VA_ARGS__)
#define DRM_DEBUG_DRIVER(fmt, ...) \
- drm_dbg(DRM_UT_DRIVER, fmt, ##__VA_ARGS__)
+ DRM_DEBUG(fmt, ##__VA_ARGS__)
#define DRM_DEV_DEBUG_KMS(dev, fmt, ...) \
drm_dev_dbg(dev, DRM_UT_KMS, fmt, ##__VA_ARGS__)
@@ -399,17 +405,17 @@ void drm_err(const char *format, ...);
* @dev: device pointer
* @fmt: printf() like format string.
*/
-#define DRM_DEV_DEBUG_RATELIMITED(dev, fmt, ...) \
+#define DRM_DEV_DEBUG_CORE_RATELIMITED(dev, fmt, ...) \
_DEV_DRM_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_CORE, \
fmt, ##__VA_ARGS__)
-#define DRM_DEBUG_RATELIMITED(fmt, ...) \
- DRM_DEV_DEBUG_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
+#define DRM_DEBUG_CORE_RATELIMITED(fmt, ...) \
+ DRM_DEV_DEBUG_CORE_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
-#define DRM_DEV_DEBUG_DRIVER_RATELIMITED(dev, fmt, ...) \
- _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_DRIVER, \
+#define DRM_DEV_DEBUG_RATELIMITED(dev, fmt, ...) \
+ _DEV_DRM_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_DRIVER, \
fmt, ##__VA_ARGS__)
-#define DRM_DEBUG_DRIVER_RATELIMITED(fmt, ...) \
- DRM_DEV_DEBUG_DRIVER_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
+#define DRM_DEBUG_RATELIMITED(fmt, ...) \
+ DRM_DEV_DEBUG_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
#define DRM_DEV_DEBUG_KMS_RATELIMITED(dev, fmt, ...) \
_DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_KMS, \
--
2.11.0
More information about the Intel-gfx
mailing list