提交 56cbcb6c 编写于 作者: G Gerd Hoffmann
上级 33d930e5
...@@ -219,7 +219,7 @@ int qxl_garbage_collect(struct qxl_device *qdev) ...@@ -219,7 +219,7 @@ int qxl_garbage_collect(struct qxl_device *qdev)
union qxl_release_info *info; union qxl_release_info *info;
while (qxl_ring_pop(qdev->release_ring, &id)) { while (qxl_ring_pop(qdev->release_ring, &id)) {
QXL_INFO(qdev, "popped %lld\n", id); DRM_DEBUG_DRIVER("popped %lld\n", id);
while (id) { while (id) {
release = qxl_release_from_id_locked(qdev, id); release = qxl_release_from_id_locked(qdev, id);
if (release == NULL) if (release == NULL)
...@@ -229,7 +229,7 @@ int qxl_garbage_collect(struct qxl_device *qdev) ...@@ -229,7 +229,7 @@ int qxl_garbage_collect(struct qxl_device *qdev)
next_id = info->next; next_id = info->next;
qxl_release_unmap(qdev, release, info); qxl_release_unmap(qdev, release, info);
QXL_INFO(qdev, "popped %lld, next %lld\n", id, DRM_DEBUG_DRIVER("popped %lld, next %lld\n", id,
next_id); next_id);
switch (release->type) { switch (release->type) {
...@@ -248,7 +248,7 @@ int qxl_garbage_collect(struct qxl_device *qdev) ...@@ -248,7 +248,7 @@ int qxl_garbage_collect(struct qxl_device *qdev)
} }
} }
QXL_INFO(qdev, "%s: %d\n", __func__, i); DRM_DEBUG_DRIVER("%d\n", i);
return i; return i;
} }
...@@ -381,8 +381,7 @@ void qxl_io_create_primary(struct qxl_device *qdev, ...@@ -381,8 +381,7 @@ void qxl_io_create_primary(struct qxl_device *qdev,
{ {
struct qxl_surface_create *create; struct qxl_surface_create *create;
QXL_INFO(qdev, "%s: qdev %p, ram_header %p\n", __func__, qdev, DRM_DEBUG_DRIVER("qdev %p, ram_header %p\n", qdev, qdev->ram_header);
qdev->ram_header);
create = &qdev->ram_header->create_surface; create = &qdev->ram_header->create_surface;
create->format = bo->surf.format; create->format = bo->surf.format;
create->width = bo->surf.width; create->width = bo->surf.width;
...@@ -390,8 +389,7 @@ void qxl_io_create_primary(struct qxl_device *qdev, ...@@ -390,8 +389,7 @@ void qxl_io_create_primary(struct qxl_device *qdev,
create->stride = bo->surf.stride; create->stride = bo->surf.stride;
create->mem = qxl_bo_physical_address(qdev, bo, offset); create->mem = qxl_bo_physical_address(qdev, bo, offset);
QXL_INFO(qdev, "%s: mem = %llx, from %p\n", __func__, create->mem, DRM_DEBUG_DRIVER("mem = %llx, from %p\n", create->mem, bo->kptr);
bo->kptr);
create->flags = QXL_SURF_FLAG_KEEP_DATA; create->flags = QXL_SURF_FLAG_KEEP_DATA;
create->type = QXL_SURF_TYPE_PRIMARY; create->type = QXL_SURF_TYPE_PRIMARY;
...@@ -401,7 +399,7 @@ void qxl_io_create_primary(struct qxl_device *qdev, ...@@ -401,7 +399,7 @@ void qxl_io_create_primary(struct qxl_device *qdev,
void qxl_io_memslot_add(struct qxl_device *qdev, uint8_t id) void qxl_io_memslot_add(struct qxl_device *qdev, uint8_t id)
{ {
QXL_INFO(qdev, "qxl_memslot_add %d\n", id); DRM_DEBUG_DRIVER("qxl_memslot_add %d\n", id);
wait_for_io_cmd(qdev, id, QXL_IO_MEMSLOT_ADD_ASYNC); wait_for_io_cmd(qdev, id, QXL_IO_MEMSLOT_ADD_ASYNC);
} }
......
...@@ -62,33 +62,9 @@ ...@@ -62,33 +62,9 @@
#define QXL_DEBUGFS_MAX_COMPONENTS 32 #define QXL_DEBUGFS_MAX_COMPONENTS 32
extern int qxl_log_level;
extern int qxl_num_crtc; extern int qxl_num_crtc;
extern int qxl_max_ioctls; extern int qxl_max_ioctls;
enum {
QXL_INFO_LEVEL = 1,
QXL_DEBUG_LEVEL = 2,
};
#define QXL_INFO(qdev, fmt, ...) do { \
if (qxl_log_level >= QXL_INFO_LEVEL) { \
qxl_io_log(qdev, fmt, __VA_ARGS__); \
} \
} while (0)
#define QXL_DEBUG(qdev, fmt, ...) do { \
if (qxl_log_level >= QXL_DEBUG_LEVEL) { \
qxl_io_log(qdev, fmt, __VA_ARGS__); \
} \
} while (0)
#define QXL_INFO_ONCE(qdev, fmt, ...) do { \
static int done; \
if (!done) { \
done = 1; \
QXL_INFO(qdev, fmt, __VA_ARGS__); \
} \
} while (0)
#define DRM_FILE_OFFSET 0x100000000ULL #define DRM_FILE_OFFSET 0x100000000ULL
#define DRM_FILE_PAGE_OFFSET (DRM_FILE_OFFSET >> PAGE_SHIFT) #define DRM_FILE_PAGE_OFFSET (DRM_FILE_OFFSET >> PAGE_SHIFT)
...@@ -351,7 +327,7 @@ int qxl_check_idle(struct qxl_ring *ring); ...@@ -351,7 +327,7 @@ int qxl_check_idle(struct qxl_ring *ring);
static inline void * static inline void *
qxl_fb_virtual_address(struct qxl_device *qdev, unsigned long physical) qxl_fb_virtual_address(struct qxl_device *qdev, unsigned long physical)
{ {
QXL_INFO(qdev, "not implemented (%lu)\n", physical); DRM_DEBUG_DRIVER("not implemented (%lu)\n", physical);
return 0; return 0;
} }
......
...@@ -240,18 +240,15 @@ static int qxlfb_create(struct qxl_fbdev *qfbdev, ...@@ -240,18 +240,15 @@ static int qxlfb_create(struct qxl_fbdev *qfbdev,
return ret; return ret;
qbo = gem_to_qxl_bo(gobj); qbo = gem_to_qxl_bo(gobj);
QXL_INFO(qdev, "%s: %dx%d %d\n", __func__, mode_cmd.width, DRM_DEBUG_DRIVER("%dx%d %d\n", mode_cmd.width,
mode_cmd.height, mode_cmd.pitches[0]); mode_cmd.height, mode_cmd.pitches[0]);
shadow = vmalloc(mode_cmd.pitches[0] * mode_cmd.height); shadow = vmalloc(mode_cmd.pitches[0] * mode_cmd.height);
/* TODO: what's the usual response to memory allocation errors? */ /* TODO: what's the usual response to memory allocation errors? */
BUG_ON(!shadow); BUG_ON(!shadow);
QXL_INFO(qdev, DRM_DEBUG_DRIVER("surface0 at gpu offset %lld, mmap_offset %lld (virt %p, shadow %p)\n",
"surface0 at gpu offset %lld, mmap_offset %lld (virt %p, shadow %p)\n", qxl_bo_gpu_offset(qbo), qxl_bo_mmap_offset(qbo),
qxl_bo_gpu_offset(qbo), qbo->kptr, shadow);
qxl_bo_mmap_offset(qbo),
qbo->kptr,
shadow);
size = mode_cmd.pitches[0] * mode_cmd.height; size = mode_cmd.pitches[0] * mode_cmd.height;
info = drm_fb_helper_alloc_fbi(&qfbdev->helper); info = drm_fb_helper_alloc_fbi(&qfbdev->helper);
......
...@@ -154,7 +154,7 @@ qxl_release_alloc(struct qxl_device *qdev, int type, ...@@ -154,7 +154,7 @@ qxl_release_alloc(struct qxl_device *qdev, int type,
return handle; return handle;
} }
*ret = release; *ret = release;
QXL_INFO(qdev, "allocated release %d\n", handle); DRM_DEBUG_DRIVER("allocated release %d\n", handle);
release->id = handle; release->id = handle;
return handle; return handle;
} }
...@@ -179,8 +179,7 @@ void ...@@ -179,8 +179,7 @@ void
qxl_release_free(struct qxl_device *qdev, qxl_release_free(struct qxl_device *qdev,
struct qxl_release *release) struct qxl_release *release)
{ {
QXL_INFO(qdev, "release %d, type %d\n", release->id, DRM_DEBUG_DRIVER("release %d, type %d\n", release->id, release->type);
release->type);
if (release->surface_release_id) if (release->surface_release_id)
qxl_surface_id_dealloc(qdev, release->surface_release_id); qxl_surface_id_dealloc(qdev, release->surface_release_id);
......
...@@ -136,8 +136,8 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma) ...@@ -136,8 +136,8 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
"filp->private_data->minor->dev->dev_private == NULL\n"); "filp->private_data->minor->dev->dev_private == NULL\n");
return -EINVAL; return -EINVAL;
} }
QXL_INFO(qdev, "%s: filp->private_data = 0x%p, vma->vm_pgoff = %lx\n", DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n",
__func__, filp->private_data, vma->vm_pgoff); filp->private_data, vma->vm_pgoff);
r = ttm_bo_mmap(filp, vma, &qdev->mman.bdev); r = ttm_bo_mmap(filp, vma, &qdev->mman.bdev);
if (unlikely(r != 0)) if (unlikely(r != 0))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册