Commit 0c4336b9 authored by Wambui Karuga's avatar Wambui Karuga Committed by Jani Nikula

drm/i915/cmd_parser: conversion to struct drm_device logging macros.

Manually convert printk based drm logging macros to the struct
drm_device based logging macros in i915/i915_cmd_parser.c.
This also involves extracting the drm_i915_private device from various
intel types for use in the macros.

Instances of the DRM_DEBUG macro are not converted due to the lack of a
similar struct drm_device based logging macro.

References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.htmlSigned-off-by: default avatarWambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200131093416.28431-4-wambui.karugax@gmail.com
parent 6db07ce4
...@@ -803,10 +803,11 @@ static bool validate_cmds_sorted(const struct intel_engine_cs *engine, ...@@ -803,10 +803,11 @@ static bool validate_cmds_sorted(const struct intel_engine_cs *engine,
u32 curr = desc->cmd.value & desc->cmd.mask; u32 curr = desc->cmd.value & desc->cmd.mask;
if (curr < previous) { if (curr < previous) {
DRM_ERROR("CMD: %s [%d] command table not sorted: " drm_err(&engine->i915->drm,
"table=%d entry=%d cmd=0x%08X prev=0x%08X\n", "CMD: %s [%d] command table not sorted: "
engine->name, engine->id, "table=%d entry=%d cmd=0x%08X prev=0x%08X\n",
i, j, curr, previous); engine->name, engine->id,
i, j, curr, previous);
ret = false; ret = false;
} }
...@@ -829,10 +830,11 @@ static bool check_sorted(const struct intel_engine_cs *engine, ...@@ -829,10 +830,11 @@ static bool check_sorted(const struct intel_engine_cs *engine,
u32 curr = i915_mmio_reg_offset(reg_table[i].addr); u32 curr = i915_mmio_reg_offset(reg_table[i].addr);
if (curr < previous) { if (curr < previous) {
DRM_ERROR("CMD: %s [%d] register table not sorted: " drm_err(&engine->i915->drm,
"entry=%d reg=0x%08X prev=0x%08X\n", "CMD: %s [%d] register table not sorted: "
engine->name, engine->id, "entry=%d reg=0x%08X prev=0x%08X\n",
i, curr, previous); engine->name, engine->id,
i, curr, previous);
ret = false; ret = false;
} }
...@@ -1010,18 +1012,21 @@ void intel_engine_init_cmd_parser(struct intel_engine_cs *engine) ...@@ -1010,18 +1012,21 @@ void intel_engine_init_cmd_parser(struct intel_engine_cs *engine)
} }
if (!validate_cmds_sorted(engine, cmd_tables, cmd_table_count)) { if (!validate_cmds_sorted(engine, cmd_tables, cmd_table_count)) {
DRM_ERROR("%s: command descriptions are not sorted\n", drm_err(&engine->i915->drm,
engine->name); "%s: command descriptions are not sorted\n",
engine->name);
return; return;
} }
if (!validate_regs_sorted(engine)) { if (!validate_regs_sorted(engine)) {
DRM_ERROR("%s: registers are not sorted\n", engine->name); drm_err(&engine->i915->drm,
"%s: registers are not sorted\n", engine->name);
return; return;
} }
ret = init_hash_table(engine, cmd_tables, cmd_table_count); ret = init_hash_table(engine, cmd_tables, cmd_table_count);
if (ret) { if (ret) {
DRM_ERROR("%s: initialised failed!\n", engine->name); drm_err(&engine->i915->drm,
"%s: initialised failed!\n", engine->name);
fini_hash_table(engine); fini_hash_table(engine);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment