summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-02-11 07:01:38 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-02-11 07:01:38 +0000
commitad5913cac487cf6124985987c03aae56e75bcdc9 (patch)
treead00508d4531d96a46f0b1c7745cc67c0cfa0612 /sys/dev/pci
parent0980b0a5576b31b8beebf58ba89e9c93653d6e32 (diff)
Switch most printf style functions calls back to linux function names
and move DRM_INFO/pr_info/dev_info messages under DRMDEBUG.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/drmP.h18
-rw-r--r--sys/dev/pci/drm/drm_crtc.c4
-rw-r--r--sys/dev/pci/drm/drm_crtc_helper.c5
-rw-r--r--sys/dev/pci/drm/drm_edid.c13
-rw-r--r--sys/dev/pci/drm/drm_fb_helper.c8
-rw-r--r--sys/dev/pci/drm/drm_irq.c18
-rw-r--r--sys/dev/pci/drm/drm_linux.h54
-rw-r--r--sys/dev/pci/drm/drm_mm.c10
-rw-r--r--sys/dev/pci/drm/drm_modes.c5
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.c5
-rw-r--r--sys/dev/pci/drm/i915/i915_irq.c46
-rw-r--r--sys/dev/pci/drm/i915/intel_crt.c4
-rw-r--r--sys/dev/pci/drm/i915/intel_ddi.c4
-rw-r--r--sys/dev/pci/drm/i915/intel_display.c6
-rw-r--r--sys/dev/pci/drm/i915/intel_lvds.c6
-rw-r--r--sys/dev/pci/drm/i915/intel_overlay.c4
-rw-r--r--sys/dev/pci/drm/i915/intel_pm.c4
-rw-r--r--sys/dev/pci/drm/radeon/atom.c46
-rw-r--r--sys/dev/pci/drm/radeon/evergreen.c4
-rw-r--r--sys/dev/pci/drm/radeon/evergreen_cs.c4
-rw-r--r--sys/dev/pci/drm/radeon/ni.c4
-rw-r--r--sys/dev/pci/drm/radeon/r100.c32
-rw-r--r--sys/dev/pci/drm/radeon/r200.c4
-rw-r--r--sys/dev/pci/drm/radeon/r300.c12
-rw-r--r--sys/dev/pci/drm/radeon/r420.c10
-rw-r--r--sys/dev/pci/drm/radeon/r520.c4
-rw-r--r--sys/dev/pci/drm/radeon/r600.c18
-rw-r--r--sys/dev/pci/drm/radeon/r600_cs.c4
-rw-r--r--sys/dev/pci/drm/radeon/radeon_agp.c4
-rw-r--r--sys/dev/pci/drm/radeon/radeon_benchmark.c4
-rw-r--r--sys/dev/pci/drm/radeon/radeon_bios.c4
-rw-r--r--sys/dev/pci/drm/radeon/radeon_combios.c4
-rw-r--r--sys/dev/pci/drm/radeon/radeon_device.c4
-rw-r--r--sys/dev/pci/drm/radeon/radeon_fb.c4
-rw-r--r--sys/dev/pci/drm/radeon/radeon_gem.c16
-rw-r--r--sys/dev/pci/drm/radeon/radeon_irq_kms.c6
-rw-r--r--sys/dev/pci/drm/radeon/radeon_kms.c6
-rw-r--r--sys/dev/pci/drm/radeon/radeon_object.c14
-rw-r--r--sys/dev/pci/drm/radeon/radeon_test.c8
-rw-r--r--sys/dev/pci/drm/radeon/radeon_ttm.c6
-rw-r--r--sys/dev/pci/drm/radeon/rs400.c4
-rw-r--r--sys/dev/pci/drm/radeon/rs690.c4
-rw-r--r--sys/dev/pci/drm/radeon/rv515.c8
-rw-r--r--sys/dev/pci/drm/radeon/si.c6
-rw-r--r--sys/dev/pci/drm/ttm/ttm_bo.c54
-rw-r--r--sys/dev/pci/drm/ttm/ttm_bo_vm.c4
-rw-r--r--sys/dev/pci/drm/ttm/ttm_memory.c6
-rw-r--r--sys/dev/pci/drm/ttm/ttm_object.c4
-rw-r--r--sys/dev/pci/drm/ttm/ttm_page_alloc.c24
-rw-r--r--sys/dev/pci/drm/ttm/ttm_tt.c6
50 files changed, 281 insertions, 275 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index 3011ba62efb..dcd8475fe80 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: drmP.h,v 1.179 2015/02/10 01:39:32 jsg Exp $ */
+/* $OpenBSD: drmP.h,v 1.180 2015/02/11 07:01:36 jsg Exp $ */
/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
*/
@@ -394,7 +394,11 @@ mdelay(unsigned long msecs)
curproc->p_pid, __func__ , ## arg)
+#ifdef DRM_DEBUG
#define DRM_INFO(fmt, arg...) printf("drm: " fmt, ## arg)
+#else
+#define DRM_INFO(fmt, arg...) do { } while(/* CONSTCOND */ 0)
+#endif
#ifdef DRMDEBUG
#undef DRM_DEBUG
@@ -439,18 +443,6 @@ mdelay(unsigned long msecs)
#define DRM_DEBUG_DRIVER(fmt, arg...) do { } while(/* CONSTCOND */ 0)
#endif
-#define dev_warn(dev, fmt, arg...) do { \
- DRM_ERROR(fmt, ## arg); \
-} while(0)
-
-#define dev_err(dev, fmt, arg...) do { \
- DRM_ERROR(fmt, ## arg); \
-} while(0)
-
-#define dev_info(dev, fmt, arg...) do { \
- printf("%s: " fmt, dev.dv_xname, ## arg); \
-} while(0)
-
#define PCI_ANY_ID (uint16_t) (~0U)
struct drm_pcidev {
diff --git a/sys/dev/pci/drm/drm_crtc.c b/sys/dev/pci/drm/drm_crtc.c
index f694823e7d0..f6d79cea7a5 100644
--- a/sys/dev/pci/drm/drm_crtc.c
+++ b/sys/dev/pci/drm/drm_crtc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_crtc.c,v 1.10 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: drm_crtc.c,v 1.11 2015/02/11 07:01:36 jsg Exp $ */
/*
* Copyright (c) 2006-2008 Intel Corporation
* Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
@@ -2991,7 +2991,7 @@ void drm_object_attach_property(struct drm_mode_object *obj,
int count = obj->properties->count;
if (count == DRM_OBJECT_MAX_PROPERTY) {
- printf("Failed to attach object property (type: 0x%x). Please "
+ WARN(1, "Failed to attach object property (type: 0x%x). Please "
"increase DRM_OBJECT_MAX_PROPERTY by 1 for each time "
"you see this message on the same object type.\n",
obj->type);
diff --git a/sys/dev/pci/drm/drm_crtc_helper.c b/sys/dev/pci/drm/drm_crtc_helper.c
index a4af3a19fb2..6fe7f1095bb 100644
--- a/sys/dev/pci/drm/drm_crtc_helper.c
+++ b/sys/dev/pci/drm/drm_crtc_helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_crtc_helper.c,v 1.9 2015/02/10 03:39:41 jsg Exp $ */
+/* $OpenBSD: drm_crtc_helper.c,v 1.10 2015/02/11 07:01:36 jsg Exp $ */
/*
* Copyright (c) 2006-2008 Intel Corporation
* Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
@@ -316,8 +316,7 @@ static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
struct drm_crtc *tmp;
int crtc_mask = 1;
- if (crtc == NULL)
- printf("%s checking null crtc?\n", __func__);
+ WARN(!crtc, "checking null crtc?\n");
dev = crtc->dev;
diff --git a/sys/dev/pci/drm/drm_edid.c b/sys/dev/pci/drm/drm_edid.c
index 4611cbc9e34..c7390a3079f 100644
--- a/sys/dev/pci/drm/drm_edid.c
+++ b/sys/dev/pci/drm/drm_edid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_edid.c,v 1.10 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: drm_edid.c,v 1.11 2015/02/11 07:01:36 jsg Exp $ */
/*
* Copyright (c) 2006 Luc Verhaegen (quirks list)
* Copyright (c) 2007-2008 Intel Corporation
@@ -345,7 +345,8 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_controller *adapter)
}
if (i == 4 && print_bad_edid) {
- printf("%s: Ignoring invalid EDID block %d.\n",
+ dev_warn(connector->dev->dev,
+ "%s: Ignoring invalid EDID block %d.\n",
drm_get_connector_name(connector), j);
connector->bad_edid_counter++;
@@ -368,7 +369,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_controller *adapter)
carp:
if (print_bad_edid) {
- printf("%s: EDID block %d invalid.\n",
+ dev_warn(connector->dev->dev, "%s: EDID block %d invalid.\n",
drm_get_connector_name(connector), j);
}
connector->bad_edid_counter++;
@@ -893,11 +894,11 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
return NULL;
if (pt->misc & DRM_EDID_PT_STEREO) {
- printf("stereo mode not supported\n");
+ printk(KERN_WARNING "stereo mode not supported\n");
return NULL;
}
if (!(pt->misc & DRM_EDID_PT_SEPARATE_SYNC)) {
- printf("composite sync not supported\n");
+ printk(KERN_WARNING "composite sync not supported\n");
}
/* it is incorrect if hsync/vsync width is zero */
@@ -1988,7 +1989,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
return 0;
}
if (!drm_edid_is_valid(edid)) {
- printf("%s: EDID invalid.\n",
+ dev_warn(connector->dev->dev, "%s: EDID invalid.\n",
drm_get_connector_name(connector));
return 0;
}
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c
index c0707306864..cc13d6bca84 100644
--- a/sys/dev/pci/drm/drm_fb_helper.c
+++ b/sys/dev/pci/drm/drm_fb_helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_fb_helper.c,v 1.8 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: drm_fb_helper.c,v 1.9 2015/02/11 07:01:36 jsg Exp $ */
/*
* Copyright (c) 2006-2009 Red Hat Inc.
* Copyright (c) 2006-2008 Intel Corporation
@@ -811,7 +811,7 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
if (crtc_count == 0 || sizes.fb_width == -1 || sizes.fb_height == -1) {
/* hmm everyone went away - assume VGA cable just fell out
and will come back later. */
- printf("Cannot find any crtc or sizes - going 1024x768\n");
+ DRM_INFO("Cannot find any crtc or sizes - going 1024x768\n");
sizes.fb_width = sizes.surface_width = 1024;
sizes.fb_height = sizes.surface_height = 768;
}
@@ -1137,7 +1137,7 @@ static bool drm_target_cloned(struct drm_fb_helper *fb_helper,
DRM_DEBUG_KMS("can clone using 1024x768\n");
return true;
}
- printf("kms: can't enable cloning when we probably wanted to.\n");
+ DRM_INFO("kms: can't enable cloning when we probably wanted to.\n");
return false;
}
@@ -1361,7 +1361,7 @@ bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel)
* we shouldn't end up with no modes here.
*/
if (count == 0)
- printf("No connectors reported connected with modes\n");
+ dev_info(fb_helper->dev->dev, "No connectors reported connected with modes\n");
drm_setup_crtcs(fb_helper);
diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c
index 636f1f3e35d..659168fbe2c 100644
--- a/sys/dev/pci/drm/drm_irq.c
+++ b/sys/dev/pci/drm/drm_irq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_irq.c,v 1.57 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: drm_irq.c,v 1.58 2015/02/11 07:01:36 jsg Exp $ */
/**
* \file drm_irq.c
* IRQ support
@@ -236,7 +236,7 @@ static void vblank_disable_fn(void *arg)
spin_lock_irqsave(&dev->vbl_lock, irqflags);
if (atomic_read(&dev->vblank_refcount[i]) == 0 &&
dev->vblank_enabled[i]) {
- DPRINTF("disabling vblank on crtc %d\n", i);
+ DRM_DEBUG("disabling vblank on crtc %d\n", i);
vblank_disable_and_save(dev, i);
}
spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
@@ -312,13 +312,13 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)
if (!dev->_vblank_time)
goto err;
- DRM_DEBUG("Supports vblank timestamp caching Rev 1 (10.10.2010).\n");
+ DRM_INFO("Supports vblank timestamp caching Rev 1 (10.10.2010).\n");
/* Driver specific high-precision vblank timestamping supported? */
if (dev->driver->get_vblank_timestamp)
- DRM_DEBUG("Driver supports precise vblank timestamp query.\n");
+ DRM_INFO("Driver supports precise vblank timestamp query.\n");
else
- DRM_DEBUG("No driver support for vblank timestamp query.\n");
+ DRM_INFO("No driver support for vblank timestamp query.\n");
/* Zero per-crtc vblank stuff */
for (i = 0; i < num_crtcs; i++) {
@@ -1198,7 +1198,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
vblwait->reply.sequence = vblwait->request.sequence;
}
- DPRINTF("event on vblank count %d, current %d, crtc %d\n",
+ DRM_DEBUG("event on vblank count %d, current %d, crtc %d\n",
vblwait->request.sequence, seq, pipe);
#if 0
@@ -1305,7 +1305,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
vblwait->request.sequence = seq + 1;
}
- DPRINTF("waiting on vblank count %d, crtc %d\n",
+ DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
vblwait->request.sequence, crtc);
dev->last_vblank_wait[crtc] = vblwait->request.sequence;
DRM_WAIT_ON(ret, &dev->vbl_queue[crtc], &dev->vbl_lock, 3 * hz,
@@ -1320,10 +1320,10 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
vblwait->reply.tval_sec = now.tv_sec;
vblwait->reply.tval_usec = now.tv_usec;
- DPRINTF("returning %d to client\n",
+ DRM_DEBUG("returning %d to client\n",
vblwait->reply.sequence);
} else {
- DPRINTF("vblank wait interrupted by signal\n");
+ DRM_DEBUG("vblank wait interrupted by signal\n");
}
done:
diff --git a/sys/dev/pci/drm/drm_linux.h b/sys/dev/pci/drm/drm_linux.h
index f5e55d241f5..ba105db880d 100644
--- a/sys/dev/pci/drm/drm_linux.h
+++ b/sys/dev/pci/drm/drm_linux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_linux.h,v 1.3 2015/02/10 00:23:53 jsg Exp $ */
+/* $OpenBSD: drm_linux.h,v 1.4 2015/02/11 07:01:36 jsg Exp $ */
/*
* Copyright (c) 2013, 2014 Mark Kettenis
*
@@ -16,6 +16,58 @@
*/
#define __force
+#define KERN_INFO
+#define KERN_WARNING
+#define KERN_NOTICE
+#define KERN_DEBUG
+#define KERN_CRIT
+#define KERN_ERR
+
+#define KBUILD_MODNAME "drm"
+
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define printk(fmt, arg...) printf(fmt, ## arg)
+#define pr_warn(fmt, arg...) printf(pr_fmt(fmt), ## arg)
+#define pr_notice(fmt, arg...) printf(pr_fmt(fmt), ## arg)
+#define pr_crit(fmt, arg...) printf(pr_fmt(fmt), ## arg)
+#define pr_err(fmt, arg...) printf(pr_fmt(fmt), ## arg)
+
+#ifdef DRMDEBUG
+#define pr_info(fmt, arg...) printf(pr_fmt(fmt), ## arg)
+#define pr_debug(fmt, arg...) printf(pr_fmt(fmt), ## arg)
+#else
+#define pr_info(fmt, arg...) do { } while(0)
+#define pr_debug(fmt, arg...) do { } while(0)
+#endif
+
+#define dev_warn(dev, fmt, arg...) \
+ printf("drm:pid%d:%s *WARNING* " fmt, curproc->p_pid, \
+ __func__ , ## arg)
+#define dev_notice(dev, fmt, arg...) \
+ printf("drm:pid%d:%s *NOTICE* " fmt, curproc->p_pid, \
+ __func__ , ## arg)
+#define dev_crit(dev, fmt, arg...) \
+ printf("drm:pid%d:%s *ERROR* " fmt, curproc->p_pid, \
+ __func__ , ## arg)
+#define dev_err(dev, fmt, arg...) \
+ printf("drm:pid%d:%s *ERROR* " fmt, curproc->p_pid, \
+ __func__ , ## arg)
+
+#ifdef DRMDEBUG
+#define dev_info(dev, fmt, arg...) \
+ printf("drm: " fmt, ## arg)
+#define dev_debug(dev, fmt, arg...) \
+ printf("drm:pid%d:%s *DEBUG* " fmt, curproc->p_pid, \
+ __func__ , ## arg)
+#else
+#define dev_info(dev, fmt, arg...) \
+ do { } while(0)
+#define dev_debug(dev, fmt, arg...) \
+ do { } while(0)
+#endif
static inline void
spin_lock_irqsave(struct mutex *mtxp, __unused unsigned long flags)
diff --git a/sys/dev/pci/drm/drm_mm.c b/sys/dev/pci/drm/drm_mm.c
index d473fa40d6a..8a7483d90b1 100644
--- a/sys/dev/pci/drm/drm_mm.c
+++ b/sys/dev/pci/drm/drm_mm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_mm.c,v 1.5 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: drm_mm.c,v 1.6 2015/02/11 07:01:36 jsg Exp $ */
/**************************************************************************
*
* Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA.
@@ -694,13 +694,13 @@ void drm_mm_debug_table(struct drm_mm *mm, const char *prefix)
hole_end = drm_mm_hole_node_end(&mm->head_node);
hole_size = hole_end - hole_start;
if (hole_size)
- DRM_DEBUG("%s 0x%08lx-0x%08lx: %8lu: free\n",
+ printk(KERN_DEBUG "%s 0x%08lx-0x%08lx: %8lu: free\n",
prefix, hole_start, hole_end,
hole_size);
total_free += hole_size;
drm_mm_for_each_node(entry, mm) {
- DRM_DEBUG("%s 0x%08lx-0x%08lx: %8lu: used\n",
+ printk(KERN_DEBUG "%s 0x%08lx-0x%08lx: %8lu: used\n",
prefix, entry->start, entry->start + entry->size,
entry->size);
total_used += entry->size;
@@ -709,7 +709,7 @@ void drm_mm_debug_table(struct drm_mm *mm, const char *prefix)
hole_start = drm_mm_hole_node_start(entry);
hole_end = drm_mm_hole_node_end(entry);
hole_size = hole_end - hole_start;
- DRM_DEBUG("%s 0x%08lx-0x%08lx: %8lu: free\n",
+ printk(KERN_DEBUG "%s 0x%08lx-0x%08lx: %8lu: free\n",
prefix, hole_start, hole_end,
hole_size);
total_free += hole_size;
@@ -717,7 +717,7 @@ void drm_mm_debug_table(struct drm_mm *mm, const char *prefix)
}
total = total_free + total_used;
- DRM_DEBUG("%s total: %lu, used %lu free %lu\n", prefix, total,
+ printk(KERN_DEBUG "%s total: %lu, used %lu free %lu\n", prefix, total,
total_used, total_free);
}
EXPORT_SYMBOL(drm_mm_debug_table);
diff --git a/sys/dev/pci/drm/drm_modes.c b/sys/dev/pci/drm/drm_modes.c
index 4d1bae610d6..abf243ca3b9 100644
--- a/sys/dev/pci/drm/drm_modes.c
+++ b/sys/dev/pci/drm/drm_modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_modes.c,v 1.3 2013/09/02 06:25:28 jsg Exp $ */
+/* $OpenBSD: drm_modes.c,v 1.4 2015/02/11 07:01:36 jsg Exp $ */
/*
* Copyright © 1997-2003 by The XFree86 Project, Inc.
* Copyright © 2007 Dave Airlie
@@ -1136,7 +1136,8 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
}
done:
if (i >= 0) {
- printf("parse error at position %i in video mode '%s'\n",
+ printk(KERN_WARNING
+ "parse error at position %i in video mode '%s'\n",
i, name);
mode->specified = false;
return false;
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c
index 61eceeee34a..162c1d5a9b6 100644
--- a/sys/dev/pci/drm/i915/i915_drv.c
+++ b/sys/dev/pci/drm/i915/i915_drv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_drv.c,v 1.73 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: i915_drv.c,v 1.74 2015/02/11 07:01:36 jsg Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -504,7 +504,8 @@ i915_drm_freeze(struct drm_device *dev)
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
int error = i915_gem_idle(dev);
if (error) {
- printf("GEM idle failed, resume might fail\n");
+ dev_err(&dev->pdev->dev,
+ "GEM idle failed, resume might fail\n");
return error;
}
diff --git a/sys/dev/pci/drm/i915/i915_irq.c b/sys/dev/pci/drm/i915/i915_irq.c
index 14c812d08f8..a659f8a2dd0 100644
--- a/sys/dev/pci/drm/i915/i915_irq.c
+++ b/sys/dev/pci/drm/i915/i915_irq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_irq.c,v 1.18 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: i915_irq.c,v 1.19 2015/02/11 07:01:37 jsg Exp $ */
/* i915_irq.c -- IRQ support for the I915 -*- linux-c -*-
*/
/*
@@ -1364,7 +1364,7 @@ static void i915_report_and_clear_eir(struct drm_device *dev)
if (!eir)
return;
- printf("render error detected, EIR: 0x%08x\n", eir);
+ pr_err("render error detected, EIR: 0x%08x\n", eir);
i915_get_extra_instdone(dev, instdone);
@@ -1372,19 +1372,19 @@ static void i915_report_and_clear_eir(struct drm_device *dev)
if (eir & (GM45_ERROR_MEM_PRIV | GM45_ERROR_CP_PRIV)) {
u32 ipeir = I915_READ(IPEIR_I965);
- printf(" IPEIR: 0x%08x\n", I915_READ(IPEIR_I965));
- printf(" IPEHR: 0x%08x\n", I915_READ(IPEHR_I965));
+ pr_err(" IPEIR: 0x%08x\n", I915_READ(IPEIR_I965));
+ pr_err(" IPEHR: 0x%08x\n", I915_READ(IPEHR_I965));
for (i = 0; i < ARRAY_SIZE(instdone); i++)
- printf(" INSTDONE_%d: 0x%08x\n", i, instdone[i]);
- printf(" INSTPS: 0x%08x\n", I915_READ(INSTPS));
- printf(" ACTHD: 0x%08x\n", I915_READ(ACTHD_I965));
+ pr_err(" INSTDONE_%d: 0x%08x\n", i, instdone[i]);
+ pr_err(" INSTPS: 0x%08x\n", I915_READ(INSTPS));
+ pr_err(" ACTHD: 0x%08x\n", I915_READ(ACTHD_I965));
I915_WRITE(IPEIR_I965, ipeir);
POSTING_READ(IPEIR_I965);
}
if (eir & GM45_ERROR_PAGE_TABLE) {
u32 pgtbl_err = I915_READ(PGTBL_ER);
- printf("page table error\n");
- printf(" PGTBL_ER: 0x%08x\n", pgtbl_err);
+ pr_err("page table error\n");
+ pr_err(" PGTBL_ER: 0x%08x\n", pgtbl_err);
I915_WRITE(PGTBL_ER, pgtbl_err);
POSTING_READ(PGTBL_ER);
}
@@ -1393,40 +1393,40 @@ static void i915_report_and_clear_eir(struct drm_device *dev)
if (!IS_GEN2(dev)) {
if (eir & I915_ERROR_PAGE_TABLE) {
u32 pgtbl_err = I915_READ(PGTBL_ER);
- printf("page table error\n");
- printf(" PGTBL_ER: 0x%08x\n", pgtbl_err);
+ pr_err("page table error\n");
+ pr_err(" PGTBL_ER: 0x%08x\n", pgtbl_err);
I915_WRITE(PGTBL_ER, pgtbl_err);
POSTING_READ(PGTBL_ER);
}
}
if (eir & I915_ERROR_MEMORY_REFRESH) {
- printf("memory refresh error:\n");
+ pr_err("memory refresh error:\n");
for_each_pipe(pipe)
- printf("pipe %c stat: 0x%08x\n",
+ pr_err("pipe %c stat: 0x%08x\n",
pipe_name(pipe), I915_READ(PIPESTAT(pipe)));
/* pipestat has already been acked */
}
if (eir & I915_ERROR_INSTRUCTION) {
- printf("instruction error\n");
- printf(" INSTPM: 0x%08x\n", I915_READ(INSTPM));
+ pr_err("instruction error\n");
+ pr_err(" INSTPM: 0x%08x\n", I915_READ(INSTPM));
for (i = 0; i < ARRAY_SIZE(instdone); i++)
- printf(" INSTDONE_%d: 0x%08x\n", i, instdone[i]);
+ pr_err(" INSTDONE_%d: 0x%08x\n", i, instdone[i]);
if (INTEL_INFO(dev)->gen < 4) {
u32 ipeir = I915_READ(IPEIR);
- printf(" IPEIR: 0x%08x\n", I915_READ(IPEIR));
- printf(" IPEHR: 0x%08x\n", I915_READ(IPEHR));
- printf(" ACTHD: 0x%08x\n", I915_READ(ACTHD));
+ pr_err(" IPEIR: 0x%08x\n", I915_READ(IPEIR));
+ pr_err(" IPEHR: 0x%08x\n", I915_READ(IPEHR));
+ pr_err(" ACTHD: 0x%08x\n", I915_READ(ACTHD));
I915_WRITE(IPEIR, ipeir);
POSTING_READ(IPEIR);
} else {
u32 ipeir = I915_READ(IPEIR_I965);
- printf(" IPEIR: 0x%08x\n", I915_READ(IPEIR_I965));
- printf(" IPEHR: 0x%08x\n", I915_READ(IPEHR_I965));
- printf(" INSTPS: 0x%08x\n", I915_READ(INSTPS));
- printf(" ACTHD: 0x%08x\n", I915_READ(ACTHD_I965));
+ pr_err(" IPEIR: 0x%08x\n", I915_READ(IPEIR_I965));
+ pr_err(" IPEHR: 0x%08x\n", I915_READ(IPEHR_I965));
+ pr_err(" INSTPS: 0x%08x\n", I915_READ(INSTPS));
+ pr_err(" ACTHD: 0x%08x\n", I915_READ(ACTHD_I965));
I915_WRITE(IPEIR_I965, ipeir);
POSTING_READ(IPEIR_I965);
}
diff --git a/sys/dev/pci/drm/i915/intel_crt.c b/sys/dev/pci/drm/i915/intel_crt.c
index adbbadfd4cb..02c8b8858bf 100644
--- a/sys/dev/pci/drm/i915/intel_crt.c
+++ b/sys/dev/pci/drm/i915/intel_crt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_crt.c,v 1.9 2014/05/03 05:22:38 jsg Exp $ */
+/* $OpenBSD: intel_crt.c,v 1.10 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
*
@@ -716,7 +716,7 @@ static const struct drm_encoder_funcs intel_crt_enc_funcs = {
static int __init intel_no_crt_dmi_callback(const struct dmi_system_id *id)
{
- printf("Skipping CRT initialization for %s\n", id->ident);
+ DRM_INFO("Skipping CRT initialization for %s\n", id->ident);
return 1;
}
diff --git a/sys/dev/pci/drm/i915/intel_ddi.c b/sys/dev/pci/drm/i915/intel_ddi.c
index 8e265e2828c..5d6e747f767 100644
--- a/sys/dev/pci/drm/i915/intel_ddi.c
+++ b/sys/dev/pci/drm/i915/intel_ddi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_ddi.c,v 1.11 2014/02/15 09:37:03 jsg Exp $ */
+/* $OpenBSD: intel_ddi.c,v 1.12 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright © 2012 Intel Corporation
*
@@ -819,7 +819,7 @@ static void intel_ddi_calculate_wrpll(int clock, int *p, int *n2, int *r2)
*r2 = wrpll_tmds_clock_table[i].r2;
if (wrpll_tmds_clock_table[i].clock != clock)
- printf("WRPLL: using settings for %dKHz on %dKHz mode\n",
+ DRM_INFO("WRPLL: using settings for %dKHz on %dKHz mode\n",
wrpll_tmds_clock_table[i].clock, clock);
DRM_DEBUG_KMS("WRPLL: %dKHz refresh rate with p=%d, n2=%d r2=%d\n",
diff --git a/sys/dev/pci/drm/i915/intel_display.c b/sys/dev/pci/drm/i915/intel_display.c
index 1f89958e089..9bb8240bc80 100644
--- a/sys/dev/pci/drm/i915/intel_display.c
+++ b/sys/dev/pci/drm/i915/intel_display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_display.c,v 1.40 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: intel_display.c,v 1.41 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
*
@@ -488,7 +488,7 @@ static void vlv_init_dpio(struct drm_device *dev)
static int intel_dual_link_lvds_callback(const struct dmi_system_id *id)
{
- printf("Forcing lvds to dual link mode on %s\n", id->ident);
+ DRM_INFO("Forcing lvds to dual link mode on %s\n", id->ident);
return 1;
}
@@ -9010,7 +9010,7 @@ struct intel_dmi_quirk {
#ifdef notyet
static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
{
- printf("Backlight polarity reversed on %s\n", id->ident);
+ DRM_INFO("Backlight polarity reversed on %s\n", id->ident);
return 1;
}
#endif
diff --git a/sys/dev/pci/drm/i915/intel_lvds.c b/sys/dev/pci/drm/i915/intel_lvds.c
index e400c8ddc45..7a6c05b3c8e 100644
--- a/sys/dev/pci/drm/i915/intel_lvds.c
+++ b/sys/dev/pci/drm/i915/intel_lvds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_lvds.c,v 1.12 2015/02/10 03:39:41 jsg Exp $ */
+/* $OpenBSD: intel_lvds.c,v 1.13 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
* Copyright (c) 2006 Dave Airlie <airlied@linux.ie>
@@ -483,7 +483,7 @@ static int intel_lvds_get_modes(struct drm_connector *connector)
static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
{
- printf("Skipping forced modeset for %s\n", id->ident);
+ DRM_INFO("Skipping forced modeset for %s\n", id->ident);
return 1;
}
@@ -638,7 +638,7 @@ static const struct drm_encoder_funcs intel_lvds_enc_funcs = {
static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
{
- printf("Skipping LVDS initialization for %s\n", id->ident);
+ DRM_INFO("Skipping LVDS initialization for %s\n", id->ident);
return 1;
}
diff --git a/sys/dev/pci/drm/i915/intel_overlay.c b/sys/dev/pci/drm/i915/intel_overlay.c
index 55efee12602..b5614a831f6 100644
--- a/sys/dev/pci/drm/i915/intel_overlay.c
+++ b/sys/dev/pci/drm/i915/intel_overlay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_overlay.c,v 1.11 2015/02/10 03:39:41 jsg Exp $ */
+/* $OpenBSD: intel_overlay.c,v 1.12 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright © 2009
*
@@ -1403,7 +1403,7 @@ void intel_setup_overlay(struct drm_device *dev)
dev_priv->overlay = overlay;
mutex_unlock(&dev->struct_mutex);
- DRM_DEBUG("initialized overlay support\n");
+ DRM_INFO("initialized overlay support\n");
return;
out_unpin_bo:
diff --git a/sys/dev/pci/drm/i915/intel_pm.c b/sys/dev/pci/drm/i915/intel_pm.c
index b6930fec132..7a33b28c4a9 100644
--- a/sys/dev/pci/drm/i915/intel_pm.c
+++ b/sys/dev/pci/drm/i915/intel_pm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_pm.c,v 1.25 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: intel_pm.c,v 1.26 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright © 2012 Intel Corporation
*
@@ -2619,7 +2619,7 @@ static void gen6_enable_rps(struct drm_device *dev)
rc6_mask |= GEN6_RC_CTL_RC6pp_ENABLE;
}
- DRM_DEBUG("Enabling RC6 states: RC6 %s, RC6p %s, RC6pp %s\n",
+ DRM_INFO("Enabling RC6 states: RC6 %s, RC6p %s, RC6pp %s\n",
(rc6_mask & GEN6_RC_CTL_RC6_ENABLE) ? "on" : "off",
(rc6_mask & GEN6_RC_CTL_RC6p_ENABLE) ? "on" : "off",
(rc6_mask & GEN6_RC_CTL_RC6pp_ENABLE) ? "on" : "off");
diff --git a/sys/dev/pci/drm/radeon/atom.c b/sys/dev/pci/drm/radeon/atom.c
index 958b8c3147b..e17fb457b58 100644
--- a/sys/dev/pci/drm/radeon/atom.c
+++ b/sys/dev/pci/drm/radeon/atom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atom.c,v 1.5 2015/02/10 06:19:36 jsg Exp $ */
+/* $OpenBSD: atom.c,v 1.6 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
*
@@ -87,15 +87,15 @@ static int debug_depth = 0;
static void debug_print_spaces(int n)
{
while (n--)
- printf(" ");
+ printk(" ");
}
#ifdef DEBUG
#undef DEBUG
#endif
-#define DEBUG(...) do if (atom_debug) { printf(__FILE__ __VA_ARGS__); } while (0)
-#define SDEBUG(...) do if (atom_debug) { printf(__FILE__); debug_print_spaces(debug_depth); printf(__VA_ARGS__); } while (0)
+#define DEBUG(...) do if (atom_debug) { printk(__FILE__ __VA_ARGS__); } while (0)
+#define SDEBUG(...) do if (atom_debug) { printk(__FILE__); debug_print_spaces(debug_depth); printf(__VA_ARGS__); } while (0)
#else
#define DEBUG(...) do { } while (0)
#define SDEBUG(...) do { } while (0)
@@ -171,7 +171,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base,
case ATOM_IIO_END:
return temp;
default:
- DRM_INFO("Unknown IIO opcode.\n");
+ printk(KERN_INFO "Unknown IIO opcode.\n");
return 0;
}
}
@@ -195,20 +195,20 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr,
val = gctx->card->reg_read(gctx->card, idx);
break;
case ATOM_IO_PCI:
- DRM_INFO(
+ printk(KERN_INFO
"PCI registers are not implemented.\n");
return 0;
case ATOM_IO_SYSIO:
- DRM_INFO(
+ printk(KERN_INFO
"SYSIO registers are not implemented.\n");
return 0;
default:
if (!(gctx->io_mode & 0x80)) {
- DRM_INFO( "Bad IO mode.\n");
+ printk(KERN_INFO "Bad IO mode.\n");
return 0;
}
if (!gctx->iio[gctx->io_mode & 0x7F]) {
- DRM_INFO(
+ printk(KERN_INFO
"Undefined indirect IO read method %d.\n",
gctx->io_mode & 0x7F);
return 0;
@@ -478,20 +478,20 @@ static void atom_put_dst(atom_exec_context *ctx, int arg, uint8_t attr,
gctx->card->reg_write(gctx->card, idx, val);
break;
case ATOM_IO_PCI:
- DRM_INFO(
+ printk(KERN_INFO
"PCI registers are not implemented.\n");
return;
case ATOM_IO_SYSIO:
- DRM_INFO(
+ printk(KERN_INFO
"SYSIO registers are not implemented.\n");
return;
default:
if (!(gctx->io_mode & 0x80)) {
- DRM_INFO( "Bad IO mode.\n");
+ printk(KERN_INFO "Bad IO mode.\n");
return;
}
if (!gctx->iio[gctx->io_mode & 0xFF]) {
- DRM_INFO(
+ printk(KERN_INFO
"Undefined indirect IO write method %d.\n",
gctx->io_mode & 0x7F);
return;
@@ -620,7 +620,7 @@ static void atom_op_and(atom_exec_context *ctx, int *ptr, int arg)
static void atom_op_beep(atom_exec_context *ctx, int *ptr, int arg)
{
- printf("ATOM BIOS beeped!\n");
+ printk("ATOM BIOS beeped!\n");
}
static void atom_op_calltable(atom_exec_context *ctx, int *ptr, int arg)
@@ -824,17 +824,17 @@ static void atom_op_postcard(atom_exec_context *ctx, int *ptr, int arg)
static void atom_op_repeat(atom_exec_context *ctx, int *ptr, int arg)
{
- DRM_INFO( "unimplemented!\n");
+ printk(KERN_INFO "unimplemented!\n");
}
static void atom_op_restorereg(atom_exec_context *ctx, int *ptr, int arg)
{
- DRM_INFO( "unimplemented!\n");
+ printk(KERN_INFO "unimplemented!\n");
}
static void atom_op_savereg(atom_exec_context *ctx, int *ptr, int arg)
{
- DRM_INFO( "unimplemented!\n");
+ printk(KERN_INFO "unimplemented!\n");
}
static void atom_op_setdatablock(atom_exec_context *ctx, int *ptr, int arg)
@@ -997,7 +997,7 @@ static void atom_op_switch(atom_exec_context *ctx, int *ptr, int arg)
}
(*ptr) += 2;
} else {
- DRM_INFO( "Bad case.\n");
+ printk(KERN_INFO "Bad case.\n");
return;
}
(*ptr) += 2;
@@ -1031,7 +1031,7 @@ static void atom_op_xor(atom_exec_context *ctx, int *ptr, int arg)
static void atom_op_debug(atom_exec_context *ctx, int *ptr, int arg)
{
- DRM_INFO( "unimplemented!\n");
+ printk(KERN_INFO "unimplemented!\n");
}
static struct {
@@ -1276,14 +1276,14 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
ctx->bios = bios;
if (CU16(0) != ATOM_BIOS_MAGIC) {
- DRM_INFO( "Invalid BIOS magic.\n");
+ printk(KERN_INFO "Invalid BIOS magic.\n");
kfree(ctx);
return NULL;
}
if (strncmp
(CSTR(ATOM_ATI_MAGIC_PTR), ATOM_ATI_MAGIC,
strlen(ATOM_ATI_MAGIC))) {
- DRM_INFO( "Invalid ATI magic.\n");
+ printk(KERN_INFO "Invalid ATI magic.\n");
kfree(ctx);
return NULL;
}
@@ -1292,7 +1292,7 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
if (strncmp
(CSTR(base + ATOM_ROM_MAGIC_PTR), ATOM_ROM_MAGIC,
strlen(ATOM_ROM_MAGIC))) {
- DRM_INFO( "Invalid ATOM magic.\n");
+ printk(KERN_INFO "Invalid ATOM magic.\n");
kfree(ctx);
return NULL;
}
@@ -1313,7 +1313,7 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
break;
}
}
- DRM_INFO( "ATOM BIOS: %s\n", name);
+ printk(KERN_INFO "ATOM BIOS: %s\n", name);
#endif
return ctx;
diff --git a/sys/dev/pci/drm/radeon/evergreen.c b/sys/dev/pci/drm/radeon/evergreen.c
index e4dedc6bc4c..183f76e2335 100644
--- a/sys/dev/pci/drm/radeon/evergreen.c
+++ b/sys/dev/pci/drm/radeon/evergreen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: evergreen.c,v 1.12 2014/04/07 06:43:11 jsg Exp $ */
+/* $OpenBSD: evergreen.c,v 1.13 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2010 Advanced Micro Devices, Inc.
*
@@ -1240,7 +1240,7 @@ void evergreen_pcie_gart_tlb_flush(struct radeon_device *rdev)
tmp = RREG32(VM_CONTEXT0_REQUEST_RESPONSE);
tmp = (tmp & RESPONSE_TYPE_MASK) >> RESPONSE_TYPE_SHIFT;
if (tmp == 2) {
- DRM_ERROR("[drm] r600 flush TLB failed\n");
+ printk(KERN_WARNING "[drm] r600 flush TLB failed\n");
return;
}
if (tmp) {
diff --git a/sys/dev/pci/drm/radeon/evergreen_cs.c b/sys/dev/pci/drm/radeon/evergreen_cs.c
index fec496feb0a..403e6eace77 100644
--- a/sys/dev/pci/drm/radeon/evergreen_cs.c
+++ b/sys/dev/pci/drm/radeon/evergreen_cs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: evergreen_cs.c,v 1.3 2014/02/15 14:19:44 jsg Exp $ */
+/* $OpenBSD: evergreen_cs.c,v 1.4 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2010 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -1252,7 +1252,7 @@ static int evergreen_packet0_check(struct radeon_cs_parser *p,
}
break;
default:
- DRM_ERROR( "Forbidden register 0x%04X in cs at %d\n",
+ printk(KERN_ERR "Forbidden register 0x%04X in cs at %d\n",
reg, idx);
return -EINVAL;
}
diff --git a/sys/dev/pci/drm/radeon/ni.c b/sys/dev/pci/drm/radeon/ni.c
index 36a644aa825..1948c992019 100644
--- a/sys/dev/pci/drm/radeon/ni.c
+++ b/sys/dev/pci/drm/radeon/ni.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ni.c,v 1.8 2014/07/12 18:48:52 tedu Exp $ */
+/* $OpenBSD: ni.c,v 1.9 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2010 Advanced Micro Devices, Inc.
*
@@ -335,9 +335,7 @@ int ni_init_microcode(struct radeon_device *rdev)
default: BUG();
}
-#ifdef DRMDEBUG
DRM_INFO("Loading %s Microcode\n", chip_name);
-#endif
snprintf(fw_name, sizeof(fw_name), "radeon-%s_pfp", chip_name);
err = loadfirmware(fw_name, &rdev->pfp_fw, &rdev->pfp_fw_size);
diff --git a/sys/dev/pci/drm/radeon/r100.c b/sys/dev/pci/drm/radeon/r100.c
index 38d9dc8e035..9fe8a393967 100644
--- a/sys/dev/pci/drm/radeon/r100.c
+++ b/sys/dev/pci/drm/radeon/r100.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: r100.c,v 1.9 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: r100.c,v 1.10 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -994,17 +994,13 @@ static int r100_cp_init_microcode(struct radeon_device *rdev)
if ((rdev->family == CHIP_R100) || (rdev->family == CHIP_RV100) ||
(rdev->family == CHIP_RV200) || (rdev->family == CHIP_RS100) ||
(rdev->family == CHIP_RS200)) {
-#ifdef DRMDEBUG
DRM_INFO("Loading R100 Microcode\n");
-#endif
fw_name = FIRMWARE_R100;
} else if ((rdev->family == CHIP_R200) ||
(rdev->family == CHIP_RV250) ||
(rdev->family == CHIP_RV280) ||
(rdev->family == CHIP_RS300)) {
-#ifdef DRMDEBUG
DRM_INFO("Loading R200 Microcode\n");
-#endif
fw_name = FIRMWARE_R200;
} else if ((rdev->family == CHIP_R300) ||
(rdev->family == CHIP_R350) ||
@@ -1012,27 +1008,19 @@ static int r100_cp_init_microcode(struct radeon_device *rdev)
(rdev->family == CHIP_RV380) ||
(rdev->family == CHIP_RS400) ||
(rdev->family == CHIP_RS480)) {
-#ifdef DRMDEBUG
DRM_INFO("Loading R300 Microcode\n");
-#endif
fw_name = FIRMWARE_R300;
} else if ((rdev->family == CHIP_R420) ||
(rdev->family == CHIP_R423) ||
(rdev->family == CHIP_RV410)) {
-#ifdef DRMDEBUG
DRM_INFO("Loading R400 Microcode\n");
-#endif
fw_name = FIRMWARE_R420;
} else if ((rdev->family == CHIP_RS690) ||
(rdev->family == CHIP_RS740)) {
-#ifdef DRMDEBUG
DRM_INFO("Loading RS690/RS740 Microcode\n");
-#endif
fw_name = FIRMWARE_RS690;
} else if (rdev->family == CHIP_RS600) {
-#ifdef DRMDEBUG
DRM_INFO("Loading RS600 Microcode\n");
-#endif
fw_name = FIRMWARE_RS600;
} else if ((rdev->family == CHIP_RV515) ||
(rdev->family == CHIP_R520) ||
@@ -1040,9 +1028,7 @@ static int r100_cp_init_microcode(struct radeon_device *rdev)
(rdev->family == CHIP_R580) ||
(rdev->family == CHIP_RV560) ||
(rdev->family == CHIP_RV570)) {
-#ifdef DRMDEBUG
DRM_INFO("Loading R500 Microcode\n");
-#endif
fw_name = FIRMWARE_R520;
}
@@ -1070,7 +1056,7 @@ static void r100_cp_load_microcode(struct radeon_device *rdev)
int i, size;
if (r100_gui_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait GUI idle while "
+ printk(KERN_WARNING "Failed to wait GUI idle while "
"programming pipes. Bad things might happen.\n");
}
@@ -1156,9 +1142,7 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size)
WREG32(RADEON_CP_RB_CNTL, tmp | RADEON_RB_NO_UPDATE);
/* Set ring address */
-#ifdef DRMDEBUG
DRM_INFO("radeon: ring at 0x%016lX\n", (unsigned long)ring->gpu_addr);
-#endif
WREG32(RADEON_CP_RB_BASE, ring->gpu_addr);
/* Force read & write ptr to 0 */
WREG32(RADEON_CP_RB_CNTL, tmp | RADEON_RB_RPTR_WR_ENA | RADEON_RB_NO_UPDATE);
@@ -1235,7 +1219,7 @@ void r100_cp_disable(struct radeon_device *rdev)
WREG32(RADEON_CP_CSQ_CNTL, 0);
WREG32(R_000770_SCRATCH_UMSK, 0);
if (r100_gui_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait GUI idle while "
+ printk(KERN_WARNING "Failed to wait GUI idle while "
"programming pipes. Bad things might happen.\n");
}
}
@@ -1981,7 +1965,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
track->tex_dirty = true;
break;
default:
- DRM_ERROR("Forbidden register 0x%04X in cs at %d\n",
+ printk(KERN_ERR "Forbidden register 0x%04X in cs at %d\n",
reg, idx);
return -EINVAL;
}
@@ -2587,7 +2571,7 @@ int r100_gui_wait_for_idle(struct radeon_device *rdev)
uint32_t tmp;
if (r100_rbbm_fifo_wait_for_entry(rdev, 64)) {
- DRM_ERROR("radeon: wait for empty RBBM fifo failed !"
+ printk(KERN_WARNING "radeon: wait for empty RBBM fifo failed !"
" Bad things might happen.\n");
}
for (i = 0; i < rdev->usec_timeout; i++) {
@@ -2855,9 +2839,7 @@ r100_get_accessible_vram(struct radeon_device *rdev)
rdev->family >= CHIP_RV350) {
WREG32_P(RADEON_HOST_PATH_CNTL, RADEON_HDP_APER_CNTL,
~RADEON_HDP_APER_CNTL);
-#ifdef DRMDEBUG
DRM_INFO("Generation 2 PCI interface, using max accessible memory\n");
-#endif
return aper_size * 2;
}
@@ -3763,9 +3745,7 @@ int r100_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
udelay(1);
}
if (i < rdev->usec_timeout) {
-#ifdef DRMDEBUG
DRM_INFO("ring test succeeded in %d usecs\n", i);
-#endif
} else {
DRM_ERROR("radeon: ring test failed (scratch(0x%04X)=0x%08X)\n",
scratch, tmp);
@@ -3836,9 +3816,7 @@ int r100_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
udelay(1);
}
if (i < rdev->usec_timeout) {
-#ifdef DRMDEBUG
DRM_INFO("ib test succeeded in %u usecs\n", i);
-#endif
} else {
DRM_ERROR("radeon: ib test failed (scratch(0x%04X)=0x%08X)\n",
scratch, tmp);
diff --git a/sys/dev/pci/drm/radeon/r200.c b/sys/dev/pci/drm/radeon/r200.c
index 9ffa8e9d314..93088350aba 100644
--- a/sys/dev/pci/drm/radeon/r200.c
+++ b/sys/dev/pci/drm/radeon/r200.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: r200.c,v 1.1 2013/08/12 04:11:53 jsg Exp $ */
+/* $OpenBSD: r200.c,v 1.2 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -535,7 +535,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
track->tex_dirty = true;
break;
default:
- DRM_ERROR( "Forbidden register 0x%04X in cs at %d\n",
+ printk(KERN_ERR "Forbidden register 0x%04X in cs at %d\n",
reg, idx);
return -EINVAL;
}
diff --git a/sys/dev/pci/drm/radeon/r300.c b/sys/dev/pci/drm/radeon/r300.c
index 2a65e95ec0c..8869d1202a4 100644
--- a/sys/dev/pci/drm/radeon/r300.c
+++ b/sys/dev/pci/drm/radeon/r300.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: r300.c,v 1.4 2014/04/07 06:43:11 jsg Exp $ */
+/* $OpenBSD: r300.c,v 1.5 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -354,7 +354,7 @@ static void r300_gpu_init(struct radeon_device *rdev)
WREG32(R300_GB_TILE_CONFIG, gb_tile_config);
if (r100_gui_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait GUI idle while "
+ printk(KERN_WARNING "Failed to wait GUI idle while "
"programming pipes. Bad things might happen.\n");
}
@@ -366,17 +366,15 @@ static void r300_gpu_init(struct radeon_device *rdev)
R300_DC_DC_DISABLE_IGNORE_PE);
if (r100_gui_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait GUI idle while "
+ printk(KERN_WARNING "Failed to wait GUI idle while "
"programming pipes. Bad things might happen.\n");
}
if (r300_mc_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait MC idle while "
+ printk(KERN_WARNING "Failed to wait MC idle while "
"programming pipes. Bad things might happen.\n");
}
-#ifdef DRMDEBUG
DRM_INFO("radeon: %d quad pipes, %d Z pipes initialized.\n",
rdev->num_gb_pipes, rdev->num_z_pipes);
-#endif
}
int r300_asic_reset(struct radeon_device *rdev)
@@ -1138,7 +1136,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
}
return 0;
fail:
- DRM_ERROR( "Forbidden register 0x%04X in cs at %d (val=%08x)\n",
+ printk(KERN_ERR "Forbidden register 0x%04X in cs at %d (val=%08x)\n",
reg, idx, idx_value);
return -EINVAL;
}
diff --git a/sys/dev/pci/drm/radeon/r420.c b/sys/dev/pci/drm/radeon/r420.c
index 766cc7a6b95..d6d005fb7ab 100644
--- a/sys/dev/pci/drm/radeon/r420.c
+++ b/sys/dev/pci/drm/radeon/r420.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: r420.c,v 1.4 2014/04/07 06:43:11 jsg Exp $ */
+/* $OpenBSD: r420.c,v 1.5 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -91,7 +91,7 @@ void r420_pipes_init(struct radeon_device *rdev)
(1 << 2) | (1 << 3));
/* add idle wait as per freedesktop.org bug 24041 */
if (r100_gui_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait GUI idle while "
+ printk(KERN_WARNING "Failed to wait GUI idle while "
"programming pipes. Bad things might happen.\n");
}
/* get max number of pipes */
@@ -127,7 +127,7 @@ void r420_pipes_init(struct radeon_device *rdev)
tmp |= R300_TILE_SIZE_16 | R300_ENABLE_TILING;
WREG32(R300_GB_TILE_CONFIG, tmp);
if (r100_gui_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait GUI idle while "
+ printk(KERN_WARNING "Failed to wait GUI idle while "
"programming pipes. Bad things might happen.\n");
}
@@ -140,7 +140,7 @@ void r420_pipes_init(struct radeon_device *rdev)
R300_DC_DC_DISABLE_IGNORE_PE);
if (r100_gui_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait GUI idle while "
+ printk(KERN_WARNING "Failed to wait GUI idle while "
"programming pipes. Bad things might happen.\n");
}
@@ -153,10 +153,8 @@ void r420_pipes_init(struct radeon_device *rdev)
} else
rdev->num_z_pipes = 1;
-#ifdef DRMDEBUG
DRM_INFO("radeon: %d quad pipes, %d z pipes initialized.\n",
rdev->num_gb_pipes, rdev->num_z_pipes);
-#endif
}
u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg)
diff --git a/sys/dev/pci/drm/radeon/r520.c b/sys/dev/pci/drm/radeon/r520.c
index ee15d76c4dc..7729bce2981 100644
--- a/sys/dev/pci/drm/radeon/r520.c
+++ b/sys/dev/pci/drm/radeon/r520.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: r520.c,v 1.2 2014/02/09 12:33:44 jsg Exp $ */
+/* $OpenBSD: r520.c,v 1.3 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -87,7 +87,7 @@ static void r520_gpu_init(struct radeon_device *rdev)
(((gb_pipe_select >> 8) & 0xF) << 4);
WREG32_PLL(0x000D, tmp);
if (r520_mc_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait MC idle while "
+ printk(KERN_WARNING "Failed to wait MC idle while "
"programming pipes. Bad things might happen.\n");
}
}
diff --git a/sys/dev/pci/drm/radeon/r600.c b/sys/dev/pci/drm/radeon/r600.c
index ea33c16c490..5dfaee2e88b 100644
--- a/sys/dev/pci/drm/radeon/r600.c
+++ b/sys/dev/pci/drm/radeon/r600.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: r600.c,v 1.11 2015/02/10 06:19:36 jsg Exp $ */
+/* $OpenBSD: r600.c,v 1.12 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -855,7 +855,7 @@ void r600_pcie_gart_tlb_flush(struct radeon_device *rdev)
tmp = RREG32(VM_CONTEXT0_REQUEST_RESPONSE);
tmp = (tmp & RESPONSE_TYPE_MASK) >> RESPONSE_TYPE_SHIFT;
if (tmp == 2) {
- DRM_ERROR("[drm] r600 flush TLB failed\n");
+ printk(KERN_WARNING "[drm] r600 flush TLB failed\n");
return;
}
if (tmp) {
@@ -1977,7 +1977,7 @@ int r600_init_microcode(struct radeon_device *rdev)
pdev = platform_device_register_simple("radeon_cp", 0, NULL, 0);
err = IS_ERR(pdev);
if (err) {
- DRM_ERROR( "radeon_cp: Failed to register firmware\n");
+ printk(KERN_ERR "radeon_cp: Failed to register firmware\n");
return -EINVAL;
}
#endif
@@ -2071,9 +2071,7 @@ int r600_init_microcode(struct radeon_device *rdev)
rlc_req_size = RLC_UCODE_SIZE * 4;
}
-#ifdef DRMDEBUG
DRM_INFO("Loading %s Microcode\n", chip_name);
-#endif
snprintf(fw_name, sizeof(fw_name), "radeon-%s_pfp", chip_name);
err = loadfirmware(fw_name, &rdev->pfp_fw, &rdev->pfp_fw_size);
@@ -2112,7 +2110,7 @@ int r600_init_microcode(struct radeon_device *rdev)
out:
if (err) {
if (err != -EINVAL)
- DRM_ERROR(
+ printk(KERN_ERR
"r600_cp: Failed to load firmware \"%s\"\n",
fw_name);
if (rdev->pfp_fw) {
@@ -2465,9 +2463,7 @@ int r600_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
udelay(1);
}
if (i < rdev->usec_timeout) {
-#ifdef DRMDEBUG
DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, i);
-#endif
} else {
DRM_ERROR("radeon: ring %d test failed (scratch(0x%04X)=0x%08X)\n",
ring->idx, scratch, tmp);
@@ -2522,9 +2518,7 @@ int r600_dma_ring_test(struct radeon_device *rdev,
}
if (i < rdev->usec_timeout) {
-#ifdef DRMDEBUG
DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, i);
-#endif
} else {
DRM_ERROR("radeon: ring %d test failed (0x%08X)\n",
ring->idx, tmp);
@@ -3100,9 +3094,7 @@ int r600_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
udelay(1);
}
if (i < rdev->usec_timeout) {
-#ifdef DRMDEBUG
DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i);
-#endif
} else {
DRM_ERROR("radeon: ib test failed (scratch(0x%04X)=0x%08X)\n",
scratch, tmp);
@@ -3170,9 +3162,7 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
udelay(1);
}
if (i < rdev->usec_timeout) {
-#ifdef DRMDEBUG
DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i);
-#endif
} else {
DRM_ERROR("radeon: ib test failed (0x%08X)\n", tmp);
r = -EINVAL;
diff --git a/sys/dev/pci/drm/radeon/r600_cs.c b/sys/dev/pci/drm/radeon/r600_cs.c
index 3e7f3dafc6b..4dc72f2e453 100644
--- a/sys/dev/pci/drm/radeon/r600_cs.c
+++ b/sys/dev/pci/drm/radeon/r600_cs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: r600_cs.c,v 1.4 2015/01/28 05:29:30 jsg Exp $ */
+/* $OpenBSD: r600_cs.c,v 1.5 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -1079,7 +1079,7 @@ static int r600_packet0_check(struct radeon_cs_parser *p,
}
break;
default:
- DRM_ERROR( "Forbidden register 0x%04X in cs at %d\n",
+ printk(KERN_ERR "Forbidden register 0x%04X in cs at %d\n",
reg, idx);
return -EINVAL;
}
diff --git a/sys/dev/pci/drm/radeon/radeon_agp.c b/sys/dev/pci/drm/radeon/radeon_agp.c
index b265440b4c0..27d980c35d0 100644
--- a/sys/dev/pci/drm/radeon/radeon_agp.c
+++ b/sys/dev/pci/drm/radeon/radeon_agp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_agp.c,v 1.2 2014/04/07 06:43:11 jsg Exp $ */
+/* $OpenBSD: radeon_agp.c,v 1.3 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Red Hat Inc.
* Copyright 2009 Jerome Glisse.
@@ -154,7 +154,7 @@ int radeon_agp_init(struct radeon_device *rdev)
if ((ddev->agp->info.ai_aperture_size >> 20) < 32) {
drm_agp_release(rdev->ddev);
- DRM_ERROR("AGP aperture too small (%zuM) "
+ dev_warn(rdev->dev, "AGP aperture too small (%zuM) "
"need at least 32M, disabling AGP\n",
ddev->agp->info.ai_aperture_size >> 20);
return -EINVAL;
diff --git a/sys/dev/pci/drm/radeon/radeon_benchmark.c b/sys/dev/pci/drm/radeon/radeon_benchmark.c
index 8d4748e5e99..c76619ce747 100644
--- a/sys/dev/pci/drm/radeon/radeon_benchmark.c
+++ b/sys/dev/pci/drm/radeon/radeon_benchmark.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_benchmark.c,v 1.1 2013/08/12 04:11:53 jsg Exp $ */
+/* $OpenBSD: radeon_benchmark.c,v 1.2 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2009 Jerome Glisse.
*
@@ -93,7 +93,7 @@ radeon_benchmark_log_results(int n, unsigned size,
#ifdef DRMDEBUG
unsigned int throughput = (n * (size >> 10)) / time;
#endif
- DRM_DEBUG("radeon: %s %u bo moves of %u kB from"
+ DRM_INFO("radeon: %s %u bo moves of %u kB from"
" %d to %d in %u ms, throughput: %u Mb/s or %u MB/s\n",
kind, n, size >> 10, sdomain, ddomain, time,
throughput * 8, throughput);
diff --git a/sys/dev/pci/drm/radeon/radeon_bios.c b/sys/dev/pci/drm/radeon/radeon_bios.c
index 0a96b4b2360..aee68d9108a 100644
--- a/sys/dev/pci/drm/radeon/radeon_bios.c
+++ b/sys/dev/pci/drm/radeon/radeon_bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_bios.c,v 1.3 2014/07/06 08:19:33 jsg Exp $ */
+/* $OpenBSD: radeon_bios.c,v 1.4 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -712,7 +712,7 @@ bool radeon_get_bios(struct radeon_device *rdev)
return false;
}
if (rdev->bios[0] != 0x55 || rdev->bios[1] != 0xaa) {
- printf("BIOS signature incorrect %x %x\n", rdev->bios[0], rdev->bios[1]);
+ printk("BIOS signature incorrect %x %x\n", rdev->bios[0], rdev->bios[1]);
goto free_bios;
}
diff --git a/sys/dev/pci/drm/radeon/radeon_combios.c b/sys/dev/pci/drm/radeon/radeon_combios.c
index 049100e24ca..2a8a064d3d2 100644
--- a/sys/dev/pci/drm/radeon/radeon_combios.c
+++ b/sys/dev/pci/drm/radeon/radeon_combios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_combios.c,v 1.5 2014/04/07 06:43:11 jsg Exp $ */
+/* $OpenBSD: radeon_combios.c,v 1.6 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2004 ATI Technologies Inc., Markham, Ontario
* Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -2634,11 +2634,13 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
return true;
}
+#ifdef DRMDEBUG
static const char *thermal_controller_names[] = {
"NONE",
"lm63",
"adm1032",
};
+#endif
void radeon_combios_get_power_modes(struct radeon_device *rdev)
{
diff --git a/sys/dev/pci/drm/radeon/radeon_device.c b/sys/dev/pci/drm/radeon/radeon_device.c
index b476e5e4db7..3aa93875ba1 100644
--- a/sys/dev/pci/drm/radeon/radeon_device.c
+++ b/sys/dev/pci/drm/radeon/radeon_device.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_device.c,v 1.8 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: radeon_device.c,v 1.9 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -1014,7 +1014,9 @@ static const struct vga_switcheroo_client_ops radeon_switcheroo_ops = {
int radeon_device_init(struct radeon_device *rdev,
struct drm_device *ddev)
{
+#ifdef DRMDEBUG
struct pci_dev *pdev = ddev->pdev;
+#endif
int r, i;
int dma_bits;
diff --git a/sys/dev/pci/drm/radeon/radeon_fb.c b/sys/dev/pci/drm/radeon/radeon_fb.c
index 0b0ad16683b..6962b728679 100644
--- a/sys/dev/pci/drm/radeon/radeon_fb.c
+++ b/sys/dev/pci/drm/radeon/radeon_fb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_fb.c,v 1.6 2015/01/27 03:17:36 dlg Exp $ */
+/* $OpenBSD: radeon_fb.c,v 1.7 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright © 2007 David Airlie
*
@@ -133,7 +133,7 @@ radeonfb_create_pinned_object(struct radeon_fbdev *rfbdev,
false, true,
&gobj);
if (ret) {
- DRM_ERROR( "failed to allocate framebuffer (%d)\n",
+ printk(KERN_ERR "failed to allocate framebuffer (%d)\n",
aligned_size);
return -ENOMEM;
}
diff --git a/sys/dev/pci/drm/radeon/radeon_gem.c b/sys/dev/pci/drm/radeon/radeon_gem.c
index 840d8c8bd3d..faba97ce27a 100644
--- a/sys/dev/pci/drm/radeon/radeon_gem.c
+++ b/sys/dev/pci/drm/radeon/radeon_gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_gem.c,v 1.5 2015/02/10 06:19:36 jsg Exp $ */
+/* $OpenBSD: radeon_gem.c,v 1.6 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -74,7 +74,7 @@ int radeon_gem_object_create(struct radeon_device *rdev, int size,
/* maximun bo size is the minimun btw visible vram and gtt size */
max_size = min(rdev->mc.visible_vram_size, rdev->mc.gtt_size);
if (size > max_size) {
- printf("%s:%d alloc size %dMb bigger than %ldMb limit\n",
+ printk(KERN_WARNING "%s:%d alloc size %dMb bigger than %ldMb limit\n",
__func__, __LINE__, size >> 20, max_size >> 20);
return -ENOMEM;
}
@@ -117,14 +117,14 @@ int radeon_gem_set_domain(struct drm_gem_object *gobj,
}
if (!domain) {
/* Do nothings */
- DRM_ERROR("Set domain without domain !\n");
+ printk(KERN_WARNING "Set domain without domain !\n");
return 0;
}
if (domain == RADEON_GEM_DOMAIN_CPU) {
/* Asking for cpu access wait for object idle */
r = radeon_bo_wait(robj, NULL, false);
if (r) {
- DRM_ERROR("Failed to wait for object !\n");
+ printk(KERN_ERR "Failed to wait for object !\n");
return r;
}
}
@@ -191,7 +191,7 @@ void radeon_gem_object_close(struct drm_gem_object *obj,
r = radeon_bo_reserve(rbo, true);
if (r) {
- DRM_ERROR("leaking bo va because "
+ dev_err(rdev->dev, "leaking bo va because "
"we fail to reserve bo (%d)\n", r);
return;
}
@@ -481,13 +481,13 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data,
*/
invalid_flags = RADEON_VM_PAGE_VALID | RADEON_VM_PAGE_SYSTEM;
if ((args->flags & invalid_flags)) {
- DRM_ERROR("invalid flags 0x%08X vs 0x%08X\n",
+ dev_err(&dev->pdev->dev, "invalid flags 0x%08X vs 0x%08X\n",
args->flags, invalid_flags);
args->operation = RADEON_VA_RESULT_ERROR;
return -EINVAL;
}
if (!(args->flags & RADEON_VM_PAGE_SNOOPED)) {
- DRM_ERROR("only supported snooped mapping for now\n");
+ dev_err(&dev->pdev->dev, "only supported snooped mapping for now\n");
args->operation = RADEON_VA_RESULT_ERROR;
return -EINVAL;
}
@@ -497,7 +497,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data,
case RADEON_VA_UNMAP:
break;
default:
- DRM_ERROR("unsupported operation %d\n",
+ dev_err(&dev->pdev->dev, "unsupported operation %d\n",
args->operation);
args->operation = RADEON_VA_RESULT_ERROR;
return -EINVAL;
diff --git a/sys/dev/pci/drm/radeon/radeon_irq_kms.c b/sys/dev/pci/drm/radeon/radeon_irq_kms.c
index 31754dd2114..27d2d8e2c13 100644
--- a/sys/dev/pci/drm/radeon/radeon_irq_kms.c
+++ b/sys/dev/pci/drm/radeon/radeon_irq_kms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_irq_kms.c,v 1.6 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: radeon_irq_kms.c,v 1.7 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -268,7 +268,7 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
int ret = pci_enable_msi(rdev->pdev);
if (!ret) {
rdev->msi_enabled = 1;
- dev_info(rdev->ddev, "radeon: using MSI.\n");
+ dev_info(rdev->dev, "radeon: using MSI.\n");
}
}
#endif
@@ -278,7 +278,7 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
rdev->irq.installed = false;
return r;
}
- DRM_DEBUG("radeon: irq initialized.\n");
+ DRM_INFO("radeon: irq initialized.\n");
return 0;
}
diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c
index 05a6a359db8..8ab5e83c799 100644
--- a/sys/dev/pci/drm/radeon/radeon_kms.c
+++ b/sys/dev/pci/drm/radeon/radeon_kms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_kms.c,v 1.34 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: radeon_kms.c,v 1.35 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -671,7 +671,7 @@ radeondrm_attachhook(void *xsc)
*/
r = radeon_device_init(rdev, rdev->ddev);
if (r) {
- printf(": Fatal error during GPU init\n");
+ dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
radeon_fatal_error = 1;
radeondrm_forcedetach(rdev);
return;
@@ -683,7 +683,7 @@ radeondrm_attachhook(void *xsc)
*/
r = radeon_modeset_init(rdev);
if (r)
- printf("Fatal error during modeset init\n");
+ dev_err(&dev->pdev->dev, "Fatal error during modeset init\n");
/* Call ACPI methods: require modeset init
* but failure is not fatal
diff --git a/sys/dev/pci/drm/radeon/radeon_object.c b/sys/dev/pci/drm/radeon/radeon_object.c
index e34be49f99f..6e621086da1 100644
--- a/sys/dev/pci/drm/radeon/radeon_object.c
+++ b/sys/dev/pci/drm/radeon/radeon_object.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_object.c,v 1.7 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: radeon_object.c,v 1.8 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2009 Jerome Glisse.
* All Rights Reserved.
@@ -262,7 +262,7 @@ int radeon_bo_pin_restricted(struct radeon_bo *bo, u32 domain, u64 max_offset,
*gpu_addr = radeon_bo_gpu_offset(bo);
}
if (unlikely(r != 0))
- DRM_ERROR("%p pin failed\n", bo);
+ dev_err(bo->rdev->dev, "%p pin failed\n", bo);
return r;
}
@@ -276,7 +276,7 @@ int radeon_bo_unpin(struct radeon_bo *bo)
int r, i;
if (!bo->pin_count) {
- DRM_ERROR("%p unpin not necessary\n", bo);
+ dev_warn(bo->rdev->dev, "%p unpin not necessary\n", bo);
return 0;
}
bo->pin_count--;
@@ -286,7 +286,7 @@ int radeon_bo_unpin(struct radeon_bo *bo)
bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT;
r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false);
if (unlikely(r != 0))
- DRM_ERROR("%p validate failed for unpin\n", bo);
+ dev_err(bo->rdev->dev, "%p validate failed for unpin\n", bo);
return r;
}
@@ -308,11 +308,11 @@ void radeon_bo_force_delete(struct radeon_device *rdev)
if (list_empty(&rdev->gem.objects)) {
return;
}
- DRM_ERROR("Userspace still has active objects !\n");
+ dev_err(rdev->dev, "Userspace still has active objects !\n");
list_for_each_entry_safe(bo, n, &rdev->gem.objects, list) {
mutex_lock(&rdev->ddev->struct_mutex);
#ifdef notyet
- DRM_ERROR("%p %p %lu %lu force free\n",
+ dev_err(rdev->dev, "%p %p %lu %lu force free\n",
&bo->gem_base, bo, (unsigned long)bo->gem_base.size,
*((unsigned long *)&bo->gem_base.refcount));
#endif
@@ -659,7 +659,7 @@ int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr)
r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, 0);
if (unlikely(r != 0)) {
if (r != -ERESTARTSYS)
- DRM_ERROR("%p reserve failed\n", bo);
+ dev_err(bo->rdev->dev, "%p reserve failed\n", bo);
return r;
}
return 0;
diff --git a/sys/dev/pci/drm/radeon/radeon_test.c b/sys/dev/pci/drm/radeon/radeon_test.c
index 1f8cc8bb23d..675290184d3 100644
--- a/sys/dev/pci/drm/radeon/radeon_test.c
+++ b/sys/dev/pci/drm/radeon/radeon_test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_test.c,v 1.3 2014/02/10 01:08:34 jsg Exp $ */
+/* $OpenBSD: radeon_test.c,v 1.4 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2009 VMware, Inc.
*
@@ -241,7 +241,7 @@ out_cleanup:
radeon_fence_unref(&fence);
}
if (r) {
- DRM_ERROR("Error while testing BO move.\n");
+ printk(KERN_WARNING "Error while testing BO move.\n");
}
}
@@ -340,7 +340,7 @@ out_cleanup:
radeon_fence_unref(&fence2);
if (r)
- DRM_ERROR("Error while testing ring sync (%d).\n", r);
+ printk(KERN_WARNING "Error while testing ring sync (%d).\n", r);
}
static void radeon_test_ring_sync2(struct radeon_device *rdev,
@@ -455,7 +455,7 @@ out_cleanup:
radeon_fence_unref(&fenceB);
if (r)
- DRM_ERROR("Error while testing ring sync (%d).\n", r);
+ printk(KERN_WARNING "Error while testing ring sync (%d).\n", r);
}
void radeon_test_syncing(struct radeon_device *rdev)
diff --git a/sys/dev/pci/drm/radeon/radeon_ttm.c b/sys/dev/pci/drm/radeon/radeon_ttm.c
index 925bf63f376..77dfa064d35 100644
--- a/sys/dev/pci/drm/radeon/radeon_ttm.c
+++ b/sys/dev/pci/drm/radeon/radeon_ttm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_ttm.c,v 1.9 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: radeon_ttm.c,v 1.10 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2009 Jerome Glisse.
* All Rights Reserved.
@@ -815,20 +815,16 @@ int radeon_ttm_init(struct radeon_device *rdev)
radeon_bo_unref(&rdev->stollen_vga_memory);
return r;
}
-#ifdef DRMDEBUG
DRM_INFO("radeon: %uM of VRAM memory ready\n",
(unsigned) (rdev->mc.real_vram_size / (1024 * 1024)));
-#endif
r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_TT,
rdev->mc.gtt_size >> PAGE_SHIFT);
if (r) {
DRM_ERROR("Failed initializing GTT heap.\n");
return r;
}
-#ifdef DRMDEBUG
DRM_INFO("radeon: %uM of GTT memory ready.\n",
(unsigned)(rdev->mc.gtt_size / (1024 * 1024)));
-#endif
#ifdef notyet
rdev->mman.bdev.dev_mapping = rdev->ddev->dev_mapping;
#endif
diff --git a/sys/dev/pci/drm/radeon/rs400.c b/sys/dev/pci/drm/radeon/rs400.c
index 4c132a950a2..ea320eb9f80 100644
--- a/sys/dev/pci/drm/radeon/rs400.c
+++ b/sys/dev/pci/drm/radeon/rs400.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rs400.c,v 1.4 2014/02/09 12:33:44 jsg Exp $ */
+/* $OpenBSD: rs400.c,v 1.5 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -249,7 +249,7 @@ static void rs400_gpu_init(struct radeon_device *rdev)
/* FIXME: is this correct ? */
r420_pipes_init(rdev);
if (rs400_mc_wait_for_idle(rdev)) {
- DRM_ERROR("rs400: Failed to wait MC idle while "
+ printk(KERN_WARNING "rs400: Failed to wait MC idle while "
"programming pipes. Bad things might happen. %08x\n", RREG32(RADEON_MC_STATUS));
}
}
diff --git a/sys/dev/pci/drm/radeon/rs690.c b/sys/dev/pci/drm/radeon/rs690.c
index f20785dfeed..1e528851355 100644
--- a/sys/dev/pci/drm/radeon/rs690.c
+++ b/sys/dev/pci/drm/radeon/rs690.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rs690.c,v 1.4 2014/02/09 12:33:44 jsg Exp $ */
+/* $OpenBSD: rs690.c,v 1.5 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -52,7 +52,7 @@ static void rs690_gpu_init(struct radeon_device *rdev)
/* FIXME: is this correct ? */
r420_pipes_init(rdev);
if (rs690_mc_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait MC idle while "
+ printk(KERN_WARNING "Failed to wait MC idle while "
"programming pipes. Bad things might happen.\n");
}
}
diff --git a/sys/dev/pci/drm/radeon/rv515.c b/sys/dev/pci/drm/radeon/rv515.c
index 0a2656e90f5..080e4839432 100644
--- a/sys/dev/pci/drm/radeon/rv515.c
+++ b/sys/dev/pci/drm/radeon/rv515.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rv515.c,v 1.3 2014/02/09 12:33:44 jsg Exp $ */
+/* $OpenBSD: rv515.c,v 1.4 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -153,7 +153,7 @@ static void rv515_gpu_init(struct radeon_device *rdev)
unsigned pipe_select_current, gb_pipe_select, tmp;
if (r100_gui_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait GUI idle while "
+ printk(KERN_WARNING "Failed to wait GUI idle while "
"resetting GPU. Bad things might happen.\n");
}
rv515_vga_render_disable(rdev);
@@ -165,11 +165,11 @@ static void rv515_gpu_init(struct radeon_device *rdev)
(((gb_pipe_select >> 8) & 0xF) << 4);
WREG32_PLL(0x000D, tmp);
if (r100_gui_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait GUI idle while "
+ printk(KERN_WARNING "Failed to wait GUI idle while "
"resetting GPU. Bad things might happen.\n");
}
if (rv515_mc_wait_for_idle(rdev)) {
- DRM_ERROR("Failed to wait MC idle while "
+ printk(KERN_WARNING "Failed to wait MC idle while "
"programming pipes. Bad things might happen.\n");
}
}
diff --git a/sys/dev/pci/drm/radeon/si.c b/sys/dev/pci/drm/radeon/si.c
index 6d5e27b00d5..92441ba9bc8 100644
--- a/sys/dev/pci/drm/radeon/si.c
+++ b/sys/dev/pci/drm/radeon/si.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: si.c,v 1.16 2015/02/10 06:19:36 jsg Exp $ */
+/* $OpenBSD: si.c,v 1.17 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright 2011 Advanced Micro Devices, Inc.
*
@@ -321,9 +321,7 @@ static int si_init_microcode(struct radeon_device *rdev)
default: BUG();
}
-#ifdef DRMDEBUG
DRM_INFO("Loading %s Microcode\n", chip_name);
-#endif
snprintf(fw_name, sizeof(fw_name), "radeon-%s_pfp", chip_name);
err = loadfirmware(fw_name, &rdev->pfp_fw, &rdev->pfp_fw_size);
@@ -384,7 +382,7 @@ static int si_init_microcode(struct radeon_device *rdev)
out:
if (err) {
if (err != -EINVAL)
- DRM_ERROR(
+ printk(KERN_ERR
"si_cp: Failed to load firmware \"%s\"\n",
fw_name);
if (rdev->pfp_fw) {
diff --git a/sys/dev/pci/drm/ttm/ttm_bo.c b/sys/dev/pci/drm/ttm/ttm_bo.c
index e124efb40ad..8fc9aed8fa9 100644
--- a/sys/dev/pci/drm/ttm/ttm_bo.c
+++ b/sys/dev/pci/drm/ttm/ttm_bo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttm_bo.c,v 1.12 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: ttm_bo.c,v 1.13 2015/02/11 07:01:37 jsg Exp $ */
/**************************************************************************
*
* Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
@@ -71,13 +71,13 @@ static void ttm_mem_type_debug(struct ttm_bo_device *bdev, int mem_type)
{
struct ttm_mem_type_manager *man = &bdev->man[mem_type];
- printf(" has_type: %d\n", man->has_type);
- printf(" use_type: %d\n", man->use_type);
- printf(" flags: 0x%08X\n", man->flags);
- printf(" gpu_offset: 0x%08lX\n", man->gpu_offset);
- printf(" size: %llu\n", man->size);
- printf(" available_caching: 0x%08X\n", man->available_caching);
- printf(" default_caching: 0x%08X\n", man->default_caching);
+ pr_err(" has_type: %d\n", man->has_type);
+ pr_err(" use_type: %d\n", man->use_type);
+ pr_err(" flags: 0x%08X\n", man->flags);
+ pr_err(" gpu_offset: 0x%08lX\n", man->gpu_offset);
+ pr_err(" size: %llu\n", man->size);
+ pr_err(" available_caching: 0x%08X\n", man->available_caching);
+ pr_err(" default_caching: 0x%08X\n", man->default_caching);
if (mem_type != TTM_PL_SYSTEM)
(*man->func->debug)(man, TTM_PFX);
}
@@ -87,7 +87,7 @@ static void ttm_bo_mem_space_debug(struct ttm_buffer_object *bo,
{
int i, ret, mem_type;
- printf("No space for %p (%lu pages, %luK, %luM)\n",
+ pr_err("No space for %p (%lu pages, %luK, %luM)\n",
bo, bo->mem.num_pages, bo->mem.size >> 10,
bo->mem.size >> 20);
for (i = 0; i < placement->num_placement; i++) {
@@ -95,7 +95,7 @@ static void ttm_bo_mem_space_debug(struct ttm_buffer_object *bo,
&mem_type);
if (ret)
return;
- printf(" placement[%d]=0x%08X (%d)\n",
+ pr_err(" placement[%d]=0x%08X (%d)\n",
i, placement->placement[i], mem_type);
ttm_mem_type_debug(bo->bdev, mem_type);
}
@@ -363,7 +363,7 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
bo->ttm->sg = bo->sg;
break;
default:
- printf("Illegal buffer object type\n");
+ pr_err("Illegal buffer object type\n");
ret = -EINVAL;
break;
}
@@ -453,7 +453,7 @@ moved:
if (bdev->driver->invalidate_caches) {
ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement);
if (ret)
- printf("Can not flush read caches\n");
+ pr_err("Can not flush read caches\n");
}
bo->evicted = false;
}
@@ -783,8 +783,8 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo, bool interruptible,
spin_unlock(&bdev->fence_lock);
if (unlikely(ret != 0)) {
- if (ret != -ERESTART) {
- printf("Failed to expire sync object before buffer eviction\n");
+ if (ret != -ERESTARTSYS) {
+ pr_err("Failed to expire sync object before buffer eviction\n");
}
goto out;
}
@@ -804,8 +804,8 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo, bool interruptible,
ret = ttm_bo_mem_space(bo, &placement, &evict_mem, interruptible,
no_wait_gpu);
if (ret) {
- if (ret != -ERESTART) {
- printf("Failed to find memory space for buffer 0x%p eviction\n",
+ if (ret != -ERESTARTSYS) {
+ pr_err("Failed to find memory space for buffer 0x%p eviction\n",
bo);
ttm_bo_mem_space_debug(bo, &placement);
}
@@ -815,8 +815,8 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo, bool interruptible,
ret = ttm_bo_handle_move_mem(bo, &evict_mem, true, interruptible,
no_wait_gpu);
if (ret) {
- if (ret != -ERESTART)
- printf("Buffer eviction failed\n");
+ if (ret != -ERESTARTSYS)
+ pr_err("Buffer eviction failed\n");
ttm_bo_mem_put(bo, &evict_mem);
goto out;
}
@@ -1210,7 +1210,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
ret = ttm_mem_global_alloc(mem_glob, acc_size, false, false);
if (ret) {
- printf("Out of kernel memory\n");
+ pr_err("Out of kernel memory\n");
if (destroy)
(*destroy)(bo);
else
@@ -1220,7 +1220,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
if (num_pages == 0) {
- printf("Illegal buffer object size\n");
+ pr_err("Illegal buffer object size\n");
if (destroy)
(*destroy)(bo);
else
@@ -1367,7 +1367,7 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
if (allow_errors) {
return ret;
} else {
- printf("Cleanup eviction failed\n");
+ pr_err("Cleanup eviction failed\n");
}
}
spin_lock(&glob->lru_lock);
@@ -1382,13 +1382,13 @@ int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type)
int ret = -EINVAL;
if (mem_type >= TTM_NUM_MEM_TYPES) {
- printf("Illegal memory type %d\n", mem_type);
+ pr_err("Illegal memory type %d\n", mem_type);
return ret;
}
man = &bdev->man[mem_type];
if (!man->has_type) {
- printf("Trying to take down uninitialized memory manager type %u\n",
+ pr_err("Trying to take down uninitialized memory manager type %u\n",
mem_type);
return ret;
}
@@ -1412,12 +1412,12 @@ int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type)
struct ttm_mem_type_manager *man = &bdev->man[mem_type];
if (mem_type == 0 || mem_type >= TTM_NUM_MEM_TYPES) {
- printf("Illegal memory manager memory type %u\n", mem_type);
+ pr_err("Illegal memory manager memory type %u\n", mem_type);
return -EINVAL;
}
if (!man->has_type) {
- printf("Memory type %u has not been initialized\n", mem_type);
+ pr_err("Memory type %u has not been initialized\n", mem_type);
return 0;
}
@@ -1501,7 +1501,7 @@ int ttm_bo_global_init(struct drm_global_reference *ref)
ttm_mem_init_shrink(&glob->shrink, ttm_bo_swapout);
ret = ttm_mem_register_shrink(glob->mem_glob, &glob->shrink);
if (unlikely(ret != 0)) {
- printf("Could not register buffer object swapout\n");
+ pr_err("Could not register buffer object swapout\n");
goto out_no_shrink;
}
@@ -1532,7 +1532,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev)
man->use_type = false;
if ((i != TTM_PL_SYSTEM) && ttm_bo_clean_mm(bdev, i)) {
ret = -EBUSY;
- printf("DRM memory manager type %d is not clean\n",
+ pr_err("DRM memory manager type %d is not clean\n",
i);
}
man->has_type = false;
diff --git a/sys/dev/pci/drm/ttm/ttm_bo_vm.c b/sys/dev/pci/drm/ttm/ttm_bo_vm.c
index f01f3554957..e0b9a887e80 100644
--- a/sys/dev/pci/drm/ttm/ttm_bo_vm.c
+++ b/sys/dev/pci/drm/ttm/ttm_bo_vm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttm_bo_vm.c,v 1.4 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: ttm_bo_vm.c,v 1.5 2015/02/11 07:01:37 jsg Exp $ */
/**************************************************************************
*
* Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
@@ -312,7 +312,7 @@ ttm_bo_mmap(voff_t off, vsize_t size, struct ttm_bo_device *bdev)
read_unlock(&bdev->vm_lock);
if (unlikely(bo == NULL)) {
-// pr_err("Could not find buffer object to map\n");
+ pr_err("Could not find buffer object to map\n");
return NULL;
}
diff --git a/sys/dev/pci/drm/ttm/ttm_memory.c b/sys/dev/pci/drm/ttm/ttm_memory.c
index 9c0c56a8f3b..e978e58306e 100644
--- a/sys/dev/pci/drm/ttm/ttm_memory.c
+++ b/sys/dev/pci/drm/ttm/ttm_memory.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttm_memory.c,v 1.7 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: ttm_memory.c,v 1.8 2015/02/11 07:01:37 jsg Exp $ */
/**************************************************************************
*
* Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
@@ -73,7 +73,7 @@ static struct attribute ttm_mem_used = {
static void ttm_mem_zone_kobj_release(struct ttm_mem_zone *zone)
{
- DRM_INFO("Zone %7s: Used memory at exit: %llu kiB\n",
+ pr_info("Zone %7s: Used memory at exit: %llu kiB\n",
zone->name, (unsigned long long)zone->used_mem >> 10);
kfree(zone);
}
@@ -359,7 +359,7 @@ int ttm_mem_global_init(struct ttm_mem_global *glob)
#ifdef DRMDEBUG
for (i = 0; i < glob->num_zones; ++i) {
zone = glob->zones[i];
- DRM_INFO("Zone %7s: Available graphics memory: %llu kiB\n",
+ pr_info("Zone %7s: Available graphics memory: %llu kiB\n",
zone->name, (unsigned long long)zone->max_mem >> 10);
}
#endif
diff --git a/sys/dev/pci/drm/ttm/ttm_object.c b/sys/dev/pci/drm/ttm/ttm_object.c
index 9456e7b95d8..a820c000c12 100644
--- a/sys/dev/pci/drm/ttm/ttm_object.c
+++ b/sys/dev/pci/drm/ttm/ttm_object.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttm_object.c,v 1.4 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: ttm_object.c,v 1.5 2015/02/11 07:01:37 jsg Exp $ */
/**************************************************************************
*
* Copyright (c) 2009 VMware, Inc., Palo Alto, CA., USA
@@ -230,7 +230,7 @@ struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file *tfile,
return NULL;
if (tfile != base->tfile && !base->shareable) {
- DRM_ERROR("Attempted access of non-shareable object\n");
+ pr_err("Attempted access of non-shareable object\n");
ttm_base_object_unref(&base);
return NULL;
}
diff --git a/sys/dev/pci/drm/ttm/ttm_page_alloc.c b/sys/dev/pci/drm/ttm/ttm_page_alloc.c
index e5a8264237c..b2cb2f3e857 100644
--- a/sys/dev/pci/drm/ttm/ttm_page_alloc.c
+++ b/sys/dev/pci/drm/ttm/ttm_page_alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttm_page_alloc.c,v 1.7 2015/02/10 10:50:49 jsg Exp $ */
+/* $OpenBSD: ttm_page_alloc.c,v 1.8 2015/02/11 07:01:37 jsg Exp $ */
/*
* Copyright (c) Red Hat Inc.
@@ -316,7 +316,7 @@ static void ttm_pages_put(struct vm_page *pages[], unsigned npages)
{
unsigned i;
if (set_pages_array_wb(pages, npages))
- printf("Failed to set %d pages to wb!\n", npages);
+ pr_err("Failed to set %d pages to wb!\n", npages);
for (i = 0; i < npages; ++i)
ttm_uvm_free_page(pages[i]);
}
@@ -352,7 +352,7 @@ static int ttm_page_pool_free(struct ttm_page_pool *pool, unsigned nr_free)
pages_to_free = kmalloc(npages_to_free * sizeof(struct vm_page *),
GFP_KERNEL);
if (!pages_to_free) {
- printf("Failed to allocate memory for pool free operation\n");
+ pr_err("Failed to allocate memory for pool free operation\n");
return 0;
}
@@ -485,12 +485,12 @@ static int ttm_set_pages_caching(struct vm_page **pages,
case tt_uncached:
r = set_pages_array_uc(pages, cpages);
if (r)
- printf("Failed to set %d pages to uc!\n", cpages);
+ pr_err("Failed to set %d pages to uc!\n", cpages);
break;
case tt_wc:
r = set_pages_array_wc(pages, cpages);
if (r)
- printf("Failed to set %d pages to wc!\n", cpages);
+ pr_err("Failed to set %d pages to wc!\n", cpages);
break;
default:
break;
@@ -535,7 +535,7 @@ static int ttm_alloc_new_pages(struct pglist *pages, int gfp_flags,
caching_array = kmalloc(max_cpages*sizeof(struct vm_page *), GFP_KERNEL);
if (!caching_array) {
- printf("Unable to allocate table for new pages\n");
+ pr_err("Unable to allocate table for new pages\n");
return -ENOMEM;
}
@@ -543,7 +543,7 @@ static int ttm_alloc_new_pages(struct pglist *pages, int gfp_flags,
p = ttm_uvm_alloc_page();
if (!p) {
- printf("Unable to get page %u\n", i);
+ pr_err("Unable to get page %u\n", i);
/* store already allocated pages in the pool after
* setting the caching state */
@@ -641,7 +641,7 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
++pool->nrefills;
pool->npages += alloc_size;
} else {
- DRM_ERROR("Failed to fill pool (%p)\n", pool);
+ pr_err("Failed to fill pool (%p)\n", pool);
/* If we have any pages left put them to the pool. */
TAILQ_FOREACH(p, &pool->list, pageq) {
++cpages;
@@ -766,7 +766,7 @@ static int ttm_get_pages(struct vm_page **pages, unsigned npages, int flags,
p = ttm_uvm_alloc_page();
if (!p) {
- printf("ttm: Unable to allocate page\n");
+ pr_err("Unable to allocate page\n");
return -ENOMEM;
}
@@ -806,7 +806,7 @@ static int ttm_get_pages(struct vm_page **pages, unsigned npages, int flags,
if (r) {
/* If there is any pages in the list put them back to
* the pool. */
- printf("ttm: Failed to allocate extra pages for large request\n");
+ pr_err("Failed to allocate extra pages for large request\n");
ttm_put_pages(pages, count, flags, cstate);
return r;
}
@@ -830,7 +830,7 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages)
{
WARN_ON(_manager);
- DRM_DEBUG("Initializing pool allocator\n");
+ pr_info("Initializing pool allocator\n");
_manager = kzalloc(sizeof(*_manager), GFP_KERNEL);
@@ -858,7 +858,7 @@ void ttm_page_alloc_fini(void)
{
int i;
- printf("Finalizing pool allocator\n");
+ pr_info("Finalizing pool allocator\n");
ttm_pool_mm_shrink_fini(_manager);
for (i = 0; i < NUM_POOLS; ++i)
diff --git a/sys/dev/pci/drm/ttm/ttm_tt.c b/sys/dev/pci/drm/ttm/ttm_tt.c
index 4bee3414812..d03e74a7c55 100644
--- a/sys/dev/pci/drm/ttm/ttm_tt.c
+++ b/sys/dev/pci/drm/ttm/ttm_tt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttm_tt.c,v 1.3 2014/02/10 02:11:02 jsg Exp $ */
+/* $OpenBSD: ttm_tt.c,v 1.4 2015/02/11 07:01:37 jsg Exp $ */
/**************************************************************************
*
* Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
@@ -196,7 +196,7 @@ int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev,
ttm_tt_alloc_page_directory(ttm);
if (!ttm->pages) {
ttm_tt_destroy(ttm);
- DRM_ERROR("Failed allocating page table\n");
+ pr_err("Failed allocating page table\n");
return -ENOMEM;
}
return 0;
@@ -229,7 +229,7 @@ int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev,
ttm_dma_tt_alloc_page_directory(ttm_dma);
if (!ttm->pages || !ttm_dma->dma_address) {
ttm_tt_destroy(ttm);
- DRM_ERROR("Failed allocating page table\n");
+ pr_err("Failed allocating page table\n");
return -ENOMEM;
}
return 0;