drm/i915/cmd_parser: conversion to struct drm_device logging macros.
authorWambui Karuga <wambui.karugax@gmail.com>
Fri, 31 Jan 2020 09:34:14 +0000 (12:34 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 4 Feb 2020 09:29:40 +0000 (11:29 +0200)
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.html
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200131093416.28431-4-wambui.karugax@gmail.com
drivers/gpu/drm/i915/i915_cmd_parser.c

index a0e437a..189b573 100644 (file)
@@ -803,10 +803,11 @@ static bool validate_cmds_sorted(const struct intel_engine_cs *engine,
                        u32 curr = desc->cmd.value & desc->cmd.mask;
 
                        if (curr < previous) {
-                               DRM_ERROR("CMD: %s [%d] command table not sorted: "
-                                         "table=%d entry=%d cmd=0x%08X prev=0x%08X\n",
-                                         engine->name, engine->id,
-                                         i, j, curr, previous);
+                               drm_err(&engine->i915->drm,
+                                       "CMD: %s [%d] command table not sorted: "
+                                       "table=%d entry=%d cmd=0x%08X prev=0x%08X\n",
+                                       engine->name, engine->id,
+                                       i, j, curr, previous);
                                ret = false;
                        }
 
@@ -829,10 +830,11 @@ static bool check_sorted(const struct intel_engine_cs *engine,
                u32 curr = i915_mmio_reg_offset(reg_table[i].addr);
 
                if (curr < previous) {
-                       DRM_ERROR("CMD: %s [%d] register table not sorted: "
-                                 "entry=%d reg=0x%08X prev=0x%08X\n",
-                                 engine->name, engine->id,
-                                 i, curr, previous);
+                       drm_err(&engine->i915->drm,
+                               "CMD: %s [%d] register table not sorted: "
+                               "entry=%d reg=0x%08X prev=0x%08X\n",
+                               engine->name, engine->id,
+                               i, curr, previous);
                        ret = false;
                }
 
@@ -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)) {
-               DRM_ERROR("%s: command descriptions are not sorted\n",
-                         engine->name);
+               drm_err(&engine->i915->drm,
+                       "%s: command descriptions are not sorted\n",
+                       engine->name);
                return;
        }
        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;
        }
 
        ret = init_hash_table(engine, cmd_tables, cmd_table_count);
        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);
                return;
        }